Skip to content

Commit

Permalink
Merge pull request #70 from Ryu0118/feature/case-pathable
Browse files Browse the repository at this point in the history
Add `@CasePathable` support
  • Loading branch information
Ryu0118 committed Dec 8, 2023
2 parents 385fbe3 + b31560e commit 88462ae
Show file tree
Hide file tree
Showing 16 changed files with 470 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths.git",
"state" : {
"revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
"version" : "1.0.0"
"revision" : "a5521dde99570789d8cb7c43e51418d7cd1a87ca",
"version" : "1.1.2"
}
},
{
Expand All @@ -50,26 +50,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ea631ce892687f5432a833312292b80db238186a",
"version" : "1.0.0"
"revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71",
"version" : "1.1.0"
}
},
{
"identity" : "swift-custom-dump",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-custom-dump.git",
"state" : {
"revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01",
"version" : "1.0.0"
"revision" : "aedcf6f4cd486ccef5b312ccac85d4b3f6e58605",
"version" : "1.1.2"
}
},
{
"identity" : "swift-dependencies",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies.git",
"state" : {
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
"version" : "1.0.0"
"revision" : "9783b58167f7618cb86011156e741cbc6f4cc864",
"version" : "1.1.2"
}
},
{
Expand All @@ -81,40 +81,58 @@
"version" : "0.2.2"
}
},
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
}
},
{
"identity" : "swift-docc-symbolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-symbolkit",
"state" : {
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
}
},
{
"identity" : "swift-macro-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-macro-testing",
"state" : {
"revision" : "101d84b5fd6df3d70435ab13b5495ff77f930248",
"version" : "0.1.0"
"revision" : "10dcef36314ddfea6f60442169b0b320204cbd35",
"version" : "0.2.2"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "506b6052384d8e97a4bb16fe8680325351c23c64",
"version" : "1.14.0"
"revision" : "59b663f68e69f27a87b45de48cb63264b8194605",
"version" : "1.15.1"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "74203046135342e4a4a627476dd6caf8b28fe11b",
"version" : "509.0.0"
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
},
{
"identity" : "swiftui-navigation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swiftui-navigation",
"state" : {
"revision" : "6eb293c49505d86e9e24232cb6af6be7fff93bd5",
"version" : "1.0.2"
"revision" : "78f9d72cf667adb47e2040aa373185c88c63f0dc",
"version" : "1.2.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42E697E32ACC0C26008514B1"
BuildableName = "Github-App.app"
BlueprintName = "Github-App"
ReferencedContainer = "container:Github-App.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42E697F32ACC0C27008514B1"
BuildableName = "Github-AppTests.xctest"
BlueprintName = "Github-AppTests"
ReferencedContainer = "container:Github-App.xcodeproj">
</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">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42E697E32ACC0C26008514B1"
BuildableName = "Github-App.app"
BlueprintName = "Github-App"
ReferencedContainer = "container:Github-App.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42E697E32ACC0C26008514B1"
BuildableName = "Github-App.app"
BlueprintName = "Github-App"
ReferencedContainer = "container:Github-App.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,18 @@
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>42E697E32ACC0C26008514B1</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>42E697F32ACC0C27008514B1</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
10 changes: 5 additions & 5 deletions Examples/Github-App/Github-App/View/RootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import SwiftUI

@Reducer
struct RootReducer {
enum ViewAction: Equatable {
enum ViewAction {
case textChanged
case onAppear
}

enum ReducerAction: Equatable {
case fetchRepositoriesResponse(TaskResult<[Repository]>)
enum ReducerAction {
case fetchRepositoriesResponse(Result<[Repository], any Error>)
case alert(Alert)
case queryChangeDebounced

enum Alert: Equatable {
enum Alert {
case retry
}
}
Expand Down Expand Up @@ -81,7 +81,7 @@ struct RootReducer {
.run { send in
await send(
.fetchRepositoriesResponse(
TaskResult { try await fetchRepositories(query) }
Result { try await fetchRepositories(query) }
)
)
}
Expand Down
8 changes: 4 additions & 4 deletions Examples/Github-App/Github-AppTests/RootReducerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ final class RootReducerTests: XCTestCase {
}

await store.send(.textChanged)
await store.receive(.queryChangeDebounced) {
await store.receive(\.queryChangeDebounced, timeout: 1) {
$0.isLoading = true
}
await store.receive(.fetchRepositoriesResponse(.success([.stub]))) {
await store.receive(\.fetchRepositoriesResponse.success, timeout: 1) {
$0.repositories = [.stub]
$0.isLoading = false
}
Expand All @@ -28,10 +28,10 @@ final class RootReducerTests: XCTestCase {
}

await store.send(.textChanged)
await store.receive(.queryChangeDebounced) {
await store.receive(\.queryChangeDebounced, timeout: 1) {
$0.isLoading = true
}
await store.receive(.fetchRepositoriesResponse(.failure(error))) {
await store.receive(\.fetchRepositoriesResponse.failure, timeout: 1) {
$0.isLoading = false
$0.alertState = .init {
TextState("An Error has occurred.")
Expand Down
32 changes: 16 additions & 16 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths.git",
"state" : {
"revision" : "5da6989aae464f324eef5c5b52bdb7974725ab81",
"version" : "1.0.0"
"revision" : "a5521dde99570789d8cb7c43e51418d7cd1a87ca",
"version" : "1.1.2"
}
},
{
Expand All @@ -50,26 +50,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "ea631ce892687f5432a833312292b80db238186a",
"version" : "1.0.0"
"revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71",
"version" : "1.1.0"
}
},
{
"identity" : "swift-custom-dump",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-custom-dump.git",
"state" : {
"revision" : "edd66cace818e1b1c6f1b3349bb1d8e00d6f8b01",
"version" : "1.0.0"
"revision" : "aedcf6f4cd486ccef5b312ccac85d4b3f6e58605",
"version" : "1.1.2"
}
},
{
"identity" : "swift-dependencies",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies.git",
"state" : {
"revision" : "4e1eb6e28afe723286d8cc60611237ffbddba7c5",
"version" : "1.0.0"
"revision" : "9783b58167f7618cb86011156e741cbc6f4cc864",
"version" : "1.1.2"
}
},
{
Expand All @@ -95,35 +95,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-macro-testing",
"state" : {
"revision" : "101d84b5fd6df3d70435ab13b5495ff77f930248",
"version" : "0.1.0"
"revision" : "10dcef36314ddfea6f60442169b0b320204cbd35",
"version" : "0.2.2"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "696b86a6d151578bca7c1a2a3ed419a5f834d40f",
"version" : "1.13.0"
"revision" : "59b663f68e69f27a87b45de48cb63264b8194605",
"version" : "1.15.1"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "74203046135342e4a4a627476dd6caf8b28fe11b",
"version" : "509.0.0"
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
},
{
"identity" : "swiftui-navigation",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swiftui-navigation.git",
"state" : {
"revision" : "6eb293c49505d86e9e24232cb6af6be7fff93bd5",
"version" : "1.0.2"
"revision" : "78f9d72cf667adb47e2040aa373185c88c63f0dc",
"version" : "1.2.0"
}
},
{
Expand Down
15 changes: 9 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", exact: "509.0.2"),
.package(url: "https://github.com/pointfreeco/swift-case-paths.git", exact: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump.git", exact: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swift-dependencies.git", exact: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swiftui-navigation.git", exact: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing.git", exact: "0.2.2"),
.package(url: "https://github.com/apple/swift-syntax.git", from: "509.0.2"),
.package(url: "https://github.com/pointfreeco/swift-case-paths.git", from: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump.git", from: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swift-dependencies.git", from: "1.1.2"),
.package(url: "https://github.com/pointfreeco/swiftui-navigation.git", from: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-macro-testing.git", from: "0.2.2"),
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.2"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras.git", from: "1.1.0")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand All @@ -40,6 +41,8 @@ let package = Package(
.product(name: "CustomDump", package: "swift-custom-dump"),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(name: "SwiftUINavigation", package: "swiftui-navigation"),
.product(name: "DependenciesMacros", package: "swift-dependencies"),
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras")
]
),
.executableTarget(
Expand Down

0 comments on commit 88462ae

Please sign in to comment.