@blockquote/create-wc 2.8.2 → 2.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockquote/create-wc",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Web component with Lit scaffolding - Extending Open Web Component",
5
5
  "keywords": [
6
6
  "Lit",
@@ -57,7 +57,7 @@
57
57
  "@open-wc/eslint-config": "^13.0.0",
58
58
  "eslint": "^9.39.2",
59
59
  "eslint-config-prettier": "^10.1.8",
60
- "prettier": "^3.7.4",
60
+ "prettier": "^3.8.0",
61
61
  "globals": "^17.0.0"
62
62
  },
63
63
  "engines": {
package/src/Generator.js CHANGED
@@ -81,11 +81,17 @@ function spawnCommand(command, args, options = {}) {
81
81
  * @param {string} command
82
82
  * @param {object} options
83
83
  */
84
- function _install(command = 'npm', options = {}) {
84
+ /**
85
+ * @param {string} command
86
+ * @param {string[]} args
87
+ * @param {object} options
88
+ * @param {string} errorAction - description of action for error message
89
+ */
90
+ function runTask(command, args, options, errorAction) {
85
91
  return new Promise((resolve, reject) => {
86
92
  let child;
87
93
  try {
88
- child = spawnCommand(command, ['install'], options);
94
+ child = spawnCommand(command, args, options);
89
95
  } catch (error) {
90
96
  reject(error);
91
97
  return;
@@ -93,19 +99,27 @@ function _install(command = 'npm', options = {}) {
93
99
 
94
100
  child.on('error', (error) => {
95
101
  const cwd = normalizeCwd(options.cwd);
96
- reject(new Error(`Failed to run ${command} install in ${cwd}: ${error.message}`));
102
+ reject(new Error(`Failed to ${errorAction} in ${cwd}: ${error.message}`));
97
103
  });
98
104
 
99
105
  child.on('close', (code) => {
100
106
  if (code === 0) {
101
107
  resolve();
102
108
  } else {
103
- reject(new Error(`${command} install failed with code ${code}`));
109
+ reject(new Error(`${command} ${args.join(' ')} failed with code ${code}`));
104
110
  }
105
111
  });
106
112
  });
107
113
  }
108
114
 
115
+ /**
116
+ * @param {string} command
117
+ * @param {object} options
118
+ */
119
+ function _install(command = 'npm', options = {}) {
120
+ return runTask(command, ['install'], options, `run ${command} install`);
121
+ }
122
+
109
123
  /**
110
124
  *
111
125
  * @param {string} where
@@ -165,34 +179,12 @@ class Generator extends _Generator.default {
165
179
  if (installDependencies === 'pnpm' || installDependencies === 'npm') {
166
180
  await installNpm(this.options.destinationPath, installDependencies);
167
181
 
168
- await new Promise((resolve, reject) => {
169
- let child;
170
- try {
171
- child = spawnCommand(installDependencies, ['run', 'analyze'], {
172
- cwd: this.options.destinationPath,
173
- });
174
- } catch (error) {
175
- reject(error);
176
- return;
177
- }
178
-
179
- child.on('error', (error) => {
180
- const cwd = normalizeCwd(this.options.destinationPath);
181
- reject(
182
- new Error(
183
- `Failed to run ${installDependencies} run analyze in ${cwd}: ${error.message}`
184
- )
185
- );
186
- });
187
-
188
- child.on('close', (code) => {
189
- if (code === 0) {
190
- resolve();
191
- } else {
192
- reject(new Error(`${installDependencies} run analyze failed`));
193
- }
194
- });
195
- });
182
+ await runTask(
183
+ installDependencies,
184
+ ['run', 'analyze'],
185
+ {cwd: this.options.destinationPath},
186
+ `run ${installDependencies} run analyze`
187
+ );
196
188
  }
197
189
  }
198
190
  }
@@ -69,8 +69,8 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@eslint/js": "^9.39.2",
72
- "@html-eslint/eslint-plugin": "^0.52.1",
73
- "@html-eslint/parser": "^0.52.0",
72
+ "@html-eslint/eslint-plugin": "^0.53.0",
73
+ "@html-eslint/parser": "^0.53.0",
74
74
  "eslint": "^9.39.2",
75
75
  "eslint-config-prettier": "^10.1.8",
76
76
  "eslint-plugin-html": "^8.1.3",
@@ -78,12 +78,12 @@
78
78
  "eslint-plugin-lit": "^2.1.1",
79
79
  "eslint-plugin-lit-a11y": "^5.1.1",
80
80
  "eslint-plugin-wc": "^3.0.2",
81
- "typescript-eslint": "^8.52.0",
81
+ "typescript-eslint": "^8.53.1",
82
82
  "globals": "^17.0.0",
83
83
  "husky": "^9.1.7",
84
84
  "lint-staged": "^16.2.7",
85
- "prettier": "^3.7.4",
86
- "stylelint": "^16.26.1",
87
- "stylelint-config-standard-scss": "^16.0.0"
85
+ "prettier": "^3.8.0",
86
+ "stylelint": "^17.0.0",
87
+ "stylelint-config-standard-scss": "^17.0.0"
88
88
  }
89
89
  }
@@ -34,7 +34,7 @@
34
34
  "@open-wc/semantic-dom-diff": "^0.20.1",
35
35
  "@open-wc/testing-helpers": "^3.0.1",
36
36
  "playwright": "^1.57.0",
37
- "postcss-html": "^1.8.0",
37
+ "postcss-html": "^1.8.1",
38
38
  "postcss-lit": "^1.3.1",
39
39
  "@types/mocha": "^10.0.10",
40
40
  "rollup-plugin-copy": "^3.5.0",
@@ -43,11 +43,11 @@
43
43
  "chai-a11y-axe": "^1.5.0",
44
44
  "concurrently": "^9.2.1",
45
45
  "sort-package-json": "^3.6.0",
46
- "@vitest/browser-playwright": "^4.0.16",
47
- "@vitest/coverage-istanbul": "^4.0.16",
48
- "@vitest/coverage-v8": "^4.0.16",
49
- "@vitest/ui": "^4.0.16",
50
- "vitest": "^4.0.16",
46
+ "@vitest/browser-playwright": "^4.0.17",
47
+ "@vitest/coverage-istanbul": "^4.0.17",
48
+ "@vitest/coverage-v8": "^4.0.17",
49
+ "@vitest/ui": "^4.0.17",
50
+ "vitest": "^4.0.17",
51
51
  "vite": "^7.3.1"
52
52
  },
53
53
  "publishConfig": {