-
Notifications
You must be signed in to change notification settings - Fork 99
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 "Unreleased" commit group to be renamed #117
Conversation
@alex-pex wouldn't it be easier to just modify the output of |
Indeed, I could modify the output using a custom script around lerna-changelog, but I wanted something more integrated. https://github.com/conventional-changelog/conventional-changelog already uses lerna-changelog is just a step in my publishing toolchain. |
src/cli.ts
Outdated
.example( | ||
'lerna-changelog --next-version="Next: 0.4.0"', | ||
'create a changelog for the changes after the latest available tag, under "Next: 0.4.0" section' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need a dedicated example for this option. I'd prefer it if we kept it as it was before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
src/cli.ts
Outdated
@@ -45,6 +56,7 @@ export async function run() { | |||
let options = { | |||
tagFrom: argv["from"] || argv["tag-from"], | |||
tagTo: argv["to"] || argv["tag-to"], | |||
nextVersion: argv["next-version"] === "" ? true : argv["next-version"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to change the default behavior to "autodiscover", which would be a breaking change. the default (at least for now) should keep using "Unreleased".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- when the parameter is not set, the value is undefined (default, the text will be "Unreleased")
- when the parameter is set without value, it equals empty string, which is typecasted as
true
(the lib will find the version by itself) - when the parameter is set WITH a value, it uses it as the next version label
That's why I'm checking argv["next-version"] === ""
instead of !argv["next-version"]
I'd prefer it if we'd only use dedicated CLI options for this, but not read it from the I'd imagine something like this: lerna-changelog # uses "Unreleased"
lerna-changelog --next-release "v0.3.0" # uses "v0.3.0"
lerna-changelog --next-release-from-metadata # uses whatever is in `package.json` |
What whould prevent the user from doing
That's why I used a single all-purpose parameter. Maybe a special value like --next-release="auto" would work ? |
shouldn't be hard to show a warning for that case
I'm not a big fan of such magic constants. I'd prefer to have explicit parameters for the different modes. |
I'll try to work on the requested changes as soon as possible |
I've fixed the issues reported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, thanks and sorry for the long review time :)
Allow "Unreleased" commit group to be renamed
Tests updated, Lint OK