standard-commit
conventional commit
Last updated 5 months ago by stasson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install standard-commit 
SYNC missed versions from official npm registry.

standard-commit

npm version

A zero-config opiniated, commitizen like command line utility to enforce the conventional commits and have a clean changelog with standard-version.

  • standard-commit: Same as git commit but with prompt and formating of the commit message.

  • standard-commitlint runs commitlint based on your standard-commit config.

  • standard-commithook is meant to be run as a commit-msg git hook to enforce the convention.

Usage

npm install -g standard-commit
standard-commit --help

git alias

# you can create an alias:
git config --global alias.cc '!standard-commit'
# then use:
git cc <option>

commitlint

# Usage: standard-commitlint [options...]
# Where <options> is one of:
#   -f --from  lower end of the commit range to lint.
#   -t --to    upper end of the commit range to lint.
standard-commitlint --help

ci checks

# CI check before merge request
npx -p standard-commit standard-commitlint --from origin/master

repo setup

install yorkie (or husky@next)

npm install --save-dev yorkie standard-commit standard-version

and setup the scripts and commit-msg hook in your package.json

{
  "scripts": {
    "commit": "standard-commit",
    "commitlint": "standard-commitlint",
    "release": "standard-version"
  },
  "gitHooks": {
    "commit-msg": "standard-commithook"
  }
}
# use commit script to commit
npm -s run commit

# use commitlint script to check commit history
npm -s run commitlint -- --from  origin/master

# use release script to create a version commit
npm -s run release

Configuration

standard-commit --init

you can configure standard-commit via:

  • A .standard-commitrc file, written in YAML or JSON, with optional extensions: .yaml/.yml/.json.
  • A standard-commit.config.js file that exports an object.
  • A standard-commit key in your package.json file.
{
  /**
   * Allowed types
   *
   * @default ['feat','fix','chore','docs','style','refactor','test']
   */
  types?: string[]

  /**
   * When set to 'staged', suggest from staged files (git).
   * When set to 'packages, suggest from package names (monorepo).
   * When set to an array, the list of scopes.
   *
   * @default 'staged'
   */
  scopes?: 'staged' | 'packages' | string[]

  /**
   * When set to 'suggest', scope is optional.
   * When set to 'enforce, scope can not be empty.
   * When set to false, scope prompt is skipped.
   * @default false
   */
  promptScope?: 'suggest' | 'enforce' | false

  /**
   * whether to strip the scope for scoped packages
   * @default true
   */
  stripPackageScope?: boolean

  /**
   * set to false to skip.
   *
   * @default true
   */
  promptBody?: boolean

  /**
   * set to false to skip.
   *
   * @default true
   */
  promptBreaking?: boolean

  /**
   * set to false to skip.
   *
   * @default true
   */
  promptIssues?: boolean

  /**
   * set to false to skip.
   *
   * @default true
   */
  promptConfirm?: boolean

  /**
   * extra commitlint rules
   *
   * see http://marionebl.github.io/commitlint/#/reference-rules
   */
  rules?: {}
}

Current Tags

  • 2.0.0-rc4                                ...           @next (2 years ago)
  • 4.0.1                                ...           latest (5 months ago)
  • 2.0.0-rc2                                ...           next (2 years ago)

46 Versions

  • 4.0.1                                ...           5 months ago
  • 4.0.0                                ...           5 months ago
  • 3.3.0                                ...           a year ago
  • 3.2.3                                ...           a year ago
  • 3.2.1                                ...           a year ago
  • 3.2.0                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 2.0.0-rc4                                ...           2 years ago
  • 2.0.0-rc3                                ...           2 years ago
  • 2.0.0-rc2                                ...           2 years ago
  • 2.0.0-rc1                                ...           2 years ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.1                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.10.0                                ...           2 years ago
  • 0.9.1                                ...           2 years ago
  • 0.9.0                                ...           2 years ago
  • 0.8.1                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.1                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (17)
Dev Dependencies (19)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |