diff --git a/.github/assets/github-banner.png b/.github/assets/github-banner.png new file mode 100644 index 0000000..2f61255 Binary files /dev/null and b/.github/assets/github-banner.png differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94b30e5..4989604 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: run: | swift package --allow-writing-to-directory docs-output \ generate-documentation \ - --target TUIKit \ + --target TUIkit \ --output-path docs-output \ --transform-for-static-hosting @@ -117,7 +117,7 @@ jobs: - Redirecting to TUIKit Documentation... + Redirecting to TUIkit Documentation... HTMLEOF diff --git a/.swiftlint.yml b/.swiftlint.yml index 3e42586..9436ad4 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,4 +1,4 @@ -# SwiftLint Configuration for TUIKit +# SwiftLint Configuration for TUIkit # Only lint project sources (not build artifacts or dependencies) included: diff --git a/LANDING_PAGE_ASSETS.md b/LANDING_PAGE_ASSETS.md index 07a3147..72dd97b 100644 --- a/LANDING_PAGE_ASSETS.md +++ b/LANDING_PAGE_ASSETS.md @@ -17,23 +17,23 @@ - **Aspect Ratio**: 16:9 (landscape) - **Recommended Size**: 1000×560px or larger (up to 2000px width for retina) - **Format**: PNG, JPG, or WebP (lossless recommended) -- **Content**: Screenshot/demo of TUIKit in action +- **Content**: Screenshot/demo of TUIkit in action - Terminal UI showing an interactive application - - Nice visualization of TUIKit components + - Nice visualization of TUIkit components - Colors: Green (#10b981), dark background (#030712) - Examples: Menu selection, modal dialogs, text input, etc. **HTML Location**: `docs/index.html` - Line ~555-591 ```html
- + ...
``` **Placeholder Preview**: - Terminal window with green border -- Shows TUIKit menu example +- Shows TUIkit menu example - Command: `$ swift run MyApp` - Interactive menu selection @@ -48,8 +48,8 @@ - **Aspect Ratio**: 16:9 or Square (1:1) - **Recommended Size**: 600×400px (or 600×600px) - **Format**: PNG, JPG, or WebP -- **Content**: Professional screenshot of TUIKit features - - Shows real TUIKit app with actual components +- **Content**: Professional screenshot of TUIkit features + - Shows real TUIkit app with actual components - Terminal UI showcase with multiple features - Examples of: Menu, Button, Text, Panel, Dialog, etc. - Color scheme: Green theme with different appearance styles @@ -59,13 +59,13 @@ **HTML Location**: `docs/index.html` - Line ~641-685 ```html
- + ...
``` **Placeholder Preview**: -- Advanced TUIKit Demo terminal window +- Advanced TUIkit Demo terminal window - Two feature boxes: "Theme: Green Phosphor" + "Components" - Live example: Interactive menu with selection @@ -157,7 +157,7 @@ Find this in `docs/index.html` around line 554: Replace with: ```html
- TUIKit Demo Application + TUIkit Demo Application
``` @@ -172,7 +172,7 @@ Find this in `docs/index.html` around line 641: Replace with: ```html
- Advanced TUIKit Features + Advanced TUIkit Features
``` @@ -193,7 +193,7 @@ With: All current images are high-quality SVG placeholders that: - ✅ Match the dark theme and color scheme -- ✅ Show relevant TUIKit UI examples +- ✅ Show relevant TUIkit UI examples - ✅ Are vector-based (scale perfectly) - ✅ Look professional on their own - ✅ Are easy to replace diff --git a/Package.swift b/Package.swift index 6d13387..91b3584 100644 --- a/Package.swift +++ b/Package.swift @@ -14,7 +14,7 @@ let swiftLintPlugin: [Target.PluginUsage] = enableSwiftLint : [] let package = Package( - name: "TUIKit", + name: "TUIkit", // Minimum deployment targets for Apple platforms // Linux is automatically supported (no platform specification needed) platforms: [ @@ -22,12 +22,12 @@ let package = Package( ], products: [ .library( - name: "TUIKit", - targets: ["TUIKit"] + name: "TUIkit", + targets: ["TUIkit"] ), .executable( - name: "TUIKitExample", - targets: ["TUIKitExample"] + name: "TUIkitExample", + targets: ["TUIkitExample"] ), ], dependencies: [ @@ -36,17 +36,17 @@ let package = Package( ], targets: [ .target( - name: "TUIKit", + name: "TUIkit", plugins: swiftLintPlugin ), .executableTarget( - name: "TUIKitExample", - dependencies: ["TUIKit"], + name: "TUIkitExample", + dependencies: ["TUIkit"], plugins: swiftLintPlugin ), .testTarget( - name: "TUIKitTests", - dependencies: ["TUIKit"] + name: "TUIkitTests", + dependencies: ["TUIkit"] ), ] ) diff --git a/README.md b/README.md index 239e804..d76f27f 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,21 @@ -[![CI](https://github.com/phranck/TUIKit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/phranck/TUIKit/actions/workflows/ci.yml) +[![CI](https://github.com/phranck/TUIkit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/phranck/TUIkit/actions/workflows/ci.yml) ![Tests](https://img.shields.io/badge/Tests-181_passing-brightgreen) ![Swift 6.0](https://img.shields.io/badge/Swift-6.0-F05138?logo=swift&logoColor=white) -![macOS](https://img.shields.io/badge/Platform-macOS-000000?logo=apple&logoColor=white) -![Linux](https://img.shields.io/badge/Platform-Linux-FCC624?logo=linux&logoColor=black) +![Platforms](https://img.shields.io/badge/Platforms-macOS%20%7C%20Linux-blue) ![License](https://img.shields.io/badge/License-CC--BY--NC--SA%204.0-lightgrey?style=flat) -![Spotnik - Terminal based Sptoify Player](.github/assets/spotnik_1.png) +![TUIkit Banner](.github/assets/github-banner.png) -# TUIKit +# TUIkit A SwiftUI-like framework for building Terminal User Interfaces in Swift — no ncurses, no C dependencies, just pure Swift. ## What is this? -TUIKit lets you build TUI apps using the same declarative syntax you already know from SwiftUI. Define your UI with `View`, compose views with `VStack`, `HStack`, and `ZStack`, style text with modifiers like `.bold()` and `.foregroundColor(.red)`, and run it all in your terminal. +TUIkit lets you build TUI apps using the same declarative syntax you already know from SwiftUI. Define your UI with `View`, compose views with `VStack`, `HStack`, and `ZStack`, style text with modifiers like `.bold()` and `.foregroundColor(.red)`, and run it all in your terminal. ```swift -import TUIKit +import TUIkit @main struct MyApp: App { @@ -32,7 +31,7 @@ struct ContentView: View { var body: some View { VStack(spacing: 1) { - Text("Hello, TUIKit!") + Text("Hello, TUIkit!") .bold() .foregroundColor(.cyan) @@ -85,18 +84,18 @@ struct ContentView: View { ## Run the Example App ```bash -swift run TUIKitExample +swift run TUIkitExample ``` Press `q` or `ESC` to exit. ## Installation -Add TUIKit to your `Package.swift`: +Add TUIkit to your `Package.swift`: ```swift dependencies: [ - .package(url: "https://github.com/phranck/TUIKit.git", branch: "main") + .package(url: "https://github.com/phranck/TUIkit.git", branch: "main") ] ``` @@ -105,13 +104,13 @@ Then add it to your target: ```swift .target( name: "YourApp", - dependencies: ["TUIKit"] + dependencies: ["TUIkit"] ) ``` ## Theming -TUIKit includes 8 predefined themes inspired by classic terminals: +TUIkit includes 8 predefined themes inspired by classic terminals: ```swift @main @@ -146,16 +145,16 @@ Available themes: ``` Sources/ -├── TUIKit/ +├── TUIkit/ │ ├── App/ App, Scene, WindowGroup │ ├── Core/ View, ViewBuilder, State, Environment, Color, Theme │ ├── Modifiers/ Border, Frame, Padding, Overlay, Lifecycle │ ├── Rendering/ Terminal, ANSIRenderer, ViewRenderer, FrameBuffer │ └── Views/ Text, Stacks, Button, Menu, Alert, StatusBar, ... -└── TUIKitExample/ Example app (executable target) +└── TUIkitExample/ Example app (executable target) Tests/ -└── TUIKitTests/ 181 tests across 27 test suites +└── TUIkitTests/ 181 tests across 27 test suites ``` ## Requirements diff --git a/Sources/TUIKit/App/App.swift b/Sources/TUIkit/App/App.swift similarity index 97% rename from Sources/TUIKit/App/App.swift rename to Sources/TUIkit/App/App.swift index 84a74d1..fb87eb0 100644 --- a/Sources/TUIKit/App/App.swift +++ b/Sources/TUIkit/App/App.swift @@ -1,17 +1,17 @@ // // App.swift -// TUIKit +// TUIkit // -// The base protocol for TUIKit applications. +// The base protocol for TUIkit applications. // import Foundation // MARK: - App Protocol -/// The base protocol for TUIKit applications. +/// The base protocol for TUIkit applications. /// -/// `App` is the entry point for every TUIKit application, +/// `App` is the entry point for every TUIkit application, /// similar to `App` in SwiftUI. /// /// # Example diff --git a/Sources/TUIKit/App/InputHandler.swift b/Sources/TUIkit/App/InputHandler.swift similarity index 99% rename from Sources/TUIKit/App/InputHandler.swift rename to Sources/TUIkit/App/InputHandler.swift index 8a2b268..e9b0bb7 100644 --- a/Sources/TUIKit/App/InputHandler.swift +++ b/Sources/TUIkit/App/InputHandler.swift @@ -1,6 +1,6 @@ // // InputHandler.swift -// TUIKit +// TUIkit // // Dispatches key events through a 3-layer priority chain. // diff --git a/Sources/TUIKit/App/RenderLoop.swift b/Sources/TUIkit/App/RenderLoop.swift similarity index 99% rename from Sources/TUIKit/App/RenderLoop.swift rename to Sources/TUIkit/App/RenderLoop.swift index 65849cc..198f042 100644 --- a/Sources/TUIKit/App/RenderLoop.swift +++ b/Sources/TUIkit/App/RenderLoop.swift @@ -1,6 +1,6 @@ // // RenderLoop.swift -// TUIKit +// TUIkit // // Manages the rendering pipeline: scene rendering, environment // assembly, and status bar output. diff --git a/Sources/TUIKit/App/Scene.swift b/Sources/TUIkit/App/Scene.swift similarity index 91% rename from Sources/TUIKit/App/Scene.swift rename to Sources/TUIkit/App/Scene.swift index 5220eea..cb62613 100644 --- a/Sources/TUIKit/App/Scene.swift +++ b/Sources/TUIkit/App/Scene.swift @@ -1,11 +1,11 @@ // // Scene.swift -// TUIKit +// TUIkit // -// Scene types for TUIKit applications. +// Scene types for TUIkit applications. // -/// The base protocol for scenes in TUIKit. +/// The base protocol for scenes in TUIkit. /// /// A scene represents a part of the app structure, /// typically a window or a group of views. diff --git a/Sources/TUIKit/App/SignalManager.swift b/Sources/TUIkit/App/SignalManager.swift similarity index 99% rename from Sources/TUIKit/App/SignalManager.swift rename to Sources/TUIkit/App/SignalManager.swift index d40f447..f505e25 100644 --- a/Sources/TUIKit/App/SignalManager.swift +++ b/Sources/TUIkit/App/SignalManager.swift @@ -1,6 +1,6 @@ // // SignalManager.swift -// TUIKit +// TUIkit // // Manages POSIX signal handlers for terminal resize and graceful shutdown. // diff --git a/Sources/TUIKit/App/StatusBarState.swift b/Sources/TUIkit/App/StatusBarState.swift similarity index 99% rename from Sources/TUIKit/App/StatusBarState.swift rename to Sources/TUIkit/App/StatusBarState.swift index 3f50ad5..e194523 100644 --- a/Sources/TUIKit/App/StatusBarState.swift +++ b/Sources/TUIkit/App/StatusBarState.swift @@ -1,6 +1,6 @@ // // StatusBarState.swift -// TUIKit +// TUIkit // // Manages the status bar state for the running application. // diff --git a/Sources/TUIKit/Core/AppStorage.swift b/Sources/TUIkit/Core/AppStorage.swift similarity index 99% rename from Sources/TUIKit/Core/AppStorage.swift rename to Sources/TUIkit/Core/AppStorage.swift index 690bdac..c2372bb 100644 --- a/Sources/TUIKit/Core/AppStorage.swift +++ b/Sources/TUIkit/Core/AppStorage.swift @@ -1,6 +1,6 @@ // // AppStorage.swift -// TUIKit +// TUIkit // // Persistent storage for app settings using @AppStorage property wrapper. // @@ -51,7 +51,7 @@ private func appConfigDirectory() -> URL { /// A storage backend that persists data to a JSON file. /// -/// This is the default storage backend for TUIKit apps. +/// This is the default storage backend for TUIkit apps. /// Data is stored in `$XDG_CONFIG_HOME/[appName]/settings.json` /// or `~/.config/[appName]/settings.json` as fallback. public final class JSONFileStorage: StorageBackend, @unchecked Sendable { diff --git a/Sources/TUIKit/Core/Appearance.swift b/Sources/TUIkit/Core/Appearance.swift similarity index 99% rename from Sources/TUIKit/Core/Appearance.swift rename to Sources/TUIkit/Core/Appearance.swift index 28307bb..dd3d2f5 100644 --- a/Sources/TUIKit/Core/Appearance.swift +++ b/Sources/TUIkit/Core/Appearance.swift @@ -1,6 +1,6 @@ // // Appearance.swift -// TUIKit +// TUIkit // // Appearance system for consistent UI control styling. // diff --git a/Sources/TUIKit/Core/BorderStyle.swift b/Sources/TUIkit/Core/BorderStyle.swift similarity index 99% rename from Sources/TUIKit/Core/BorderStyle.swift rename to Sources/TUIkit/Core/BorderStyle.swift index f5635c9..8788a21 100644 --- a/Sources/TUIKit/Core/BorderStyle.swift +++ b/Sources/TUIkit/Core/BorderStyle.swift @@ -1,6 +1,6 @@ // // BorderStyle.swift -// TUIKit +// TUIkit // // Border styles and character sets for TUI borders. // diff --git a/Sources/TUIKit/Core/Color.swift b/Sources/TUIkit/Core/Color.swift similarity index 99% rename from Sources/TUIKit/Core/Color.swift rename to Sources/TUIkit/Core/Color.swift index 3183020..af9637d 100644 --- a/Sources/TUIKit/Core/Color.swift +++ b/Sources/TUIkit/Core/Color.swift @@ -1,11 +1,11 @@ // // Color.swift -// TUIKit +// TUIkit // // Color definitions for terminal output with ANSI escape codes. // -/// A color for use in TUIKit views. +/// A color for use in TUIkit views. /// /// `Color` represents standard ANSI colors as well as /// extended 256-color palette and True Color (24-bit RGB). diff --git a/Sources/TUIKit/Core/Environment.swift b/Sources/TUIkit/Core/Environment.swift similarity index 98% rename from Sources/TUIKit/Core/Environment.swift rename to Sources/TUIkit/Core/Environment.swift index c90e247..ecea748 100644 --- a/Sources/TUIKit/Core/Environment.swift +++ b/Sources/TUIkit/Core/Environment.swift @@ -1,6 +1,6 @@ // // Environment.swift -// TUIKit +// TUIkit // // Environment system for passing values down the view hierarchy. // Similar to SwiftUI's @Environment property wrapper. @@ -209,7 +209,7 @@ extension EnvironmentModifier: Renderable { // Render content with modified environment return EnvironmentStorage.shared.withEnvironment(modifiedEnvironment) { - TUIKit.renderToBuffer(content, context: modifiedContext) + TUIkit.renderToBuffer(content, context: modifiedContext) } } } diff --git a/Sources/TUIKit/Core/Focus.swift b/Sources/TUIkit/Core/Focus.swift similarity index 99% rename from Sources/TUIKit/Core/Focus.swift rename to Sources/TUIkit/Core/Focus.swift index cb2a5c0..aa5eb3f 100644 --- a/Sources/TUIKit/Core/Focus.swift +++ b/Sources/TUIkit/Core/Focus.swift @@ -1,6 +1,6 @@ // // Focus.swift -// TUIKit +// TUIkit // // Focus management system for interactive views. // diff --git a/Sources/TUIKit/Core/KeyEvent.swift b/Sources/TUIkit/Core/KeyEvent.swift similarity index 99% rename from Sources/TUIKit/Core/KeyEvent.swift rename to Sources/TUIkit/Core/KeyEvent.swift index d4cbe25..402eb68 100644 --- a/Sources/TUIKit/Core/KeyEvent.swift +++ b/Sources/TUIkit/Core/KeyEvent.swift @@ -1,8 +1,8 @@ // // KeyEvent.swift -// TUIKit +// TUIkit // -// Keyboard event handling for TUIKit. +// Keyboard event handling for TUIkit. // import Foundation diff --git a/Sources/TUIKit/Core/Preferences.swift b/Sources/TUIkit/Core/Preferences.swift similarity index 98% rename from Sources/TUIKit/Core/Preferences.swift rename to Sources/TUIkit/Core/Preferences.swift index 0615248..768d7df 100644 --- a/Sources/TUIKit/Core/Preferences.swift +++ b/Sources/TUIkit/Core/Preferences.swift @@ -1,6 +1,6 @@ // // Preferences.swift -// TUIKit +// TUIkit // // Preferences system for bottom-up data flow (child → parent). // Similar to SwiftUI's PreferenceKey system. @@ -214,7 +214,7 @@ extension PreferenceModifier: Renderable { context.tuiContext.preferences.setValue(value, forKey: K.self) // Render content - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) } } @@ -245,7 +245,7 @@ extension OnPreferenceChangeModifier: Renderable { prefs.push() // Render content - let buffer = TUIKit.renderToBuffer(content, context: context) + let buffer = TUIkit.renderToBuffer(content, context: context) // Pop and get collected preferences let preferences = prefs.pop() diff --git a/Sources/TUIKit/Core/PrimitiveViews.swift b/Sources/TUIkit/Core/PrimitiveViews.swift similarity index 99% rename from Sources/TUIKit/Core/PrimitiveViews.swift rename to Sources/TUIkit/Core/PrimitiveViews.swift index 0a4a397..61dcd06 100644 --- a/Sources/TUIKit/Core/PrimitiveViews.swift +++ b/Sources/TUIkit/Core/PrimitiveViews.swift @@ -1,6 +1,6 @@ // // PrimitiveViews.swift -// TUIKit +// TUIkit // // Primitive view types that serve as leaves in the view tree. // diff --git a/Sources/TUIKit/Core/State.swift b/Sources/TUIkit/Core/State.swift similarity index 97% rename from Sources/TUIKit/Core/State.swift rename to Sources/TUIkit/Core/State.swift index dd35fb4..f3bcb11 100644 --- a/Sources/TUIKit/Core/State.swift +++ b/Sources/TUIkit/Core/State.swift @@ -1,8 +1,8 @@ // // State.swift -// TUIKit +// TUIkit // -// State management for TUIKit views. +// State management for TUIkit views. // import Foundation @@ -11,7 +11,7 @@ import Foundation /// Global application state that triggers re-renders when modified. /// -/// Since TUIKit runs in a single-threaded event loop, we use a simple +/// Since TUIkit runs in a single-threaded event loop, we use a simple /// observable pattern. The AppRunner subscribes to state changes and /// re-renders when notified. public final class AppState: @unchecked Sendable { diff --git a/Sources/TUIKit/Core/TUIContext.swift b/Sources/TUIkit/Core/TUIContext.swift similarity index 98% rename from Sources/TUIKit/Core/TUIContext.swift rename to Sources/TUIkit/Core/TUIContext.swift index a5110d0..2fba983 100644 --- a/Sources/TUIKit/Core/TUIContext.swift +++ b/Sources/TUIkit/Core/TUIContext.swift @@ -1,6 +1,6 @@ // // TUIContext.swift -// TUIKit +// TUIkit // // Central dependency container replacing scattered singletons. // Owned by AppRunner and threaded through RenderContext. @@ -174,7 +174,7 @@ public final class LifecycleManager: @unchecked Sendable { // MARK: - TUI Context -/// Central dependency container for TUIKit runtime services. +/// Central dependency container for TUIkit runtime services. /// /// `TUIContext` replaces the scattered singleton pattern by bundling all /// framework-internal services into a single object owned by `AppRunner`. @@ -197,7 +197,7 @@ public final class LifecycleManager: @unchecked Sendable { /// context.tuiContext.keyEventDispatcher.addHandler { event in /// // handle key /// } -/// return TUIKit.renderToBuffer(content, context: context) +/// return TUIkit.renderToBuffer(content, context: context) /// } /// } /// ``` diff --git a/Sources/TUIKit/Core/Theme.swift b/Sources/TUIkit/Core/Theme.swift similarity index 99% rename from Sources/TUIKit/Core/Theme.swift rename to Sources/TUIkit/Core/Theme.swift index 8bec51b..c1d8b41 100644 --- a/Sources/TUIKit/Core/Theme.swift +++ b/Sources/TUIkit/Core/Theme.swift @@ -1,6 +1,6 @@ // // Theme.swift -// TUIKit +// TUIkit // // Palette system with full 16M color support and predefined terminal palettes. // @@ -9,10 +9,10 @@ import Foundation // MARK: - Palette Protocol -/// A palette defines the color scheme for a TUIKit application. +/// A palette defines the color scheme for a TUIkit application. /// /// Palettes provide semantic colors that views use for consistent styling. -/// TUIKit includes several predefined palettes inspired by classic terminals. +/// TUIkit includes several predefined palettes inspired by classic terminals. /// /// Conforms to ``Cyclable`` so it can be managed by a ``ThemeManager``. /// diff --git a/Sources/TUIKit/Core/ThemeManager.swift b/Sources/TUIkit/Core/ThemeManager.swift similarity index 99% rename from Sources/TUIKit/Core/ThemeManager.swift rename to Sources/TUIkit/Core/ThemeManager.swift index 644b564..5001423 100644 --- a/Sources/TUIKit/Core/ThemeManager.swift +++ b/Sources/TUIkit/Core/ThemeManager.swift @@ -1,6 +1,6 @@ // // ThemeManager.swift -// TUIKit +// TUIkit // // Generic manager for cycling through items that conform to `Cyclable`. // Replaces the previously duplicated palette manager and appearance manager @@ -43,7 +43,7 @@ public protocol Cyclable: Sendable { /// set a specific item by reference, and apply the current selection to the /// environment so all views pick up the change. /// -/// TUIKit uses two instances: +/// TUIkit uses two instances: /// - A ``PaletteManager`` for color palettes /// - An ``AppearanceManager`` for border-style appearances /// diff --git a/Sources/TUIKit/Core/TupleViews.swift b/Sources/TUIkit/Core/TupleViews.swift similarity index 98% rename from Sources/TUIKit/Core/TupleViews.swift rename to Sources/TUIkit/Core/TupleViews.swift index 26fbabe..4dbaf53 100644 --- a/Sources/TUIKit/Core/TupleViews.swift +++ b/Sources/TUIkit/Core/TupleViews.swift @@ -1,6 +1,6 @@ // // TupleViews.swift -// TUIKit +// TUIkit // // Container type for multiple views in ViewBuilder, using Swift Parameter Packs. // diff --git a/Sources/TUIKit/Core/UserDefaultsStorage.swift b/Sources/TUIkit/Core/UserDefaultsStorage.swift similarity index 99% rename from Sources/TUIKit/Core/UserDefaultsStorage.swift rename to Sources/TUIkit/Core/UserDefaultsStorage.swift index c4bdd7e..a8c792b 100644 --- a/Sources/TUIKit/Core/UserDefaultsStorage.swift +++ b/Sources/TUIkit/Core/UserDefaultsStorage.swift @@ -1,6 +1,6 @@ // // UserDefaultsStorage.swift -// TUIKit +// TUIkit // // UserDefaults-compatible storage backend for all platforms. // diff --git a/Sources/TUIKit/Core/View.swift b/Sources/TUIkit/Core/View.swift similarity index 88% rename from Sources/TUIKit/Core/View.swift rename to Sources/TUIkit/Core/View.swift index c5b09c5..04b26d5 100644 --- a/Sources/TUIKit/Core/View.swift +++ b/Sources/TUIkit/Core/View.swift @@ -1,13 +1,13 @@ // // View.swift -// TUIKit +// TUIkit // -// The base protocol for all TUIKit views. +// The base protocol for all TUIkit views. // -/// The base protocol for all TUIKit views. +/// The base protocol for all TUIkit views. /// -/// `View` is the central protocol in TUIKit and works similarly to `View` in SwiftUI. +/// `View` is the central protocol in TUIkit and works similarly to `View` in SwiftUI. /// It defines how components declare their structure and content. /// /// Every View defines a `body` composed of other Views. @@ -15,7 +15,7 @@ /// /// ## Dual Rendering System /// -/// TUIKit uses two rendering paths: +/// TUIkit uses two rendering paths: /// /// - **Composite views** implement `body` to compose other views. /// The rendering system recurses into `body` to resolve the tree. @@ -31,7 +31,7 @@ /// ```swift /// struct MyView: View { /// var body: some View { -/// Text("Hello, TUIKit!") +/// Text("Hello, TUIkit!") /// } /// } /// ``` diff --git a/Sources/TUIKit/Core/ViewBuilder.swift b/Sources/TUIkit/Core/ViewBuilder.swift similarity index 99% rename from Sources/TUIKit/Core/ViewBuilder.swift rename to Sources/TUIkit/Core/ViewBuilder.swift index 9c97998..e3acce7 100644 --- a/Sources/TUIKit/Core/ViewBuilder.swift +++ b/Sources/TUIkit/Core/ViewBuilder.swift @@ -1,6 +1,6 @@ // // ViewBuilder.swift -// TUIKit +// TUIkit // // Result builder for declarative view composition. // diff --git a/Sources/TUIKit/Core/ViewModifier.swift b/Sources/TUIkit/Core/ViewModifier.swift similarity index 96% rename from Sources/TUIKit/Core/ViewModifier.swift rename to Sources/TUIkit/Core/ViewModifier.swift index 079296e..5b2a0a0 100644 --- a/Sources/TUIKit/Core/ViewModifier.swift +++ b/Sources/TUIkit/Core/ViewModifier.swift @@ -1,6 +1,6 @@ // // ViewModifier.swift -// TUIKit +// TUIkit // // The view modifier system for transforming views. // @@ -60,7 +60,7 @@ public struct ModifiedView: View { extension ModifiedView: Renderable { public func renderToBuffer(context: RenderContext) -> FrameBuffer { - let childBuffer = TUIKit.renderToBuffer(content, context: context) + let childBuffer = TUIkit.renderToBuffer(content, context: context) return modifier.modify(buffer: childBuffer, context: context) } } diff --git a/Sources/TUIKit/Extensions/PrimitiveTypes+Extensions.swift b/Sources/TUIkit/Extensions/PrimitiveTypes+Extensions.swift similarity index 93% rename from Sources/TUIKit/Extensions/PrimitiveTypes+Extensions.swift rename to Sources/TUIkit/Extensions/PrimitiveTypes+Extensions.swift index 81c721e..4f77e72 100644 --- a/Sources/TUIKit/Extensions/PrimitiveTypes+Extensions.swift +++ b/Sources/TUIkit/Extensions/PrimitiveTypes+Extensions.swift @@ -1,6 +1,6 @@ // // PrimitiveTypes+Extensions.swift -// TUIKit +// TUIkit // // Protocol conformances for standard types (Never, Optional). // @@ -38,7 +38,7 @@ extension Optional: Renderable where Wrapped: View { public func renderToBuffer(context: RenderContext) -> FrameBuffer { switch self { case .some(let view): - return TUIKit.renderToBuffer(view, context: context) + return TUIkit.renderToBuffer(view, context: context) case .none: return FrameBuffer() } diff --git a/Sources/TUIKit/Extensions/String+ANSI.swift b/Sources/TUIkit/Extensions/String+ANSI.swift similarity index 98% rename from Sources/TUIKit/Extensions/String+ANSI.swift rename to Sources/TUIkit/Extensions/String+ANSI.swift index dc8661f..2b7c41b 100644 --- a/Sources/TUIKit/Extensions/String+ANSI.swift +++ b/Sources/TUIkit/Extensions/String+ANSI.swift @@ -1,6 +1,6 @@ // // String+ANSI.swift -// TUIKit +// TUIkit // // ANSI-aware String helpers for visible-length calculation and padding. // diff --git a/Sources/TUIKit/Extensions/View+Convenience.swift b/Sources/TUIkit/Extensions/View+Convenience.swift similarity index 99% rename from Sources/TUIKit/Extensions/View+Convenience.swift rename to Sources/TUIkit/Extensions/View+Convenience.swift index 019b50b..bf53c3d 100644 --- a/Sources/TUIKit/Extensions/View+Convenience.swift +++ b/Sources/TUIkit/Extensions/View+Convenience.swift @@ -1,6 +1,6 @@ // // View+Convenience.swift -// TUIKit +// TUIkit // // Convenience view extensions: modal, asAnyView. // diff --git a/Sources/TUIKit/Extensions/View+Environment.swift b/Sources/TUIkit/Extensions/View+Environment.swift similarity index 99% rename from Sources/TUIKit/Extensions/View+Environment.swift rename to Sources/TUIkit/Extensions/View+Environment.swift index 168df4b..ff97d71 100644 --- a/Sources/TUIKit/Extensions/View+Environment.swift +++ b/Sources/TUIkit/Extensions/View+Environment.swift @@ -1,6 +1,6 @@ // // View+Environment.swift -// TUIKit +// TUIkit // // Environment injection view modifiers: environment, appearance, theme. // diff --git a/Sources/TUIKit/Extensions/View+Events.swift b/Sources/TUIkit/Extensions/View+Events.swift similarity index 99% rename from Sources/TUIKit/Extensions/View+Events.swift rename to Sources/TUIkit/Extensions/View+Events.swift index 059ee9a..64e9412 100644 --- a/Sources/TUIKit/Extensions/View+Events.swift +++ b/Sources/TUIkit/Extensions/View+Events.swift @@ -1,6 +1,6 @@ // // View+Events.swift -// TUIKit +// TUIkit // // Event handling and lifecycle view modifiers: onKeyPress, onAppear, onDisappear, task, statusBarItems. // diff --git a/Sources/TUIKit/Extensions/View+Layout.swift b/Sources/TUIkit/Extensions/View+Layout.swift similarity index 99% rename from Sources/TUIKit/Extensions/View+Layout.swift rename to Sources/TUIkit/Extensions/View+Layout.swift index 00875e7..f51cddc 100644 --- a/Sources/TUIKit/Extensions/View+Layout.swift +++ b/Sources/TUIkit/Extensions/View+Layout.swift @@ -1,6 +1,6 @@ // // View+Layout.swift -// TUIKit +// TUIkit // // Layout and styling view modifiers: border, dimmed, background, frame, overlay, padding. // diff --git a/Sources/TUIKit/Extensions/View+Modifier.swift b/Sources/TUIkit/Extensions/View+Modifier.swift similarity index 97% rename from Sources/TUIKit/Extensions/View+Modifier.swift rename to Sources/TUIkit/Extensions/View+Modifier.swift index 8e97eb5..4867c4a 100644 --- a/Sources/TUIKit/Extensions/View+Modifier.swift +++ b/Sources/TUIkit/Extensions/View+Modifier.swift @@ -1,6 +1,6 @@ // // View+Modifier.swift -// TUIKit +// TUIkit // // Generic modifier application extension for View. // diff --git a/Sources/TUIKit/Extensions/View+Preferences.swift b/Sources/TUIkit/Extensions/View+Preferences.swift similarity index 99% rename from Sources/TUIKit/Extensions/View+Preferences.swift rename to Sources/TUIkit/Extensions/View+Preferences.swift index ca46e94..be7f58d 100644 --- a/Sources/TUIKit/Extensions/View+Preferences.swift +++ b/Sources/TUIkit/Extensions/View+Preferences.swift @@ -1,6 +1,6 @@ // // View+Preferences.swift -// TUIKit +// TUIkit // // Preference system view modifiers: preference, onPreferenceChange, navigationTitle. // diff --git a/Sources/TUIKit/Modifiers/BackgroundModifier.swift b/Sources/TUIkit/Modifiers/BackgroundModifier.swift similarity index 99% rename from Sources/TUIKit/Modifiers/BackgroundModifier.swift rename to Sources/TUIkit/Modifiers/BackgroundModifier.swift index bdb59f8..ca44f10 100644 --- a/Sources/TUIKit/Modifiers/BackgroundModifier.swift +++ b/Sources/TUIkit/Modifiers/BackgroundModifier.swift @@ -1,6 +1,6 @@ // // BackgroundModifier.swift -// TUIKit +// TUIkit // // The .background() modifier for adding background colors to views. // diff --git a/Sources/TUIKit/Modifiers/BorderModifier.swift b/Sources/TUIkit/Modifiers/BorderModifier.swift similarity index 97% rename from Sources/TUIKit/Modifiers/BorderModifier.swift rename to Sources/TUIkit/Modifiers/BorderModifier.swift index 3c4ef1c..41fb906 100644 --- a/Sources/TUIKit/Modifiers/BorderModifier.swift +++ b/Sources/TUIkit/Modifiers/BorderModifier.swift @@ -1,6 +1,6 @@ // // BorderModifier.swift -// TUIKit +// TUIkit // // The .border() modifier for adding borders around views. // @@ -37,7 +37,7 @@ extension BorderedView: Renderable { contentContext.availableWidth = max(1, context.availableWidth - BorderRenderer.borderWidthOverhead) // Render content with reduced width - let buffer = TUIKit.renderToBuffer(content, context: contentContext) + let buffer = TUIkit.renderToBuffer(content, context: contentContext) guard !buffer.isEmpty else { return buffer } diff --git a/Sources/TUIKit/Modifiers/DimmedModifier.swift b/Sources/TUIkit/Modifiers/DimmedModifier.swift similarity index 95% rename from Sources/TUIKit/Modifiers/DimmedModifier.swift rename to Sources/TUIkit/Modifiers/DimmedModifier.swift index b7a35ff..5a84e82 100644 --- a/Sources/TUIKit/Modifiers/DimmedModifier.swift +++ b/Sources/TUIkit/Modifiers/DimmedModifier.swift @@ -1,6 +1,6 @@ // // DimmedModifier.swift -// TUIKit +// TUIkit // // A modifier that applies a dimming effect to the entire view content. // @@ -22,7 +22,7 @@ public struct DimmedModifier: View { extension DimmedModifier: Renderable { public func renderToBuffer(context: RenderContext) -> FrameBuffer { - let contentBuffer = TUIKit.renderToBuffer(content, context: context) + let contentBuffer = TUIkit.renderToBuffer(content, context: context) guard !contentBuffer.isEmpty else { return contentBuffer diff --git a/Sources/TUIKit/Modifiers/FrameModifier.swift b/Sources/TUIkit/Modifiers/FrameModifier.swift similarity index 98% rename from Sources/TUIKit/Modifiers/FrameModifier.swift rename to Sources/TUIkit/Modifiers/FrameModifier.swift index 028cee9..f692041 100644 --- a/Sources/TUIKit/Modifiers/FrameModifier.swift +++ b/Sources/TUIkit/Modifiers/FrameModifier.swift @@ -1,6 +1,6 @@ // // FrameModifier.swift -// TUIKit +// TUIkit // // The .frame() modifier for setting explicit size constraints. // @@ -81,7 +81,7 @@ extension FlexibleFrameView: Renderable { } // Render content - let buffer = TUIKit.renderToBuffer(content, context: contentContext) + let buffer = TUIkit.renderToBuffer(content, context: contentContext) // Apply minimum constraints var finalWidth = buffer.width diff --git a/Sources/TUIKit/Modifiers/KeyPressModifier.swift b/Sources/TUIkit/Modifiers/KeyPressModifier.swift similarity index 94% rename from Sources/TUIKit/Modifiers/KeyPressModifier.swift rename to Sources/TUIkit/Modifiers/KeyPressModifier.swift index 3578fa8..da247c5 100644 --- a/Sources/TUIKit/Modifiers/KeyPressModifier.swift +++ b/Sources/TUIkit/Modifiers/KeyPressModifier.swift @@ -1,6 +1,6 @@ // // KeyPressModifier.swift -// TUIKit +// TUIkit // // A modifier for handling keyboard events. // @@ -43,6 +43,6 @@ extension KeyPressModifier: Renderable { } // Render the content - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) } } diff --git a/Sources/TUIKit/Modifiers/LifecycleModifier.swift b/Sources/TUIkit/Modifiers/LifecycleModifier.swift similarity index 97% rename from Sources/TUIKit/Modifiers/LifecycleModifier.swift rename to Sources/TUIkit/Modifiers/LifecycleModifier.swift index c9eece5..9dc6001 100644 --- a/Sources/TUIKit/Modifiers/LifecycleModifier.swift +++ b/Sources/TUIkit/Modifiers/LifecycleModifier.swift @@ -1,6 +1,6 @@ // // LifecycleModifier.swift -// TUIKit +// TUIkit // // Lifecycle modifiers: .onAppear(), .onDisappear(), .task() // @@ -117,7 +117,7 @@ extension OnAppearModifier: Renderable { _ = context.tuiContext.lifecycle.recordAppear(token: token, action: action) // Render content - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) } } @@ -185,7 +185,7 @@ extension OnDisappearModifier: Renderable { _ = context.tuiContext.lifecycle.recordAppear(token: token, action: {}) // Render content - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) } } @@ -274,6 +274,6 @@ extension TaskModifier: Renderable { } // Render content - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) } } diff --git a/Sources/TUIKit/Modifiers/OverlayModifier.swift b/Sources/TUIkit/Modifiers/OverlayModifier.swift similarity index 94% rename from Sources/TUIKit/Modifiers/OverlayModifier.swift rename to Sources/TUIkit/Modifiers/OverlayModifier.swift index 6d44a3d..186b95e 100644 --- a/Sources/TUIKit/Modifiers/OverlayModifier.swift +++ b/Sources/TUIkit/Modifiers/OverlayModifier.swift @@ -1,6 +1,6 @@ // // OverlayModifier.swift -// TUIKit +// TUIkit // // A modifier that renders an overlay on top of the base view. // @@ -30,8 +30,8 @@ public struct OverlayModifier: View { extension OverlayModifier: Renderable { public func renderToBuffer(context: RenderContext) -> FrameBuffer { // Render both contents - let baseBuffer = TUIKit.renderToBuffer(base, context: context) - let overlayBuffer = TUIKit.renderToBuffer(overlay, context: context) + let baseBuffer = TUIkit.renderToBuffer(base, context: context) + let overlayBuffer = TUIkit.renderToBuffer(overlay, context: context) guard !baseBuffer.isEmpty else { return overlayBuffer diff --git a/Sources/TUIKit/Modifiers/PaddingModifier.swift b/Sources/TUIkit/Modifiers/PaddingModifier.swift similarity index 99% rename from Sources/TUIKit/Modifiers/PaddingModifier.swift rename to Sources/TUIkit/Modifiers/PaddingModifier.swift index b0748c6..b3b8fb2 100644 --- a/Sources/TUIKit/Modifiers/PaddingModifier.swift +++ b/Sources/TUIkit/Modifiers/PaddingModifier.swift @@ -1,6 +1,6 @@ // // PaddingModifier.swift -// TUIKit +// TUIkit // // The .padding() modifier for adding space around a view. // diff --git a/Sources/TUIKit/Modifiers/StatusBarItemsModifier.swift b/Sources/TUIkit/Modifiers/StatusBarItemsModifier.swift similarity index 96% rename from Sources/TUIKit/Modifiers/StatusBarItemsModifier.swift rename to Sources/TUIkit/Modifiers/StatusBarItemsModifier.swift index c217853..b780609 100644 --- a/Sources/TUIKit/Modifiers/StatusBarItemsModifier.swift +++ b/Sources/TUIkit/Modifiers/StatusBarItemsModifier.swift @@ -1,6 +1,6 @@ // // StatusBarItemsModifier.swift -// TUIKit +// TUIkit // // A modifier that sets status bar items for a view. // @@ -64,6 +64,6 @@ extension StatusBarItemsModifier: Renderable { } // Render the content - return TUIKit.renderToBuffer(content, context: renderContext) + return TUIkit.renderToBuffer(content, context: renderContext) } } diff --git a/Sources/TUIKit/Rendering/ANSIRenderer.swift b/Sources/TUIkit/Rendering/ANSIRenderer.swift similarity index 99% rename from Sources/TUIKit/Rendering/ANSIRenderer.swift rename to Sources/TUIkit/Rendering/ANSIRenderer.swift index f3c88e6..324774c 100644 --- a/Sources/TUIKit/Rendering/ANSIRenderer.swift +++ b/Sources/TUIkit/Rendering/ANSIRenderer.swift @@ -1,6 +1,6 @@ // // ANSIRenderer.swift -// TUIKit +// TUIkit // // ANSI escape code generation for terminal output. // diff --git a/Sources/TUIKit/Rendering/BorderRenderer.swift b/Sources/TUIkit/Rendering/BorderRenderer.swift similarity index 99% rename from Sources/TUIKit/Rendering/BorderRenderer.swift rename to Sources/TUIkit/Rendering/BorderRenderer.swift index 5b04f5f..adf3e6b 100644 --- a/Sources/TUIKit/Rendering/BorderRenderer.swift +++ b/Sources/TUIkit/Rendering/BorderRenderer.swift @@ -1,6 +1,6 @@ // // BorderRenderer.swift -// TUIKit +// TUIkit // // Centralized border rendering utilities for standard and block styles. // diff --git a/Sources/TUIKit/Rendering/FrameBuffer.swift b/Sources/TUIkit/Rendering/FrameBuffer.swift similarity index 99% rename from Sources/TUIKit/Rendering/FrameBuffer.swift rename to Sources/TUIkit/Rendering/FrameBuffer.swift index ac66ed5..49fd64d 100644 --- a/Sources/TUIKit/Rendering/FrameBuffer.swift +++ b/Sources/TUIkit/Rendering/FrameBuffer.swift @@ -1,6 +1,6 @@ // // FrameBuffer.swift -// TUIKit +// TUIkit // // A 2D text buffer for off-screen rendering before terminal output. // diff --git a/Sources/TUIKit/Rendering/Renderable.swift b/Sources/TUIkit/Rendering/Renderable.swift similarity index 98% rename from Sources/TUIKit/Rendering/Renderable.swift rename to Sources/TUIkit/Rendering/Renderable.swift index d978e99..41617ed 100644 --- a/Sources/TUIKit/Rendering/Renderable.swift +++ b/Sources/TUIkit/Rendering/Renderable.swift @@ -1,13 +1,13 @@ // // Renderable.swift -// TUIKit +// TUIkit // // Protocol for views that can render themselves directly. // /// A protocol for views that produce terminal output directly. /// -/// TUIKit uses a **dual rendering system** inspired by SwiftUI: +/// TUIkit uses a **dual rendering system** inspired by SwiftUI: /// /// - **`View.body`** — Compositional path: views declare *what* they /// are made of by composing other `View` types. @@ -123,7 +123,7 @@ public struct RenderContext { /// Renders any `View` into a ``FrameBuffer`` using the dual rendering system. /// -/// This is the **single entry point** for all view rendering in TUIKit. +/// This is the **single entry point** for all view rendering in TUIkit. /// Every recursive call in the view tree passes through this function. /// /// ## Decision order diff --git a/Sources/TUIKit/Rendering/Terminal.swift b/Sources/TUIkit/Rendering/Terminal.swift similarity index 99% rename from Sources/TUIKit/Rendering/Terminal.swift rename to Sources/TUIkit/Rendering/Terminal.swift index e46b5ca..854e70a 100644 --- a/Sources/TUIKit/Rendering/Terminal.swift +++ b/Sources/TUIkit/Rendering/Terminal.swift @@ -1,6 +1,6 @@ // // Terminal.swift -// TUIKit +// TUIkit // // Terminal abstraction for input and output. // diff --git a/Sources/TUIKit/Rendering/ViewRenderer.swift b/Sources/TUIkit/Rendering/ViewRenderer.swift similarity index 98% rename from Sources/TUIKit/Rendering/ViewRenderer.swift rename to Sources/TUIkit/Rendering/ViewRenderer.swift index 4b0440c..69e3244 100644 --- a/Sources/TUIKit/Rendering/ViewRenderer.swift +++ b/Sources/TUIkit/Rendering/ViewRenderer.swift @@ -1,6 +1,6 @@ // // ViewRenderer.swift -// TUIKit +// TUIkit // // Renders Views to terminal output via FrameBuffer. // @@ -264,9 +264,9 @@ extension ConditionalView: Renderable { public func renderToBuffer(context: RenderContext) -> FrameBuffer { switch self { case .trueContent(let content): - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) case .falseContent(let content): - return TUIKit.renderToBuffer(content, context: context) + return TUIkit.renderToBuffer(content, context: context) } } } diff --git a/Sources/TUIKit/TUIKit.docc/Articles/Architecture.md b/Sources/TUIkit/TUIkit.docc/Articles/Architecture.md similarity index 94% rename from Sources/TUIKit/TUIKit.docc/Articles/Architecture.md rename to Sources/TUIkit/TUIkit.docc/Articles/Architecture.md index cc2a06d..848bee3 100644 --- a/Sources/TUIKit/TUIKit.docc/Articles/Architecture.md +++ b/Sources/TUIkit/TUIkit.docc/Articles/Architecture.md @@ -1,10 +1,10 @@ # Architecture -Understand the layer model and rendering pipeline of TUIKit. +Understand the layer model and rendering pipeline of TUIkit. ## Overview -TUIKit is structured in five layers, each building on the one below. This clean separation makes the framework easy to extend and maintain. +TUIkit is structured in five layers, each building on the one below. This clean separation makes the framework easy to extend and maintain. ## Layer Model @@ -55,7 +55,7 @@ The rendering pipeline converts the view tree into terminal output: ## Event Loop -TUIKit runs a synchronous event loop: +TUIkit runs a synchronous event loop: ``` ┌─────────────────────────┐ diff --git a/Sources/TUIKit/TUIKit.docc/Articles/GettingStarted.md b/Sources/TUIkit/TUIkit.docc/Articles/GettingStarted.md similarity index 81% rename from Sources/TUIKit/TUIKit.docc/Articles/GettingStarted.md rename to Sources/TUIkit/TUIkit.docc/Articles/GettingStarted.md index a9ca244..4c2599a 100644 --- a/Sources/TUIKit/TUIKit.docc/Articles/GettingStarted.md +++ b/Sources/TUIkit/TUIkit.docc/Articles/GettingStarted.md @@ -1,14 +1,14 @@ # Getting Started -Build your first terminal application with TUIKit. +Build your first terminal application with TUIkit. ## Overview -TUIKit is a Swift package that lets you create terminal user interfaces with a declarative, SwiftUI-like syntax. This guide walks you through setting up a project and building a simple app. +TUIkit is a Swift package that lets you create terminal user interfaces with a declarative, SwiftUI-like syntax. This guide walks you through setting up a project and building a simple app. -## Adding TUIKit to Your Project +## Adding TUIkit to Your Project -Add TUIKit as a dependency in your `Package.swift`: +Add TUIkit as a dependency in your `Package.swift`: ```swift // swift-tools-version: 6.0 @@ -18,12 +18,12 @@ let package = Package( name: "MyTUIApp", platforms: [.macOS(.v10_15)], dependencies: [ - .package(url: "https://github.com/phranck/TUIKit.git", from: "0.1.0"), + .package(url: "https://github.com/phranck/TUIkit.git", from: "0.1.0"), ], targets: [ .executableTarget( name: "MyTUIApp", - dependencies: ["TUIKit"] + dependencies: ["TUIkit"] ), ] ) @@ -34,7 +34,7 @@ let package = Package( Create a `main.swift` file with the ``App`` protocol as your entry point: ```swift -import TUIKit +import TUIkit @main struct MyApp: App { @@ -48,7 +48,7 @@ struct MyApp: App { struct ContentView: View { var body: some View { VStack { - Text("Welcome to TUIKit!") + Text("Welcome to TUIkit!") .bold() .foregroundColor(.cyan) @@ -86,11 +86,11 @@ struct CounterView: View { For simple scripts that don't need a full app lifecycle, use ``renderOnce(content:)``: ```swift -import TUIKit +import TUIkit renderOnce { VStack { - Text("Hello, TUIKit!") + Text("Hello, TUIkit!") .bold() .foregroundColor(.green) Divider() diff --git a/Sources/TUIKit/TUIKit.docc/Articles/StateManagement.md b/Sources/TUIkit/TUIkit.docc/Articles/StateManagement.md similarity index 92% rename from Sources/TUIKit/TUIKit.docc/Articles/StateManagement.md rename to Sources/TUIkit/TUIkit.docc/Articles/StateManagement.md index 66b789e..06d4208 100644 --- a/Sources/TUIKit/TUIKit.docc/Articles/StateManagement.md +++ b/Sources/TUIkit/TUIkit.docc/Articles/StateManagement.md @@ -1,10 +1,10 @@ # State Management -Manage reactive state in your TUIKit application. +Manage reactive state in your TUIkit application. ## Overview -TUIKit provides a state management system modeled after SwiftUI. When state changes, the view tree is automatically re-rendered. +TUIkit provides a state management system modeled after SwiftUI. When state changes, the view tree is automatically re-rendered. ## @State @@ -99,7 +99,7 @@ struct SettingsView: View { ## How Re-Rendering Works -TUIKit uses a single-threaded event loop. When a ``State`` value changes: +TUIkit uses a single-threaded event loop. When a ``State`` value changes: 1. ``AppState/setNeedsRender()`` is called 2. The main loop detects the change diff --git a/Sources/TUIKit/TUIKit.docc/Articles/ThemingGuide.md b/Sources/TUIkit/TUIkit.docc/Articles/ThemingGuide.md similarity index 95% rename from Sources/TUIKit/TUIKit.docc/Articles/ThemingGuide.md rename to Sources/TUIkit/TUIkit.docc/Articles/ThemingGuide.md index 3b04b7c..56849d7 100644 --- a/Sources/TUIKit/TUIKit.docc/Articles/ThemingGuide.md +++ b/Sources/TUIkit/TUIkit.docc/Articles/ThemingGuide.md @@ -1,10 +1,10 @@ # Theming Guide -Customize the visual appearance of your TUIKit application with themes. +Customize the visual appearance of your TUIkit application with themes. ## Overview -TUIKit includes a full theming system with five built-in themes inspired by classic CRT terminals. Themes define semantic colors for backgrounds, foregrounds, accents, and UI elements. +TUIkit includes a full theming system with five built-in themes inspired by classic CRT terminals. Themes define semantic colors for backgrounds, foregrounds, accents, and UI elements. ## Built-in Themes diff --git a/Sources/TUIKit/TUIKit.docc/TUIKit.md b/Sources/TUIkit/TUIkit.docc/TUIkit.md similarity index 94% rename from Sources/TUIKit/TUIKit.docc/TUIKit.md rename to Sources/TUIkit/TUIkit.docc/TUIkit.md index df9b9ca..da72af6 100644 --- a/Sources/TUIKit/TUIKit.docc/TUIKit.md +++ b/Sources/TUIkit/TUIkit.docc/TUIkit.md @@ -1,14 +1,14 @@ -# ``TUIKit`` +# ``TUIkit`` A declarative, SwiftUI-like framework for building Terminal User Interfaces in Swift. @Metadata { - @DisplayName("TUIKit") + @DisplayName("TUIkit") } ## Overview -TUIKit lets you build terminal applications using a familiar, declarative syntax inspired by SwiftUI. No ncurses, no C dependencies — pure Swift. +TUIkit lets you build terminal applications using a familiar, declarative syntax inspired by SwiftUI. No ncurses, no C dependencies — pure Swift. ```swift @main @@ -16,7 +16,7 @@ struct MyApp: App { var body: some Scene { WindowGroup { VStack { - Text("Hello, TUIKit!") + Text("Hello, TUIkit!") .bold() .foregroundColor(.cyan) Button("Press me") { diff --git a/Sources/TUIKit/TUIKit.swift b/Sources/TUIkit/TUIkit.swift similarity index 86% rename from Sources/TUIKit/TUIKit.swift rename to Sources/TUIkit/TUIkit.swift index a37bbf1..8dda390 100644 --- a/Sources/TUIKit/TUIKit.swift +++ b/Sources/TUIkit/TUIkit.swift @@ -1,14 +1,14 @@ // -// TUIKit.swift -// TUIKit +// TUIkit.swift +// TUIkit // // A SwiftUI-like framework for Terminal User Interfaces. // -// TUIKit enables creating TUI applications with a declarative, +// TUIkit enables creating TUI applications with a declarative, // SwiftUI-like syntax - without ncurses or other low-level libraries. // -/// The current version of TUIKit. +/// The current version of TUIkit. public let tuiKitVersion = "0.1.0" /// Executes a view closure and renders it once. @@ -20,7 +20,7 @@ public let tuiKitVersion = "0.1.0" /// ```swift /// renderOnce { /// VStack { -/// Text("Hello, TUIKit!") +/// Text("Hello, TUIkit!") /// .bold() /// .foregroundColor(.cyan) /// Divider() diff --git a/Sources/TUIKit/Views/Alert.swift b/Sources/TUIkit/Views/Alert.swift similarity index 99% rename from Sources/TUIKit/Views/Alert.swift rename to Sources/TUIkit/Views/Alert.swift index a606f58..709adac 100644 --- a/Sources/TUIKit/Views/Alert.swift +++ b/Sources/TUIkit/Views/Alert.swift @@ -1,6 +1,6 @@ // // Alert.swift -// TUIKit +// TUIkit // // A modal alert view with title, message, and optional action buttons. // diff --git a/Sources/TUIKit/Views/Box.swift b/Sources/TUIkit/Views/Box.swift similarity index 99% rename from Sources/TUIKit/Views/Box.swift rename to Sources/TUIkit/Views/Box.swift index 2185b66..248f349 100644 --- a/Sources/TUIKit/Views/Box.swift +++ b/Sources/TUIkit/Views/Box.swift @@ -1,6 +1,6 @@ // // Box.swift -// TUIKit +// TUIkit // // A simple bordered container view. // diff --git a/Sources/TUIKit/Views/Button.swift b/Sources/TUIkit/Views/Button.swift similarity index 99% rename from Sources/TUIKit/Views/Button.swift rename to Sources/TUIkit/Views/Button.swift index 7e74161..0af28d8 100644 --- a/Sources/TUIKit/Views/Button.swift +++ b/Sources/TUIkit/Views/Button.swift @@ -1,6 +1,6 @@ // // Button.swift -// TUIKit +// TUIkit // // An interactive button view that responds to keyboard input. // @@ -443,7 +443,7 @@ extension ButtonRow: Renderable { // Render each button var buttonBuffers: [FrameBuffer] = [] for button in buttons { - let buffer = TUIKit.renderToBuffer(button, context: context) + let buffer = TUIkit.renderToBuffer(button, context: context) buttonBuffers.append(buffer) } diff --git a/Sources/TUIKit/Views/Card.swift b/Sources/TUIkit/Views/Card.swift similarity index 99% rename from Sources/TUIKit/Views/Card.swift rename to Sources/TUIkit/Views/Card.swift index 9481f49..a7ad979 100644 --- a/Sources/TUIKit/Views/Card.swift +++ b/Sources/TUIkit/Views/Card.swift @@ -1,6 +1,6 @@ // // Card.swift -// TUIKit +// TUIkit // // A styled container view with optional header, content, and footer. // diff --git a/Sources/TUIKit/Views/ContainerView.swift b/Sources/TUIkit/Views/ContainerView.swift similarity index 99% rename from Sources/TUIKit/Views/ContainerView.swift rename to Sources/TUIkit/Views/ContainerView.swift index f6b320b..85a3e01 100644 --- a/Sources/TUIKit/Views/ContainerView.swift +++ b/Sources/TUIkit/Views/ContainerView.swift @@ -1,6 +1,6 @@ // // ContainerView.swift -// TUIKit +// TUIkit // // A unified container component with Header/Body/Footer architecture. // @@ -283,13 +283,13 @@ extension ContainerView: Renderable { // Render body content let paddedContent = content.padding(padding) - let bodyBuffer = TUIKit.renderToBuffer(paddedContent, context: context) + let bodyBuffer = TUIkit.renderToBuffer(paddedContent, context: context) // Render footer if present let footerBuffer: FrameBuffer? if let footerView = footer { let paddedFooter = footerView.padding(EdgeInsets(horizontal: 1, vertical: 0)) - footerBuffer = TUIKit.renderToBuffer(paddedFooter, context: context) + footerBuffer = TUIkit.renderToBuffer(paddedFooter, context: context) } else { footerBuffer = nil } diff --git a/Sources/TUIKit/Views/Dialog.swift b/Sources/TUIkit/Views/Dialog.swift similarity index 99% rename from Sources/TUIKit/Views/Dialog.swift rename to Sources/TUIkit/Views/Dialog.swift index c60e8eb..911fcfe 100644 --- a/Sources/TUIKit/Views/Dialog.swift +++ b/Sources/TUIkit/Views/Dialog.swift @@ -1,6 +1,6 @@ // // Dialog.swift -// TUIKit +// TUIkit // // A modal dialog view with title, custom content, and optional footer. // diff --git a/Sources/TUIKit/Views/ForEach.swift b/Sources/TUIkit/Views/ForEach.swift similarity index 99% rename from Sources/TUIKit/Views/ForEach.swift rename to Sources/TUIkit/Views/ForEach.swift index e9997e8..1ed4ecf 100644 --- a/Sources/TUIKit/Views/ForEach.swift +++ b/Sources/TUIkit/Views/ForEach.swift @@ -1,6 +1,6 @@ // // ForEach.swift -// TUIKit +// TUIkit // // Iteration over data collections for view generation. // diff --git a/Sources/TUIKit/Views/Menu.swift b/Sources/TUIkit/Views/Menu.swift similarity index 99% rename from Sources/TUIKit/Views/Menu.swift rename to Sources/TUIkit/Views/Menu.swift index a3c04f4..30ca6e1 100644 --- a/Sources/TUIKit/Views/Menu.swift +++ b/Sources/TUIkit/Views/Menu.swift @@ -1,6 +1,6 @@ // // Menu.swift -// TUIKit +// TUIkit // // A menu view that displays a list of selectable items. // @@ -429,7 +429,7 @@ public struct AnyView: View { /// Creates an AnyView wrapping the given view. public init(_ view: V) { self._render = { context in - TUIKit.renderToBuffer(view, context: context) + TUIkit.renderToBuffer(view, context: context) } } diff --git a/Sources/TUIKit/Views/Panel.swift b/Sources/TUIkit/Views/Panel.swift similarity index 99% rename from Sources/TUIKit/Views/Panel.swift rename to Sources/TUIkit/Views/Panel.swift index 24e5fc4..13e775a 100644 --- a/Sources/TUIKit/Views/Panel.swift +++ b/Sources/TUIkit/Views/Panel.swift @@ -1,6 +1,6 @@ // // Panel.swift -// TUIKit +// TUIkit // // A titled container view with optional footer. // diff --git a/Sources/TUIKit/Views/Spacer.swift b/Sources/TUIkit/Views/Spacer.swift similarity index 99% rename from Sources/TUIKit/Views/Spacer.swift rename to Sources/TUIkit/Views/Spacer.swift index cab5173..beba680 100644 --- a/Sources/TUIKit/Views/Spacer.swift +++ b/Sources/TUIkit/Views/Spacer.swift @@ -1,6 +1,6 @@ // // Spacer.swift -// TUIKit +// TUIkit // // Flexible spacing elements for layout. // diff --git a/Sources/TUIKit/Views/Stacks.swift b/Sources/TUIkit/Views/Stacks.swift similarity index 99% rename from Sources/TUIKit/Views/Stacks.swift rename to Sources/TUIkit/Views/Stacks.swift index 92db27a..9cba044 100644 --- a/Sources/TUIKit/Views/Stacks.swift +++ b/Sources/TUIkit/Views/Stacks.swift @@ -1,6 +1,6 @@ // // Stacks.swift -// TUIKit +// TUIkit // // Layout containers for vertical and horizontal arrangement. // diff --git a/Sources/TUIKit/Views/StatusBar.swift b/Sources/TUIkit/Views/StatusBar.swift similarity index 99% rename from Sources/TUIKit/Views/StatusBar.swift rename to Sources/TUIkit/Views/StatusBar.swift index cb5fa70..01e5aab 100644 --- a/Sources/TUIKit/Views/StatusBar.swift +++ b/Sources/TUIkit/Views/StatusBar.swift @@ -1,6 +1,6 @@ // // StatusBar.swift -// TUIKit +// TUIkit // // A status bar that displays keyboard shortcuts and context-sensitive actions. // Always rendered at the bottom of the terminal, never dimmed by overlays. diff --git a/Sources/TUIKit/Views/Text.swift b/Sources/TUIkit/Views/Text.swift similarity index 98% rename from Sources/TUIKit/Views/Text.swift rename to Sources/TUIkit/Views/Text.swift index c9c8716..16ba884 100644 --- a/Sources/TUIKit/Views/Text.swift +++ b/Sources/TUIkit/Views/Text.swift @@ -1,13 +1,13 @@ // // Text.swift -// TUIKit +// TUIkit // // A view for displaying text in the terminal. // /// A view that displays text in the terminal. /// -/// `Text` is one of the most fundamental views in TUIKit. It displays +/// `Text` is one of the most fundamental views in TUIkit. It displays /// a string in the terminal and supports various formatting options. /// /// # Example diff --git a/Sources/TUIKitExample/AppState.swift b/Sources/TUIkitExample/AppState.swift similarity index 97% rename from Sources/TUIKitExample/AppState.swift rename to Sources/TUIkitExample/AppState.swift index abcd58c..9faa95f 100644 --- a/Sources/TUIKitExample/AppState.swift +++ b/Sources/TUIkitExample/AppState.swift @@ -1,11 +1,11 @@ // // AppState.swift -// TUIKitExample +// TUIkitExample // // Global state management for the example app. // -import TUIKit +import TUIkit // MARK: - Demo Page Enum diff --git a/Sources/TUIKitExample/Components/DemoSection.swift b/Sources/TUIkitExample/Components/DemoSection.swift similarity index 96% rename from Sources/TUIKitExample/Components/DemoSection.swift rename to Sources/TUIkitExample/Components/DemoSection.swift index 8a04811..fc82538 100644 --- a/Sources/TUIKitExample/Components/DemoSection.swift +++ b/Sources/TUIkitExample/Components/DemoSection.swift @@ -1,11 +1,11 @@ // // DemoSection.swift -// TUIKitExample +// TUIkitExample // // A reusable section component for organizing demo content. // -import TUIKit +import TUIkit /// A section with a styled title and content. /// diff --git a/Sources/TUIKitExample/Components/HeaderView.swift b/Sources/TUIkitExample/Components/HeaderView.swift similarity index 93% rename from Sources/TUIKitExample/Components/HeaderView.swift rename to Sources/TUIkitExample/Components/HeaderView.swift index 1ec9ec8..0e35dd2 100644 --- a/Sources/TUIKitExample/Components/HeaderView.swift +++ b/Sources/TUIkitExample/Components/HeaderView.swift @@ -1,11 +1,11 @@ // // HeaderView.swift -// TUIKitExample +// TUIkitExample // // A reusable header component for demo pages. // -import TUIKit +import TUIkit /// A styled header with title on the left and version on the right. /// @@ -36,7 +36,7 @@ struct HeaderView: View { .bold() .foregroundColor(.theme.accent) Spacer() - Text("TUIKit v\(tuiKitVersion)") + Text("TUIkit v\(tuiKitVersion)") .foregroundColor(.theme.foregroundTertiary) } if let subtitleText = subtitle { diff --git a/Sources/TUIKitExample/ContentView.swift b/Sources/TUIkitExample/ContentView.swift similarity index 98% rename from Sources/TUIKitExample/ContentView.swift rename to Sources/TUIkitExample/ContentView.swift index f1a2389..0900b26 100644 --- a/Sources/TUIKitExample/ContentView.swift +++ b/Sources/TUIkitExample/ContentView.swift @@ -1,11 +1,11 @@ // // ContentView.swift -// TUIKitExample +// TUIkitExample // // The main content view that routes between demo pages. // -import TUIKit +import TUIkit // MARK: - Content View (Page Router) diff --git a/Sources/TUIKitExample/Pages/ButtonsPage.swift b/Sources/TUIkitExample/Pages/ButtonsPage.swift similarity index 98% rename from Sources/TUIKitExample/Pages/ButtonsPage.swift rename to Sources/TUIkitExample/Pages/ButtonsPage.swift index e21c80c..cfa21b8 100644 --- a/Sources/TUIKitExample/Pages/ButtonsPage.swift +++ b/Sources/TUIkitExample/Pages/ButtonsPage.swift @@ -1,11 +1,11 @@ // // ButtonsPage.swift -// TUIKitExample +// TUIkitExample // // Demonstrates button and focus system capabilities. // -import TUIKit +import TUIkit /// Buttons and focus demo page. /// diff --git a/Sources/TUIKitExample/Pages/ColorsPage.swift b/Sources/TUIkitExample/Pages/ColorsPage.swift similarity index 98% rename from Sources/TUIKitExample/Pages/ColorsPage.swift rename to Sources/TUIkitExample/Pages/ColorsPage.swift index c25e011..a084b1c 100644 --- a/Sources/TUIKitExample/Pages/ColorsPage.swift +++ b/Sources/TUIkitExample/Pages/ColorsPage.swift @@ -1,11 +1,11 @@ // // ColorsPage.swift -// TUIKitExample +// TUIkitExample // // Demonstrates color capabilities. // -import TUIKit +import TUIkit /// Colors demo page. /// diff --git a/Sources/TUIKitExample/Pages/ContainersPage.swift b/Sources/TUIkitExample/Pages/ContainersPage.swift similarity index 99% rename from Sources/TUIKitExample/Pages/ContainersPage.swift rename to Sources/TUIkitExample/Pages/ContainersPage.swift index 55fc29e..45f57cb 100644 --- a/Sources/TUIKitExample/Pages/ContainersPage.swift +++ b/Sources/TUIkitExample/Pages/ContainersPage.swift @@ -1,11 +1,11 @@ // // ContainersPage.swift -// TUIKitExample +// TUIkitExample // // Demonstrates container view capabilities. // -import TUIKit +import TUIkit /// Container views demo page. /// diff --git a/Sources/TUIKitExample/Pages/LayoutPage.swift b/Sources/TUIkitExample/Pages/LayoutPage.swift similarity index 98% rename from Sources/TUIKitExample/Pages/LayoutPage.swift rename to Sources/TUIkitExample/Pages/LayoutPage.swift index 1bd017b..5642a80 100644 --- a/Sources/TUIKitExample/Pages/LayoutPage.swift +++ b/Sources/TUIkitExample/Pages/LayoutPage.swift @@ -1,11 +1,11 @@ // // LayoutPage.swift -// TUIKitExample +// TUIkitExample // // Demonstrates layout system capabilities. // -import TUIKit +import TUIkit /// Layout system demo page. /// diff --git a/Sources/TUIKitExample/Pages/MainMenuPage.swift b/Sources/TUIkitExample/Pages/MainMenuPage.swift similarity index 97% rename from Sources/TUIKitExample/Pages/MainMenuPage.swift rename to Sources/TUIkitExample/Pages/MainMenuPage.swift index f145799..34aed68 100644 --- a/Sources/TUIKitExample/Pages/MainMenuPage.swift +++ b/Sources/TUIkitExample/Pages/MainMenuPage.swift @@ -1,11 +1,11 @@ // // MainMenuPage.swift -// TUIKitExample +// TUIkitExample // // The main menu page with navigation to all demos. // -import TUIKit +import TUIkit /// The main menu page. /// @@ -17,7 +17,7 @@ struct MainMenuPage: View { VStack(spacing: 1) { HeaderView( - title: "TUIKit Example App", + title: "TUIkit Example App", subtitle: "A SwiftUI-like framework for Terminal User Interfaces" ) diff --git a/Sources/TUIKitExample/Pages/OverlaysPage.swift b/Sources/TUIkitExample/Pages/OverlaysPage.swift similarity index 98% rename from Sources/TUIKitExample/Pages/OverlaysPage.swift rename to Sources/TUIkitExample/Pages/OverlaysPage.swift index e49d711..3a0b51e 100644 --- a/Sources/TUIKitExample/Pages/OverlaysPage.swift +++ b/Sources/TUIkitExample/Pages/OverlaysPage.swift @@ -1,11 +1,11 @@ // // OverlaysPage.swift -// TUIKitExample +// TUIkitExample // // Demonstrates overlay and modal capabilities. // -import TUIKit +import TUIkit /// Overlays and modals demo page. /// diff --git a/Sources/TUIKitExample/Pages/TextStylesPage.swift b/Sources/TUIkitExample/Pages/TextStylesPage.swift similarity index 97% rename from Sources/TUIKitExample/Pages/TextStylesPage.swift rename to Sources/TUIkitExample/Pages/TextStylesPage.swift index f4eee21..c6d23b8 100644 --- a/Sources/TUIKitExample/Pages/TextStylesPage.swift +++ b/Sources/TUIkitExample/Pages/TextStylesPage.swift @@ -1,11 +1,11 @@ // // TextStylesPage.swift -// TUIKitExample +// TUIkitExample // // Demonstrates text styling capabilities. // -import TUIKit +import TUIkit /// Text styles demo page. /// diff --git a/Sources/TUIKitExample/main.swift b/Sources/TUIkitExample/main.swift similarity index 66% rename from Sources/TUIKitExample/main.swift rename to Sources/TUIkitExample/main.swift index 11da2fc..b09c3a5 100644 --- a/Sources/TUIKitExample/main.swift +++ b/Sources/TUIkitExample/main.swift @@ -1,14 +1,14 @@ // // main.swift -// TUIKitExample +// TUIkitExample // -// Entry point for the TUIKit example application. +// Entry point for the TUIkit example application. // -// This app demonstrates TUIKit capabilities through various demo pages. +// This app demonstrates TUIkit capabilities through various demo pages. // Use the menu to navigate between demos. // -import TUIKit +import TUIkit // MARK: - Main App diff --git a/Tests/TUIKitTests/AppearanceTests.swift b/Tests/TUIkitTests/AppearanceTests.swift similarity index 99% rename from Tests/TUIKitTests/AppearanceTests.swift rename to Tests/TUIkitTests/AppearanceTests.swift index 9885ddf..97ac17e 100644 --- a/Tests/TUIKitTests/AppearanceTests.swift +++ b/Tests/TUIkitTests/AppearanceTests.swift @@ -1,13 +1,13 @@ // // AppearanceTests.swift -// TUIKit +// TUIkit // // Tests for the Appearance system. // import Testing -@testable import TUIKit +@testable import TUIkit // MARK: - Appearance Tests diff --git a/Tests/TUIKitTests/ButtonTests.swift b/Tests/TUIkitTests/ButtonTests.swift similarity index 99% rename from Tests/TUIKitTests/ButtonTests.swift rename to Tests/TUIkitTests/ButtonTests.swift index 309135a..94bfccc 100644 --- a/Tests/TUIKitTests/ButtonTests.swift +++ b/Tests/TUIkitTests/ButtonTests.swift @@ -1,13 +1,13 @@ // // ButtonTests.swift -// TUIKit +// TUIkit // // Tests for Button, ButtonStyle, and ButtonRow views. // import Testing -@testable import TUIKit +@testable import TUIkit // MARK: - Test Helpers diff --git a/Tests/TUIKitTests/ColorTests.swift b/Tests/TUIkitTests/ColorTests.swift similarity index 98% rename from Tests/TUIKitTests/ColorTests.swift rename to Tests/TUIkitTests/ColorTests.swift index af69736..6ffe02e 100644 --- a/Tests/TUIKitTests/ColorTests.swift +++ b/Tests/TUIkitTests/ColorTests.swift @@ -1,13 +1,13 @@ // // ColorTests.swift -// TUIKit +// TUIkit // // Tests for the Color system and ANSI rendering. // import Testing -@testable import TUIKit +@testable import TUIkit @Suite("Color Tests") struct ColorTests { diff --git a/Tests/TUIKitTests/ContainerViewTests.swift b/Tests/TUIkitTests/ContainerViewTests.swift similarity index 99% rename from Tests/TUIKitTests/ContainerViewTests.swift rename to Tests/TUIkitTests/ContainerViewTests.swift index 68ec174..3892442 100644 --- a/Tests/TUIKitTests/ContainerViewTests.swift +++ b/Tests/TUIkitTests/ContainerViewTests.swift @@ -1,13 +1,13 @@ // // ContainerViewTests.swift -// TUIKit +// TUIkit // // Tests for container views: Alert, Dialog, Menu. // import Testing -@testable import TUIKit +@testable import TUIkit @Suite("Alert Tests") struct AlertTests { diff --git a/Tests/TUIKitTests/FocusTests.swift b/Tests/TUIkitTests/FocusTests.swift similarity index 99% rename from Tests/TUIKitTests/FocusTests.swift rename to Tests/TUIkitTests/FocusTests.swift index 256852d..9d17ac8 100644 --- a/Tests/TUIKitTests/FocusTests.swift +++ b/Tests/TUIkitTests/FocusTests.swift @@ -1,6 +1,6 @@ // // FocusTests.swift -// TUIKit +// TUIkit // // Tests for the focus management system. // @@ -8,7 +8,7 @@ import Foundation import Testing -@testable import TUIKit +@testable import TUIkit // MARK: - Mock Focusable diff --git a/Tests/TUIKitTests/FrameBufferTests.swift b/Tests/TUIkitTests/FrameBufferTests.swift similarity index 99% rename from Tests/TUIKitTests/FrameBufferTests.swift rename to Tests/TUIkitTests/FrameBufferTests.swift index 7e4a43d..ae77b7e 100644 --- a/Tests/TUIKitTests/FrameBufferTests.swift +++ b/Tests/TUIkitTests/FrameBufferTests.swift @@ -1,13 +1,13 @@ // // FrameBufferTests.swift -// TUIKit +// TUIkit // // Tests for FrameBuffer operations and compositing. // import Testing -@testable import TUIKit +@testable import TUIkit @Suite("FrameBuffer Tests") struct FrameBufferTests { diff --git a/Tests/TUIKitTests/RenderingTests.swift b/Tests/TUIkitTests/RenderingTests.swift similarity index 99% rename from Tests/TUIKitTests/RenderingTests.swift rename to Tests/TUIkitTests/RenderingTests.swift index 9343ce3..cd4f649 100644 --- a/Tests/TUIKitTests/RenderingTests.swift +++ b/Tests/TUIkitTests/RenderingTests.swift @@ -1,13 +1,13 @@ // // RenderingTests.swift -// TUIKit +// TUIkit // // Tests for view rendering and layout. // import Testing -@testable import TUIKit +@testable import TUIkit @Suite("Rendering Tests") struct RenderingTests { diff --git a/Tests/TUIKitTests/StatusBarTests.swift b/Tests/TUIkitTests/StatusBarTests.swift similarity index 99% rename from Tests/TUIKitTests/StatusBarTests.swift rename to Tests/TUIkitTests/StatusBarTests.swift index 3406411..1d85fbc 100644 --- a/Tests/TUIKitTests/StatusBarTests.swift +++ b/Tests/TUIkitTests/StatusBarTests.swift @@ -1,14 +1,14 @@ // swiftlint:disable file_length // // StatusBarTests.swift -// TUIKit +// TUIkit // // Tests for Shortcut constants, StatusBarItem, StatusBarManager, and StatusBar. // import Testing -@testable import TUIKit +@testable import TUIkit // MARK: - Shortcut Constants Tests diff --git a/Tests/TUIKitTests/TViewTests.swift b/Tests/TUIkitTests/TViewTests.swift similarity index 99% rename from Tests/TUIKitTests/TViewTests.swift rename to Tests/TUIkitTests/TViewTests.swift index d8e7c34..627ff30 100644 --- a/Tests/TUIKitTests/TViewTests.swift +++ b/Tests/TUIkitTests/TViewTests.swift @@ -1,13 +1,13 @@ // // ViewTests.swift -// TUIKit +// TUIkit // // Tests for the View protocol, ViewBuilder, and basic views. // import Testing -@testable import TUIKit +@testable import TUIkit @Suite("View Protocol Tests") struct ViewTests { diff --git a/papers/project_analysis.md b/papers/project_analysis.md index 921da6c..5434163 100644 --- a/papers/project_analysis.md +++ b/papers/project_analysis.md @@ -1,4 +1,4 @@ -# TUIKit - Comprehensive Project Analysis +# TUIkit - Comprehensive Project Analysis **Date:** 2026-01-30 **Scope:** Full codebase review (66 Swift files) @@ -8,7 +8,7 @@ ## Executive Summary -TUIKit is a well-architected declarative Swift framework for building terminal UIs. The SwiftUI-inspired API design is clean, consistent, and idiomatic. Documentation is above average for a personal project. However, the codebase suffers from **significant code duplication** across Views and Modifiers, an **overreliance on singletons** that hinders testability, and several **thread-safety issues** with `@unchecked Sendable` types. The most impactful improvements would be extracting shared rendering logic into utilities, replacing singletons with dependency injection, and expanding test coverage for Views and Modifiers. +TUIkit is a well-architected declarative Swift framework for building terminal UIs. The SwiftUI-inspired API design is clean, consistent, and idiomatic. Documentation is above average for a personal project. However, the codebase suffers from **significant code duplication** across Views and Modifiers, an **overreliance on singletons** that hinders testability, and several **thread-safety issues** with `@unchecked Sendable` types. The most impactful improvements would be extracting shared rendering logic into utilities, replacing singletons with dependency injection, and expanding test coverage for Views and Modifiers. --- @@ -319,7 +319,7 @@ Marked as "Fixed Frame Modifier (Legacy)". `FlexibleFrameView` is the active imp --- -### C.5 TODO Placeholder — `TUIKit.swift` (Low) +### C.5 TODO Placeholder — `TUIkit.swift` (Low) ```swift return 0 // TODO: Return actual line count @@ -818,14 +818,14 @@ The same bug exists in `AppearanceManager.setAppearance()`. | C.2 | `FrameModifier` legacy code | Dead Code | Medium | FrameModifier.swift | | C.3 | Panel `body` dead code | Dead Code | Medium | Panel.swift | | C.4 | Common Preference Keys likely unused | Dead Code | Low | Preferences.swift | -| C.5 | TODO placeholder return 0 | Dead Code | Low | TUIKit.swift | +| C.5 | TODO placeholder return 0 | Dead Code | Low | TUIkit.swift | | C.6 | Menu pointless ternary `4 : 4` | Dead Code | Low | Menu.swift | | C.7 | Menu identical if/else branches | Dead Code | Low | Menu.swift | | C.8 | `_ = self` anti-pattern | Dead Code | Low | App.swift | | E.1 | Public types missing doc comments | Documentation | Medium | Multiple | | E.2 | Complex logic without inline comments | Documentation | Medium | KeyEvent, FrameBuffer, ViewRenderer | | E.3 | Missing contributor documentation | Documentation | Medium | Project root | -| E.4 | Example app missing demonstrations | Documentation | Low | TUIKitExample | +| E.4 | Example app missing demonstrations | Documentation | Low | TUIkitExample | | F.1 | 60+ magic hex values in KeyEvent | Constants | High | KeyEvent.swift | | F.2 | ANSI style codes as magic strings | Constants | Medium | ANSIRenderer.swift | | F.3 | Block characters scattered | Constants | Medium | Multiple |