@blockquote/create-wc 2.12.0 → 2.13.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockquote/create-wc",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "Lit",
@@ -55,9 +55,9 @@
55
55
  "devDependencies": {
56
56
  "@eslint/js": "^10.0.1",
57
57
  "@open-wc/eslint-config": "^13.1.0",
58
- "eslint": "^10.5.0",
58
+ "eslint": "^10.6.0",
59
59
  "eslint-config-prettier": "^10.1.8",
60
- "prettier": "^3.8.4",
60
+ "prettier": "^3.9.0",
61
61
  "globals": "^17.7.0"
62
62
  },
63
63
  "publishConfig": {
@@ -69,9 +69,9 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@eslint/js": "^10.0.1",
72
- "@html-eslint/eslint-plugin": "^0.62.0",
73
- "@html-eslint/parser": "^0.62.0",
74
- "eslint": "^10.5.0",
72
+ "@html-eslint/eslint-plugin": "^0.63.0",
73
+ "@html-eslint/parser": "^0.63.0",
74
+ "eslint": "^10.6.0",
75
75
  "eslint-config-prettier": "^10.1.8",
76
76
  "eslint-plugin-html": "^8.1.4",
77
77
  "eslint-plugin-import-x": "^4.17.0",
@@ -83,8 +83,8 @@
83
83
  "globals": "^17.7.0",
84
84
  "husky": "^9.1.7",
85
85
  "lint-staged": "^17.0.8",
86
- "prettier": "^3.8.4",
87
- "stylelint": "^17.13.0",
86
+ "prettier": "^3.9.0",
87
+ "stylelint": "^17.14.0",
88
88
  "stylelint-config-standard-scss": "^17.0.0"
89
89
  }
90
90
  }
@@ -18,7 +18,6 @@
18
18
  "preview:vite": "vite preview",
19
19
  "analyze": "cem analyze --litelement --globs \"src/**/*.{js,ts}\" \"index.js\"",
20
20
  "sort:package": "npx sort-package-json",
21
- "postinstall": "npm run sort:package",
22
21
  "prepare": "husky",
23
22
  "test": "vitest",
24
23
  "test:watch": "vitest --browser.headless=false"
@@ -33,7 +32,7 @@
33
32
  "@custom-elements-manifest/analyzer": "^0.11.0",
34
33
  "@open-wc/semantic-dom-diff": "^0.20.1",
35
34
  "@open-wc/testing-helpers": "^3.0.1",
36
- "playwright": "^1.61.0",
35
+ "playwright": "^1.61.1",
37
36
  "postcss-html": "^1.8.1",
38
37
  "postcss-lit": "^1.4.1",
39
38
  "@types/mocha": "^10.0.10",
@@ -1,4 +1,4 @@
1
- import {defineConfig} from 'vite';
1
+ import {defineConfig} from 'vitest/config';
2
2
  import {playwright} from '@vitest/browser-playwright';
3
3
  import {globSync} from 'tinyglobby';
4
4
  import copy from 'rollup-plugin-copy';
@@ -7,6 +7,7 @@ import totalBundlesize from '@blockquote/rollup-plugin-total-bundlesize';
7
7
  const OUT_DIR = 'dev';
8
8
  const ENTRIES_DIR = 'demo';
9
9
  const ENTRIES_GLOB = [`${ENTRIES_DIR}/**/*.js`];
10
+ const ENTRY_EXCLUDE_GLOBS = [`${ENTRIES_DIR}/**/*.{test,spec}.js`];
10
11
 
11
12
  const copyConfig = {
12
13
  targets: [
@@ -19,13 +20,31 @@ const copyConfig = {
19
20
  };
20
21
 
21
22
  // https://github.com/vitejs/vite/discussions/1736#discussioncomment-5126923
22
- const entries = Object.fromEntries(
23
- globSync(ENTRIES_GLOB).map((file) => {
24
- const [key] = file.match(new RegExp(`(?<=${ENTRIES_DIR}/).*`)) || [];
25
- return [key?.replace(/\.[^.]*$/, ''), file];
26
- })
23
+ const entryFiles = [...new Set(globSync(ENTRIES_GLOB, {ignore: ENTRY_EXCLUDE_GLOBS}))].sort(
24
+ (a, b) => a.localeCompare(b)
27
25
  );
28
26
 
27
+ const entries = (() => {
28
+ const map = new Map();
29
+
30
+ for (const file of entryFiles) {
31
+ const key = file.startsWith(`${ENTRIES_DIR}/`)
32
+ ? file.slice(ENTRIES_DIR.length + 1).replace(/\.[^.]*$/, '')
33
+ : file.replace(/\.[^.]*$/, '');
34
+
35
+ if (map.has(key)) {
36
+ throw new Error(
37
+ `Duplicate demo entry key "${key}" generated by "${map.get(key)}" and "${file}".`
38
+ );
39
+ }
40
+
41
+ map.set(key, file);
42
+ }
43
+
44
+ return Object.fromEntries(map);
45
+ })();
46
+
47
+
29
48
  // https://vitejs.dev/config/
30
49
  // https://vite-rollup-plugins.patak.dev/
31
50
  // https://github.com/vitest-dev/vitest/commit/78b62ffe#diff-d3e264f3679867e205ed7eeb7622aa3b62bb0c4b1a4aa5a5983cb3aa118fcf3c
@@ -49,8 +68,12 @@ export default defineConfig(({command}) => ({
49
68
  browser: 'chromium',
50
69
  provider: playwright({
51
70
  launchOptions: {
52
- devtools: true,
53
- args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu'],
71
+ args: [
72
+ '--auto-open-devtools-for-tabs',
73
+ '--no-sandbox',
74
+ '--disable-setuid-sandbox',
75
+ '--disable-gpu',
76
+ ],
54
77
  },
55
78
  }),
56
79
  },
@@ -27,6 +27,7 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "build": "echo \"This is not a TypeScript project, so no need to build.\"",
30
+ "build:demo": "npm run dev:vite",
30
31
  "sass:watch": "sass-style-template"
31
32
  }
32
33
  }
@@ -26,7 +26,8 @@
26
26
  "/dist/"
27
27
  ],
28
28
  "scripts": {
29
- "build": "npm run dev:vite && npm run build:lib && npm run build:tsc",
29
+ "build": "npm run build:lib && npm run build:tsc",
30
+ "build:demo": "npm run dev:vite",
30
31
  "build:lib": "vite build --config vite.lib.config.js",
31
32
  "build:tsc": "tsc",
32
33
  "sass:watch": "sass-style-template -j ts"
@@ -3,16 +3,34 @@ import {nodeExternals} from 'rollup-plugin-node-externals';
3
3
  import {globSync} from 'tinyglobby';
4
4
 
5
5
  const ENTRIES_DIR = 'src';
6
- const ENTRIES_GLOB = [`${ENTRIES_DIR}/**/*.ts`];
6
+ const ENTRIES_GLOB = [`${ENTRIES_DIR}/**/*.{js,ts}`];
7
+ const ENTRY_EXCLUDE_GLOBS = [`${ENTRIES_DIR}/**/*.{test,spec}.{js,ts}`];
7
8
 
8
- // https://github.com/vitejs/vite/discussions/1736#discussioncomment-5126923
9
- const entries = Object.fromEntries(
10
- globSync(ENTRIES_GLOB).map((file) => {
11
- const [key] = file.match(new RegExp(`(?<=${ENTRIES_DIR}/).*`)) || [];
12
- return [key?.replace(/\.[^.]*$/, ''), file];
13
- })
9
+ const entryFiles = [...new Set(globSync(ENTRIES_GLOB, {ignore: ENTRY_EXCLUDE_GLOBS}))].sort(
10
+ (a, b) => a.localeCompare(b)
14
11
  );
15
12
 
13
+ // https://github.com/vitejs/vite/discussions/1736#discussioncomment-5126923
14
+ const entries = (() => {
15
+ const map = new Map();
16
+
17
+ for (const file of entryFiles) {
18
+ const key = file.startsWith(`${ENTRIES_DIR}/`)
19
+ ? file.slice(ENTRIES_DIR.length + 1).replace(/\.[^.]*$/, '')
20
+ : file.replace(/\.[^.]*$/, '');
21
+
22
+ if (map.has(key)) {
23
+ throw new Error(
24
+ `Duplicate library entry key "${key}" generated by "${map.get(key)}" and "${file}".`
25
+ );
26
+ }
27
+
28
+ map.set(key, file);
29
+ }
30
+
31
+ return Object.fromEntries(map);
32
+ })();
33
+
16
34
  export default defineConfig({
17
35
  plugins: [nodeExternals()],
18
36
  build: {