npm-factory
Scaffolds a complete TypeScript monorepo with publishable ESM packages, a Fumadocs documentation site, and build tooling — all driven by a single config file (DOT).
Quick start
mkdir my-project && cd my-project && git init
npx @npm-factory/initThe interactive wizard walks you through:
- Project id — kebab-case name (e.g.
acme-sdk). Used for folder names and site title. - Scope — npm scope for generated packages (e.g.
@acme). - Modules — one or more packages to generate. Each module has an id (
core,react, etc.), kind, platforms, and stability. - Playgrounds — none, one shared, or one per module.
After confirming, it creates the full monorepo structure and you're ready to go.
Non-interactive mode
npx @npm-factory/init \
--project acme-sdk \
--scope @acme \
--modules core,react \
--playground single| Flag | Required | Description |
|---|---|---|
--project | yes | Project id (kebab-case) |
--scope | yes | npm scope (e.g. @acme) |
--modules | yes | Comma-separated module ids |
--playground | yes | none, single, or per-module |
What gets generated
my-project/
├── packages/<project>-config/ # DOT config + Zod schema
├── packages/<scope>-<module>/ # one per module (ESM, tsdown, TypeScript)
├── apps/<project>-site/ # Fumadocs documentation site (Next.js)
├── apps/<project>-playground/ # optional playground app
├── scripts/ # dot-validate, docs-sync, pack-smoke, etc.
├── turbo.json
├── pnpm-workspace.yaml
└── .changeset/After scaffolding
pnpm install
pnpm build # builds all packages + site
pnpm dev # starts site + playground in parallelEdit your DOT config at packages/<project>-config/src/dot.ts to add modules, change metadata, or configure docs. Re-running npx @npm-factory/init is safe — it skips existing files and patches root config.
Modules
- Init — the CLI scaffolder
- Docs Preset — Fumadocs components and nav helpers