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.
- package/dist/index.js +10 -5
- 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
|
|
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📌
|
|
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);
|