create-vue3-enterprise 1.0.31 → 1.0.32

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -163,7 +163,6 @@ async function main() {
163
163
  value: "vue3-ts-full"
164
164
  }
165
165
  ],
166
- // 新增:选中模板后立即输出 value 到终端
167
166
  onState: (state) => {
168
167
  const selectedTemplate = state.value;
169
168
  if (selectedTemplate) {
@@ -171,18 +170,22 @@ async function main() {
171
170
  }
172
171
  }
173
172
  },
174
- // 询问 Router:仅当模板不是全量模板时显示
173
+ // 询问 Router:输出 prev.template 并判断显示
175
174
  {
176
175
  type: (prev) => {
176
+ // 调试输出:打印 prev.template 的值
177
+ console.log(yellow(`\n[调试] needsRouter 阶段 prev.template = ${prev.template}`));
177
178
  return ["vue3-ts", "vue3-ts-pinia"].includes(prev.template) ? "confirm" : null;
178
179
  },
179
180
  name: "needsRouter",
180
181
  message: "添加 Vue Router?",
181
182
  initial: true
182
183
  },
183
- // 询问 Pinia:仅当模板是基础模板(vue3-ts)时显示
184
+ // 询问 Pinia:输出 prev.template 并判断显示
184
185
  {
185
186
  type: (prev) => {
187
+ // 调试输出:打印 prev.template 的值
188
+ console.log(yellow(`\n[调试] needsPinia 阶段 prev.template = ${prev.template}`));
186
189
  return prev.template === "vue3-ts" ? "confirm" : null;
187
190
  },
188
191
  name: "needsPinia",
@@ -208,6 +211,8 @@ async function main() {
208
211
  },
209
212
  {
210
213
  type: (prev) => {
214
+ // 调试输出:打印 prev.template 的值
215
+ console.log(yellow(`\n[调试] overwrite 阶段 prev.template = ${prev.template}`));
211
216
  // 仅当目录存在且非空时,才显示确认覆盖的选项
212
217
  return targetDir && fs.existsSync(targetDir) && fs.readdirSync(targetDir).length > 0 ? "confirm" : null;
213
218
  },
@@ -221,8 +226,8 @@ async function main() {
221
226
  process.exit(1);
222
227
  }
223
228
  });
224
- // 可选:在所有交互完成后,也可以输出最终选中的模板值(二次确认)
225
- console.log(green(`\n📌 最终确认:你选择的模板值是: ${promptResult.template}`));
229
+ // 最终输出:确认所有交互完成后的 prev.template 最终值(即 promptResult.template)
230
+ console.log(green(`\n📌 最终确认:prev.template 的最终值是: ${promptResult.template}`));
226
231
  if (promptResult.overwrite === false) {
227
232
  console.log(red("✖ 操作已取消"));
228
233
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vue3-enterprise",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "Vue3 + TypeScript + Vite 企业级项目脚手架",
5
5
  "type": "module",
6
6
  "bin": {