From cf1d528509f90d558ab2480a30e0cb29089fbf40 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 13:14:54 +0000 Subject: [PATCH] Fix analyzer errors that fail the TUI.Cli release publish The RID publish of TUI.Cli failed on 16 analyzer errors in SampleCLI.cs that the regular build does not surface: - IDE0008: explicit types instead of var (lines 22, 25, 28, 41, 49, 64, 76) - IDE0065: usings moved inside the file-scoped namespace (lines 3-7), matching TUI.App - IDE0055: over-indented BorderStyle initializer (line 79) - CA2007: ConfigureAwait(false) on app.RunAsync(), as TUI.App does (33,9) - CA1859: CreateDemoUI returns StackPanel rather than IUIElement (38,28); the now-unused Contracts using is dropped - KTSU0002: AssemblyInfo.cs exposing internals to ktsu.TUI.Test, the same form TUI.App uses Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01RTMFFSY8FY5CpAhf6ikNH1 --- TUI.Cli/AssemblyInfo.cs | 3 +++ TUI.Cli/SampleCLI.cs | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 TUI.Cli/AssemblyInfo.cs diff --git a/TUI.Cli/AssemblyInfo.cs b/TUI.Cli/AssemblyInfo.cs new file mode 100644 index 0000000..d771f7e --- /dev/null +++ b/TUI.Cli/AssemblyInfo.cs @@ -0,0 +1,3 @@ +// Copyright (c) 2023-2026 ktsu-dev contributors + +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ktsu.TUI.Test")] diff --git a/TUI.Cli/SampleCLI.cs b/TUI.Cli/SampleCLI.cs index 3d44e99..a7a5613 100644 --- a/TUI.Cli/SampleCLI.cs +++ b/TUI.Cli/SampleCLI.cs @@ -1,13 +1,12 @@ // Copyright (c) 2023-2026 ktsu-dev contributors -using ktsu.TUI.Core.Contracts; +namespace ktsu.TUI.Cli; + using ktsu.TUI.Core.Elements.Layouts; using ktsu.TUI.Core.Elements.Primitives; using ktsu.TUI.Core.Models; using ktsu.TUI.Core.Services; -namespace ktsu.TUI.Cli; - /// /// A sample CLI application demonstrating the TUI library /// @@ -19,26 +18,26 @@ public static class SampleCLI public static async Task Main() { // Create console provider - var consoleProvider = new SpectreConsoleProvider(); + SpectreConsoleProvider consoleProvider = new(); // Create application - var app = new UIApplication(consoleProvider); + UIApplication app = new(consoleProvider); // Create a demo UI - var rootPanel = CreateDemoUI(); + StackPanel rootPanel = CreateDemoUI(); app.Setup(rootPanel); // Run the application Console.WriteLine("Starting TUI CLI Demo. Press ESC to exit."); - await app.RunAsync(); + await app.RunAsync().ConfigureAwait(false); Console.WriteLine("TUI CLI Demo finished."); } - private static IUIElement CreateDemoUI() + private static StackPanel CreateDemoUI() { // Create main container - var mainPanel = new StackPanel + StackPanel mainPanel = new() { Orientation = Orientation.Vertical, Spacing = 1, @@ -46,7 +45,7 @@ private static IUIElement CreateDemoUI() }; // Add title - var title = new BorderElement + BorderElement title = new() { Title = "TUI Library CLI Demo", TitleAlignment = HorizontalAlignment.Center, @@ -61,7 +60,7 @@ private static IUIElement CreateDemoUI() }; // Add description - var description = new TextElement + TextElement description = new() { Text = "This demonstrates the TUI library's capabilities:\n" + "• Text rendering with styling\n" + @@ -73,10 +72,10 @@ private static IUIElement CreateDemoUI() }; // Add instructions - var instructions = new BorderElement + BorderElement instructions = new() { Title = "Instructions", - BorderStyle = BorderStyle.SingleLine, + BorderStyle = BorderStyle.SingleLine, Child = new TextElement { Text = "Press ESC to exit the application",