Comments (12)
The code explicitly load the angular
preset only if neither writerOpts
and parserOpts
are defined:
I don't remember why exactly but I guess there must have been a reason for that. I'll dig in the commit history to try to figure out.
from release-notes-generator.
writerOpts: Additional conventional-commits-writer options that will extends ones loaded by preset or config. See Writer options
means that option you set in writerOpts
will be added to the one from the preset
you use.
If you don't use a preset
it just uses whatever you pass in writerOpts
.
from release-notes-generator.
Isn't the preset
default to angular
? If what you say is true, then passing an empty writerOpts
should have the same effect than passing no writerOpts
at all, which is not the case.
from release-notes-generator.
Yes the preset defaults to angular
but only if you don't pass writerOpts
or parserOpts
.
from release-notes-generator.
- So if I pass a
preset
,writerOpts
will extend the config stored at thepreset
. So I can pass apreset
and an emptywriterOpts
, this will work. - If I don't pass a
preset
,writerOpts
will be set as the config, so if I pass an emptywriterOpts
the config will have an empty value, which will not work correctly. - If I don't pass a
preset
orwriterOpts
, thepreset
will be set toangular
.
Is this correct?
from release-notes-generator.
Yes. But in any case there is absolutely no reason to pass an empty writerOpts
. I don't understand why you are trying to do that.
from release-notes-generator.
I'm closing as it doesn't seems you are reporting a bug. Feel free to comment further if you think there is actually a bug.
from release-notes-generator.
If I understood correctly, an empty writerOpts
would be the same than passing a single parameter. In the example on the README:
{
"release": {
"generateNotes": {
"preset": "angular",
"writerOpts": {
"commitsSort": ["subject", "scope"],
}
}
}
}
This works since you are explicitly passing preset: angular
, but if I don't pass preset
(assuming the preset
will default to angular
), this will not work as desired.
I believe the documentation may be more specific about that case. Since it says that the default value for preset
is angular
, and writerOpts
extends the preset
or config
, one can easily assume that when passing no preset
, it will default to angular
and writerOpts
will extend from that, but that's not the case.
This is either a bug in the documentation or a bug on the behavior.
from release-notes-generator.
Maybe you can add something like this in the note.
-**NOTE:** `options.config` will be overwritten by the values of preset. You should use either `preset` or `config`, but not both. Individual properties of `parserOpts` and `writerOpts` will overwrite ones loaded with `preset` or `config`.
+**NOTE:** `options.config` will be overwritten by the values of preset. You should use either `preset` or `config`, but not both. Individual properties of `parserOpts` and `writerOpts` will overwrite ones loaded with `preset` or `config`, only if `preset` is provided, otherwise it will not extend but set the values at config.
from release-notes-generator.
Hey @pvdlg, can you explain what changed? I can see in the PR #91 that you clarify the current behavior, but on line 23 you change the behavior.
If parserOpts
or writerOpts
are not defined, it will use Angular preset, and then it will be merged.
from release-notes-generator.
The behavior didn't change, it's just a refactoring of the code to make it more clear.
The condition on line 23 was useless as it's repeated on lines 35-36
The intention behind this behavior is:
- If you want to customize a
preset
, set thepreset
and useparserOpts
/writerOpts
to override - If you want to specify your own config then use
config
from release-notes-generator.
🎉 This issue has been resolved in version 6.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from release-notes-generator.
Related Issues (20)
- Upgrade peer dependency semantic-release to version 19.0.3 or later to fix known vulnerability HOT 1
- Refactor & chore commits not getting includes in changelog HOT 3
- Release notes generation with Bitbucket
- question: link to both GH PR numbers and external issues
- Question: conventionalcommits preset with PR owner
- Defining the commitPartial voids other wirter and presetConfig options
- I need to include other commits than `feat` and `fix`. HOT 3
- Sort commit sections HOT 11
- An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM] HOT 5
- wrong Gitlab issue link in release notes HOT 20
- Plugin ends up abruptly without completition or error, making other plugins not to start HOT 12
- Wrong commit link for Bitbucket HOT 3
- `release skip`-ed commits still get into release notes
- Links to PRs and Contributors list HOT 2
- `MODULE_NOT_FOUND` when running with `npx` HOT 4
- Unexpected behavior for major updates with conventionalcommits preset HOT 2
- self-hosted GitLab - no issue links in release notes
- Question: Merging pre-release branches & generated changelog
- Question: Mirror release rules to release notes generator? HOT 1
- Question: how can i gruop no-scope commits on a section in release notes generator configuration ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from release-notes-generator.