Skip to content

chore(deps): migrate to conventional-changelog-writer v9#78

Merged
mattt merged 2 commits into
mainfrom
mattt/merge-dependabot-prs
Jul 6, 2026
Merged

chore(deps): migrate to conventional-changelog-writer v9#78
mattt merged 2 commits into
mainfrom
mattt/merge-dependabot-prs

Conversation

@mattt

@mattt mattt commented Jul 6, 2026

Copy link
Copy Markdown

Closes #71

Completes the writer v9 bump deferred in the previous commit. v9 replaces
the Handlebars template engine with function-based templates, so this is a
real migration rather than a version bump:

- conventional-changelog-writer 6 -> 9.1.1, plus its now-required companion
  conventional-changelog-conventionalcommits 6 -> 10.2.1 (only the v10 preset
  emits the function-based partials the v9 writer consumes).
- Both packages are ESM-only; load them via dynamic import from this CommonJS
  module, matching how main.ts loads @actions/core.
- parseArray -> writeChangelogString; preset.writerOpts -> preset.writer.
- Translate changelogSections from the preset's old `hidden` boolean to its
  new `effect` enum.
- Pin context.commit to 'commit' (the writer now defaults it to 'commits',
  which would break every generated commit link).
- Preserve the public commitPartial/headerPartial/mainTemplate config surface:
  these stay Handlebars strings and are compiled with handlebars into the
  function form the new writer expects.

Snapshots updated to drop the redundant blank lines the old Handlebars
templates emitted between sections; changelog content is unchanged.
@mattt
mattt force-pushed the mattt/merge-dependabot-prs branch from b1b6439 to ff1ff33 Compare July 6, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the changelog generation stack to conventional-changelog-writer v9 (and the v10 conventional commits preset), adapting the codebase to ESM-only dependencies by switching to dynamic imports and vendoring a couple of previously require()-based utilities. It also refreshes affected Vitest snapshots and updates a few workflow and dependency versions.

Changes:

  • Migrate changelog notes generation to the v9 writer API (function-based templates) and add tests for custom template overrides.
  • Replace ESM-only dependencies (unist-util-visit*, detect-indent, @actions/core) with local shims or dynamic imports to keep the CommonJS + ncc workflow working.
  • Update lockfile / dependency versions and refresh snapshots affected by formatting/link changes.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/strategies/snapshots/rust.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/ruby.ts.snap Snapshot update (blank lines removed; compare URL encoding change).
test/strategies/snapshots/php.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/php-yoshi.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/ocaml.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/helm.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/go-yoshi.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/dotnet-yoshi.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/dart.ts.snap Snapshot update reflecting changelog whitespace changes.
test/strategies/snapshots/base.ts.snap Snapshot update reflecting changelog whitespace changes.
test/plugins/compatibility/snapshots/linked-versions-workspace.ts.snap Snapshot update reflecting changelog whitespace changes.
test/plugins/compatibility/snapshots/linked-versions-group-title.ts.snap Snapshot update reflecting changelog whitespace changes.
test/plugins/snapshots/linked-versions.ts.snap Snapshot update reflecting changelog whitespace changes.
test/changelog-notes/default-changelog-notes.ts Adds test coverage for custom template overrides in changelog notes.
test/changelog-notes/snapshots/default-changelog-notes.ts.snap Snapshot updates for new writer output formatting.
test/snapshots/manifest.ts.snap Snapshot updates for new writer output formatting.
src/util/unist-visit.ts Adds a local visit/visitWithAncestors implementation to avoid ESM-only unist utilities.
src/util/json-stringify.ts Switches indent detection to a locally vendored implementation.
src/util/detect-indent.ts Vendors detect-indent to avoid ESM-only dependency issues.
src/main.ts Loads @actions/core via dynamic import and refactors action entrypoint error handling.
src/commit.ts Replaces unist-util-visit* usage with the local visitor utilities.
src/changelog-notes/default.ts Refactors changelog generation to use writer v9 APIs and Handlebars compilation for backward-compatible template strings.
pnpm-lock.yaml Updates lockfile for migrated dependencies and related version bumps.
package.json Bumps conventional-changelog-writer/preset versions, updates supporting deps, and adds Handlebars.
.github/workflows/self-test.yml Updates actions/checkout major version.
.github/workflows/release.yml Updates actions/checkout major version.
.github/workflows/ci.yaml Updates actions/checkout major version.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/changelog-notes/default.ts
Addresses PR review feedback. The v9 writer's compare-URL builder
percent-encodes tag names, turning the '/' in monorepo component tags
(e.g. "google-cloud-automl/v1.2.3") into '%2F' — which GitHub does not
resolve in /compare links. Override the preset's formatCompareUrl to
reproduce the unescaped URL release-please has always generated.

(The review's other note — that the conventionalcommits factory is async
and exposes `.writerOpts` — describes the pre-v9 API; v10's createPreset
is synchronous and exposes `.writer`. Documented inline.)
@mattt
mattt merged commit 586d663 into main Jul 6, 2026
1 check passed
@mattt
mattt deleted the mattt/merge-dependabot-prs branch July 6, 2026 20:17
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.

2 participants