oscarotero / keep-a-changelog

Node & Deno package to parse and generate changelogs
MIT License
61 stars 20 forks source link

Add CLI option not to prepend `v` to versions #43

Open MrVauxs opened 2 months ago

MrVauxs commented 2 months ago

As title says, preferably in the CLI. It is quite annoying to an otherwise excellent npm script to just run at the end of everything. Code_oz8Xo7pkHW

MrVauxs commented 2 months ago

This seems to be the offending code. https://github.com/oscarotero/keep-a-changelog/blob/79d06e71f9d0db4442ce8a77c9bac236da75a5c6/src/Changelog.ts#L89

oscarotero commented 2 months ago

It's a good practice to prepend the git tags of the releases with v. Anyway, there's already a tagNameBuilder option to customize the tag name.

MrVauxs commented 2 months ago

It's a good practice to prepend the git tags of the releases with v.

A practice, but not a semver version. And if something relies on tags as the version then it'll break with the pretended v.

Anyway, there's already a tagNameBuilder option to customize the tag name.

TagNameBuilder is only available if you build a JS script. For such a small change in functionality I'd rather not have to create an entire script file for it.

oscarotero commented 2 months ago

Okay, but instead of creating a new option in the Changelog class, I think it's better to simply provide a cli option to use a different tagNameBuilder. For example:

changelog --no-v-prefix
MrVauxs commented 2 months ago

I have modified the related PR with the suggestion.

oscarotero commented 2 months ago

Merged. Thanks!

oscarotero commented 2 months ago

I can't publish the NPM package due this bug https://github.com/denoland/dnt/issues/421