Skip to content

Commit f1656b5

Browse files
authored
Merge pull request #38 from github/cem
Custom Element Manifest
2 parents 541bb33 + ec62988 commit f1656b5

File tree

7 files changed

+368
-19
lines changed

7 files changed

+368
-19
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,47 @@
33
Boilerplate for creating a custom element.
44

55
## Installation
6-
6+
Available on [npm](https://www.npmjs.com/) as [**@github/custom-element-element**](https://www.npmjs.com/package/@github/custom-element-element).
77
```
8-
$ npm install @github/custom-element-element
8+
$ npm install --save @github/custom-element-element
99
```
1010

1111
## Usage
1212

13+
### Script
14+
15+
Import as ES modules:
16+
1317
```js
1418
import '@github/custom-element-element'
1519
```
1620

21+
Include with a script tag:
22+
1723
```html
24+
<script type="module" src="./node_modules/@github/custom-element-element/dist/index.js">
25+
```
26+
27+
An example Custom Element. This documentation ends up in the
28+
README so describe how this elements works here.
29+
30+
You can event add examples on the element is used with Markdown.
31+
32+
```
1833
<custom-element></custom-element>
1934
```
2035
2136
## Browser support
2237
2338
Browsers without native [custom element support][support] require a [polyfill][].
24-
2539
- Chrome
2640
- Firefox
2741
- Safari
2842
- Microsoft Edge
2943
30-
[support]: https://caniuse.com/#feat=custom-elementsv1
44+
[support]: https://caniuse.com/custom-elementsv1
3145
[polyfill]: https://github.com/webcomponents/custom-elements
3246
33-
## Development
34-
35-
```
36-
npm install
37-
npm test
38-
```
39-
4047
## License
4148
42-
Distributed under the MIT license. See LICENSE for details.
49+
Distributed under the MIT license. See LICENSE for details.

custom-elements-manifest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {generateCustomData} from 'cem-plugin-vs-code-custom-data-generator'
2+
import {readme} from '@github/cem-plugin-readme'
3+
4+
export default {
5+
packagejson: true,
6+
globs: ['src/*-element.ts'],
7+
plugins: [readme(), generateCustomData()]
8+
}

custom-elements.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"schemaVersion": "1.0.0",
3+
"readme": "",
4+
"modules": [
5+
{
6+
"kind": "javascript-module",
7+
"path": "src/custom-element.ts",
8+
"declarations": [
9+
{
10+
"kind": "class",
11+
"description": "An example Custom Element. This documentation ends up in the\nREADME so describe how this elements works here.\n\nYou can event add examples on the element is used with Markdown.\n\n```\n<custom-element></custom-element>\n```",
12+
"name": "CustomElementElement",
13+
"superclass": {
14+
"name": "HTMLElement"
15+
},
16+
"tagName": "custom-element",
17+
"customElement": true
18+
}
19+
],
20+
"exports": [
21+
{
22+
"kind": "js",
23+
"name": "default",
24+
"declaration": {
25+
"name": "CustomElementElement",
26+
"module": "src/custom-element.ts"
27+
}
28+
},
29+
{
30+
"kind": "custom-element-definition",
31+
"name": "custom-element",
32+
"declaration": {
33+
"name": "CustomElementElement",
34+
"module": "src/custom-element.ts"
35+
}
36+
}
37+
]
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)