From ffc7eaafd0e2bbf53bce96b74c48e711838e5d14 Mon Sep 17 00:00:00 2001 From: hannes Date: Tue, 23 Feb 2021 09:53:13 +0800 Subject: [PATCH] chore: update husky to v5 (#2463) --- .husky/.gitignore | 1 + .husky/commit-msg | 4 ++ .husky/pre-commit | 4 ++ .../fixtures/husky/integration/package.json | 2 +- @commitlint/cli/fixtures/husky/package.json | 2 +- @commitlint/cli/fixtures/signoff/package.json | 2 +- package.json | 11 ++--- yarn.lock | 43 +++---------------- 8 files changed, 20 insertions(+), 49 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000000..effdb7aaed --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +node @commitlint/cli/lib/cli.js --edit $1 \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..dc0378c348 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint-staged \ No newline at end of file diff --git a/@commitlint/cli/fixtures/husky/integration/package.json b/@commitlint/cli/fixtures/husky/integration/package.json index 3f0ef85bae..da9eb87a29 100644 --- a/@commitlint/cli/fixtures/husky/integration/package.json +++ b/@commitlint/cli/fixtures/husky/integration/package.json @@ -1,6 +1,6 @@ { "scripts": {}, "devDependencies": { - "husky": "4.2.1" + "husky": "^5.1.1" } } diff --git a/@commitlint/cli/fixtures/husky/package.json b/@commitlint/cli/fixtures/husky/package.json index 3f0ef85bae..da9eb87a29 100644 --- a/@commitlint/cli/fixtures/husky/package.json +++ b/@commitlint/cli/fixtures/husky/package.json @@ -1,6 +1,6 @@ { "scripts": {}, "devDependencies": { - "husky": "4.2.1" + "husky": "^5.1.1" } } diff --git a/@commitlint/cli/fixtures/signoff/package.json b/@commitlint/cli/fixtures/signoff/package.json index 3f0ef85bae..da9eb87a29 100644 --- a/@commitlint/cli/fixtures/signoff/package.json +++ b/@commitlint/cli/fixtures/signoff/package.json @@ -1,6 +1,6 @@ { "scripts": {}, "devDependencies": { - "husky": "4.2.1" + "husky": "^5.1.1" } } diff --git a/package.json b/package.json index 01fed23cc9..a0e52148ea 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "reinstall": "yarn clean && yarn install", "start": "yarn watch", "test": "jest", - "test-ci": "jest --runInBand" + "test-ci": "jest --runInBand", + "postinstall": "yarn husky install" }, "commitlint": { "extends": [ @@ -89,7 +90,7 @@ "eslint-config-prettier": "^7.0.0", "eslint-plugin-import": "^2.20.1", "eslint-plugin-jest": "^24.0.0", - "husky": "4.3.8", + "husky": "^5.1.1", "jest": "26.6.3", "lerna": "^3.22.1", "lerna-v3": "npm:lerna@3", @@ -98,12 +99,6 @@ "ts-jest": "26.5.1", "typescript": "4.1.5" }, - "husky": { - "hooks": { - "commit-msg": "node @commitlint/cli/lib/cli.js -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } - }, "resolutions": { "**/lodash": "^4.17.19" } diff --git a/yarn.lock b/yarn.lock index 735aad7fec..81dae31b08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3451,11 +3451,6 @@ compare-func@^2.0.0: array-ify "^1.0.0" dot-prop "^5.1.0" -compare-versions@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" - integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== - component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -4788,13 +4783,6 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" -find-versions@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965" - integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== - dependencies: - semver-regex "^3.1.2" - findup-sync@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" @@ -5464,21 +5452,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@4.3.8: - version "4.3.8" - resolved "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d" - integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== - dependencies: - chalk "^4.0.0" - ci-info "^2.0.0" - compare-versions "^3.6.0" - cosmiconfig "^7.0.0" - find-versions "^4.0.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^5.0.0" - please-upgrade-node "^3.2.0" - slash "^3.0.0" - which-pm-runs "^1.0.0" +husky@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/husky/-/husky-5.1.1.tgz#8678953fd8deb86f387cbf1ad50bb2f7f96e83f2" + integrity sha512-80LZ736V0Nr4/st0c2COYaMbEQhHNmAbLMN8J/kLk7/mo0QdUkUGNDjv/7jVkhug377Wh8wfbWyaVXEJ/h2B/Q== iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" @@ -8121,7 +8098,7 @@ pirates@^4.0.1: dependencies: node-modules-regexp "^1.0.0" -pkg-dir@5.0.0, pkg-dir@^5.0.0: +pkg-dir@5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== @@ -8976,11 +8953,6 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -semver-regex@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" - integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== - "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -10262,11 +10234,6 @@ which-module@^2.0.0: resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-pm-runs@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" - integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= - which@^1.2.14, which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"