Skip to content

Commit db73cc1

Browse files
committed
Move files to package Tool
1 parent 8fbfa3a commit db73cc1

File tree

9 files changed

+25
-23
lines changed

9 files changed

+25
-23
lines changed

Core/Package.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ let package = Package(
4343
.package(url: "https://github.com/ChimeHQ/LanguageClient", exact: "0.3.1"),
4444
.package(url: "https://github.com/ChimeHQ/LanguageServerProtocol", exact: "0.8.0"),
4545
.package(url: "https://github.com/apple/swift-async-algorithms", from: "0.1.0"),
46-
.package(url: "https://github.com/raspu/Highlightr", from: "2.1.0"),
47-
.package(url: "https://github.com/JohnSundell/Splash", branch: "master"),
4846
.package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.1.0"),
4947
.package(url: "https://github.com/sparkle-project/Sparkle", from: "2.0.0"),
5048
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess", from: "4.2.2"),
5149
.package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.12.1"),
50+
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "0.5.1"),
5251
.package(
5352
url: "https://github.com/pointfreeco/swift-composable-architecture",
5453
from: "0.55.0"
@@ -90,6 +89,7 @@ let package = Package(
9089
.product(name: "Preferences", package: "Tool"),
9190
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
9291
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
92+
.product(name: "Dependencies", package: "swift-dependencies"),
9393
].pro([
9494
"ProChatTabs",
9595
])
@@ -209,8 +209,8 @@ let package = Package(
209209
.target(
210210
name: "ChatGPTChatTab",
211211
dependencies: [
212-
"SharedUIComponents",
213212
"ChatService",
213+
.product(name: "SharedUIComponents", package: "Tool"),
214214
.product(name: "OpenAIService", package: "Tool"),
215215
.product(name: "Logger", package: "Tool"),
216216
.product(name: "ChatTab", package: "Tool"),
@@ -220,22 +220,12 @@ let package = Package(
220220

221221
// MARK: - UI
222222

223-
.target(
224-
name: "SharedUIComponents",
225-
dependencies: [
226-
"Highlightr",
227-
"Splash",
228-
.product(name: "Preferences", package: "Tool"),
229-
]
230-
),
231-
.testTarget(name: "SharedUIComponentsTests", dependencies: ["SharedUIComponents"]),
232-
233223
.target(
234224
name: "SuggestionWidget",
235225
dependencies: [
236226
"ChatGPTChatTab",
237227
"UserDefaultsObserver",
238-
"SharedUIComponents",
228+
.product(name: "SharedUIComponents", package: "Tool"),
239229
.product(name: "AppMonitoring", package: "Tool"),
240230
.product(name: "Environment", package: "Tool"),
241231
.product(name: "ChatTab", package: "Tool"),

Core/Sources/Service/GUI/GraphicalUserInterfaceController.swift.swift renamed to Core/Sources/Service/GUI/GraphicalUserInterfaceController.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ChatGPTChatTab
33
import ChatService
44
import ChatTab
55
import ComposableArchitecture
6+
import Dependencies
67
import Environment
78
import Preferences
89
import PromptToCodeService
@@ -133,15 +134,13 @@ public final class GraphicalUserInterfaceController {
133134
viewStore = ViewStore(store)
134135
widgetDataSource = .init()
135136

136-
widgetController = withDependencies(setupDependency) {
137-
SuggestionWidgetController(
138-
store: store.scope(
139-
state: \.suggestionWidgetState,
140-
action: GUI.Action.suggestionWidget
141-
),
142-
dependency: suggestionDependency
143-
)
144-
}
137+
widgetController = SuggestionWidgetController(
138+
store: store.scope(
139+
state: \.suggestionWidgetState,
140+
action: GUI.Action.suggestionWidget
141+
),
142+
dependency: suggestionDependency
143+
)
145144

146145
suggestionDependency.suggestionWidgetDataSource = widgetDataSource
147146
suggestionDependency.onOpenChatClicked = { [weak self] in

Tool/Package.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ let package = Package(
1717
.library(name: "Environment", targets: ["Environment"]),
1818
.library(name: "SuggestionModel", targets: ["SuggestionModel"]),
1919
.library(name: "Toast", targets: ["Toast"]),
20+
.library(name: "SharedUIComponents", targets: ["SharedUIComponents"]),
2021
.library(
2122
name: "AppMonitoring",
2223
targets: [
@@ -36,6 +37,8 @@ let package = Package(
3637
.package(url: "https://github.com/ChimeHQ/JSONRPC", exact: "0.6.0"),
3738
.package(url: "https://github.com/scinfu/SwiftSoup.git", from: "2.6.0"),
3839
.package(url: "https://github.com/unum-cloud/usearch", from: "0.19.1"),
40+
.package(url: "https://github.com/raspu/Highlightr", from: "2.1.0"),
41+
.package(url: "https://github.com/JohnSundell/Splash", branch: "master"),
3942
.package(
4043
url: "https://github.com/pointfreeco/swift-composable-architecture",
4144
from: "0.55.0"
@@ -123,6 +126,16 @@ let package = Package(
123126
]
124127
),
125128

129+
.target(
130+
name: "SharedUIComponents",
131+
dependencies: [
132+
"Highlightr",
133+
"Splash",
134+
"Preferences",
135+
]
136+
),
137+
.testTarget(name: "SharedUIComponentsTests", dependencies: ["SharedUIComponents"]),
138+
126139
// MARK: - Services
127140

128141
.target(
File renamed without changes.
File renamed without changes.

Core/Sources/SharedUIComponents/CustomScrollView.swift renamed to Tool/Sources/SharedUIComponents/CustomScrollView.swift

File renamed without changes.

Core/Sources/SharedUIComponents/CustomTextEditor.swift renamed to Tool/Sources/SharedUIComponents/CustomTextEditor.swift

File renamed without changes.

Core/Sources/SharedUIComponents/SyntaxHighlighting.swift renamed to Tool/Sources/SharedUIComponents/SyntaxHighlighting.swift

File renamed without changes.

Core/Tests/SharedUIComponentsTests/ConvertToCodeLinesTests.swift renamed to Tool/Tests/SharedUIComponentsTests/ConvertToCodeLinesTests.swift

File renamed without changes.

0 commit comments

Comments
 (0)