Skip to content

Commit e4b010b

Browse files
author
微信公众号:储凡
authored
Merge pull request #171 from 142vip/feat/simple-git-hooks
feat: 移除`husky`模块,使用`simple-git-hooks`来配置钩子函数,规范仓库内容
2 parents 9e4d75f + 0298f3b commit e4b010b

File tree

16 files changed

+95
-825
lines changed

16 files changed

+95
-825
lines changed

.husky/commit-msg

-5
This file was deleted.

.husky/pre-commit

-6
This file was deleted.

code/express/apps/apis-demo/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"name": "apis-demo",
33
"version": "0.0.1",
44
"description": "Express框架的API演示Demo",
5-
"dependencies": {
6-
"express": "^4.21.0"
7-
},
8-
"scripts": {},
95
"author": {
106
"name": "微信公众号:储凡",
117
"email": "[email protected]"
128
},
13-
"license": "MIT"
9+
"license": "MIT",
10+
"scripts": {},
11+
"dependencies": {
12+
"express": "^4.21.0"
13+
}
1414
}

code/express/apps/error-handle-demo/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"name": "error-handle-demo",
33
"version": "0.0.1",
44
"description": "基于Express框架的错误处理演示Demo",
5-
"dependencies": {
6-
"body-parser": "^1.20.2",
7-
"express": "^4.21.0",
8-
"method-override": "^3.0.0"
9-
},
10-
"scripts": {
11-
"dev": "node app.js"
12-
},
135
"author": {
146
"name": "微信公众号:储凡",
157
"email": "[email protected]"
168
},
17-
"license": "MIT"
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "node app.js"
12+
},
13+
"dependencies": {
14+
"body-parser": "^1.20.2",
15+
"express": "^4.21.0",
16+
"method-override": "^3.0.0"
17+
}
1818
}

code/express/apps/quick-start-demo/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"name": "quick-start-demo",
33
"version": "0.0.1",
44
"description": "express框架快速开始演示demo",
5-
"dependencies": {
6-
"express": "^4.21.0"
7-
},
8-
"scripts": {
9-
"dev": "node app.js"
10-
},
115
"author": {
126
"name": "微信公众号:储凡",
137
"email": "[email protected]"
148
},
15-
"license": "MIT"
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "node app.js"
12+
},
13+
"dependencies": {
14+
"express": "^4.21.0"
15+
}
1616
}

code/express/apps/static-source-demo/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"name": "static-source-demo",
33
"version": "0.0.1",
44
"description": "Express框架前端静态资源托管服务演示Demo",
5-
"dependencies": {
6-
"express": "^4.21.0"
7-
},
8-
"scripts": {
9-
"dev": "node app.js"
10-
},
115
"author": {
126
"name": "微信公众号:储凡",
137
"email": "[email protected]"
148
},
15-
"license": "MIT"
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "node app.js"
12+
},
13+
"dependencies": {
14+
"express": "^4.21.0"
15+
}
1616
}

code/express/apps/template-demo/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
"name": "template-demo",
33
"version": "0.0.1",
44
"description": "Express框架模板项目,约定一些开发规范",
5+
"author": {
6+
"name": "微信公众号:储凡",
7+
"email": "[email protected]"
8+
},
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "node app.js"
12+
},
513
"dependencies": {
614
"cookie-parser": "^1.4.6",
715
"debug": "^2.6.9",
816
"ejs": "^3.1.10",
917
"express": "^4.21.0",
1018
"http-errors": "^1.8.1",
1119
"morgan": "^1.10.0"
12-
},
13-
"scripts": {
14-
"dev": "node app.js"
15-
},
16-
"author": {
17-
"name": "微信公众号:储凡",
18-
"email": "[email protected]"
19-
},
20-
"license": "MIT"
20+
}
2121
}

code/koa/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"name": "koa",
33
"version": "1.0.0",
44
"description": "",
5+
"author": "",
6+
"license": "ISC",
57
"main": "index.js",
68
"scripts": {
79
"test": "echo \"Error: no test specified\" && exit 1"
810
},
9-
"author": "",
10-
"license": "ISC",
1111
"dependencies": {
1212
"koa": "^2.14.2"
1313
}

code/orm/sequelize/apis-demo/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"name": "api-demo",
33
"version": "0.0.1",
44
"description": "SequelizeORM框架的一些API操作",
5-
"dependencies": {
6-
"sequelize": "^6.35.1"
7-
},
8-
"scripts": {
9-
"dev": "node app.js"
10-
},
115
"author": {
126
"name": "微信公众号:储凡",
137
"email": "[email protected]"
148
},
15-
"license": "MIT"
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "node app.js"
12+
},
13+
"dependencies": {
14+
"sequelize": "^6.35.1"
15+
}
1616
}

code/orm/sequelize/db-curd-demo/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"name": "db-curd-demo",
33
"version": "0.0.1",
44
"description": "SequelizeORM框架的一些增删改查操作",
5-
"dependencies": {
6-
"sequelize": "^6.35.1"
7-
},
8-
"scripts": {
9-
"dev": "node app.js"
10-
},
115
"author": {
126
"name": "微信公众号:储凡",
137
"email": "[email protected]"
148
},
15-
"license": "MIT"
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "node app.js"
12+
},
13+
"dependencies": {
14+
"sequelize": "^6.35.1"
15+
}
1616
}

docs/develop-skill/code-style/eslint.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pnpm i eslint -D
3838
"eslint-plugin-import": "^2.25.2",
3939
"eslint-plugin-n": "^15.0.0",
4040
"eslint-plugin-promise": "^6.0.0",
41-
"eslint-plugin-vue": "^9.9.0",
41+
"eslint-plugin-vue": "^9.9.0"
4242
}
4343
```
4444

docs/develop-skill/package-manager.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ npm install 包名@1.x # 安装指定版本
9393
package.json文件
9494

9595
```json
96-
9796
{
98-
"name": "orderlee",
99-
"dependencies": {
100-
"argv": "0.0.2"
101-
}
97+
"name": "orderlee",
98+
"dependencies": {
99+
"argv": "0.0.2"
100+
}
102101
}
103-
104102
```
105103

106104
### 卸载模块

eslint.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import antFu from '@antfu/eslint-config'
22

33
// 参考:https://github.com/antfu/eslint-config
4-
54
export default antFu({
65
ignores: [
76
'**/CHANGELOG.md',
87
],
98
gitignore: true,
109
typescript: true,
1110
vue: true,
12-
jsonc: false,
11+
jsonc: true,
1312
yaml: true,
1413
formatters: {
1514
css: true,

package.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"name": "JavaScriptCollection",
3-
"description": "一本有趣的JavaScript合集",
4-
"version": "0.0.2-alpha.18",
53
"type": "module",
4+
"version": "0.0.2-alpha.18",
5+
"packageManager": "[email protected]",
6+
"description": "一本有趣的JavaScript合集",
67
"authorInfo": {
78
"name": "微信公众号:储凡",
89
"email": "[email protected]",
910
"url": "https://github.com/142vip",
1011
"homePage": "https://code.142vip.cn"
1112
},
12-
"packageManager": "[email protected]",
1313
"engines": {
1414
"node": ">=18.x",
1515
"pnpm": "9.6.0"
1616
},
1717
"scripts": {
1818
"preinstall": "npx only-allow pnpm && chmod +x ./scripts/*",
19-
"prepare": "husky install",
19+
"postinstall": "simple-git-hooks",
2020
"clean": "npx fa clean --ignore-tips --dist --vite --all",
21-
"dev": "vuepress dev docs",
2221
"lint": "npx fa lint",
2322
"lint:fix": "npx fa lint --fix",
23+
"dev": "vuepress dev docs",
2424
"build": "vuepress build docs --clean-temp --clean-cache",
2525
"build:proxy": "PROXY_DOMAIN=true vuepress build docs --clean-temp --clean-cache",
2626
"deploy:vercel": "vercel --prod",
@@ -31,23 +31,24 @@
3131
"@142vip/release-version": "^0.0.1-alpha.9",
3232
"@142vip/utils": "0.0.1-alpha.4",
3333
"@antfu/eslint-config": "^2.27.3",
34-
"@commitlint/cli": "^18.6.1",
35-
"@commitlint/config-conventional": "^18.6.3",
3634
"@vue/repl": "^4.3.1",
3735
"@vuepress/bundler-vite": "2.0.0-rc.15",
3836
"@vuepress/plugin-markdown-image": "2.0.0-rc.30",
3937
"eslint": "8.55.0",
4038
"hls.js": "^1.5.13",
41-
"husky": "^8.0.3",
42-
"lint-staged": "^15.2.7",
4339
"mermaid": "^10.9.1",
4440
"reveal.js": "^5.1.0",
41+
"simple-git-hooks": "^2.11.1",
4542
"typescript": "^5.5.4",
4643
"vercel": "^32.7.2",
4744
"vidstack": "^1.11.30",
4845
"vue": "^3.5.8",
4946
"vuepress": "2.0.0-rc.15",
5047
"vuepress-plugin-search-pro": "2.0.0-rc.53",
5148
"vuepress-theme-hope": "2.0.0-rc.53"
49+
},
50+
"simple-git-hooks": {
51+
"pre-commit": "pnpm lint",
52+
"prepare-commit-msg": "pnpm build"
5253
}
5354
}

0 commit comments

Comments
 (0)