feat: consolidate per-package changelogs into root CHANGELOG#316
Merged
Conversation
Adds a script run as part of `ci:version` that aggregates the latest release entries from each package's CHANGELOG into a single root CHANGELOG, deduplicating by PR/commit and dropping `Updated dependencies` noise.
Closed
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an automated way to generate and maintain a consolidated root CHANGELOG.md for the monorepo by aggregating the latest release entries from each packages/*/CHANGELOG.md, and wires it into the ci:version workflow used by changesets/action.
Changes:
- Added
scripts/consolidate-changelog.tsto collect and dedupe latest per-package changelog entries into a rootCHANGELOG.md, filtering out “Updated dependencies”. - Added
scripts/package.jsonto mark thescripts/folder as ESM so the TypeScript script can be executed via Node. - Updated root
ci:versionscript to run the consolidation step afterchangeset version.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| scripts/package.json | Marks scripts/ as ESM to support running TS scripts with ESM imports. |
| scripts/consolidate-changelog.ts | New changelog consolidation script (parse latest versions, dedupe, write/insert root block). |
| package.json | Runs the new consolidation script as part of ci:version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fs.readdirSync makes no ordering guarantee, which left the consolidated CHANGELOG's targetVersion selection, dedup tiebreakers, and within-section entry order dependent on filesystem iteration order. Sort the discovered paths so the output is byte-stable across OS/filesystems.
The per-package dedup pass keyed entries by PR number, which collapsed legitimate distinct changeset entries when a single PR produced multiple changesets in one package (e.g. PR callstack#275 in packages/brownfield). Drop the per-package dedup entirely; the cross-package dedup in consolidate() still handles the one-PR-shows-up-in-many-packages case correctly.
When every package's release entries are filtered out as "Updated dependencies", the consolidated map ends up empty but the script would still emit a bare "## <version>" block with no content. Treat that case as a no-op and log it.
The previous literal-substring check missed legitimate matches when the existing root CHANGELOG starts directly with the version heading, uses CRLF newlines, or has a date/suffix after the version. Replace with a multiline regex that matches "##" at any line start, allows any horizontal whitespace, and ends at a whitespace or end-of-line boundary.
indexOf('\n## ') required a preceding newline, so a root
CHANGELOG that begins directly with a "## <version>" heading
(e.g. after a human strips the "# Changelog" header) was
treated as having no version block, and new content got
appended to the end instead of spliced at the top. Switch to
a multiline regex that matches "## " at any line start,
including line 0.
artus9033
approved these changes
May 12, 2026
artus9033
reviewed
May 12, 2026
Per discussion on PR callstack#316, consumers tracking transitive dependency bumps (e.g. for security advisories) need this information in the consolidated root CHANGELOG. Drop the filter so every package's "Updated dependencies" entries flow through to the rollup.
Collaborator
|
Thanks, let's ship it! 🚢 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/consolidate-changelog.ts, run as part ofci:version, which aggregates the latest release entries from eachpackages/*/CHANGELOG.mdinto a single rootCHANGELOG.md.Updated dependenciesnoise.The script is invoked automatically by the
changesets/actionrelease workflow, so the consolidated rootCHANGELOG.mdis committed and pushed as part of the auto-generatedchore(release): version packagesPR — no manual step required.Test plan
yarn ci:versionlocally with pending changesets and verify rootCHANGELOG.mdis created/updated correctly.yarn ci:versiontwice and confirming no duplicate version block is added.Updated dependencieslines are stripped and PRs are not duplicated across packages.chore(release): version packagesPR opened bychangesets/actionincludes the rootCHANGELOG.mdchange.