[Javascript] Writing conventional commits with commitizen
Because semantic-release requires a specific message format, it's easier to follow this convention using a tool called commitizen. In this lesson, we'll use it to write our first conventional commit message.
Install:
npm i -D commitizen cz-conventional-changelog
package.json:
{ "czConfig": { "path": "node_modules/cz-conventional-changelog" }, "scripts": { "commit": "git-cz", "start": "cross-env NODE_ENV=development webpack-dev-server --progress --profile --colors --display-error-details --display-cached --inline", "test": "cross-env NODE_ENV=test karma start", "test:single": "cross-env NODE_ENV=test karma start --single-run", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, }
The convention it follows is from angular
Committing a new feature with commitizen
n this lesson, we'll add a new feature to our library and use commitizen to generate our commit message that follows the convention for semantic-release to know it needs to bump the minor version.
npm run commit
It will let you go thoguht few steps of commit message, then you can push to github.
Automatically Releasing with TravisCI
Now that we have everything set up with semantic-release and we have a feature commit, let's push that up and watch TravisCI use semantic-release do our library release automatically.
After you git push to master. Traavis will automatically run the build and tests, if everything pass, then it will automaticlly update the package version number and release the package in github and npm.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2015-05-13 [Whole Web] [Node.js, PM2] Controlling runaway apps using pm2
2015-05-13 [AngularJS] angular-formly: Default Options