release-it / keep-a-changelog

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

Unclear how should the initial release look like #19

Open mitar opened 2 years ago

mitar commented 2 years ago

I am trying to make the first release and I am getting the following error:

Missing section for previous release ("0.0.0") in CHANGELOG.md.

I prepared the following changelog:

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- First public release.

[Unreleased]: https://gitlab.com/example/project/-/compare/firstcommit...main
johanhammar commented 2 years ago

Hi

Try release-it --no-plugins.@release-it/keep-a-changelog.strictLatest

Source https://github.com/release-it/release-it/blob/master/docs/configuration.md

mitar commented 2 years ago

Setting strictLatest: false did indeed help me make a release, but it did not update changelog at all. What should be the git.changelog setting when using this plugin? I set it to "".

mitar commented 2 years ago

Oh, I had keepUnreleased also set and it made not change the changelog at all. A very confusion setting. Not sure why it exists. :-)

Changing it to addUnreleased made it change the changelog, almost perfect:

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2021-12-16

### Added

- First public release.

[Unreleased]: https://gitlab.com/example/project/compare/v0.1.0...main

[0.1.0]: https://gitlab.com/example/project/compare/null...v0.1.0

It added an extra empty line between two references at the end and made invalid the last reference.

I would expect it to change it to:

[Unreleased]: https://gitlab.com/example/project/-/compare/v0.1.0...main
[0.1.0]: https://gitlab.com/example/project/-/tags/v0.1.0