Skip to content

Commit 3c48596

Browse files
committed
feat: [no-release] updates husky
1 parent 0157b72 commit 3c48596

File tree

3 files changed

+1540
-180
lines changed

3 files changed

+1540
-180
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ typings/
6161

6262
package-lock.json
6363
.dccache
64-
64+
.husky

package.json

+13-17
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@
1111
"es-check": "index.js"
1212
},
1313
"scripts": {
14-
"chore:delete-branch": "if git show-ref --quiet refs/heads/chore-changelog; then git branch -D chore-changelog; fi",
15-
"chore:branch": "git checkout -b chore-changelog",
16-
"chore:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
17-
"chore:pr": "git add . && git commit -m '[chore] updates changelog' --no-verify && git push origin chore-changelog -f",
18-
"chore": "pnpm run chore:delete-branch && pnpm run chore:branch && pnpm run chore:changelog && pnpm run chore:pr",
14+
"commit": "git-cz",
15+
"commit-msg": "commitlint --edit $1",
16+
"husky-setup": "if [[ ! -d /.husky/commit-msg ]]; then (husky install && pnpm husky-setup:commit-msg && pnpm husky-setup:post-merge && pnpm husky-setup:pre-commit); fi",
17+
"husky-setup:commit-msg": "npx husky add .husky/commit-msg 'pnpm run commit-msg'",
18+
"husky-setup:post-merge": "npx husky add .husky/post-merge 'pnpm run setup'",
19+
"husky-setup:pre-commit": "npx husky add .husky/pre-commit 'pnpm run pre-commit'",
1920
"lint": "eslint index.js --fix",
2021
"lint:ci": "eslint index.js",
21-
"prepush": "pnpm run lint && pnpm test",
22-
"postpublish": "git tag $npm_package_version && git push origin --tags && pnpm run chore",
22+
"pre-commit": "pnpm lint && pnpm test",
23+
"prepare": "is-ci || pnpm husky-setup",
24+
"prepublishOnly": "pnpm test",
25+
"release": "release-it",
2326
"report:coverage": "nyc report --reporter=lcov > coverage.lcov && codecov",
27+
"setup": "pnpm install --reporter=silent",
2428
"test": "nyc mocha test.js --timeout 10s --coverage"
2529
},
2630
"repository": {
@@ -45,7 +49,8 @@
4549
"husky": "^8.0.1",
4650
"mocha": "^10.0.0",
4751
"nyc": "^15.1.0",
48-
"prettier": "^2.5.1"
52+
"prettier": "^2.5.1",
53+
"release-it": "^15.1.3"
4954
},
5055
"dependencies": {
5156
"acorn": "^8.7.0",
@@ -86,14 +91,5 @@
8691
120
8792
]
8893
}
89-
},
90-
"husky": {
91-
"hooks": {
92-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
93-
"post-checkout": "if [[ $HUSKY_GIT_PARAMS =~ 1$ ]]; then pnpm i -r; fi",
94-
"post-merge": "pnpm i -r",
95-
"post-rewrite": "pnpm i -r",
96-
"pre-commit": "pnpm test && pnpm lint"
97-
}
9894
}
9995
}

0 commit comments

Comments
 (0)