Skip to content

Commit 6ace186

Browse files
committed
chore(contributing): added commit hooks and documentation for contributing
1 parent e31321a commit 6ace186

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Scrutinizer](https://scrutinizer-ci.com/g/auru/unity-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/auru/unity-api/)
66
[![Deps](https://david-dm.org/auru/unity-api/status.svg)](https://david-dm.org/auru/unity-api)
77
[![Deps-Dev](https://david-dm.org/auru/unity-api/dev-status.svg)](https://david-dm.org/auru/unity-api)
8+
[![Dependency Status](https://dependencyci.com/github/auru/unity-api/badge)](https://dependencyci.com/github/auru/unity-api)
89

910
> REST-API helper, wrapped around `fetch`.
1011
@@ -13,6 +14,7 @@
1314
* [API](#api)
1415
* [Usage](#usage)
1516
* [Example](#example)
17+
* [Contributing](#contributing)
1618
* [License](#license)
1719

1820
# Installation
@@ -215,5 +217,10 @@ const user = await API.user.get({ id: 1 }, { log: true });
215217

216218
```
217219

220+
# Contributing
221+
222+
* Provide [conventional commit messages](https://github.com/conventional-changelog/conventional-changelog-angular/blob/master/convention.md) by using `npm run commit` instead of `git commit`.
223+
* **Core contributors:** use GitHub's *Rebase and merge* as a default way of merging PRs.
224+
218225
# License
219226
MIT © AuRu

package.json

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
{
22
"name": "unity-api",
33
"version": "1.0.2",
4-
"description": "",
4+
"description": "REST-API helper, wrapped around fetch.",
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "npm run test && npm run clean && ./node_modules/.bin/babel src --out-dir dist",
8+
"build:watch": "npm run clean && ./node_modules/.bin/babel src --out-dir dist -s -w",
89
"clean": "./node_modules/.bin/rimraf dist",
10+
"commit": "./node_modules/.bin/git-cz",
911
"lint": "./node_modules/.bin/eslint --ignore-path=.gitignore --fix ./src",
1012
"lint-prod": "NODE_ENV='production' npm run lint",
13+
"version": " ./node_modules/.bin/conventional-changelog -i CHANGELOG.md -s && git add CHANGELOG.md",
1114
"prepublish": "npm run build",
12-
"precommit-msg": "echo 'Running pre-commit checks...' && exit 0",
15+
"precommit": "npm test",
16+
"commitmsg": "./node_modules/.bin/validate-commit-msg",
1317
"test": "npm run lint-prod && ./node_modules/.bin/ava --verbose",
14-
"test-watch": "npm run lint && ./node_modules/.bin/ava --verbose --watch"
18+
"test:watch": "npm run lint && ./node_modules/.bin/ava --verbose --watch"
1519
},
1620
"repository": {
1721
"type": "git",
@@ -25,6 +29,12 @@
2529
"bugs": {
2630
"url": "https://github.com/auru/unity-api/issues"
2731
},
32+
"keywords": [
33+
"api",
34+
"fetch",
35+
"rest",
36+
"unity"
37+
],
2838
"homepage": "https://github.com/auru/unity-api#readme",
2939
"engines": {
3040
"node": ">=4"
@@ -43,10 +53,14 @@
4353
"babel-preset-es2015": "^6.16.0",
4454
"babel-preset-stage-2": "^6.16.0",
4555
"babel-register": "^6.16.3",
56+
"commitizen": "^2.8.6",
57+
"conventional-changelog-cli": "^1.2.0",
58+
"cz-conventional-changelog": "^1.2.0",
59+
"husky": "^0.11.9",
4660
"eslint": "^3.7.1",
4761
"eslint-plugin-ava": "^3.1.0",
48-
"pre-commit": "^1.1.3",
49-
"rimraf": "^2.5.4"
62+
"rimraf": "^2.5.4",
63+
"validate-commit-msg": "^2.8.2"
5064
},
5165
"ava": {
5266
"files": [
@@ -63,5 +77,10 @@
6377
"babel-polyfill"
6478
],
6579
"babel": "inherit"
80+
},
81+
"config": {
82+
"commitizen": {
83+
"path": "./node_modules/cz-conventional-changelog"
84+
}
6685
}
6786
}

0 commit comments

Comments
 (0)