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.

 After you add a feature, git status and add all the files.
Then run:
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.

[Javascript] Writing conventional commits with commitizen的更多相关文章

  1. [Javascript] How to write a Javascript libarary

    Create package.json file //npm settings npm set init-author-name 'username' npm set init-author-emai ...

  2. 如何规范git commit提交

    相信很多人使用SVN.Git等版本控制工具时候都会觉得每次提交都要写一个注释有什么用啊?好麻烦,所以我每次都是随便写个数字就提交了,但是慢慢的我就发现了,如果项目长期维护或者修改很久之前的项目,没有一 ...

  3. (转) [it-ebooks]电子书列表

    [it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...

  4. Frontend Development

    原文链接: https://github.com/dypsilon/frontend-dev-bookmarks Frontend Development Looking for something ...

  5. iOS Plugins

    iOS Plugins This section provides details for how to implement native plugin code on the iOS platfor ...

  6. kafka原理和实践(四)spring-kafka消费者源码

    系列目录 kafka原理和实践(一)原理:10分钟入门 kafka原理和实践(二)spring-kafka简单实践 kafka原理和实践(三)spring-kafka生产者源码 kafka原理和实践( ...

  7. git commit template

    https://www.zhihu.com/question/27462267/answer/204658544 https://gist.github.com/adeekshith/cd4c95a0 ...

  8. 在 Git 提交信息中使用 Emoji

    Gitmoji 旨在解释如何在 Git 提交消息时使用表情符号.在提交信息时使用表情符号,可以更容易地识别提交的目的或意图. Emoji 列表 :优化项目结构 / 代码格式 :art: ️ :性能提升 ...

  9. JavaScript Patterns 2.12 Writing API Docs

    Free and open source tools for doc generation: the JSDoc Toolkit (http://code.google.com/p/jsdoc-too ...

随机推荐

  1. PHP 用Class构造JSON数据

    header('Content-type: appliction/json; charset=shift-JIS'); // error //{ // "result": fals ...

  2. 学C++不得不看的一篇文章[转]

    1. 扎实的基础.数据结构.离散数学.编译原理,这些是所有计算机科学的基础,如果不掌握他们,很难写出高水平的程序.据我的观察,学计算机专业的人比学其他专业的人更能写出高质量的软件.程序人人都会写,但当 ...

  3. C#.NET Winform 通用开发框架

    C/S系统开发框架-企业版 V4.0 (Enterprise Edition) 简介: http://www.csframework.com/cs-framework-4.0.htm 视频下载: 百度 ...

  4. bzoj1662: [Usaco2006 Nov]Round Numbers 圆环数

    Description 正如你所知,奶牛们没有手指以至于不能玩“石头剪刀布”来任意地决定例如谁先挤奶的顺序.她们甚至也不能通过仍硬币的方式. 所以她们通过"round number" ...

  5. 3ds max 2016 新功能

    3ds max 2016 新功能_MCG节点编辑器 这是介绍视频下载: http://pan.baidu.com/s/1gds4wqJ

  6. WPF会重写Windows GUI的历史吗?

    原文地址:http://tech.it168.com/zx/2007-09-15/200709141320653.shtml 你可能对微软的.NET框架3.0版本的最近的一次更新感到有点奇怪.主版本指 ...

  7. LINUX-LXC要好好关注下

    因为我觉得轻量极虚拟化可能是云的另一个发展方向. 至少,腾讯的WEB云引擎是以此为基础. LXC结合DOCKER.相信是快速云的另一种实现. 余下的,只是结合生产系统围绕这一中心进行的的二次开了. I ...

  8. 静态与动态IP设置

    静态IP设置 netsh interface ipv4 set address name="本地连接" source=static addr=192.168.0.212 (这个地方 ...

  9. sphinx插入css

    使用role指令达到目的. We can put following lines at the beginning of our RST file to specify its style. .. r ...

  10. 14.5.3 Locks Set by Different SQL Statements in InnoDB

    14.5.3 Locks Set by Different SQL Statements in InnoDB 通过不同的SQL语句设置的锁 在InnoDB中 一个锁定读, 一个UPDATE 或者一个D ...