### Install and Run SvelTUI Example Source: https://github.com/rlabs-inc/sveltui/blob/main/README.md Installs project dependencies using Bun and then runs the example application. This is the initial setup step for using SvelTUI. ```bash bun install bun run example ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Create SvelteKit Project using `sv create` Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte-kit.txt Scaffolds a new SvelteKit project, installs dependencies, and starts a development server. It prompts for tooling setup like TypeScript and initializes the project in a specified directory. ```bash npx sv create my-app cd my-app npm install npm run dev ``` -------------------------------- ### Svelte Check START Record Example Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/cli.txt Demonstrates the 'START' record format, indicating the workspace folder. This is the first line of output in machine-readable modes. ```text 1590680325583 START "/home/user/language-tools/packages/language-server/test/plugins/typescript/testfiles" ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Project Setup with npm Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/guardian-ai-mvp/03-implementation-phases.md Initializes a new Node.js project, sets up TypeScript, and provides an example of how to structure tests for the configuration system. This phase focuses on establishing the foundational project structure and essential utilities. ```bash # Create project structure mkdir guardian-ai-mvp cd guardian-ai-mvp npm init -y # Install dependencies and setup TypeScript ``` ```typescript // Example test structure describe('Configuration System', () => { it('loads default configuration', () => { const config = loadConfig() expect(config.project.name).toBeDefined() }) it('merges project-specific configuration', () => { // Test configuration hierarchy }) }) ``` -------------------------------- ### Untitled No description -------------------------------- ### Run Basic Test Example with Bun Source: https://github.com/rlabs-inc/sveltui/blob/main/examples-backup/README-test-examples.md Launches the basic test example for SvelTUI components using Bun. This example demonstrates basic Box and Text component rendering. ```bash bun --conditions browser examples/basic-test-launcher.ts ``` -------------------------------- ### Install and Run SvelTUI Project Commands Source: https://github.com/rlabs-inc/sveltui/blob/main/CLAUDE.md Common bash commands for managing the SvelTUI project, including installing dependencies, running the development server, building the library, executing example applications, and running tests. These commands utilize the 'bun' package manager. ```bash # Install dependencies bun install # Run the development server with auto-reload bun run dev # Build the library bun run build # Run the example application (uses Svelte 5 client-side) bun run example # Run tests bun test ``` -------------------------------- ### Untitled No description -------------------------------- ### SvelteKit Project Creation using npx Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte.txt This command-line snippet shows how to create a new SvelteKit project using the `npx` command. It outlines the steps to generate a project, navigate into its directory, install dependencies, and start the development server. ```bash npx sv create myapp cd myapp npm install npm run dev ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Run TextInput Test Example with Bun Source: https://github.com/rlabs-inc/sveltui/blob/main/examples-backup/README-test-examples.md Launches the TextInput test example using Bun. This example tests the TextInput component's focus, input binding, and submission handling. ```bash bun --conditions browser examples/text-input-test-launcher.ts ``` -------------------------------- ### SvelTUI Example Launcher Script Source: https://github.com/rlabs-inc/sveltui/blob/main/examples/README.md A bash command to run a compiled SvelTUI example using Bun. It specifies browser conditions for Svelte 5 client-side compatibility and assumes the launcher script is available. ```bash bun --conditions browser examples/[example-name]-launcher.ts ``` -------------------------------- ### Run ScrollableList Test Example with Bun Source: https://github.com/rlabs-inc/sveltui/blob/main/examples-backup/README-test-examples.md Launches the ScrollableList test example using Bun. This example tests keyboard navigation, selection handling, and item display within a scrollable list. ```bash bun --conditions browser examples/scrollable-list-test-launcher.ts ``` -------------------------------- ### Untitled No description -------------------------------- ### Complete SvelTUI Themed App Setup in TypeScript Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/THEMING.md A comprehensive example of initializing a SvelTUI application with a theme. It attempts to load a custom theme, falls back to `DarkTheme`, and then renders a basic UI structure including boxes and text elements styled according to the active theme. ```typescript import { initializeScreen, render, setTheme, loadTheme, DarkTheme, } from "sveltui"; // Try to load a custom theme, fall back to dark theme const customTheme = loadTheme("./themes/custom.yaml"); setTheme(customTheme || DarkTheme); // Create the UI const screen = initializeScreen({ title: "Themed App" }); const main = render("box", { width: "100%", height: "100%", border: true, }); // Create a panel using the surface color const panel = render("box", { parent: main.element, width: "80%", height: "50%", top: "center", left: "center", border: true, type: "panel", // This will use the surface color }); render("text", { parent: panel.element, top: "center", left: "center", content: "This text uses the theme's foreground color", }); render("text", { parent: panel.element, top: "center+2", left: "center", content: "This text uses the muted color", muted: true, }); screen.render(); ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Initialize Database Connection on Server Start Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte-kit.txt Defines an asynchronous initialization function for the server environment. This function is intended for one-time setup tasks, such as establishing a database connection, and runs when the server starts. ```javascript /// file: src/hooks.server.js import * as db from '$lib/server/database'; /** @type {import('@sveltejs/kit').ServerInit} */ export async function init() { await db.connect(); } ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Running SvelTUI Streaming Demos with Bun Source: https://github.com/rlabs-inc/sveltui/blob/main/src/streaming/README.md Provides command-line instructions using Bun to run the provided streaming system examples. It includes commands for launching both a simple streaming demo and a more advanced backpressure demonstration, specifying the browser environment. ```bash # Simple streaming demo bun --conditions browser examples/streaming-simple-launcher.ts # Advanced backpressure demo bun --conditions browser examples/streaming-backpressure-launcher.ts ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### SvelteKit Form with GET Method for Client-Side Routing Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte-kit.txt An example of a Svelte form using the GET method, which is suitable for search inputs or forms that do not need to send data to the server via an action. Submitting this form will trigger client-side routing to the specified action URL with query parameters. ```html
``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Read imported asset from filesystem Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte-kit.txt Reads the content of an imported asset from the filesystem. The `read` function returns a Response object, which can then be processed, for example, to get its text content. ```javascript // @errors: 7031 import { read } from '$app/server'; import somefile from './somefile.txt'; const asset = read(somefile); const text = await asset.text(); ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Get DOM node reference with `bind:this` in Svelte Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte.txt This Svelte example illustrates how to get a direct reference to a DOM node using the `bind:this` directive. The reference is available after the component mounts, typically used within effects or event handlers for direct DOM manipulation or interaction. The `canvas` element and `getContext('2d')` are common use cases. ```svelte bind:this={dom_node} ``` ```svelte ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Configure SvelteKit Netlify Adapter (Default) Source: https://github.com/rlabs-inc/sveltui/blob/main/docs/svelte5/svelte-kit.txt Configures the SvelteKit adapter for Netlify deployment. This setup uses standard Node-based Netlify Functions. The adapter is installed via npm and configured in svelte.config.js. ```javascript import adapter from '@sveltejs/adapter-netlify'; export default { kit: { // default options are shown adapter: adapter({ // if true, will create a Netlify Edge Function rather // than using standard Node-based functions edge: false, // if true, will split your app into multiple functions // instead of creating a single one for the entire app. // if `edge` is true, this option cannot be used split: false }) } }; ``` -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description -------------------------------- ### Untitled No description