absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
417 stars 40 forks source link

feat: Expose release count option #53

Closed lucahuettner closed 1 year ago

lucahuettner commented 1 year ago

Hey, thanks for the fork it offers really useful additions to standard-version!

One feature that is missing for us is that we can't regenerate the complete changelog since the releaseCount option isn't passed through to conventional-changelog so I added it with this PR. If you have any feedback on it feel free to share.

Hope we can make it an addition to the package since also other people seem to miss it as well (Fixes #719)

lucahuettner commented 1 year ago

Extension: Since releaseCount = 0 regenerates the complete changelog but still gets added to the old changelog it might be good to also have an option to regenerate the changelog without appending it to the old one. Or have an extra option to ignore the old changelog which could be combined with releaseCount = 0 to regenerate the complete changelog. This would also be helpful to us and I would be happy to implement it as well.

TimothyJones commented 1 year ago

This is awesome, thank you!

I can definitely accept this. A couple of requests:

1) Would it be possible to add a test or two? I think this file would be a good place to look for a pattern- there are mocks and expected changelogs there.

2) Could you add the option to the readme too?

And a question:

3) I agree with @lucahuettner that releaseCount = 0 appending the whole changelog is probably unexpected - I can't think of a use case for that. Should we instead replace the whole changelog when releaseCount is 0? (Adding an option to control this would give the most configurability, but I'm not wild about expanding the API surface when I can't see a use case for controlling it) Thoughts?

lucahuettner commented 1 year ago

Yes I will take a look at the tests and add the option to the readme. And I also agree with you on the 3rd point, I will implement this as well.

lucahuettner commented 1 year ago

I have added documentation about the option to the readme and have added that the changelog gets overridden when releaseCount is 0.

But unfortunately, I couldn't figure out how to test the changelog regeneration.

TimothyJones commented 1 year ago

I'll get this in on Monday, and see if I can add a test. Either way, I'll release it then.

Thanks again for the PR! Much appreciated <3

codecov-commenter commented 1 year ago

Codecov Report

Merging #53 (6dfde4e) into master (7fbc106) will not change coverage. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##           master      #53   +/-   ##
=======================================
  Coverage   97.40%   97.40%           
=======================================
  Files          27       27           
  Lines        1194     1194           
=======================================
  Hits         1163     1163           
  Misses         31       31           
Impacted Files Coverage Δ
command.js 84.61% <ø> (ø)
defaults.js 100.00% <ø> (ø)
lib/lifecycles/changelog.js 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

lucahuettner commented 1 year ago

Okay sounds great :)

TimothyJones commented 1 year ago

Released as 11.1.0. Please let me know if there are any issues, and thanks again for the PR!