build: generate CHANGELOG.md from conventional commits - #66
Merged
Conversation
Adds @release-it/conventional-changelog so each release updates a maintained CHANGELOG.md instead of leaving the history only in GitHub release notes. Backfills the file with the full history back to v1.0.0. The version stays an explicit argument to `pnpm release` (ignoreRecommendedBump), so the semver call remains the maintainer's: the v4.2.0 release is the case in point — its one substantive commit was typed `fix:` but added public API, so an inferred bump would have been 4.1.1 rather than the correct 4.2.0. Preset types are declared explicitly: feat, fix, perf and revert are released sections; docs and refactor appear without implying a bump; and chore, ci, build, style and test are hidden. Also corrects the generated v4.2.0 entry, which the parser reduced to a single "Bug Fixes" line with two malformed issue links (the squash body's "#53-#57" ranges), and ships CHANGELOG.md in the npm tarball. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLxceiNFfXfpGoxdfQEZqw
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 62 62
Lines 1870 1870
Branches 277 277
=========================================
Hits 1870 1870 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Adds
@release-it/conventional-changelogso every release updates a maintainedCHANGELOG.md, instead of the history living only in GitHub release notes.Follow-up to the v4.2.0 release.
What's here
CHANGELOG.md, backfilled to v1.0.0. The plugin creates the file with full history on first release, but generating it now means the changelog exists today rather than after the next release..release-it.jsonwith explicitly declared preset types, so the output is deliberate rather than preset defaults:feat/fix/perf/revertget sections,docsandrefactorappear without implying a bump (effect: "changelog"), andchore/ci/build/style/testare hidden.CONTRIBUTING.md— the command, what it runs, theGITHUB_TOKENrequirement, and the--dry-runpreview.CHANGELOG.mdships in the npm tarball (added tofiles), so it renders on the package page. Verified vianpm pack --dry-run.The version stays a manual decision
I set
ignoreRecommendedBump: true, sopnpm release <version>still takes an explicit version rather than inferring one from commit types.The v4.2.0 release is exactly why. Its one substantive commit was typed
fix:, but it also addedLockCanNotBeReleasedError,AmbiguousTransitionCandidate, and theFactoryoptions template — so an inferred bump would have produced 4.1.1, when the correct answer was 4.2.0. Automatic versioning is only as good as commit-type discipline, and the semver call is worth keeping with a human. Flip the flag tofalselater if you'd rather have it inferred.The same root cause produced one artifact worth flagging: the generated v4.2.0 entry was a single "Bug Fixes" line, with two malformed links (
closes [53-#57](.../53-/issues/57)) parsed out of the#53-#57ranges in the squash-commit body. I corrected that entry by hand to list the features and fixes accurately. The plugin only ever prepends new sections, so hand-corrected history is safe — noted in CONTRIBUTING.Note on the lockfile diff
pnpm-lock.yamlis larger than the plugin alone accounts for:node_moduleshad release-it 20.2.1 installed whilepackage.jsonhas declared^21.0.2since #49 merged, sopnpm installalso picked up that pending upgrade. Worth knowing that the v4.2.0 release was cut with 20.2.1.Verification
pnpm lintclean ·pnpm test389/389 ·pnpm format:checkclean ·npx release-it --dry-runresolves the plugin, computes the compare link, and reports "Writing changelog to CHANGELOG.md".🤖 Generated with Claude Code
https://claude.ai/code/session_01JLxceiNFfXfpGoxdfQEZqw