release-it / keep-a-changelog

Keep a Changelog plugin for release-it
MIT License
27 stars 15 forks source link

Add options for customising version URL format #25

Closed jasongerbes closed 2 years ago

jasongerbes commented 2 years ago

Fixes #24.

This PR adds support for non-GitHub style version URLs via custom format strings. It also improves support for new changelogs, where the first released version should link to the tag rather than trying to compare to null.

Also renamed [Unreleased]: to [unreleased]: to match Keep a Changelog. This change is backwards-compatible as the plugin will now rename any existing [Unreleased] link as necessary.

jasongerbes commented 2 years ago

@webpro, any chance you could review this PR?

One test is currently skipped due to a limitation in runTasks from 'release-it/test/util'.

webpro commented 2 years ago

Thanks for the PR! Let's make it happen.

jasongerbes commented 2 years ago

Hey @webpro, the title of the section will remain "Unreleased", I've just updated the reference link at the bottom of the changelog to be lower case.

For example, here's a snippet from the Keep a Changelog repo's changelog:

## [Unreleased]
...

## [1.1.0] - 2019-02-15
...

[unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.1.0...HEAD
[1.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...v1.1.0

More importantly though, reference links are case-insensitive. Any decent Markdown formatter (e.g. Prettier) will rename [Unreleased]: to [unreleased]:, causing the plugin to add an additional [Unreleased]: link each time a release is created.

webpro commented 2 years ago

Ah, gotcha. Agreed, thanks for clarifying this.

I just released https://github.com/release-it/release-it/releases/tag/14.13.1

jasongerbes commented 2 years ago

I just updated release-it and re-enabled the skipped test

webpro commented 2 years ago

Thanks! Not too fond of the ancient new dependency, but the template syntax is ubiquitous, so will be easy to swap.

jasongerbes commented 2 years ago

Thanks @webpro for merging. Could you please create a release for this change

webpro commented 2 years ago

Yes, I was out running errands. There you go: https://github.com/release-it/keep-a-changelog/releases/tag/2.5.0

Thanks again!