Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Conventional changelog plugin for release-it

License

NotificationsYou must be signed in to change notification settings

release-it/conventional-changelog

Repository files navigation

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 therelease-it config, for example:

"plugins": {"@release-it/conventional-changelog": {"preset": {"name":"angular"    },"infile":"CHANGELOG.md"  }}

The plugin is a wrapper around conventional-changelog packagesconventional-recommended-bump,conventional-changelog-core and more.

Important

For theconventionalcommits preset, you may need to override the versionof the transitiveconventional-changelog-conventionalcommits dependency, like so:

{"overrides": {"conventional-changelog-conventionalcommits":"8.0.0"  }}

Use"resolutions" for pnpm or Yarn.

Contents

preset

Forpreset.name, use one of:

  • angular
  • atom
  • codemirror
  • conventionalcommits
  • ember
  • eslint
  • express
  • jquery
  • jscs
  • jshint

Use an object withname andtypes to use a custom preset:

"plugins": {"@release-it/conventional-changelog": {"infile":"CHANGELOG.md","preset": {"name":"conventionalcommits","types": [        {"type":"feat","section":"Features"        },        {"type":"fix","section":"Bug Fixes"        },        {}      ]    }  }}

This is passed as the first argument tobumper.loadPreset (in both bumper and changelog writer).

See theConventional Changelog Configuration Spec (v2.1.0) for the configuration object to pass aspreset.

Bump

tagOpts

commitsOpts

whatBump

{"plugins": {"@release-it/conventional-changelog": {"whatBump":false    }  }}
  • Use a function to manually provide a bump:
module.exports={plugins:{'@release-it/conventional-changelog':{whatBump:function(){return{releaseType:'10.0.1'};}}}};

ignoreRecommendedBump

Default value:false

Usetrue 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-itprocess. Theinfile will have the correct version.

strictSemVer

Default value:false

Usetrue to strictly follow semver, also in consecutive pre-releases. This means that from a pre-release, arecommended bump will result in a next pre-release for the next version.

For example, from1.0.0-alpha.0 a recommended bump ofminor will result in apreminor bump to1.1.0-alpha.0.

The default behavior results in aprerelease bump to1.0.0-alpha.1.

Changelog

infile

Default value:undefined

  • Set a filename asinfile to write the changelog to. If this file does not exist yet, it's created with the fullhistory.
  • Wheninfile is not set, the changelog generated by this plugin will still be used as release notes for e.g.GitHubReleases.
  • Setinfile: false to disable the changelog writing (and only use the recommended bump for the next version).

header

Default value:"# Changelog"

Set the main header for the changelog document:

{"plugins": {"@release-it/conventional-changelog": {"infile":"CHANGELOG.md","header":"# Changelog","preset": {"name":"conventionalcommits"      }    }  }}

context

Default value:undefined

This option will be passed as the second argument (context) toconventional-changelog-core, for example:

"plugins": {"@release-it/conventional-changelog": {"context": {"linkCompare":false    }  }}

gitRawCommitsOpts

Default value:undefined

Options forgit-raw-commits. For example, you can use the following option to include merge commits intochangelog:

{"plugins": {"@release-it/conventional-changelog": {"gitRawCommitsOpts": {"merges":null      }    }  }}

parserOpts

For example, you can use the following option to set the merge pattern during parsing the commit message:

{"plugins": {"@release-it/conventional-changelog": {"parserOpts": {"mergePattern":"^Merge pull request #(\\d+) from (.*)$"      }    }  }}

writerOpts

For example, you can use the following option to group the commits by 'scope' instead of 'type' by default.

{"plugins": {"@release-it/conventional-changelog": {"writerOpts": {"groupBy":"scope"      }    }  }}

If you want to customize the templates used to write the changelog, you can do it like in a.release-it.js file likeso:

constfs=require('fs');constcommitTemplate=fs.readFileSync('commit.hbs').toString();module.exports={plugins:{'@release-it/conventional-changelog':{writerOpts:{commitPartial:commitTemplate}}}};

Command-line

Options for this plugin can be set from the command line. Some examples:

release-it --plugins.@release-it/conventional-changelog.infile=history.mdrelease-it --no-plugins.@release-it/conventional-changelog.infile
  • Keys are separated by dots.
  • Values can be negated by prefixing the key withno-.
  • 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 setfetch-depth: 0 so the history is available todetermine the correct recommended bump and changelog.

Also seehttps://github.com/release-it/release-it/blob/master/docs/ci.md#github-actions

About

Conventional changelog plugin for release-it

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp