Skip to content

Commit

Permalink
Merge pull request #4 from streamich/docs-readme
Browse files Browse the repository at this point in the history
Docs readme
  • Loading branch information
streamich authored Jun 6, 2018
2 parents 063825f + 021fa4c commit ad1878f
Show file tree
Hide file tree
Showing 13 changed files with 491 additions and 94,546 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ package-lock.json
run.js
yarn.lock
/test/
/build/
/docs/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ script:
- yarn build
- yarn test
after_success:
- npx semantic-release
- npx semantic-release@15.5.0
- npx ci-scripts slack
- npx ci-scripts github-post
branches:
Expand Down
181 changes: 140 additions & 41 deletions README.md
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.
Expand All @@ -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` &mdash; Adding missing tests
- `feat` &mdash; A new feature
- `fix` &mdash; A bug fix
- `chore` &mdash; Build process or auxiliary tool changes
- `docs` &mdash; Documentation only changes
- `refactor` &mdash; A code change that neither fixes a bug or adds a feature
- `style` &mdash; Markup, white-space, formatting, missing semi-colons...
- `ci` &mdash; CI related changes
- `perf` &mdash; A code change that improves performance


### Subject

Expand Down Expand Up @@ -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
```

16 changes: 16 additions & 0 deletions build/readme.js
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}\` &mdash; ${defaults.types[type].description}\n`;
}

return str;
};

exports.config = () =>
`\`\`\`js
module.exports = ${JSON.stringify(defaults, null, 2)};
\`\`\``;
Loading

1 comment on commit ad1878f

@streamich
Copy link
Owner Author

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 🎉

Please sign in to comment.