Skip to content

Commit 62daf1d

Browse files
authored
refactor: add conventional changelog (#772)
* refactor: add conventional changelog * refactor: add standard-version * refactor: add commitlint * fix: try to fix commit workflow
1 parent de50134 commit 62daf1d

File tree

6 files changed

+1123
-46
lines changed

6 files changed

+1123
-46
lines changed

.commitlintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.czrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "./node_modules/cz-conventional-changelog"
3+
}

.github/workflows/commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Commit
2+
on:
3+
push:
4+
jobs:
5+
conventional-commit:
6+
runs-on: ubuntu-latest
7+
name: Checking commit name
8+
steps:
9+
- name: Checkout the repository
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Run commitlint
14+
uses: wagoid/commitlint-github-action@v4

.simple-git-hooks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"prepare-commit-msg": "exec < /dev/tty && yarn cz --hook || true",
23
"pre-commit": "yarn lint-staged",
34
"pre-push": "yarn test"
45
}

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
"format": "prettier --write src",
3636
"predeploy": "cd example && yarn && yarn build",
3737
"deploy": "gh-pages -d example/build",
38+
"commit": "cz",
39+
"release": "standard-version",
3840
"cleanPublish": "yarn test && clean-publish"
3941
},
4042
"dependencies": {
@@ -46,6 +48,8 @@
4648
},
4749
"devDependencies": {
4850
"@babel/core": "^7.15.8",
51+
"@commitlint/cli": "^13.2.1",
52+
"@commitlint/config-conventional": "^13.2.0",
4953
"@rollup/plugin-node-resolve": "^13.0.5",
5054
"@size-limit/preset-big-lib": "^6.0.3",
5155
"@storybook/addon-actions": "^6.3.12",
@@ -67,6 +71,8 @@
6771
"browserslist": "^4.17.3",
6872
"chart.js": "^3.1.0",
6973
"clean-publish": "^3.4.1",
74+
"commitizen": "^4.2.4",
75+
"cz-conventional-changelog": "3.3.0",
7076
"eslint": "^7.32.0",
7177
"eslint-config-prettier": "^8.3.0",
7278
"eslint-config-standard": "^16.0.3",
@@ -89,6 +95,7 @@
8995
"rollup-plugin-swc": "^0.2.0",
9096
"simple-git-hooks": "^2.6.1",
9197
"size-limit": "^6.0.3",
98+
"standard-version": "^9.3.1",
9299
"typescript": "^4.4.3",
93100
"webpack": "^5.58.2"
94101
},

0 commit comments

Comments
 (0)