From b9325ad9da685919d2f3e4877c871f5e48f0c5c0 Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:01:48 +0800 Subject: [PATCH 01/10] x1 --- package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index 482c435e6..8bc708c6d 100644 --- a/package.json +++ b/package.json @@ -57,11 +57,6 @@ "watch:css": "npm run css -- -o themes -w", "watch:js": "node build/build.js" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, "lint-staged": { "*.js": "eslint --fix" }, @@ -124,4 +119,4 @@ "creator", "generator" ] -} +} \ No newline at end of file From bbd5b6a3b2c4f962be29a1700ca06fef6f09d999 Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:03:44 +0800 Subject: [PATCH 02/10] x12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8bc708c6d..420c5c73c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lint:fix": "eslint . --fix", "lint": "prettier . --check && eslint .", "postinstall": "opencollective-postinstall", - "prepare": "npm run build", + "prepare": "sh build/husky.sh && npm run build", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", "serve": "node server", From c0d1ec275e7ceed7e2f9684fd69e1a0d0a20f553 Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:17:16 +0800 Subject: [PATCH 03/10] x --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 420c5c73c..5934b76b2 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lint:fix": "eslint . --fix", "lint": "prettier . --check && eslint .", "postinstall": "opencollective-postinstall", - "prepare": "sh build/husky.sh && npm run build", + "prepare": "sh build/husky.sh && npm run build && husky install", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", "serve": "node server", @@ -119,4 +119,4 @@ "creator", "generator" ] -} \ No newline at end of file +} From 61d15d7116c0407fc6635b0e8e4759815751267c Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:20:46 +0800 Subject: [PATCH 04/10] fix: husky install in v5. --- .gitignore | 1 + .husky/pre-commit | 4 ++++ build/husky.sh | 4 ++++ package.json | 4 ++-- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 build/husky.sh diff --git a/.gitignore b/.gitignore index ba0c48710..0a55e421e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /lib /node_modules /themes +/.husky/_ # exceptions !.gitkeep diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..d24fdfc60 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/build/husky.sh b/build/husky.sh new file mode 100644 index 000000000..1147ebef8 --- /dev/null +++ b/build/husky.sh @@ -0,0 +1,4 @@ +echo "Husky installing ..." +npm install husky --save-dev +npx husky install +echo "Husky is already installed and hooks enabled." \ No newline at end of file diff --git a/package.json b/package.json index 5934b76b2..420c5c73c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lint:fix": "eslint . --fix", "lint": "prettier . --check && eslint .", "postinstall": "opencollective-postinstall", - "prepare": "sh build/husky.sh && npm run build && husky install", + "prepare": "sh build/husky.sh && npm run build", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", "serve": "node server", @@ -119,4 +119,4 @@ "creator", "generator" ] -} +} \ No newline at end of file From 70928dfb830d5b13548489f479313ea5ed339042 Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:27:34 +0800 Subject: [PATCH 05/10] update: preinstall. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 420c5c73c..d3000b107 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "prettier": "prettier . --write", "lint:fix": "eslint . --fix", "lint": "prettier . --check && eslint .", - "postinstall": "opencollective-postinstall", - "prepare": "sh build/husky.sh && npm run build", + "postinstall": "opencollective-postinstall && sh build/husky.sh", + "prepare": "npm run build", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", "serve": "node server", From 9ff9c24cdd3e6cbbb331730ec90c0892f29999a9 Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:30:21 +0800 Subject: [PATCH 06/10] update: lint. --- .husky/pre-commit | 1 + 1 file changed, 1 insertion(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index d24fdfc60..0997d63ad 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +npm run prettier npx lint-staged From e2e5c43b0ba9e0921703e5099e49bfe67eed7a7f Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 8 Dec 2023 01:30:50 +0800 Subject: [PATCH 07/10] update: preinstall2. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d3000b107..6ef799c3f 100644 --- a/package.json +++ b/package.json @@ -119,4 +119,4 @@ "creator", "generator" ] -} \ No newline at end of file +} From f2425030615eed08979b7ecbabc8db371b0af2d3 Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 22 Dec 2023 13:51:56 +0800 Subject: [PATCH 08/10] test-1: keep hooks and only do preinstall. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6ef799c3f..775c63ccc 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "prettier": "prettier . --write", "lint:fix": "eslint . --fix", "lint": "prettier . --check && eslint .", - "postinstall": "opencollective-postinstall && sh build/husky.sh", + "postinstall": "opencollective-postinstall && npx husky install", "prepare": "npm run build", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", @@ -119,4 +119,4 @@ "creator", "generator" ] -} +} \ No newline at end of file From 669ecae8f139d30572db5607d661f26029fcd6cc Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 22 Dec 2023 13:57:49 +0800 Subject: [PATCH 09/10] update: clean. --- build/husky.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 build/husky.sh diff --git a/build/husky.sh b/build/husky.sh deleted file mode 100644 index 1147ebef8..000000000 --- a/build/husky.sh +++ /dev/null @@ -1,4 +0,0 @@ -echo "Husky installing ..." -npm install husky --save-dev -npx husky install -echo "Husky is already installed and hooks enabled." \ No newline at end of file From 77111e6c0550936bfb59f15bdefff8f603016bbd Mon Sep 17 00:00:00 2001 From: koy <369491420@qq.com> Date: Fri, 22 Dec 2023 14:00:35 +0800 Subject: [PATCH 10/10] update: format. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 775c63ccc..3d6bc29a3 100644 --- a/package.json +++ b/package.json @@ -119,4 +119,4 @@ "creator", "generator" ] -} \ No newline at end of file +}