diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 00000000..d88280b4 --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,6 @@ +# Palette's Journal - Critical Learnings + +## 2025-12-29 - [CLI UI Constraints] + +**Learning:** Visual verification of CLI output requires reliable build environments; when builds are fragile, rely on existing libraries like `Rainbow` for styling but double-check their availability in the target module. +**Action:** Always verify dependencies in `Package.swift` before adding imports, especially in environments where running the build is difficult. diff --git a/Sources/ExFig/Subcommands/checkForUpdate.swift b/Sources/ExFig/Subcommands/checkForUpdate.swift index 10a9fa34..0bb66851 100644 --- a/Sources/ExFig/Subcommands/checkForUpdate.swift +++ b/Sources/ExFig/Subcommands/checkForUpdate.swift @@ -2,6 +2,7 @@ import ArgumentParser import FigmaAPI import Foundation import Logging +import Rainbow func checkForUpdate(logger: Logger) async { let client = GitHubClient() @@ -12,13 +13,31 @@ func checkForUpdate(logger: Logger) async { let latestVersion = latestRelease.tagName if ExFigCommand.version != latestVersion { - logger.info(""" + if TTYDetector.colorsEnabled { + let border = "──────────────────────────────────────────────────────────────" - ---------------------------------------------------------------------------- - exfig \(latestVersion) is available. You are on \(ExFigCommand.version). - You should use the latest version. - To update, visit https://github.com/alexey1312/ExFig/releases - ---------------------------------------------------------------------------- - """) + let message = """ + + \("╭\(border)".cyan) + \("│".cyan) + \("│".cyan) \("🚀 Update Available: \(latestVersion)".bold.green) + \("│".cyan) Current version: \(ExFigCommand.version) + \("│".cyan) + \("│".cyan) To update, visit: + \("│".cyan) \("https://github.com/alexey1312/ExFig/releases".blue.underline) + \("│".cyan) + \("╰\(border)".cyan) + """ + logger.info(Logger.Message(stringLiteral: message)) + } else { + logger.info(""" + + ---------------------------------------------------------------------------- + exfig \(latestVersion) is available. You are on \(ExFigCommand.version). + You should use the latest version. + To update, visit https://github.com/alexey1312/ExFig/releases + ---------------------------------------------------------------------------- + """) + } } } diff --git a/mise.lock b/mise.lock index 7dbbf666..13429c24 100644 --- a/mise.lock +++ b/mise.lock @@ -81,6 +81,7 @@ backend = "core:python" [[tools.swift]] version = "6.2.3" backend = "core:swift" +"platforms.linux-x64" = { checksum = "blake3:0857a2267c52dc00ff1b59b93530a4316d3f99884744f4f75661fcbbea8a414b"} [[tools.swiftformat]] version = "0.58.7"