语义化版本控制规范
约定式提交
Node.js
NPM
淘宝 NPM 镜像
Commitizen
conventional-changelog-cli
介绍
- 语义化版本控制
- 约定式提交
- 名词解释
- 演示
插件
1.安装Node.js
2.安装cnpm(淘宝 NPM 镜像)
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
3.安装version生成工具
$ cnpm install -g standard-version
新开项目使用版本号:0.1.0
$ standard-version -v --dry-run
升级指定版本号
$ standard-version -r 0.1.0 --dry-run
升级版本号
$ standard-version -r major --preMajor true --dry-run
$ standard-version -r minor --preMajor true --dry-run
$ standard-version -r patch --preMajor true --dry-run
先行版版本号
$ standard-version -p Alpha --preMajor true --dry-run
$ standard-version -p Beta --dry-run
$ standard-version -p RC --dry-run
第一次release:1.0.0-Stable
$ standard-version -f --releaseCommitMessageFormat 稳定版 --dry-run
升级版本号
$ standard-version -r major --dry-run
$ standard-version -r minor --dry-run
$ standard-version -r patch --dry-run
修订/增强
$ standard-version -p SR --dry-run
紧急修复
$ standard-version -p Hotfix --dry-run
自定义头信息
$ standard-version -r patch --changelogHeader # ERM(ER图建模工具)
帮助
$ standard-version -h
Usage: cli.js [options]
Preset Configuration:
--header A string to be used as the main header section of the CHANGELOG.
[string] [default: "# Changelog"]
--types An array of `type` objects representing the explicitly supported
commit message types, and whether they should show up in
generated `CHANGELOG`s.
[array] [default: [{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"
type":"chore","hidden":true},{"type":"docs","hidden":true},{"type":"style","hidden":true},{"typ
e":"refactor","hidden":true},{"type":"perf","hidden":true},{"type":"test","hidden":true}]]
--preMajor Boolean indicating whether or not the action being run
(generating CHANGELOG, recommendedBump, etc.) is being performed
for a pre-major release (<1.0.0).
This config setting will generally be set by tooling and not a
user. [boolean] [default: false]
--commitUrlFormat A URL representing a specific commit at a hash.
[string] [default: "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}"]
--compareUrlFormat A URL representing the comparison between two git SHAs.
[string] [default:
"{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}"]
--issueUrlFormat A URL representing the issue format (allowing a different URL
format to be swapped in for Gitlab, Bitbucket, etc).
[string] [default: "{{host}}/{{owner}}/{{repository}}/issues/{{id}}"]
--userUrlFormat A URL representing the a user's profile URL on GitHub, Gitlab,
etc. This URL is used for substituting @bcoe with
https://github.com/bcoe in commit messages.
[string] [default: "{{host}}/{{user}}"]
--releaseCommitMessageFormat A string to be used to format the auto-generated release commit
message. [string] [default: "chore(release): {{currentTag}}"]
Options:
--help, -h Show help [boolean]
--version, -v Show version number [boolean]
--release-as, -r Specify the release type manually (like npm version <major|minor|patch>)
[string]
--prerelease, -p make a pre-release with optional option value to specify a tag id [string]
--infile, -i Read the CHANGELOG from this file [default: "CHANGELOG.md"]
--message, -m [DEPRECATED] Commit message, replaces %s with new version.
This option will be removed in the next major version, please use
--releaseCommitMessageFormat. [string]
--first-release, -f Is this the first release? [boolean] [default: false]
--sign, -s Should the git commit and tag be signed? [boolean] [default: false]
--no-verify, -n Bypass pre-commit or commit-msg git hooks during the commit phase
[boolean] [default: false]
--commit-all, -a Commit all staged changes, not just files affected by standard-version
[boolean] [default: false]
--silent Don't print logs and errors [boolean] [default: false]
--tag-prefix, -t Set a custom prefix for the git tag to be created [string] [default: "v"]
--scripts Provide scripts to execute for lifecycle events (prebump, precommit,
etc.,) [default: {}]
--skip Map of steps in the release process that should be skipped [default: {}]
--dry-run See the commands that running standard-version would run
[boolean] [default: false]
--git-tag-fallback fallback to git tags for version, if no meta-information file is found
(e.g., package.json) [boolean] [default: true]
--path Only populate commits made under this path [string]
--changelogHeader Use a custom header when generating and updating changelog. [string]
--preset Commit message guideline preset [string] [default: "conventionalcommits"]~~~~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。