conventional-changelog / standard-version

:trophy: Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
ISC License
7.65k stars 787 forks source link

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

Open Jasonnor opened 3 years ago

Jasonnor commented 3 years ago

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)

1.1.0 - 2021-07-15

2. Description, e.g.,
```markdown
<!-- 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

...

Features and improvements

...

Bug fixes and other changes

...



I wonder if there is a way to do it? Thanks!
rogamoore commented 2 years ago

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

Jasonnor commented 2 years ago

@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 😢

techieshark commented 2 years ago

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

Jasonnor commented 2 years ago

@techieshark unfortunately no 😢

techieshark commented 2 years ago

@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.
`
}
Jasonnor commented 2 years ago

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

vandres commented 4 months ago

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

Jasonnor commented 4 months ago

@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?

vandres commented 4 months ago

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

Jasonnor commented 4 months ago

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