-
Notifications
You must be signed in to change notification settings - Fork 729
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
fix(types): allow combining provided types with defaults #1064
fix(types): allow combining provided types with defaults #1064
Conversation
please @dangreen when you get a chance 👀 |
@roggervalf I'll take a look this week 👌 |
@roggervalf Hi. Sorry for the delay. I want to suggest more easier way: what if we will export default types, so you can extend / modify them const preset = require('conventional-changelog-conventionalcommits')
conventionalChangelogCore({
config: preset({
types: preset.defaultCommitTypes.map((commitType) => (
commitType.type === 'chore'
? { ...commitType, hidden: false }
: commitType
))
})
}) WDYT? |
hey @dangreen, but in that case how it will work with commit-analyzer usage https://github.com/semantic-release/commit-analyzer#usage? the configuration is passed in a json file |
@roggervalf Configuration can be made as js file: https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration
|
Thank you @dangreen, it sounds good to me |
it('alternative "types" configuration to be provided and combined with default ones', function (done) { | ||
preparing(1) | ||
conventionalChangelogCore({ | ||
config: preset({ | ||
types: preset.defaultCommitTypes.map((commitType) => ( | ||
commitType.type === 'chore' | ||
? { ...commitType, hidden: false } | ||
: commitType | ||
)) | ||
}) | ||
}) | ||
.on('error', function (err) { | ||
done(err) | ||
}) | ||
.pipe(through(function (chunk) { | ||
chunk = chunk.toString() | ||
|
||
expect(chunk).to.include('### Miscellaneous Chores') | ||
expect(chunk).to.include('**deps:** upgrade example from 1 to 2') | ||
|
||
expect(chunk).to.include('### Performance Improvements') | ||
expect(chunk).to.include('**ngOptions:** make it faster') | ||
|
||
done() | ||
})) | ||
}) | ||
|
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.
Please use arrow functions and for await
. You can find examples in this test file.
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.
It should be addressed, thank you
6f2dc29
to
853b54f
Compare
853b54f
to
ccdb2ef
Compare
ref #984
we should have a way to combine types from user and default ones, in order to prevent a breaking change I added hardTypesReplacement option, by default is true