Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

standard-commit

stasson26.9kMIT4.3.0TypeScript support: included

conventional commit

commit, conventional, conventional-changelog, standard-version, commitizen

readme

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

  /**
   * set to true to enforce 'Signed-off-by:' in footer.
   *
   * @default false
   */
  enforceSignedOffBy?: boolean

  /**
   * enforce issue reference when true else for specified list of types.
   *
   * @default []
   */
  enforceIssueRefs?: boolean | string[]

  /**
   * enforce issue reference to match the given pattern
   *
   * @default ['#']
   */
  issuePrefixes?: string[]

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

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

4.3.0 (2024-06-25)

Features

  • ignore git commit comments when parsing (bf542d5)

4.2.6 (2022-07-06)

Bug Fixes

  • bin: remove update notification (65b0b2b)

4.2.5 (2021-12-23)

Bug Fixes

4.2.4 (2021-03-31)

Bug Fixes

4.2.3 (2021-03-30)

Bug Fixes

  • import conventional-changelog-conventionalcommits (6c6f898)

4.2.2 (2021-03-30)

Bug Fixes

4.2.1 (2021-03-28)

4.2.0 (2021-03-28)

Features

  • configure issue parsing and prefixes (45568c3)

4.1.1 (2021-03-09)

Bug Fixes

  • lint of issue ref by types (bcca151)

4.1.0 (2021-03-09)

Features

  • enforce signed-of-by and refs trailers (e898764)
  • fix issue formating (08e76b3)

4.0.1 (2020-08-26)

Bug Fixes

  • unhandled config promise rejection (cd6cc95)
  • commitlint: from/to default is not null (487dc40)

4.0.0 (2020-08-09)

4.0.0-0 (2020-08-09)

3.3.0 (2019-11-11)

Features

  • prompt: use commitlint to validate subject (29695a0)
  • root: replace root with * as default scope (943f07c)

3.2.3 (2019-10-30)

3.2.2 (2019-10-30)

Bug Fixes

  • formatmsg: should not have footer when issue list is empty (ce04ba1)

3.2.1 (2019-10-29)

Bug Fixes

  • formatmsg: issue ref should start with # (a66e8cb)

3.2.0 (2019-10-26)

Features

  • commit: show message before commiting (1608415)
  • prompt: switch to enquirer prompts (d474a52)

Bug Fixes

  • commit: commit should fail when no staged files (78e895d)
  • prompt: cursor does not always show (5b40765)
  • suggest-prompt: fix missing module (1b057ee)

3.1.0 (2019-09-10)

Features

  • cli: print error message when internal error (97f640b)

3.0.2 (2019-07-28)

Bug Fixes

  • config: default type refactor and style are missing (07acdd9)

3.0.1 (2019-07-18)

Bug Fixes

  • config: even simpler config (e3e2b50)

3.0.0 (2019-07-18)

Features

  • cli: upgrade read-pkg-up to 5.0.0 (adfedae)
  • config: simple defaults (fbd3cc4)
  • package: upgrade to commitlint 8 (6a9f6f7)
  • prompt: ensure lowercase scope (12b7a93)

BREAKING CHANGES

  • config: config defaults have change, update your config to enable scopes

2.1.1 (2019-05-11)

Bug Fixes

  • prompt: scope config id not an array when enforce or suggest (1d01ecc)

2.1.0 (2019-05-08)

Features

  • init: save config in package or rc file (a5dc1bf)

2.0.0 (2019-05-08)

Features

  • commit: add init config option (295e0fb)
  • config: load config early (157de5d)
  • root: use esnext (e61ef20)

BREAKING CHANGES

  • root: Node 10 is required

1.5.1 (2019-04-27)

1.5.0 (2019-02-02)

Features

  • scope: strip scope from scoped packages (126fc93)

1.4.1 (2019-01-27)

1.4.0 (2019-01-27)

Bug Fixes

  • package: add missing rxjs dependency (8586b31)

Features

  • bin: run from local if installed (88db06b)

  • cli: add update notifier (9b70c98)

1.2.0 (2019-01-19)

Features

  • lib: adjust scope suggestion order (73d38e7)
  • prompt: improve scope prompt for suggest (c395f6d)

1.1.0 (2019-01-19)

Bug Fixes

  • scopes config is not applied (aa70173)
  • lib: update rules as per latest conventional commit (e276965)

Features

  • scopes: add support for monorepo package names (f4ba3dd)

1.0.1 (2018-10-27)

Bug Fixes

  • commit lint final status failure (969835a), closes #2

1.0.0 (2018-09-16)

Features

  • simplify commithook and commitlint (804ad71)

BREAKING CHANGES

  • standard-commit-lint is now standard-commitlint and standard-commit-msg-hook is now standard-commithook

0.10.0 (2018-09-16)

Bug Fixes

  • simplify default scopes (6fc2d54)

Features

  • add support for commitlint (2f10267)

0.9.1 (2018-09-13)

Bug Fixes

0.9.0 (2018-09-13)

Features

  • alias should be managed by git (1c3e954)

0.8.1 (2018-09-08)

Bug Fixes

0.8.0 (2018-09-08)

Features

  • add dedicated promptscope config (a9c2588)

0.7.1 (2018-09-07)

Bug Fixes

0.7.0 (2018-09-06)

Features

0.6.1 (2018-09-06)

Bug Fixes

  • new files are missing from scope suggestions (cca96fa)

0.6.0 (2018-09-04)

Bug Fixes

  • scope is badly formated (52b1438)

Features

  • add edit prompt (d16fc26)
  • enable types and scopes configuration (03b9c14)

0.5.0 (2018-09-03)

Bug Fixes

  • git-cc is actually a better alias (651b144)

Features

  • add scope config (50783c3)
  • check if can commit before prompt (8ecc8c7)

0.4.0 (2018-09-02)

Bug Fixes

Features

0.3.1 (2018-09-01)

Bug Fixes

  • remove breaking change extra formated line break (066ecf2)

0.3.0 (2018-09-01)

Bug Fixes

  • set alias to git-sc instead of git-cc (0d858ef)

Features

  • add commit message parsing (af6cb56)

0.2.3 (2018-08-31)

Bug Fixes

0.2.2 (2018-08-30)

Bug Fixes

  • distribution is missing ./commit.js (f1f1c03)

0.2.1 (2018-08-30)

Bug Fixes

  • distribution missing files (377ecb2)

0.2.0 (2018-08-30)

Features

0.1.0 (2018-08-29)

Features

  • prompt and format commit message (224938e)