Skip to content

[FEATURE]: 공통 타입 정의, Query Client 설정, 개발 툴체인 구성 - #17

Merged
gyehyun-bak merged 1 commit into
devfrom
feature/#16
Mar 7, 2026
Merged

[FEATURE]: 공통 타입 정의, Query Client 설정, 개발 툴체인 구성#17
gyehyun-bak merged 1 commit into
devfrom
feature/#16

Conversation

@gyehyun-bak

Copy link
Copy Markdown
Contributor

🔗 관련 이슈 (Related Issues)

✨ 변경 사항 (Changes)

기능 구현 전 필요한 기반 인프라 전반을 구성합니다.

공통 타입 정의

  • 서버 ApiResponse<T> 래퍼, ExceptionDto, FieldErrorDto를 서버 스펙에 맞게 재정의
  • ErrorCode 상수 (GEN / JWT / SEC / USER / POST / COMMENT / MERCHANT / CATEGORY)
  • 커서 기반 페이지네이션 공통 타입 CursorPageMeta
  • Nullable<T>, Optional<T> 유틸리티 타입 분리

TanStack Query 설정

  • QueryClient 인스턴스 (staleTime 1분, retry 1회, refetchOnWindowFocus 비활성)
  • QueryProvider를 앱 루트에 마운트

axios 환경변수 연동

  • baseURL을 하드코딩에서 VITE_API_BASE_URL ?? "/api" 로 변경

GitHub Actions CI 파이프라인

  • lint / test / build 3개 job 병렬 실행 (lint 통과 후 build 실행)
  • PR Checks 탭: dorny/test-reporter로 테스트별 통과/실패 + 스택트레이스 표시
  • PR 코멘트: davelosert/vitest-coverage-report-action으로 변경 파일 커버리지 delta 자동 게시
  • concurrency 설정으로 동일 PR 이전 실행 자동 취소
  • npm audit --audit-level=critical 보안 감사 포함

개발 툴체인

  • husky + lint-staged: pre-commit 시 staged 파일 ESLint + Prettier 자동 실행
  • steiger: FSD 레이어 import 규칙 위반 정적 분석 (npm run lint:arch)
  • @tanstack/eslint-plugin-query: ESLint에 TanStack Query 규칙 활성화
  • no-console ESLint 규칙 추가 (warn/error는 허용)
  • Vitest JUnit + coverage JSON 리포터 추가

📸 변경 사항 확인 (선택)

UI 변경 없음. CI 파이프라인 실행 결과는 이 PR의 Checks 탭 및 코멘트에서 확인 가능합니다.

⚠️ 고려 및 주의 사항 (선택)

axios 인터셉터 미구현
JWT 토큰 주입 및 401 → refresh 처리 인터셉터가 없습니다. 인증 기능 구현 시 별도 이슈로 추가해야 합니다.

steiger minimatch 취약점 (devDependency)
@feature-sliced/steiger-plugin 의존성 체인에 ReDoS(high) 취약점이 존재합니다. 프로덕션 번들에는 포함되지 않으며, upstream 수정 전까지 CI는 --audit-level=critical로 운영합니다.

💬 리뷰 포인트 (선택)

  • src/shared/types/ — 서버 스펙과의 타입 일치 여부
  • .github/workflows/ci.yml — job 구성 및 리포터 설정이 요구사항에 맞는지
  • steiger.config.tssrc/mocks/** 제외 처리가 적절한지

🔗 참고 사항 (선택)

- Align shared types with server response format (ApiResponse,
  ErrorCode, CursorPageMeta, etc.)
- Configure TanStack Query client and provider
- Fix axios baseURL to respect VITE_API_BASE_URL
- Add GitHub Actions CI with test/coverage reports on PRs
- Add husky + lint-staged pre-commit hook
- Add steiger for FSD architecture linting
- Register @tanstack/eslint-plugin-query in ESLint
@gyehyun-bak gyehyun-bak linked an issue Feb 21, 2026 that may be closed by this pull request
13 tasks
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 46.75% 36 / 77
🔵 Statements 47.4% 64 / 135
🔵 Functions 28.57% 4 / 14
🔵 Branches 44.18% 38 / 86
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/app/index.tsx 0% 0% 0% 0% 6-8
src/app/providers/index.ts 100% 100% 100% 100%
src/app/providers/query.tsx 0% 0% 0% 0% 8-10
src/shared/api/axios.ts 0% 0% 100% 0% 3-9
src/shared/api/index.ts 0% 0% 100% 0% 16
src/shared/api/query-client.ts 0% 100% 100% 0% 3-14
src/shared/types/api-response.ts 100% 100% 100% 100%
src/shared/types/common.ts 100% 100% 100% 100%
src/shared/types/error-code.ts 0% 100% 100% 0% 5-54
src/shared/types/index.ts 100% 100% 100% 100%
src/shared/types/pagination.ts 100% 100% 100% 100%
Generated in workflow #1 for commit f6c6879 by the Vitest Coverage Report Action

@gyehyun-bak gyehyun-bak self-assigned this Feb 21, 2026
@gyehyun-bak
gyehyun-bak merged commit 77e70e0 into dev Mar 7, 2026
5 of 7 checks passed
@gyehyun-bak
gyehyun-bak deleted the feature/#16 branch March 7, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: 공통 타입 정의, Query Client 설정, 개발 툴체인 구성

1 participant