feat: presets
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
defaultone is the current one, it has the looks of the currently generated changelogs at the moment of the PR. - The
githubone 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)
- It uses no emoji (like
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.
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.
Hey @antfu, sorry for the bump, any news on this topic? Can I help somehow?
Let's track via https://github.com/unjs/changelogen/issues/30 particulary we can leverage c12 layers for template support.
Sure, I've subscribed to that issue 👍 It's most likely that I'll use changelogen anyway once it has monorepository support