Manage Package Versions Skill
This skill provides a standardized workflow for consistently bumping package versions across the entire monorepo. It ensures that both package.json files and the project changelog are kept in sync.
When to Use
- •When you need to update all packages to a specific version (e.g., "update to 0.1.0").
- •When preparing for a new release.
- •When syncing workspace package versions.
Instructions
Critical Constraints
- •NO Git Commits or Pushes: Do NOT perform any
git commit,git push, or similar destructive git operations as part of this skill. Only stage changes if necessary for verification, but never commit them. Leave these actions to the user.
1. Bump Package Versions
Use pnpm to update versions in package.json files. For monorepos, you must update both the root and all workspace packages.
To update the root version:
pnpm version <version> --no-git-tag-version
To update all workspace packages recursively:
pnpm -r version <version> --no-git-tag-version
Note: The --no-git-tag-version flag prevents pnpm from creating a git commit and tag automatically, allowing you to review changes first.
2. Update Changelog with Changie
After bumping the package versions, you must also update the changelog to reflect the new version.
Batch unreleased changes into the new version:
changie batch <version>
Merge the new version notes into CHANGELOG.md:
changie merge
Best Practices
- •Always use the same
<version>string for bothpnpmandchangiecommands. - •Run
pnpm installafter bumping versions to update thepnpm-lock.yaml. - •Verify the changes in
package.jsonfiles andCHANGELOG.mdbefore committing.