@npm-factory/init
CLI that generates a complete TypeScript monorepo with ESM packages, Fumadocs site, build scripts, and Changesets — from a single command.
- Stability: beta
- Platform: Node.js
Usage
npx @npm-factory/initOr non-interactively:
npx @npm-factory/init \
--project my-lib \
--scope @my-org \
--modules core,react \
--playground singleCLI flags
| Flag | Description |
|---|---|
--project <id> | Project id in kebab-case |
--scope <scope> | npm scope (e.g. @my-org) |
--modules <ids> | Comma-separated module ids (e.g. core,react) |
--playground <mode> | none, single, or per-module |
All flags are required for non-interactive mode. Without them, the interactive wizard starts.
Re-running
Safe to run multiple times in the same directory. Existing files are skipped. Root package.json, turbo.json, tsconfig.base.json, and .changeset/config.json are patched (merged, not overwritten).
npm-factory-scripts
@npm-factory/init ships a npm-factory-scripts binary that provides check subcommands. These scripts discover your DOT config at runtime by scanning for packages/*-config/ in the workspace — no generated script files needed.
Subcommands
| Command | Description |
|---|---|
npm-factory-scripts validate | Validate DOT config |
npm-factory-scripts docs-sync | Create missing doc skeleton files |
npm-factory-scripts docs-orphans | Detect orphan doc directories |
npm-factory-scripts pack-smoke | Pack + install + import test for each module |
npm-factory-scripts changeset-required | Check that changesets exist for package changes |
npm-factory-scripts check | Run all checks in sequence (validate, docs-sync, docs-orphans, build+publint+attw, pack-smoke, changeset-required) |
The root pnpm check script runs npm-factory-scripts check.