Add root module, hook up boilerplate
This commit is contained in:
parent
e716c1cf03
commit
498716fd67
@ -4,12 +4,14 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Root
|
||||
import ComposableArchitecture
|
||||
|
||||
@main
|
||||
struct App: SwiftUI.App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
RootView(store: .init(initialState: RootFeature.State()) { RootFeature() })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// Meow
|
||||
//
|
||||
// Created by Ben Kreeger on 11/21/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentView()
|
||||
}
|
||||
@ -7,7 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
C3A5E8D52ED0C60D002DB10E /* Meow in Frameworks */ = {isa = PBXBuildFile; productRef = C3A5E8D42ED0C60D002DB10E /* Meow */; };
|
||||
C3C75C5B2ED2C672000FD10A /* Root in Frameworks */ = {isa = PBXBuildFile; productRef = C3C75C5A2ED2C672000FD10A /* Root */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -57,7 +57,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C3A5E8D52ED0C60D002DB10E /* Meow in Frameworks */,
|
||||
C3C75C5B2ED2C672000FD10A /* Root in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -85,6 +85,7 @@
|
||||
C3BB763D2ED0C38800D56534 /* App */,
|
||||
C3BB764B2ED0C38900D56534 /* AppTests */,
|
||||
C3BB76552ED0C38900D56534 /* AppUITests */,
|
||||
C3C75C592ED2C672000FD10A /* Frameworks */,
|
||||
C3BB763C2ED0C38800D56534 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
@ -99,6 +100,13 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C3C75C592ED2C672000FD10A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@ -119,7 +127,7 @@
|
||||
);
|
||||
name = App;
|
||||
packageProductDependencies = (
|
||||
C3A5E8D42ED0C60D002DB10E /* Meow */,
|
||||
C3C75C5A2ED2C672000FD10A /* Root */,
|
||||
);
|
||||
productName = Meow;
|
||||
productReference = C3BB763B2ED0C38800D56534 /* App.app */;
|
||||
@ -203,6 +211,8 @@
|
||||
);
|
||||
mainGroup = C3BB76322ED0C38800D56534;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
packageReferences = (
|
||||
);
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = C3BB763C2ED0C38800D56534 /* Products */;
|
||||
projectDirPath = "";
|
||||
@ -588,9 +598,9 @@
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
C3A5E8D42ED0C60D002DB10E /* Meow */ = {
|
||||
C3C75C5A2ED2C672000FD10A /* Root */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = Meow;
|
||||
productName = Root;
|
||||
};
|
||||
/* End XCSwiftPackageProductDependency section */
|
||||
};
|
||||
|
||||
@ -1,6 +1,15 @@
|
||||
{
|
||||
"originHash" : "b5a4d1a917ee731eae9d288a993a1e905ecfa9e87cb169c76452216c83b5b4f2",
|
||||
"originHash" : "03f5559d79002e8e6f227dad3ac96ca579765f0a5ca04e269a674fc6b6809778",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "combine-schedulers",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/combine-schedulers",
|
||||
"state" : {
|
||||
"revision" : "fd16d76fd8b9a976d88bfb6cacc05ca8d19c91b6",
|
||||
"version" : "1.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "mocker",
|
||||
"kind" : "remoteSourceControl",
|
||||
@ -9,6 +18,123 @@
|
||||
"revision" : "95fa785c751f6bc40c49e112d433c3acf8417a97",
|
||||
"version" : "3.0.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-case-paths",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-case-paths",
|
||||
"state" : {
|
||||
"revision" : "6989976265be3f8d2b5802c722f9ba168e227c71",
|
||||
"version" : "1.7.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-clocks",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-clocks",
|
||||
"state" : {
|
||||
"revision" : "cc46202b53476d64e824e0b6612da09d84ffde8e",
|
||||
"version" : "1.0.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-collections",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-collections",
|
||||
"state" : {
|
||||
"revision" : "7b847a3b7008b2dc2f47ca3110d8c782fb2e5c7e",
|
||||
"version" : "1.3.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-composable-architecture",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-composable-architecture",
|
||||
"state" : {
|
||||
"revision" : "5b0890fabfd68a2d375d68502bc3f54a8548c494",
|
||||
"version" : "1.23.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-concurrency-extras",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
|
||||
"state" : {
|
||||
"revision" : "5a3825302b1a0d744183200915a47b508c828e6f",
|
||||
"version" : "1.3.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-custom-dump",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-custom-dump",
|
||||
"state" : {
|
||||
"revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
|
||||
"version" : "1.3.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-dependencies",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-dependencies",
|
||||
"state" : {
|
||||
"revision" : "a10f9feeb214bc72b5337b6ef6d5a029360db4cc",
|
||||
"version" : "1.10.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-identified-collections",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-identified-collections",
|
||||
"state" : {
|
||||
"revision" : "322d9ffeeba85c9f7c4984b39422ec7cc3c56597",
|
||||
"version" : "1.1.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-navigation",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-navigation",
|
||||
"state" : {
|
||||
"revision" : "bf498690e1f6b4af790260f542e8428a4ba10d78",
|
||||
"version" : "2.6.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-perception",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-perception",
|
||||
"state" : {
|
||||
"revision" : "4f47ebafed5f0b0172cf5c661454fa8e28fb2ac4",
|
||||
"version" : "2.0.9"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-sharing",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/swift-sharing",
|
||||
"state" : {
|
||||
"revision" : "3bfc408cc2d0bee2287c174da6b1c76768377818",
|
||||
"version" : "2.7.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "swift-syntax",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/swiftlang/swift-syntax",
|
||||
"state" : {
|
||||
"revision" : "4799286537280063c85a32f09884cfbca301b1a1",
|
||||
"version" : "602.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "xctest-dynamic-overlay",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
|
||||
"state" : {
|
||||
"revision" : "4c27acf5394b645b70d8ba19dc249c0472d5f618",
|
||||
"version" : "1.7.0"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 3
|
||||
|
||||
@ -20,9 +20,14 @@ let package = Package(
|
||||
name: "CatFactsKit",
|
||||
targets: ["CatFactsKit"]
|
||||
),
|
||||
.library(
|
||||
name: "Root",
|
||||
targets: ["Root"]
|
||||
)
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/WeTransfer/Mocker", from: "3.0.2"),
|
||||
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.23.1"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
||||
@ -31,6 +36,14 @@ let package = Package(
|
||||
name: "CatFactsKit",
|
||||
swiftSettings: commonSwiftSettings
|
||||
),
|
||||
.target(
|
||||
name: "Root",
|
||||
dependencies: [
|
||||
"CatFactsKit",
|
||||
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
|
||||
],
|
||||
swiftSettings: commonSwiftSettings
|
||||
),
|
||||
.testTarget(
|
||||
name: "CatFactsKitTests",
|
||||
dependencies: [
|
||||
|
||||
27
Meow/Sources/Root/RootFeature.swift
Normal file
27
Meow/Sources/Root/RootFeature.swift
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// RootFeature.swift
|
||||
// Root
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import ComposableArchitecture
|
||||
|
||||
@Reducer
|
||||
public struct RootFeature {
|
||||
@ObservableState
|
||||
public struct State {
|
||||
public var baseURL: String?
|
||||
|
||||
public init() { }
|
||||
}
|
||||
|
||||
public enum Action {
|
||||
// Add your actions here
|
||||
}
|
||||
|
||||
public init() { }
|
||||
|
||||
public var body: some ReducerOf<Self> {
|
||||
EmptyReducer()
|
||||
}
|
||||
}
|
||||
31
Meow/Sources/Root/RootView.swift
Normal file
31
Meow/Sources/Root/RootView.swift
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// RootView.swift
|
||||
// Root
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import ComposableArchitecture
|
||||
|
||||
public struct RootView: View {
|
||||
let store: StoreOf<RootFeature>
|
||||
|
||||
public init(store: StoreOf<RootFeature>) {
|
||||
self.store = store
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
RootView(store: .init(initialState: RootFeature.State()) {
|
||||
RootFeature()
|
||||
})
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user