@blockquote/create-wc 1.23.0 → 1.25.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/README.md CHANGED
@@ -202,6 +202,11 @@ Example:
202
202
  ```css
203
203
  ./
204
204
  ├── my-el/
205
+ │ ├── .husky/
206
+ │ │ ├── _/
207
+ │ │ │ ├── .gitignore
208
+ │ │ │ └── husky.sh
209
+ │ │ └── pre-commit
205
210
  │ ├── define/
206
211
  │ │ └── my-el.{js,ts}
207
212
  │ ├── demo/
@@ -221,7 +226,6 @@ Example:
221
226
  │ ├── package.json
222
227
  │ ├── README.md
223
228
  │ ├── vite.config.js
224
- │ ├── web-dev-server.config.mjs
225
229
  │ └── web-test-runner.config.mjs
226
230
  ```
227
231
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockquote/create-wc",
3
- "version": "1.23.0",
3
+ "version": "1.25.0",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "LitElement",
@@ -43,13 +43,13 @@
43
43
  "chalk": "^5.2.0",
44
44
  "command-line-args": "^5.2.1",
45
45
  "prompts": "^2.4.2",
46
- "semver": "^7.3.8"
46
+ "semver": "^7.5.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@open-wc/eslint-config": "^10.0.0",
50
- "eslint": "^8.37.0",
50
+ "eslint": "^8.39.0",
51
51
  "eslint-config-prettier": "^8.8.0",
52
- "prettier": "^2.8.7"
52
+ "prettier": "^2.8.8"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=14.15.0"
@@ -9,11 +9,6 @@
9
9
  "lint:prettier": "prettier \"**/*.{js,ts,json,html}\" --check --ignore-path .eslintignore",
10
10
  "lint:stylelint": "stylelint \"**/*.{scss,css}\" --allow-empty-input --ignore-path .eslintignore"
11
11
  },
12
- "husky": {
13
- "hooks": {
14
- "pre-commit": "lint-staged"
15
- }
16
- },
17
12
  "lint-staged": {
18
13
  "**/*.{js,ts,html}": [
19
14
  "npm run format:eslint"
@@ -93,13 +88,13 @@
93
88
  },
94
89
  "devDependencies": {
95
90
  "@open-wc/eslint-config": "^10.0.0",
96
- "eslint": "^8.37.0",
91
+ "eslint": "^8.39.0",
97
92
  "eslint-config-prettier": "^8.8.0",
98
93
  "eslint-plugin-log-filenames": "^1.0.6",
99
- "husky": "^4.3.8",
100
- "lint-staged": "^13.2.0",
101
- "prettier": "^2.8.7",
102
- "stylelint": "^15.4.0",
103
- "stylelint-config-standard-scss": "^7.0.1"
94
+ "husky": "^8.0.3",
95
+ "lint-staged": "^13.2.1",
96
+ "prettier": "^2.8.8",
97
+ "stylelint": "^15.6.0",
98
+ "stylelint-config-standard-scss": "^9.0.0"
104
99
  }
105
100
  }
@@ -1,5 +1,6 @@
1
1
  import { fileURLToPath } from 'url';
2
- import { dirname } from 'path';
2
+ import path, { dirname } from 'path';
3
+ import fs from 'fs';
3
4
 
4
5
  const __filename = fileURLToPath(import.meta.url);
5
6
  const __dirname = dirname(__filename);
@@ -31,10 +32,30 @@ export const CommonRepoMixin = (subclass) =>
31
32
  // write and rename .gitignore
32
33
  this.copyTemplate(`${__dirname}/templates/gitignore`, this.destinationPath(`.gitignore`));
33
34
 
34
- // write and rename .gitignore
35
- this.copyTemplate(`${__dirname}/templates/eslintignore`, this.destinationPath(`.eslintignore`));
35
+ // write and rename .eslintignore
36
+ this.copyTemplate(
37
+ `${__dirname}/templates/eslintignore`,
38
+ this.destinationPath(`.eslintignore`),
39
+ );
36
40
 
37
41
  // copy all other files
38
42
  await this.copyTemplates(`${__dirname}/templates/static/**/*`);
39
43
  }
44
+
45
+ async end() {
46
+ await super.end();
47
+
48
+ const { destinationPath } = this.options;
49
+
50
+ if (destinationPath) {
51
+ const huskyPreCommit = path.join(this.options.destinationPath, '.husky/pre-commit');
52
+ try {
53
+ fs.chmodSync(huskyPreCommit, 0o755);
54
+ } catch (err) {
55
+ if (err.code !== 'ENOENT') {
56
+ throw err;
57
+ }
58
+ }
59
+ }
60
+ }
40
61
  };
@@ -18,25 +18,25 @@
18
18
  "preview:vite": "vite preview",
19
19
  "analyze": "cem analyze --litelement --globs \"{src,define}/**/*.{js,ts}\" \"index.js\"",
20
20
  "sort:package": "npx sort-package-json",
21
- "postinstall": "npm run sort:package"
21
+ "postinstall": "npm run sort:package",
22
+ "prepare": "husky install"
22
23
  },
23
24
  "dependencies": {
24
25
  "lit": "^2.5.0"
25
26
  },
26
27
  "devDependencies": {
27
- "@blockquote/rollup-plugin-total-bundlesize": "^1.0.0",
28
+ "@blockquote/rollup-plugin-total-bundlesize": "^2.0.1",
28
29
  "@blockquote/sass-style-template": "^3.0.1",
29
30
  "@blockquote/coverage-table-reporter": "^1.0.0",
30
31
  "@custom-elements-manifest/analyzer": "^0.8.0",
31
32
  "@ungap/global-this": "^0.4.4",
32
- "@web/dev-server": "^0.1.37",
33
- "@web/rollup-plugin-html": "^1.11.0",
33
+ "@web/rollup-plugin-html": "^2.0.0",
34
34
  "@webcomponents/shadycss": "^1.11.2",
35
35
  "@webcomponents/webcomponentsjs": "^2.8.0",
36
36
  "concurrently": "^8.0.1",
37
37
  "rollup-plugin-copy": "^3.4.0",
38
38
  "tiny-array-flat-polyfill": "^0.2.1",
39
- "vite": "^4.2.1",
39
+ "vite": "^4.3.2",
40
40
  "sort-package-json": "^2.4.1"
41
41
  },
42
42
  "publishConfig": {
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx --no-install lint-staged
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "devDependencies": {
25
- "@typescript-eslint/eslint-plugin": "^5.57.1",
26
- "@typescript-eslint/parser": "^5.57.1"
25
+ "@typescript-eslint/eslint-plugin": "^5.59.1",
26
+ "@typescript-eslint/parser": "^5.59.1"
27
27
  }
28
28
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@open-wc/testing": "^3.1.7",
4
- "@web/test-runner": "^0.15.2",
5
- "@web/test-runner-playwright": "^0.9.0"
3
+ "@open-wc/testing": "^3.1.8",
4
+ "@web/test-runner": "^0.16.0",
5
+ "@web/test-runner-playwright": "^0.10.0"
6
6
  }
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "devDependencies": {
3
- "@open-wc/testing": "^3.1.7",
4
- "@web/test-runner": "^0.15.2",
5
- "@web/test-runner-playwright": "^0.9.0"
3
+ "@open-wc/testing": "^3.1.8",
4
+ "@web/test-runner": "^0.16.1",
5
+ "@web/test-runner-playwright": "^0.10.0"
6
6
  }
7
7
  }
@@ -27,8 +27,6 @@
27
27
  ],
28
28
  "scripts": {
29
29
  "build": "echo \"This is not a TypeScript project, so no need to build.\"",
30
- "sass:watch": "sass-style-template",
31
- "start:wds": "concurrently -k -r \"npm:sass:watch\" \"npm:wds\"",
32
- "wds": "web-dev-server"
30
+ "sass:watch": "sass-style-template"
33
31
  }
34
32
  }
@@ -27,12 +27,10 @@
27
27
  "scripts": {
28
28
  "build": "npm run build:tsc && npm run dev:vite",
29
29
  "build:tsc": "tsc",
30
- "sass:watch": "sass-style-template -j ts",
31
- "start:wds": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"npm:sass:watch\" \"npm:wds\"",
32
- "wds": "web-dev-server"
30
+ "sass:watch": "sass-style-template -j ts"
33
31
  },
34
32
  "devDependencies": {
35
33
  "tslib": "^2.5.0",
36
- "typescript": "^5.0.3"
34
+ "typescript": "^5.0.4"
37
35
  }
38
36
  }
@@ -1,27 +0,0 @@
1
- // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2
-
3
- /** Use Hot Module replacement by adding --hmr to the start command */
4
- const hmr = process.argv.includes('--hmr');
5
-
6
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7
- open: '/demo/',
8
- /** Use regular watch mode if HMR is not enabled. */
9
- watch: !hmr,
10
- /** Resolve bare module imports */
11
- nodeResolve: {
12
- exportConditions: ['browser', 'development'],
13
- },
14
-
15
- /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16
- // esbuildTarget: 'auto'
17
-
18
- /** Set appIndex to enable SPA routing */
19
- // appIndex: 'demo/index.html',
20
-
21
- plugins: [
22
- /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
23
- // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
24
- ],
25
-
26
- // See documentation for all available options
27
- });