From 398c5dc4bf955ef0c5b7aeaba797e57454b692c4 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 19 Dec 2024 14:47:27 +0800 Subject: [PATCH] chore: remove husky Signed-off-by: Innei --- .husky/post-checkout | 3 --- .husky/post-commit | 3 --- .husky/post-merge | 3 --- .husky/pre-commit | 1 - .husky/pre-push | 3 --- apps/core/package.json | 1 - package.json | 12 +++++------- pnpm-lock.yaml | 22 +++++++++------------- 8 files changed, 14 insertions(+), 34 deletions(-) delete mode 100755 .husky/post-checkout delete mode 100755 .husky/post-commit delete mode 100755 .husky/post-merge delete mode 100755 .husky/pre-commit delete mode 100755 .husky/pre-push diff --git a/.husky/post-checkout b/.husky/post-checkout deleted file mode 100755 index ca7fcb40088..00000000000 --- a/.husky/post-checkout +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } -git lfs post-checkout "$@" diff --git a/.husky/post-commit b/.husky/post-commit deleted file mode 100755 index 52b339cb3f4..00000000000 --- a/.husky/post-commit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } -git lfs post-commit "$@" diff --git a/.husky/post-merge b/.husky/post-merge deleted file mode 100755 index a912e667aa3..00000000000 --- a/.husky/post-merge +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } -git lfs post-merge "$@" diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 98475b507b5..00000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -pnpm test diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index 0f0089bc25d..00000000000 --- a/.husky/pre-push +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').\n"; exit 2; } -git lfs pre-push "$@" diff --git a/apps/core/package.json b/apps/core/package.json index f4e5ad4b880..7a4dce1babd 100644 --- a/apps/core/package.json +++ b/apps/core/package.json @@ -160,7 +160,6 @@ "@types/validator": "13.12.2", "@vercel/ncc": "0.38.3", "cron": "^3.3.1", - "husky": "9.1.7", "ioredis": "5.4.1", "sharp": "0.33.5", "socket.io": "^4.8.1", diff --git a/package.json b/package.json index 5daf1da9edd..e5c19738ccc 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "author": "Innei ", "scripts": { "format": "prettier --write \"apps/**/*.ts\" \"test/**/*.ts\" \"packages/**/*.ts\"", - "prepare": "husky", + "prepare": "simple-git-hooks", "build:external": "pnpm -C \"packages/compiled\" run build", "build": "pnpm run build:external && pnpm -C \"apps/core\" run build", "dev": "pnpm run build:external && pnpm -C \"apps/core\" run start", @@ -33,20 +33,18 @@ "cross-env": "7.0.3", "eslint": "^9.16.0", "eslint-plugin-unused-imports": "4.1.4", - "husky": "9.1.7", "lint-staged": "15.2.10", "prettier": "3.4.1", "rimraf": "6.0.1", + "simple-git-hooks": "2.11.1", "ts-node": "10.9.2", "tsconfig-paths": "4.2.0", "tsup": "8.3.5", "typescript": "5.7.2", "vite-tsconfig-paths": "5.1.3" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } + "simple-git-hooks": { + "pre-commit": "pnpm lint-staged" }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ @@ -63,4 +61,4 @@ "typescript": "5.6.3", "whatwg-url": "14.0.0" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 08edce22c1e..c28cfb6cb99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,9 +45,6 @@ importers: eslint-plugin-unused-imports: specifier: 4.1.4 version: 4.1.4(@typescript-eslint/eslint-plugin@8.17.0(@typescript-eslint/parser@8.17.0(eslint@9.16.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.16.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.16.0(jiti@1.21.6)) - husky: - specifier: 9.1.7 - version: 9.1.7 lint-staged: specifier: 15.2.10 version: 15.2.10 @@ -57,6 +54,9 @@ importers: rimraf: specifier: 6.0.1 version: 6.0.1 + simple-git-hooks: + specifier: 2.11.1 + version: 2.11.1 ts-node: specifier: 10.9.2 version: 10.9.2(@swc/core@1.10.1)(@types/node@22.10.1)(typescript@5.6.3) @@ -401,9 +401,6 @@ importers: cron: specifier: ^3.3.1 version: 3.3.1 - husky: - specifier: 9.1.7 - version: 9.1.7 ioredis: specifier: 5.4.1 version: 5.4.1 @@ -4287,11 +4284,6 @@ packages: humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - husky@9.1.7: - resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} - engines: {node: '>=18'} - hasBin: true - iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -5851,6 +5843,10 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-git-hooks@2.11.1: + resolution: {integrity: sha512-tgqwPUMDcNDhuf1Xf6KTUsyeqGdgKMhzaH4PAZZuzguOgTl5uuyeYe/8mWgAr6IBxB5V06uqEf6Dy37gIWDtDg==} + hasBin: true + simple-swizzle@0.2.2: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} @@ -11229,8 +11225,6 @@ snapshots: dependencies: ms: 2.1.3 - husky@9.1.7: {} - iconv-lite@0.4.24: dependencies: safer-buffer: 2.1.2 @@ -12953,6 +12947,8 @@ snapshots: signal-exit@4.1.0: {} + simple-git-hooks@2.11.1: {} + simple-swizzle@0.2.2: dependencies: is-arrayish: 0.3.2