explaingit

changesets/changesets

11,838TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

A tool that automates version bumping and changelog generation for JavaScript projects, especially monorepos with multiple packages, by collecting small changeset files contributed alongside code changes.

Mindmap

mindmap
  root((changesets))
    What it does
      Tracks version bumps
      Generates changelogs
      Publishes to npm
    Concepts
      Changeset files
      Semver levels
      Monorepo packages
    Automation
      GitHub Action
      GitHub bot
      CI publishing
    Audience
      JS library authors
      Monorepo teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Manage semver version bumps and changelogs across all packages in a JavaScript monorepo in a single automated release step.

USE CASE 2

Require contributors to declare what version bump their PR introduces before merging, using the GitHub bot check.

USE CASE 3

Automate publishing packages to npm via a CI GitHub Action that creates versioning PRs and triggers publishing on merge.

Tech stack

TypeScriptNode.js

Getting it running

Difficulty · moderate Time to first run · 30min

Full CI automation requires GitHub Actions setup and npm publish credentials, the CLI itself is quick to install.

In plain English

Changesets is a TypeScript tool for managing version numbers and changelogs in JavaScript projects, with particular strength in repositories that contain multiple packages (often called monorepos). It covers the full release cycle: from a developer recording that their change should bump a version, through to the automated update of package version numbers, changelog files, and publishing to npm. The central concept is the changeset file. While writing code, a contributor runs a CLI command that creates a small file declaring which packages are affected, whether the change is a major, minor, or patch-level bump following the semver convention, and a short description of what changed. These files accumulate in the repository as separate contributions come in. When it is time to make a release, the CLI reads all the pending changeset files and merges them into a single coherent release. It works out the correct version number for each package, accounts for packages in the same repository that depend on one another, and updates all version fields and changelog files in one pass. A single command then publishes the updated packages. For teams using continuous integration, a GitHub Action is available that automates creating versioning pull requests and optionally publishing packages. A GitHub bot can also check incoming pull requests to confirm they include a changeset file before merging. The project has been widely adopted across the JavaScript ecosystem. Notable users listed in the README include Astro, SvelteKit, Remix, Apollo Client, MobX, Chakra UI, pnpm, Formik, Firebase's JavaScript SDK, and many others. The README links to detailed documentation covering prerelease versions, snapshot releases, linked packages, and modifying the changelog format.

Copy-paste prompts

Prompt 1
I'm maintaining a monorepo with 5 npm packages using changesets. Walk me through the workflow: how contributors add a changeset, how I run a release, and how it handles cross-package dependencies.
Prompt 2
Set up a GitHub Actions workflow using the changesets action that automatically creates a versioning PR and publishes to npm when changesets are merged to main.
Prompt 3
How do I configure changesets to write custom changelog entries, for example linking to a Jira ticket number extracted from the changeset description?
Prompt 4
I want the changesets GitHub bot to block merging any PR that doesn't include a changeset file. How do I configure this check for my repo?
Open on GitHub → Explain another repo

← changesets on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.