diff --git a/Projects/DVPresentation/Project.swift b/Projects/DVPresentation/Project.swift index 68afb41d..85f09d4f 100644 --- a/Projects/DVPresentation/Project.swift +++ b/Projects/DVPresentation/Project.swift @@ -10,9 +10,13 @@ let project = Project.project( sources: .sources, resources: .default, dependencies: [ + // internal dependency .domain(), .design(), .core(), + + // 3rd-party dependency + .tca(), ] ), ] diff --git a/Projects/DVPresentation/Sources/Features/.gitkeep b/Projects/DVPresentation/Sources/Features/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Projects/DVPresentation/Sources/Features/AppFeature.swift b/Projects/DVPresentation/Sources/Features/AppFeature.swift new file mode 100644 index 00000000..1fec354b --- /dev/null +++ b/Projects/DVPresentation/Sources/Features/AppFeature.swift @@ -0,0 +1,52 @@ +// Copyright © 2026 Devault. All rights reserved + +import Foundation + +import ComposableArchitecture + +// MARK: - AppFeature + +@Reducer +public struct AppFeature { + + // MARK: - State + + @ObservableState + public struct State: Equatable { + + public init() {} + } + + // MARK: - Action + + public enum Action: Equatable { + + // MARK: - View + + case task + + // MARK: - Delegate + + case delegate(Delegate) + + public enum Delegate: Equatable {} + } + + // MARK: - Init + + public init() {} + + // MARK: - Body + + public var body: some ReducerOf { + Reduce { state, action in + switch action { + case .task: + return .none + + case .delegate: + return .none + } + } + } +} diff --git a/Projects/DVPresentation/Sources/Features/AppView.swift b/Projects/DVPresentation/Sources/Features/AppView.swift new file mode 100644 index 00000000..5c734939 --- /dev/null +++ b/Projects/DVPresentation/Sources/Features/AppView.swift @@ -0,0 +1,46 @@ +// Copyright © 2026 Devault. All rights reserved + +import SwiftUI + +import ComposableArchitecture + +// MARK: - AppView + +public struct AppView: View { + + // MARK: - Properties + + @Bindable public var store: StoreOf + + // MARK: - Init + + public init(store: StoreOf) { + self.store = store + } + + // MARK: - Body + + public var body: some View { + content + .task { store.send(.task) } + } +} + +// MARK: - Subviews + +extension AppView { + + private var content: some View { + Text("Devault") + } +} + +// MARK: - Preview + +#Preview { + AppView( + store: Store(initialState: AppFeature.State()) { + AppFeature() + } + ) +} diff --git a/Projects/Devault/Project.swift b/Projects/Devault/Project.swift index 3feb11c1..3102b994 100644 --- a/Projects/Devault/Project.swift +++ b/Projects/Devault/Project.swift @@ -13,10 +13,14 @@ let project = Project.project( sources: .sources, resources: .default, dependencies: [ + // internal dependency .presentation(), .data(), .domain(), .core(), + + // 3rd-party dependency + .tca(), ] ), ], diff --git a/Projects/Devault/Sources/Composition/.gitkeep b/Projects/Devault/Sources/Composition/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Projects/Devault/Sources/DevaultApp.swift b/Projects/Devault/Sources/DevaultApp.swift index 686ad83b..69316e6e 100644 --- a/Projects/Devault/Sources/DevaultApp.swift +++ b/Projects/Devault/Sources/DevaultApp.swift @@ -1,24 +1,17 @@ -import DVData import SwiftUI +import ComposableArchitecture +import DVPresentation + @main struct DevaultApp: App { - private let storageResult: Result - - init() { - self.storageResult = Result { - try LocalStorage.makeDefault() - } - } - var body: some Scene { WindowGroup { - switch storageResult { - case let .success(storage): - ContentView(storage: storage) - case let .failure(error): - StorageUnavailableView(error: error) - } + AppView( + store: Store(initialState: AppFeature.State()) { + AppFeature() + } + ) } } } diff --git a/Tuist/Package.swift b/Tuist/Package.swift index ca82a1cc..df1de317 100644 --- a/Tuist/Package.swift +++ b/Tuist/Package.swift @@ -17,7 +17,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/pointfreeco/swift-composable-architecture", - from: "1.25.0" + from: "1.26.0" ), ] ) diff --git a/Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift b/Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift index 2ddac018..8a2d49fc 100644 --- a/Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift +++ b/Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift @@ -10,4 +10,8 @@ extension TargetDependency { public static func external(dependency: External) -> TargetDependency { .external(name: dependency.rawValue, condition: .when([.macos])) } + + public static func tca() -> TargetDependency { + .external(dependency: .ComposableArchitecture) + } }