From 9144ab94577c1c6a85f27bd79f8a413cbf25c966 Mon Sep 17 00:00:00 2001 From: youncccat <1306036576@qq.com> Date: Fri, 28 May 2021 22:47:17 +0800 Subject: [PATCH 1/2] [Chore] ignore package-lock.json --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0cba56e..9220cd2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ packages/**/node_modules # dist dist -packages/**/dist \ No newline at end of file +packages/**/dist + +# NPM +package-lock.json \ No newline at end of file From 92a13c48064d052204a8a95020e9b2e7a2d387f2 Mon Sep 17 00:00:00 2001 From: youncccat <1306036576@qq.com> Date: Fri, 28 May 2021 22:47:42 +0800 Subject: [PATCH 2/2] [Feat::doc] add document of the project --- README.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da834a8..d6f5acd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,81 @@ # commitlint-wizardoc -Constraint rules that apply to the commit message for Wizardoc projects. +commitlint-wizardoc is a configuration package for [commitlint](https://github.com/conventional-changelog/commitlint) that contain some rules and plugins to check that your commit message conform to the `Wizardoc` convention. + +## Usage +If you have never used commitlint before, you can visit [commitlint document](https://commitlint.js.org/) for more detail. + +### Install +You can install `commitlint-wizardoc` using NPM and YARN as well. + +```shell +# NPM +npm i commitlint-wizardoc -D + +# YARN +yarn add commitlint-wizardoc -D +``` + +### Configuration +Create a [commitlint](https://github.com/conventional-changelog/commitlint) config in the root path of your project, and you can extends the `wizardoc` config to do all configuration work. + +For instance, create `.commitlintrc.js` that looks like: + +```js +module.exports = { + // This line config will read the NPM package named "commitlint-config-wizardoc", so please make sure you have installed it before config this line. + extends: 'wizardoc' +} +``` + +Now, that's all you need to do. + +## Convention +The commit message should consists of four parts: +``` +![Feat::scope] some sentence +^ ^ ^ ^ +| | | | +| | | | +| | | |- Subject(required) +| | | +| | |- Scope(optional) +| | +| |- Type(required) +| +|- Break change symbol(optional) +``` + +- `Break change symbol`: it can indicate that the commit contains break change +- `Type`: commit type that can only be one of the following types + - Feat + - Init + - Remove + - Delete + - Update + - Refactor + - Move + - New + - Add + - Patch + - Fix + - Test + - Stub + - Chore +- `Scope`: scope of modification +- `Subject`: description of the commit + +## Override configs +You can also override `Wizardoc` config to create your own configuration as well. + +```js +module.exports = { + extends: 'wizardoc', + rules: [ + // Set the $ as the third parameter if you wanna change break symbol to $ + "break-change-prefix": [2, "always", '$'], + ] +} +``` + +## LiCENSE +MIT. \ No newline at end of file