-
Notifications
You must be signed in to change notification settings - Fork 713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: creating specifically for conventionalcommits.org #421
Conversation
@jbottigliero @stevemao I think this is ready for some review:
|
@bcoe – just took a look at this. The configuration PR (conventional-changelog/standard-version#278) shouldn't have to change much with this direction (mostly will just need to update tests based on the desired defaults). It then just becomes a question of whether or not we want the configuration changes to land before having a Reviewing some of the issues in
In most cases, it seems like folks want to make minor tweaks to I don't want to distract from the core conversation here, so maybe it makes sense to move to release plan task in Just let me know what direction you are thinking of going and I can start updating |
`scope`, | ||
`subject` | ||
], | ||
noteKeywords: [`BREAKING CHANGE`], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also be configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe eventually? I think I'd like to implement a first pass that addresses the most common feature requests that I've seen:
- the ability to more directly control the URLs to commits, ranges, and issues in the CHANGELOG generated.
- the ability to configure which types of commits show up in the CHANGELOG.
I expect we'll want to make more options configurable as we start to work our way through existing feature requests in the backlog of issues.
I'm not sure how to configure things like |
☝️ this is exactly the types of configuration I'd like to make easier to control in the new
Well I agree that this should be a major release, I'm not convinced that there's much value in releasing a configurable version of I think the document here is a better layer of abstraction, we can continue to extend on this exposing more dials ... Note: right now it's feeling like |
parserOpts: parserOpts(config), | ||
|
||
whatBump: (commits) => { | ||
let level = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is our stance on releasing on every change? (I maintain my own personal changelog preset solely for the purpose of only recommending a release on fixes, features, and breaking changes.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to continue releasing changes for every commit type; this is how the angular preset approaches things, and is what I myself (and I expect other users of standard-version
) have come to expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could open this up to being configured? it feels really weird to me though as a library maintainer. If I've performed a maintenance task, such as upgrading libraries, or performance refactoring, etc., I still often want to release a patch release of my module -- I have never personally found myself in a position where the default behavior of bumping the PATCH
wasn't the behavior I wanted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could open this up to being configured?
As a first pass, let's please not let my comment hold up your PR. 😅
Long-term, yes, I would really like to make releases configurable. My own preset was actually a pre-cursor to the one I wrote for my company because the number of releases for tasks, such as chores related to project configuration, refactors related to reducing technical debt, and docs related to inline comments, were becoming disruptive to our library consumers 😞 (new releases caused our dependency update tool to roll that out to hundreds of applications in near real-time, which caused lots of notifications, CI job queues to grow, etc.).
If I've performed a maintenance task, such as upgrading libraries, or performance refactoring
Those sound like tasks that effect downstream consumers. Those, in my opinion, should be released. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this use-case better now; let's take the conversation to another issue?
// which accepts a config object (allowing for customization) and returns | ||
// a promise. | ||
if (!options.config.then && presetConfig) { | ||
options.config = options.config(presetConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is redundant. conventional-changelog-core
currently merges the options from, say, parserOpts
, over the options.config.parserOpts
object. Same with gitRawCommitOpts
and writerOpts
.
If you don't like the preset options, you can override them by settings the appropriate options in parserOpts
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly find this approach to configuring things very convoluted, it was @stevemao's recommendation that we start passing configuration directly into presets, and I think this is much less confusing to an implementor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, I think the configuration is at the wrong level of granularity; as evidenced by the variety of open issues on standard-version
(which is the project I work with most directly) users want to be able to:
- have more control over the URL format output in CHANGELOGs.
- have more control over which specific types of commits show up in the CHANGELOG (
feat
, vs,chore
, etc).
The existing configuration exposes a ton of nuts and bolts about what's happening in conventional-commits several layers of abstraction away from the presets. As an example, even though you could potentially overwrite the entire writeOpts
config, there's no easy way prior to this change to pass configuration to this method in the angular preset, which actually configures which items are toggled oin and off in the CHANGELOG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevemao is there a better way to pass configuration all the way through to the preset? without introducing this refactor -- I want the preset to have access to configuration like you suggested, but I think it should be the responsibility of upstream libraries like standard-version
to accept this configuration (either from command line arguments or loading it from disk).
Long story short, the least breaking way I could think of to chain configuration all the way to the preset was to override the behavior such that presets
can optionally return a factory that accepts configuration, rather than a promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing configuration exposes a ton of nuts and bolts about what's happening in conventional-commits several layers of abstraction away from the presets.
Thank you for the explanation @bcoe. 👍 It's a sentiment I share as well. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an example on how to make angular preset print each commit type in the change log? Or do I still have to implement a workaround like this? My apologies, but I am somewhat confused. This PR is merged, but the master
still prints only 3 types be default - feat
, fix
and perf
.
@stevemao please see my most recent push, I hadn't actually exposed any configuration yet; had been working on things this afternoon. |
I absolutely agree with this. I wanted to make sure I understood the structure you were proposing before I start any work... I've opened #422 with two example fixtures. From the |
Hey, im humbled for @mention 😻. I have not worked at this topic for a long time and currently am chasing other projects. So I will not be able to contribute, sorry. |
Thanks @bcoe, only thing is I'd like to see |
@stevemao do you mean simplify this logic: if (typeof options.preset === 'object' && options.preset.name) {
// Rather than a string preset name, options.preset can be an object
// with a "name" key indicating the preset to load; additinoal key/value
// pairs are assumed to be configuration for the preset. See the documentation
// for a given preset for configuration available.
presetConfig = options.preset
options.config = conventionalChangelogPresetLoader(options.preset.name.toLowerCase())
} else {
options.config = conventionalChangelogPresetLoader(options.preset.toLowerCase())
} such that if |
Please see #426 for the idea of removing presets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
When will a new version (with this change) be published? I don't see any milestones. |
@stevemao I'm starting work on a preset that will be tailored specifically towards https://www.conventionalcommits.org/en/v1.0.0-beta.3/.
In the process of doing so, based on conversations here I propose that we simply how configuration is passed to the preset, perhaps based on the proposal here.
@jbottigliero @Xiphe would you be willing to work with me in this effort? I think this would potentially simplify some of the work currently taking place here -- making it more clear what configuration options are available.
This would also hopefully better document certain edge-case behavior, and how to customize CHANGELOG generation, which is a topic of interest for @JustinBeckwith and myself.