From c4cc835c80e85a97547b3943cd08bd4b9ed90cc3 Mon Sep 17 00:00:00 2001 From: effozen Date: Wed, 6 Nov 2024 03:22:27 +0900 Subject: [PATCH] =?UTF-8?q?[ENV][Fix]=20:=20Husky=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=8F=99=EC=9E=91=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=97=85=EB=A1=9C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/_/.gitignore | 1 + .husky/_/applypatch-msg | 2 ++ .husky/_/commit-msg | 2 ++ .husky/_/h | 22 ++++++++++++++++++++++ .husky/_/husky.sh | 9 +++++++++ .husky/_/post-applypatch | 2 ++ .husky/_/post-checkout | 2 ++ .husky/_/post-commit | 2 ++ .husky/_/post-merge | 2 ++ .husky/_/post-rewrite | 2 ++ .husky/_/pre-applypatch | 2 ++ .husky/_/pre-auto-gc | 2 ++ .husky/_/pre-commit | 2 ++ .husky/_/pre-merge-commit | 2 ++ .husky/_/pre-push | 2 ++ .husky/_/pre-rebase | 2 ++ .husky/_/prepare-commit-msg | 2 ++ .husky/pre-commit | 34 +++++++++++++++++----------------- package.json | 1 + 19 files changed, 78 insertions(+), 17 deletions(-) create mode 100644 .husky/_/.gitignore create mode 100755 .husky/_/applypatch-msg create mode 100755 .husky/_/commit-msg create mode 100644 .husky/_/h create mode 100644 .husky/_/husky.sh create mode 100755 .husky/_/post-applypatch create mode 100755 .husky/_/post-checkout create mode 100755 .husky/_/post-commit create mode 100755 .husky/_/post-merge create mode 100755 .husky/_/post-rewrite create mode 100755 .husky/_/pre-applypatch create mode 100755 .husky/_/pre-auto-gc create mode 100755 .husky/_/pre-commit create mode 100755 .husky/_/pre-merge-commit create mode 100755 .husky/_/pre-push create mode 100755 .husky/_/pre-rebase create mode 100755 .husky/_/prepare-commit-msg diff --git a/.husky/_/.gitignore b/.husky/_/.gitignore new file mode 100644 index 00000000..f59ec20a --- /dev/null +++ b/.husky/_/.gitignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/.husky/_/applypatch-msg b/.husky/_/applypatch-msg new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/applypatch-msg @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/commit-msg b/.husky/_/commit-msg new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/commit-msg @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/h b/.husky/_/h new file mode 100644 index 00000000..bf7c8964 --- /dev/null +++ b/.husky/_/h @@ -0,0 +1,22 @@ +#!/usr/bin/env sh +[ "$HUSKY" = "2" ] && set -x +n=$(basename "$0") +s=$(dirname "$(dirname "$0")")/$n + +[ ! -f "$s" ] && exit 0 + +if [ -f "$HOME/.huskyrc" ]; then + echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh" +fi +i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh" +[ -f "$i" ] && . "$i" + +[ "${HUSKY-}" = "0" ] && exit 0 + +export PATH="node_modules/.bin:$PATH" +sh -e "$s" "$@" +c=$? + +[ $c != 0 ] && echo "husky - $n script failed (code $c)" +[ $c = 127 ] && echo "husky - command not found in PATH=$PATH" +exit $c diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh new file mode 100644 index 00000000..f9d06379 --- /dev/null +++ b/.husky/_/husky.sh @@ -0,0 +1,9 @@ +echo "husky - DEPRECATED + +Please remove the following two lines from $0: + +#!/usr/bin/env sh +. \"\$(dirname -- \"\$0\")/_/husky.sh\" + +They WILL FAIL in v10.0.0 +" \ No newline at end of file diff --git a/.husky/_/post-applypatch b/.husky/_/post-applypatch new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/post-applypatch @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/post-checkout b/.husky/_/post-checkout new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/post-checkout @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/post-commit b/.husky/_/post-commit new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/post-commit @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/post-merge b/.husky/_/post-merge new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/post-merge @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/post-rewrite b/.husky/_/post-rewrite new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/post-rewrite @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/pre-applypatch b/.husky/_/pre-applypatch new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/pre-applypatch @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/pre-auto-gc b/.husky/_/pre-auto-gc new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/pre-auto-gc @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/pre-commit b/.husky/_/pre-commit new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/pre-commit @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/pre-merge-commit b/.husky/_/pre-merge-commit new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/pre-merge-commit @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/pre-push b/.husky/_/pre-push new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/pre-push @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/pre-rebase b/.husky/_/pre-rebase new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/pre-rebase @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/_/prepare-commit-msg b/.husky/_/prepare-commit-msg new file mode 100755 index 00000000..16aae78f --- /dev/null +++ b/.husky/_/prepare-commit-msg @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +. "$(dirname "$0")/h" \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index a65b148c..34f2fb24 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,17 +1,17 @@ -echo "๐Ÿ” commit ์ด์ „์— lint ๊ทœ์น™์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค..." -if pnpm lint-staged; then - echo "โœ… ๋ชจ๋“  lint ๊ทœ์น™์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ ์šฉ๋˜์—ˆ์Šต๋‹ˆ๋‹ค." - exit 0 -else - echo "โŒ lint ๊ทœ์น™ ๊ฒ€์‚ฌ์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค." - exit 1 -fi - -echo "๐Ÿ” commit ์ด์ „์— test๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค..." -if pnpm test; then - echo "โœ… ๋ชจ๋“  Test๋ฅผ ํ†ต๊ณผํ•˜์…จ์Šต๋‹ˆ๋‹ค." - exit 0 -else - echo "โŒ Test๋ฅผ ํ†ต๊ณผํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค." - exit 1 -fi +echo "๐Ÿ” commit ์ด์ „์— lint ๊ทœ์น™์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค..." +if pnpm lint-staged; then + echo "โœ… ๋ชจ๋“  lint ๊ทœ์น™์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ ์šฉ๋˜์—ˆ์Šต๋‹ˆ๋‹ค." + exit 0 +else + echo "โŒ lint ๊ทœ์น™ ๊ฒ€์‚ฌ์—์„œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค." + exit 1 +fi + +echo "๐Ÿ” commit ์ด์ „์— test๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค..." +if pnpm test; then + echo "โœ… ๋ชจ๋“  Test๋ฅผ ํ†ต๊ณผํ•˜์…จ์Šต๋‹ˆ๋‹ค." + exit 0 +else + echo "โŒ Test๋ฅผ ํ†ต๊ณผํ•˜์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค." + exit 1 +fi \ No newline at end of file diff --git a/package.json b/package.json index a0be4ed8..dd9ba9b4 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "description": "์ค‘์žฅ๋…„์ธต์„ ์œ„ํ•œ ์ ‘๊ทผ์„ฑ์„ ๋ฐ”ํƒ•์œผ๋กœ ํ•œ ์œ„์น˜ ๊ธฐ๋ฐ˜ ์„œ๋น„์Šค", "scripts": { + "prepare": "husky", "front": "pnpm --filter ddara-frontend dev", "backend": "pnpm --filter ddara-backend dev", "build": "pnpm --filter ddara-frontend build",