English | 中文版本
A modern pnpm + Turbo Repo + Changesets starter that helps you bootstrap production-ready monorepos quickly.
monorepo-template is a production-oriented pnpm + Turbo monorepo template. It ships with unified build, test, release, linting, and commit conventions, making it ideal for teams maintaining multiple deployable apps alongside reusable packages.
- Modular Architecture: Template sources live under
templates/while reusable tooling lives inpackages/, keeping responsibilities clear. - Centralized Scaffolding Assets:
@icebreakers/monorepo-templatespackages templates and assets for bothmonorepoandcreate-icebreaker. - Unified Toolchain: pnpm workspaces, Turbo task pipelines, Vitest, and Changesets streamline the entire lifecycle from development to release.
- Engineering Standards: ESLint, Stylelint, Husky, and Commitlint keep code quality high and commit messages consistent.
- Extensible Template: Helper scripts (
script:init,script:sync,script:clean, etc.) from@icebreakers/monorepokeep dependencies and scaffolding aligned. - CI/CD Ready: Sample GitHub Actions configuration, Codecov integration, and
secrets.NPM_TOKENsupport automated publishing and coverage reporting.
- Prepare environment: Ensure Node.js >= 20 and run
corepack enableso pnpm is available. - Install dependencies: Run
pnpm installto fetch every workspace dependency. - Local development: Use
pnpm devto launch Turbo parallel dev scripts and iterate within each app. - Build and verify: Run
pnpm build,pnpm test, andpnpm lintto validate builds, tests, and linting. - Template cleanup (optional): Use
pnpm script:cleanto prune sample packages when personalising the template.
- Zero-install cleanup on a fresh clone:
pnpm dlx @icebreakers/monorepo@latest clean --yes(add--include-privateto keep private packages in scope). - One-liner scaffold:
pnpm create icebreakerornpm create icebreaker@latestenters interactive mode, asks for the target directory, and lets you select which templates to keep. Use--templates tsup,vue-honoor--templates 2,5to preselect.
templates/
cli/ # CLI application scaffold
client/ # Web client (e.g., Vue/React)
server/ # Server or API layer
vitepress/ # Static site or documentation portal
tsup/ # Library template powered by tsup
tsdown/ # Library template powered by tsdown
unbuild/ # Library template powered by unbuild
vue-lib/ # Vue component library template
packages/
monorepo/ # @icebreakers/monorepo helper scripts
create-icebreaker/ # npm create flow
monorepo-templates/ # template and asset bundle for npm
templates/cli: Sample CLI app scaffold.templates/client: Sample rich web client application.templates/server: Entry point for server or API services.templates/vitepress: Static marketing or documentation site starter.templates/tsup: Library template powered by tsup.templates/tsdown: Library template powered by tsdown.templates/unbuild: Library template powered by unbuild.templates/vue-lib: Vue component library template.packages/*: Reusable packages and scaffolding shared across apps.- Root configuration files (
turbo.json,tsconfig.json,eslint.config.js, etc.) enforce consistent settings across the monorepo.
| Command | Description |
|---|---|
pnpm install |
Install workspace dependencies. |
pnpm dev |
Run every workspace exposing a dev script in parallel. |
pnpm build |
Execute a repository-wide build through Turbo. |
pnpm test / pnpm test:dev |
Run Vitest once or in watch mode. |
pnpm lint |
Apply ESLint and Stylelint checks across the monorepo. |
pnpm changeset |
Create an interactive Changeset for version bumps. |
pnpm publish-packages |
Build, lint, test, then version and publish changed packages. |
pnpm script:init |
Initialise template settings via @icebreakers/monorepo. |
pnpm script:sync |
Synchronise dependency and script versions. |
pnpm script:clean |
Remove sample packages and generated artifacts. |
- Use
pnpm create icebreakerto scaffold a trimmed workspace in a new directory. - Install dependencies and start development with
pnpm installandpnpm dev. - Add or remove apps/packages as your workspace evolves.
Leverage Changesets plus GitHub Actions for automated versioning:
- Capture changes with
pnpm changeset, marking each update as patch, minor, or major. - After merging, run
pnpm publish-packageslocally or let CI publish from themainbranch. - Configure
secrets.NPM_TOKENin GitHub to allow npm publishing.
- Code style:
.editorconfigenforces two-space indentation and LF line endings, while ESLint and Stylelint maintain consistency across packages. - Commit hooks: Husky and lint-staged run
eslint --fix,vitest, and other checks before commits. - Testing & coverage: Run
pnpm test -- --coverageto export coverage reports into thecoverage/directory. - Staying current: Use
npx @icebreakers/monorepo@latestto upgrade this template when new features ship.
- Documentation: https://monorepo.icebreaker.top/
- Contributing guide: See
CONTRIBUTING.mdfor workflow details. - Code of Conduct: Review
CODE_OF_CONDUCT.mdto understand community expectations. - Security policy: Follow
SECURITY.mdto report security issues. - License: Refer to
LICENSEfor the full open-source license text.