Composition
Scaffolding
Generate a project containing only the surfaces you asked for.scripts/scaffold.mjs reads the manifests in composition/ and writes a new
project directory: the shell, the chosen surfaces, the union of the slices
those surfaces require, a generated package.json and a filtered
.env.example.
Last updated August 27, 2026- --surfaces — comma-separated surface ids. Required.
- --out — output directory. Required.
- --slices — capability slices no surface requires, such as billing. See Billing.
- --name — package name for the generated project.
- --url — the site's canonical URL.
- --targets — platforms beyond the web; mobile adds iOS and Android shells, desktop adds macOS, Windows and Linux ones. See Mobile apps and Desktop apps.
- --app-id — the bundle id for mobile and desktop.
- --dry-run — print the resolved plan and exit without writing.
- --json — machine-readable output.
- --force — overwrite an existing output directory.
- Create the route group under src/app/.
- Add composition/surfaces/<id>.json listing its files and requires.
- If the shell references the surface, add absentTransforms with exact anchors so the references are removed when the surface is left out.
- Scaffold both with and without it, and build both.
Edit this page on GitHub