Skip to content

Commit d98eb5c

Browse files
committed
feat(conventional-commit): config tools for conventional commit
1 parent 500e4a7 commit d98eb5c

File tree

7 files changed

+1014
-14
lines changed

7 files changed

+1014
-14
lines changed

Diff for: .commitlintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": [ "@commitlint/config-conventional" ] }

Diff for: .czrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "path": "./node_modules/cz-conventional-changelog" }

Diff for: .husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm exec commitlint --edit ${1}

Diff for: .husky/prepare-commit-msg

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
if [ -t 0 ];
5+
then
6+
# running via terminal
7+
exec < /dev/tty && [ -z "$(cat ${1})" ] && pnpm exec cz --hook || true
8+
else
9+
# running via GUI
10+
[ -z "$(cat ${1})" ] && pnpm exec cz --hook || true
11+
fi

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ansidev 's blog
22

3+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
34
[![Netlify Status](https://api.netlify.com/api/v1/badges/2862c07d-8cb3-4326-bbf2-b3a07eeda938/deploy-status)](https://app.netlify.com/sites/ansidev/deploys)
45

56
## Introduction

Diff for: package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"lint": "eslint --ext .js,.vue --ignore-path .gitignore src",
1111
"lint:fix": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
1212
"gen:feed": "ts-node-esm ./src/cli/genFeed",
13-
"build": "cross-env NODE_ENV=production vite-ssg build && pnpm run gen:feed"
13+
"build": "cross-env NODE_ENV=production vite-ssg build && pnpm run gen:feed",
14+
"prepare": "husky install"
1415
},
1516
"dependencies": {
1617
"@vueuse/core": "^9.8.2",
@@ -28,6 +29,8 @@
2829
},
2930
"devDependencies": {
3031
"@antfu/eslint-config": "^0.34.0",
32+
"@commitlint/cli": "^17.3.0",
33+
"@commitlint/config-conventional": "^17.3.0",
3134
"@iconify/vue": "^4.0.2",
3235
"@intlify/unplugin-vue-i18n": "^0.8.1",
3336
"@mdit-vue/plugin-headers": "^0.11.2",
@@ -44,13 +47,16 @@
4447
"@yankeeinlondon/link-builder": "^1.2.1",
4548
"@yankeeinlondon/meta-builder": "^1.2.1",
4649
"autoprefixer": "^10.4.13",
50+
"commitizen": "^4.2.6",
4751
"cross-env": "^7.0.3",
52+
"cz-conventional-changelog": "^3.3.0",
4853
"eslint": "^8.30.0",
4954
"eslint-config-prettier": "^8.5.0",
5055
"feed": "^4.2.2",
5156
"fp-ts": "^2.13.1",
5257
"gray-matter": "^4.0.3",
5358
"happy-dom": "^8.1.1",
59+
"husky": "^8.0.2",
5460
"inferred-types": "^0.37.6",
5561
"markdown-it": "^13.0.1",
5662
"markdown-it-anchor": "^8.6.6",

0 commit comments

Comments
 (0)