standard-version icon indicating copy to clipboard operation
standard-version copied to clipboard

How to customize some changelog format (date, description and order of section)

Open Jasonnor opened this issue 3 years ago • 10 comments

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:

  1. 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

  1. 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.
  1. 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!

Jasonnor avatar Jul 15 '21 04:07 Jasonnor

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 avatar Sep 13 '21 19:09 rogamoore

@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 avatar Sep 29 '21 10:09 Jasonnor

@Jasonnor did you have any luck figuring this out by any chance?

techieshark avatar Jun 19 '22 03:06 techieshark

@techieshark unfortunately no 😢

Jasonnor avatar Jun 19 '22 03:06 Jasonnor

@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 avatar Jun 19 '22 04:06 techieshark

@techieshark Thanks! I will reply here if I find solution for the other two. 😄

Jasonnor avatar Jun 19 '22 16:06 Jasonnor

@Jasonnor Did you find a solution for the date format?

vandres avatar May 01 '24 12:05 vandres

@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 avatar May 02 '24 05:05 Jasonnor

@Jasonnor I started using release-it. It has plugins for the most common formats and is highly configurable

vandres avatar May 08 '24 09:05 vandres

@vandres Thanks for sharing! Looks like using the template will do what I need, I'll check it out later! 😃

Jasonnor avatar May 09 '24 02:05 Jasonnor