Skip to content

Commit ec321f5

Browse files
author
Marek Fořt
committed
Rename to ComposableTuistArchitecture.
1 parent 1f8ac11 commit ec321f5

File tree

23 files changed

+114
-87
lines changed

23 files changed

+114
-87
lines changed

Diff for: Projects/TuistComposableArchitecture/Project.swift renamed to Projects/ComposableTuistArchitecture/Project.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ProjectDescription
22
import ProjectDescriptionHelpers
33

44
let project = Project.app(
5-
name: "TuistComposableArchitecture",
5+
name: "ComposableTuistArchitecture",
66
packages: [
77
.remote(
88
url: "https://github.com/pointfreeco/swift-composable-architecture",
@@ -11,8 +11,8 @@ let project = Project.app(
1111
],
1212
dependencies: [
1313
.project(
14-
target: "TuistComposableArchitectureKit",
15-
path: .relativeToManifest("../TuistComposableArchitectureKit")
14+
target: "ComposableTuistArchitectureKit",
15+
path: .relativeToRoot("Projects/ComposableTuistArchitectureKit")
1616
),
1717
.project(
1818
target: "RecipeList",

Diff for: Projects/TuistComposableArchitecture/Sources/AppDelegate.swift renamed to Projects/ComposableTuistArchitecture/Sources/AppDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import UIKit
2-
import TuistComposableArchitectureKit
2+
import ComposableTuistArchitectureKit
33

44
@UIApplicationMain
55
class AppDelegate: UIResponder, UIApplicationDelegate {

Diff for: Projects/TuistComposableArchitecture/Sources/SceneDelegate.swift renamed to Projects/ComposableTuistArchitecture/Sources/SceneDelegate.swift

+21-27
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import UIKit
22
import SwiftUI
33
import ComposableArchitecture
4-
import TuistComposableArchitectureSupport
4+
import ComposableTuistArchitectureSupport
5+
import RecipeList
6+
7+
struct ContentView: View {
8+
var body: some View {
9+
Text("Hello, World!")
10+
}
11+
}
12+
513

614
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
715

816
var window: UIWindow?
917

10-
1118
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
1219
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
1320
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
@@ -16,31 +23,18 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
1623
// Use a UIHostingController as window root view controller.
1724
if let windowScene = scene as? UIWindowScene {
1825
let window = UIWindow(windowScene: windowScene)
19-
// window.rootViewController = CounterViewController(store: Store(
20-
// initialValue: CounterState(
21-
// count: 0,
22-
// alertNthPrime: nil,
23-
// isNthPrimeButtonDisabled: false
24-
// ),
25-
// reducer: with(
26-
// counterReducer,
27-
// logging
28-
// ),
29-
// environment: .live
30-
// )
31-
// )
32-
// window.rootViewController = UIHostingController(
33-
// rootView: ContentView(
34-
// store: Store(
35-
// initialValue: AppState(),
36-
// reducer: with(
37-
// appReducer,
38-
// logging
39-
// ),
40-
// environment: .live
41-
// )
42-
// )
43-
// )
26+
window.rootViewController = UIHostingController(
27+
rootView: RecipeListView(
28+
store: Store(
29+
initialState: RecipeListState(),
30+
reducer: recipeListReducer.debug(),
31+
environment: RecipeListEnvironment(
32+
cookbookClient: .live,
33+
mainQueue: DispatchQueue.main.eraseToAnyScheduler()
34+
)
35+
)
36+
)
37+
)
4438
self.window = window
4539
window.makeKeyAndVisible()
4640
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Foundation
2+
import XCTest
3+
4+
@testable import ComposableTuistArchitecture
5+
6+
final class ComposableTuistArchitectureTests: XCTestCase {
7+
8+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import ProjectDescription
2+
import ProjectDescriptionHelpers
3+
4+
let project = Project.framework(
5+
name: "ComposableTuistArchitectureKit",
6+
dependencies: [
7+
.project(
8+
target: "ComposableTuistArchitectureSupport",
9+
path: .relativeToManifest("../ComposableTuistArchitectureSupport")
10+
)
11+
]
12+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Foundation
2+
import ComposableTuistArchitectureSupport
3+
4+
public final class ComposableTuistArchitectureKit {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Foundation
2+
import XCTest
3+
4+
@testable import ComposableTuistArchitectureKit
5+
6+
final class ComposableTuistArchitectureKitTests: XCTestCase {
7+
8+
}

Diff for: Projects/TuistComposableArchitectureSupport/Project.swift renamed to Projects/ComposableTuistArchitectureSupport/Project.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ProjectDescription
22
import ProjectDescriptionHelpers
33

44
let project = Project.framework(
5-
name: "TuistComposableArchitectureSupport",
5+
name: "ComposableTuistArchitectureSupport",
66
dependencies: [
77
.package(product: "ComposableArchitecture"),
88
.package(product: "CasePaths"),

Diff for: Projects/TuistComposableArchitectureSupport/Sources/CookbookClient.swift renamed to Projects/ComposableTuistArchitectureSupport/Sources/CookbookClient.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public struct Recipe: Codable, Identifiable, Equatable {
77
id: String,
88
name: String,
99
duration: Int,
10-
score: Int
10+
score: Double
1111
) {
1212
self.id = id
1313
self.name = name
@@ -18,7 +18,7 @@ public struct Recipe: Codable, Identifiable, Equatable {
1818
public let id: String
1919
public let name: String
2020
public let duration: Int
21-
public let score: Int
21+
public let score: Double
2222
}
2323

2424
public struct CookbookClient {
@@ -36,7 +36,7 @@ public extension CookbookClient {
3636
return URLSession.shared.dataTaskPublisher(for: url)
3737
.map { data, _ in data }
3838
.decode(type: [Recipe].self, decoder: jsonDecoder)
39-
.mapError { _ in Failure() }
39+
.mapError { error in Failure() }
4040
.eraseToEffect()
4141
}
4242
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Foundation
2+
import XCTest
3+
4+
@testable import ComposableTuistArchitectureSupport
5+
6+
final class ComposableTuistArchitectureSupportTests: XCTestCase {
7+
8+
}

Diff for: Projects/Features/RecipeList/Sources/RecipeList.swift

+22-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ import CasePaths
22
import Combine
33
import ComposableArchitecture
44
import SwiftUI
5-
import TuistComposableArchitectureSupport
5+
import ComposableTuistArchitectureSupport
66

77
public struct RecipeListState {
8+
public init(
9+
recipes: [Recipe] = [],
10+
isLoadingRecipes: Bool = false
11+
) {
12+
self.recipes = recipes
13+
self.isLoadingRecipes = isLoadingRecipes
14+
}
15+
816
var recipes: [Recipe] = []
917
var isLoadingRecipes: Bool = false
1018
}
@@ -15,11 +23,19 @@ public enum RecipeListAction: Equatable {
1523
}
1624

1725
public struct RecipeListEnvironment {
26+
public init(
27+
cookbookClient: CookbookClient,
28+
mainQueue: AnySchedulerOf<DispatchQueue>
29+
) {
30+
self.cookbookClient = cookbookClient
31+
self.mainQueue = mainQueue
32+
}
33+
1834
let cookbookClient: CookbookClient
1935
let mainQueue: AnySchedulerOf<DispatchQueue>
2036
}
2137

22-
let recipeListReducer = Reducer<RecipeListState, RecipeListAction, RecipeListEnvironment> { state, action, environment in
38+
public let recipeListReducer = Reducer<RecipeListState, RecipeListAction, RecipeListEnvironment> { state, action, environment in
2339
switch action {
2440
case .recipes:
2541
state.isLoadingRecipes = true
@@ -54,6 +70,10 @@ public struct RecipeListView: View {
5470

5571
let store: Store<RecipeListState, RecipeListAction>
5672

73+
public init(store: Store<RecipeListState, RecipeListAction>) {
74+
self.store = store
75+
}
76+
5777
public var body: some View {
5878
WithViewStore(
5979
self.store.scope(state: State.init, action: RecipeListAction.init)

Diff for: Projects/TuistComposableArchitecture/Tests/TuistComposableArchitectureTests.swift

-8
This file was deleted.

Diff for: Projects/TuistComposableArchitectureKit/Project.swift

-12
This file was deleted.

Diff for: Projects/TuistComposableArchitectureKit/Sources/TuistComposableArchitectureKit.swift

-4
This file was deleted.

Diff for: Projects/TuistComposableArchitectureKit/Tests/TuistComposableArchitectureKitTests.swift

-8
This file was deleted.

Diff for: Projects/TuistComposableArchitectureSupport/Tests/TuistComposableArchitectureSupportTests.swift

-8
This file was deleted.

Diff for: Tuist/ProjectDescriptionHelpers/Project+Templates.swift

+19-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extension Project {
99
platform: Platform = platform,
1010
dependencies: [TargetDependency] = []
1111
) -> Project {
12-
return self.project(
12+
return project(
1313
name: name,
1414
packages: packages,
1515
product: .app,
@@ -18,7 +18,20 @@ extension Project {
1818
dependencies,
1919
infoPlist: [
2020
"CFBundleShortVersionString": "1.0",
21-
"CFBundleVersion": "1"
21+
"CFBundleVersion": "1",
22+
"UIMainStoryboardFile": "",
23+
"UILaunchStoryboardName": "LaunchScreen",
24+
"UIApplicationSceneManifest": [
25+
"UIApplicationSupportsMultipleScenes": false,
26+
"UISceneConfigurations": [
27+
"UIWindowSceneSessionRoleApplication": [
28+
[
29+
"UISceneConfigurationName": "Default Configuration",
30+
"UISceneDelegateClassName": "$(PRODUCT_MODULE_NAME).SceneDelegate"
31+
]
32+
]
33+
]
34+
]
2235
]
2336
)
2437
}
@@ -28,14 +41,14 @@ extension Project {
2841
platform: Platform = platform,
2942
dependencies: [TargetDependency] = []
3043
) -> Project {
31-
return self.project(
44+
return project(
3245
name: name,
3346
product: .framework,
3447
platform: platform,
3548
dependencies: dependencies
3649
)
3750
}
38-
51+
3952
public static func feature(
4053
name: String,
4154
platform: Platform = platform,
@@ -46,8 +59,8 @@ extension Project {
4659
platform: platform,
4760
dependencies: dependencies + [
4861
.project(
49-
target: "TuistComposableArchitectureSupport",
50-
path: .relativeToRoot("Projects/TuistComposableArchitectureSupport")
62+
target: "ComposableTuistArchitectureSupport",
63+
path: .relativeToRoot("Projects/ComposableTuistArchitectureSupport")
5164
)
5265
]
5366
)

Diff for: Workspace.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import ProjectDescription
22
import ProjectDescriptionHelpers
33

4-
let workspace = Workspace(name: "TuistComposableArchitecture", projects: [
5-
"Projects/TuistComposableArchitecture",
6-
"Projects/TuistComposableArchitectureKit",
7-
"Projects/TuistComposableArchitectureSupport"
4+
let workspace = Workspace(name: "ComposableTuistArchitecture", projects: [
5+
"Projects/ComposableTuistArchitecture",
6+
"Projects/ComposableTuistArchitectureKit",
7+
"Projects/ComposableTuistArchitectureSupport"
88
])

0 commit comments

Comments
 (0)