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. 『重构--改善既有代码的设计』读书笔记----Move Method

    明确函数所在类的位置是很重要的.这样可以避免你的类与别的类有太多耦合.也会让你的类的内聚性变得更加牢固,让你的整个系统变得更加整洁.简单来说,如果在你的程序中,某个类的函数在使用的过程中,更多的是在和 ...

  2. 手机端的META你有多了解?

    我们先来简单了解下meta标签:meta指元素可提供有关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词. 标签位于文档的头部,不包含任何内容. 标签的属性定 ...

  3. python str + int

    TypeError: cannot concatenate 'str' and 'int' objects 1. print 'Is your secret number " + str(p ...

  4. 关于在DEDECMS当中模板文件不存在的解决方案

    大家可能在生成文档的时候遇到过,模板文件不存在,无法解析  这个问题,其实这个遇到这个问题的大多数人应该是修改了默认模板的名称才导致这样的问题,如果你避免这种问题大家在一开始对模板进行命名的时候就要写 ...

  5. 如何给div加一个边框border样式

    如何给div加一个边框样式? 对div盒子加一个边框样式很简单只需要使用border板块样式即可. 一.虚线与实线边框 边框虚线样式:dashed 边框实现样式:solid border:1px da ...

  6. Spark应用程序的运行框架

    几个基本概念: (1)job:包含多个task组成的并行计算,往往由action催生. (2)stage:job的调度单位. (3)task:被送到某个executor上的工作单元. (4)taskS ...

  7. 《how to design programs》15章 相互引用的数据定义

    由结构体组成的表与结构体中的表. 在用追溯形式建立家家谱树时,我们通常从某个后代除法,依次处理它的父母,组父母等.而构建树时,我们会不断添加谁是谁的孩子,而不是写出谁是谁的父母,从而建立一颗后代家谱树 ...

  8. mysql处理字符串的两个绝招:substring_index,concat

    mysql处理字符串的两个绝招:substring_index,concat 最近老是碰到要处理数据库中字符串的处理,发现用来用去也就是这两个函数: 1.substring_index(str,del ...

  9. Qt入门(14)——父窗口部件和子窗口部件

    这个例子演示了如何创建一个父窗口部件和子窗口部件.我们下面使用一个单一的父窗口部件和一个独立的子窗口部件编写界面.    #include <qvbox.h>我们添加了一个头文件qvbox ...

  10. weblogic启动报错之未修改hosts产生错误

    报错如下: Enter username to boot WebLogic server:weblogic Enter password to boot WebLogic server: <Ju ...