仓库版本管理-standard-version
# 这个玩意儿有什么用?
- 自动升级版本
- 自动打tag
- 自动生成changelog
不了解以上东西的,可以移步一下几篇文章 git版本管理以及生成changelog
# 使用
在package.json里配置命令即可,非常的方便
{
"script": {
"release-major": "standard-version --release-as major",
"release-minor": "standard-version --release-as minor",
"release-patch": "standard-version --release-as patch"
}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
# 配置哪些commit消息写入changelog
hidden
属性值控制是否将该类型的commit
消息写入changlog
, 不填的情况下默认是:false
.versionrc.js
module.exports = {
"types": [
{ "type": "feat", "section": "✨ Features | 新功能" },
{ "type": "fix", "section": "🐛 Bug Fixes | Bug 修复" },
{ "type": "init", "section": "🎉 Init | 初始化" },
{ "type": "docs", "section": "✏️ Documentation | 文档" },
{ "type": "style", "section": "💄 Styles | 风格" },
{ "type": "refactor", "section": "♻️ Code Refactoring | 代码重构" },
{ "type": "perf", "section": "⚡ Performance Improvements | 性能优化" },
{ "type": "test", "section": "✅ Tests | 测试" },
{ "type": "revert", "section": "⏪ Revert | 回退", "hidden": true },
{ "type": "build", "section": "📦 Build System | 打包构建" },
{ "type": "chore", "section": "🚀 Chore | 构建/工程依赖/工具" },
{ "type": "ci", "section": "👷 Continuous Integration | CI 配置" }
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 配置跳过生成changelog这个步骤
package.json
所有可配置跳过的有: bump, changelog, commit, tag
{
"standard-version": {
"skip": {
"changelog": true
}
}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
编辑 (opens new window)
上次更新: 2023/03/08, 09:35:38