Skip to content

Commit a5abafe

Browse files
leogdionclaude
andcommitted
refactor: split package into library and CLI products
Reorganize the Swift package into two separate products: - BushelCloudKit: Reusable library with CloudKit/data source logic - bushel-cloud: CLI executable using ArgumentParser This separation allows the CloudKit functionality to be used as a library in other Swift projects while maintaining the existing CLI tool. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4fc7e80 commit a5abafe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+282
-194
lines changed

Package.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ let package = Package(
8383
.macOS(.v14)
8484
],
8585
products: [
86-
.executable(name: "bushel-cloud", targets: ["BushelCloud"])
86+
.library(name: "BushelCloudKit", targets: ["BushelCloudKit"]),
87+
.executable(name: "bushel-cloud", targets: ["BushelCloudCLI"])
8788
],
8889
dependencies: [
8990
.package(url: "https://github.com/brightdigit/MistKit.git", from: "1.0.0-alpha.3"),
@@ -93,21 +94,28 @@ let package = Package(
9394
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0")
9495
],
9596
targets: [
96-
.executableTarget(
97-
name: "BushelCloud",
97+
.target(
98+
name: "BushelCloudKit",
9899
dependencies: [
99100
.product(name: "MistKit", package: "MistKit"),
100101
.product(name: "IPSWDownloads", package: "IPSWDownloads"),
101102
.product(name: "SwiftSoup", package: "SwiftSoup"),
102-
.product(name: "ArgumentParser", package: "swift-argument-parser"),
103103
.product(name: "Logging", package: "swift-log")
104104
],
105105
swiftSettings: swiftSettings
106106
),
107+
.executableTarget(
108+
name: "BushelCloudCLI",
109+
dependencies: [
110+
.target(name: "BushelCloudKit"),
111+
.product(name: "ArgumentParser", package: "swift-argument-parser")
112+
],
113+
swiftSettings: swiftSettings
114+
),
107115
.testTarget(
108116
name: "BushelCloudTests",
109117
dependencies: [
110-
.target(name: "BushelCloud")
118+
.target(name: "BushelCloudKit")
111119
],
112120
swiftSettings: swiftSettings
113121
)

Sources/BushelCloud/BushelCloudCLI.swift renamed to Sources/BushelCloudCLI/BushelCloudCLI.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import ArgumentParser
2+
import BushelCloudKit
23

34
@main
45
internal struct BushelCloudCLI: AsyncParsableCommand {

Sources/BushelCloud/Commands/ClearCommand.swift renamed to Sources/BushelCloudCLI/Commands/ClearCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ArgumentParser
22
import Foundation
3+
import BushelCloudKit
34

45
struct ClearCommand: AsyncParsableCommand {
56
static let configuration = CommandConfiguration(

Sources/BushelCloud/Commands/ExportCommand.swift renamed to Sources/BushelCloudCLI/Commands/ExportCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ArgumentParser
22
import Foundation
3+
import BushelCloudKit
34
import MistKit
45

56
struct ExportCommand: AsyncParsableCommand {

Sources/BushelCloud/Commands/ListCommand.swift renamed to Sources/BushelCloudCLI/Commands/ListCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import ArgumentParser
55
import Foundation
6+
import BushelCloudKit
67
import MistKit
78

89
struct ListCommand: AsyncParsableCommand {

Sources/BushelCloud/Commands/StatusCommand.swift renamed to Sources/BushelCloudCLI/Commands/StatusCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import ArgumentParser
55
import Foundation
6+
import BushelCloudKit
67
internal import MistKit
78

89
struct StatusCommand: AsyncParsableCommand {

Sources/BushelCloud/Commands/SyncCommand.swift renamed to Sources/BushelCloudCLI/Commands/SyncCommand.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ArgumentParser
22
import Foundation
3+
import BushelCloudKit
34

45
struct SyncCommand: AsyncParsableCommand {
56
static let configuration = CommandConfiguration(
File renamed without changes.

Sources/BushelCloud/BushelCloud.docc/CloudKitIntegration.md renamed to Sources/BushelCloudKit/BushelCloud.docc/CloudKitIntegration.md

File renamed without changes.

Sources/BushelCloud/BushelCloud.docc/CloudKitSetup.md renamed to Sources/BushelCloudKit/BushelCloud.docc/CloudKitSetup.md

File renamed without changes.

0 commit comments

Comments
 (0)