Releasing
How changes become versions on npm, with Changesets and GitHub Actions.
Versioning and changelogs are managed with Changesets.
Published packages
| Package | Folder |
|---|---|
nextjs-cms | packages/nextjs-cms |
create-nextjs-cms | packages/create-nextjs-cms |
@nextjscms/translations | packages/translations |
@nextjscms/plugin-* | plugins/* |
nextjs-cms-app (apps/cms) is ignored by Changesets; it ships to users through create-nextjs-cms's generated template.
1. Every PR adds a changeset
pnpm changesetThis writes a Markdown file in .changeset/ naming the packages, the bump, and a summary:
---
'nextjs-cms': minor
---
Add `allowInlineColors` to `richTextField` to keep body text on the site's theme.Write the summary for users: what changed and what they need to do. It goes straight into CHANGELOG.md.
| Bump | When |
|---|---|
patch | Bug fixes, internal changes, docs in the package |
minor | New options, fields, commands, backwards-compatible features |
major | Removed or renamed options, changed defaults, anything requiring user changes |
Internal dependents are bumped automatically (updateInternalDependencies: "patch").
2. CI checks it
The Changeset Check workflow runs pnpm changeset status --since origin/main on pull requests to main.
3. Merging to main opens a release PR
The Release workflow (.github/workflows/release.yml) runs on every push to main:
- Installs, tests, lints, and type-checks.
- Runs
changesets/action:- If there are pending changesets, it opens (or updates) a "Version Packages" pull request that runs
pnpm changeset version: bumps versions, writes changelogs, and deletes the consumed changesets. - If that PR was just merged (no pending changesets, versions changed), it runs the publish command (
pnpm release) to publish to npm.
- If there are pending changesets, it opens (or updates) a "Version Packages" pull request that runs
Review the Version Packages PR like any other: the changelog is user-facing.
Building for release
pnpm build:release # nextjs-cms, create-nextjs-cms, @nextjscms/translations
pnpm build:pluginscreate-nextjs-cms's build regenerates its templates/ from apps/cms (scripts/build.ts), replacing workspace:* dependencies with the published versions, so the scaffolded app always matches the released core.
The Release workflow publishes with pnpm release. Make sure a release script exists in the root package.json (building the packages and running changeset publish) before relying on automated publishing.
Versioning policy
- The CLI checks that the project's
nextjs-cmsversion matches what the CLI expects before running commands, so core and CLI stay in lockstep (they're the same package). - Keep
create-nextjs-cmsandnextjs-cmsreleases aligned when the template changes. - Breaking changes need a migration section in the changeset summary and, for larger ones, a guide in the developer docs.