Npm Factory

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/init

The interactive wizard walks you through:

  1. Project id — kebab-case name (e.g. acme-sdk). Used for folder names and site title.
  2. Scope — npm scope for generated packages (e.g. @acme).
  3. Modules — one or more packages to generate. Each module has an id (core, react, etc.), kind, platforms, and stability.
  4. 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
FlagRequiredDescription
--projectyesProject id (kebab-case)
--scopeyesnpm scope (e.g. @acme)
--modulesyesComma-separated module ids
--playgroundyesnone, 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 parallel

Edit 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

On this page