diff --git a/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/ErrorFeature.xcscheme b/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/ErrorFeature.xcscheme new file mode 100644 index 0000000000000000000000000000000000000000..95ae136eb336e7590ebc8e1d791912f4c0393a84 --- /dev/null +++ b/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/ErrorFeature.xcscheme @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1340" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ErrorFeature" + BuildableName = "ErrorFeature" + BlueprintName = "ErrorFeature" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ErrorFeatureTests" + BuildableName = "ErrorFeatureTests" + BlueprintName = "ErrorFeatureTests" + ReferencedContainer = "container:"> + </BuildableReference> + </TestableReference> + </Testables> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ErrorFeature" + BuildableName = "ErrorFeature" + BlueprintName = "ErrorFeature" + ReferencedContainer = "container:"> + </BuildableReference> + </MacroExpansion> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme b/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme index 6901d4337f3e45c7c983250b1a6b7c357e540062..ac213623f3e728760923364f7769a3ffd075fbd1 100644 --- a/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme +++ b/Example/ExampleApp/.swiftpm/xcode/xcshareddata/xcschemes/example-app.xcscheme @@ -20,6 +20,20 @@ ReferencedContainer = "container:"> </BuildableReference> </BuildActionEntry> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ErrorFeature" + BuildableName = "ErrorFeature" + BlueprintName = "ErrorFeature" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" @@ -67,6 +81,16 @@ ReferencedContainer = "container:"> </BuildableReference> </TestableReference> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "ErrorFeatureTests" + BuildableName = "ErrorFeatureTests" + BlueprintName = "ErrorFeatureTests" + ReferencedContainer = "container:"> + </BuildableReference> + </TestableReference> <TestableReference skipped = "NO"> <BuildableReference diff --git a/Example/ExampleApp/Package.swift b/Example/ExampleApp/Package.swift index e8881f2ee23096a8ed495f6108b6c5ed8cf4ddcd..9f02c271e0bba61bdf5ce95235ca7a946288950b 100644 --- a/Example/ExampleApp/Package.swift +++ b/Example/ExampleApp/Package.swift @@ -24,6 +24,10 @@ let package = Package( name: "AppFeature", targets: ["AppFeature"] ), + .library( + name: "ErrorFeature", + targets: ["ErrorFeature"] + ), .library( name: "LandingFeature", targets: ["LandingFeature"] @@ -80,6 +84,27 @@ let package = Package( ], swiftSettings: swiftSettings ), + .target( + name: "ErrorFeature", + dependencies: [ + .product( + name: "ComposableArchitecture", + package: "swift-composable-architecture" + ), + .product( + name: "ElixxirDAppsSDK", + package: "elixxir-dapps-sdk-swift" + ), + ], + swiftSettings: swiftSettings + ), + .testTarget( + name: "ErrorFeatureTests", + dependencies: [ + .target(name: "ErrorFeature"), + ], + swiftSettings: swiftSettings + ), .target( name: "LandingFeature", dependencies: [ diff --git a/Example/ExampleApp/Sources/ErrorFeature/ErrorFeature.swift b/Example/ExampleApp/Sources/ErrorFeature/ErrorFeature.swift new file mode 100644 index 0000000000000000000000000000000000000000..7490e1daf55ff0d125adc8ad5b067779dcd47cb9 --- /dev/null +++ b/Example/ExampleApp/Sources/ErrorFeature/ErrorFeature.swift @@ -0,0 +1,20 @@ +import ComposableArchitecture +import SwiftUI + +public struct ErrorState: Equatable { + public init() {} +} + +public enum ErrorAction: Equatable {} + +public struct ErrorEnvironment { + public init() {} +} + +public let errorReducer = Reducer<ErrorState, ErrorAction, ErrorEnvironment>.empty + +#if DEBUG +extension ErrorEnvironment { + public static let failing = ErrorEnvironment() +} +#endif diff --git a/Example/ExampleApp/Sources/ErrorFeature/ErrorView.swift b/Example/ExampleApp/Sources/ErrorFeature/ErrorView.swift new file mode 100644 index 0000000000000000000000000000000000000000..bc86d99c96c44a0d70a5eb8532a1b7fc9295d5a6 --- /dev/null +++ b/Example/ExampleApp/Sources/ErrorFeature/ErrorView.swift @@ -0,0 +1,32 @@ +import ComposableArchitecture +import SwiftUI + +public struct ErrorView: View { + public init(store: Store<ErrorState, ErrorAction>) { + self.store = store + } + + let store: Store<ErrorState, ErrorAction> + + struct ViewState: Equatable { + init(state: ErrorState) {} + } + + public var body: some View { + WithViewStore(store.scope(state: ViewState.init)) { viewStore in + Text("ErrorView") + } + } +} + +#if DEBUG +public struct ErrorView_Previews: PreviewProvider { + public static var previews: some View { + ErrorView(store: .init( + initialState: .init(), + reducer: .empty, + environment: () + )) + } +} +#endif diff --git a/Example/ExampleApp/Tests/ErrorFeatureTests/ErrorFeatureTests.swift b/Example/ExampleApp/Tests/ErrorFeatureTests/ErrorFeatureTests.swift new file mode 100644 index 0000000000000000000000000000000000000000..50dabc308273fc6c77beafab3ab8733397b462bc --- /dev/null +++ b/Example/ExampleApp/Tests/ErrorFeatureTests/ErrorFeatureTests.swift @@ -0,0 +1,8 @@ +import XCTest +@testable import ErrorFeature + +final class ErrorFeatureTests: XCTestCase { + func testExample() { + XCTAssert(true) + } +}