Describe the bug
The v13 migration guide states that most existing .versionrc configurations continue to work unchanged and specifically says:
parserOpts and writerOpts overrides work as before
However, v13 upgrades conventional-changelog from v4 to v8. In conventional-changelog v8, Handlebars template strings and partial files were replaced with JavaScript render
functions.
As a result, existing custom writerOpts templates do not work as before. A string-valued commitPartial that worked with commit-and-tag-version@12.7.3 fails after upgrading to v13.
Current behavior
Given an existing configuration such as:
module.exports = {
writerOpts: {
commitPartial: '- {{subject}}',
},
}
Running:
commit-and-tag-version --dry-run
with v13 fails during changelog generation:
✔ bumping version in package.json
commitPartial is not a function
This behavior is reproducible with both commit-and-tag-version@13.0.0 and 13.1.2.
The underlying breaking change is documented in the conventional-changelog v8 release:
Handlebars template strings and partial files were replaced with render functions.
Expected behavior
The v13 migration guide should explicitly document the render-function migration for users with custom writer templates.
In particular, it should explain that:
writerOpts.commitPartial, headerPartial, and footerPartial must now be render functions rather than Handlebars strings or partial files.
- A custom
writerOpts.mainTemplate must be migrated to a writerOpts.template render function.
@conventional-changelog/template provides the official Markdown, URL, repository, and composition helpers for implementing these functions.
- ESM
.versionrc.js configuration files require commit-and-tag-version@13.1.0 or newer.
- Users importing
@conventional-changelog/template from their configuration must declare it as a direct dependency when using strict dependency managers such as pnpm.
The statement that all writerOpts overrides “work as before” should also be qualified so that it does not include the removed Handlebars template interface.
I also suggest adding @conventional-changelog/template to the direct dependencies of commit-and-tag-version. The v13 migration makes these helpers part of the supported
customization path rather than merely an implementation detail inherited transitively through conventional-changelog-writer or a preset.
Declaring the package as a dependency alone would not make it directly importable from user configuration under strict dependency managers. If the intention is to let users access the
helpers without installing another dependency, commit-and-tag-version could additionally expose a supported subpath export, for example:
import { segments, words, link, url } from 'commit-and-tag-version/template'
Otherwise, the migration guide should explicitly instruct users to install the helper package themselves:
npm install --save-dev @conventional-changelog/template
Environment
- Working version:
commit-and-tag-version@12.7.3
- Affected versions:
13.0.0, 13.1.2
- Node.js: 22 or newer
- OS: Linux
Possible Solution
Add a migration section similar to the following:
Custom changelog templates now use render functions
conventional-changelog v8 replaced Handlebars templates with JavaScript render functions. String-valued writer templates must be rewritten as functions.
Before:
module.exports = {
writerOpts: {
mainTemplate: '...',
commitPartial: '- {{subject}}',
},
}
After:
import { words } from '@conventional-changelog/template'
function commitPartial(_context, commit) {
return words(commit.subject || commit.header, commit.shortHash)
}
export default {
writerOpts: {
commitPartial,
},
}
If a custom main template is used, replace mainTemplate with a template(context) function.
For dependency handling, either:
- Document that users must install
@conventional-changelog/template directly; or
- Add it as a direct dependency and expose its helpers through a supported
commit-and-tag-version/template subpath.
Additional context
Describe the bug
The v13 migration guide states that most existing
.versionrcconfigurations continue to work unchanged and specifically says:However, v13 upgrades
conventional-changelogfrom v4 to v8. Inconventional-changelogv8, Handlebars template strings and partial files were replaced with JavaScript renderfunctions.
As a result, existing custom
writerOptstemplates do not work as before. A string-valuedcommitPartialthat worked withcommit-and-tag-version@12.7.3fails after upgrading to v13.Current behavior
Given an existing configuration such as:
Running:
with v13 fails during changelog generation:
This behavior is reproducible with both
commit-and-tag-version@13.0.0and13.1.2.The underlying breaking change is documented in the
conventional-changelogv8 release:Expected behavior
The v13 migration guide should explicitly document the render-function migration for users with custom writer templates.
In particular, it should explain that:
writerOpts.commitPartial,headerPartial, andfooterPartialmust now be render functions rather than Handlebars strings or partial files.writerOpts.mainTemplatemust be migrated to awriterOpts.templaterender function.@conventional-changelog/templateprovides the official Markdown, URL, repository, and composition helpers for implementing these functions..versionrc.jsconfiguration files requirecommit-and-tag-version@13.1.0or newer.@conventional-changelog/templatefrom their configuration must declare it as a direct dependency when using strict dependency managers such as pnpm.The statement that all
writerOptsoverrides “work as before” should also be qualified so that it does not include the removed Handlebars template interface.I also suggest adding
@conventional-changelog/templateto the directdependenciesofcommit-and-tag-version. The v13 migration makes these helpers part of the supportedcustomization path rather than merely an implementation detail inherited transitively through
conventional-changelog-writeror a preset.Declaring the package as a dependency alone would not make it directly importable from user configuration under strict dependency managers. If the intention is to let users access the
helpers without installing another dependency,
commit-and-tag-versioncould additionally expose a supported subpath export, for example:Otherwise, the migration guide should explicitly instruct users to install the helper package themselves:
Environment
commit-and-tag-version@12.7.313.0.0,13.1.2Possible Solution
Add a migration section similar to the following:
Custom changelog templates now use render functions
conventional-changelogv8 replaced Handlebars templates with JavaScript render functions. String-valued writer templates must be rewritten as functions.Before:
After:
If a custom main template is used, replace
mainTemplatewith atemplate(context)function.For dependency handling, either:
@conventional-changelog/templatedirectly; orcommit-and-tag-version/templatesubpath.Additional context
https://github.com/absolute-version/commit-and-tag-version/blob/master/MIGRATION.md
https://github.com/conventional-changelog/conventional-changelog/releases/tag/conventional-changelog-v8.0.0
feat(conventional-changelog-writer,conventional-changelog-angular,conventional-changelog-conventionalcommits,conventional-changelog,template)!: replace handlebars templates with render functions conventional-changelog/conventional-changelog#1477
https://conventional-changelog.js.org/template/
https://github.com/absolute-version/commit-and-tag-version/releases/tag/v13.1.0