white-label create <destination>
Create a project in the target directory.
- Returns
- Process success after scaffold creation; file-system failures surface as command errors.
- Runtime
- Node.js CLI
Project creation
Create a production-oriented TypeScript starter that composes the White Label packages, with optional JSX or equivalent plain-TypeScript templates.
npx generator-white-label create my-projectnpm install --global generator-white-label
white-label create my-projectimport {createProject} from 'generator-white-label';Interactive creation asks whether page/view templates should use JSX/TSX. Yes generates White Label JSX; No generates plain TypeScript functions returning HTML strings. Both variants produce equivalent application behavior.
For scripts or non-interactive environments, pass --jsx or --no-jsx explicitly. When no interactive answer is available and neither flag is supplied, JSX is the default.
npx generator-white-label create my-project --jsx
npx generator-white-label create my-project --no-jsxcreateProject() is the canonical creation engine. The CLI is an adapter around the same implementation rather than a separate scaffold path.
A successful call resolves after scaffold files and package metadata are written. File-system failures reject the promise rather than returning a status object.
import {createProject} from 'generator-white-label';
await createProject({
destination: './my-project',
jsx: false
});The generated application demonstrates Router → Mediator → Model → View as composable responsibilities, not mandatory framework layers. Static sections remain static; features use only the pieces they need.
The JSX and no-JSX scaffolds mirror the same structure and behavior. The difference is template syntax, not architecture or capabilities.
white-label create <destination>Create a project in the target directory.
--jsxGenerate JSX/TSX page and view templates using the White Label JSX runtime.
--no-jsxGenerate equivalent plain-TypeScript templates that return HTML strings.
white-label --helpShow command usage.
createProject(options)Write a complete White Label scaffold using the same implementation as the CLI.
| Parameter | Type | Default | Description |
|---|---|---|---|
destination | string | — | Required filesystem destination. |
jsx | boolean | true | true for JSX/TSX, false for equivalent plain-TypeScript HTML templates. |
The generated application uses strict TypeScript and the real White Label runtime packages.
When JSX is enabled, TypeScript uses jsx: react-jsx with jsxImportSource: white-label-view.
Generated JSX escapes ordinary dynamic values by default. Plain-TypeScript HTML templates must escape untrusted values before interpolation.
The generator creates the project; generated application behavior belongs to the runtime packages and application code.
Future creation integrations should call createProject() rather than copy templates or reimplement scaffold logic.