Skip to content

Commit 1634fbf

Browse files
keithamuslangermank
andcommitted
prepare for release
Co-authored-by: langermank <[email protected]>
1 parent 460ad71 commit 1634fbf

File tree

7 files changed

+57
-50
lines changed

7 files changed

+57
-50
lines changed

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# &lt;custom-element&gt; element
1+
# &lt;blink-text&gt; element
22

3-
Boilerplate for creating a custom element.
3+
An element which blinks in and out to try to get the users attention like the traditional blink element found in the browsers of yesteryear
44

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

1111
## Usage
@@ -15,22 +15,19 @@ $ npm install --save @github/custom-element-element
1515
Import as ES modules:
1616

1717
```js
18-
import '@github/custom-element-element'
18+
import 'blink-text-element'
1919
```
2020

2121
Include with a script tag:
2222

2323
```html
24-
<script type="module" src="./node_modules/@github/custom-element-element/dist/index.js">
24+
<script type="module" src="./node_modules/blink-text-element/dist/index.js">
2525
```
2626
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-
```
33-
<custom-element></custom-element>
27+
```html
28+
<blink-text>
29+
This text will blink!
30+
</blink-text>
3431
```
3532
3633
## Browser support

custom-elements.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@
44
"modules": [
55
{
66
"kind": "javascript-module",
7-
"path": "src/custom-element.ts",
7+
"path": "src/blink-text-element.ts",
88
"declarations": [
99
{
1010
"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",
11+
"description": "```html\n<blink-text>\n This text will blink!\n</blink-text>\n```",
12+
"name": "BlinkTextElement",
13+
"members": [
14+
{
15+
"kind": "field",
16+
"name": "#renderRoot",
17+
"privacy": "private"
18+
}
19+
],
1320
"superclass": {
1421
"name": "HTMLElement"
1522
},
16-
"tagName": "custom-element",
23+
"tagName": "blink-text",
1724
"customElement": true
1825
}
1926
],
@@ -22,16 +29,16 @@
2229
"kind": "js",
2330
"name": "default",
2431
"declaration": {
25-
"name": "CustomElementElement",
26-
"module": "src/custom-element.ts"
32+
"name": "BlinkTextElement",
33+
"module": "src/blink-text-element.ts"
2734
}
2835
},
2936
{
3037
"kind": "custom-element-definition",
31-
"name": "custom-element",
38+
"name": "blink-text",
3239
"declaration": {
33-
"name": "CustomElementElement",
34-
"module": "src/custom-element.ts"
40+
"name": "BlinkTextElement",
41+
"module": "src/blink-text-element.ts"
3542
}
3643
}
3744
]

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"name": "@github/custom-element-element",
2+
"name": "blink-text-element",
33
"version": "0.0.1",
4-
"description": "Boilerplate for creating a custom element.",
5-
"main": "dist/custom-element.js",
6-
"module": "dist/custom-element.js",
4+
"description": "An element which blinks in and out to try to get the users attention like the traditional blink element found in the browsers of yesteryear",
5+
"main": "dist/blink-text-element.js",
6+
"module": "dist/blink-text-element.js",
77
"type": "module",
8-
"types": "dist/custom-elements.d.ts",
8+
"types": "dist/blink-text-elements.d.ts",
99
"license": "MIT",
10-
"repository": "github/custom-element-boilerplate",
10+
"repository": "24webcomponents/blink-text-element",
1111
"files": [
1212
"dist"
1313
],
1414
"scripts": {
15+
"meta": "custom-elements-manifest analyze",
1516
"clean": "rm -rf dist",
1617
"lint": "eslint . --ext .ts,.js",
1718
"prebuild": "npm run clean && npm run lint && mkdir dist",
1819
"build": "tsc",
1920
"pretest": "npm run build",
2021
"test": "web-test-runner \"test/**/*\" --node-resolve",
2122
"start": "web-dev-server --node-resolve --open --watch --app-index=examples/index.html --root-dir=. --esbuild-target auto",
22-
"prepublishOnly": "npm run build",
23-
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'"
23+
"prepublishOnly": "npm run build"
2424
},
2525
"prettier": "@github/prettier-config",
2626
"devDependencies": {

src/blink-text-element.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
/**
2+
* ```html
3+
* <blink-text>
4+
* This text will blink!
5+
* </blink-text>
6+
* ```
7+
*/
18
class BlinkTextElement extends HTMLElement {
29
#renderRoot = this.attachShadow({mode: 'open'})
310

411
connectedCallback(): void {
12+
// eslint-disable-next-line github/no-inner-html
513
this.#renderRoot.innerHTML = `
614
<style>
715
:host {

test/test.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
import {assert, fixture, html} from '@open-wc/testing'
2-
import '../src/custom-element'
1+
import {assert} from '@open-wc/testing'
2+
import '../src/blink-text-element'
33

4-
describe('custom-element', function () {
4+
describe('blink-text-element', function () {
55
describe('element creation', function () {
66
it('creates from document.createElement', function () {
7-
const el = document.createElement('custom-element')
8-
assert.equal('CUSTOM-ELEMENT', el.nodeName)
7+
const el = document.createElement('blink-text')
8+
assert.equal('BLINK-TEXT', el.nodeName)
99
})
1010

1111
it('creates from constructor', function () {
12-
const el = new window.CustomElementElement()
13-
assert.equal('CUSTOM-ELEMENT', el.nodeName)
14-
})
15-
})
16-
17-
describe('after tree insertion', function () {
18-
beforeEach(async function () {
19-
await fixture(html` <custom-element></custom-element>`)
20-
})
21-
22-
it('initiates', function () {
23-
const ce = document.querySelector('custom-element')
24-
assert.equal(ce?.textContent, ':wave:')
12+
const el = new window.BlinkTextElement()
13+
assert.equal('BLINK-TEXT', el.nodeName)
2514
})
2615
})
2716
})

vscode.css-custom-data.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": 1.1,
3+
"properties": [],
4+
"pseudoElements": []
5+
}

vscode.html-custom-data.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2+
"version": 1.1,
23
"tags": [
34
{
4-
"name": "custom-element",
5-
"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```",
5+
"name": "blink-text",
6+
"description": "```html\n<blink-text>\n This text will blink!\n</blink-text>\n```",
67
"attributes": []
78
}
89
]

0 commit comments

Comments
 (0)