当前位置: 首页 > news >正文

发布版本自动化记录版本功能方法

# 安装commitizennpm install --save-dev commitizen# 初始化Conventional Commits规范适配器npx commitizen init cz-conventional-changelog --save-dev --save-exact最后一步,需要在package.json中添加一个script"scripts": {..., // 此处省略其它配置"commit": "cz"
}
此时你的package.json应该是这样的:
{"name": "changelog","version": "1.0.0","description": "","main": "index.js","scripts": {"test": "echo "Error: no test specified" && exit 1","commit": "cz"},"keywords": [],"author": "","license": "ISC","devDependencies": {"commitizen": "^4.2.4","cz-conventional-changelog": "^3.3.0"},"config": {"commitizen": {"path": "./node_modules/cz-conventional-changelog"}}
}

使用release-it自动生成变更日志
安装release-it:
npm init release-it

 当前不需要在npm进行发布,因此需要在.release-it.json中添加下面的配置,禁用npm发布:
"npm": {"publish": false
}

为了兼容当前的提交信息格式,还需要执行下面的指令安装一个插件:
npm install @release-it/conventional-changelog --save-dev

如果想使用angular默认的changelog生成规范,只需要进行下面的配置就可以了:
创建.release-it.json


{"plugins": {"@release-it/conventional-changelog": {"infile": "CHANGELOG.md","ignoreRecommendedBump": true,"strictSemVer": true,"preset": {"name": "conventionalcommits","types": [{ "type": "feat", "section": "功能" },{ "type": "fix", "section": "修复BUG" },{ "type": "docs", "section": "文档" },{ "type": "style", "section": "样式" },{ "type": "refactor", "section": "重构" },{ "type": "perf", "section": "性能优化" },{ "type": "test", "section": "测试" }]}}},"git": {"commitMessage": "版本号 v${version}","commit": true,"tag": true,"push": true},"npm": {"publish": false}
}
http://www.lryc.cn/news/224544.html

相关文章:

  • Elastic Stack 8.11:引入一种新的强大查询语言 ES|QL
  • wx:for-item wx:for-index wx:for-key
  • 老师还不会评课?这里有你需要的解决方案
  • Talk | 马里兰大学博士生吴曦旸:分布式多智能体强化学习在复杂交通轨迹规划中的应用
  • 2023年下半年架构案例真题及答案
  • Java必考面试题,谈谈你对 Spring AOP 的理解
  • BERT和ChatGPT简单对比
  • 又一重要合作,创邻科技华为云联营产品正式发布
  • PHP+Swoole应用示例
  • 3线硬件SPI+DMA驱动 HX8347 TFT屏
  • 实验语音学的基本概念
  • 市场上ios签名公司做什么的?
  • 12. 一文快速学懂常用工具——docker 命令
  • API低代码开发应用场景
  • 从零开始搭建React+TypeScript+webpack开发环境-性能优化
  • sCrypt 现在支持 Ordinals 了
  • 乌班图搭建 LAMP
  • 【Unity细节】Unity中的Transform.SetParent还有你不知道的细节
  • php生成个性二维码
  • css排版—— 一篇优雅的文章(中英文) vs 聊天框的特别排版
  • 2022最新版-李宏毅机器学习深度学习课程-P46 自监督学习Self-supervised Learning(BERT)
  • 【MySQL习题】各个视频的平均完播率【全网最详细教学】
  • Linux Centos配置邮件发送
  • 宋浩高等数学笔记(三)微分中值定理
  • 华为认证 | 11月底这门HCIP认证即将发布!
  • U-Mail邮件系统安全登录解决方案
  • 在Java继承关系中变量访问规则
  • 11. 一文快速学懂常用工具——网络工具(下)
  • 什么GAN生成对抗网络?生成对抗网络可以干什么?
  • 采集Prestashop独立站