Skip to content

Commit

Permalink
docs: generated READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Jul 11, 2021
1 parent c1876da commit 1c68a95
Show file tree
Hide file tree
Showing 14 changed files with 1,125 additions and 3 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"type": "module",
"scripts": {
"analyze": "node scripts/workspaces-scripts-bin.mjs analyze",
"build": "npm run build:packages && npm run build:site",
"build:packages": "node scripts/workspaces-scripts-bin.mjs build:package",
"build:site": "npm run rocket:build",
Expand Down Expand Up @@ -45,6 +46,7 @@
},
"devDependencies": {
"@changesets/cli": "^2.12.0",
"@custom-elements-manifest/analyzer": "^0.4.11",
"@open-wc/testing": "^3.0.0-next.1",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-json": "^4.1.0",
Expand All @@ -59,6 +61,7 @@
"@web/test-runner": "^0.12.2",
"@web/test-runner-commands": "^0.4.0",
"@web/test-runner-playwright": "^0.8.0",
"cem-plugin-readme": "^0.1.2",
"chai": "^4.2.0",
"concurrently": "^5.3.0",
"copyfiles": "^2.4.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/launch/README.head.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Launch Preset for Rocket

For docs please see our homepage [https://rocket.modern-web.dev/docs/presets/launch/](https://rocket.modern-web.dev/docs/presets/launch/).
54 changes: 54 additions & 0 deletions packages/launch/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
# Launch Preset for Rocket

For docs please see our homepage [https://rocket.modern-web.dev/docs/presets/launch/](https://rocket.modern-web.dev/docs/presets/launch/).


## `inline-notification/index.js`:

### class: `InlineNotification`, `inline-notification`

#### Superclass

| Name | Module | Package |
| ---------- | ------ | ----------- |
| LitElement | | lit-element |

#### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ----- | ------- | ---------------------------- | ------- | ----------- | -------------- |
| title | public | `string` | `''` | | |
| type | public | `'tip'\|'warning'\|'danger'` | `'tip'` | | |

#### Attributes

| Name | Field | Inherited From |
| ----- | ----- | -------------- |
| type | type | |
| title | title | |

#### CSS Properties

| Name | Description |
| ---------------------------------------------- | ----------- |
| --inline-notification-tip-background-color | |
| --inline-notification-tip-border-color | |
| --inline-notification-warning-background-color | |
| --inline-notification-warning-border-color | |
| --inline-notification-danger-background-color | |
| --inline-notification-danger-border-color | |
| --inline-notification-warning-heading-color | |
| --inline-notification-danger-heading-color | |

<hr/>

### Exports

| Kind | Name | Declaration | Module | Package |
| ---- | ------------------ | ------------------ | ---------------------------- | ------- |
| js | InlineNotification | InlineNotification | inline-notification/index.js | |

## `inline-notification/inline-notification.js`:

### Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | ------------------- | ------------------ | ----------------------------- | ------- |
| custom-element-definition | inline-notification | InlineNotification | /inline-notification/index.js | |
13 changes: 13 additions & 0 deletions packages/launch/custom-elements-manifest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { readmePlugin } from 'cem-plugin-readme';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

export default {
globs: ['inline-notification/*.js'],
plugins: [
readmePlugin({
from: dirname(fileURLToPath(import.meta.url)),
header: 'README.head.md',
}),
],
};
121 changes: 121 additions & 0 deletions packages/launch/custom-elements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"schemaVersion": "1.0.0",
"readme": "",
"modules": [
{
"kind": "javascript-module",
"path": "inline-notification/index.js",
"declarations": [
{
"kind": "class",
"description": "",
"name": "InlineNotification",
"cssProperties": [
{
"name": "--inline-notification-tip-background-color",
"default": "rgba(221, 221, 221, 0.3)"
},
{
"name": "--inline-notification-tip-border-color",
"default": "#42b983"
},
{
"name": "--inline-notification-warning-background-color",
"default": "rgba(255, 229, 100, 0.2)"
},
{
"name": "--inline-notification-warning-border-color",
"default": "#e7c000"
},
{
"name": "--inline-notification-danger-background-color",
"default": "rgba(192, 0, 0, 0.1)"
},
{
"name": "--inline-notification-danger-border-color",
"default": "#c00"
},
{
"name": "--inline-notification-warning-heading-color",
"default": "#b29400"
},
{
"name": "--inline-notification-danger-heading-color",
"default": "#900"
}
],
"cssParts": [
{
"description": "the title heading",
"name": "title"
}
],
"members": [
{
"kind": "field",
"name": "title",
"type": {
"text": "string"
},
"default": "''",
"privacy": "public",
"attribute": "title"
},
{
"kind": "field",
"name": "type",
"type": {
"text": "'tip'|'warning'|'danger'"
},
"default": "'tip'",
"privacy": "public",
"attribute": "type",
"reflects": true
}
],
"attributes": [
{
"name": "type",
"fieldName": "type"
},
{
"name": "title",
"fieldName": "title"
}
],
"superclass": {
"name": "LitElement",
"package": "lit-element"
},
"tagName": "inline-notification",
"customElement": true
}
],
"exports": [
{
"kind": "js",
"name": "InlineNotification",
"declaration": {
"name": "InlineNotification",
"module": "inline-notification/index.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "inline-notification/inline-notification.js",
"declarations": [],
"exports": [
{
"kind": "custom-element-definition",
"name": "inline-notification",
"declaration": {
"name": "InlineNotification",
"module": "/inline-notification/index.js"
}
}
]
}
]
}
15 changes: 14 additions & 1 deletion packages/launch/inline-notification/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { LitElement, css, html } from 'lit-element';

/**
* @element inline-notification
* @cssprop [--inline-notification-tip-background-color=rgba(221, 221, 221, 0.3)]
* @cssprop [--inline-notification-tip-border-color=#42b983]
* @cssprop [--inline-notification-warning-background-color=rgba(255, 229, 100, 0.2)]
* @cssprop [--inline-notification-warning-border-color=#e7c000]
* @cssprop [--inline-notification-danger-background-color=rgba(192, 0, 0, 0.1)]
* @cssprop [--inline-notification-danger-border-color=#c00]
* @cssprop [--inline-notification-warning-heading-color=#b29400]
* @cssprop [--inline-notification-danger-heading-color=#900]
* @csspart title - the title heading
*/
export class InlineNotification extends LitElement {
static get properties() {
return {
Expand All @@ -11,6 +23,7 @@ export class InlineNotification extends LitElement {
constructor() {
super();
this.title = '';
/** @type {'tip'|'warning'|'danger'} */
this.type = 'tip';
}

Expand Down Expand Up @@ -64,7 +77,7 @@ export class InlineNotification extends LitElement {

render() {
return html`
<h3>${this.title ? this.title : this.type}</h3>
<h3 part="title">${this.title || this.type}</h3>
<slot></slot>
`;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/launch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"./inline-notification/inline-notification.js": "./inline-notification/inline-notification.js"
},
"scripts": {
"analyze": "cem analyze --litelement",
"test": "mocha --timeout 5000 test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test"
},
Expand All @@ -37,5 +38,6 @@
"dependencies": {
"@rocket/drawer": "^0.1.3",
"@rocket/navigation": "^0.2.1"
}
},
"customElements": "custom-elements.json"
}
5 changes: 5 additions & 0 deletions packages/search/README.head.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rocket Search

Add a search for all your static content.

For docs please see our homepage [https://rocket.modern-web.dev/docs/presets/search/](https://rocket.modern-web.dev/docs/presets/search/).
Loading

0 comments on commit 1c68a95

Please sign in to comment.