优化第一阶段

This commit is contained in:
yinsx
2025-12-22 12:07:12 +08:00
parent dd99e932b4
commit 1df41ac4ab
38 changed files with 340 additions and 300 deletions

View File

@ -0,0 +1,42 @@
import color from "picocolors";
import { projectTypes } from "./config.js";
import { gridSelect } from "../../grid.js";
import { createScaffoldUI, formatResults, waitKey } from "./ui.js";
async function run() {
while (true) {
// 二级菜单 - 项目类型
const typeResult = await gridSelect({
items: projectTypes,
title: "项目搭建器 - 选择类型",
cols: Math.min(3, projectTypes.length),
colWidth: 20,
instructions: "←→ 选择 | Enter 确认 | Esc 返回",
onCancel: "back",
mapper: item => ({ action: "select", item }),
showUpdateButton: false,
});
if (typeResult === "back") return "back";
const projectType = typeResult.item.name;
// 三级页面 - 框架+组件配置(合并)
const ui = createScaffoldUI(projectType);
const result = await ui.runInteractive();
if (result) {
const summary = formatResults(result.steps, result.results);
ui.showSummary(summary);
console.log(color.yellow("功能开发中,敬请期待..."));
await waitKey();
}
}
}
export default {
id: "scaffold",
name: "项目搭建",
desc: "快速创建项目模板",
run,
};