Changeset Management Skill
This skill streamlines version control and release processes in the monorepo, utilizing Changesets.
Core Capabilities
- •Add Changeset: Quickly generate a changeset file to document changes.
- •Version Bump: Apply changesets to update package versions.
- •Changelog Update: Automatically update
CHANGELOG.mdfiles. - •Release Tagging: Create and push git tags corresponding to package releases.
Workflow
- •When making changes:
Run
pnpm changesetand select the affected packages. Choose the semver bump type (patch, minor, major) and write a summary. - •Release Preparation:
When ready to release, run
pnpm changeset version(or CI equivalent) to consume changesets and updatepackage.jsonversions and changelogs. - •Publishing:
Run
pnpm changeset publishafter successfully building and testing.
CI Integration Best Practices
- • Automated Version PR: Configure a GitHub Action that runs
changeset versionand opens a "Version Packages" PR. - • Release Trigger: On merging the Version PR to
main, trigger thepublishworkflow. - • Token Permissions: Ensure the
GITHUB_TOKENhas write permissions for contents and pull requests.
Common commands
- •
pnpm changeset: Interact with the CLI to create a new changeset. - •
pnpm changeset version: Bump versions based on changesets. - •
pnpm changeset publish: Publish packages to npm (requires authentication).
Troubleshooting
- •"No changesets found": Ensure you have committed the changeset file
.changeset/*.md. - •"Access restricted": Verify NPM token permissions and scope.