create-vue3-enterprise 1.0.24 → 1.0.26

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/dist/index.js CHANGED
@@ -12,8 +12,8 @@ const argv = minimist(process.argv.slice(2), {
12
12
  alias: {
13
13
  h: "help",
14
14
  t: "template",
15
- f: "force",
16
- },
15
+ f: "force"
16
+ }
17
17
  });
18
18
  const cwd = process.cwd();
19
19
  const __filename = fileURLToPath(import.meta.url);
@@ -70,9 +70,7 @@ function copyDir(srcDir, destDir) {
70
70
  }
71
71
  async function generatePackageJson(targetDir, options) {
72
72
  const pkg = {
73
- name: isValidPackageName(targetDir)
74
- ? targetDir
75
- : toValidPackageName(targetDir),
73
+ name: isValidPackageName(targetDir) ? targetDir : toValidPackageName(targetDir),
76
74
  version: "0.0.0",
77
75
  private: true,
78
76
  type: "module",
@@ -87,17 +85,18 @@ async function generatePackageJson(targetDir, options) {
87
85
  format: "prettier --write .",
88
86
  "type-check": "vue-tsc --noEmit",
89
87
  prepare: "husky install",
90
- "lint-staged": "lint-staged",
88
+ "lint-staged": "lint-staged"
91
89
  },
92
90
  dependencies: {
93
- vue: "^3.4.0",
91
+ vue: "^3.4.0"
94
92
  },
95
93
  devDependencies: {
96
94
  "@vitejs/plugin-vue": "^5.0.0",
97
95
  typescript: "^5.3.0",
98
96
  vite: "^5.0.0",
99
97
  "vue-tsc": "^1.8.0",
100
- },
98
+ "@rushstack/eslint-patch": "^1.16.1"
99
+ }
101
100
  };
102
101
  if (options.needsRouter) {
103
102
  pkg.dependencies["vue-router"] = "^4.2.0";
@@ -150,7 +149,7 @@ async function main() {
150
149
  initial: "vue3-enterprise-project",
151
150
  onState: (state) => {
152
151
  targetDir = String(state.value).trim() || "vue3-enterprise-project";
153
- },
152
+ }
154
153
  },
155
154
  {
156
155
  type: "select",
@@ -161,9 +160,9 @@ async function main() {
161
160
  { title: "Vue3 + TypeScript + Vite + Pinia", value: "vue3-ts-pinia" },
162
161
  {
163
162
  title: "Vue3 + TypeScript + Vite + Pinia + Vue Router",
164
- value: "vue3-ts-full",
165
- },
166
- ],
163
+ value: "vue3-ts-full"
164
+ }
165
+ ]
167
166
  },
168
167
  {
169
168
  type: "multiselect",
@@ -175,46 +174,42 @@ async function main() {
175
174
  {
176
175
  title: "Playwright (E2E 测试)",
177
176
  value: "playwright",
178
- selected: true,
177
+ selected: true
179
178
  },
180
179
  { title: "Vue3 Enterprise MCP", value: "mcp", selected: true },
181
180
  { title: "CI/CD 工作流", value: "ci", selected: true },
182
- { title: "性能基准测试", value: "perf", selected: true },
183
- ],
181
+ { title: "性能基准测试", value: "perf", selected: true }
182
+ ]
184
183
  },
185
184
  {
186
185
  type: "confirm",
187
186
  name: "needsTypeScript",
188
187
  message: "使用 TypeScript?",
189
- initial: true,
188
+ initial: true
190
189
  },
191
190
  {
192
191
  type: "confirm",
193
192
  name: "needsRouter",
194
193
  message: "添加 Vue Router?",
195
- initial: true,
194
+ initial: true
196
195
  },
197
196
  {
198
197
  type: "confirm",
199
198
  name: "needsPinia",
200
199
  message: "添加 Pinia (状态管理)?",
201
- initial: true,
200
+ initial: true
202
201
  },
203
202
  {
204
203
  type: "confirm",
205
204
  name: "overwrite",
206
- message: targetDir &&
207
- fs.existsSync(targetDir) &&
208
- fs.readdirSync(targetDir).length > 0
209
- ? `目录 "${targetDir}" 已存在且不为空。是否覆盖?`
210
- : "",
211
- initial: false,
212
- },
205
+ message: targetDir && fs.existsSync(targetDir) && fs.readdirSync(targetDir).length > 0 ? `目录 "${targetDir}" 已存在且不为空。是否覆盖?` : "",
206
+ initial: false
207
+ }
213
208
  ], {
214
209
  onCancel: () => {
215
210
  console.log(red("✖ 操作已取消"));
216
211
  process.exit(1);
217
- },
212
+ }
218
213
  });
219
214
  if (promptResult.overwrite === false) {
220
215
  console.log(red("✖ 操作已取消"));
@@ -240,7 +235,7 @@ async function main() {
240
235
  const pkg = await generatePackageJson(targetDir, {
241
236
  features: promptResult.features || [],
242
237
  needsRouter: promptResult.needsRouter,
243
- needsPinia: promptResult.needsPinia,
238
+ needsPinia: promptResult.needsPinia
244
239
  });
245
240
  fs.writeFileSync(path.join(root, "package.json"), JSON.stringify(pkg, null, 2));
246
241
  const featureDescriptions = {
@@ -249,7 +244,7 @@ async function main() {
249
244
  playwright: "- 🎭 Playwright E2E 测试",
250
245
  mcp: "- 🔍 Vue3 Enterprise MCP 代码审查",
251
246
  ci: "- ⚡ CI/CD 自动化",
252
- perf: "- 📊 性能基准测试",
247
+ perf: "- 📊 性能基准测试"
253
248
  };
254
249
  const readme = `# ${pkg.name}
255
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vue3-enterprise",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "Vue3 + TypeScript + Vite 企业级项目脚手架",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "semi": false,
3
3
  "singleQuote": true,
4
- "trailingComma": "es5",
4
+ "trailingComma": "none",
5
5
  "tabWidth": 2,
6
6
  "printWidth": 100,
7
7
  "endOfLine": "lf"
@@ -1,8 +1,10 @@
1
1
  module.exports = {
2
- // TypeScript and Vue files - check types
3
- '*.ts': ['vue-tsc --noEmit', 'eslint --fix'],
4
- '*.tsx': ['vue-tsc --noEmit', 'eslint --fix'],
5
- '*.vue': ['vue-tsc --noEmit', 'eslint --fix'],
6
- // Format all staged files
7
- '**/*': ['prettier --write --ignore-unknown'],
2
+ // TypeScript and Vue files - lint only (skip slow type check in pre-commit)
3
+ '*.ts': ['eslint --fix'],
4
+ '*.tsx': ['eslint --fix'],
5
+ '*.vue': ['eslint --fix'],
6
+ // Format only (fast)
7
+ '*.{js,jsx,json,css,html,md}': ['prettier --write'],
8
+ // Vue and TS files - format only (skip type check for speed)
9
+ '*.{ts,tsx,vue}': ['prettier --write'],
8
10
  }