Skip to content

Setting/#30 - TCA 적용을 위한 Module Dependency 그래프 수정 및 루트 Feature 스캐폴드 - #31

Merged
dlguszoo merged 4 commits into
developfrom
setting/#30
Jul 10, 2026
Merged

Setting/#30 - TCA 적용을 위한 Module Dependency 그래프 수정 및 루트 Feature 스캐폴드#31
dlguszoo merged 4 commits into
developfrom
setting/#30

Conversation

@doyeonk429

@doyeonk429 doyeonk429 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

✨ What's this PR?

📌 관련 이슈 (Related Issue)


🧶 주요 변경 내용 (Summary)

  • 의존성 그래프: swift-composable-architecture 1.26.0 도입. TargetDependency+External.tca() 축약 헬퍼 추가. DVPresentation·Devault 두 Project.swift에 .tca() 배선
  • 폴더 구조 세팅 (Composition Root 대비):
    • DVPresentation/Sources/Features/, DVPresentation/Sources/Dependencies/ 신설
    • Devault/Sources/Composition/, Devault/Sources/Dependencies/ 신설
  • 루트 Feature 스캐폴드: AppFeature(@Reducer, @ObservableState) + AppView(@bindable Store) 최소 skeleton을 DVPresentation에 추가. 향후 자식 Feature 라우팅 hook 지점
  • DevaultApp 재배선: 기존 LocalStorage 초기화·성공/실패 분기 제거. ComposableArchitecture StoreAppFeature를 호스팅하도록 교체

🧪 테스트 / 검증 내역

  • tuist generate 실행 성공 (SourceKit "No such module 'ComposableArchitecture'" 경고 해소 확인)
  • Devault 앱 빌드/실행 시 Text("Devault") placeholder 정상 표시
  • AppView #Preview 렌더링 확인

💬 기타 공유 사항

  • Storage 초기화·실패 분기 로직은 이번 PR에서 제거 (임시). 향후 AppInfrastructure + AppFeature.State로 재도입 예정
  • ContentView.swift, StorageUnavailableView.swift가 이제 참조되지 않는 dead code로 남음 → 후속 PR에서 정리
  • Client 결합 단위는 Flow 단위(예: SecretManagementClient)로 가는 것을 이번 논의에서 확정. 실제 Client는 첫 진짜 Feature 도입 시점부터 배선 예정
  • TCA 버전 1.25.0 → 1.26.0으로 상향됐지만 docs/TCA_GUIDELINES.md는 아직 1.25.0으로 표기 → 후속 문서 갱신 필요

🙇🏻‍♀️ 리뷰 가이드

  • Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift.tca() 헬퍼 신설 위치·명명 컨벤션
  • Projects/DVPresentation/Project.swift, Projects/Devault/Project.swift.tca() 배선 지점 및 internal / 3rd-party 그룹 코멘트
  • Projects/DVPresentation/Sources/Features/AppFeature.swift, AppView.swiftpublic 접근제어 범위와 skeleton 구조 (앞으로 자식 Feature 추가 시 hook 지점)
  • Projects/Devault/Sources/DevaultApp.swift — Storage 초기화 로직 제거의 임시성 확인

Summary by CodeRabbit

  • New Features

    • 앱이 새 화면 구조로 전환되어, 시작 시 기본 메인 화면이 표시됩니다.
    • 새로운 상태 관리 흐름이 적용되어 앱 진입과 화면 동작이 더 일관되게 연결됩니다.
  • Bug Fixes

    • 초기 실행 시 저장소 상태에 따라 분기되던 동작을 정리해, 더 안정적인 시작 경험을 제공합니다.
  • Chores

    • 앱 의존성 구성이 정리되었고, 관련 라이브러리 버전이 최신으로 업데이트되었습니다.

- swift-composable-architecture 1.25.0 → 1.26.0 버전 업데이트
- TargetDependency에 .tca() 헬퍼 추가
- Devault, DVPresentation 타겟에 TCA 의존성 연결
- DVPresentation에 Features 디렉토리 생성 (.gitkeep)
- Devault에 Composition 디렉토리 생성 (.gitkeep)
- AppFeature Reducer 초기 구조 추가 (State, Action, Delegate)
- AppView 초기 뷰 구현 및 task 액션 연결
- LocalStorage 초기화·성공/실패 분기를 진입점에서 제거
- ComposableArchitecture Store로 AppFeature/AppView를 호스팅
- Storage 초기화는 향후 AppInfrastructure/AppFeature.State 도입 시 재구성 예정
- ContentView / StorageUnavailableView는 참조 해제 (후속 커밋에서 정리)
@doyeonk429 doyeonk429 self-assigned this Jul 9, 2026
@doyeonk429 doyeonk429 linked an issue Jul 9, 2026 that may be closed by this pull request
2 tasks
@doyeonk429
doyeonk429 requested review from dlguszoo and yeseonglee July 9, 2026 14:39
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

DVPresentation 모듈에 Composable Architecture 기반 AppFeature 리듀서와 AppView SwiftUI 뷰가 새로 추가되었고, DevaultApp이 LocalStorage 분기 로직 대신 TCA Store로 AppView를 구동하도록 교체되었습니다. 아울러 tca() 의존성 헬퍼 추가, ComposableArchitecture 버전 상향(1.26.0), 각 Project.swift의 의존성 주석 정리가 함께 이루어졌습니다.

Changes

TCA 도입

Layer / File(s) Summary
TCA 외부 의존성 헬퍼 및 버전 업데이트
Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift, Tuist/Package.swift
TargetDependency.tca() 팩토리 메서드가 추가되고, ComposableArchitecture 버전이 1.25.0에서 1.26.0으로 올라갔습니다.
모듈 의존성 그래프 주석 정리
Projects/DVPresentation/Project.swift, Projects/Devault/Project.swift
dependencies 배열에 내부(domain/design/core/presentation/data)와 외부(tca) 의존성을 구분하는 주석과 공백이 추가되었습니다.
AppFeature 리듀서 신규 구현
Projects/DVPresentation/Sources/Features/AppFeature.swift
빈 State, .task/.delegate Action, Delegate enum을 갖는 AppFeature가 추가되었고, 두 액션 모두 .none을 반환합니다.
AppView 및 DevaultApp 엔트리 교체
Projects/DVPresentation/Sources/Features/AppView.swift, Projects/Devault/Sources/DevaultApp.swift
StoreOf<AppFeature>를 바인딩하는 AppView가 추가되고, .task에서 store.send(.task)를 호출합니다. DevaultApp은 기존 LocalStorage 성공/실패 분기(ContentView/StorageUnavailableView)를 제거하고 AppView + Store(initialState: AppFeature.State()) { AppFeature() }로 대체했습니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DevaultApp
  participant Store
  participant AppFeature
  participant AppView
  DevaultApp->>Store: Store(initialState: AppFeature.State()) { AppFeature() }
  DevaultApp->>AppView: AppView(store:)
  AppView->>Store: store.send(.task)
  Store->>AppFeature: reduce(.task)
  AppFeature-->>Store: .none
Loading

Suggested reviewers: yeseonglee, dlguszoo

원인: LocalStorage 초기화 실패 분기가 사라지며 스토리지 오류 처리 경로가 완전히 삭제됨. 개선안: AppFeature 내부에 스토리지 초기화 실패를 감지해 .delegate 액션으로 전달하는 로직을 추가해 에러 UX를 TCA 흐름 안에서 유지하는 것을 권장합니다.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 TCA용 모듈 의존성 그래프 수정과 루트 Feature 스캐폴드라는 핵심 변경을 간결하게 담고 있습니다.
Linked Issues check ✅ Passed #30의 TCA 의존성 모듈 정리와 최종 Dependency 그래프 확정 요구를 패키지·헬퍼·프로젝트 연결 변경으로 충족합니다.
Out of Scope Changes check ✅ Passed 의존성 그래프 정리와 TCA 루트 스캐폴드 범위를 벗어난 별도 기능 추가나 무관한 변경은 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch setting/#30

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.

@doyeonk429 doyeonk429 added the ⚙ Setting 개발 환경 설정 label Jul 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Projects/Devault/Sources/DevaultApp.swift (1)

9-14: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Storebody 내에서 inline 생성하지 말고 저장 프로퍼티로 이동하세요.

body가 재평가될 때마다 새 Store 인스턴스가 생성되어 모든 TCA 상태가 초기화될 위험이 있습니다. TCA 공식 패턴대로 저장 프로퍼티로 선언하세요.

♻️ 제안하는 리팩토링
 `@main`
 struct DevaultApp: App {
+    private let store = Store(initialState: AppFeature.State()) {
+        AppFeature()
+    }
+
     var body: some Scene {
         WindowGroup {
             AppView(
-                store: Store(initialState: AppFeature.State()) {
-                    AppFeature()
-                }
+                store: store
             )
         }
     }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Projects/Devault/Sources/DevaultApp.swift` around lines 9 - 14, `DevaultApp`의
`body` 안에서 `AppView`에 전달하는 `Store(initialState: AppFeature.State()) {
AppFeature() }`를 inline 생성하지 말고, `DevaultApp`의 저장 프로퍼티로 분리하세요. `body`가 다시 평가될
때마다 새 `Store`가 만들어져 상태가 초기화될 수 있으므로, `DevaultApp` 타입에 `Store<AppFeature>`를 한 번만
생성해 보관한 뒤 `WindowGroup`의 `AppView`에서는 그 저장 프로퍼티를 전달하도록 수정하세요.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Projects/Devault/Sources/DevaultApp.swift`:
- Around line 9-14: `DevaultApp`의 `body` 안에서 `AppView`에 전달하는
`Store(initialState: AppFeature.State()) { AppFeature() }`를 inline 생성하지 말고,
`DevaultApp`의 저장 프로퍼티로 분리하세요. `body`가 다시 평가될 때마다 새 `Store`가 만들어져 상태가 초기화될 수
있으므로, `DevaultApp` 타입에 `Store<AppFeature>`를 한 번만 생성해 보관한 뒤 `WindowGroup`의
`AppView`에서는 그 저장 프로퍼티를 전달하도록 수정하세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c0ab8dc-b0b8-40d1-bd02-2418f424f43a

📥 Commits

Reviewing files that changed from the base of the PR and between c4201e1 and b65e102.

📒 Files selected for processing (9)
  • Projects/DVPresentation/Project.swift
  • Projects/DVPresentation/Sources/Features/.gitkeep
  • Projects/DVPresentation/Sources/Features/AppFeature.swift
  • Projects/DVPresentation/Sources/Features/AppView.swift
  • Projects/Devault/Project.swift
  • Projects/Devault/Sources/Composition/.gitkeep
  • Projects/Devault/Sources/DevaultApp.swift
  • Tuist/Package.swift
  • Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙ Setting 개발 환경 설정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting: TCA 적용을 위한 Module Dependency 그래프 수정

2 participants