Automated Semantic Versioning for Monorepos and Single Packages
Turboversion is a powerful CLI tool that automates version bumps according to Semantic Versioning (SemVer). By analyzing your commit history or branch patterns, it intelligently determines version updates, saving you time and reducing human error in the versioning process.
- β Automatic version bumps based on commit messages or branch names
- β Monorepo support with both sync and async versioning modes
- β Semantic Versioning (SemVer) compliance
- β
Customizable through
version.config.json
- β PNPM workspace optimized
- β Supports prerelease versions
- β Skip specific packages when needed
# Using yarn
yarn add -D turboversion
# Using pnpm
pnpm add -D turboversion
# Using npm
npm install -D turboversion
In sync mode, all packages share the same version number. Ideal for tightly coupled packages.
Monorepo Example:
packages/
pkg-a/ (1.0.0)
pkg-b/ (1.0.0)
pkg-c/ (1.0.0)
After feat
commit β All become 1.1.0
Single Package: Updates the standalone package version.
Run with:
turboversion --bump [patch|minor|major]
Only updated packages get version bumps. Perfect for independent versioning.
Example:
packages/
pkg-a/ (1.0.0) β modified
pkg-b/ (1.0.0)
pkg-c/ (1.0.0) β modified
After changes β pkg-a 1.0.1, pkg-c 1.1.0 (based on changes)
Run with:
turboversion --async
Turboversion analyzes commit messages to determine version bumps:
Commit Type | Version Bump | Example Message |
---|---|---|
fix | Patch | fix(button): correct color |
feat | Minor | feat: add new component |
Breaking | Major | feat!: remove deprecated API |
Full type list:
feat
: New featuresfix
: Bug fixesdocs
: Documentation changesstyle
: Code style changesrefactor
: Code refactoringtest
: Test changeschore
: Maintenance tasks
Example:
git commit -m "feat(button): add new button"
Alternative approach using branch names:
{
"versionStrategy": "branchPattern",
"branchPattern": ["major", "minor", "patch"]
}
Example: Merging a branch named minor
will trigger a minor version bump.
Configure Turboversion to match your workflow:
{
"tagPrefix": "v",
"baseBranch": "main",
"sync": false,
"updateInternalDependencies": "patch",
"skip": ["private-pkg"],
"versionStrategy": "commitMessage",
"branchPattern": ["major", "minor", "patch"],
"prereleaseIdentifier": "beta",
"skipHooks": false
}
Key Options:
Option | Description | Default |
---|---|---|
tagPrefix | Git tag prefix | v |
baseBranch | Your main branch | main |
sync | Sync versioning mode | false |
versionStrategy | commitMessage or branchPattern |
commitMessage |
prereleaseIdentifier | Prerelease tag (e.g., beta) | - |
# 1. Update versions
pnpm turboversion
# 2. Publish all updated packages
pnpm publish -r
--help
: Show help--version
: Show version
-b
,--bump
: Version bump type (patch|minor|major|premajor|preminor|prepatch|prerelease)
-t
,--target
: Specific package to bump-b
,--bump
: Force specific bump type
β±οΈ Saves time - No more manual version updates π Reduces errors - Automatic SemVer compliance π€ Improves collaboration - Clear version history π§© Monorepo optimized - Flexible versioning strategies β‘ PNPM ready - Perfect workspace integration