What are Changesets?
Changesets is a tool for managing versions and changelogs in monorepos. Each PR includes a file describing the changes. When publishing, Changesets groups changes, calculates new versions, and generates changelogs.
Installation
npm install --save-dev @changesets/cli
npx changeset init
Workflow
- Developer runs
npx changesetand selects affected packages. - Selects change type (major, minor, patch).
- Writes a summary for the changelog.
- A
.mdfile is generated in.changeset/and committed with the PR.
Publishing
npx changeset version
npx changeset publish
Changesets vs Semantic Release
Changesets is designed for multi-package monorepos. Semantic Release assumes a single package. For monorepos with multiple independent packages, Changesets is the better choice.
Benefits
- Each PR explicitly describes its changes.
- Changelogs are accurate per package.
- Version is decided in the PR, not after.
- Ideal for libraries and shared packages.
Using a monorepo with multiple packages? At Vynta we configure Changesets for your project.