chore(release): build release notes from every package changelog

Merged
SR
9d ago
+743-27

The v11.1.0 release page showed 1 of the 10 changes in the release. The Publish workflow built the body from packages/core/CHANGELOG.md only, and changesets writes a change only into the CHANGELOGs of the packages it touches. This builds the body from every package CHANGELOG, and trims the noise changesets writes into the CHANGELOGs themselves.

Summary

 .github/workflows/publish.yml  "Create Aggregated GitHub Release"
-  awk the "## <version>" section out of packages/core/CHANGELOG.md
-  + list all 22 published packages
+  bun scripts/release-notes.ts "$VERSION" > /tmp/release-notes.md

 scripts/release-notes.ts   (new)
+  for each packages/*/CHANGELOG.md: take "## <version>"
+    merge entries by commit hash → one entry, all its packages, highest bump kind
+    drop "Updated dependencies" lines
+  ## Breaking changes / ## Features / ## Fixes and internal changes
+    - **`pkg`, `pkg2`** (#PR): first line + body (tables and lists kept)
+  footer: All @node-minify/* packages are published at <version>.
+  PR via `gh api commits/<hash>/pulls`; a failed lookup only drops the (#PR)

 .changeset/changelog.cjs   (new, replaces @changesets/cli/changelog)
+  getReleaseLine: same as changelog-git, hash links to the commit
+  getDependencyReleaseLine: one line "Updated `@node-minify/*` dependencies to <v>."
-    instead of "Updated dependencies [hash]" per changeset + one line per dependency
  • The private @node-minify/action changelog is read too: it ships as the GitHub Action in the same release, and #2973 is filed only there.
  • Existing CHANGELOG entries are not rewritten. The new format applies from the next changeset version.
  • No changeset: repo tooling only, no package change.

Evidence

Release body for 11.1.0 (bun scripts/release-notes.ts 11.1.0):

  • Before (published page): 1 entry (#2972 "Internal cleanup"), under "Patch Changes", 6 "Updated dependencies" lines, 22-line package list.
  • After: 10 entries, #2965–#2974: ## Features (#2966–#2970) and ## Fixes and internal changes (#2965, #2971–#2974), each with its packages and PR. No dependency lines, no package list.

changeset version probe (throwaway worktree, one core: minor changeset, not committed):

packages/core/CHANGELOG.md
  ## 11.2.0
  ### Minor Changes
  - [`292a5ee`](https://github.com/srod/node-minify/commit/292a5ee…): Probe feature line one.
  ### Patch Changes
  - Updated `@node-minify/*` dependencies to 11.2.0.
packages/cli/CHANGELOG.md, packages/terser/CHANGELOG.md
  ## 11.2.0
  ### Patch Changes
  - Updated `@node-minify/*` dependencies to 11.2.0.
packages/types/CHANGELOG.md (no internal dependencies)
  ## 11.2.0                                  # bare heading, as today

bun scripts/release-notes.ts 11.2.0 on the probe gave one ## Features entry for core; the probe commit is not on GitHub, so it had no (#PR), and the run still succeeded.

Tests: scripts/__tests__/release-notes.test.ts, 12 tests: merge across packages, highest kind wins, dependency lines dropped, both entry formats, multi-line bodies and tables, section order, sort, missing PR, other versions ignored, empty fallback, and the real 11.1.0 CHANGELOGs (all 10 entries). With the parser changed to keep dependency lines, 2 fail.

Gate: lint, typecheck, both guard scripts pass; 1176 tests pass (1164 + 12).

Not run: the Publish workflow itself. It runs on the next release; the step only swaps the body source, gh release create is unchanged.

Merge Danger

Door: two-way

Blast Radius: release notes

Affects only the next release's CHANGELOG entries and GitHub release body. If the script failed, gh release create would not run after npm publish; packages would be published but the GitHub release and the action tag step would need a manual rerun.


Summary by cubic

Fixes the v11.1.0 release page showing only 1 of 10 changes. The Publish workflow now builds the body from every package CHANGELOG with a new scripts/release-notes.ts, instead of just packages/core/CHANGELOG.md, since changesets writes each release only into the CHANGELOGs of the packages it touches.

  • Entries from the same commit are merged across packages, filed under the highest bump kind, and sorted by PR number via gh api; entries without a commit hash are kept and merged by their text, and a failed lookup drops the (#PR) suffix.
  • Dependency-bump lines are dropped only when they match exactly what changesets writes, so real changes that start the same way are kept.
  • Reads every package CHANGELOG, including @node-minify/action (ships as the GitHub Action), and handles CRLF line endings.
  • A new .changeset/changelog.cjs replaces @changesets/cli/changelog: hash entries link to their commit and dependency-only bumps collapse to one line. Existing CHANGELOG entries are untouched.

Rollout

The Publish workflow isn't run in this PR; it runs on the next release. If the script fails, packages still publish but the GitHub release and action tag step need a manual rerun.