Skip to content

Commit ed718cf

Browse files
committed
chore: setup changelog generator and commit linter
1 parent 29b7d69 commit ed718cf

File tree

5 files changed

+405
-17
lines changed

5 files changed

+405
-17
lines changed

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
. "$(dirname -- "$0")/_/husky.sh"
33

44
yarn lint
5+
6+
echo "$@"
7+
8+
npx --no -- commitlint --edit "${1}"

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,14 @@ client.on('event name', async () => {
8484
await client.emit('wait for remote', 'message', true)
8585
})
8686
```
87+
88+
Contributing
89+
---
90+
91+
Follows [conventional commits](https://www.conventionalcommits.org/).
92+
93+
For example:
94+
95+
- `feat(Server): something` for server feature.
96+
97+
- `fix(Client): something` for client bug fix.

commitlint.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
}

package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@
2525
"coverage": "yarn run coverage:test && yarn run coverage:report",
2626
"coverage:test": "nyc yarn run test",
2727
"coverage:report": "nyc report --reporter=lcov --reporter=text-summary",
28-
"prepare": "husky install"
28+
"prepare": "husky install",
29+
"make-changelog": "changelog -x ci,test,chore",
30+
"release:major": "yarn make-changelog -M && git add CHANGELOG.md && git commit -m 'docs(changelog): update CHANGELOG' && lerna version --major",
31+
"release:minor": "yarn make-changelog -m && git add CHANGELOG.md && git commit -m 'docs(changelog): update CHANGELOG' && lerna version --minor",
32+
"release:patch": "yarn make-changelog -p && git add CHANGELOG.md && git commit -m 'docs(changelog): update CHANGELOG' && lerna version --patch"
2933
},
3034
"devDependencies": {
35+
"@commitlint/cli": "^17.0.3",
36+
"@commitlint/config-conventional": "^17.0.3",
3137
"ansi-colors": "^4.1.3",
3238
"axios": "^0.27.2",
3339
"eslint": "^8.18.0",
@@ -38,6 +44,7 @@
3844
"eslint-plugin-perf-standard": "^1.0.3",
3945
"eslint-plugin-promise": "^6.0.0",
4046
"form-data": "^4.0.0",
47+
"generate-changelog": "^1.8.0",
4148
"husky": "^8.0.0",
4249
"lerna": "^5.1.6",
4350
"lru-cache": "^7.10.1",

0 commit comments

Comments
 (0)