Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to overwrite whatBump function from presets #741

Open
jaklan opened this issue Dec 1, 2024 · 0 comments
Open

Allow to overwrite whatBump function from presets #741

jaklan opened this issue Dec 1, 2024 · 0 comments

Comments

@jaklan
Copy link

jaklan commented Dec 1, 2024

Hi, currently we are able to overwrite parserOpts and writerOpts:

return {
parserOpts: { ...loadedConfig.parser, ...parserOpts },
writerOpts: { ...loadedConfig.writer, ...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.

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

No branches or pull requests

1 participant