@blockquote/create-wc 1.101.0 → 1.103.0
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/package.json +1 -1
- package/src/common-linting/templates/package.json +1 -1
- package/src/common-repo/templates/eslint.config.js +15 -7
- package/src/common-repo/templates/package.json +3 -3
- package/src/common-repo/templates/prettierignore +0 -1
- package/src/common-repo/templates/static/custom-elements-manifest.config.js +1 -1
- package/src/common-repo/templates/static/vite.config.js +7 -3
- package/src/common-testing-wtr/templates/static/web-test-runner.config.js +7 -10
- package/src/testing/templates/my-el.test.js +1 -1
- package/src/testing-ts/templates/my-el.test.ts +2 -2
- package/src/wc-lit-element/templates/MyEl.js +5 -5
- package/src/wc-lit-element/templates/index.js +1 -1
- package/src/wc-lit-element/templates/my-el.js +1 -1
- package/src/wc-lit-element/templates/static/demo/index.html +4 -4
- package/src/wc-lit-element-ts/templates/MyEl.ts +6 -6
- package/src/wc-lit-element-ts/templates/index.ts +1 -1
- package/src/wc-lit-element-ts/templates/my-el.ts +1 -1
- package/src/wc-lit-element-ts/templates/package.json +1 -1
- package/src/wc-lit-element-ts/templates/static/demo/index.html +4 -4
- package/src/wc-lit-element/templates/static/demo/favicon.svg +0 -12
- package/src/wc-lit-element-ts/templates/static/demo/favicon.svg +0 -12
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import tseslint from 'typescript-eslint';
|
|
2
2
|
import html from '@html-eslint/eslint-plugin';
|
|
3
|
-
// import htmlParser from '@html-eslint/parser';
|
|
4
3
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
5
4
|
import path from 'node:path';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
7
5
|
import js from '@eslint/js';
|
|
8
|
-
import {
|
|
6
|
+
import {fileURLToPath} from 'node:url';
|
|
7
|
+
import {FlatCompat} from '@eslint/eslintrc';
|
|
9
8
|
|
|
10
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
10
|
const __dirname = path.dirname(__filename);
|
|
@@ -16,7 +15,7 @@ const compat = new FlatCompat({
|
|
|
16
15
|
allConfig: js.configs.all,
|
|
17
16
|
});
|
|
18
17
|
|
|
19
|
-
const htmlFilesConfig = [html.configs['flat/recommended']].map(conf => ({
|
|
18
|
+
const htmlFilesConfig = [html.configs['flat/recommended']].map((conf) => ({
|
|
20
19
|
...conf,
|
|
21
20
|
files: ['**/*.html'],
|
|
22
21
|
}));
|
|
@@ -31,7 +30,7 @@ const htmlFilesRules = {
|
|
|
31
30
|
},
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
const tsFilesConfig = [...tseslint.configs.strict, ...tseslint.configs.stylistic].map(conf => ({
|
|
33
|
+
const tsFilesConfig = [...tseslint.configs.strict, ...tseslint.configs.stylistic].map((conf) => ({
|
|
35
34
|
...conf,
|
|
36
35
|
files: ['**/*.ts'],
|
|
37
36
|
}));
|
|
@@ -52,7 +51,6 @@ export default [
|
|
|
52
51
|
ignores: [
|
|
53
52
|
'**/.idea',
|
|
54
53
|
'**/.vscode',
|
|
55
|
-
'**/.code-workspace',
|
|
56
54
|
'**/coverage',
|
|
57
55
|
'**/reports',
|
|
58
56
|
'**/__snapshots__',
|
|
@@ -66,6 +64,7 @@ export default [
|
|
|
66
64
|
'**/*.d.ts',
|
|
67
65
|
'**/storybook-static',
|
|
68
66
|
'**/*.config.*',
|
|
67
|
+
'**/*.workspace.*',
|
|
69
68
|
'**/*.min.js',
|
|
70
69
|
'**/*-styles.*',
|
|
71
70
|
],
|
|
@@ -118,9 +117,18 @@ export default [
|
|
|
118
117
|
],
|
|
119
118
|
'import/no-unresolved': 'off',
|
|
120
119
|
'import/prefer-default-export': 'off',
|
|
121
|
-
'lit/no-classfield-shadowing': 'off',
|
|
122
120
|
'lit/no-native-attributes': 'off',
|
|
121
|
+
'lit/no-useless-template-literals': 'off',
|
|
122
|
+
'lit-a11y/anchor-is-valid': 'off',
|
|
123
123
|
'lit-a11y/click-events-have-key-events': 'off',
|
|
124
|
+
'lit-a11y/no-autofocus': 'off',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
files: ['**/test/**/*.{js,ts}'],
|
|
129
|
+
rules: {
|
|
130
|
+
'no-unused-expressions': 'off',
|
|
131
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
124
132
|
},
|
|
125
133
|
},
|
|
126
134
|
];
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|
|
34
34
|
"@open-wc/testing": "^4.0.0",
|
|
35
35
|
"@types/mocha": "^10.0.7",
|
|
36
|
-
"@web/test-runner": "^0.
|
|
36
|
+
"@web/test-runner": "^0.19.0",
|
|
37
37
|
"@web/test-runner-playwright": "^0.11.0",
|
|
38
38
|
"@web/rollup-plugin-html": "^2.3.0",
|
|
39
|
-
"concurrently": "^
|
|
39
|
+
"concurrently": "^9.0.0",
|
|
40
40
|
"sort-package-json": "^2.10.1",
|
|
41
41
|
"ts-lit-plugin": "^2.0.2",
|
|
42
|
-
"vite": "^5.4.
|
|
42
|
+
"vite": "^5.4.4"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable implicit-arrow-linebreak */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import {defineConfig} from 'vite';
|
|
3
|
+
import {rollupPluginHTML as pluginHtml} from '@web/rollup-plugin-html';
|
|
4
4
|
import totalBundlesize from '@blockquote/rollup-plugin-total-bundlesize';
|
|
5
5
|
import externalizeSourceDependencies from '@blockquote/rollup-plugin-externalize-source-dependencies';
|
|
6
6
|
|
|
@@ -10,7 +10,11 @@ import externalizeSourceDependencies from '@blockquote/rollup-plugin-externalize
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
export default defineConfig({
|
|
13
|
-
plugins: [
|
|
13
|
+
plugins: [
|
|
14
|
+
externalizeSourceDependencies(['/__web-dev-server__web-socket.js']),
|
|
15
|
+
pluginHtml(),
|
|
16
|
+
totalBundlesize(),
|
|
17
|
+
],
|
|
14
18
|
build: {
|
|
15
19
|
target: ['chrome71'],
|
|
16
20
|
outDir: 'dev',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
2
|
/* process.env.npm_lifecycle_event, process.env.npm_lifecycle_script, process.env.OUTDIR; */
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import {playwrightLauncher} from '@web/test-runner-playwright';
|
|
4
|
+
import {defaultReporter, summaryReporter} from '@web/test-runner';
|
|
5
|
+
import {coverageTableReporter} from '@blockquote/coverage-table-reporter';
|
|
6
6
|
|
|
7
7
|
const filteredLogs = ['in dev mode'];
|
|
8
8
|
const outDir = process.env.OUTDIR || '.';
|
|
@@ -15,10 +15,7 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
|
15
15
|
nodeResolve: true,
|
|
16
16
|
|
|
17
17
|
/** Browsers to run tests on */
|
|
18
|
-
browsers: [
|
|
19
|
-
playwrightLauncher({ product: 'chromium' }),
|
|
20
|
-
playwrightLauncher({ product: 'webkit' }),
|
|
21
|
-
],
|
|
18
|
+
browsers: [playwrightLauncher({product: 'chromium'}), playwrightLauncher({product: 'webkit'})],
|
|
22
19
|
|
|
23
20
|
/** Amount of browsers to run concurrently */
|
|
24
21
|
concurrentBrowsers: 2,
|
|
@@ -27,7 +24,7 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
|
27
24
|
concurrency: 1,
|
|
28
25
|
|
|
29
26
|
reporters: [summaryReporter({}), defaultReporter(), coverageTableReporter()],
|
|
30
|
-
|
|
27
|
+
|
|
31
28
|
preserveSymlinks: true,
|
|
32
29
|
|
|
33
30
|
coverage: true,
|
|
@@ -48,14 +45,14 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
|
48
45
|
// https://mochajs.org/api/mocha
|
|
49
46
|
config: {
|
|
50
47
|
ui: 'tdd',
|
|
51
|
-
timeout: 4000
|
|
48
|
+
timeout: 4000,
|
|
52
49
|
},
|
|
53
50
|
},
|
|
54
51
|
|
|
55
52
|
/** Filter out lit dev mode logs */
|
|
56
53
|
filterBrowserLogs(log) {
|
|
57
54
|
for (const arg of log.args) {
|
|
58
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
55
|
+
if (typeof arg === 'string' && filteredLogs.some((l) => arg.includes(l))) {
|
|
59
56
|
return false;
|
|
60
57
|
}
|
|
61
58
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {html, fixture, assert, expect, fixtureCleanup} from '@open-wc/testing';
|
|
2
|
+
import {<%= className %>} from '../src/<%= className %>.js';
|
|
3
3
|
import '../define/<%= tagName %>.js';
|
|
4
4
|
|
|
5
5
|
suite('<%= className %>', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {html, LitElement} from 'lit';
|
|
2
|
+
import {styles} from './styles/<%= tagName %>-styles.css.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 
|
|
@@ -25,12 +25,12 @@ export class <%= className %> extends LitElement {
|
|
|
25
25
|
/**
|
|
26
26
|
* The heading to say "Hello" to.
|
|
27
27
|
*/
|
|
28
|
-
heading: {
|
|
28
|
+
heading: {type: String},
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* The number of times the button has been clicked.
|
|
32
32
|
*/
|
|
33
|
-
counter: {
|
|
33
|
+
counter: {type: Number},
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
constructor() {
|
|
@@ -53,7 +53,7 @@ export class <%= className %> extends LitElement {
|
|
|
53
53
|
|
|
54
54
|
#onClick() {
|
|
55
55
|
this.counter += 1;
|
|
56
|
-
this.dispatchEvent(new CustomEvent('counterchange', {
|
|
56
|
+
this.dispatchEvent(new CustomEvent('counterchange', {detail: this.counter}));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {<%= className %>} from './<%= className %>.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<title>Demo - <%= tagName %></title>
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<link rel="icon" href="
|
|
7
|
+
<link rel="icon" href="data:image/x-icon;base64,B" />
|
|
8
8
|
<meta name="description" content="<%= tagName %>" />
|
|
9
9
|
<style>
|
|
10
10
|
html,
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
<div id="demo"></div>
|
|
20
20
|
|
|
21
21
|
<script type="module">
|
|
22
|
-
import {
|
|
22
|
+
import {html, render} from 'lit';
|
|
23
23
|
import '../define/<%= tagName %>.js';
|
|
24
24
|
|
|
25
25
|
const heading = 'World!';
|
|
26
26
|
render(
|
|
27
27
|
html`<<%= tagName %>
|
|
28
|
-
@counterchange="${ev => console.log('==>', ev.detail)}" .heading=${heading}
|
|
28
|
+
@counterchange="${(ev) => console.log('==>', ev.detail)}" .heading=${heading}
|
|
29
29
|
>some light-dom</<%= tagName %>
|
|
30
30
|
>`,
|
|
31
|
-
document.querySelector('#demo')
|
|
31
|
+
document.querySelector('#demo')
|
|
32
32
|
);
|
|
33
33
|
</script>
|
|
34
34
|
</body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {html, LitElement} from 'lit';
|
|
2
|
+
import {property} from 'lit/decorators.js';
|
|
3
|
+
import {styles} from './styles/<%= tagName %>-styles.css.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 
|
|
@@ -19,13 +19,13 @@ export class <%= className %> extends LitElement {
|
|
|
19
19
|
/**
|
|
20
20
|
* The heading to say "Hello" to.
|
|
21
21
|
*/
|
|
22
|
-
@property({
|
|
22
|
+
@property({type: String})
|
|
23
23
|
heading = 'Hey there';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* The number of times the button has been clicked.
|
|
27
27
|
*/
|
|
28
|
-
@property({
|
|
28
|
+
@property({type: Number})
|
|
29
29
|
counter = 5;
|
|
30
30
|
|
|
31
31
|
override render() {
|
|
@@ -39,7 +39,7 @@ export class <%= className %> extends LitElement {
|
|
|
39
39
|
|
|
40
40
|
#onClick() {
|
|
41
41
|
this.counter += 1;
|
|
42
|
-
this.dispatchEvent(new CustomEvent('counterchange', {
|
|
42
|
+
this.dispatchEvent(new CustomEvent('counterchange', {detail: this.counter}));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {<%= className %>} from './<%= className %>.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<title>Demo - <%= tagName %></title>
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<link rel="icon" href="
|
|
7
|
+
<link rel="icon" href="data:image/x-icon;base64,B" />
|
|
8
8
|
<meta name="description" content="<%= tagName %>" />
|
|
9
9
|
<style>
|
|
10
10
|
html,
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
<div id="demo"></div>
|
|
20
20
|
|
|
21
21
|
<script type="module">
|
|
22
|
-
import {
|
|
22
|
+
import {html, render} from 'lit';
|
|
23
23
|
import '../define/<%= tagName %>.ts';
|
|
24
24
|
|
|
25
25
|
const heading = 'World!';
|
|
26
26
|
render(
|
|
27
27
|
html`<<%= tagName %>
|
|
28
|
-
@counterchange="${ev => console.log('==>', ev.detail)}" .heading=${heading}
|
|
28
|
+
@counterchange="${(ev) => console.log('==>', ev.detail)}" .heading=${heading}
|
|
29
29
|
>some light-dom</<%= tagName %>
|
|
30
30
|
>`,
|
|
31
|
-
document.querySelector('#demo')
|
|
31
|
+
document.querySelector('#demo')
|
|
32
32
|
);
|
|
33
33
|
</script>
|
|
34
34
|
</body>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<style>
|
|
3
|
-
.square1 { fill: #888888; }
|
|
4
|
-
.square2 { fill: #D2D2D2; }
|
|
5
|
-
@media (prefers-color-scheme: dark) {
|
|
6
|
-
.square1 { fill: #D2D2D2; }
|
|
7
|
-
.square2 { fill: #888888; }
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
<rect class="square1" x="24" y="24" width="48" height="48" />
|
|
11
|
-
<rect class="square2" x="33" y="33" width="30" height="30" />
|
|
12
|
-
</svg>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg width="96" height="96" viewBox="0 0 96 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<style>
|
|
3
|
-
.square1 { fill: #888888; }
|
|
4
|
-
.square2 { fill: #D2D2D2; }
|
|
5
|
-
@media (prefers-color-scheme: dark) {
|
|
6
|
-
.square1 { fill: #D2D2D2; }
|
|
7
|
-
.square2 { fill: #888888; }
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
<rect class="square1" x="24" y="24" width="48" height="48" />
|
|
11
|
-
<rect class="square2" x="33" y="33" width="30" height="30" />
|
|
12
|
-
</svg>
|