Skip to content

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

Function: scaffoldProject()

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

Alpha

Scaffold a starter project for a platform, with pantoken already installed and wired in.

Parameters

platform

string

A ScaffoldPlatform.

dir?

string

The target directory (default "."). Its basename (or "pantoken-app" for ".") is substituted for in the template files.

options?

ScaffoldProjectOptions

theme/mode select which @pantoken/css token sheet scaffolded files to import (default "rebrand"/"light"), applied across every platform). cdn selects the CDN provider canvas-theme-editor's theme.css/theme.js are built for (default jsDelivr); ignored by every other platform). locale (default "en") sets the generated markup's lang/dir attributes.

Returns

Promise<string[]>

The paths written.

Example

Scaffold a React starter

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

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