@blockquote/create-wc 1.3.0 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/package.json +1 -1
- package/src/common-linting/templates/package.json +2 -2
- package/src/common-repo/templates/gitignore +2 -1
- package/src/common-repo/templates/static/vite.config.js +11 -11
- package/src/common-testing-wtr/templates/static/web-test-runner.config.mjs +1 -0
- package/src/testing/templates/my-el.test.js +8 -8
- package/src/testing-ts/templates/my-el.test.ts +8 -8
- package/src/wc-lit-element/templates/MyEl.js +57 -0
- package/src/wc-lit-element/templates/my-el.js +3 -0
- package/src/wc-lit-element/templates/partials/README.demoing.md +13 -0
- package/src/wc-lit-element/templates/partials/README.linting.md +13 -0
- package/src/wc-lit-element/templates/partials/README.testing.md +13 -0
- package/src/wc-lit-element/templates/static/README.md +35 -0
- package/src/wc-lit-element/templates/static/demo/index.html +25 -0
- package/src/wc-lit-element/templates/static/index.js +1 -0
- package/src/wc-lit-element/templates/styles/MyEl-styles.js +20 -0
- package/src/wc-lit-element-ts/templates/MyEl.ts +46 -0
- package/src/wc-lit-element-ts/templates/my-el.ts +3 -0
- package/src/wc-lit-element-ts/templates/partials/README.demoing.md +13 -0
- package/src/wc-lit-element-ts/templates/partials/README.linting.md +13 -0
- package/src/wc-lit-element-ts/templates/partials/README.testing.md +13 -0
- package/src/wc-lit-element-ts/templates/static/README.md +35 -0
- package/src/wc-lit-element-ts/templates/static/demo/index.html +25 -0
- package/src/wc-lit-element-ts/templates/static/index.ts +1 -0
- package/src/wc-lit-element-ts/templates/styles/MyEl-styles.ts +20 -0
- package/src/wc-lit-element-ts/templates/tsconfig.json +27 -0
- package/CHANGELOG.md +0 -1
- package/src/testing-wtr/templates/static/_web-test-runner.config.mjs +0 -67
- package/src/testing-wtr-ts/templates/static/_web-test-runner.config.mjs +0 -67
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ This scaffold generator extends and customizes the core parts of [@open-wc/creat
|
|
|
18
18
|
- TypeScript
|
|
19
19
|
|
|
20
20
|
- ### [sass](https://github.com/oscarmarina/sass-style-template)
|
|
21
|
+
|
|
21
22
|
- SCSS watcher with autoprefixer
|
|
22
23
|
|
|
23
24
|
- ### miscellany
|
|
@@ -152,6 +153,17 @@ npm run sass:watch
|
|
|
152
153
|
<hr>
|
|
153
154
|
<br>
|
|
154
155
|
|
|
156
|
+
## TypeScript
|
|
157
|
+
|
|
158
|
+
### build ts
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
npm run build
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
<hr>
|
|
165
|
+
<br>
|
|
166
|
+
|
|
155
167
|
### Start:
|
|
156
168
|
|
|
157
169
|
#### `"start": "concurrently -k -r \"npm:sass:watch\" \"npm:vite\""`
|
|
@@ -160,6 +172,10 @@ npm run sass:watch
|
|
|
160
172
|
npm start
|
|
161
173
|
```
|
|
162
174
|
|
|
175
|
+
Example:
|
|
176
|
+
|
|
177
|
+
### [open-wc-vitejs-sass](https://github.com/oscarmarina/open-wc-vitejs-sass)
|
|
178
|
+
|
|
163
179
|
<hr>
|
|
164
180
|
<br>
|
|
165
181
|
|
|
@@ -218,6 +234,7 @@ open-wc scaffold
|
|
|
218
234
|
<hr>
|
|
219
235
|
|
|
220
236
|
### the component definition is generated in its own folder
|
|
237
|
+
|
|
221
238
|
```css
|
|
222
239
|
./
|
|
223
240
|
├── my-el/
|
package/package.json
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"trailingComma": "all"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"format": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\"
|
|
31
|
-
"lint": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\"
|
|
30
|
+
"format": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\" --fix --ignore-path .gitignore && prettier \"**/*.{js,ts,json,html,md}\" --write --ignore-path .gitignore",
|
|
31
|
+
"lint": "eslint \"{src,define,test}/**/*.{js,ts,json,html}\" \"index.*\" --ignore-path .gitignore && prettier \"**/*.{js,ts,json,html,md}\" --check --ignore-path .gitignore"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"eslint": "^8.0.0",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
## testing
|
|
14
14
|
/coverage/
|
|
15
15
|
**/coverage/
|
|
16
|
+
/reports/
|
|
16
17
|
__snapshots__
|
|
17
18
|
|
|
18
19
|
## temp folders
|
|
@@ -33,4 +34,4 @@ storybook-static
|
|
|
33
34
|
/packages/*/build
|
|
34
35
|
/packages/*/node_modules
|
|
35
36
|
/packages/*/.editorconfig
|
|
36
|
-
/packages/*/.gitignore
|
|
37
|
+
/packages/*/.gitignore
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* https://vite-rollup-plugins.patak.dev/
|
|
3
|
-
*/
|
|
1
|
+
/* eslint-disable implicit-arrow-linebreak */
|
|
4
2
|
import { defineConfig } from 'vite';
|
|
5
3
|
import pluginHtml from '@web/rollup-plugin-html';
|
|
6
4
|
import copy from 'rollup-plugin-copy';
|
|
@@ -53,21 +51,24 @@ const copyConfig = {
|
|
|
53
51
|
hook: 'writeBundle',
|
|
54
52
|
};
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
/**
|
|
55
|
+
* https://vitejs.dev/config/
|
|
56
|
+
* https://vite-rollup-plugins.patak.dev/
|
|
57
|
+
*/
|
|
57
58
|
|
|
58
59
|
export default defineConfig({
|
|
59
60
|
plugins: [
|
|
60
61
|
pluginHtml({
|
|
61
62
|
transformHtml: [
|
|
62
|
-
|
|
63
|
+
html =>
|
|
63
64
|
html.replace(
|
|
64
65
|
'<meta charset="utf-8">',
|
|
65
66
|
`<meta charset="utf-8">
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
<script src="./web_modules/@ungap/global-this/index.js"></script>
|
|
68
|
+
<script src="./web_modules/tiny-array-flat-polyfill/tiny-array-flat-polyfill.min.js"></script>
|
|
69
|
+
<script src="./web_modules/lit/polyfill-support.js"></script>
|
|
70
|
+
<script src="./web_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
|
|
71
|
+
<script src="./web_modules/@webcomponents/shadycss/custom-style-interface.min.js"></script>`,
|
|
71
72
|
),
|
|
72
73
|
],
|
|
73
74
|
}),
|
|
@@ -78,7 +79,6 @@ export default defineConfig({
|
|
|
78
79
|
],
|
|
79
80
|
build: {
|
|
80
81
|
target: ['edge18'],
|
|
81
|
-
minify: 'terser',
|
|
82
82
|
outDir: 'dev',
|
|
83
83
|
rollupOptions: {
|
|
84
84
|
input: 'demo/*.html',
|
|
@@ -9,22 +9,22 @@ suite('<%= className %>', () => {
|
|
|
9
9
|
|
|
10
10
|
suite('Default', () => {
|
|
11
11
|
setup(async () => {
|
|
12
|
-
el = await fixture(html` <<%= tagName
|
|
12
|
+
el = await fixture(html` <<%= tagName %>>light-dom</<%= tagName %>> `);
|
|
13
13
|
await el.updateComplete;
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
test('has a default heading "Hey there" and counter 5',
|
|
16
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
17
17
|
assert.equal(el.heading, 'Hey there');
|
|
18
18
|
assert.equal(el.counter, 5);
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
suite('Semantic Dom and a11y', () => {
|
|
22
|
-
test('SHADOW DOM - Structure test', () => {
|
|
23
|
-
assert.shadowDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
22
|
+
test('SHADOW DOM - Structure test', async () => {
|
|
23
|
+
await assert.shadowDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
test('LIGHT DOM - Structure test', () => {
|
|
27
|
-
assert.lightDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
26
|
+
test('LIGHT DOM - Structure test', async () => {
|
|
27
|
+
await assert.lightDom.equalSnapshot(el, { ignoreAttributes: ['id'] });
|
|
28
28
|
});
|
|
29
29
|
test('a11y', async () => {
|
|
30
30
|
await assert.isAccessible(el);
|
|
@@ -38,7 +38,7 @@ suite('<%= className %>', () => {
|
|
|
38
38
|
await el.updateComplete;
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
test('increases the counter on button click',
|
|
41
|
+
test('increases the counter on button click', () => {
|
|
42
42
|
el.shadowRoot.querySelector('button').click();
|
|
43
43
|
assert.equal(el.counter, 6);
|
|
44
44
|
});
|
|
@@ -50,7 +50,7 @@ suite('<%= className %>', () => {
|
|
|
50
50
|
await el.updateComplete;
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
test('can override the heading via attribute',
|
|
53
|
+
test('can override the heading via attribute', () => {
|
|
54
54
|
assert.equal(el.heading, 'attribute heading');
|
|
55
55
|
});
|
|
56
56
|
});
|
|
@@ -11,22 +11,22 @@ suite('<%= className %>', () => {
|
|
|
11
11
|
|
|
12
12
|
suite('Default', () => {
|
|
13
13
|
setup(async () => {
|
|
14
|
-
el = (await fixture(html` <<%= tagName
|
|
14
|
+
el = (await fixture(html` <<%= tagName %>>light-dom</<%= tagName %>> `)) as <%= className %>;
|
|
15
15
|
await el.updateComplete;
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
test('has a default heading "Hey there" and counter 5',
|
|
18
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
19
19
|
assert.equal(el.heading, 'Hey there');
|
|
20
20
|
assert.equal(el.counter, 5);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
suite('Semantic Dom and a11y', () => {
|
|
24
|
-
test('SHADOW DOM - Structure test', () => {
|
|
25
|
-
assert.shadowDom.equalSnapshot(el);
|
|
24
|
+
test('SHADOW DOM - Structure test', async () => {
|
|
25
|
+
await assert.shadowDom.equalSnapshot(el);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
test('LIGHT DOM - Structure test', () => {
|
|
29
|
-
assert.lightDom.equalSnapshot(el);
|
|
28
|
+
test('LIGHT DOM - Structure test', async () => {
|
|
29
|
+
await assert.lightDom.equalSnapshot(el);
|
|
30
30
|
});
|
|
31
31
|
test('a11y', async () => {
|
|
32
32
|
await assert.isAccessible(el);
|
|
@@ -40,7 +40,7 @@ suite('<%= className %>', () => {
|
|
|
40
40
|
await el.updateComplete;
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
test('increases the counter on button click',
|
|
43
|
+
test('increases the counter on button click', () => {
|
|
44
44
|
const button = el.shadowRoot!.querySelector('button')!;
|
|
45
45
|
button.click();
|
|
46
46
|
assert.equal(el.counter, 6);
|
|
@@ -55,7 +55,7 @@ suite('<%= className %>', () => {
|
|
|
55
55
|
await el.updateComplete;
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
test('can override the heading via attribute',
|
|
58
|
+
test('can override the heading via attribute', () => {
|
|
59
59
|
assert.equal(el.heading, 'attribute heading');
|
|
60
60
|
});
|
|
61
61
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import styles from './styles/<%= className %>-styles.js';
|
|
3
|
+
|
|
4
|
+
export class <%= className %> extends LitElement {
|
|
5
|
+
static get is() {
|
|
6
|
+
return '<%= tagName %>';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static get styles() {
|
|
10
|
+
return [styles];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static get properties() {
|
|
14
|
+
return {
|
|
15
|
+
/**
|
|
16
|
+
* The heading to say "Hello" to.
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
heading: { type: String },
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The number of times the button has been clicked.
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
25
|
+
counter: { type: Number },
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.heading = 'Hey there';
|
|
32
|
+
this.counter = 5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
return html`
|
|
37
|
+
<h1>${this.sayHello(this.heading)}!</h1>
|
|
38
|
+
<button @click=${this._onClick}>Counter: ${this.counter}</button>
|
|
39
|
+
<hr />
|
|
40
|
+
<slot></slot>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_onClick() {
|
|
45
|
+
this.counter += 1;
|
|
46
|
+
this.dispatchEvent(new CustomEvent('counter-changed'));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Formats a greeting
|
|
51
|
+
* @param heading {string} The heading to say "Hello" to
|
|
52
|
+
* @returns {string} A greeting directed at `heading`
|
|
53
|
+
*/
|
|
54
|
+
sayHello(heading) {
|
|
55
|
+
return `Hello, ${heading}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# \<<%= tagName %>>
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i <%= tagName %>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script type="module">
|
|
17
|
+
import '<%= tagName %>/<%= tagName %>.js';
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<<%= tagName %>></<%= tagName %>>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Tooling configs
|
|
24
|
+
|
|
25
|
+
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
26
|
+
|
|
27
|
+
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
28
|
+
|
|
29
|
+
## Local Demo with `vite`
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm start
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To run a local development server that serves the basic demo located in demo/index.html
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<style>
|
|
6
|
+
body {
|
|
7
|
+
background: #fafafa;
|
|
8
|
+
}
|
|
9
|
+
</style>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="demo"></div>
|
|
13
|
+
|
|
14
|
+
<script type="module">
|
|
15
|
+
import { html, render } from 'lit';
|
|
16
|
+
import '../define/<%= tagName %>.js';
|
|
17
|
+
|
|
18
|
+
const heading = 'World!';
|
|
19
|
+
render(
|
|
20
|
+
html`<<%= tagName %> .heading=${heading}>some light-dom</<%= tagName %>>`,
|
|
21
|
+
document.querySelector('#demo'),
|
|
22
|
+
);
|
|
23
|
+
</script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { <%= className %> } from './src/<%= className %>.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
|
|
4
|
+
export default css`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([hidden]),
|
|
11
|
+
[hidden] {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
*,
|
|
16
|
+
*:before,
|
|
17
|
+
*:after {
|
|
18
|
+
box-sizing: inherit;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import styles from './styles/<%= className %>-styles.js';
|
|
4
|
+
|
|
5
|
+
export class <%= className %> extends LitElement {
|
|
6
|
+
static get is() {
|
|
7
|
+
return '<%= tagName %>';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static override styles = [styles];
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The heading to say "Hello" to.
|
|
14
|
+
*/
|
|
15
|
+
@property({ type: String })
|
|
16
|
+
heading = 'Hey there';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The number of times the button has been clicked.
|
|
20
|
+
*/
|
|
21
|
+
@property({ type: Number })
|
|
22
|
+
counter = 5;
|
|
23
|
+
|
|
24
|
+
override render() {
|
|
25
|
+
return html`
|
|
26
|
+
<h1>${this.sayHello(this.heading)}!</h1>
|
|
27
|
+
<button @click=${this._onClick}>Counter: ${this.counter}</button>
|
|
28
|
+
<hr />
|
|
29
|
+
<slot></slot>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private _onClick() {
|
|
34
|
+
this.counter += 1;
|
|
35
|
+
this.dispatchEvent(new CustomEvent('counter-changed'));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Formats a greeting
|
|
40
|
+
* @param heading The heading to say "Hello" to
|
|
41
|
+
* @returns {string} A greeting directed at `heading`
|
|
42
|
+
*/
|
|
43
|
+
sayHello(heading: string): string {
|
|
44
|
+
return `Hello, ${heading}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# \<<%= tagName %>>
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i <%= tagName %>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script type="module">
|
|
17
|
+
import '<%= tagName %>/<%= tagName %>.js';
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<<%= tagName %>></<%= tagName %>>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Tooling configs
|
|
24
|
+
|
|
25
|
+
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
26
|
+
|
|
27
|
+
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
28
|
+
|
|
29
|
+
## Local Demo with `vite`
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm start
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To run a local development server that serves the basic demo located in demo/index.html
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<style>
|
|
6
|
+
body {
|
|
7
|
+
background: #fafafa;
|
|
8
|
+
}
|
|
9
|
+
</style>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="demo"></div>
|
|
13
|
+
|
|
14
|
+
<script type="module">
|
|
15
|
+
import { html, render } from 'lit';
|
|
16
|
+
import '../define/<%= tagName %>.ts';
|
|
17
|
+
|
|
18
|
+
const heading = 'World!';
|
|
19
|
+
render(
|
|
20
|
+
html`<<%= tagName %> .heading=${heading}>some light-dom</<%= tagName %>>`,
|
|
21
|
+
document.querySelector('#demo'),
|
|
22
|
+
);
|
|
23
|
+
</script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { <%= className %> } from './src/<%= className %>.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
|
|
4
|
+
export default css`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([hidden]),
|
|
11
|
+
[hidden] {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
*,
|
|
16
|
+
*:before,
|
|
17
|
+
*:after {
|
|
18
|
+
box-sizing: inherit;
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2019",
|
|
4
|
+
"module": "es2020",
|
|
5
|
+
"lib": ["es2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"rootDirs": ["./src", "./define", ".test/"],
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noImplicitAny": true,
|
|
18
|
+
"noImplicitThis": true,
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"allowSyntheticDefaultImports": true,
|
|
21
|
+
"experimentalDecorators": true,
|
|
22
|
+
"forceConsistentCasingInFileNames": true,
|
|
23
|
+
"noImplicitOverride": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["src/**/*.ts", "define/**/*.ts", "test/**/*.ts", "./index.ts"],
|
|
26
|
+
"exclude": []
|
|
27
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# create-blockquote-wc
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
|
|
3
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
-
import { defaultReporter } from '@web/test-runner';
|
|
5
|
-
import { mochaStyleReporter } from '@blockquote/test-runner-mocha-style-reporter';
|
|
6
|
-
|
|
7
|
-
const filteredLogs = ['in dev mode'];
|
|
8
|
-
|
|
9
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
10
|
-
/** Test files to run */
|
|
11
|
-
files: 'test/**/*.test.js',
|
|
12
|
-
|
|
13
|
-
/** Resolve bare module imports */
|
|
14
|
-
nodeResolve: {
|
|
15
|
-
exportConditions: ['browser', 'development'],
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
reporters: [
|
|
19
|
-
defaultReporter(),
|
|
20
|
-
mochaStyleReporter(),
|
|
21
|
-
],
|
|
22
|
-
|
|
23
|
-
coverageConfig: {
|
|
24
|
-
report: true,
|
|
25
|
-
reportDir: 'test/coverage',
|
|
26
|
-
threshold: {
|
|
27
|
-
statements: 80,
|
|
28
|
-
branches: 80,
|
|
29
|
-
functions: 80,
|
|
30
|
-
lines: 80,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
testFramework: {
|
|
35
|
-
config: {
|
|
36
|
-
ui: 'tdd',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/** Filter out lit dev mode logs */
|
|
41
|
-
filterBrowserLogs(log) {
|
|
42
|
-
for (const arg of log.args) {
|
|
43
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
51
|
-
// esbuildTarget: 'auto',
|
|
52
|
-
|
|
53
|
-
/** Amount of browsers to run concurrently */
|
|
54
|
-
// concurrentBrowsers: 2,
|
|
55
|
-
|
|
56
|
-
/** Amount of test files per browser to test concurrently */
|
|
57
|
-
// concurrency: 1,
|
|
58
|
-
|
|
59
|
-
/** Browsers to run tests on */
|
|
60
|
-
// browsers: [
|
|
61
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
62
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
63
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
64
|
-
// ],
|
|
65
|
-
|
|
66
|
-
// See documentation for all available options
|
|
67
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
|
|
3
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
-
import { defaultReporter } from '@web/test-runner';
|
|
5
|
-
import { mochaStyleReporter } from '@blockquote/test-runner-mocha-style-reporter';
|
|
6
|
-
|
|
7
|
-
const filteredLogs = ['in dev mode'];
|
|
8
|
-
|
|
9
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
10
|
-
/** Test files to run */
|
|
11
|
-
files: 'dist/test/**/*.test.js',
|
|
12
|
-
|
|
13
|
-
/** Resolve bare module imports */
|
|
14
|
-
nodeResolve: {
|
|
15
|
-
exportConditions: ['browser', 'development'],
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
reporters: [
|
|
19
|
-
defaultReporter(),
|
|
20
|
-
mochaStyleReporter(),
|
|
21
|
-
],
|
|
22
|
-
|
|
23
|
-
coverageConfig: {
|
|
24
|
-
report: true,
|
|
25
|
-
reportDir: 'dist/test/coverage',
|
|
26
|
-
threshold: {
|
|
27
|
-
statements: 80,
|
|
28
|
-
branches: 80,
|
|
29
|
-
functions: 80,
|
|
30
|
-
lines: 80,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
testFramework: {
|
|
35
|
-
config: {
|
|
36
|
-
ui: 'tdd',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/** Filter out lit dev mode logs */
|
|
41
|
-
filterBrowserLogs(log) {
|
|
42
|
-
for (const arg of log.args) {
|
|
43
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
51
|
-
// esbuildTarget: 'auto',
|
|
52
|
-
|
|
53
|
-
/** Amount of browsers to run concurrently */
|
|
54
|
-
// concurrentBrowsers: 2,
|
|
55
|
-
|
|
56
|
-
/** Amount of test files per browser to test concurrently */
|
|
57
|
-
// concurrency: 1,
|
|
58
|
-
|
|
59
|
-
/** Browsers to run tests on */
|
|
60
|
-
// browsers: [
|
|
61
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
62
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
63
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
64
|
-
// ],
|
|
65
|
-
|
|
66
|
-
// See documentation for all available options
|
|
67
|
-
});
|