Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Projects/DVPresentation/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ let project = Project.project(
sources: .sources,
resources: .default,
dependencies: [
// internal dependency
.domain(),
.design(),
.core(),

// 3rd-party dependency
.tca(),
]
),
]
Expand Down
Empty file.
52 changes: 52 additions & 0 deletions Projects/DVPresentation/Sources/Features/AppFeature.swift
Original file line number Diff line number Diff line change
@@ -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<Self> {
Reduce { state, action in
switch action {
case .task:
return .none

case .delegate:
return .none
}
}
}
}
46 changes: 46 additions & 0 deletions Projects/DVPresentation/Sources/Features/AppView.swift
Original file line number Diff line number Diff line change
@@ -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<AppFeature>

// MARK: - Init

public init(store: StoreOf<AppFeature>) {
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()
}
)
}
4 changes: 4 additions & 0 deletions Projects/Devault/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ let project = Project.project(
sources: .sources,
resources: .default,
dependencies: [
// internal dependency
.presentation(),
.data(),
.domain(),
.core(),

// 3rd-party dependency
.tca(),
]
),
],
Expand Down
Empty file.
23 changes: 8 additions & 15 deletions Projects/Devault/Sources/DevaultApp.swift
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
import DVData
import SwiftUI

import ComposableArchitecture
import DVPresentation

@main
struct DevaultApp: App {
private let storageResult: Result<LocalStorage, Error>

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()
}
)
}
}
}
2 changes: 1 addition & 1 deletion Tuist/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}