Skip to content

fix: list only the changes since the previous prerelease with the same name in each prerelease changelog section, instead of repeating everything since the last stable release. Stable releases, and the first prerelease with a new name, still list everything since the last stable release. (fixes #349) - #350

Open
TimothyJones wants to merge 1 commit into
masterfrom
fix/prerelease-changelog-window

Conversation

@TimothyJones

Copy link
Copy Markdown
Member

Fixes #349.

Problem

Since 13.1.1 (#310) the changelog window always started at the last stable tag. That is right for a stable release, but a continued prerelease (alpha.1 → alpha.2) repeated every earlier prerelease's entries, and its compare link pointed at the stable tag.

Change

A changelog section now starts at the most recent tag that is either stable or a prerelease with the same name as the version being released.

Releasing Section covers
Stable release everything since the last stable release (unchanged, #310)
Continued prerelease (alpha.1 → alpha.2) changes since alpha.1
First prerelease with a new name (dev.0 → rc.0) everything since the last stable release (unchanged, #310)
Returning to a name (dev.0, rc.0, dev.1) everything since dev.0

The third row differs from the "last tag of any kind" suggestion in the issue. The #310 tests assert it deliberately, so I kept it.

The tag list is filtered in a ConventionalGitClient subclass passed to ConventionalChangelog, so the commit range, section splits and compare links all use the same boundaries. The bump calculation is untouched.

Testing

  • The reproduction script from Prerelease changelog sections are cumulative since the last stable tag and duplicate on every prerelease #349 now produces the expected output from the issue, and a stable release on top of it still lists all three changes from v1.0.0.
  • test/prerelease-window.integration-test.js: the "continues a prerelease with the same identifier" test asserted the cumulative behaviour and is flipped; added the issue's three-alpha scenario followed by a stable release, and the return-to-a-name case.
  • npm test passes (156 tests, lint, prettier).

Docs

New README section "What Each Changelog Section Covers". The neighbouring "Keeping Prereleases out of a Final Changelog" section is not changed here; it predates the #310 fix and may want a follow-up.

🤖 Generated with Claude Code

…e name in each prerelease changelog section, instead of repeating everything since the last stable release. Stable releases, and the first prerelease with a new name, still list everything since the last stable release. (fixes #349)

Since 13.1.1 (#310) the changelog window always started at the last
stable tag, so a continued prerelease repeated every earlier prerelease's
entries and its compare link pointed at the stable tag.

The window now starts at the most recent tag that is stable or a
prerelease with the same identifier as the version being released. The
tag list is filtered in a ConventionalGitClient subclass passed to
ConventionalChangelog, so the commit range, section splits and compare
links all use the same boundaries. The bump calculation is unchanged.

A switched identifier (dev -> rc) deliberately stays cumulative, as the
#310 tests assert, rather than reverting to "last tag of any kind".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prerelease changelog sections are cumulative since the last stable tag and duplicate on every prerelease

1 participant