Manage package versioning with changeset add, version, publish, CHANGELOG generation, monorepo linked packages, and pre-release mode
0 / 5 completed
1 / 5
What does changeset add do in a Changesets workflow?
changeset add: Runs interactively, asking which packages changed and the semver bump type. Creates a file in .changeset/ with a random name like blue-dogs-eat.md. The file contains YAML frontmatter listing packages and bump types, plus a markdown description used as the changelog entry. This file is PR-reviewed alongside code changes.
2 / 5
What happens when you run changeset version?
changeset version: Reads all .changeset/*.md files, determines the highest bump for each package (e.g. if two changesets target a package with minor and patch, it becomes minor), updates package.json versions, prepends entries to each package's CHANGELOG.md, and deletes the consumed changeset files. Commit the resulting changes before publishing.
3 / 5
What does changeset publish do?
changeset publish: Compares each package's current package.json version against the npm registry. Packages with unpublished versions are published. It runs npm publish (or yarn/pnpm equivalent) for each. Typically run in CI after changeset version has been committed — commonly via the official changesets/action GitHub Action.
4 / 5
How does Changesets handle monorepo package bumps — specifically linked packages?
Linked packages: In .changeset/config.json: { "linked": [["@myapp/ui", "@myapp/icons"]] } ensures both packages receive the same version bump. Without linking, @myapp/ui@2.0.0 and @myapp/icons@1.3.1 can diverge. Changesets also supports fixed groups for identical versioning across a suite of related packages.
5 / 5
What is the purpose of the pre mode in Changesets?
Pre mode: Enter with changeset pre enter beta. Subsequent changeset version calls produce versions like 2.0.0-beta.0, 2.0.0-beta.1. Exit with changeset pre exit — the next version call produces the final 2.0.0, consuming all accumulated changesets. Useful for release candidates where you want to publish testable packages before the official release.