Skip to content

feat: implement changesets changelog module - #83

Closed
GuillaumeRx wants to merge 1 commit into
mainfrom
gr/changesets-changelog-implementation
Closed

GuillaumeRx wants to merge 1 commit into
mainfrom
gr/changesets-changelog-implementation

Conversation

@GuillaumeRx

Copy link
Copy Markdown
Contributor

Explanation

The scaffolding PR added the @metamask/changesets-changelog package with only the generated template files. This PR adds the actual changelog module.

Changesets renders release entries through a changelog module. The default module writes ### Minor Changes sections, which do not match the "Keep a Changelog" format MetaMask changelogs use. This module renders those sections instead, through the categorized changelog support in @metamask/apply-release-plan.

Each changeset holds one entry: a category heading and one top-level bullet, parsed by parseChangesetSummary from @metamask/changesets-utils. The module renders one section per category, in the order Added, Changed, Deprecated, Removed, Fixed, Security. Sub-bullets and continuation lines stay below the entry. Entries of a major release get a **BREAKING:** prefix, since only major bumps are breaking. Dependency bumps render as - Bump \name` from `^old` to `^new`and go intoChanged`.

Pull request links are resolved locally. The module reads the subject of the commit that added the changeset file with git show -s --format=%s, the same approach @metamask/auto-changelog uses, and extracts the number from it. This needs no GitHub token and makes no network call. It accepts squash subjects such as Add a feature (#1234) and merge subjects such as Merge pull request #1234 from owner/branch. Rendering fails when no number is found, so no entry is published without a link.

Two things are worth calling out for reviewers:

  • The module declares its own CategorizedReleaseLine type rather than importing it from @metamask/apply-release-plan. The loaded module should not depend on the package that loads it, and importing the type across package sources also breaks the TypeScript rootDir of this package.
  • The generated greetings placeholder is removed. It was scaffolding, and it would otherwise fail this package's 100% coverage gate. The logic lives in named modules rather than index.ts, because the shared Vitest config excludes index files from coverage.

Tests cover each module directly, plus an integration test that runs the real applyReleasePlan against a fixture package and asserts the rendered changelog survives an auto-changelog round trip unchanged.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@GuillaumeRx
GuillaumeRx force-pushed the gr/changesets-changelog-implementation branch from 536ba0a to 8d6cb8b Compare October 15, 2026 10:01
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.

1 participant