Skip to content

Commit 0d142c8

Browse files
author
Chu Fan
committed
feat: 配置cz,优化commit hooks
1 parent d009770 commit 0d142c8

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
3+
## Git提交规范
4+
5+
6+
- type: commit 的类型
7+
- feat: 新特性
8+
- fix: 修改问题
9+
- refactor: 代码重构
10+
- docs: 文档修改
11+
- style: 代码格式修改, 注意不是 css 修改
12+
- test: 测试用例修改
13+
- chore: 其他修改, 比如构建流程, 依赖管理.
14+
- scope: commit 影响的范围, 比如: route, component, utils, build...
15+
- subject: commit 的概述, 建议符合 50/72 formatting
16+
- body: commit 具体修改内容, 可以分为多行, 建议符合 50/72 formatting
17+
- footer: 一些备注, 通常是 BREAKING CHANGE 或修复的 bug 的链接.
18+

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "一本有趣的JavaScript合集",
55
"scripts": {
66
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' + && rm -rf docs/.vuepress/dist",
7+
"commit": "git cz",
78
"dev": "vuepress dev docs",
89
"build": "vuepress build docs",
910
"build-proxy": "PROXY_DOMAIN=true vuepress build docs",
@@ -16,10 +17,16 @@
1617
"devDependencies": {
1718
"@vuepress/client": "2.0.0-beta.60",
1819
"@vuepress/utils": "2.0.0-beta.60",
20+
"cz-git": "^1.4.1",
1921
"eslint": "^8.34.0",
2022
"vue": "^3.2.47",
2123
"vuepress": "2.0.0-beta.60",
2224
"vuepress-plugin-search-pro": "2.0.0-beta.174",
2325
"vuepress-theme-hope": "^2.0.0-beta.174"
26+
},
27+
"config": {
28+
"commitizen": {
29+
"path": "node_modules/cz-git"
30+
}
2431
}
2532
}

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)