Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
feat: 🎸 add mmarkdown
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 6, 2018
1 parent 54ed319 commit 323f0e8
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 22 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ package-lock.json
run.js
yarn.lock
/test/
/build/
42 changes: 25 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite
Issues: MOL-1234
```


## Custom config

You can provide custom configuration in `changelog.congfig.js` file
Expand All @@ -59,13 +58,13 @@ in your repo. See [default configuration file](./src/defaults.js) for reference.
* 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 +79,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,6 +119,7 @@ The footer is the place to reference any tasks related to this commit.
## Why this Fork?

```
<<<<<<< HEAD
npm i -g git-cz
added 1 package in 0.612s
```
Expand All @@ -129,3 +130,10 @@ Installs in 0.6s vs 31.1s.
npm i -g mol-conventional-changelog
added 345 packages in 31.076s
```
=======
11:10 $ npm i -g mol-conventional-changelog
+ mol-conventional-changelog@1.4.0
added 345 packages in 38.677s
```
>>>>>>> feat: 🎸 add mmarkdown
11 changes: 11 additions & 0 deletions build/readme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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;
};
119 changes: 119 additions & 0 deletions build/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

# mol-conventional-changelog

## Setup

Install commitizen

```shell
npm install -g commitizen
```

Install the `mol-conventional-changelog` package.

```shell
npm install --save-dev mol-conventional-changelog
```

Init commitizen configuration

```shell
commitizen init mol-conventional-changelog --save-dev --save-exact
```

## Usage

```
git cz
```

## Examples

```
feat: 🎸 add 'graphiteWidth' option
```

```
fix: 🐞 stop graphite breaking when width < 0.1
```

```
perf: ⚡️ remove graphiteWidth option
BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason.
Issues: MOL-1234
```


## Custom config

You can provide custom configuration in `changelog.congfig.js` file
in your repo. See [default configuration file](./src/defaults.js) for reference.


## Commit Message Format

* A commit message consists of a **header**, **body** and **footer**.
* The header has a **type** and a **subject**:

```
<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.

The first line (type + subject) is limited to 50 characters **[enforced]**

Any other line should be limited to 72 character **[automatic wrapping]**

This allows the message to be easier to read on GitHub as well as in various git tools.

### Type

Must be one of the following:

```mmd
return scripts.types();
```

### Subject

The subject contains succinct description of the change:

* Use the imperative, present tense: "change" not "changed" nor "changes"
* No dot (.) at the end.

### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

#### Affects [only on [lerna](https://lernajs.io/) environments]

Select the packages the commit affected.

### Breaking Changes

**Breaking Changes** must start with the words `BREAKING CHANGE: `.

### Footer

The footer is the place to reference any tasks related to this commit.



## Why this Fork?

```
11:10 $ npm i -g mol-conventional-changelog
+ mol-conventional-changelog@1.4.0
added 345 packages in 38.677s
```
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
"build": "yarn build:cli && yarn build:cz",
"build:cli": "browserify --node -o dist/cli.js lib/cli.js",
"build:cz": "browserify --node -o dist/cz.js --standalone prompter lib/cz.js",
"build:readme": "mmarkdown",
"test": "mocha",
"precommit": "yarn lint",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"eslint": "eslint lib/*.js"
},
"devDependencies": {
"mmarkdown": "^1.0.0",
"browserify": "^16.2.2",
"mocha": "^5.2.0",
"inquirer": "^6.0.0",
Expand All @@ -44,5 +46,11 @@
"commitizen": {
"path": "./dist/cz.js"
}
},
"mmarkdown": {
"src": "./build/readme.md",
"out": "./README.md",
"scripts": "./build/readme.js",
"backup": false
}
}
Loading

0 comments on commit 323f0e8

Please sign in to comment.