Project creation

generator-white-label

Create a production-oriented TypeScript starter that composes the White Label packages, with optional JSX or equivalent plain-TypeScript templates.

Install and requirements

  • Node.js ^22.18.0 or >=24.11.0
  • npm >=11
npx generator-white-label create my-project
npm install --global generator-white-label
white-label create my-project
import {createProject} from 'generator-white-label';

CLI workflow

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-jsx

Programmatic creation

createProject() 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
});

Generated architecture

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.

CLI contract

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

--jsx

Generate JSX/TSX page and view templates using the White Label JSX runtime.

Returns
CLI option.
Runtime
Node.js CLI

--no-jsx

Generate equivalent plain-TypeScript templates that return HTML strings.

Returns
CLI option.
Runtime
Node.js CLI

white-label --help

Show command usage.

Returns
CLI help output.
Runtime
Node.js CLI

Programmatic API

createProject(options)

Write a complete White Label scaffold using the same implementation as the CLI.

ParameterTypeDefaultDescription
destinationstringRequired filesystem destination.
jsxbooleantruetrue for JSX/TSX, false for equivalent plain-TypeScript HTML templates.
Returns
Promise<void>; resolves with undefined when creation is complete.
Throws / rejects
Promise rejects on filesystem or scaffold-writing failures.
Runtime
Node.js

TypeScript

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.

Security and trust boundaries

Generated JSX escapes ordinary dynamic values by default. Plain-TypeScript HTML templates must escape untrusted values before interpolation.

Design boundaries

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.