-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from streamich/docs-readme
Docs readme
- Loading branch information
Showing
13 changed files
with
491 additions
and
94,546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ package-lock.json | |
run.js | ||
yarn.lock | ||
/test/ | ||
/build/ | ||
/docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,162 @@ | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) | ||
|
||
# mol-conventional-changelog | ||
# git-cz | ||
|
||
## Setup | ||
|
||
Install commitizen | ||
### Without installation | ||
|
||
```shell | ||
npm install -g commitizen | ||
npx git-cz | ||
``` | ||
|
||
Install the `mol-conventional-changelog` package. | ||
### Install globally standalone | ||
|
||
```shell | ||
npm install --save-dev mol-conventional-changelog | ||
npm install -g git-cz | ||
git-cz | ||
``` | ||
|
||
Init commitizen configuration | ||
### Install locally with Commitizen | ||
|
||
```shell | ||
commitizen init mol-conventional-changelog --save-dev --save-exact | ||
npm install -g commitizen | ||
npm install --save-dev git-cz | ||
``` | ||
|
||
## Usage | ||
`package.json`: | ||
|
||
```json | ||
{ | ||
"config": { | ||
"commitizen": { | ||
"path": "git-cz" | ||
} | ||
}, | ||
} | ||
``` | ||
|
||
run: | ||
|
||
```shell | ||
git cz | ||
``` | ||
|
||
## Examples | ||
### Install globally with Commitizen | ||
|
||
``` | ||
feat: 🎸 add 'graphiteWidth' option | ||
```shell | ||
npm install -g commitizen git-cz | ||
commitizen init git-cz --save-dev --save-exact | ||
``` | ||
|
||
``` | ||
fix: 🐞 stop graphite breaking when width < 0.1 | ||
``` | ||
run: | ||
|
||
```shell | ||
git cz | ||
``` | ||
perf: ⚡️ remove graphiteWidth option | ||
|
||
BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason. | ||
## Example | ||
|
||
Issues: MOL-1234 | ||
``` | ||
![](./docs/example.png) | ||
|
||
|
||
## Custom config | ||
|
||
You can provide custom configuration in `changelog.congfig.js` file | ||
in your repo. See [default configuration file](./src/defaults.js) for reference. | ||
|
||
in your repo. Below is default config: | ||
|
||
```js | ||
module.exports = { | ||
"list": [ | ||
"test", | ||
"feat", | ||
"fix", | ||
"chore", | ||
"docs", | ||
"refactor", | ||
"style", | ||
"ci", | ||
"perf" | ||
], | ||
"maxMessageLength": 64, | ||
"minMessageLength": 3, | ||
"questions": [ | ||
"type", | ||
"scope", | ||
"subject", | ||
"body", | ||
"breaking", | ||
"issues", | ||
"lerna" | ||
], | ||
"scopes": [], | ||
"types": { | ||
"chore": { | ||
"description": "Build process or auxiliary tool changes", | ||
"emoji": "🤖", | ||
"value": "chore" | ||
}, | ||
"ci": { | ||
"description": "CI related changes", | ||
"emoji": "🎡", | ||
"value": "ci" | ||
}, | ||
"docs": { | ||
"description": "Documentation only changes", | ||
"emoji": "✏️", | ||
"value": "docs" | ||
}, | ||
"feat": { | ||
"description": "A new feature", | ||
"emoji": "🎸", | ||
"value": "feat" | ||
}, | ||
"fix": { | ||
"description": "A bug fix", | ||
"emoji": "🐛", | ||
"value": "fix" | ||
}, | ||
"perf": { | ||
"description": "A code change that improves performance", | ||
"emoji": "⚡️", | ||
"value": "perf" | ||
}, | ||
"refactor": { | ||
"description": "A code change that neither fixes a bug or adds a feature", | ||
"emoji": "💡", | ||
"value": "refactor" | ||
}, | ||
"release": { | ||
"description": "Create a release commit", | ||
"emoji": "🏹", | ||
"value": "release" | ||
}, | ||
"style": { | ||
"description": "Markup, white-space, formatting, missing semi-colons...", | ||
"emoji": "💄", | ||
"value": "style" | ||
}, | ||
"test": { | ||
"description": "Adding missing tests", | ||
"emoji": "💍", | ||
"value": "test" | ||
} | ||
} | ||
}; | ||
``` | ||
|
||
## Commit Message Format | ||
|
||
* A commit message consists of a **header**, **body** and **footer**. | ||
* The header has a **type** and a **subject**: | ||
|
||
``` | ||
{{type}}: {{subject}} | ||
<BLANK LINE> | ||
{{body}} | ||
<BLANK LINE> | ||
{{breaking changes}} | ||
<BLANK LINE> | ||
{{footer}} | ||
<type>[(<scope>)]: <emoji> <subject> | ||
[BLANK LINE] | ||
[body] | ||
[BLANK LINE] | ||
[breaking changes] | ||
[BLANK LINE] | ||
[footer] | ||
``` | ||
|
||
The **header** is the only mandatory part of the commit message. | ||
|
@@ -80,15 +171,16 @@ This allows the message to be easier to read on GitHub as well as in various git | |
|
||
Must be one of the following: | ||
|
||
* `feat`: A new feature. | ||
* `fix`: A bug fix. | ||
* `docs`: Documentation only changes. | ||
* `style`: Markup-only changes (white-space, formatting, missing semi-colons, etc). | ||
* `refactor`: A code change that neither fixes a bug or adds a feature. | ||
* `perf`: A code change that improves performance. | ||
* `test`: Adding or updating tests. | ||
* `chore`: Build process or auxiliary tool changes. | ||
* `ci`: CI related changes. | ||
- `test` — Adding missing tests | ||
- `feat` — A new feature | ||
- `fix` — A bug fix | ||
- `chore` — Build process or auxiliary tool changes | ||
- `docs` — Documentation only changes | ||
- `refactor` — A code change that neither fixes a bug or adds a feature | ||
- `style` — Markup, white-space, formatting, missing semi-colons... | ||
- `ci` — CI related changes | ||
- `perf` — A code change that improves performance | ||
|
||
|
||
### Subject | ||
|
||
|
@@ -119,7 +211,14 @@ The footer is the place to reference any tasks related to this commit. | |
## Why this Fork? | ||
|
||
``` | ||
11:10 $ npm i -g mol-conventional-changelog | ||
+ [email protected] | ||
added 345 packages in 38.677s | ||
``` | ||
npm i -g git-cz | ||
added 1 package in 0.612s | ||
``` | ||
|
||
Installs in 0.6s vs 31.1s. | ||
|
||
``` | ||
npm i -g mol-conventional-changelog | ||
added 345 packages in 31.076s | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const defaults = require('../lib/defaults'); | ||
|
||
exports.types = () => { | ||
let str = ''; | ||
|
||
for (const type of defaults.list) { | ||
str += `- \`${type}\` — ${defaults.types[type].description}\n`; | ||
} | ||
|
||
return str; | ||
}; | ||
|
||
exports.config = () => | ||
`\`\`\`js | ||
module.exports = ${JSON.stringify(defaults, null, 2)}; | ||
\`\`\``; |
Oops, something went wrong.
ad1878f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build version:
1.6.0-master.23
🤞master
on Travis 🎉