From 662ec0caac3d8ae61bd79ad5acf9bd51defda0f7 Mon Sep 17 00:00:00 2001 From: Brendan Szymanski Date: Mon, 15 Jun 2026 22:36:41 -0400 Subject: [PATCH] Reorganize targets into LuminateUI with Components and Utilities --- Package.swift | 23 +------------ Sources/Luminate/Luminate.swift | 8 +---- .../Pages}/HomeView.swift | 1 + .../Pages}/LibraryPage.swift | 1 + Sources/LuminateHome/LibraryGrid.swift | 24 ------------- Sources/LuminateLibrary/LuminateLibrary.swift | 4 --- .../Components}/EpisodeList.swift | 0 .../Components}/HomePosterCell.swift | 0 .../Components}/ItemGrid.swift | 0 .../LuminateUI/Components/LibraryGrid.swift | 34 +++++++++++++++++++ .../Components}/MediaRow.swift | 24 +++++++++---- .../Components}/MovieDetailView.swift | 0 .../Components/PersonCell.swift | 0 .../Components}/PosterCell.swift | 0 .../Components/RatingBadge.swift | 0 .../Components}/SearchView.swift | 0 .../Components}/TVShowView.swift | 0 .../Utilities}/AnyView+Overflow.swift | 0 .../PageAnimationTracker.swift | 0 19 files changed, 56 insertions(+), 63 deletions(-) rename Sources/{LuminateHome => Luminate/Pages}/HomeView.swift (99%) rename Sources/{LuminateHome => Luminate/Pages}/LibraryPage.swift (98%) delete mode 100644 Sources/LuminateHome/LibraryGrid.swift delete mode 100644 Sources/LuminateLibrary/LuminateLibrary.swift rename Sources/{LuminateLibrary => LuminateUI/Components}/EpisodeList.swift (100%) rename Sources/{LuminateHome => LuminateUI/Components}/HomePosterCell.swift (100%) rename Sources/{LuminateLibrary => LuminateUI/Components}/ItemGrid.swift (100%) create mode 100644 Sources/LuminateUI/Components/LibraryGrid.swift rename Sources/{LuminateHome => LuminateUI/Components}/MediaRow.swift (56%) rename Sources/{LuminateLibrary => LuminateUI/Components}/MovieDetailView.swift (100%) rename Sources/{LuminateLibrary => LuminateUI}/Components/PersonCell.swift (100%) rename Sources/{LuminateLibrary => LuminateUI/Components}/PosterCell.swift (100%) rename Sources/{LuminateLibrary => LuminateUI}/Components/RatingBadge.swift (100%) rename Sources/{LuminateLibrary => LuminateUI/Components}/SearchView.swift (100%) rename Sources/{LuminateLibrary => LuminateUI/Components}/TVShowView.swift (100%) rename Sources/{LuminateHome => LuminateUI/Utilities}/AnyView+Overflow.swift (100%) rename Sources/LuminateUI/{ => Utilities}/PageAnimationTracker.swift (100%) diff --git a/Package.swift b/Package.swift index 7a4a21b..cf7b7ed 100644 --- a/Package.swift +++ b/Package.swift @@ -59,26 +59,7 @@ let package = Package( .product(name: "Adwaita", package: "adwaita-swift"), ] ), - .target( - name: "LuminateHome", - dependencies: [ - "LuminateCore", - "LuminateDI", - "LuminateUI", - "LuminateObservationMacros", - .product(name: "Adwaita", package: "adwaita-swift"), - ] - ), - .target( - name: "LuminateLibrary", - dependencies: [ - "LuminateCore", - "LuminateDI", - "LuminateUI", - "LuminateObservationMacros", - .product(name: "Adwaita", package: "adwaita-swift"), - ] - ), + .target( name: "LuminatePlayer", dependencies: [ @@ -92,8 +73,6 @@ let package = Package( .executableTarget( name: "Luminate", dependencies: [ - "LuminateHome", - "LuminateLibrary", "LuminatePlayer", "LuminateUI", "LuminateDI", diff --git a/Sources/Luminate/Luminate.swift b/Sources/Luminate/Luminate.swift index 33a5c61..8b9f16a 100644 --- a/Sources/Luminate/Luminate.swift +++ b/Sources/Luminate/Luminate.swift @@ -2,8 +2,6 @@ import Adwaita import Foundation import LuminateCore import LuminateDI -import LuminateHome -import LuminateLibrary import LuminatePlayer import LuminateUI @@ -20,6 +18,7 @@ struct Luminate: App { if let store = try? SQLiteStore(dbURL: SQLiteStore.defaultDatabaseURL()) { DIContainer.shared.register(\.persistence, value: store) } + DIContainer.shared.register(\.imageService, value: ImageService()) DIContainer.shared.register(\.pageAnimationTracker, value: PageAnimationTracker()) } @@ -41,9 +40,6 @@ struct Luminate: App { ServerSetupView { client, id in DIContainer.shared.register(\.client, value: client) DIContainer.shared.register(\.userId, value: id) - DIContainer.shared.register(\.imageService, value: ImageService()) - DIContainer.shared.register( - \.pageAnimationTracker, value: PageAnimationTracker()) self.client = client self.userId = id @@ -75,8 +71,6 @@ struct Luminate: App { DIContainer.shared.register(\.client, value: client) DIContainer.shared.register(\.userId, value: auth.userId) - DIContainer.shared.register(\.imageService, value: ImageService()) - DIContainer.shared.register(\.pageAnimationTracker, value: PageAnimationTracker()) self.client = client self.userId = auth.userId diff --git a/Sources/LuminateHome/HomeView.swift b/Sources/Luminate/Pages/HomeView.swift similarity index 99% rename from Sources/LuminateHome/HomeView.swift rename to Sources/Luminate/Pages/HomeView.swift index c9fd137..2ae2669 100644 --- a/Sources/LuminateHome/HomeView.swift +++ b/Sources/Luminate/Pages/HomeView.swift @@ -1,6 +1,7 @@ import Adwaita import LuminateCore import LuminateDI +import LuminateUI public struct HomeView: View { diff --git a/Sources/LuminateHome/LibraryPage.swift b/Sources/Luminate/Pages/LibraryPage.swift similarity index 98% rename from Sources/LuminateHome/LibraryPage.swift rename to Sources/Luminate/Pages/LibraryPage.swift index 629fc10..49e75eb 100644 --- a/Sources/LuminateHome/LibraryPage.swift +++ b/Sources/Luminate/Pages/LibraryPage.swift @@ -7,6 +7,7 @@ import Adwaita import LuminateCore +import LuminateUI public struct LibraryPage: View { diff --git a/Sources/LuminateHome/LibraryGrid.swift b/Sources/LuminateHome/LibraryGrid.swift deleted file mode 100644 index 84a5293..0000000 --- a/Sources/LuminateHome/LibraryGrid.swift +++ /dev/null @@ -1,24 +0,0 @@ -import Adwaita -import Foundation -import LuminateCore - -struct LibraryGrid: View { - - var libraries: [Components.Schemas.BaseItemDto] - @Binding var navigation: NavigationStack - var title: String? - - var view: Body { - VStack(spacing: 16) { - Text(title ?? "Libraries") - .title3() - .halign(.start) - .padding(10, .horizontal) - FlowBox(libraries) { library in - HomePosterCell(item: library) - } - .columnSpacing(16) - .rowSpacing(16) - } - } -} diff --git a/Sources/LuminateLibrary/LuminateLibrary.swift b/Sources/LuminateLibrary/LuminateLibrary.swift deleted file mode 100644 index 8835247..0000000 --- a/Sources/LuminateLibrary/LuminateLibrary.swift +++ /dev/null @@ -1,4 +0,0 @@ -import Adwaita -import LuminateCore - -public struct LuminateLibrary {} diff --git a/Sources/LuminateLibrary/EpisodeList.swift b/Sources/LuminateUI/Components/EpisodeList.swift similarity index 100% rename from Sources/LuminateLibrary/EpisodeList.swift rename to Sources/LuminateUI/Components/EpisodeList.swift diff --git a/Sources/LuminateHome/HomePosterCell.swift b/Sources/LuminateUI/Components/HomePosterCell.swift similarity index 100% rename from Sources/LuminateHome/HomePosterCell.swift rename to Sources/LuminateUI/Components/HomePosterCell.swift diff --git a/Sources/LuminateLibrary/ItemGrid.swift b/Sources/LuminateUI/Components/ItemGrid.swift similarity index 100% rename from Sources/LuminateLibrary/ItemGrid.swift rename to Sources/LuminateUI/Components/ItemGrid.swift diff --git a/Sources/LuminateUI/Components/LibraryGrid.swift b/Sources/LuminateUI/Components/LibraryGrid.swift new file mode 100644 index 0000000..5bc4211 --- /dev/null +++ b/Sources/LuminateUI/Components/LibraryGrid.swift @@ -0,0 +1,34 @@ +import Adwaita +import Foundation +import LuminateCore + +public struct LibraryGrid: View { + + public var libraries: [Components.Schemas.BaseItemDto] + @Binding public var navigation: NavigationStack + public var title: String? + + public init( + libraries: [Components.Schemas.BaseItemDto], + navigation: Binding>, + title: String? = nil + ) { + self.libraries = libraries + _navigation = navigation + self.title = title + } + + public var view: Body { + VStack(spacing: 16) { + Text(title ?? "Libraries") + .title3() + .halign(.start) + .padding(10, .horizontal) + FlowBox(libraries) { library in + HomePosterCell(item: library) + } + .columnSpacing(16) + .rowSpacing(16) + } + } +} diff --git a/Sources/LuminateHome/MediaRow.swift b/Sources/LuminateUI/Components/MediaRow.swift similarity index 56% rename from Sources/LuminateHome/MediaRow.swift rename to Sources/LuminateUI/Components/MediaRow.swift index d8b7adf..2a4ec94 100644 --- a/Sources/LuminateHome/MediaRow.swift +++ b/Sources/LuminateUI/Components/MediaRow.swift @@ -2,14 +2,26 @@ import Adwaita import Foundation import LuminateCore -struct MediaRow: View { +public struct MediaRow: View { - var title: String - var items: [Components.Schemas.BaseItemDto] - @Binding var navigation: NavigationStack - var onSeeAll: (() -> Void)? + public var title: String + public var items: [Components.Schemas.BaseItemDto] + @Binding public var navigation: NavigationStack + public var onSeeAll: (() -> Void)? - var view: Body { + public init( + title: String, + items: [Components.Schemas.BaseItemDto], + navigation: Binding>, + onSeeAll: (() -> Void)? = nil + ) { + self.title = title + self.items = items + _navigation = navigation + self.onSeeAll = onSeeAll + } + + public var view: Body { VStack(spacing: 16) { HStack { Text(title) diff --git a/Sources/LuminateLibrary/MovieDetailView.swift b/Sources/LuminateUI/Components/MovieDetailView.swift similarity index 100% rename from Sources/LuminateLibrary/MovieDetailView.swift rename to Sources/LuminateUI/Components/MovieDetailView.swift diff --git a/Sources/LuminateLibrary/Components/PersonCell.swift b/Sources/LuminateUI/Components/PersonCell.swift similarity index 100% rename from Sources/LuminateLibrary/Components/PersonCell.swift rename to Sources/LuminateUI/Components/PersonCell.swift diff --git a/Sources/LuminateLibrary/PosterCell.swift b/Sources/LuminateUI/Components/PosterCell.swift similarity index 100% rename from Sources/LuminateLibrary/PosterCell.swift rename to Sources/LuminateUI/Components/PosterCell.swift diff --git a/Sources/LuminateLibrary/Components/RatingBadge.swift b/Sources/LuminateUI/Components/RatingBadge.swift similarity index 100% rename from Sources/LuminateLibrary/Components/RatingBadge.swift rename to Sources/LuminateUI/Components/RatingBadge.swift diff --git a/Sources/LuminateLibrary/SearchView.swift b/Sources/LuminateUI/Components/SearchView.swift similarity index 100% rename from Sources/LuminateLibrary/SearchView.swift rename to Sources/LuminateUI/Components/SearchView.swift diff --git a/Sources/LuminateLibrary/TVShowView.swift b/Sources/LuminateUI/Components/TVShowView.swift similarity index 100% rename from Sources/LuminateLibrary/TVShowView.swift rename to Sources/LuminateUI/Components/TVShowView.swift diff --git a/Sources/LuminateHome/AnyView+Overflow.swift b/Sources/LuminateUI/Utilities/AnyView+Overflow.swift similarity index 100% rename from Sources/LuminateHome/AnyView+Overflow.swift rename to Sources/LuminateUI/Utilities/AnyView+Overflow.swift diff --git a/Sources/LuminateUI/PageAnimationTracker.swift b/Sources/LuminateUI/Utilities/PageAnimationTracker.swift similarity index 100% rename from Sources/LuminateUI/PageAnimationTracker.swift rename to Sources/LuminateUI/Utilities/PageAnimationTracker.swift