Version
Bump versions based on changesets.
Synopsis
Description
The version command reads all changeset files and bumps package versions accordingly. It:
- Reads all changesets from
.changes/ or .changesets/
- Determines the bump level for each package (highest level wins when multiple changesets affect the same package)
- Updates version numbers in package manifest files
- Updates dependencies that reference bumped packages
- Generates changelog entries from changesets
- Runs
post-version commands (if configured)
- Cleans up consumed changeset files
Options
| Option |
Description |
--allow-dirty |
Allow git repository with uncommitted changes |
Requirements
- Semifold must be initialized (
smif init previously run)
- Git repository should be clean (all changes committed), or use
--allow-dirty
Version Bumping Logic
When multiple changesets affect the same package, the highest bump level is used:
| Changesets |
Final Bump |
| patch + patch |
patch |
| patch + minor |
minor |
| minor + patch |
minor |
| major + minor |
major |
Examples
Standard Usage
Allow Dirty Repository
smif version --allow-dirty
Output
The command displays:
- Packages being bumped
- Old version → New version for each package
- Post-version commands being executed
- Warnings for unchanged packages
Post-Version Commands
After bumping versions, Semifold runs configured post-version commands. For example, for Rust packages:
[resolver.rust]
post-version = [
{ command = "cargo", args = ["generate-lockfile", "--offline"], dry_run = true }
]
See Also