Skip to content

THIP-396: 지현 폴더 구조 개선 (mock 파일 통합 및 store 파일 네이밍 컨벤션 표준화)#301

Merged
ljh130334 merged 3 commits intoTHIP-394from
THIP-396
Jan 4, 2026
Merged

THIP-396: 지현 폴더 구조 개선 (mock 파일 통합 및 store 파일 네이밍 컨벤션 표준화)#301
ljh130334 merged 3 commits intoTHIP-394from
THIP-396

Conversation

@ljh130334
Copy link
Member

@ljh130334 ljh130334 commented Jan 1, 2026

#️⃣ 연관된 이슈

https://thip2025.atlassian.net/browse/THIP2025-396?atlOrigin=eyJpIjoiMDI4OWIwYzMxZmFmNDQwNTg4ZjA1NWEzZWFiZTc0MjAiLCJwIjoiaiJ9

📝 작업 내용

프로젝트의 폴더 구조를 FSD(Feature-Sliced Design) 아키텍처에 맞게 재구성하고, 파일 네이밍 컨벤션을 표준화했습니다.

1. 목업 데이터 통합 및 재구성

  • 기존 문제점
    • 목업 데이터가 src/mocks/, src/data/, src/constants/ 3개 폴더에 분산되어 관리의 어려움
    • 파일명 컨벤션이 일관되지 않음 (aiwrite.mock.ts, groupDetail.mock.ts, bookData.ts, today-constants.ts 등)
  • 개선 내용
    • 모든 목업 데이터를 src/mocks/ 단일 폴더로 통합
    • 파일명을 .mock.ts 형식으로 통일
      • bookData.tsbook.mock.ts
      • postData.tspost.mock.ts
      • userData.tsuser.mock.ts
      • today-constants.tstoday.mock.ts
      • groupDetail.mock.tsgroup.mock.ts
    • src/data/, src/constants/ 폴더 삭제
  • 최종 구조
src/mocks/
├── aiWrite.mock.ts
├── book.mock.ts
├── group.mock.ts
├── members.mock.ts
├── notification.mock.ts
├── post.mock.ts
├── searchBook.mock.ts
├── today.mock.ts
└── user.mock.ts

2. Google Analytics 유틸리티 FSD 구조 적용

  • 기존 문제점
    • src/lib/ 폴더에 ga.ts 단일 파일만 존재하여 구조적으로 비효율적
    • FSD 아키텍처의 shared 레이어 구조 미적용
  • 개선 내용
    • FSD 구조에 맞게 src/shared/lib/analytics/ 경로로 이동
    • 빈 src/lib/ 폴더 삭제
  • 최종 구조
src/shared/
└── lib/
    └── analytics/
        └── ga.ts

3. Store 파일 네이밍 컨벤션 표준화

  • 기존 문제점
    • Store 파일명이 useXxxStore.ts 형식으로 React Hook prefix 포함
    • 파일명과 export하는 hook의 역할이 혼재되어 혼란 야기
  • 개선 내용
    • 파일명을 xxxStore.ts 형식으로 변경하여 store 정의 파일임을 명확히 표현
      • useAuthReadyStore.tsauthReadyStore.ts
      • useCommentBottomSheetStore.tscommentBottomSheetStore.ts
      • usePopupStore.tspopupStore.ts
      • useReplyStore.tsreplyStore.ts
  • 네이밍 규칙
    • 파일명: xxxStore.ts (store 정의)
    • Export: useXxxStore (hook)
  • 최종 구조
src/stores/
├── authReadyStore.ts
├── commentBottomSheetStore.ts
├── popupStore.ts
└── replyStore.ts

Summary by CodeRabbit

릴리스 노트

  • 리팩토링
    • 내부 모듈 구조 정리 및 import 경로 통합
    • 저장소 및 분석 모듈 명명 규칙 표준화

사용자 영향: 없음. 이 변경사항은 내부 코드 구조 개선으로 기능상 변화가 없습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
thip Ready Ready Preview, Comment Jan 1, 2026 4:30pm

@coderabbitai
Copy link

coderabbitai bot commented Jan 1, 2026

Walkthrough

17개 파일의 import 경로를 업데이트했습니다. use 접두사가 제거된 저장소 모듈(popupStore, replyStore, commentBottomSheetStore, authReadyStore)과 새로운 경로의 분석 모듈로 변경되었습니다. 런타임 동작이나 로직에는 변화 없이 모듈 위치만 재구성되었습니다.

Changes

Cohort / File(s) 변경 내용
Popup Store Import 경로 업데이트
src/components/common/Modal/ConfirmModal.tsx, src/components/common/Modal/MoreMenu.tsx, src/components/common/Modal/PopupContainer.tsx, src/components/common/Modal/ReplyModal.tsx, src/components/common/Modal/Snackbar.tsx, src/components/feed/Profile.tsx, src/components/feed/UserProfileItem.tsx, src/hooks/usePopupActions.ts, src/pages/groupDetail/GroupDetail.tsx, src/pages/searchBook/SearchBook.tsx
@/stores/usePopupStore@/stores/popupStore로 import 경로 변경
Reply Store Import 경로 업데이트
src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx, src/hooks/useReplyActions.ts, src/pages/feed/FeedDetailPage.tsx
@/stores/useReplyStore@/stores/replyStore로 import 경로 변경
Comment Bottom Sheet Store Import 경로 업데이트
src/components/memory/RecordItem/RecordItem.tsx, src/pages/memory/Memory.tsx
@/stores/useCommentBottomSheetStore@/stores/commentBottomSheetStore로 import 경로 변경
Auth Ready Store Import 경로 업데이트
src/components/common/MainHeader.tsx, src/hooks/useSocialLoginToken.ts
@/stores/useAuthReadyStore@/stores/authReadyStore로 import 경로 변경
Analytics Module 경로 업데이트
src/components/common/Layout.tsx, src/main.tsx
@/lib/ga@/shared/lib/analytics/ga로 import 경로 변경

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ho0010
  • heeeeyong

Poem

🐰 저장소 경로를 정리하고,
폴더 구조를 다시 짜서,
더 깔끔한 모듈로 변신!
use 없이도 잘 작동하고,
코드는 더욱 우아해졌네 ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 폴더 구조 개선, mock 파일 통합, store 파일 네이밍 컨벤션 표준화 등 주요 변경사항을 명확하게 요약하고 있습니다.
Linked Issues check ✅ Passed PR에서 수행한 모든 코드 변경사항(mock 파일 통합, store 파일 네이밍 표준화, analytics 파일 이동)이 THIP-396의 폴더 구조 개선 목표와 일치합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 import 경로 업데이트에 국한되며, 런타임 로직, 상태 관리 또는 컴포넌트 동작의 변경이 없어 범위 내입니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • THIP-396: Request failed with status code 404

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the project structure to align with Feature-Sliced Design (FSD) architecture by consolidating mock data files, relocating utilities, and standardizing file naming conventions. The changes improve code organization and maintainability without altering functionality.

Key Changes:

  • Consolidated all mock data from src/mocks/, src/data/, and src/constants/ into a single src/mocks/ directory with standardized .mock.ts naming convention
  • Moved Google Analytics utilities from src/lib/ga.ts to src/shared/lib/analytics/ga.ts to follow FSD architecture
  • Renamed store files from useXxxStore.ts to xxxStore.ts pattern while keeping exported hook names unchanged

Reviewed changes

Copilot reviewed 19 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/stores/replyStore.ts Renamed from useReplyStore.ts - manages reply state for comments
src/stores/popupStore.ts Renamed from usePopupStore.ts - manages popup/modal state with type definitions
src/stores/commentBottomSheetStore.ts Renamed from useCommentBottomSheetStore.ts - manages bottom sheet state for comments
src/stores/authReadyStore.ts Renamed from useAuthReadyStore.ts - manages authentication ready state
src/shared/lib/analytics/ga.ts Moved from src/lib/ga.ts - Google Analytics initialization and tracking utilities
src/mocks/user.mock.ts Renamed from userData.ts - mock user profile data
src/mocks/today.mock.ts Renamed from today-constants.ts - mock message data for "today's words" feature
src/mocks/post.mock.ts Renamed from postData.ts - mock post, feed, and comment data
src/mocks/group.mock.ts Renamed from groupDetail.mock.ts - mock group detail data
src/mocks/book.mock.ts Renamed from bookData.ts - mock book data
src/main.tsx Updated import path for GA initialization
src/components/common/Layout.tsx Updated import path for sendPageView function
src/components/common/MainHeader.tsx Updated import path for useAuthReadyStore
src/hooks/useSocialLoginToken.ts Updated import path for useAuthReadyStore
src/hooks/useReplyActions.ts Updated import path for useReplyStore
src/hooks/usePopupActions.ts Updated import paths for usePopupStore and types
src/pages/feed/FeedDetailPage.tsx Updated import path for useReplyStore
src/pages/memory/Memory.tsx Updated import path for useCommentBottomSheetStore
src/pages/groupDetail/GroupDetail.tsx Updated import path for usePopupStore
src/pages/searchBook/SearchBook.tsx Updated import path for usePopupStore
src/components/memory/RecordItem/RecordItem.tsx Updated import path for useCommentBottomSheetStore
src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx Updated import paths for useReplyStore and useCommentBottomSheetStore
src/components/feed/UserProfileItem.tsx Updated import path for usePopupStore
src/components/feed/Profile.tsx Updated import path for usePopupStore
src/components/common/Modal/PopupContainer.tsx Updated import paths for usePopupStore and types
src/components/common/Modal/ConfirmModal.tsx Updated import path for ConfirmModalProps type
src/components/common/Modal/MoreMenu.tsx Updated import path for MoreMenuProps type
src/components/common/Modal/ReplyModal.tsx Updated import path for ReplyModalProps type
src/components/common/Modal/Snackbar.tsx Updated import path for SnackbarProps type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main.tsx (1)

4-4: Analytics 모듈 경로가 FSD 구조에 맞게 업데이트되었습니다.

Google Analytics 유틸리티가 shared layer로 올바르게 이동되었습니다. 다만 상대 경로(./shared)를 사용하고 있는데, 다른 파일들(예: Layout.tsx)에서는 alias(@/shared)를 사용하고 있습니다.

선택사항: 경로 표기 일관성 개선

프로젝트 전체에서 일관성을 위해 alias를 사용하는 것을 고려해보세요:

-import { initGA } from './shared/lib/analytics/ga';
+import { initGA } from '@/shared/lib/analytics/ga';
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e60f9a4 and d4f2d60.

📒 Files selected for processing (29)
  • src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx
  • src/components/common/Layout.tsx
  • src/components/common/MainHeader.tsx
  • src/components/common/Modal/ConfirmModal.tsx
  • src/components/common/Modal/MoreMenu.tsx
  • src/components/common/Modal/PopupContainer.tsx
  • src/components/common/Modal/ReplyModal.tsx
  • src/components/common/Modal/Snackbar.tsx
  • src/components/feed/Profile.tsx
  • src/components/feed/UserProfileItem.tsx
  • src/components/memory/RecordItem/RecordItem.tsx
  • src/hooks/usePopupActions.ts
  • src/hooks/useReplyActions.ts
  • src/hooks/useSocialLoginToken.ts
  • src/main.tsx
  • src/mocks/book.mock.ts
  • src/mocks/group.mock.ts
  • src/mocks/post.mock.ts
  • src/mocks/today.mock.ts
  • src/mocks/user.mock.ts
  • src/pages/feed/FeedDetailPage.tsx
  • src/pages/groupDetail/GroupDetail.tsx
  • src/pages/memory/Memory.tsx
  • src/pages/searchBook/SearchBook.tsx
  • src/shared/lib/analytics/ga.ts
  • src/stores/authReadyStore.ts
  • src/stores/commentBottomSheetStore.ts
  • src/stores/popupStore.ts
  • src/stores/replyStore.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Agent
🔇 Additional comments (18)
src/components/memory/RecordItem/RecordItem.tsx (1)

6-6: LGTM! import 경로 업데이트가 올바르게 적용되었습니다.

스토어 파일명 표준화에 따라 import 경로가 정확하게 변경되었으며, 훅 사용법은 그대로 유지되어 동작에 영향이 없습니다.

src/components/common/CommentBottomSheet/GlobalCommentBottomSheet.tsx (1)

8-9: LGTM! 두 스토어의 import 경로가 정확하게 업데이트되었습니다.

replyStorecommentBottomSheetStore 모두 새로운 네이밍 컨벤션에 맞게 import 경로가 변경되었으며, 훅 사용은 변경 없이 정상적으로 유지됩니다.

src/pages/groupDetail/GroupDetail.tsx (1)

48-48: LGTM! popupStore import 경로가 올바르게 변경되었습니다.

스토어 파일명 표준화에 따라 import 경로가 정확하게 업데이트되었으며, Zustand 스토어 사용 패턴은 그대로 유지됩니다.

src/components/common/Modal/Snackbar.tsx (1)

3-3: LGTM! 타입 import 경로가 정확하게 변경되었습니다.

SnackbarProps 타입의 import 경로가 새로운 스토어 모듈 경로로 올바르게 업데이트되었으며, 컴포넌트 동작에는 영향이 없습니다.

src/pages/feed/FeedDetailPage.tsx (1)

15-15: 좋습니다! replyStore import 경로가 올바르게 변경되었습니다.

스토어 파일명 표준화에 따라 모든 import 경로가 일관되게 업데이트되었습니다. 검증 결과 이전 네이밍 패턴(from '@/stores/use[A-Z])은 코드베이스에 남아있지 않으며, 4개의 스토어 파일(authReadyStore, commentBottomSheetStore, popupStore, replyStore)이 모두 새로운 표준명을 따르고 있습니다. 21개의 import 문이 모두 일관되게 변경되었으며, 훅 사용법은 그대로 유지되어 동작에 영향이 없습니다.

src/hooks/useReplyActions.ts (1)

1-1: import 경로 변경이 올바르게 적용되었습니다.

store 파일 네이밍 표준화에 따라 import 경로가 정확하게 업데이트되었습니다. hook 이름은 useReplyStore로 유지되어 기존 사용 방식과 호환됩니다.

src/components/feed/UserProfileItem.tsx (1)

8-8: import 경로 업데이트가 정확합니다.

popup store의 경로가 새로운 네이밍 컨벤션에 맞게 변경되었으며, hook 사용 방식은 그대로 유지됩니다.

src/components/common/MainHeader.tsx (1)

9-9: import 경로가 표준화된 네이밍 컨벤션을 따릅니다.

auth ready store의 파일 경로가 올바르게 변경되었으며, useAuthReadyStore hook은 기존과 동일하게 사용됩니다.

src/hooks/useSocialLoginToken.ts (1)

4-4: store import 경로가 올바르게 변경되었습니다.

파일 네이밍 표준화에 따라 authReadyStore 경로가 정확하게 업데이트되었습니다.

src/pages/searchBook/SearchBook.tsx (1)

42-42: import 경로가 정확하게 업데이트되었습니다.

PopupStore의 import 경로가 새로운 표준(@/stores/popupStore)에 맞게 변경되었으며, 훅 사용(line 70)과 직접 store 접근(line 235)이 모두 올바르게 작동합니다. 전체 코드베이스에서 이전 import 경로가 제거되었고 새로운 경로로 일관되게 업데이트되었습니다.

src/components/common/Modal/MoreMenu.tsx (1)

3-3: 타입 import 경로가 올바르게 업데이트되었습니다.

타입 import 경로가 새로운 store 파일 위치를 정확하게 반영하고 있습니다.

src/pages/memory/Memory.tsx (1)

9-9: Store import 경로가 올바르게 업데이트되었습니다.

commentBottomSheetStore 파일의 새로운 위치를 정확하게 반영하고 있으며, 내보낸 훅의 이름은 그대로 유지되어 기존 코드와의 호환성이 보장됩니다.

src/hooks/usePopupActions.ts (1)

6-7: import 경로 업데이트가 올바르게 적용되었습니다.

Store 파일 네이밍 컨벤션 변경에 따라 import 경로가 @/stores/popupStore로 정확하게 업데이트되었으며, 내보낸 훅의 이름(usePopupStore)은 일관되게 유지됩니다. 코드베이스 전체에서 이전 경로에 대한 참조가 없음을 확인했습니다.

src/components/common/Layout.tsx (1)

5-5: Analytics 모듈 경로가 올바르게 업데이트되었습니다.

Google Analytics 유틸리티의 새로운 경로(@/shared/lib/analytics/ga)를 정확하게 반영하고 있으며, alias를 사용하여 명확한 경로 표현을 제공합니다. sendPageView 함수가 35번 줄에서 올바르게 사용 중이며, 이전 import 경로는 코드베이스에서 완전히 제거되었습니다.

src/components/feed/Profile.tsx (1)

5-5: LGTM! 깔끔한 리팩토링입니다.

스토어 파일 네이밍 컨벤션에 맞춰 import 경로가 올바르게 업데이트되었습니다. 훅 이름(usePopupStore)은 그대로 유지되어 기존 코드와의 호환성이 보장됩니다.

src/components/common/Modal/ConfirmModal.tsx (1)

3-3: LGTM! 타입 import 경로가 올바르게 업데이트되었습니다.

스토어 모듈 경로 변경에 맞춰 ConfirmModalProps 타입 import가 정확히 수정되었습니다. 런타임 동작에는 영향이 없습니다.

src/components/common/Modal/ReplyModal.tsx (1)

6-6: LGTM! 타입 import 경로 업데이트가 정확합니다.

새로운 스토어 모듈 경로에 맞춰 ReplyModalProps 타입 import가 올바르게 변경되었습니다.

src/components/common/Modal/PopupContainer.tsx (1)

2-2: LGTM! 일관된 import 경로 업데이트입니다.

usePopupStore 훅과 관련 타입들의 import 경로가 새로운 모듈 위치에 맞춰 일관되게 업데이트되었습니다. 훅 사용(line 18) 및 타입 사용(lines 44, 49, 51, 55, 61)이 모두 정상적으로 유지됩니다.

Also applies to: 15-15

@ljh130334 ljh130334 merged commit 8176bcc into THIP-394 Jan 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants