From db885f0137865af19ebb90fcebd19470dfdce9e9 Mon Sep 17 00:00:00 2001 From: Technote Date: Fri, 26 Feb 2021 21:26:47 +0900 Subject: [PATCH] chore: update husky settings --- .husky/.gitignore | 1 + .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ .huskyrc | 6 ------ package.json | 8 ++++++-- yarn.lock | 20 ++++++++++++++++---- 6 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit delete mode 100644 .huskyrc diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..d1fca51e --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn commitlint -- --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..d2ae35e8 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint-staged diff --git a/.huskyrc b/.huskyrc deleted file mode 100644 index 6ffa65e4..00000000 --- a/.huskyrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", - "pre-commit": "lint-staged" - } -} \ No newline at end of file diff --git a/package.json b/package.json index 18bcde8a..cd232f77 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,10 @@ "lint:fix": "eslint --fix 'src/**/*.ts' '__tests__/**/*.ts'", "release": "yarn release-ga --test", "test": "yarn lint && yarn cover", - "update": "npx npm-check-updates -u && yarn install && yarn upgrade && yarn audit" + "update": "npx npm-check-updates -u && yarn install && yarn upgrade && yarn audit", + "postinstall": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/husky ] || husky install", + "prepublishOnly": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --disable", + "postpublish": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --enable" }, "dependencies": { "@actions/core": "^1.2.6", @@ -51,11 +54,12 @@ "@typescript-eslint/eslint-plugin": "^4.15.1", "@typescript-eslint/parser": "^4.15.1", "eslint": "^7.20.0", - "husky": "^5.0.9", + "husky": "^5.0.0", "jest": "^26.6.3", "jest-circus": "^26.6.3", "lint-staged": "^10.5.4", "nock": "^13.0.7", + "pinst": "^2.1.6", "ts-jest": "^26.5.1", "typescript": "^4.1.5" }, diff --git a/yarn.lock b/yarn.lock index 4ac36522..ccee32e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2227,6 +2227,11 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +fromentries@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" + integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== + fs-extra@^9.0.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -2483,10 +2488,10 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -husky@^5.0.9: - version "5.0.9" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.9.tgz#6d38706643d66ed395bcd4ee952d02e3f15eb3a3" - integrity sha512-0SjcaY21a+IRdx7p7r/X33Vc09UR2m8SbP8yfkhUX2/jAmwcz+GR7i9jXkp2pP3GfX23JhMkVP6SWwXB18uXtg== +husky@5: + version "5.1.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.1.1.tgz#8678953fd8deb86f387cbf1ad50bb2f7f96e83f2" + integrity sha512-80LZ736V0Nr4/st0c2COYaMbEQhHNmAbLMN8J/kLk7/mo0QdUkUGNDjv/7jVkhug377Wh8wfbWyaVXEJ/h2B/Q== iconv-lite@0.4.24: version "0.4.24" @@ -3945,6 +3950,13 @@ picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +pinst@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/pinst/-/pinst-2.1.6.tgz#8d968b8ec1dac5dddcfc976c735592dbec58b42c" + integrity sha512-B4dYmf6nEXg1NpDSB+orYWvKa5Kfmz5KzWC29U59dpVM4S/+xp0ak/JMEsw04UQTNNKps7klu0BUalr343Gt9g== + dependencies: + fromentries "^1.3.2" + pirates@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"