Skip to content

fix: document and support custom writer render functions - #324

Open
yangxu52 wants to merge 3 commits into
absolute-version:masterfrom
yangxu52:fix/custom-writer-render
Open

fix: document and support custom writer render functions#324
yangxu52 wants to merge 3 commits into
absolute-version:masterfrom
yangxu52:fix/custom-writer-render

Conversation

@yangxu52

@yangxu52 yangxu52 commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • add @conventional-changelog/template@1.2.1 as a direct runtime dependency
  • cover function-based writerOpts.commitPartial imported from an ESM .versionrc.js
  • document the conventional-changelog v8 custom writer template migration

Root cause

Version 13 upgraded conventional-changelog from v4 to v8, where Handlebars template strings and partial files were replaced by JavaScript render functions.

The v13 migration guide still stated that writerOpts overrides worked as before, which incorrectly implied that the removed Handlebars template interface
remained compatible. The official template helpers were also only available transitively rather than being declared as a supported runtime dependency.

Implementation

  • declare @conventional-changelog/template@1.2.1 as a direct dependency
  • add a real CLI dry-run regression test using:
    • an ESM .versionrc.js
    • the official words helper
    • a function-based writerOpts.commitPartial
    • a conventional commit included in the generated changelog
  • document:
    • the render-function migration
    • mainTemplate to template(context)
    • the affected writer options
    • ESM configuration version requirements
    • direct dependency requirements under strict package managers such as pnpm

Validation

  • npm exec vitest run test/esm-config.integration-test.js
  • npm test
  • npm run lint
  • npm run format:check
  • git diff --check

Non-goals

  • no changes to the ESM configuration loader
  • no new commit-and-tag-version/template subpath export
  • no changes to changelog generation
  • no changes to default preset behavior
  • no changes to Node.js engines
  • no unrelated dependency upgrades or refactoring

Fixes #323

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.

v13 migration guide misses the render-function migration for custom writerOpt

1 participant