semantic-release / semantic-release/release-notes-generator
Allow to overwrite `whatBump` function from presets
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 368
- Forks
- 55
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
Hi, currently we are able to overwrite parserOpts and writerOpts:
but we miss a capability to overwrite whatBump() function used by presets, e.g. conventional-changelog-conventionalcommits:
export default async function createPreset (config) {
return {
commits: {
ignore: config?.ignoreCommits,
merges: false
},
parser: createParserOpts(config),
writer: await createWriterOpts(config),
whatBump: createWhatBump(config)
}
}
In case of this specific preset, whatBump() impacts the generated release notes because of a) commit object modification (which is a preset issue itself) b) hardcoded breakingHeaderPattern here:
export const breakingHeaderPattern = /^(\w*)(?:\((.*)\))?!: (.*)$/
which ignores the breakingHeaderPattern value passed to parserOpts (which, I guess, makes sense as whatBump() is a separate function). If we could overwrite a function - we would be able to align parser and whatBump() logic on our end.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with lib/load-changelog-config.js at the linked parserOpts and writerOpts handling, then trace how presets supply whatBump, especially in conventional-changelog-conventionalcommits. Confirm that a caller can replace that function and that generated release notes use the replacement, including the breaking-header case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- release, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100