create-orb
v0.1.1
Published
Scaffolds a new project from the Orbit SaaS starter kit. Asks which optional features to include (teams, billing, uploads, waitlist) and strips the rest.
Maintainers
Readme
create-orb
Scaffolds a new project from the Orbit SaaS starter kit.
npm create orb@latest my-app
# or
npx create-orb my-app
# or
pnpm create orb my-appWhat it does
- Asks which optional features you want. Four y/n prompts:
- Teams + per-team PBAC — nested role scope inside a workspace
- Billing — Stripe subscriptions, webhooks, customer portal
- File uploads — UploadThing-backed avatars/images
- Waitlist — gated signups behind an allowlist
- Clones the upstream Orbit repo at the chosen ref.
- Runs a strip pass that removes any feature you said no to. It uses
// +feature:<name>/// -feature:<name>fence markers inside source files plus a repo-rootfeatures.jsonmanifest to know what to delete. - Optionally runs
npm install. - Prints next steps.
Nothing is written until after you confirm the summary.
Flags
create-orb [<target>] [options]
--from <url|path> Template source. Git URL or local directory.
Default: upstream Orbit repo.
--ref <branch> Branch, tag, or commit to clone. Default: main.
--teams=yes|no Include per-team PBAC.
--billing=yes|no Include billing (Stripe).
--billing-provider=stripe Pick a billing provider. Only stripe today.
--uploads=yes|no Include file uploads (UploadThing).
--waitlist=yes|no Include the waitlist flow.
--no-install Skip `npm install` after scaffolding.
-y, --yes Accept defaults for anything not given as a flag.
-h, --help
-v, --versionEnv-var equivalents: ORBIT_TEMPLATE_SOURCE, ORBIT_TEMPLATE_REF.
Headless / CI example
create-orb ./out \
--from ~/code/orbit \
--teams=yes --billing=no --uploads=yes --waitlist=no \
--no-install -yHow the strip works
Every optional feature declares itself in features.json at the root of
the template:
{
"features": {
"teams": {
"files": ["apps/api/src/teams/", "apps/api/src/interfaces/http/controllers/teams.controller.ts", ...],
"envKeys": []
}
}
}For each feature the user opts out of, the strip pass:
- Deletes every
filespath recursively (directories or single files). - Walks the whole repo once and removes every line between
// +feature:<name>and// -feature:<name>markers, inclusive. The walker skipsnode_modules/,.git/, build outputs, etc. This means contributors can add fences in new files without having to updatefeatures.json— the walk is the source of truth. - Scrubs every
envKeysentry fromapps/*/.env.example.
Three fence syntaxes are accepted so the same markers work across TS, TSX, Prisma, and JSX contexts:
// +feature:teams
// -feature:teams
/* +feature:teams */
/* -feature:teams */
{/* +feature:teams */}
{/* -feature:teams */}Fences must live on their own line, paired, at the same nesting. Nested SAME-name fences are disallowed; nested DIFFERENT-name fences are fine.
Development
# in the Orbit monorepo
cd packages/create-orb
npm run dev -- ./tmp-app --from /Users/you/code/orbit -y --no-install--from accepts a local path for fast dev loops (no git round-trip).
