-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/state #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Chore/state #15
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1 @@ | ||
| <<<<<<< HEAD | ||
| <<<<<<< HEAD | ||
| pnpm lint-staged | ||
| ======= | ||
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
|
||
| echo "๐ pre-commit: lint-staged ์คํ ๋ฐ ์ต์ข ์ ๊ฒ ์์" | ||
|
|
||
| # 0) ์ปค๋ฐ์ ํฌํจ๋ ํ์ผ ๋ชฉ๋ก (์ถ๊ฐ/๋ณต์ฌ/์์ ) | ||
| STAGED_FILES="$(git diff --name-only --cached --diff-filter=ACMR)" | ||
| if [ -z "$STAGED_FILES" ]; then | ||
| echo "โน๏ธ ์คํ ์ด์ง๋ ํ์ผ์ด ์์ต๋๋ค. ๊ฑด๋๋๋๋ค." | ||
| exit 0 | ||
| fi | ||
|
|
||
| # 1) ๋ณ๊ฒฝ ํ์ผ๋ง ์๋ ์์ (eslint --fix, prettier --write) | ||
| if ! pnpm lint-staged; then | ||
| echo | ||
| echo "โ lint-staged ๋จ๊ณ์์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค." | ||
| echo " - ์๋์์ ๋ถ๊ฐํ ๋ฆฐํธ ์๋ฌ๊ฐ ์์ ์ ์์ด์." | ||
| echo " - ๋ก์ปฌ์์ 'pnpm lint'๋ก ์๋ฌ๋ฅผ ํ์ธํ๊ณ ์์ ํ ๋ค ๋ค์ ์ปค๋ฐํ์ธ์." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # 2) ์ต์ข ์ ๊ฒ: ์คํ ์ด์ง๋ ํ์ผ๋ง ๋์์ผ๋ก ๊ฒ์ฌ(์์ ์์ด ์คํจ๋ง ๊ฐ์ง) | ||
| PRETTIER_FAIL=0 | ||
| ESLINT_FAIL=0 | ||
|
|
||
| # ๊ฐํ๋ง ๊ตฌ๋ถ์๋ก ์ฌ์ฉ (๊ณต๋ฐฑ ํฌํจ ํ์ผ๋ช ์์ ) | ||
| IFS="$(printf '\n')" | ||
| for f in $STAGED_FILES; do | ||
| case "$f" in | ||
| *.js|*.jsx|*.ts|*.tsx|*.json|*.css|*.md) | ||
| # Prettier ํฌ๋งท ์ค์ ํ์ธ (์์ ์์ด ๊ฒ์ฌ) | ||
| pnpm -s prettier --check "$f" || PRETTIER_FAIL=1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| for f in $STAGED_FILES; do | ||
| case "$f" in | ||
| *.js|*.jsx|*.ts|*.tsx) | ||
| # ESLint ์ต์ข ํ์ธ (์์ ์์ด ๊ฒ์ฌ) | ||
| pnpm -s eslint --max-warnings=0 "$f" || ESLINT_FAIL=1 | ||
| ;; | ||
| esac | ||
| done | ||
| unset IFS | ||
|
|
||
| if [ "$PRETTIER_FAIL" -ne 0 ]; then | ||
| echo | ||
| echo "โ Prettier ํฌ๋งท ์๋ฐ์ด ๋จ์ ์์ต๋๋ค." | ||
| echo " - 'pnpm format' ํ ๋ค์ ์ปค๋ฐํ์ธ์." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ "$ESLINT_FAIL" -ne 0 ]; then | ||
| echo | ||
| echo "โ ESLint ์๋ฐ์ด ๋จ์ ์์ต๋๋ค." | ||
| echo " - 'pnpm lint:fix' ๋๋ ์๋ ์์ ํ ๋ค์ ์ปค๋ฐํ์ธ์." | ||
| exit 1 | ||
| fi | ||
|
|
||
| COUNT="$(printf '%s\n' "$STAGED_FILES" | wc -l | tr -d ' ')" | ||
| echo "โ pre-commit ํต๊ณผ: ${COUNT}๊ฐ ํ์ผ ์ ๊ฒ ์๋ฃ" | ||
| exit 0 | ||
| >>>>>>> 382ffc3 (Chore/code style commit convention) | ||
| ======= | ||
| pnpm lint-staged | ||
| >>>>>>> 103f47c (Chore/lucide react) | ||
| pnpm lint-staged | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| "use client"; | ||
|
|
||
| import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
| import { ReactNode, useState } from "react"; | ||
|
|
||
| export function Providers({ children }: { children: ReactNode }) { | ||
| const [client] = useState( | ||
| () => | ||
| new QueryClient({ | ||
| defaultOptions: { | ||
| queries: { retry: 2, refetchOnWindowFocus: false, staleTime: 30_000, gcTime: 5 * 60_000 }, | ||
| }, | ||
| }), | ||
| ); | ||
|
|
||
| return <QueryClientProvider client={client}>{children}</QueryClientProvider>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { create } from "zustand"; | ||
|
|
||
| type UserState = { | ||
| userId: string | null; | ||
| setUserId: (id: string | null) => void; | ||
| reset: () => void; | ||
| // ์์ผ๋ก ํ์ฅ๋ ์ ์๋ ์ ์ญ UI ์ํ ์์ | ||
| theme: "light" | "dark"; | ||
| toggleTheme: () => void; | ||
| }; | ||
|
|
||
| export const useUserStore = create<UserState>((set) => ({ | ||
| userId: null, | ||
| setUserId: (id) => set({ userId: id }), | ||
| reset: () => set({ userId: null }), | ||
| theme: "light", | ||
| toggleTheme: () => set((s) => ({ theme: s.theme === "light" ? "dark" : "light" })), | ||
| })); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hook now consists of a single
pnpm lint-stagedline and no longer declares a shebang or sources Huskyโshusky.sh. Git executes hook files directly, so without an interpreter header the hook can raiseExec format erroron platforms that donโt automatically fall back to/bin/sh. In addition, removing the bootstrap script drops the localnode_modules/.binfromPATH, sopnpm(and lint-staged) may not be found for contributors who rely on Corepack or non-global installations. As a result pre-commit checks can fail or be silently skipped across environments.Useful? React with ๐ย / ๐.