完善 脚手架UI
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import color from "picocolors";
|
||||
import { projectTypes, frameworks } from "./config.js";
|
||||
import { gridSelect, createComponentUI, formatResults, waitKey, showPlaceholder } from "./ui.js";
|
||||
import { projectTypes } from "./config.js";
|
||||
import { gridSelect, createScaffoldUI, formatResults, waitKey } from "./ui.js";
|
||||
|
||||
export async function run() {
|
||||
while (true) {
|
||||
@ -9,31 +9,16 @@ export async function run() {
|
||||
if (typeResult.action === "back") return "back";
|
||||
|
||||
const projectType = typeResult.item.name;
|
||||
const frameworkList = frameworks[projectType];
|
||||
|
||||
while (true) {
|
||||
// 三级菜单 - 框架选择
|
||||
const frameworkResult = await gridSelect(frameworkList, `${projectType}项目 - 选择框架`);
|
||||
if (frameworkResult.action === "back") break;
|
||||
// 三级页面 - 框架+组件配置(合并)
|
||||
const ui = createScaffoldUI(projectType);
|
||||
const result = await ui.runInteractive();
|
||||
|
||||
const framework = frameworkResult.item;
|
||||
|
||||
if (projectType === "前端" || projectType === "全栈") {
|
||||
// 组件配置
|
||||
const ui = createComponentUI(framework.name);
|
||||
const result = await ui.runInteractive();
|
||||
|
||||
if (result) {
|
||||
const summary = formatResults(result.results);
|
||||
ui.showSummary(summary);
|
||||
console.log(color.yellow("功能开发中,敬请期待..."));
|
||||
await waitKey();
|
||||
}
|
||||
} else {
|
||||
// 后端暂无组件配置
|
||||
showPlaceholder(framework);
|
||||
await waitKey();
|
||||
}
|
||||
if (result) {
|
||||
const summary = formatResults(result.steps, result.results);
|
||||
ui.showSummary(summary);
|
||||
console.log(color.yellow("功能开发中,敬请期待..."));
|
||||
await waitKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user