Using Changesets with pnpm
At the time of writing this documentation, the latest pnpm version was v6.14. The latest Changesets version was v2.16.0.
Setup
To setup changesets on a pnpm workspace, install changesets as a dev dependency in the root of the workspace:
pnpm add -Dw @changesets/cli
Then changesets' init command:
pnpm changeset init
Adding new changesets
To generate a new changeset, run pnpm changeset
in the root of the repository.
The generated markdown files in the .changeset
directory should be committed
to the repository.
Releasing changes
- Run
pnpm changeset version
. This will bump the versions of the packages previously specified withpnpm changeset
(and any dependents of those) and update the changelog files. - Run
pnpm install
. This will update the lockfile and rebuild packages. - Commit the changes.
- Run
pnpm publish -r
. This command will publish all packages that have bumped versions not yet present in the registry.
Using GitHub Actions
To automate the process, you can use changeset version
with GitHub actions.
Bump up package versions
The action will detect when changeset files arrive in the main
branch, and then open a new PR listing all the packages with bumped versions. Once merged, the packages will be updated and you can decide whether to publish or not by adding the publish
property.