⚠️ Opinionated Template: This monorepo template is designed for our internal standards and workflows. Feel free to use, adapt, and extend it for your own projects.
A modern TypeScript monorepo template for npm packages, managed with pnpm and TurboRepo.
- Monorepo structure with workspaces
- TypeScript support
- Linting and formatting with ESLint and Prettier
- Easy dependency management with pnpm
- Run setup after cloning:
pnpm run setup
- Build all packages:
pnpm build
- Run tests:
pnpm test
-
First, ensure the repository URL is included in the root
package.json. This allows Turbo to automatically set therepositoryproperty for packages in the monorepo:{ "repository": { "type": "git", "url": "https://github.com/user/repo.git" } } -
packages/example-package – Example package included by default. You can remove this and run
pnpm run turbo:gen:initto generate a new package for your monorepo.
In this template, we use @pixpilot as a placeholder for package names. As a user, you might want to replace it with your own organization or project name.
This monorepo uses the Changeset Autopilot GitHub Action for fully automated, dependency-aware versioning and publishing. It:
- Detects conventional commits and generates changesets automatically
- Handles branch-based release channels (main, next, beta, etc.)
- Versions and publishes only changed packages to npm
- Manages pre-releases and dist-tags
- Runs entirely in CI for maximum reliability
How it works:
- On every push to a release branch, the action analyzes commits, generates changesets, versions packages, and publishes to npm.
- No manual steps are needed—just follow the conventional commit format and push to the correct branch.
- See the Changeset Autopilot documentation for setup and configuration details.
Manual releases are possible if needed (for example, for hotfixes or if CI is unavailable):
- Ensure you have an
NPM_TOKENwith publish rights set in your environment (for CI/CD, set as a secret). - Run the following commands from the root:
This will version and publish only those workspace packages with relevant changes.
pnpm changeset pnpm changeset version pnpm changeset publish
- Each package is versioned independently.
- Git tags are created in the format
<package-name>-<version>. - See
.changeset/config.jsonfor configuration details.
For more, see the Changesets documentation.
See CONTRIBUTING.md for guidelines.