standard-version
standard-version copied to clipboard
How to customize some changelog format (date, description and order of section)
Hello, our repo has maintained its own changelog for a while, and recently discovered this cool automation tool.
However, we want more customization of some changelog formats, including:
- Date format, e.g.,
<!-- Before -->
## [1.1.0](../compare/v1.0.0...v1.1.0) (2021-07-15)
<!-- After -->
## [1.1.0](../compare/v1.0.0...v1.1.0) - 2021-07-15
- Description, e.g.,
<!-- Before -->
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
<!-- After -->
# 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).
See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
- Order of section (I don’t know why the bug fixes is always displayed before feature), e.g.,
<!-- Before -->
### Bug fixes and other changes
...
### Features and improvements
...
<!-- After -->
### Features and improvements
...
### Bug fixes and other changes
...
I wonder if there is a way to do it? Thanks!
If I understand correctly you can create your own set of templates/preset like here: https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits
@rogamoore Thanks for your reply, but I read this document: https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.1.0/README.md
It doesn’t seem to support the few format I mentioned 😢
@Jasonnor did you have any luck figuring this out by any chance?
@techieshark unfortunately no 😢
@Jasonnor I was able to get part (2) of your issue working. Originally it wasn't for me, but then I upgraded from an older version to the latest version (9.5) of standard-version
.
Here is my .versionrc.js
file:
// Provides settings for standard-version tool
// See: https://github.com/conventional-changelog/standard-version
module.exports = {
header: `# 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).
See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
`
}
@techieshark Thanks! I will reply here if I find solution for the other two. 😄
@Jasonnor Did you find a solution for the date format?
@vandres Sorry but I haven't used this tool for a while. There is an alternative tool release-please but I haven't used it yet, maybe you can take a look?
@Jasonnor I started using release-it. It has plugins for the most common formats and is highly configurable
@vandres Thanks for sharing! Looks like using the template will do what I need, I'll check it out later! 😃