Changesets are designed to make your workflows easier, by allowing the person making contributions to make key decisions when they are making their contribution. Changesets hold two key bits of information: a version type (following semver), and change information to be added to a changelog.
In addition, changesets were originally designed for implementation in bolt monorepos. As such, in a monorepo context, changesets will handle bumping dependencies of changed packages, if that is required.
This guide is aimed at package maintainers adding changesets as a tool. For the information relevant to contributors, see adding a changeset.
The overall tool after initialization should lead to a loop that looks like:
- Changesets added along with each change
- The version command is run when a release is ready, and the changes are verified
- The publish command is run afterwards.
The second two steps can be made part of a CI process.
npm install @changesets/cli && npx changeset initor
yarn add @changesets/cli && yarn changeset initnpx changesetor
yarn changesetNote: You can run
changeset addto add a changeset if you want to, but running Changesets without any command works as well.
Once you decide you want to do a release, you can run
npx changeset versionor
yarn changeset versionThis consumes all changesets, and updates to the most appropriate semver version based on those changesets. It also writes changelog entries for each consumed changeset.
We recommend at this step reviewing both the changelog entries and the version changes for packages. Once you are confident that these are correct, and have made any necessary tweeks to changelogs, you can publish your packages:
npx changeset publishor
yarn changeset publishThis will run npm publish in each package that is of a later version than the one currently listed on npm.
Since changesets are focused on releases and changelogs, changes to your repository that don't require these won't need a changeset. As such, we recommend not adding a blocking element to contributions in the absence of a changeset.