Skip to content

pantoken-root / ai/pantoken-ai/src / scaffoldProject

函数: scaffoldProject()

scaffoldProject(platform, dir?, options?): Promise<string[]>

Alpha

为某个平台生成一个入门项目模板,已预装并集成 pantoken。

参数

platform

string

一个 ScaffoldPlatform

dir?

string

目标目录(默认 ".")。其基名(或针对 "." 使用 "pantoken-app") 在模板文件中替换为

options?

ScaffoldProjectOptions

theme/mode 选择 哪些 @pantoken/css 代币 表 生成 的 文件 导入(默认 "rebrand"/"light")),应用 于 每个平台。 cdn 选择 CDN 提供商 canvas-theme-editortheme.css/theme.js 为 其 构建(默认 jsDelivr); 被 所有 其他 平台 忽略)。 locale(默认 "en") 设置 生成 的 标记 的 lang/dir 属性。

返回值

Promise<string[]>

写入的路径。

示例

生成一个 React 入门模板

ts
import { scaffoldProject } from "@pantoken/scaffold";

scaffoldProject("react", "./my-app");
scaffoldProject("vue", "./my-vue-app", { theme: "canvas", locale: "hu" });