Skip to content

Changesets

pubm uses changesets as the checked-in record of what should be released next. Instead of inferring versions from commit messages or branch names, it reads files from .pubm/changesets/ and turns them into version bumps and changelog entries.

  • a reviewable release plan in each pull request
  • deterministic version bump calculation across packages
  • changelog content written before release day, not after it

Pending changesets live in:

.pubm/changesets/

Initialize that directory by running the interactive setup wizard:

Terminal window
pubm init

During setup, pubm init asks whether to enable the changesets workflow. If you choose yes, it creates the .pubm/changesets/ directory, generates .github/workflows/changeset-check.yml for PR enforcement, and updates .gitignore so changeset files are tracked while other .pubm/ contents stay ignored.

Terminal window
pubm changesets add

In a monorepo, pubm also asks which packages are affected and what bump type each one should receive.

For non-interactive use:

Terminal window
pubm changesets add \
--packages @acme/core,@acme/react \
--bump minor \
--message "Add token-based auth to the public client."
---
"@acme/core": minor
"@acme/react": patch
---
Add token-based auth to the public client.

The metadata controls version calculation. The body becomes the changelog summary.

Inspect changesets before pubm consumes them:

Terminal window
pubm changesets status
pubm changesets status --verbose
pubm changesets version --dry-run

When you run the normal release pipeline with pubm, pending changesets are consumed during the version step.

The flow is:

  1. reads pending .pubm/changesets/*.md files
  2. calculates the resulting package versions
  3. updates manifest versions
  4. generates changelog entries
  5. deletes consumed changeset files
  6. creates the release commit and tags

If you want to run only the versioning step ahead of time, you can still use:

Terminal window
pubm changesets version

That command is useful for editorial or controlled workflows, but it is not required before pubm or pubm --mode ci --phase publish.

If you want to generate changelog text without consuming versions yet:

Terminal window
pubm changesets changelog --dry-run
pubm changesets changelog --version 1.8.0

When versionSources is "all" (the default), pubm changesets version automatically falls back to conventional commits for any package that has no pending changeset files. This lets teams adopt changesets incrementally: packages with changesets use them; packages without fall back to commit history.

Commit typeBump
featminor
fixpatch
perfpatch

A BREAKING CHANGE footer or a ! suffix (e.g. feat!:) always produces a major bump.

Override the default mapping in pubm.config.ts:

export default defineConfig({
versionSources: "all",
conventionalCommits: {
types: {
feat: "minor",
fix: "patch",
perf: "patch",
docs: "patch",
},
},
});

Set versionSources: "commits" to use only conventional commits and ignore changeset files entirely. Set versionSources: "changesets" to disable the fallback and use only changeset files.

Terminal window
pubm changesets migrate

This migrates pending files from .changeset/ into .pubm/.