1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-12-21 11:10:08 +01:00

📦 Upgrade packages to v2.0

This commit is contained in:
2025-11-27 13:46:57 +01:00
parent 11aff48625
commit 1dc54977f0
20 changed files with 82 additions and 60 deletions

View File

@@ -11,6 +11,9 @@
0310B17A2EB8F3FF00A8B140 /* CrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 0310B1792EB8F3FF00A8B140 /* CrashReporter */; };
0310B17C2EB8F40100A8B140 /* CrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 0310B17B2EB8F40100A8B140 /* CrashReporter */; };
0310B17E2EB8F40400A8B140 /* CrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 0310B17D2EB8F40400A8B140 /* CrashReporter */; };
0317C17E2ED87CAB005479D2 /* NVAppUpdater in Frameworks */ = {isa = PBXBuildFile; productRef = 0317C17D2ED87CAB005479D2 /* NVAppUpdater */; };
0317C1812ED87CE1005479D2 /* NVAppUpdater in Frameworks */ = {isa = PBXBuildFile; productRef = 0317C1802ED87CE1005479D2 /* NVAppUpdater */; };
0317C1832ED87CEA005479D2 /* NVAppUpdater in Frameworks */ = {isa = PBXBuildFile; productRef = 0317C1822ED87CEA005479D2 /* NVAppUpdater */; };
031E2B692B1525A7007C29E1 /* BrewPhpExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031E2B682B1525A7007C29E1 /* BrewPhpExtension.swift */; };
031E2B6A2B1525A7007C29E1 /* BrewPhpExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031E2B682B1525A7007C29E1 /* BrewPhpExtension.swift */; };
031E2B6B2B1525A7007C29E1 /* BrewPhpExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031E2B682B1525A7007C29E1 /* BrewPhpExtension.swift */; };
@@ -427,7 +430,6 @@
C46FA9882822EFDC00D78807 /* PhpConfigurationFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA9872822EFDC00D78807 /* PhpConfigurationFile.swift */; };
C46FA9892822EFDC00D78807 /* PhpConfigurationFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA9872822EFDC00D78807 /* PhpConfigurationFile.swift */; };
C46FA98C2822F08F00D78807 /* PhpConfigurationFileTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA98A2822F08F00D78807 /* PhpConfigurationFileTest.swift */; };
C47014FC2C46D31B0069AAE7 /* NVAppUpdater in Frameworks */ = {isa = PBXBuildFile; productRef = C47014FB2C46D31B0069AAE7 /* NVAppUpdater */; };
C47014FF2C46D57C0069AAE7 /* NVAlert in Frameworks */ = {isa = PBXBuildFile; productRef = C47014FE2C46D57C0069AAE7 /* NVAlert */; };
C47015022C46D6910069AAE7 /* NVAlertExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47015012C46D6910069AAE7 /* NVAlertExtension.swift */; };
C47015032C46D7F00069AAE7 /* NVAlertExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47015012C46D6910069AAE7 /* NVAlertExtension.swift */; };
@@ -1345,7 +1347,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C47014FC2C46D31B0069AAE7 /* NVAppUpdater in Frameworks */,
0317C1832ED87CEA005479D2 /* NVAppUpdater in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1354,6 +1356,8 @@
buildActionMask = 2147483647;
files = (
C47014FF2C46D57C0069AAE7 /* NVAlert in Frameworks */,
0317C17E2ED87CAB005479D2 /* NVAppUpdater in Frameworks */,
0317C1812ED87CE1005479D2 /* NVAppUpdater in Frameworks */,
03D8462B2EB6418F006EFE3C /* CrashReporter in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -2489,7 +2493,7 @@
);
name = "PHP Monitor Self-Updater";
packageProductDependencies = (
C47014FB2C46D31B0069AAE7 /* NVAppUpdater */,
0317C1822ED87CEA005479D2 /* NVAppUpdater */,
);
productName = "PHP Monitor Updater";
productReference = C406A5F0298AD2CE00B5B85A /* PHP Monitor Self-Updater.app */;
@@ -2513,6 +2517,8 @@
packageProductDependencies = (
C47014FE2C46D57C0069AAE7 /* NVAlert */,
03D8462A2EB6418F006EFE3C /* CrashReporter */,
0317C17D2ED87CAB005479D2 /* NVAppUpdater */,
0317C1802ED87CE1005479D2 /* NVAppUpdater */,
);
productName = phpmon;
productReference = C41C1B3322B0097F00E7CF16 /* PHP Monitor.app */;
@@ -2637,9 +2643,9 @@
);
mainGroup = C41C1B2A22B0097F00E7CF16;
packageReferences = (
C47014FA2C46D31B0069AAE7 /* XCRemoteSwiftPackageReference "NVAppUpdater" */,
C47014FD2C46D57C0069AAE7 /* XCRemoteSwiftPackageReference "NVAlert" */,
03D846292EB6418F006EFE3C /* XCRemoteSwiftPackageReference "plcrashreporter" */,
0317C17F2ED87CE1005479D2 /* XCRemoteSwiftPackageReference "NVAppUpdater" */,
);
productRefGroup = C41C1B3422B0097F00E7CF16 /* Products */;
projectDirPath = "";
@@ -4639,6 +4645,14 @@
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
0317C17F2ED87CE1005479D2 /* XCRemoteSwiftPackageReference "NVAppUpdater" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nicoverbruggen/NVAppUpdater";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 2.0.0;
};
};
03D846292EB6418F006EFE3C /* XCRemoteSwiftPackageReference "plcrashreporter" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/microsoft/plcrashreporter.git";
@@ -4647,20 +4661,12 @@
minimumVersion = 1.12.0;
};
};
C47014FA2C46D31B0069AAE7 /* XCRemoteSwiftPackageReference "NVAppUpdater" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nicoverbruggen/NVAppUpdater";
requirement = {
branch = main;
kind = branch;
};
};
C47014FD2C46D57C0069AAE7 /* XCRemoteSwiftPackageReference "NVAlert" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nicoverbruggen/NVAlert";
requirement = {
kind = exactVersion;
version = 1.1.0;
kind = upToNextMajorVersion;
minimumVersion = 2.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
@@ -4681,16 +4687,25 @@
package = 03D846292EB6418F006EFE3C /* XCRemoteSwiftPackageReference "plcrashreporter" */;
productName = CrashReporter;
};
0317C17D2ED87CAB005479D2 /* NVAppUpdater */ = {
isa = XCSwiftPackageProductDependency;
productName = NVAppUpdater;
};
0317C1802ED87CE1005479D2 /* NVAppUpdater */ = {
isa = XCSwiftPackageProductDependency;
package = 0317C17F2ED87CE1005479D2 /* XCRemoteSwiftPackageReference "NVAppUpdater" */;
productName = NVAppUpdater;
};
0317C1822ED87CEA005479D2 /* NVAppUpdater */ = {
isa = XCSwiftPackageProductDependency;
package = 0317C17F2ED87CE1005479D2 /* XCRemoteSwiftPackageReference "NVAppUpdater" */;
productName = NVAppUpdater;
};
03D8462A2EB6418F006EFE3C /* CrashReporter */ = {
isa = XCSwiftPackageProductDependency;
package = 03D846292EB6418F006EFE3C /* XCRemoteSwiftPackageReference "plcrashreporter" */;
productName = CrashReporter;
};
C47014FB2C46D31B0069AAE7 /* NVAppUpdater */ = {
isa = XCSwiftPackageProductDependency;
package = C47014FA2C46D31B0069AAE7 /* XCRemoteSwiftPackageReference "NVAppUpdater" */;
productName = NVAppUpdater;
};
C47014FE2C46D57C0069AAE7 /* NVAlert */ = {
isa = XCSwiftPackageProductDependency;
package = C47014FD2C46D57C0069AAE7 /* XCRemoteSwiftPackageReference "NVAlert" */;

View File

@@ -18,6 +18,6 @@ extension NVAlert {
return NVAlert().withInformation(
title: "\(key).title".localized,
subtitle: "\(key).description".localized
).withPrimary(text: "generic.ok".localized).show()
).withPrimary(text: "generic.ok".localized).show(urgency: .bringToFront)
}
}

View File

@@ -10,12 +10,19 @@ import Foundation
import Cocoa
import NVAlert
/**
The potential different outcomes of a check for updates.
*/
enum UpdateCheckResult {
case success
case networkError
case parseError
}
/**
Instead of using `UpdateCheck` which is a more simplified update checking process
included in `NVAppUpdater`, we have a slightly more complex setup here.
*/
class AppUpdater {
var caskFile: CaskFile!
var latestVersionOnline: AppVersion!
@@ -100,7 +107,7 @@ class AppUpdater {
.withTertiary(text: "updater.alerts.buttons.dismiss".localized, action: { vc in
vc.close(with: .OK)
})
.show()
.show(urgency: interactive ? .bringToFront : .urgentRequestAttention)
}
@MainActor public func presentNoNewerVersionAvailableAlert() {
@@ -110,7 +117,7 @@ class AppUpdater {
description: ""
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: interactive ? .bringToFront : .none)
}
@MainActor public func presentCouldNotRetrieveUpdate() {
@@ -128,7 +135,7 @@ class AppUpdater {
}
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: interactive ? .bringToFront : .normalRequestAttention)
}
// MARK: - Preparing for Self-Updater

View File

@@ -68,7 +68,7 @@ class CrashReporter {
})
.withPrimary(text: "crash_reporter.send_report".localized, action: { alert in
alert.close(with: .OK)
}).runModal()
}).runModal(urgency: .urgentRequestAttention)
// Check the outcome of what the user chose
if response == .abort {

View File

@@ -91,7 +91,7 @@ class ValetServicesManager: ServicesManager {
description: "alert.service_error.extra".localized
)
.withPrimary(text: "alert.service_error.button.close".localized)
.show()
.show(urgency: .bringToFront)
}
// If we do have a path to a log file, show a more complex alert w/ Show Log button
@@ -112,6 +112,6 @@ class ValetServicesManager: ServicesManager {
alert.close(with: .OK)
})
.show()
.show(urgency: .bringToFront)
}
}

View File

@@ -171,7 +171,7 @@ extension Startup {
vc.close(with: .alertSecondButtonReturn)
exit(1)
})
.show()
.show(urgency: .bringToFront)
await self.check()
}

View File

@@ -69,6 +69,6 @@ extension Startup {
.withTertiary(text: "", action: { _ in
NSWorkspace.shared.open(URL(string: "https://github.com/nicoverbruggen/phpmon/issues/294")!)
})
.show()
.show(urgency: .urgentRequestAttention)
}
}

View File

@@ -74,7 +74,7 @@ class Startup {
)
.withPrimary(text: check.buttonText, action: { _ in
exit(1)
}).show()
}).show(urgency: .bringToFront)
}
NVAlert()
@@ -84,7 +84,7 @@ class Startup {
description: check.descriptionText
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
// MARK: - Check (List)

View File

@@ -137,7 +137,7 @@ import NVAlert
description: "alert.composer_missing.desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
deinit {

View File

@@ -81,7 +81,7 @@ class ValetUpgrader {
.withPrimary(text: "generic.ok".localized, action: { vc in
vc.close(with: .OK)
})
.show()
.show(urgency: .bringToFront)
}
@MainActor private static func notifyAboutUpgrade(latest: String, constraint: String, passing: Bool) {
@@ -104,6 +104,6 @@ class ValetUpgrader {
})
}
alert.show()
alert.show(urgency: .bringToFront)
}
}

View File

@@ -27,7 +27,7 @@ extension Valet {
Preferences.update(.warnAboutNonStandardTLD, value: false)
alert.close(with: .alertThirdButtonReturn)
})
.show()
.show(urgency: .urgentRequestAttention)
}
}
}
@@ -43,7 +43,7 @@ extension Valet {
)
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .urgentRequestAttention)
}
}
@@ -68,7 +68,7 @@ extension Valet {
description: "alert.php_fpm_broken.description".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .urgentRequestAttention)
}
}

View File

@@ -27,7 +27,7 @@ extension MainMenu {
description: "phpman.unlinked.detail".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
}
@@ -40,7 +40,7 @@ extension MainMenu {
)
.withPrimary(text: "alert.fix_homebrew_permissions.ok".localized)
.withSecondary(text: "alert.fix_homebrew_permissions.cancel".localized)
.didSelectPrimary() {
.didSelectPrimary(urgency: .bringToFront) {
return
}
@@ -54,7 +54,7 @@ extension MainMenu {
description: "alert.fix_homebrew_permissions_done.desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .urgentRequestAttention)
} failure: { error in
NVAlert.show(for: error as! HomebrewPermissionError)
}
@@ -186,7 +186,7 @@ extension MainMenu {
self.performRollback()
})
.withSecondary(text: "alert.revert_description.cancel".localized)
.show()
.show(urgency: .bringToFront)
}
@objc func togglePreset(sender: PresetMenuItem) {
@@ -206,7 +206,7 @@ extension MainMenu {
NSWorkspace.shared.open(Constants.Urls.FrequentlyAskedQuestions)
alert.close(with: .OK)
})
.show()
.show(urgency: .bringToFront)
}
@objc func openPhpInfo() {
@@ -262,13 +262,13 @@ extension MainMenu {
if container.phpEnvs.availablePhpVersions.contains(version) {
Task { MainMenu.shared.switchToPhpVersion(version) }
} else {
Task {
Task { @MainActor in
NVAlert().withInformation(
title: "alert.php_switch_unavailable.title".localized,
subtitle: "alert.php_switch_unavailable.subtitle".localized(version)
).withPrimary(
text: "alert.php_switch_unavailable.ok".localized
).show()
).show(urgency: .bringToFront)
}
}
}

View File

@@ -31,7 +31,7 @@ extension MainMenu {
)
.withPrimary(text: "alert.fix_my_valet.ok".localized)
.withSecondary(text: "alert.fix_my_valet.cancel".localized)
.didSelectPrimary() {
.didSelectPrimary(urgency: .bringToFront) {
Log.info("The user has chosen to abort Fix My Valet")
return
}
@@ -54,7 +54,7 @@ extension MainMenu {
subtitle: "alert.php_formula_missing.info".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
@MainActor private func presentAlertForSameVersion() {
@@ -65,7 +65,7 @@ extension MainMenu {
description: "alert.fix_my_valet_done.desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .normalRequestAttention)
}
@MainActor private func presentAlertForDifferentVersion(version: String) {
@@ -87,7 +87,7 @@ extension MainMenu {
.withTertiary(text: "", action: { _ in
NSWorkspace.shared.open(Constants.Urls.FrequentlyAskedQuestions)
})
.show()
.show(urgency: .urgentRequestAttention)
}
}

View File

@@ -84,7 +84,7 @@ extension MainMenu {
)
.withPrimary(text: "alert.php_switch_failed.confirm".localized)
.withSecondary(text: "alert.php_switch_failed.cancel".localized)
.didSelectPrimary()
.didSelectPrimary(urgency: .bringToFront)
if outcome {
MainMenu.shared.fixMyValet()
}
@@ -113,7 +113,7 @@ extension MainMenu {
alert.close(with: .OK)
self.terminateApp()
})
.show()
.show(urgency: .urgentRequestAttention)
}
private func reloadDomainListData() async {

View File

@@ -140,7 +140,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
description: "startup.unsupported_versions_explanation.desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
}
@@ -206,7 +206,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate
description: "lite_mode_explanation.description".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
}

View File

@@ -69,7 +69,7 @@ class PhpGuard {
Stats.persistCurrentGlobalPhpVersion(version: currentVersion)
alert.close(with: .OK)
})
.show()
.show(urgency: .normalRequestAttention)
}
}
}

View File

@@ -135,7 +135,7 @@ class Stats {
.withTertiary(text: "", action: { vc in
vc.close(with: .alertThirdButtonReturn)
NSWorkspace.shared.open(Constants.Urls.DonationPage)
}).didSelectPrimary()
}).didSelectPrimary(urgency: .normalRequestAttention)
if donate {
Log.info("The user is an absolute badass for choosing this option. Thank you.")

View File

@@ -153,7 +153,7 @@ struct Preset: Codable, Equatable {
)
).withPrimary(
text: "alert.php_switch_unavailable.ok".localized
).show()
).show(urgency: .urgentRequestAttention)
}
return false
}

View File

@@ -89,7 +89,7 @@ struct ServicesView: View {
description: "alert.\(type).desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
}
}
@@ -131,7 +131,7 @@ struct ServiceView: View {
description: "alert.warnings.service_missing.description".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
} label: {
Text("?")

View File

@@ -23,7 +23,7 @@ extension DomainListVC {
subtitle: "domain_list.alert.invalid_folder_name_desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
return
}
@@ -292,7 +292,7 @@ extension DomainListVC {
description: "domain_list.alerts_isolated_php_terminal.desc".localized
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
private func notifyAboutFailedSecureStatus(command: String) {
@@ -302,7 +302,7 @@ extension DomainListVC {
subtitle: "domain_list.alerts_status_not_changed.desc".localized(command)
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
private func notifyAboutFailedSiteIsolation(command: String) {
@@ -313,6 +313,6 @@ extension DomainListVC {
description: "domain_list.alerts_isolation_failed.desc".localized(command)
)
.withPrimary(text: "generic.ok".localized)
.show()
.show(urgency: .bringToFront)
}
}