Make Changelog Round-Trips a Fixpoint - #143
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit 8d30b1a
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
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.
Description
Changelog generation was not idempotent: every regeneration re-parsed its own output and re-emitted the decorations it found, so breaking-change markers and commit/issue references piled up on item text. Entries in
libs/features/CHANGELOG.mdhad accumulated runs like**BREAKING** **BREAKING:** **BREAKING:** … ⚠️ BREAKING:in front of a single description.This PR makes a parse then serialize pass a fixpoint. Breaking markers are now lifted off item text onto the item's
breakingflag at parse time, the generator stops baking the marker into the text at all, and the serializer skips any commit hash or issue reference the description already spells out. The already-corrupted changelog entries are rewritten, and@hyperfrontend/versioningis released as 0.6.3.Type of Change
🐛 Bug fix
Changes Made
parseBreakingFromItem(libs/versioning/src/changelog/parse/breaking.ts): a regex-free, ReDoS-safe scanner that strips repeated leading breaking markers (**BREAKING**,**BREAKING:**,[BREAKING],⚠️ BREAKING:, bareBREAKING:, and theBREAKING CHANGE/CHANGESspellings, case-insensitive) and returns the flag plus the remaining text.generate-changelogfrom prefixing⚠️ BREAKING:onto item text; the flag is passed tocreateChangelogIteminstead, and the breaking-changes section items carrybreaking: true.libs/features/CHANGELOG.mdandlibs/nexus/CHANGELOG.mdto a single**BREAKING**marker per item.@hyperfrontend/versioning0.6.3 and updated its dependents (libs/builder,libs/features, the versioning package E2E fixture and lockfiles).Testing
libs/versioning/src/changelog/parse/breaking.spec.tscovers each marker spelling, repeated markers, the colon requirement that keeps prose likeBreaking apart the parserintact, and the emoji variation selector.libs/versioning/src/changelog/round-trip.spec.tsasserts that parse → serialize → parse → serialize reaches a fixpoint, including on changelogs already carrying stacked markers.parser.spec.ts,serialize/to-string.spec.ts, andflow/steps/generate-changelog.spec.tsfor the flag-based breaking path and the duplicate-reference filter.Checklist
npm run commitfor conventional commit messagesAI Assistance
GitHub Copilot was used to generate this PR description.
Additional Notes
@hyperfrontend/versioning: generated changelog items no longer contain a⚠️ BREAKING:text prefix. The information now lives on the item'sbreakingflag, and serialization emits exactly one**BREAKING**marker.libs/featuresandlibs/nexusare corrections to already-published entries; no package behavior changed there.📝 CLA Requirement
By submitting this pull request, you acknowledge that:
For more information, see our Contributing Guide.
Thank you for contributing to hyperfrontend! 🚀