Conventional changelog plugin for release-it
Installations
npm install @release-it/conventional-changelog
Developer
release-it
Developer Guide
Module System
ESM
Min. Node Version
^18.18.0 || ^20.9.0 || ^22.0.0
Typescript Support
No
Node Version
18.20.4
NPM Version
10.7.0
Statistics
128 Stars
167 Commits
38 Forks
2 Watching
2 Branches
14 Contributors
Updated on 26 Nov 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
14,979,436
Last day
-6.6%
35,037
Compared to previous day
Last week
6.6%
211,567
Compared to previous week
Last month
19.3%
828,168
Compared to previous month
Last year
71%
6,658,703
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
Dev Dependencies
5
Conventional Changelog plugin for release-it
This plugin will provide the recommended bump to release-it, and update the changelog file (e.g. CHANGELOG.md
).
npm install --save-dev @release-it/conventional-changelog
Configuration
In the release-it config, for example:
1"plugins": { 2 "@release-it/conventional-changelog": { 3 "preset": { 4 "name": "angular" 5 }, 6 "infile": "CHANGELOG.md" 7 } 8}
The plugin is a wrapper around conventional-changelog packages conventional-recommended-bump, conventional-changelog-core and more.
Contents
preset
- Bump
- Changelog
preset
For preset.name
, use one of:
angular
atom
codemirror
conventionalcommits
ember
eslint
express
jquery
jscs
jshint
Use an object with name
and types
to use a custom preset:
1"plugins": { 2 "@release-it/conventional-changelog": { 3 "infile": "CHANGELOG.md", 4 "preset": { 5 "name": "conventionalcommits", 6 "types": [ 7 { 8 "type": "feat", 9 "section": "Features" 10 }, 11 { 12 "type": "fix", 13 "section": "Bug Fixes" 14 }, 15 {} 16 ] 17 } 18 } 19}
This is passed as the first argument to bumper.loadPreset
(in both bumper and changelog writer).
See the Conventional Changelog Configuration Spec (v2.1.0) for the configuration object to pass as preset
.
Bump
tagOpts
- This option will be passed as the first argument to
bumper.tag
- Type definition for
tagOpts
→ look forGetSemverTagsParams
commitsOpts
- This option will be passed as the first argument to
bumper.commits
- Type definition for
commitsOpts
→ look forGetCommitsParams
whatBump
- This option will be passed as the first argument to
bumper.bump
- Type definition for
whatBump
→ look forPreset['whatBump']
- Use
false
to skip releasing a new version:
1{ 2 "plugins": { 3 "@release-it/conventional-changelog": { 4 "whatBump": false 5 } 6 } 7}
ignoreRecommendedBump
Default value: false
Use true
to ignore the recommended bump, and use the version provided by release-it (command line argument or prompt).
Note that the changelog preview shows the recommended bump, as the desired version isn't known yet in the release-it
process. The infile
will have the correct version.
strictSemVer
Default value: false
Use true
to strictly follow semver, also in consecutive pre-releases. This means that from a pre-release, a
recommended bump will result in a next pre-release for the next version.
For example, from 1.0.0-alpha.0
a recommended bump of minor
will result in a preminor
bump to 1.1.0-alpha.0
.
The default behavior results in a prerelease
bump to 1.0.0-alpha.1
.
Changelog
infile
Default value: undefined
- Set a filename as
infile
to write the changelog to. If this file does not exist yet, it's created with the full history. - When
infile
is not set, the changelog generated by this plugin will still be used as release notes for e.g. GitHub Releases. - Set
infile: false
to disable the changelog writing (and only use the recommended bump for the next version).
header
Set the main header for the changelog document:
1{ 2 "plugins": { 3 "@release-it/conventional-changelog": { 4 "infile": "CHANGELOG.md", 5 "header": "# Changelog", 6 "preset": { 7 "name": "conventionalcommits" 8 } 9 } 10 } 11}
context
Default value: undefined
This option will be passed as the second argument (context
) to conventional-changelog-core, for example:
1"plugins": { 2 "@release-it/conventional-changelog": { 3 "context": { 4 "linkCompare": false 5 } 6 } 7}
gitRawCommitsOpts
Default value: undefined
Options for git-raw-commits
. For example, you can use the following option to include merge commits into
changelog:
1{ 2 "plugins": { 3 "@release-it/conventional-changelog": { 4 "gitRawCommitsOpts": { 5 "merges": null 6 } 7 } 8 } 9}
parserOpts
- Default value:
undefined
- Options for
conventional-commits-parser
- This option will also be passed as the second argument to
bumper.parserOptions
- Type definition for
parserOpts
→ look forParserOptions
For example, you can use the following option to set the merge pattern during parsing the commit message:
1{ 2 "plugins": { 3 "@release-it/conventional-changelog": { 4 "parserOpts": { 5 "mergePattern": "^Merge pull request #(\\d+) from (.*)$" 6 } 7 } 8 } 9}
writerOpts
- Default value:
undefined
- Options for
conventional-changelog-writer
- Type definition for
writerOpts
→ look forOptions
For example, you can use the following option to group the commits by 'scope' instead of 'type' by default.
1{ 2 "plugins": { 3 "@release-it/conventional-changelog": { 4 "writerOpts": { 5 "groupBy": "scope" 6 } 7 } 8 } 9}
If you want to customize the templates used to write the changelog, you can do it like in a .release-it.js
file like
so:
1const fs = require('fs'); 2 3const commitTemplate = fs.readFileSync('commit.hbs').toString(); 4 5module.exports = { 6 plugins: { 7 '@release-it/conventional-changelog': { 8 writerOpts: { 9 commitPartial: commitTemplate 10 } 11 } 12 } 13};
Command-line
Options for this plugin can be set from the command line. Some examples:
release-it --plugins.@release-it/conventional-changelog.infile=history.md
release-it --no-plugins.@release-it/conventional-changelog.infile
- Keys are separated by dots.
- Values can be negated by prefixing the key with
no-
. - Arguments may need to be single-quoted (
'
) such as--'deep.key=value'
or'--deep.key=value'
Depending on your shell or OS this may differ.
GitHub Actions
When using this plugin in a GitHub Action, make sure to set fetch-depth: 0
so the history is available to
determine the correct recommended bump and changelog.
Also see https://github.com/release-it/release-it/blob/master/docs/ci.md#github-actions
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
23 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
Reason
Found 5/25 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/publish-pkg.pr.new.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-pkg.pr.new.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/release-it/conventional-changelog/publish-pkg.pr.new.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-pkg.pr.new.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/release-it/conventional-changelog/publish-pkg.pr.new.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/release-it/conventional-changelog/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/release-it/conventional-changelog/test.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:31
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Score
4.5
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More