How-To Guide

How to Version a Monorepo with Changesets

Record intended version bumps per change and let a tool compute package versions and changelogs deterministically.

On this page

  1. Introduction
  2. The Versioning Bookkeeping Problem
  3. The Changeset Workflow
  4. How Dependent Bumps Propagate
  5. Publishing in CI
  6. Changelogs and Release Notes
  7. Common Pitfalls
  8. Conclusion

Introduction

In a monorepo with several published packages, deciding each package’s next version is a bookkeeping problem that humans get wrong. A change to a shared library should bump its version, and every package that depends on it should bump too, at least its minimum dependency range. Doing this by hand across many packages produces inconsistent versions and forgotten bumps. Changesets invert the workflow: each change records the version bumps it intends, and a tool computes the final versions and changelogs from all the recorded intents, deterministically. This article covers the workflow, how dependent bumps propagate, and how publishing fits into CI.

The Versioning Bookkeeping Problem

When a package changes, its version must change so consumers can pin the new one, and its changelog must record what changed. In a monorepo, a change to a library also affects every package that depends on it: their dependency range must be updated to include the new version, and if the change breaks the interface, their published code may need a bump too. Tracking this across dozens of packages by hand is error-prone, and the errors are subtle: a version that was not bumped, a range that excludes the new version, a changelog that omits a breaking change.

The fundamental issue is that the intent of a change and the resulting versions are computed at different times by different people. Changesets separate the two: the author records the intent at the time of the change, when they know what they did, and the tooling computes versions later from all the recorded intents.

The Changeset Workflow

A changeset is a small file added with a pull request that names the packages affected and the kind of bump for each: patch, minor or major. The author adds it when making the change, so the intent is captured in review. When it is time to release, a command consumes all pending changesets, computes the next versions, writes the changelogs, updates dependency ranges and removes the consumed changesets, all in one commit.

# Author a changeset alongside the code change
pnpm changeset
#   Which packages would you like to include?  @acme/lib, @acme/app
#   For @acme/lib:  minor
#   For @acme/app:  patch
#   Summary: add pagination support to the client

# Later, consume all pending changesets and compute new versions
pnpm changeset version
#  -> bumps package versions
#  -> updates internal dependency ranges
#  -> writes CHANGELOG entries
#  -> deletes the consumed changeset files

# Publish to the registry (CI does this after merge)
pnpm changeset publish

How Dependent Bumps Propagate

The valuable part is propagation. If a library gets a minor bump, every package that depends on it has its range updated, and if the library got a major bump, dependents get at least a patch so their published range moves. This is the rule that prevents the common failure where a consumer’s range still excludes the new version and the published packages cannot be installed together.

The tool decides the bump kind from the dependency’s bump: a minor change in a dependency yields a patch in the dependent, and a major change in a dependency yields a major in the dependent only if the dependent re-exports the changed API. You can adjust this in configuration, but the default propagation is what keeps a set of interdependent packages installable.

Publishing in CI

Publishing belongs in CI, not on a laptop, so it runs from a clean checkout with the right credentials and is auditable. The common pattern is a workflow that, on merge to the main branch, runs the version command and opens a release pull request with the computed versions; merging that pull request triggers the publish. The two-step keeps a human in the loop for the version decision while automating the mechanical part.

# GitHub Actions: changesets release flow
name: release
on:
  push:
    branches: [main]
jobs:
  release:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - run: pnpm install --frozen-lockfile
      - uses: changesets/action@v1
        with:
          version: pnpm changeset version      # opens/updates the release PR
          publish: pnpm changeset publish      # publishes when merged
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Changelogs and Release Notes

Because each changeset carries a human-written summary, the changelog is assembled from intents rather than from commit messages, so it reads as a list of user-visible changes instead of a list of commits. Group the summaries by package and by bump kind so a reader sees the breaking changes first. This quality is the reason to write a good summary at change time rather than relying on commit messages later.

Keep the changeset summaries user-facing: describe what changed for the consumer, not which files were touched. A summary that says which internal function was renamed is noise; one that says which behaviour changed is what a consumer needs to decide whether to upgrade.

Common Pitfalls

A pull request without a changeset means a change that ships without a version bump, so require a changeset in CI and allow an explicit empty changeset for changes that do not need one. This keeps the tool honest: every versioned change has a recorded intent.

Another pitfall is publishing before the release pull request is reviewed, which lets a version go out without a human check. Keep the two steps separate, and never publish from a non-main branch. Finally, do not let one package’s version drift ahead of its changelog; if the version changes, the changelog entry must exist, which the tool records from the changeset.

Conclusion

Changesets turn monorepo versioning from manual bookkeeping into a recorded intent and a computed result. Each change adds a changeset naming the packages and bump kinds, the release command propagates versions through dependency ranges and assembles changelogs, and CI runs the release in two steps so a human approves the version decision. Require a changeset in review, publish only from the main branch after the release pull request merges, and write user-facing summaries. Then a set of interdependent packages is always installable and its changelogs describe what changed.

Sources: Changesets, Semantic Versioning 2.0.0, changesets/action.

FAQ

What happens to packages that depend on a bumped package?
Their dependency ranges are updated automatically, and they receive at least a patch bump so their published range moves to include the new version. This propagation is what keeps interdependent packages installable together.
Why require a changeset in every pull request?
So no versioned change ships without a recorded bump, which is exactly the failure changesets exist to prevent. Allow an explicit empty changeset for changes that genuinely need no version bump.

Related Examples