diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..c9cdc63 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..7cd8dd9 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..20d0d06 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run lint diff --git a/package.json b/package.json index 3c92a47..0abb6e6 100644 --- a/package.json +++ b/package.json @@ -25,12 +25,6 @@ "url": "https://github.com/Thream/socketio-jwt/issues" }, "homepage": "https://github.com/Thream/socketio-jwt#readme", - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "npm run lint" - } - }, "release-it": { "git": { "commitMessage": "chore(release): v${version}" @@ -77,7 +71,10 @@ "release": "release-it", "test": "jest", "test:watchAll": "jest --watchAll", - "test:clearCache": "jest --clearCache" + "test:clearCache": "jest --clearCache", + "postinstall": "husky install", + "prepublishOnly": "pinst --disable", + "postpublish": "pinst --enable" }, "peerDependencies": { "socket.io": ">=3.0.0" @@ -96,8 +93,9 @@ "@types/server-destroy": "1.0.1", "axios": "0.21.1", "express": "4.17.1", - "husky": "4.3.8", + "husky": "5.0.9", "jest": "26.6.3", + "pinst": "2.1.4", "release-it": "14.3.0", "rimraf": "3.0.2", "server-destroy": "1.0.1",