@blockquote/create-wc 2.2.12 → 2.4.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 +7 -7
- package/src/common-linting/templates/package.json +14 -14
- package/src/common-repo/templates/eslint.config.js +20 -20
- package/src/common-repo/templates/gitignore +15 -1
- package/src/common-repo/templates/package.json +10 -10
- package/src/testing/templates/my-el.test.js +8 -9
- package/src/testing-ts/templates/my-el.test.ts +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockquote/create-wc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Web component with Lit scaffolding - Extending Open Web Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"chalk": "^5.4.1",
|
|
51
51
|
"command-line-args": "^6.0.1",
|
|
52
52
|
"prompts": "^2.4.2",
|
|
53
|
-
"semver": "^7.7.
|
|
53
|
+
"semver": "^7.7.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@eslint/compat": "^1.
|
|
57
|
-
"eslint-plugin-html": "^8.1.
|
|
58
|
-
"@open-wc/eslint-config": "^
|
|
59
|
-
"eslint": "^9.
|
|
60
|
-
"eslint-config-prettier": "^10.1.
|
|
56
|
+
"@eslint/compat": "^1.3.0",
|
|
57
|
+
"eslint-plugin-html": "^8.1.3",
|
|
58
|
+
"@open-wc/eslint-config": "^13.0.0",
|
|
59
|
+
"eslint": "^9.29.0",
|
|
60
|
+
"eslint-config-prettier": "^10.1.5",
|
|
61
61
|
"prettier": "^3.5.3"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
@@ -68,22 +68,22 @@
|
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
72
|
-
"@html-eslint/parser": "^0.
|
|
73
|
-
"eslint": "^9.
|
|
74
|
-
"eslint-config-prettier": "^10.1.
|
|
75
|
-
"eslint-plugin-html": "^8.1.
|
|
71
|
+
"@html-eslint/eslint-plugin": "^0.41.0",
|
|
72
|
+
"@html-eslint/parser": "^0.41.0",
|
|
73
|
+
"eslint": "^9.29.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.5",
|
|
75
|
+
"eslint-plugin-html": "^8.1.3",
|
|
76
76
|
"eslint-plugin-import": "^2.31.0",
|
|
77
|
-
"eslint-plugin-lit": "^2.
|
|
78
|
-
"eslint-plugin-lit-a11y": "^
|
|
79
|
-
"eslint-plugin-wc": "^3.0.
|
|
80
|
-
"@typescript-eslint/parser": "^8.
|
|
81
|
-
"typescript-eslint": "^8.
|
|
82
|
-
"globals": "^16.
|
|
77
|
+
"eslint-plugin-lit": "^2.1.1",
|
|
78
|
+
"eslint-plugin-lit-a11y": "^5.0.1",
|
|
79
|
+
"eslint-plugin-wc": "^3.0.1",
|
|
80
|
+
"@typescript-eslint/parser": "^8.34.1",
|
|
81
|
+
"typescript-eslint": "^8.34.1",
|
|
82
|
+
"globals": "^16.2.0",
|
|
83
83
|
"husky": "^9.1.7",
|
|
84
|
-
"lint-staged": "^
|
|
84
|
+
"lint-staged": "^16.1.2",
|
|
85
85
|
"prettier": "^3.5.3",
|
|
86
|
-
"stylelint": "^16.
|
|
87
|
-
"stylelint-config-standard-scss": "^
|
|
86
|
+
"stylelint": "^16.20.0",
|
|
87
|
+
"stylelint-config-standard-scss": "^15.0.1"
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import {fileURLToPath} from 'node:url';
|
|
3
1
|
import js from '@eslint/js';
|
|
4
|
-
import {FlatCompat} from '@eslint/eslintrc';
|
|
5
2
|
import {configs as wc} from 'eslint-plugin-wc';
|
|
6
3
|
import {configs as lit} from 'eslint-plugin-lit';
|
|
7
|
-
import
|
|
4
|
+
import litA11y from 'eslint-plugin-lit-a11y';
|
|
5
|
+
import {flatConfigs as importPlugin} from 'eslint-plugin-import';
|
|
8
6
|
import tseslint from 'typescript-eslint';
|
|
9
7
|
import tsParser from '@typescript-eslint/parser';
|
|
10
8
|
import htmlEslint from '@html-eslint/eslint-plugin';
|
|
@@ -13,21 +11,10 @@ import eslintPluginHtml from 'eslint-plugin-html';
|
|
|
13
11
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
14
12
|
import globals from 'globals';
|
|
15
13
|
|
|
16
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
-
const __dirname = path.dirname(__filename);
|
|
18
|
-
|
|
19
14
|
const fileTypes = '{js,ts,mjs}';
|
|
20
15
|
|
|
21
|
-
const compat = new FlatCompat({
|
|
22
|
-
baseDirectory: __dirname,
|
|
23
|
-
resolvePluginsRelativeTo: __dirname,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
16
|
// eslint-plugin-import
|
|
27
|
-
const importFilesConfig = [
|
|
28
|
-
importPlugin.flatConfigs?.recommended,
|
|
29
|
-
importPlugin.flatConfigs?.typescript,
|
|
30
|
-
].map((conf) => ({
|
|
17
|
+
const importFilesConfig = [importPlugin.recommended, importPlugin.typescript].map((conf) => ({
|
|
31
18
|
...conf,
|
|
32
19
|
files: [`**/*.${fileTypes}`],
|
|
33
20
|
languageOptions: {
|
|
@@ -60,6 +47,21 @@ const importFilesRules = {
|
|
|
60
47
|
},
|
|
61
48
|
};
|
|
62
49
|
|
|
50
|
+
// eslint-plugin-lit-a11y
|
|
51
|
+
const litA11yFilesConfig = [litA11y.configs.recommended].map((conf) => ({
|
|
52
|
+
...conf,
|
|
53
|
+
files: [`**/*.${fileTypes}`],
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
const litA11yFilesRules = {
|
|
57
|
+
files: [`**/*.${fileTypes}`],
|
|
58
|
+
rules: {
|
|
59
|
+
'lit-a11y/no-autofocus': 'off',
|
|
60
|
+
'lit-a11y/anchor-is-valid': 'off',
|
|
61
|
+
'lit-a11y/click-events-have-key-events': 'off',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
63
65
|
// eslint-plugin-wc
|
|
64
66
|
const wcFilesConfig = [wc['flat/recommended']].map((conf) => ({
|
|
65
67
|
...conf,
|
|
@@ -160,9 +162,10 @@ export default [
|
|
|
160
162
|
],
|
|
161
163
|
},
|
|
162
164
|
js.configs.recommended,
|
|
163
|
-
...compat.extends('plugin:lit-a11y/recommended'),
|
|
164
165
|
...importFilesConfig,
|
|
165
166
|
importFilesRules,
|
|
167
|
+
...litA11yFilesConfig,
|
|
168
|
+
litA11yFilesRules,
|
|
166
169
|
...wcFilesConfig,
|
|
167
170
|
wcFilesRules,
|
|
168
171
|
...litFilesConfig,
|
|
@@ -202,9 +205,6 @@ export default [
|
|
|
202
205
|
},
|
|
203
206
|
],
|
|
204
207
|
'no-empty-function': 'error',
|
|
205
|
-
'lit-a11y/no-autofocus': 'off',
|
|
206
|
-
'lit-a11y/anchor-is-valid': 'off',
|
|
207
|
-
'lit-a11y/click-events-have-key-events': 'off',
|
|
208
208
|
},
|
|
209
209
|
},
|
|
210
210
|
{
|
|
@@ -8,15 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
## npm/yarn
|
|
10
10
|
**/node_modules
|
|
11
|
-
**/npm-debug.log
|
|
12
11
|
**/*-debug.log
|
|
13
12
|
**/yarn-error.log
|
|
13
|
+
**/.pnp
|
|
14
|
+
**/.pnp.*
|
|
14
15
|
|
|
15
16
|
## testing
|
|
16
17
|
**/coverage
|
|
17
18
|
**/reports
|
|
18
19
|
**/*screenshots*
|
|
19
20
|
**/*snapshots*
|
|
21
|
+
**/test-results/
|
|
22
|
+
**/playwright-report/
|
|
23
|
+
**/blob-report/
|
|
24
|
+
**/playwright/.cache/
|
|
20
25
|
|
|
21
26
|
## build
|
|
22
27
|
**/_site
|
|
@@ -28,4 +33,13 @@
|
|
|
28
33
|
**/*.tgz
|
|
29
34
|
**/*.tsbuildinfo
|
|
30
35
|
**/storybook-static
|
|
36
|
+
|
|
37
|
+
# local env files
|
|
38
|
+
**/.auth
|
|
39
|
+
**/.env
|
|
40
|
+
**/.env.local
|
|
41
|
+
**/.env.development.local
|
|
42
|
+
**/.env.test.local
|
|
43
|
+
**/.env.production.local
|
|
44
|
+
|
|
31
45
|
## end gitignore
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"@custom-elements-manifest/analyzer": "^0.10.4",
|
|
35
35
|
"@open-wc/semantic-dom-diff": "^0.20.1",
|
|
36
36
|
"@open-wc/testing": "^4.0.0",
|
|
37
|
-
"playwright": "^1.
|
|
37
|
+
"playwright": "^1.53.0",
|
|
38
38
|
"postcss-html": "1.8.0",
|
|
39
39
|
"postcss-lit": "^1.2.0",
|
|
40
40
|
"@types/mocha": "^10.0.10",
|
|
41
41
|
"rollup-plugin-copy": "^3.5.0",
|
|
42
|
-
"rollup-plugin-node-externals": "^8.0.
|
|
43
|
-
"tinyglobby": "^0.2.
|
|
42
|
+
"rollup-plugin-node-externals": "^8.0.1",
|
|
43
|
+
"tinyglobby": "^0.2.14",
|
|
44
44
|
"concurrently": "^9.1.2",
|
|
45
|
-
"sort-package-json": "^3.
|
|
46
|
-
"@vitest/browser": "^3.
|
|
47
|
-
"@vitest/coverage-istanbul": "^3.
|
|
48
|
-
"@vitest/coverage-v8": "^3.
|
|
49
|
-
"@vitest/ui": "^3.
|
|
50
|
-
"vitest": "^3.
|
|
51
|
-
"vite": "^6.
|
|
45
|
+
"sort-package-json": "^3.2.1",
|
|
46
|
+
"@vitest/browser": "^3.2.4",
|
|
47
|
+
"@vitest/coverage-istanbul": "^3.2.4",
|
|
48
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
49
|
+
"@vitest/ui": "^3.2.4",
|
|
50
|
+
"vitest": "^3.2.4",
|
|
51
|
+
"vite": "^6.3.5"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {beforeAll, afterAll, beforeEach, afterEach, suite, assert, expect, vi, test} from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {getElementLocatorSelectors} from '@vitest/browser/utils';
|
|
3
3
|
import {html} from 'lit';
|
|
4
4
|
import {getDiffableHTML} from '@open-wc/semantic-dom-diff';
|
|
5
5
|
import {assert as a11y, fixture, fixtureCleanup} from '@open-wc/testing';
|
|
@@ -17,16 +17,16 @@ suite('<%= className %>', () => {
|
|
|
17
17
|
beforeAll(async () => {
|
|
18
18
|
el = await fixture(html`<<%= tagName %>>light-dom</<%= tagName %>>`);
|
|
19
19
|
elShadowRoot = el?.shadowRoot?.innerHTML;
|
|
20
|
-
elLocator =
|
|
20
|
+
elLocator = getElementLocatorSelectors(el);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
afterAll(() => {
|
|
24
24
|
fixtureCleanup();
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
test('has a default heading "Hey there" and counter 5',
|
|
28
|
-
const button =
|
|
29
|
-
const heading =
|
|
27
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
28
|
+
const button = elLocator.getByText('Counter: 5').query();
|
|
29
|
+
const heading = elLocator.getByText('Hey there').query();
|
|
30
30
|
assert.isOk(button);
|
|
31
31
|
assert.isOk(heading);
|
|
32
32
|
});
|
|
@@ -47,7 +47,7 @@ suite('<%= className %>', () => {
|
|
|
47
47
|
suite('Events ', () => {
|
|
48
48
|
beforeEach(async () => {
|
|
49
49
|
el = await fixture(html`<<%= tagName %>></<%= tagName %>>`);
|
|
50
|
-
elLocator =
|
|
50
|
+
elLocator = getElementLocatorSelectors(el);
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
afterEach(() => {
|
|
@@ -65,8 +65,7 @@ suite('<%= className %>', () => {
|
|
|
65
65
|
test('counterchange event is dispatched', async () => {
|
|
66
66
|
const spyEvent = vi.spyOn(el, 'dispatchEvent');
|
|
67
67
|
const button = elLocator.getByText('Counter: 5');
|
|
68
|
-
|
|
69
|
-
await userEvent.click(elButton);
|
|
68
|
+
await button.click();
|
|
70
69
|
await el.updateComplete;
|
|
71
70
|
const calledWithCounterChange = spyEvent.mock.lastCall?.[0].type === 'counterchange';
|
|
72
71
|
assert.isTrue(calledWithCounterChange);
|
|
@@ -76,7 +75,7 @@ suite('<%= className %>', () => {
|
|
|
76
75
|
suite('Override ', () => {
|
|
77
76
|
beforeAll(async () => {
|
|
78
77
|
el = await fixture(html`<<%= tagName %> heading="attribute heading"></<%= tagName %>>`);
|
|
79
|
-
elLocator =
|
|
78
|
+
elLocator = getElementLocatorSelectors(el);
|
|
80
79
|
|
|
81
80
|
return () => {
|
|
82
81
|
fixtureCleanup();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {beforeAll, afterAll, beforeEach, afterEach, suite, assert, expect, vi, test} from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {type LocatorSelectors} from '@vitest/browser/context';
|
|
3
|
+
import {getElementLocatorSelectors} from '@vitest/browser/utils';
|
|
3
4
|
import {html} from 'lit';
|
|
4
5
|
import {getDiffableHTML} from '@open-wc/semantic-dom-diff';
|
|
5
6
|
import {assert as a11y, fixture, fixtureCleanup} from '@open-wc/testing';
|
|
@@ -9,22 +10,22 @@ import '../src/define/<%= tagName %>.js';
|
|
|
9
10
|
suite('<%= className %>', () => {
|
|
10
11
|
let el: <%= className %>;
|
|
11
12
|
let elShadowRoot: string;
|
|
12
|
-
let elLocator:
|
|
13
|
+
let elLocator: LocatorSelectors;
|
|
13
14
|
|
|
14
15
|
suite('Semantic Dom and a11y', () => {
|
|
15
16
|
beforeAll(async () => {
|
|
16
17
|
el = await fixture(html`<<%= tagName %>>light-dom</<%= tagName %>>`);
|
|
17
18
|
elShadowRoot = el?.shadowRoot!.innerHTML;
|
|
18
|
-
elLocator =
|
|
19
|
+
elLocator = getElementLocatorSelectors(el);
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
afterAll(() => {
|
|
22
23
|
fixtureCleanup();
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
test('has a default heading "Hey there" and counter 5',
|
|
26
|
-
const button =
|
|
27
|
-
const heading =
|
|
26
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
27
|
+
const button = elLocator.getByText('Counter: 5').query();
|
|
28
|
+
const heading = elLocator.getByText('Hey there').query();
|
|
28
29
|
assert.isOk(button);
|
|
29
30
|
assert.isOk(heading);
|
|
30
31
|
});
|
|
@@ -45,7 +46,7 @@ suite('<%= className %>', () => {
|
|
|
45
46
|
suite('Events ', () => {
|
|
46
47
|
beforeEach(async () => {
|
|
47
48
|
el = await fixture(html`<<%= tagName %>></<%= tagName %>>`);
|
|
48
|
-
elLocator =
|
|
49
|
+
elLocator = getElementLocatorSelectors(el);
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
afterEach(() => {
|
|
@@ -63,8 +64,7 @@ suite('<%= className %>', () => {
|
|
|
63
64
|
test('counterchange event is dispatched', async () => {
|
|
64
65
|
const spyEvent = vi.spyOn(el, 'dispatchEvent');
|
|
65
66
|
const button = elLocator.getByText('Counter: 5');
|
|
66
|
-
|
|
67
|
-
await userEvent.click(elButton);
|
|
67
|
+
await button.click();
|
|
68
68
|
await el.updateComplete;
|
|
69
69
|
const calledWithCounterChange = spyEvent.mock.lastCall?.[0].type === 'counterchange';
|
|
70
70
|
assert.isTrue(calledWithCounterChange);
|
|
@@ -74,7 +74,7 @@ suite('<%= className %>', () => {
|
|
|
74
74
|
suite('Override ', () => {
|
|
75
75
|
beforeAll(async () => {
|
|
76
76
|
el = await fixture(html`<<%= tagName %> heading="attribute heading"></<%= tagName %>>`);
|
|
77
|
-
elLocator =
|
|
77
|
+
elLocator = getElementLocatorSelectors(el);
|
|
78
78
|
|
|
79
79
|
return () => {
|
|
80
80
|
fixtureCleanup();
|