Skip to content

Commit

Permalink
feat: add cz-git
Browse files Browse the repository at this point in the history
添加cz-git来更方便的来生成git commit message
选项式

BREAKING CHANGE: package.json
readme
yarn.lock
  • Loading branch information
shanquan954 committed Jan 14, 2024
1 parent d113eb2 commit fe99609
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,40 @@
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged
```

## Commit-lint

### 1. Install

```bash
npm install --save-dev @commitlint/{cli,config-conventional,prompt-cli}
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
```

### 2. Provide a shortcut

```json
{
"scripts": {
"commit": "commit"
}
}
```

### 3. Test Prompt

```bash
git add .
npm run commit
```

### 4. Use CZ-Git

```bash
yarn add -D cz-git
```



6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"devDependencies": {
"@commitlint/config-conventional": "^18.4.4",
"@commitlint/prompt-cli": "^18.4.4",
"cz-git": "^1.8.0",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -32,5 +33,10 @@
},
"dependencies": {
"@commitlint/cli": "^18.4.4"
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,11 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3:
shebang-command "^2.0.0"
which "^2.0.1"

cz-git@^1.8.0:
version "1.8.0"
resolved "https://registry.npmmirror.com/cz-git/-/cz-git-1.8.0.tgz#d8566ae4b8848f04b7368e4a24dc0a465fc98dcd"
integrity sha512-XL5nXiqbW10YswQqWODrbwyWhydw3mLhP8OBrXyl8u4sIjTf/6mhGsizd6FA2VgPc4tZaNGguFoUyDj7vIBouw==

dargs@^7.0.0:
version "7.0.0"
resolved "https://registry.npmmirror.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc"
Expand Down

0 comments on commit fe99609

Please sign in to comment.