zoukankan      html  css  js  c++  java
  • [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.

     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.

  • 相关阅读:
    1084: 计算两点间的距离(多实例测试)
    1083: 数值统计(多实例测试)
    回文数的判断
    1082: 敲7(多实例测试)
    BZOJ 1303 [CQOI2009]中位数图
    计蒜客 Yingchuan Online F题 (Floyd 变形)
    并查集入门题
    常见错点
    单调队列入门题
    线段树入门题
  • 原文地址:https://www.cnblogs.com/Answer1215/p/5488064.html
Copyright © 2011-2022 走看看