mirror of https://github.com/buresdv/Cork
~ More work
This commit is contained in:
parent
094caff1cb
commit
1ded3d13c1
|
|
@ -12,6 +12,7 @@ import SwiftUI
|
|||
import CorkShared
|
||||
import Defaults
|
||||
import DefaultsMacros
|
||||
import CorkModels
|
||||
|
||||
@Observable
|
||||
class AppDelegate: NSObject, NSApplicationDelegate
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import ButtonKit
|
|||
import CorkShared
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct ContentView: View, Sendable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import Defaults
|
|||
import SwiftData
|
||||
import SwiftUI
|
||||
import UserNotifications
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
@main
|
||||
struct CorkApp: App
|
||||
|
|
@ -716,7 +718,7 @@ struct CorkApp: App
|
|||
{
|
||||
Button
|
||||
{
|
||||
openWindow(id: .errorInspectorWindowID, value: PackageLoadingError.packageIsNotAFolder("Hello I am an error", packageURL: .applicationDirectory).localizedDescription)
|
||||
openWindow(id: .errorInspectorWindowID, value: BrewPackage.PackageLoadingError.packageIsNotAFolder("Hello I am an error", packageURL: .applicationDirectory).localizedDescription)
|
||||
} label: {
|
||||
Text("debug.action.show-error-inspector")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import CorkModels
|
||||
|
||||
enum NavigationTargetMainWindow: Hashable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import AppIntents
|
|||
import Foundation
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
import CorkIntents
|
||||
|
||||
public struct GetInstalledCasksIntent: AppIntent
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct BrewfileImportProgressView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import CorkShared
|
|||
import SwiftUI
|
||||
import ButtonKit
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct AddFormulaView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct SearchResultRow: View, Sendable
|
||||
{
|
||||
|
|
@ -130,7 +131,7 @@ struct SearchResultRow: View, Sendable
|
|||
|
||||
do
|
||||
{
|
||||
let parsedPackageInfo: BrewPackageDetails = try await searchedForPackage.loadDetails()
|
||||
let parsedPackageInfo: BrewPackage.BrewPackageDetails = try await searchedForPackage.loadDetails()
|
||||
|
||||
description = parsedPackageInfo.description
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct InstallationInitialView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct TopPackagesSection: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct InstallingPackageView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import CorkShared
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct PresentingSearchResultsView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct InstallationSearchingView: View, Sendable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
import CorkShared
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct AdoptingAlreadyInstalledCaskView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct AnotherProcessAlreadyRunningView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct BinaryAlreadyExistsView: View, Sendable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct InstallationFatalErrorView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import CorkNotifications
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct InstallationFinishedSuccessfullyView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct SudoRequiredView: View, Sendable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct WrongArchitectureView: View, Sendable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct LicensingView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct Licensing_BoughtView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct Licensing_DemoView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import SwiftUI
|
|||
import CorkShared
|
||||
import ButtonKit
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct Licensing_NotBoughtOrActivatedView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct Licensing_SelfCompiledView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
enum MaintenanceSteps
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct MaintenanceFinishedView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct MaintenanceRunningView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import CorkShared
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct MassAdoptionStage_Adopting: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
typealias AdoptionProcessResult = Result<BrewPackagesTracker.AdoptableApp, MassAppAdoptionView.AdoptionAttemptFailure>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct MenuBarItem: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkNotifications
|
||||
import CorkModels
|
||||
|
||||
struct MenuBar_CachedDownloadsCleanup: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct MenuBar_PackageOverview: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct MenuBar_PackageUpdating: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
import CorkShared
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
import ApplicationInspector
|
||||
|
||||
struct PackageDetailView: View, Sendable, DismissablePane
|
||||
{
|
||||
|
|
@ -39,7 +41,7 @@ struct PackageDetailView: View, Sendable, DismissablePane
|
|||
|
||||
var isInPreviewWindow: Bool = false
|
||||
|
||||
@State private var packageDetails: BrewPackageDetails? = nil
|
||||
@State private var packageDetails: BrewPackage.BrewPackageDetails? = nil
|
||||
|
||||
@State private var caskExecutable: Application? = nil
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct PackageDependencies: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct PackageDetailHeaderComplex: View
|
||||
{
|
||||
|
|
@ -22,7 +23,7 @@ struct PackageDetailHeaderComplex: View
|
|||
|
||||
var isInPreviewWindow: Bool
|
||||
|
||||
@Bindable var packageDetails: BrewPackageDetails
|
||||
@Bindable var packageDetails: BrewPackage.BrewPackageDetails
|
||||
|
||||
let isLoadingDetails: Bool
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import SwiftUI
|
|||
import CorkShared
|
||||
import ButtonKit
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct PackageModificationButtons: View
|
||||
{
|
||||
|
|
@ -21,7 +22,7 @@ struct PackageModificationButtons: View
|
|||
@Environment(OutdatedPackagesTracker.self) var outdatedPackagesTracker: OutdatedPackagesTracker
|
||||
|
||||
let package: BrewPackage
|
||||
@Bindable var packageDetails: BrewPackageDetails
|
||||
@Bindable var packageDetails: BrewPackage.BrewPackageDetails
|
||||
|
||||
let isLoadingDetails: Bool
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import ApplicationInspector
|
||||
import CorkModels
|
||||
|
||||
struct PackageSystemInfo: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct PackageListItem: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import ButtonKit
|
||||
import CorkModels
|
||||
|
||||
struct SudoRequiredForRemovalSheet: View, Sendable
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct CheckForOutdatedPackagesButton: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct DeleteCachedDownloadsButton: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct OpenMaintenanceSheetButton: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct UpdatePackageButton: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct HomebrewServicesView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import Foundation
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct BrewPane: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import Foundation
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct DiscoverabilityPane: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import CorkShared
|
|||
import Defaults
|
||||
import SwiftUI
|
||||
import UserNotifications
|
||||
import CorkModels
|
||||
|
||||
struct NotificationsPane: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct CasksSection: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct FormulaeSection: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct SidebarContextMenu: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct SidebarPackageRow: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import ButtonKit
|
||||
import CorkModels
|
||||
|
||||
struct TapsSection: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkShared
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct SidebarView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import CorkShared
|
||||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct StartPage: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import Defaults
|
|||
import SwiftUI
|
||||
import ButtonKit
|
||||
import SwiftData
|
||||
import CorkModels
|
||||
|
||||
struct AdoptablePackagesSection: View
|
||||
{
|
||||
|
|
@ -20,7 +21,7 @@ struct AdoptablePackagesSection: View
|
|||
|
||||
@State private var isShowingAdoptionWarning: Bool = false
|
||||
|
||||
@Query private var excludedApps: [BrewPackagesTracker.ExcludedAdoptableApp]
|
||||
@Query private var excludedApps: [ExcludedAdoptableApp]
|
||||
|
||||
var body: some View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct BrokenPackageListRow: View
|
||||
{
|
||||
|
|
@ -14,7 +15,7 @@ struct BrokenPackageListRow: View
|
|||
|
||||
@Environment(AppState.self) var appState: AppState
|
||||
|
||||
let error: PackageLoadingError
|
||||
let error: BrewPackage.PackageLoadingError
|
||||
|
||||
var body: some View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import Charts
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct CachedDownloadsFolderInfoBox: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct LoadingErrorsBox: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct OutdatedPackagesBox: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct LoadingOfOutdatedPackagesFailedListBox: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import Defaults
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct OutdatedPackageListBox: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import CorkShared
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct OutdatedPackageLoaderBox: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
enum TapAddingStates
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct AddTapAddingView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct AddTapFinishedView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct TapDetailsIncludedPackages: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct PackagesIncludedInTapList: View
|
||||
{
|
||||
@Environment(\.selectedTap) var selectedTap: BrewTap?
|
||||
|
||||
@Environment(BrewPackagesTracker.self) var brewPackagesTracker
|
||||
@Environment(BrewPackagesTracker.self) var brewPackagesTracker: BrewPackagesTracker
|
||||
|
||||
let packages: [MinimalHomebrewPackage]
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct TapDetailsInfo: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct TapDetailsTitle: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import ButtonKit
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
extension EnvironmentValues
|
||||
{
|
||||
|
|
@ -109,7 +111,15 @@ struct TapDetailView: View, Sendable
|
|||
|
||||
do
|
||||
{
|
||||
tapInfo = try await parseTapInfo(from: tapInfoRaw)
|
||||
guard let tapInfoAsData = await tapInfoRaw.data(using: .utf8) else
|
||||
{
|
||||
errorOutReason = "Failed to convert String to Data"
|
||||
erroredOut = true
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
tapInfo = try await .init(from: tapInfoAsData)
|
||||
}
|
||||
catch let parsingError
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import CorkNotifications
|
|||
import CorkShared
|
||||
import Defaults
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct ErroredOutStageView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
|
||||
struct CheckingForUpdatesStateView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import SwiftUI
|
||||
import CorkShared
|
||||
import Defaults
|
||||
import CorkModels
|
||||
|
||||
struct UpdatingPackageTrackerStateView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
|
||||
import SwiftUI
|
||||
import CorkModels
|
||||
|
||||
struct UpdatingPackagesStateView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
import SwiftUI
|
||||
import CorkShared
|
||||
import CorkModels
|
||||
import CorkTerminalFunctions
|
||||
|
||||
struct UpdateSomePackagesView: View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public enum ConfirmationDialog: Identifiable, Equatable
|
|||
}
|
||||
}
|
||||
|
||||
var message: LocalizedStringKey
|
||||
public var message: LocalizedStringKey
|
||||
{
|
||||
switch self
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
enum IntentError: LocalizedError
|
||||
public enum IntentError: LocalizedError
|
||||
{
|
||||
case failedWhilePerformingIntent
|
||||
|
||||
var errorDescription: String?
|
||||
public var errorDescription: String?
|
||||
{
|
||||
switch self
|
||||
{
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ extension BrewPackage
|
|||
|
||||
/// Load package details
|
||||
@MainActor
|
||||
func loadDetails() async throws -> BrewPackage.BrewPackageDetails
|
||||
public func loadDetails() async throws -> BrewPackage.BrewPackageDetails
|
||||
{
|
||||
let decoder: JSONDecoder = {
|
||||
let decoder: JSONDecoder = .init()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import CorkTerminalFunctions
|
|||
public typealias BrewPackages = Set<Result<BrewPackage, BrewPackage.PackageLoadingError>>
|
||||
|
||||
/// A representation of a Homebrew package
|
||||
public struct BrewPackage: Identifiable, Equatable, Hashable, Codable, Sendable
|
||||
public struct BrewPackage: Identifiable, Equatable, Hashable, Codable, Sendable, Modifiable
|
||||
{
|
||||
public init(
|
||||
name: String,
|
||||
|
|
@ -68,9 +68,9 @@ public struct BrewPackage: Identifiable, Equatable, Hashable, Codable, Sendable
|
|||
/// Download count for top packages
|
||||
public let downloadCount: Int?
|
||||
|
||||
var isBeingModified: Bool = false
|
||||
public var isBeingModified: Bool = false
|
||||
|
||||
func getFormattedVersions() -> String
|
||||
public func getFormattedVersions() -> String
|
||||
{
|
||||
return versions.formatted(.list(type: .and))
|
||||
}
|
||||
|
|
@ -393,7 +393,7 @@ extension BrewPackage
|
|||
}
|
||||
}
|
||||
|
||||
extension FormatStyle where Self == Date.FormatStyle
|
||||
public extension FormatStyle where Self == Date.FormatStyle
|
||||
{
|
||||
static var packageInstallationStyle: Self
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,12 +9,21 @@ import Foundation
|
|||
|
||||
public struct BrewTap: Identifiable, Hashable, Sendable
|
||||
{
|
||||
public let id: UUID = .init()
|
||||
let name: String
|
||||
public init(
|
||||
name: String,
|
||||
isBeingModified: Bool? = nil
|
||||
) {
|
||||
self.id = .init()
|
||||
self.name = name
|
||||
self.isBeingModified = isBeingModified ?? false
|
||||
}
|
||||
|
||||
var isBeingModified: Bool = false
|
||||
public let id: UUID
|
||||
public let name: String
|
||||
|
||||
mutating func changeBeingModifiedStatus()
|
||||
public var isBeingModified: Bool
|
||||
|
||||
public mutating func changeBeingModifiedStatus()
|
||||
{
|
||||
isBeingModified.toggle()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import Foundation
|
||||
import CorkShared
|
||||
|
||||
extension CachedDownloadsTracker
|
||||
public extension CachedDownloadsTracker
|
||||
{
|
||||
func assignPackageTypeToCachedDownloads(brewPackagesTracker: BrewPackagesTracker)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,6 +9,12 @@ import Foundation
|
|||
|
||||
public struct CorruptedPackage: Identifiable, Equatable
|
||||
{
|
||||
public let id: UUID = .init()
|
||||
let name: String
|
||||
public let id: UUID
|
||||
public let name: String
|
||||
|
||||
public init(name: String)
|
||||
{
|
||||
self.id = .init()
|
||||
self.name = name
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,14 @@ public class OutdatedPackagesTracker
|
|||
case checkingForUpdates, showingOutdatedPackages, noUpdatesAvailable, erroredOut(reason: String)
|
||||
}
|
||||
|
||||
public var isCheckingForPackageUpdates: Bool = true
|
||||
public init() {
|
||||
self.isCheckingForPackageUpdates = true
|
||||
self.outdatedPackages = .init()
|
||||
}
|
||||
|
||||
public var outdatedPackages: Set<OutdatedPackage> = .init()
|
||||
public var isCheckingForPackageUpdates: Bool
|
||||
|
||||
public var outdatedPackages: Set<OutdatedPackage>
|
||||
|
||||
public var errorOutReason: String?
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import CorkModels
|
||||
|
||||
/// Decodable tap info
|
||||
public struct TapInfo: Codable
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
//
|
||||
// Modifiable.swift
|
||||
// CorkModels
|
||||
//
|
||||
// Created by David Bureš - P on 10.11.2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Defines a model that can be modified, and reflect the status of the modification in the UI
|
||||
public protocol Modifiable: Sendable
|
||||
{
|
||||
var isBeingModified: Bool { get set }
|
||||
}
|
||||
|
|
@ -12,6 +12,12 @@ import CorkShared
|
|||
@Observable @MainActor
|
||||
public class CachedDownloadsTracker
|
||||
{
|
||||
public init()
|
||||
{
|
||||
self.cachedDownloads = .init()
|
||||
self.cachedDownloadsTemp = .init()
|
||||
}
|
||||
|
||||
public var cachedDownloads: [CachedDownload] = .init()
|
||||
|
||||
private var cachedDownloadsTemp: [CachedDownload] = .init()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ import Observation
|
|||
@Observable @MainActor
|
||||
public class TapTracker
|
||||
{
|
||||
var addedTaps: [BrewTap] = .init()
|
||||
public init()
|
||||
{
|
||||
self.addedTaps = .init()
|
||||
}
|
||||
|
||||
public var addedTaps: [BrewTap]
|
||||
}
|
||||
|
||||
public extension TapTracker
|
||||
|
|
|
|||
Loading…
Reference in New Issue