用途:把 Figma Make 导出的 Vite + React 项目转换为可继续演化的页面组件或主题,尽量保持视觉、样式 token 与组件结构一致,并移除对原始 Vite 入口和版本化 alias 的依赖。
主要能力:预处理脚本会完整复制项目到 src/prototypes/[页面名]/ 或 src/themes/[theme-key]/,排除 node_modules、.npm-local-cache、build;把 @/ 转为相对路径,将 package@version 导入改为裸包名;分析组件、页面、依赖、CSS 与设计文档,生成 .figma-make-tasks.md、.figma-make-analysis.json 及主题模式的 .figma-make-theme-tasks.md。
使用方式:先用 node scripts/figma-make-converter.mjs <figma-make-project-dir> [output-name] 运行预处理,可加 --target-type themes;建议直接传入解压后的目录。随后按任务清单转换,页面验收用 node scripts/check-app-ready.mjs /prototypes/<page-name>。页面采用固定结构:根目录 index.tsx 仅做 Axhub 运行时适配,style.css 做样式桥接,src/ 下放 App.tsx、main.tsx、components/、styles/。style.css 以 @import "tailwindcss"; 加 src/styles/globals.css 为主样式来源。主题模式从 DESIGN_SYSTEM_GUIDE.md、TOKEN_REFERENCE.md、globals.css 与 CSS 变量提取 token,产出 globals.css 或 designToken.json、DESIGN-SPEC.md、index.tsx。
限制:不要把 src/index.css 直接当最终 style.css,不要保留对 package@version alias 的运行时依赖,不要塞入完整多页面路由壳层;canvas.fig、meta.json、ai_chat.json、thumbnail.png、canvas.code-manifest.json、images/ 等原始资产须保留。缺失信息暂未提供。