Skip to content

Commit

Permalink
Updates for TCA 0.39.0 and Swift Concurrency (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored Aug 9, 2022
1 parent a026888 commit f132bd0
Show file tree
Hide file tree
Showing 210 changed files with 4,956 additions and 5,050 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
run: git lfs pull
- name: Start Postgres
run: brew services start postgresql
- name: Select Xcode 13.3
run: sudo xcode-select -s /Applications/Xcode_13.3.app
- name: Select Xcode 13.4.1
run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- name: Bootstrap
run: make bootstrap
- name: Run tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ComposableGameCenter"
BuildableName = "ComposableGameCenter"
BlueprintName = "ComposableGameCenter"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</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 = "ComposableGameCenter"
BuildableName = "ComposableGameCenter"
BlueprintName = "ComposableGameCenter"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
67 changes: 67 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/ComposableStoreKit.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ComposableStoreKit"
BuildableName = "ComposableStoreKit"
BlueprintName = "ComposableStoreKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</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 = "ComposableStoreKit"
BuildableName = "ComposableStoreKit"
BlueprintName = "ComposableStoreKit"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
10 changes: 10 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/CubePreviewPreview.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CubePreviewTests"
BuildableName = "CubePreviewTests"
BlueprintName = "CubePreviewTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
10 changes: 10 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/HomeFeaturePreview.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "HomeFeatureTests"
BuildableName = "HomeFeatureTests"
BlueprintName = "HomeFeatureTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
10 changes: 10 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/OnboardingPreview.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "OnboardingFeatureTests"
BuildableName = "OnboardingFeatureTests"
BlueprintName = "OnboardingFeatureTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
67 changes: 67 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/TcaHelpers.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "TcaHelpers"
BuildableName = "TcaHelpers"
BlueprintName = "TcaHelpers"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</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 = "TcaHelpers"
BuildableName = "TcaHelpers"
BlueprintName = "TcaHelpers"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
7 changes: 3 additions & 4 deletions App/AppClip/AppClipApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension ApiClient {
// games to the leaderboards.
static var appClip: Self {
var apiClient = ApiClient.noop
apiClient.request = { route in
apiClient.request = { @Sendable route in
switch route {
case .api,
.appSiteAssociation,
Expand All @@ -60,7 +60,7 @@ extension ApiClient {
.home,
.pressKit,
.privacyPolicy:
return .none
throw CancellationError()

case let .demo(.submitGame(gameRequest)):
#if DEBUG
Expand All @@ -78,8 +78,7 @@ extension ApiClient {
request.httpMethod = "POST"
request.httpBody = try? JSONEncoder().encode(gameRequest)

return URLSession.shared.dataTaskPublisher(for: request)
.eraseToEffect()
return try await URLSession.shared.data(for: request)
}
}

Expand Down
7 changes: 3 additions & 4 deletions App/Previews/GameOverPreview/GameOverPreviewApp.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ApiClient
import ComposableArchitecture
import GameOverFeature
import Overture
Expand All @@ -15,7 +16,7 @@ struct GameOverPreviewApp: App {
WindowGroup {
GameOverView(
store: .solo
// store: .multiplayer
// store: .multiplayer
)
}
}
Expand Down Expand Up @@ -43,7 +44,7 @@ extension Store where State == GameOverState, Action == GameOverAction {
routeCase: (/ServerRoute.Api.Route.games)
.appending(path: /ServerRoute.Api.Route.Games.submit),
withResponse: { _ in
Effect.ok(
try await OK(
SubmitGameResponse.solo(
.init(
ranks: [
Expand All @@ -54,8 +55,6 @@ extension Store where State == GameOverState, Action == GameOverAction {
)
)
)
.delay(for: 1, scheduler: DispatchQueue.main)
.eraseToEffect()
}
)
},
Expand Down
Loading

0 comments on commit f132bd0

Please sign in to comment.