How to Generate Per-Package Changelogs in a Monorepo
Each package gets its own CHANGELOG.md scoped to that package changes, so a consumer never wades through unrelated entries.
Changesets writes a CHANGELOG.md per package by default. Nx enables it with projectChangelogs: true. The changelog entries come from the changeset summaries or the conventional commits that touched that package.
Steps
- Keep changelog generation per package (the Changesets default).
- In Nx, set
changelog.projectChangelogs: trueandworkspaceChangelog: false. - Enrich Changesets entries with a GitHub changelog generator for PR links.
- Commit the updated
CHANGELOG.mdfiles alongside the version bump.
GitHub changelog entries
.changeset/config.json
{
"changelog": [
"@changesets/changelog-github",
{ "repo": "acme/monorepo" }
]
}Nx config
nx.json
{
"release": {
"changelog": {
"workspaceChangelog": false,
"projectChangelogs": true
}
}
}Gotchas
- The GitHub changelog generator needs a
GITHUB_TOKENto resolve PR and author links. - A single root changelog is fine for fixed versioning but confusing when packages release independently.
Related guides
How to Create Per-Package Git Tags in a MonorepoTag each released package independently with a name@version tag so history and GitHub releases map to the rig…
How to Aggregate Release Notes Across Monorepo PackagesRoll up per-package changelog entries into one summary for a monorepo release using the Changesets workspace…