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: All deployable surfaces live under
apps/while reusable templates reside inpackages/, keeping responsibilities clear. - 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.
apps/
cli/ # CLI application scaffold
client/ # Web client (e.g., Vue/React)
server/ # Server or API layer
website/ # Static site or documentation portal
packages/
monorepo/ # @icebreakers/monorepo helper scripts
tsup-template/ # Library template powered by tsup
unbuild-template/ # Library template powered by unbuild
vue-lib-template/ # Vue component library template
apps/cli: Sample CLI app scaffold.apps/client: Sample rich web client application.apps/server: Entry point for server or API services.apps/website: Static marketing or documentation site starter.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. |
- Click “Use this template” on GitHub, or clone the repository and update the remote origin.
- Install dependencies and run
pnpm script:initto align workspace configuration. - Remove unused apps/packages or duplicate existing templates to spin up new modules quickly.
- Keep versions aligned via
pnpm script:sync.
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.