diff --git a/.husky/pre-commit b/.husky/pre-commit index 26684dd..e02c24e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index 9820c94..a32def7 100644 --- a/package.json +++ b/package.json @@ -25,13 +25,15 @@ "dependencies": { "@fontsource/pretendard": "^5.2.5", "@radix-ui/react-slot": "^1.2.3", + "@tanstack/react-query": "^5.90.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.544.0", "next": "15.5.3", "react": "19.1.0", "react-dom": "19.1.0", - "tailwind-merge": "^3.3.1" + "tailwind-merge": "^3.3.1", + "zustand": "^5.0.8" }, "devDependencies": { "@commitlint/cli": "^19.8.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dcdee76..191062e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,9 @@ importers: "@radix-ui/react-slot": specifier: ^1.2.3 version: 1.2.3(@types/react@19.1.13)(react@19.1.0) + "@tanstack/react-query": + specifier: ^5.90.2 + version: 5.90.2(react@19.1.0) class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -34,6 +37,9 @@ importers: tailwind-merge: specifier: ^3.3.1 version: 3.3.1 + zustand: + specifier: ^5.0.8 + version: 5.0.8(@types/react@19.1.13)(react@19.1.0) devDependencies: "@commitlint/cli": specifier: ^19.8.1 @@ -875,6 +881,20 @@ packages: integrity: sha512-HLgx6YSFKJT7rJqh9oJs/TkBFhxuMOfUKSBEPYwV+t78POOBsdQ7crhZLzwcH3T0UyUuOzU/GK5pk5eKr3wCiQ==, } + "@tanstack/query-core@5.90.2": + resolution: + { + integrity: sha512-k/TcR3YalnzibscALLwxeiLUub6jN5EDLwKDiO7q5f4ICEoptJ+n9+7vcEFy5/x/i6Q+Lb/tXrsKCggf5uQJXQ==, + } + + "@tanstack/react-query@5.90.2": + resolution: + { + integrity: sha512-CLABiR+h5PYfOWr/z+vWFt5VsOA2ekQeRQBFSKlcoW6Ndx/f8rfyVmq4LbgOM4GG2qtxAxjLYLOpCNTYm4uKzw==, + } + peerDependencies: + react: ^18 || ^19 + "@tybys/wasm-util@0.10.1": resolution: { @@ -3986,6 +4006,27 @@ packages: } engines: { node: ">=12.20" } + zustand@5.0.8: + resolution: + { + integrity: sha512-gyPKpIaxY9XcO2vSMrLbiER7QMAMGOQZVRdJ6Zi782jkbzZygq5GI9nG8g+sMgitRtndwaBSl7uiqC49o1SSiw==, + } + engines: { node: ">=12.20.0" } + peerDependencies: + "@types/react": ">=18.0.0" + immer: ">=9.0.6" + react: ">=18.0.0" + use-sync-external-store: ">=1.2.0" + peerDependenciesMeta: + "@types/react": + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + snapshots: "@alloc/quick-lru@5.2.0": {} @@ -4435,6 +4476,13 @@ snapshots: postcss: 8.5.6 tailwindcss: 4.1.13 + "@tanstack/query-core@5.90.2": {} + + "@tanstack/react-query@5.90.2(react@19.1.0)": + dependencies: + "@tanstack/query-core": 5.90.2 + react: 19.1.0 + "@tybys/wasm-util@0.10.1": dependencies: tslib: 2.8.1 @@ -6455,3 +6503,8 @@ snapshots: yocto-queue@0.1.0: {} yocto-queue@1.2.1: {} + + zustand@5.0.8(@types/react@19.1.13)(react@19.1.0): + optionalDependencies: + "@types/react": 19.1.13 + react: 19.1.0 diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 277752c..a5eaa6b 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,6 @@ import type { Metadata } from "next"; import "./globals.css"; +import { Providers } from "./providers"; export const metadata: Metadata = { title: "Custom Daily Planner", @@ -9,7 +10,23 @@ export const metadata: Metadata = { export default function RootLayout({ children }: { children: React.ReactNode }) { return ( -
{children} + + {/* + Providersλ‘ κ°μΈλ μ΄μ : + - React Queryμ QueryClientProviderλ₯Ό μ μ μ μ© + - λͺ¨λ νμ μ»΄ν¬λνΈκ° λμΌν client & cache 곡μ + - useQuery, useMutation ν μ΄ μ΄λμλ μ μ λμ + */} + {/* + β μΆν νμ₯ μμ: +