From 3d140e6a5605e0f56b82324722c2a69daf30e218 Mon Sep 17 00:00:00 2001 From: Arman Morshed Date: Mon, 12 Feb 2024 11:33:56 +0600 Subject: [PATCH 1/3] feat: add observation logic --- .../Common/Package.swift | 2 +- .../Features/Package.swift | 2 +- .../Features/Sources/App/AppFeature.swift | 204 +++++++++--------- .../Features/Sources/App/AppView.swift | 133 ++++++------ .../Sources/Counter/CounterFeature.swift | 87 ++++---- .../Sources/Counter/CounterView.swift | 82 +++---- .../Sources/NetworkPlatform/API/AppAPI.swift | 2 +- .../project.pbxproj | 5 +- .../xcshareddata/swiftpm/Package.resolved | 13 +- .../Generated/BuildConfiguration.plist | 2 +- 10 files changed, 273 insertions(+), 259 deletions(-) diff --git a/{{cookiecutter.app_name}}/Common/Package.swift b/{{cookiecutter.app_name}}/Common/Package.swift index c50ef42..6387fa2 100644 --- a/{{cookiecutter.app_name}}/Common/Package.swift +++ b/{{cookiecutter.app_name}}/Common/Package.swift @@ -14,7 +14,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/pointfreeco/swift-composable-architecture", - exact: "1.5.1" + exact: "1.7.3" ) ], targets: [ diff --git a/{{cookiecutter.app_name}}/Features/Package.swift b/{{cookiecutter.app_name}}/Features/Package.swift index 6b7c8cf..bb02d79 100644 --- a/{{cookiecutter.app_name}}/Features/Package.swift +++ b/{{cookiecutter.app_name}}/Features/Package.swift @@ -23,7 +23,7 @@ let package = Package( .package(path: "../PersistentPlatform"), .package( url: "https://github.com/pointfreeco/swift-composable-architecture", - exact: "1.5.1" + exact: "1.7.3" ), ], targets: [ diff --git a/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift b/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift index 3fd672b..cd3dcca 100644 --- a/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift +++ b/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift @@ -13,123 +13,125 @@ import Domain public struct AppFeature: FeatureReducer { - @Dependency(\.appClient) var appClient + @Dependency(\.appClient) var appClient - public init() {} - - public struct State: Equatable, Hashable { public init() {} - @PresentationState var destination: Destination.State? - var product: Product? - } - - public enum ViewAction: Equatable { - case onAppear - case showSheet - case showFullScreenCover - case save - } - - public enum InternalAction: Equatable { - case dismissDestination - case productResponse(TaskResult) - } - - public var body: some ReducerOf { - Reduce(core) - .ifLet(\.$destination, action: \.destination) { - Destination() - } - } - - public func reduce(into state: inout State, viewAction: ViewAction) -> Effect< - Action - > { - switch viewAction { - case .onAppear: - return .run { send in - await appClient.prepare(Void()) - await send( - .internal( - .productResponse( - TaskResult { - try await appClient.product(1) - }))) - } - case .showSheet: - state.destination = .sheet(.init()) - return .none - - case .showFullScreenCover: - state.destination = .fullScreenCover(.init()) - return .none - - case .save: - return .run { [product = state.product] send in - do { - try await appClient.save(product!) - } catch { + @ObservableState + public struct State: Equatable, Hashable { + public init() {} - } - } + @Presents var destination: Destination.State? + var product: Product? } - } - public func reduce( - into state: inout State, presentedAction: Destination.Action - ) -> Effect { - switch presentedAction { - case .sheet(.delegate(.close)): - return .send(.internal(.dismissDestination)) + public enum ViewAction: Equatable { + case onAppear + case showSheet + case showFullScreenCover + case save + } - case .fullScreenCover(.delegate(.close)): - return .send(.internal(.dismissDestination)) + public enum InternalAction: Equatable { + case dismissDestination + case productResponse(TaskResult) + } - default: - return .none + public var body: some ReducerOf { + Reduce(core) + .ifLet(\.$destination, action: \.destination) { + Destination() + } } - } - - public func reduce(into state: inout State, internalAction: InternalAction) - -> Effect - { - switch internalAction { - case let .productResponse(.success(product)): - state.product = product - return .none - case let .productResponse(.failure(error)): - print(error) - return .none - case .dismissDestination: - state.destination = nil - return .none + + public func reduce(into state: inout State, viewAction: ViewAction) -> Effect< + Action + > { + switch viewAction { + case .onAppear: + return .run { send in + await appClient.prepare(Void()) + await send( + .internal( + .productResponse( + TaskResult { + try await appClient.product(1) + }))) + } + case .showSheet: + state.destination = .sheet(.init()) + return .none + + case .showFullScreenCover: + state.destination = .fullScreenCover(.init()) + return .none + + case .save: + return .run { [product = state.product] send in + do { + try await appClient.save(product!) + } catch { + + } + } + } } - } - public struct Destination: DestinationReducer { + public func reduce( + into state: inout State, presentedAction: Destination.Action + ) -> Effect { + switch presentedAction { + case .sheet(.delegate(.close)): + return .send(.internal(.dismissDestination)) - public init() {} + case .fullScreenCover(.delegate(.close)): + return .send(.internal(.dismissDestination)) - @CasePathable - public enum State: Hashable { - case sheet(Counter.State) - case fullScreenCover(Counter.State) + default: + return .none + } } - @CasePathable - public enum Action: Equatable { - case sheet(Counter.Action) - case fullScreenCover(Counter.Action) + public func reduce(into state: inout State, internalAction: InternalAction) + -> Effect + { + switch internalAction { + case let .productResponse(.success(product)): + state.product = product + return .none + case let .productResponse(.failure(error)): + print(error) + return .none + case .dismissDestination: + state.destination = nil + return .none + } } - public var body: some ReducerOf { - Scope(state: \.sheet, action: \.sheet) { - Counter() - } - Scope(state: \.fullScreenCover, action: \.fullScreenCover) { - Counter() - } + public struct Destination: DestinationReducer { + + public init() {} + + @dynamicMemberLookup + @CasePathable + public enum State: Hashable { + case sheet(Counter.State) + case fullScreenCover(Counter.State) + } + + @CasePathable + public enum Action: Equatable { + case sheet(Counter.Action) + case fullScreenCover(Counter.Action) + } + + public var body: some ReducerOf { + Scope(state: \.sheet, action: \.sheet) { + Counter() + } + Scope(state: \.fullScreenCover, action: \.fullScreenCover) { + Counter() + } + } } - } } diff --git a/{{cookiecutter.app_name}}/Features/Sources/App/AppView.swift b/{{cookiecutter.app_name}}/Features/Sources/App/AppView.swift index 5410a47..fd040d2 100644 --- a/{{cookiecutter.app_name}}/Features/Sources/App/AppView.swift +++ b/{{cookiecutter.app_name}}/Features/Sources/App/AppView.swift @@ -13,89 +13,94 @@ import SwiftUI @MainActor public struct AppView: View { - let store: StoreOf + let store: StoreOf - public init(store: StoreOf) { - self.store = store - } + public init(store: StoreOf) { + self.store = store + } - public var body: some View { - WithViewStore(self.store, observe: { $0 }) { viewstore in - Text("\(viewstore.product?.title ?? "Unknown")") - Text("\(viewstore.product?.description ?? "Unknown")") + public var body: some View { + WithPerceptionTracking { + VStack { + VStack { + Text("\(store.product?.title ?? "Unknown")") + Spacer() + .frame(height: 20) + Text("\(store.product?.description ?? "Unknown")") + } + .padding() - Button("Save") { - viewstore.send(.view(.save)) - } + Form { + Button("Save") { + store.send(.view(.save)) + } - Form { - Button { - viewstore.send(.view(.showSheet)) - } label: { - Text("Sheet") - } + Button { + store.send(.view(.showSheet)) + } label: { + Text("Sheet") + } - Button { - viewstore.send(.view(.showFullScreenCover)) - } label: { - Text("Full Screen Cover") + Button { + store.send(.view(.showFullScreenCover)) + } label: { + Text("Full Screen Cover") + } + } + } + .onAppear { + store.send(.view(.onAppear)) + } + .destinations(with: store) } - } - .onAppear { - viewstore.send(.view(.onAppear)) - } - .destinations(with: store) } - } } extension StoreOf { - fileprivate var destination: PresentationStoreOf { - scope(state: \.$destination, action: \.destination) - } + fileprivate var bindableDestination: ComposableArchitecture.Bindable> { + return ComposableArchitecture.Bindable(self) + } } @MainActor extension View { - fileprivate func destinations(with store: StoreOf) -> some View { - let destinationStore = store.destination - return showSheet(with: destinationStore) - .showFulllScreenCover(with: destinationStore) - } + fileprivate func destinations(with store: StoreOf) -> some View { + let bindableDestination = store.bindableDestination + return showSheet(with: bindableDestination) + .showFulllScreenCover(with: bindableDestination) + } - private func showSheet( - with destinationStore: PresentationStoreOf - ) -> some View { - sheet( - store: - destinationStore.scope( - state: \.sheet, - action: \.sheet) - ) { store in - CounterView(store: store) + private func showSheet( + with destinationStore: ComposableArchitecture.Bindable> + ) -> some View { + let destinationStore = destinationStore.scope( + state: \.destination?.sheet, + action: \.destination.sheet) + + return sheet(item: destinationStore) { store in + CounterView(store: store) + } } - } - private func showFulllScreenCover( - with destinationStore: PresentationStoreOf - ) -> some View { - fullScreenCover( - store: - destinationStore.scope( - state: \.fullScreenCover, - action: \.fullScreenCover) - ) { store in - CounterView(store: store) + private func showFulllScreenCover( + with destinationStore: ComposableArchitecture.Bindable> + ) -> some View { + let destinationStore = destinationStore.scope( + state: \.destination?.fullScreenCover, + action: \.destination.fullScreenCover) + + return fullScreenCover(item: destinationStore) { store in + CounterView(store: store) + } } - } } #Preview { - AppView( - store: - .init( - initialState: AppFeature.State(), - reducer: { AppFeature() } - ) - ) + AppView( + store: + .init( + initialState: AppFeature.State(), + reducer: { AppFeature() } + ) + ) } diff --git a/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift b/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift index b242f46..dfbb0df 100644 --- a/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift +++ b/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift @@ -12,51 +12,52 @@ import Foundation public struct Counter: FeatureReducer { - public init() {} - - public struct State: Equatable, Hashable { public init() {} - var count = 0 - } - - public enum ViewAction: Equatable { - case decrementButtonTapped - case incrementButtonTapped - case closeButtonTapped - } - - public enum InternalAction: Equatable { - case close - } - - public enum DelegateAction: Equatable { - case close - } - - public func reduce(into state: inout State, viewAction: ViewAction) -> Effect< - Action - > { - switch viewAction { - case .decrementButtonTapped: - state.count -= 1 - return .none - - case .incrementButtonTapped: - state.count += 1 - return .none - - case .closeButtonTapped: - return .send(.internal(.close)) + @ObservableState + public struct State: Equatable, Hashable { + public init() {} + + var count = 0 + } + + public enum ViewAction: Equatable { + case decrementButtonTapped + case incrementButtonTapped + case closeButtonTapped + } + + public enum InternalAction: Equatable { + case close } - } - - public func reduce(into state: inout State, internalAction: InternalAction) - -> Effect - { - switch internalAction { - case .close: - return .send(.delegate(.close)) + + public enum DelegateAction: Equatable { + case close + } + + public func reduce(into state: inout State, viewAction: ViewAction) -> Effect< + Action + > { + switch viewAction { + case .decrementButtonTapped: + state.count -= 1 + return .none + + case .incrementButtonTapped: + state.count += 1 + return .none + + case .closeButtonTapped: + return .send(.internal(.close)) + } + } + + public func reduce(into state: inout State, internalAction: InternalAction) + -> Effect + { + switch internalAction { + case .close: + return .send(.delegate(.close)) + } } - } } diff --git a/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterView.swift b/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterView.swift index bf0234d..9fcf5a5 100644 --- a/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterView.swift +++ b/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterView.swift @@ -12,51 +12,51 @@ import SwiftUI @MainActor public struct CounterView: View { - let store: StoreOf - - public init(store: StoreOf) { - self.store = store - } - - public var body: some View { - WithViewStore(self.store, observe: { $0 }) { viewstore in - VStack(spacing: 16) { - HStack { - Button { - viewstore.send(.view(.decrementButtonTapped)) - } label: { - Image(systemName: "minus") - } - - Text("\(viewstore.count)") - .monospacedDigit() - - Button { - viewstore.send(.view(.incrementButtonTapped)) - } label: { - Image(systemName: "plus") - } - } + let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } - Button { - viewstore.send(.view(.closeButtonTapped)) - } label: { - Text("Dismiss") - .foregroundStyle(.white) - .frame(width: 120, height: 40) - .background(.blue) + public var body: some View { + WithPerceptionTracking { + VStack(spacing: 16) { + HStack { + Button { + store.send(.view(.decrementButtonTapped)) + } label: { + Image(systemName: "minus") + } + + Text("\(store.count)") + .monospacedDigit() + + Button { + store.send(.view(.incrementButtonTapped)) + } label: { + Image(systemName: "plus") + } + } + + Button { + store.send(.view(.closeButtonTapped)) + } label: { + Text("Dismiss") + .foregroundStyle(.white) + .frame(width: 120, height: 40) + .background(.blue) + } + } } - } } - } } #Preview { - CounterView( - store: - .init( - initialState: Counter.State(), - reducer: { Counter() } - ) - ) + CounterView( + store: + .init( + initialState: Counter.State(), + reducer: { Counter() } + ) + ) } diff --git a/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/API/AppAPI.swift b/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/API/AppAPI.swift index 720f532..c8cb934 100644 --- a/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/API/AppAPI.swift +++ b/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/API/AppAPI.swift @@ -37,7 +37,7 @@ extension AppAPI: TargetType, ProductAPIType, Stubble { } var parameters: [String: Any]? { - var params: [String: Any] = [:] + let params: [String: Any] = [:] switch self { default: break } diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj index da4ad45..4d0d684 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj @@ -19,8 +19,6 @@ 67B2B5C529127D3A00B2E0AC /* Staging.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 67B2B5BD29127D3A00B2E0AC /* Staging.xcconfig */; }; 67B2B5C729127D3A00B2E0AC /* Development.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 67B2B5C029127D3A00B2E0AC /* Development.xcconfig */; }; 67B2B5CA29127D3A00B2E0AC /* Production.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 67B2B5C429127D3A00B2E0AC /* Production.xcconfig */; }; - B20307482B207C8600EBA314 /* App in Frameworks */ = {isa = PBXBuildFile; productRef = B20307472B207C8600EBA314 /* App */; }; - B203074B2B207D4E00EBA314 /* ComposableArchitecture in Frameworks */ = {isa = PBXBuildFile; productRef = B203074A2B207D4E00EBA314 /* ComposableArchitecture */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1330,7 +1328,7 @@ repositoryURL = "git@github.com:pointfreeco/swift-composable-architecture.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 1.5.1; + minimumVersion = 1.7.3; }; }; /* End XCRemoteSwiftPackageReference section */ @@ -1342,7 +1340,6 @@ }; 2F0D066D2B76035F00442618 /* ComposableArchitecture */ = { isa = XCSwiftPackageProductDependency; - package = 6782D5B32912554D0015FCBB /* XCRemoteSwiftPackageReference "swift-composable-architecture" */; productName = ComposableArchitecture; }; /* End XCSwiftPackageProductDependency section */ diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index be0fc9c..ca61fc4 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-composable-architecture", "state" : { - "revision" : "dcde72151de8a60eecaa1673ed3c3d110549069a", - "version" : "1.5.1" + "revision" : "f815e76b520aacfad4ff35c7e1f036f8add6f4b4", + "version" : "1.7.3" } }, { @@ -117,6 +117,15 @@ "version" : "1.0.0" } }, + { + "identity" : "swift-perception", + "kind" : "remoteSourceControl", + "location" : "https://github.com/pointfreeco/swift-perception", + "state" : { + "revision" : "42240120b2a8797595433288ab4118f8042214c3", + "version" : "1.1.1" + } + }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/Resources/Generated/BuildConfiguration.plist b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/Resources/Generated/BuildConfiguration.plist index 6e2d5fc..1f4e98c 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/Resources/Generated/BuildConfiguration.plist +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/Resources/Generated/BuildConfiguration.plist @@ -3,7 +3,7 @@ name - Production + Development baseURL https://gtrend.yapie.me testFlags From 7ae9fd04c841c3335a7514499e51dd9d0f040506 Mon Sep 17 00:00:00 2001 From: Arman Morshed Date: Wed, 14 Feb 2024 17:29:43 +0600 Subject: [PATCH 2/3] feat: replace taskresult with result and equatable conformance for actions --- .../Sources/Common/FeatureReducer.swift | 40 +++---------------- .../Features/Sources/App/AppFeature.swift | 10 ++--- .../Sources/Counter/CounterFeature.swift | 6 +-- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/{{cookiecutter.app_name}}/Common/Sources/Common/FeatureReducer.swift b/{{cookiecutter.app_name}}/Common/Sources/Common/FeatureReducer.swift index c831ebb..524be65 100644 --- a/{{cookiecutter.app_name}}/Common/Sources/Common/FeatureReducer.swift +++ b/{{cookiecutter.app_name}}/Common/Sources/Common/FeatureReducer.swift @@ -12,10 +12,10 @@ import SwiftUI // MARK: FeatureReducer public protocol FeatureReducer: Reducer where State: Sendable & Hashable, Action == FeatureAction { - associatedtype ViewAction: Sendable & Equatable = Never - associatedtype InternalAction: Sendable & Equatable = Never - associatedtype ChildAction: Sendable & Equatable = Never - associatedtype DelegateAction: Sendable & Equatable = Never + associatedtype ViewAction: Sendable = Never + associatedtype InternalAction: Sendable = Never + associatedtype ChildAction: Sendable = Never + associatedtype DelegateAction: Sendable = Never func reduce(into state: inout State, viewAction: ViewAction) -> Effect func reduce(into state: inout State, internalAction: InternalAction) @@ -93,7 +93,7 @@ public typealias PresentationStoreOf = Store< // MARK: FeatureAction @CasePathable -public enum FeatureAction: Sendable, Equatable { +public enum FeatureAction: Sendable { case destination(PresentationAction) case view(Feature.ViewAction) case `internal`(Feature.InternalAction) @@ -103,7 +103,7 @@ public enum FeatureAction: Sendable, Equatable { // MARK: DestinationReducer public protocol DestinationReducer: Reducer -where State: Sendable & Hashable, Action: Sendable & Equatable & CasePathable {} +where State: Sendable & Hashable, Action: Sendable & CasePathable {} // MARK: EmptyDestination @@ -116,31 +116,3 @@ public enum EmptyDestination: DestinationReducer { Action > { .none } } - -//MARK: FeatureAction + Hashable -extension FeatureAction: Hashable -where - Feature.Destination.Action: Hashable, - Feature.ViewAction: Hashable, - Feature.ChildAction: Hashable, - Feature.InternalAction: Hashable, - Feature.DelegateAction: Hashable -{ - public func hash(into hasher: inout Hasher) { - switch self { - case let .destination(action): - hasher.combine(action) - case let .view(action): - hasher.combine(action) - case let .internal(action): - hasher.combine(action) - case let .child(action): - hasher.combine(action) - case let .delegate(action): - hasher.combine(action) - } - } -} - -/// For scoping to an actionless childstore -public func actionless(never: Never) -> T {} diff --git a/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift b/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift index cd3dcca..c6f8c81 100644 --- a/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift +++ b/{{cookiecutter.app_name}}/Features/Sources/App/AppFeature.swift @@ -25,16 +25,16 @@ public struct AppFeature: FeatureReducer { var product: Product? } - public enum ViewAction: Equatable { + public enum ViewAction { case onAppear case showSheet case showFullScreenCover case save } - public enum InternalAction: Equatable { + public enum InternalAction { case dismissDestination - case productResponse(TaskResult) + case productResponse(Result) } public var body: some ReducerOf { @@ -54,7 +54,7 @@ public struct AppFeature: FeatureReducer { await send( .internal( .productResponse( - TaskResult { + Result { try await appClient.product(1) }))) } @@ -120,7 +120,7 @@ public struct AppFeature: FeatureReducer { } @CasePathable - public enum Action: Equatable { + public enum Action { case sheet(Counter.Action) case fullScreenCover(Counter.Action) } diff --git a/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift b/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift index dfbb0df..f5d1631 100644 --- a/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift +++ b/{{cookiecutter.app_name}}/Features/Sources/Counter/CounterFeature.swift @@ -21,17 +21,17 @@ public struct Counter: FeatureReducer { var count = 0 } - public enum ViewAction: Equatable { + public enum ViewAction { case decrementButtonTapped case incrementButtonTapped case closeButtonTapped } - public enum InternalAction: Equatable { + public enum InternalAction { case close } - public enum DelegateAction: Equatable { + public enum DelegateAction { case close } From e8f6a4799d9f96fd5018076f42f2a0375a31b524 Mon Sep 17 00:00:00 2001 From: Arman Morshed Date: Wed, 14 Feb 2024 17:43:51 +0600 Subject: [PATCH 3/3] chore: update version of TCA --- {{cookiecutter.app_name}}/Common/Package.swift | 2 +- {{cookiecutter.app_name}}/Features/Package.swift | 2 +- {{cookiecutter.app_name}}/PersistentPlatform/Package.swift | 2 +- .../{{cookiecutter.app_name}}.xcodeproj/project.pbxproj | 2 +- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.app_name}}/Common/Package.swift b/{{cookiecutter.app_name}}/Common/Package.swift index 6387fa2..7943d5d 100644 --- a/{{cookiecutter.app_name}}/Common/Package.swift +++ b/{{cookiecutter.app_name}}/Common/Package.swift @@ -14,7 +14,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/pointfreeco/swift-composable-architecture", - exact: "1.7.3" + exact: "1.8.0" ) ], targets: [ diff --git a/{{cookiecutter.app_name}}/Features/Package.swift b/{{cookiecutter.app_name}}/Features/Package.swift index bb02d79..b794385 100644 --- a/{{cookiecutter.app_name}}/Features/Package.swift +++ b/{{cookiecutter.app_name}}/Features/Package.swift @@ -23,7 +23,7 @@ let package = Package( .package(path: "../PersistentPlatform"), .package( url: "https://github.com/pointfreeco/swift-composable-architecture", - exact: "1.7.3" + exact: "1.8.0" ), ], targets: [ diff --git a/{{cookiecutter.app_name}}/PersistentPlatform/Package.swift b/{{cookiecutter.app_name}}/PersistentPlatform/Package.swift index c636e7a..c8aecd2 100644 --- a/{{cookiecutter.app_name}}/PersistentPlatform/Package.swift +++ b/{{cookiecutter.app_name}}/PersistentPlatform/Package.swift @@ -16,7 +16,7 @@ let package = Package( .package(path: "../Domain"), .package(path: "../Utilities"), .package( - url: "https://github.com/pointfreeco/swift-dependencies", from: "1.0.0"), + url: "https://github.com/pointfreeco/swift-dependencies", from: "1.2.1"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj index 4d0d684..97f4ebd 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.pbxproj @@ -1328,7 +1328,7 @@ repositoryURL = "git@github.com:pointfreeco/swift-composable-architecture.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 1.7.3; + minimumVersion = 1.8.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ca61fc4..9effde1 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-composable-architecture", "state" : { - "revision" : "f815e76b520aacfad4ff35c7e1f036f8add6f4b4", - "version" : "1.7.3" + "revision" : "cf967a28a8605629559533320d604168d733fc9c", + "version" : "1.8.0" } }, {