release-it / conventional-changelog Goto Github PK
View Code? Open in Web Editor NEWConventional changelog plugin for release-it
License: MIT License
Conventional changelog plugin for release-it
License: MIT License
Hello.
I'm facing some problems with release Changelog generation and sometime version bumping.
I'm using release-it in multiple projects and have some problems, which I think are related to conventional-changelog plug-in.
Every time we do a release - commits from all previous releases are mentioned in new release.
It affects version bumping.
v0.3.0 => expected 0.1.2
fix: some fix 2
fix: some fix 1
feat: some feature 1
v0.2.0 => expected 0.1.0
fix: some fix 1
feat: some feature 1
v0.1.0
feat: some feature 1
Example repo: https://github.com/b12k/release-test
Changelog is badly generated (Sorry for bad description ^_^ ). You can compare change log of example repo with releases.
Release-it is configured the same way in both projects with
"preset": "conventionalcommits"
I assume the problem is not in the conventional-changelog
or conventional-recommended-bump
but either with this plug-in or my hands =)
Thanx in advance!
When generating the changelog with the angular preset, it ignores compareUrlFormat
and commitUrlFormat
presets and instead uses the default format
I recently upgraded from version 10 and I got an issue with the order in which things are done. Here’s my config:
{
"scripts": {
"afterRelease": "npm run deploy",
"afterBump": "npm run build"
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md"
}
}
}
In previous release-it versions, the bump and the changelog used to be done before my npm run build
command was run. It was perfect for me as I use the changelog in this command. Now the changelog gets written after the build, which cause the changelog of the previous version to be used.
I tried to change the afterBump
to beforeStage
or beforeRelease
like it is in the conventional-changelog plugin but the changelog still gets written after.
I think there was a safeBump
option previously to avoid that but I saw it got deprecated and removed from the docs. What would be the new way of running a command after the changelog is written but before stage?
(Sorry if this is more a question for the main repository)
For reference, here’s how I used to do it with previous versions:
{
"increment": "conventional:angular",
"scripts": {
"changelog": "conventional-changelog -p angular | tail -n +3",
"beforeStage": "conventional-changelog -p angular -i CHANGELOG.md -s",
"afterRelease": "npm run deploy",
"afterBump": "npm run build"
}
}
Hi, this is not an issue itself. It is more like a question.
How can I inform both parseOpts and writerOpts.
I see that conventional-changelog-core have an API like conventionalChangelogCore([options, [context, [gitRawCommitsOpts, [parserOpts, [writerOpts]]]]])
, and I would like to pass some parameters to writerOpts like:
writerOpts: {
groupBy: 'scope'
}
so I can group commits by scope instead of type by default.
Thank in advance.
I am able to make a release without a conventional-changelog but when I add conventional changelog to a git repo, I get the below error. This error goes away if I remove .git
folder and create a new repository.
λ npm run release
> [email protected] release D:\work\temp3
> dotenv release-it --
events.js:353
throw er; // Unhandled 'error' event
^
Error: fatal: ambiguous argument 'v4.0.1..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
at Transform._transform (D:\work\temp3\node_modules\git-raw-commits\index.js:83:30)
at Transform._read (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:177:10)
at Transform._write (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:164:83)
at doWrite (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:409:139)
at writeOrBuffer (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:398:5)
at Transform.Writable.write (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:307:11)
at Socket.ondata (internal/streams/readable.js:745:22)
at Socket.emit (events.js:388:22)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:280:11)
Emitted 'error' event on Readable instance at:
at Transform._transform (D:\work\temp3\node_modules\git-raw-commits\index.js:83:16)
at Transform._read (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:177:10)
[... lines matching original stack trace ...]
at readableAddChunk (internal/streams/readable.js:280:11)
In release-it.js I have written the following code:
'@release-it/conventional-changelog': {
'preset': 'angular',
'infile': 'CHANGELOG.md',
'ignoreRecommendedBump': true,
},
}
Hello !
Since v4.2.0, there is no more newline between the newly prepended changelog and the previous changelog, resulting to something like this:
* last line ([1a2b3c](https://gitlab.com/.../commit/1a2b3c))## [1.4.0](https://gitlab.com/.../compare/1.3.1...1.4.0) (2022-04-05)
Here is my plugins config in .release-it.json
:
{
"plugins": {
"@release-it/conventional-changelog": {
"ignoreRecommendedBump": true,
"infile": "CHANGELOG.md",
"preset": {
"name": "conventionalcommits",
"issueUrlFormat": "https://gitlab.com/{{id}}",
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "chore", "section": "Chore" },
{ "type": "build", "hidden": true },
{}
]
}
}
}
}
Hello! By default when I run release-it it will create changelogs based on my origin remote. I want to change that behaviour and use upstream remote to generate the changelog. Is there a way to do it? I used git.pushRepo setting but it didn't work. Thank you
I am trying to use this plugin with release-it
to auto-generate the change-logs but when I tried to run the release-it patch
script, I am getting:
> release-it "patch"
ERROR Cannot read property 'ignoreRecommendedBump' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <package_name>@0.1.7 release: `release-it "patch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <package_name>@0.1.7 release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
.release-it.json
file content:
{
"git": {
"commitMessage": "chore: release v${version}"
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md"
}
}
}
Dependencies versions:
"@release-it/conventional-changelog": "^3.0.1",
"release-it": "^14.6.2"
Insead of just passing a string containg the whole template to writerOpts.commitPartial
I would like to read a template file and pass it's contents to it.
I tried with node's async fs.promises.readFile
method, but failed.
I did a top-level await and did set the whole package.json of my project as { "type": "module" }
which failed.
And I tried the code below, also failing because the commits_template is promise is actuallt not being resolved:
this is my .release-it.js
config:
const fs = require("fs");
const path = require("path");
const commits_template = (async function () {
return await fs.promises.readFile(
path.resolve(".release-it-conventional-changelog-commit.hbs")
).data;
})();
module.exports = {
[...]
plugins: {
"@release-it/conventional-changelog": {
[...]
writerOpts: {
commitPartial: commits_template,
},
},
},
};
Maybe release-it needs to await the import of the .release-it.js file?
Or maybe trying to interpret the commitPartial as a path and trying to read it?
This package includes release-it
as a dependency:
conventional-changelog/package.json
Line 37 in 37c6683
I believe it shouldn't do that and instead have it in devDependencies
.
The reasoning is that this is a plugin for release-it
so release-it
must be installed separately anyway and this makes it so that there are two different versions of release-it
included in the project.
My context is to use the conventional-changelog in a non-npm project (actually a bash project). Running the command to install the module creates a 127Kb package.json file, and a node_modules directory with 327 sub-directories. Is this expected?
npm install --save-dev @release-it/conventional-changelog
npm WARN saveError ENOENT: no such file or directory, open '/Users/testuser/git_projects/pi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/testuser/git_projects/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.
Hello and thanks for the tool.
I am trying out release-it
. In my monorepo, I use conventional commits, so I therefore want release-it
to auto-increment the version based on the commit history. Thus, it seems like I need to use the @release-it/conventional-changelog
plugin to do this. However, I don't want to generate a changelog. And it seems like this plugin always generates a changelog.
Will you accept a PR for a new option that disables the changelog?
Hi,
I'm using conventionalcommits
preset, and I want to pass config.types
for it, how can I do that?
How I tried:
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"types": [{ "type": "feat", "section": "Bug Fixes" }]
}
}
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"config": {
"types": [{ "type": "feat", "section": "Bug Fixes" }]
}
}
}
None of this puts feat commits under bug fixes (I know it doesn't make any sense, it's just for trying)
Thanks!
Support sorting / ordering changelog sections i.e.
conventional-changelog-conventionalcommits: sort groups based on config types (#702) (#1002) (0e59f0c)
— v6.1.0
In https://github.com/release-it/conventional-changelog, update dependency https://github.com/conventional-changelog/conventional-changelog (from 3.1.25) to v4.0.0, so it will include conventional-changelog-conventionalcommits
v6.1.0.
ConventionalChangelog fails after release-it 14.11.5
Using @release-it/conventional-changelog under the latest version of release-it (14.11.7) found that the CHANGELOG record lost the version information, like this:
Changelog:
* build: update @release-it/conventional-changelog (a31d21f)
* build: Update all package versions (4087cbe)
Comparing the two versions, it is found that the plug-in cannot get the version number.
It is shown in release-it/lib/tasks.js and release- it/conventional-changelog/index.js
Hello,
We currently used [email protected]
and @release-it/[email protected]
. We release against Node 8.11.4. We also test against Node v10.5.
[email protected]
and @release-it/[email protected]
are both BREAKING CHANGES in our release process (Node 8).
@release-it/[email protected]
requires [email protected]
, which itself requires Node v10.6 or greater. Therefore, the stated requirement Node > 10 is not accurate.
Fyi, one of the breaking Release-it dependencies is cacheable-lookup
, which requires a method introduced in Node v10.6.
@release-it/[email protected]
requires release-it@13
, which dropped Node 8 support.
I'm using the following configuration:
{
"git": {
"tagName": "v${version}",
"commitMessage": "release: v${version}",
"pushArgs": ["--follow-tags", "-o ci.skip"]
},
"plugins": {
"@csmith/release-it-calver-plugin": {
"format": "YY.MM.DD.MICRO"
},
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md"
}
},
"npm": false
}
However my CHANGELOG is not updated as expected. Here is the relevant output from my pipeline:
🚀 Let's release xxx (20.11.20.0...20.11.30.0)
Changelog:
## [](xxx/v20.11.20.0...vnull) (2020-11-30)
### Features
* List of items that are already found in a previous release
Since it doesn't resolve the diff name, it seems that is simply copies all the features from the previous release. Notice that the feature list is populated correctly with commit hash references.
I have boostrapped the CHANGELOG.md
file to have the following entries:
### [v20.11.20.0](xxx/compare/v20.11.19.1...v20.11.20.0) (2020-11-20)
## [v20.11.19.1](xxx/compare/v20.11.19.0...v20.11.19.1) (2020-11-19)
### Features
* List of features
## [v20.11.19.0](xxx/compare/vnull...v20.11.19.0) (2020-11-19)
### Features
* List of features
I am under the impression that the CalVer Plugin should be able to work with conventional-changelog, unless that is not the case ?
Based on the logic here:
conventional-changelog/index.js
Lines 58 to 65 in 6b84de1
When infile
is specified, the file is always updated regardless of the status of this.global.isDryRun
.
My config for the conventionalcommits
preset includes a commit type "breaking" which will then write a "Breaking Changes".
I was wondering why the recommended bump wasn't a major version with commits with that type.
Then I found out that a major level release is recommended when the commit contains a note (See: https://github.com/conventional-changelog/conventional-changelog/blob/840d139c40a2c4e773794d794c34bc4dbfde27c2/packages/conventional-changelog-conventionalcommits/conventional-recommended-bump.js#L20 ). A note is detected via the noteKeywords
config option for conventional-commits-parser
(See: https://github.com/conventional-changelog/conventional-changelog/blob/840d139c40a2c4e773794d794c34bc4dbfde27c2/packages/conventional-commits-parser/lib/regex.js#L21 ).
The parser can be configured, as @release-it/conventional-changelogs points out: https://github.com/release-it/conventional-changelog#parseropts
But it didn't work. I added some console messages to getNotesRegex
in conventional-commits-parser/lib/regex.js
:
console.trace();
console.log(noteKeywords);
That gave me the following output:
thet@then:/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns$ release-it patch --dry-run
$ npm ping
$ npm whoami
$ npm show @patternslib/patternslib@latest version
$ npm access ls-collaborators @patternslib/patternslib
WARNING Latest version in registry (5.5.1) does not match package.json (5.5.0).
$ git rev-parse --abbrev-ref HEAD
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD [cached]
$ git config --get branch.master.remote
$ git remote get-url origin
! git fetch
$ git describe --tags --match=* --abbrev=0
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/master
$ git rev-parse --abbrev-ref HEAD [cached]
$ git config --get branch.master.remote [cached]
$ git remote get-url origin [cached]
! git fetch
$ git describe --tags --match=* --abbrev=0 [cached]
WARNING Environment variable "GITHUB_TOKEN" is required for automated GitHub Releases.
WARNING Falling back to web-based GitHub Release.
Trace
at getNotesRegex (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:22:11)
at module.exports (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:54:19)
at conventionalCommitsParser (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/index.js:74:15)
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-recommended-bump/index.js:78:15
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/git-semver-tags/index.js:66:5
at ChildProcess.exithandler (child_process.js:374:7)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:400:28)
[ 'BREAKING CHANGE' ]
/^[\s|*]*(BREAKING CHANGE)[:\s]+(.*)/i
WARNING The recommended bump is "patch", but is overridden with "patch".
Trace
at getNotesRegex (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:22:11)
at module.exports (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:54:19)
at conventionalCommitsParser (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/index.js:74:15)
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-changelog-core/index.js:93:15
at _fulfilled (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:854:54)
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:816:13)
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:624:44
at runSingle (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:137:13)
at flush (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:125:13)
[ 'breaking' ]
/^[\s|*]*(breaking)[:\s]+(.*)/i
$ git log --pretty=format:"* %s (%h)" 5.5.0...HEAD
Trace
at getNotesRegex (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:22:11)
at module.exports (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:54:19)
at conventionalCommitsParser (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/index.js:74:15)
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-recommended-bump/index.js:78:15
at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/git-semver-tags/index.js:66:5
at ChildProcess.exithandler (child_process.js:374:7)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
[ 'BREAKING CHANGE' ]
/^[\s|*]*(BREAKING CHANGE)[:\s]+(.*)/i
🚀 Let's release @patternslib/patternslib (5.5.0...5.5.1)
[...]
Apparently the config is only applied once in three times.
This is my .release-it.js
config:
const fs = require("fs");
const path = require("path");
const commits_template = fs
.readFileSync(path.resolve(".release-it", "conventional-changelog-commit.hbs"))
.toString();
module.exports = {
npm: {
publish: true,
},
git: {
requireBranch: "master",
commitMessage: "Release new version.",
commitArgs: ["-n"],
},
github: {
release: true,
},
plugins: {
"@release-it/conventional-changelog": {
infile: "CHANGES.md",
preset: {
name: "conventionalcommits",
types: [
{
type: "breaking",
section: "Breaking Changes",
},
{
type: "feat",
section: "Features",
},
{
type: "fix",
section: "Bug Fixes",
},
{
type: "maint",
section: "Maintenance",
},
],
},
parserOpts: {
noteKeywords: ["breaking"],
},
writerOpts: {
commitPartial: commits_template,
},
},
},
};
When generating the changelog with the conventionalcommits
preset, the generated changelog will look like this:
### [1.0.1](<Url to diff>) (2022-09-06)
### Bug Fixes
* <commit message> ([<commit id>](<link to commit>))
I would expect the heading level of the new version to be 2 (## [1.0.1] ...
)
Hi,
is there any way how to aggregate pre releases in changelog and create single (minor version) entry?
Using release-it minor --git.tagExclude='*[-]*'
generates changelog with each pre release.
Ideal flow:
release-it minor // e.g. 1.1.0
release-it minor --preRelease=beta // 1.2.0-beta.0 => commit, tag, gitlab release but skip changelog?
release-it --preRelease // 1.2.0-beta.1 => commit, tag, gitlab release but skip changelog?
release-it minor // 1.2.0 => commit,tag,release and create aggregated changelog from 1.1.0 to 1.2.0 (do not show pre releases)
or update changelog on pre releases, and ideally remove those entries on minor release and create aggregated changelog?
Thanks
@webpro just came across a high severity vulnerability notice from my Dependabot instance:
Dependabot cannot update trim-newlines to a non-vulnerable version
The latest possible version that can be installed is 1.0.0 because of the following conflicting dependency:
@release-it/[email protected] requires trim-newlines@^1.0.0 via a transitive dependency on [email protected]
The earliest fixed version is 3.0.1.
CVE-2021-33623
high severity
Vulnerable versions: < 3.0.1
Patched version: 3.0.1
The trim-newlines package before 3.0.1 and 4.x before 4.0.1 for Node.js has an issue related to regular expression denial-of-service (ReDoS) for the .end() method.
See https://github.com/TheRealWaldo/release-it/security/dependabot/package-lock.json/trim-newlines/open
I'm having issues where conventional-changelog
adds extra space in the markdown file and when I run a build command before a release, Prettier modifies this file and I end up being unable to do the release:
✔ npm run build
ERROR Working dir must be clean.
Please stage and commit your changes.
Documentation: https://git.io/release-it-git
I was thinking of adding the following hook in release-it.json
to fix it but I don't know if this is the best solution?
{
"hooks": {
"after:conventional-changelog:bump": ["npx prettier --write ./CHANGELOG.md"]
}
}
I'm not even sure the syntax is correct?
relase-it config
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md"
}
},
The generated infile
(e.g. Changelog.md) would have multiple # Changelog
headers like this:
# Changelog
## v1.2.3 (2021-11-21)
...
# Changelog
## v1.2.2 (2021-11-16)
...
Generally, we want only one h1
in a document but this behavior cannot be achieved through configuration because writeChangelog()
would always prepend new changelog to the infile
:
async writeChangelog() {
...
let { changelog } = this.config.getContext();
...
await prependFile(infile, changelog + EOL + EOL);
Wheninfile
already has # Changelog
and changelog has another # Changelog
. We'll get several # Changelog
header after several version bumps.
I also figure out that there's a relational rejected PR #18 resolves this problem.
First of all, thanks a lot for this great library! The README.md states (emphasis mine):
Options are passed verbatim to conventional-recommended-bump and conventional-changelog.
However, changelog is still produced for pre-releases (tested with rc and alpha). This is the relevant part of my package.json
"release-it": {
"git": {
"commitMessage": "chore: release ${version}",
"tagName": "v${version}"
},
"npm": {
"publish": true
},
"github": {
"release": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.MD",
"skipUnstable": true
}
}
}
The option is documented here. Result:
Please note that release-it
is not a global install, but an alias to npx release-it
I am trying to use this plugin but somehow get a The recommended bump is "undefined"
.
$ npm run release patch
> [email protected] release
> release-it patch
WARNING Environment variable "GITHUB_TOKEN" is required for automated GitHub Releases.
WARNING Falling back to web-based GitHub Release.
WARNING The recommended bump is "undefined", but is overridden with "patch".
🚀 Let's release vega-embed (6.21.1...6.21.2)
Changelog:
## <small>6.21.2 (2023-02-13)</small>
* fix: upgrade deps including themes and tooltips, fixes version issues ([ba8ba18](https://github.com/vega/vega-embed/commit/ba8ba18))
Shouldn't the fix trigger a patch release?
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @release-it/[email protected]
for the project I'm working on.
On react-native
, I have the following error while building my project
Invalid Podfile
unexpected token at 'Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /Users/expo/workingdir/build/node_modules/@release-it/conventional-changelog/package.json
Here is the diff that solved my problem:
diff --git a/node_modules/@release-it/conventional-changelog/package.json b/node_modules/@release-it/conventional-changelog/package.json
index 004a8b5..f37dc9b 100644
--- a/node_modules/@release-it/conventional-changelog/package.json
+++ b/node_modules/@release-it/conventional-changelog/package.json
@@ -3,7 +3,9 @@
"version": "5.0.0",
"description": "Conventional changelog plugin for release-it",
"type": "module",
- "exports": "./index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"},
"scripts": {
"test": "bron test.js --serial",
"release": "release-it"
This issue body was partially generated by patch-package.
If you agree with theses changes, I will make a PR
Is it possible to do this?
Very often, I like to manually tweak or cleanup the changelog during a release. Especially when the changelog is based on commit messages that cannot be edited and might contain typos or use the wrong prefixes/headers.
A related plugin, @release-it-plugins/lerna-changelog
, has an option launchEditor
that enables this.
Hello.
First of all thank you for a great tool! 👌
I'm trying to pass some properties to override conventinalcommits
default config.
I've found this closed issue: #8
But unfortunately that solution doesn't works incorrectly for me. Am I doing something wrong?
package.json:
"devDependencies": {
"@release-it/conventional-changelog": "^2.0.0",
"release-it": "^14.3.0"
...
},
"release-it": {
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"preset": {
"name": "conventionalcommits",
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "style",
"section": "Styles"
},
{
"type": "refactor",
"section": "Refactoring"
},
{
"type": "perf",
"section": "Performance"
},
{
"type": "test",
"section": "Tests"
},
{
"type": "build",
"section": "Build System"
},
{
"type": "ci",
"hidden": true
},
{
"type": "chore",
"section": "Miscellaneous Chores"
},
{
"type": "revert",
"section": "Reverted"
}
]
}
}
}
...
}
UPDATE:
I created multiple commits;
But only "Build" got into change log.
Thank you in advance!
When attempting to use the conventional-changelog
plugin in a newly created repo with no existing versions in git tags
, conventional-changelog
fails to properly set an initial version of 0.0.1
that should be provided by the release-it
core bump
module.
🚀 Let's release cics (currently at null)
Changelog:
## (2021-06-28)
### Features
* foo
* bar
### Fixes
* foo
### Doc Updates
* foo
### CI Changes
* foo
* bar
ERROR unacceptable kind of an object to dump [object Undefined]
To get around this error, an initial version must be pushed with release-it -i
. Then all following conventional-changelog
versioning works as expected.
Hi y'all!
I'm trying to use this with Yarn berry, but I'm running into an issue:
ERROR @release-it/conventional-changelog tried to access semver, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: semver (via "semver/package.json")
Required by: @release-it/conventional-changelog@virtual:f8628a01fc8a0c88efe1afe17f2bd962a545e2644e7bc646f13ee6114785601dea0fc25e5105597cdbff6bdbc249a1f8dc91aaafa859915fd961e5dec7c0ab9f#npm:5.0.0 (via /Users/cravend/src/html/object-access/.yarn/__virtual__/@release-it-conventional-changelog-virtual-9949b6766b/0/cache/@release-it-conventional-changelog-npm-5.0.0-19f49b5e03-205a743018.zip/node_modules/@release-it/conventional-changelog/index.js)
Is there any reason semver shouldn't be included in the dependencies array?
Hello,
@release-it/conventional-changelog package still uses the version of conventional-recommended-bump which is prone to security vulnerability. Can you please address the security issue.
Thanks for this helpful plugin :-). I think I've set the header
option for the preset in the correct place, but no (<h1>
) header is written to the changelog file. This happens regardless of whether this is the first release (with no changelog already) or whether there has already been a release.
{
"git": {
"commitMessage": "chore(release): ${version}"
},
"github": {
"release": true
},
"npm": {
"publish": false
},
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"preset": {
"header": "Changelog",
"name": "conventionalcommits",
"types": [
{
"section": "Features",
"type": "feat"
},
{
"section": "Bug fixes",
"type": "fix"
},
{
"section": "Documentation",
"type": "docs"
},
{
"section": "Styles",
"type": "style"
},
{
"section": "Code refactoring",
"type": "refactor"
},
{
"section": "Performance improvements",
"type": "perf"
},
{
"section": "Tests",
"type": "test"
},
{
"section": "Builds",
"type": "build"
},
{
"section": "Continuous integrations",
"type": "ci"
},
{
"section": "Chores",
"type": "chore"
},
{
"section": "Reverts",
"type": "revert"
}
]
},
"writerOpts": {
"headerPartial": "## {{#if @root.linkCompare~}} [{{version}}]({{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}) {{~else}} {{~version}} {{~/if}} {{~#if title}} \"{{title}}\" {{~/if}} {{~#if date}} ({{date}}) {{/if}}\n"
}
}
}
}
Thanks for the amazing lib.
I've created a workflow with release-it that mixes pre-release and official release and I found a bug in the default behavior.
release-it is not bumped correctly pre-releases. As you can see in the examples below.
I've used standard-version lib to compare.
Check this test:
release-it | standard-version |
---|---|
![]() |
![]() |
As you can see, release-it jumps from official release 1.0.0
to 2.0.1
, on the other hand, standard-version does as expected.
Version
"devDependencies": {
"@release-it/conventional-changelog": "5.1.1",
"release-it": "15.6.0"
},
Config
{
"git": {
"commitMessage": "chore(release): ${version}",
"push": false
},
"github": {
"release": false
},
"npm": {
"publish": false
},
"gitlab": {
"release": false
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"strictSemVer": true,
"context": {
"linkCompare": true
},
"infile": "CHANGELOG.md"
}
}
}
I have used only the commands :
release-it --ci
for official releaserelease-it --ci --preRelease=alpha
for pre-releaseSimilar command in standard-version
standard-version
for official releasestandard-version --prerelease alpha
for pre-releaseEven though release-it was released as v16, the conventional package still refers to v15 as peer deps, I think it should be updated. The main reason I'm asking is because of the latest security advisory shown by Dependabot, I'm not sure the normalize-package-data
can be updated but still updating release-it to v16 in a step forward. Thanks
@release-it/[email protected] requires semver@2 || 3 || 4 || 5 via a transitive dependency on [email protected]
@release-it/[email protected] requires semver@^6.3.0 via a transitive dependency on [email protected]
@release-it/[email protected] requires semver@^6.3.0 via a transitive dependency on [email protected]
@release-it/[email protected] requires [email protected]
window-size
and detect-repo-changelog
are missing in the package.json, resulting in errors when exectuing release-it
. Installing both packages manually fixes the problem.
In the readme it says that Set a filename as infile to write the changelog to. If this file does not exist yet, it's created with the full history.
However for me that does not happen. I'm not sure if I'm doing something wrong.
After running the release-it command, I can see in the log that the changelog file is created:
➜ testing-repo git:(main) ✗ npm run release
> [email protected] release
> release-it
🚀 Let's release testing-repo (1.1.0...1.2.0)
Changelog:
## [1.2.0](...../testing-repo/compare/v1.1.0...v1.2.0) (2022-10-16)
### Features
....
### Bug Fixes
....
Changeset:
M .release-it.json
A CHANGELOG.md
M package-lock.json
M package.json
However I'm only getting the changelog since the latest tag, not the full history.
Here is my .release-it.json
config:
{
"git": {
"commitMessage": "release v${version}",
"requireCleanWorkingDir": false
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "conventionalcommits",
"infile": "CHANGELOG.md"
}
},
"npm": {
"publish": false
}
}
Am I missing something super obvious, or is this a bug?
Get 'Cannot read property 'replace' of undefined' when run programmatically. Setting with 'git: false'.
A little back-searching, it seems to be tagTemplate that is undefined in getChangelogStream.
Rolling back to 3.0.1 works.
I have the @release-it/conventional-changelog
plugin added which of course handles the version bump automatically as well as CHANGELOG generation. I would still like to select the version manually, as you can without this plugin, but I’m unsure if there is a way to disable that particular step.
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md"
}
},
Is it possible to disable/skip the conventional-recommended-bump
step?
There are no commits showing up in changelog when doing a release.
You can see this here: https://github.com/abacollection/abacollection/releases/tag/0.16.3
The project is set to use preset: angular
.
@webpro strange behavior now, that didn't exist before:
Using --no-increment with --github.release is deprecated. Add --github.update in release-it v15.
🚀 Let's update release-it (currently at 0.6.1)
Changelog:
Originally posted by @TheRealWaldo in #26 (comment)
As part of the arguments passed to conventional-changelog -> https://github.com/release-it/conventional-changelog/blob/master/index.js
const { version, previousTag, currentTag } = this.getContext();
return conventionalChangelog(
Object.assign(options, this.options),
{ version, previousTag, currentTag },
{
debug: this.config.isDebug ? this.debug : null
}
);
it doesn't let us override things like from
in the 3rd argument for gitRawCommitOps https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#gitrawcommitsopts
The use-case would be in order to specify the changelog between two pre-releases. given a set of pre-releases like:
1.0.0-alpha.0
1.0.0-alpha.1
1.0.0-beta.0
1.0.0-beta.1
^ I can generate a changelog between 1.0.0-alpha.0..1.0.0-beta.1
by passing from
and to
arguments.
would it be possible to get a feature request that allows something like overriding these from the commandline?
release-it --plugin.conventional-changelog.gitRawCommitOps.from=1.0.0-alpha.0 --plugin.conventional-changelog.gitRawCommitOps.to=1.0.0-beta.1
or is there no way to pass plugin options via the command line?
Hello.
In my release-it
+ @release-it/conventional-changelog
setup only last commit made is affecting version bump and written to the changelog.
Also only last commit is taken in to consideration when bumping a version.
So if:
feat
fix
<= this one usedExample repo: https://github.com/b12k/gh-action-release-it
This repo uses github action to do an automated release on PR merge to master (using rebase).
I would appreciate some advice on why it may happen.
Thanx in advance.
UPDATE:
commit af26c4a5effc9caa01d6110741e991e83bdeb0f5 (HEAD -> master, origin/master)
Author: ci <[email protected]>
Date: Wed Feb 10 12:33:08 2021 +0000
ci: release 0.1.2
commit 9fc3e73f36beca6dc351e9bee40cb6f6792e96a7
Author: Bogdan Kolesnyk <[email protected]>
Date: Wed Feb 10 13:31:56 2021 +0100
fix: dummy fix commit
commit 6714424d45175ef420f39e82f88e611489a61fbc
Author: Bogdan Kolesnyk <[email protected]>
Date: Wed Feb 10 13:31:35 2021 +0100
feat: enable debug mode
commit f07d4f5984f1d3388f6fff687bd1a86beb2878f1
Author: ci <[email protected]>
Date: Wed Feb 10 12:19:26 2021 +0000
ci: release 0.1.1
commit 560aa843694f8ec3e23c9194a55203c69e8c55cf
Author: Bogdan Kolesnyk <[email protected]>
Date: Wed Feb 10 13:18:23 2021 +0100
fix: fix 1
commit daddac8be0da536e1b1ce4ccd170392fb76cf3cf
Author: Bogdan Kolesnyk <[email protected]>
Date: Wed Feb 10 13:17:55 2021 +0100
feat: feat 2
commit 48a71f8e81c23ba3efce6fe39cf07a2801221a82
Author: ci <[email protected]>
Date: Wed Feb 10 11:32:27 2021 +0000
ci: release 0.1.0
commit 39f3e39a71b456e206674bc1ad2b17682ec42fef
Author: Bogdan Kolesnyk <[email protected]>
Date: Wed Feb 10 12:31:24 2021 +0100
feat: feat 1
commit df1d2d0457145a4ca79832259c51d4ca6026332c
Author: Bogdan Kolesnyk <[email protected]>
Date: Wed Feb 10 12:29:55 2021 +0100
initial
> [email protected] release /home/runner/work/gh-action-release-it/gh-action-release-it
> DEBUG=release-it:* release-it --git.requireBranch=master
2021-02-10T12:33:07.678Z release-it:config {
cosmiconfig: {
config: {
plugins: [Object],
git: [Object],
npm: [Object],
github: [Object]
},
filepath: '/home/runner/work/gh-action-release-it/gh-action-release-it/package.json'
}
}
2021-02-10T12:33:07.682Z release-it:config {
system: { 'release-it': '14.3.0', node: 'v12.20.1', os: 'Linux 5.4' }
}
2021-02-10T12:33:07.682Z release-it:config {
_: [],
git: {
requireBranch: 'master',
push: true,
commitMessage: 'ci: release ${version}',
pushArgs: [ '--follow-tags' ],
changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
requireCleanWorkingDir: true,
requireUpstream: true,
requireCommits: false,
addUntrackedFiles: false,
commit: true,
commitArgs: [],
tag: true,
tagName: null,
tagAnnotation: 'Release ${version}',
tagArgs: [],
pushRepo: ''
},
increment: undefined,
ci: true,
plugins: {
'@release-it/conventional-changelog': { infile: 'CHANGELOG.md', preset: [Object] }
},
npm: {
publish: false,
publishPath: '.',
tag: null,
otp: null,
ignoreVersion: false,
skipChecks: false,
timeout: 10
},
github: {
release: true,
releaseName: 'Release ${version}',
releaseNotes: null,
preRelease: false,
draft: false,
tokenRef: 'GITHUB_TOKEN',
assets: null,
host: null,
timeout: 0,
proxy: null,
skipChecks: false
},
hooks: {},
gitlab: {
release: false,
releaseName: 'Release ${version}',
releaseNotes: null,
tokenRef: 'GITLAB_TOKEN',
assets: null,
origin: null,
skipChecks: false
},
isUpdate: false,
version: {
increment: undefined,
isPreRelease: false,
preReleaseId: undefined
}
}
2021-02-10T12:33:07.846Z release-it:config {
'conventional-changelog': {
infile: 'CHANGELOG.md',
preset: { name: 'angular', types: [Array] }
}
}
2021-02-10T12:33:07.847Z release-it:plugins {
namespace: 'conventional-changelog',
options: {
infile: 'CHANGELOG.md',
preset: { name: 'angular', types: [Array] },
tagName: null
}
}
2021-02-10T12:33:07.857Z release-it:plugins {
namespace: 'npm',
options: {
publish: false,
publishPath: '.',
tag: null,
otp: null,
ignoreVersion: false,
skipChecks: false,
timeout: 10
}
}
2021-02-10T12:33:07.859Z release-it:plugins {
namespace: 'github',
options: {
release: true,
releaseName: 'Release ${version}',
releaseNotes: null,
preRelease: false,
draft: false,
tokenRef: 'GITHUB_TOKEN',
assets: null,
host: null,
timeout: 0,
proxy: null,
skipChecks: false,
tagName: null,
pushRepo: '',
changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
isUpdate: false
}
}
2021-02-10T12:33:07.863Z release-it:plugins {
namespace: 'git',
options: {
requireBranch: 'master',
push: true,
commitMessage: 'ci: release ${version}',
pushArgs: [ '--follow-tags' ],
changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
requireCleanWorkingDir: true,
requireUpstream: true,
requireCommits: false,
addUntrackedFiles: false,
commit: true,
commitArgs: [],
tag: true,
repo: 'gh-action-release-it',
tag_name: '0.1.2',
name: 'Release 0.1.2',
body: '## 0.1.2 (2021-02-10)\n' +
'\n' +
'\n' +
'### Bug Fixes\n' +
'\n' +
'* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))',
draft: false,
prerelease: false
}
POST /repos/b12k/gh-action-release-it/releases - 201 in 407ms
2021-02-10T12:33:12.044Z release-it:github {
url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/37858104',
assets_url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/37858104/assets',
upload_url: 'https://uploads.github.com/repos/b12k/gh-action-release-it/releases/37858104/assets{?name,label}',
html_url: 'https://github.com/b12k/gh-action-release-it/releases/tag/0.1.2',
id: 37858104,
author: {
login: 'b12k',
id: 10243265,
node_id: 'MDQ6VXNlcjEwMjQzMjY1',
avatar_url: 'https://avatars.githubusercontent.com/u/10243265?v=4',
gravatar_id: '',
url: 'https://api.github.com/users/b12k',
html_url: 'https://github.com/b12k',
followers_url: 'https://api.github.com/users/b12k/followers',
following_url: 'https://api.github.com/users/b12k/following{/other_user}',
gists_url: 'https://api.github.com/users/b12k/gists{/gist_id}',
starred_url: 'https://api.github.com/users/b12k/starred{/owner}{/repo}',
subscriptions_url: 'https://api.github.com/users/b12k/subscriptions',
organizations_url: 'https://api.github.com/users/b12k/orgs',
repos_url: 'https://api.github.com/users/b12k/repos',
events_url: 'https://api.github.com/users/b12k/events{/privacy}',
received_events_url: 'https://api.github.com/users/b12k/received_events',
type: 'User',
site_admin: false
},
node_id: 'MDc6UmVsZWFzZTM3ODU4MTA0',
tag_name: '0.1.2',
target_commitish: 'master',
name: 'Release 0.1.2',
draft: false,
prerelease: false,
created_at: '2021-02-10T12:33:08Z',
published_at: '2021-02-10T12:33:11Z',
assets: [],
tarball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/tarball/0.1.2',
zipball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/zipball/0.1.2',
body: '## 0.1.2 (2021-02-10)\n' +
'\n' +
'\n' +
'### Bug Fixes\n' +
'\n' +
'* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))'
}
🔗 https://github.com/b12k/gh-action-release-it/releases/tag/0.1.2
2021-02-10T12:33:12.090Z release-it:metrics {
🏁 Done (in 4s.)
url: 'http://www.google-analytics.com/collect',
statusCode: 200,
statusMessage: 'OK',
payload: 't=event&ec=session&ea=end'
}
The hidden
property doesn't work for me. If I have this release-it config:
{
"git": {
"commit": true,
"commitMessage": "chore(release): v${version}",
"commitArgs": "",
"tag": true,
"tagName": "v${version}",
"tagAnnotation": "v${version}",
"push": true,
"requireCommits": true,
"requireUpstream": false
},
"npm": {
"publish": false
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md",
"types": [
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{ "type": "revert", "section": "Reverts", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false },
{ "type": "ci", "section": "Continuous Integration", "hidden": false }
]
}
}
}
...so I have hidden: false
everywhere, despite of that only the Features
and Bug Fixes
section is visible in my CHANGELOG.md. It seems, that the hidden
property doesn't have effect at all.
The command used to generating the changelog: release-it --ci
. My release-it config file is called .release-it.json
.
release-it
version installed: 15.0.0
@release-it/conventional-changelog
version installed: 5.0.0
Since release-it 12, version number or bump given manually, like release-it patch
or release-it 1.0.0
is ignored when using conventional changelog.
As said in release-it/release-it#526 this is a feature that can be useful sometimes when for some reasons you want to bypass the auto bump and release a specific version.
I'd love to see that feature back 🙇
In most conventions supported with conventional-changelog
, there are commit types that should not trigger a version bump.
For example, when using the angular
or conventionalcommits
preset
, version bumps should only be applicable if using commits that begin with fix
, feat
, or other types that include a !
to signify a BREAKING CHANGE
.
For commit messages that either do not conform to the types for the specified preset or are not one of the types listed above that signify a version change, release-it
and this plugin should ignore the creation of a new semver release.
Is this achievable by this plug-in, since it overrides the standard version bump logic that happens in release-it
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.