changelogithub icon indicating copy to clipboard operation
changelogithub copied to clipboard

feat: presets

Open innocenzi opened this issue 3 years ago • 2 comments

So... I like this project a lot, and I am a perfectionist/opinionated person.

I previously PR'd a few new formatting options for the changelog to look closely to what I was used to, but the project is active and moving forward so the changelogs formatting is not the same between each release.

In my PR to add the --emoji flag, I suggested a preset feature because that option was a bit out of place. I ended up hacking on that feature anyway in order to have a set of stable presets.

Currently, there is a default and a github preset.

  • The default one is the current one, it has the looks of the currently generated changelogs at the moment of the PR.
  • The github one is a preset that formats more closely to what the GitHub-generated changelog looks like:
    • It uses no emoji (like --no-emoji)
    • It doesn't group commits (like --no-group)
    • It doesn't capitalize commit messages (like --no-capitalize)
    • It formats the "full changelog" link like GitHub's
    • It formats commit messages' suffixes like GitHub does (6 chars hashes, no - separator, no monospace)

A preset is defined using the --preset <preset> flag or by using the preset option of a changelogithub configuration file. If an incorrect preset name is given, the default one will be used.

Additionally, command-line parameters take precedence over any option configured by the preset. For instance, changelogithub --preset github --capitalize will indeed capitalize commit messages.

This PR should not introduce any breaking change.

innocenzi avatar Jul 06 '22 20:07 innocenzi

I will discuss with @pi0 later today about the API with changelogen so we could backport our improvements to it while having the capability of customization. Will get back to you.

antfu avatar Jul 07 '22 02:07 antfu

Hey @antfu, sorry for the bump, any news on this topic? Can I help somehow?

innocenzi avatar Aug 04 '22 12:08 innocenzi

Let's track via https://github.com/unjs/changelogen/issues/30 particulary we can leverage c12 layers for template support.

pi0 avatar Oct 30 '23 13:10 pi0

Sure, I've subscribed to that issue 👍 It's most likely that I'll use changelogen anyway once it has monorepository support

innocenzi avatar Oct 30 '23 13:10 innocenzi