### Main lib.rs Example in Getting Started Guide Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/template-processors-module/test-plan.md Illustrates the main lib.rs example in the SDK getting started guide, showing direct use of Oscillator and wrapping built-in Gain. ```rust use wavecraft::SignalChain; use wavecraft_dsp::{Gain, Oscillator}; SignalChain![InputGain => Gain, Oscillator, OutputGain => Gain]; ``` -------------------------------- ### Check SDK Getting Started Guide for CLI Workflow Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/open-source-readiness/test-plan.md Searches the SDK getting started guide for references to the `wavecraft new` command to ensure it reflects the current CLI workflow. ```bash cat /Users/ronhouben/code/private/wavecraft/docs/guides/sdk-getting-started.md | grep "wavecraft new" ``` -------------------------------- ### Developer Workflow: Getting Started Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/developer-sdk/low-level-design-developer-sdk.md Follow these steps to set up the development environment, including cloning the template, installing dependencies, and running the development server with hot reload. ```bash # 1. Clone template (5 min) git clone https://github.com/vstkit/vstkit-plugin-template my-plugin cd my-plugin # 2. Install dependencies (5 min) cd ui && npm install && cd .. # 3. Run dev environment (2 min) cargo xtask dev # Opens browser at localhost:5173 with hot reload # WebSocket connects to Rust engine # 4. Modify DSP code, see changes (ongoing) # Edit engine/src/dsp.rs # UI updates via WebSocket # 5. Build and test in DAW (5 min) cargo xtask bundle --install # Opens Ableton Live with plugin loaded ``` -------------------------------- ### SDK Getting Started Guide - Updating Dependencies Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-version-and-update/low-level-design-cli-version-and-update.md Provides instructions for users on how to update project dependencies using the wavecraft update command. ```markdown ## Updating Dependencies To update all dependencies in your plugin project: ```bash cd my-awesome-plugin wavecraft update ``` This updates: - Rust crates in `engine/Cargo.lock` - npm packages in `ui/package-lock.json` **Note:** Commit your changes before running updates to make it easy to review lock file changes via `git diff`. ``` -------------------------------- ### Quick Start: Clone and Setup Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/plugin-skeleton/low-level-design-plugin-skeleton.md Initial setup commands for the project, including cloning the repository and setting up necessary Rust toolchain targets for cross-compilation. ```bash # Clone and setup cd vstkit rustup target add x86_64-apple-darwin aarch64-apple-darwin # macOS rustup target add x86_64-pc-windows-msvc # Windows (cross-compile) # Navigate to engine workspace cd engine ``` -------------------------------- ### Bash: Example Invocations for `wavecraft start` Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/low-level-design-cli-start-command.md Provides practical examples of how to invoke the `wavecraft start` command with different options, including default settings, custom ports, and flags for dependency management and verbosity. ```bash # Default: ports 9000 + 5173, prompt if deps missing wavecraft start # Custom ports wavecraft start --port 8000 --ui-port 3000 # CI/scripting: auto-install deps wavecraft start --install # CI/scripting: fail fast if deps missing wavecraft start --no-install # Debug mode wavecraft start --verbose ``` -------------------------------- ### Next Steps After `wavecraft create` Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/user-stories.md Example output for the `wavecraft create` command, guiding users to use the new `wavecraft start` command for development. ```bash Next steps: cd my_plugin wavecraft start # Start development servers ``` -------------------------------- ### Wavecraft Start Command Help Output Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/test-plan.md The `wavecraft start --help` command displays all available options for starting the development servers, including port configurations and dependency installation flags. ```bash Start development servers (WebSocket + UI) Usage: wavecraft start [OPTIONS] Options: -p, --port WebSocket server port (default: 9000) [default: 9000] --ui-port Vite UI server port (default: 5173) [default: 5173] --install Auto-install npm dependencies without prompting --no-install Fail if node_modules is missing (CI mode, no prompts) -v, --verbose Show verbose output from servers -h, --help Print help ``` -------------------------------- ### Setup SDK Contributor Dev Mode Source: https://github.com/ronhouben/wavecraft/blob/main/CONTRIBUTING.md Initialize the SDK template and start development servers for the engine and UI. ```bash ./scripts/setup-dev-template.sh # materialize .template files + install sdk-template/ui deps cargo xtask dev # runs dev servers against sdk-template/engine + sdk-template/ui ``` -------------------------------- ### Auto-Install Dependencies with `wavecraft start --install` Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/user-stories.md Starts the development servers and automatically runs `npm install` in the `ui/` directory if dependencies are missing, without prompting the user. ```bash wavecraft start --install ``` -------------------------------- ### Search for npm package references in SDK Guide Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/open-source-readiness/test-plan-npm-packages.md Checks the SDK Getting Started guide for correct references to `@wavecraft/core` and `@wavecraft/components` and ensures older package names are not present. ```bash grep -E "@wavecraft/(core|components)" docs/guides/sdk-getting-started.md ``` -------------------------------- ### Dev Server Builder API Example Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/dev-server-unification/implementation-plan.md Demonstrates how to use the new builder API to configure and start the development server. Requires importing `DevServer` and `AudioConfig`. ```rust use dev_server::{DevServer, AudioConfig}; let dev_server = DevServer::builder() .parameters(params) .ws_port(9000) .engine_dir(engine_dir) .verbose(true) .audio_config(AudioConfig { sample_rate: 44100.0, buffer_size: 512, }) .plugin_loader(loader) .sidecar_writer(Box::new(move |params| { write_sidecar_cache(&engine_dir, params) })) .build()?; let (session, shutdown_rx) = dev_server.start().await?; ``` -------------------------------- ### Start Development Servers Source: https://github.com/ronhouben/wavecraft/blob/main/docs/guides/sdk-getting-started.md Starts the WebSocket and UI development servers for live development. Options are available to specify custom ports for the WebSocket and UI servers, and to automatically install UI dependencies if they are missing. ```bash wavecraft start ``` ```bash wavecraft start --port 9010 ``` ```bash wavecraft start --ui-port 5174 ``` ```bash wavecraft start --install ``` -------------------------------- ### Dev Server Startup Flow Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/sdk-example-plugin/low-level-design-sdk-example-plugin.md Illustrates the sequence of commands and function calls when starting the development server in SDK mode. This flow includes detecting the SDK mode, building the example plugin, and initiating various development servers. ```text 1. cargo xtask dev └─► xtask::commands::dev::run() └─► cargo run --manifest-path ../cli/Cargo.toml --features audio-dev -- start 2. StartCommand::execute() └─► ProjectMarkers::detect(&cwd) // cwd = SDK root ├─ finds engine/Cargo.toml → [workspace] → SDK mode └─ engine_dir = engine/crates/wavecraft-example/ 3. load_parameters(engine_dir) ├─ try_read_cached_params() → cache miss (first run) ├─ cargo build --lib --features _param-discovery --package wavecraft-example │ ├─ current_dir = engine/crates/wavecraft-example/ │ └─ output → engine/target/debug/libwavecraft_example.dylib ├─ find_plugin_dylib(engine_dir) │ └─ resolve_debug_dir → engine/target/debug/ (workspace fallback) │ → libwavecraft_example.dylib └─ PluginLoader::load() → extract parameters → write sidecar cache 4. run_dev_servers() ├─ Start WebSocket server (port 9000) ├─ Start DevSession (watches engine/crates/wavecraft-example/src/) ├─ Try audio in-process (loads vtable from dylib) └─ Start Vite UI dev server (port 5173) ``` -------------------------------- ### Setup Development Template Source: https://github.com/ronhouben/wavecraft/blob/main/docs/architecture/development-workflows.md Script to set up the development template for SDK mode. This script materializes manifests, applies defaults, rewrites dependencies, and installs UI dependencies. ```bash ./scripts/setup-dev-template.sh ``` -------------------------------- ### Build Script Usage Examples Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/plugin-skeleton/implementation-progress.md Demonstrates various ways to use the build script for cleaning, installing, testing, and building AU plugins. ```bash ./scripts/build.sh --clean --all ``` ```bash ./scripts/build.sh --install ``` ```bash ./scripts/build.sh --clean --test --au --install ``` ```bash ./scripts/build.sh --help ``` -------------------------------- ### SDK Template Dev Audio Example Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/dev-audio-os-input/implementation-constraints-os-audio.md The SDK template must include a complete, working `dev-audio.rs` example. This ensures new users have a functional starting point with clear instructions and error handling. ```text cli/sdk-templates/new-project/react/engine/src/bin/dev-audio.rs.template Should contain: - Complete working example - Instantiation of template's Processor - Config loading - Error handling - Helpful comments ``` -------------------------------- ### Minimal Plugin Setup with Gain Processor Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/declarative-plugin-dsl/user-stories.md Create a basic VST3/CLAP plugin with a gain parameter using minimal code. This is the recommended starting point for new developers. ```rust use wavecraft::prelude::*; wavecraft_processor!(MyGain => Gain); wavecraft_plugin! { name: "My First Plugin", vendor: "My Company", signal: Chain![ MyGain { level: 0.0 }, ], } ``` -------------------------------- ### Wavecraft CLI Commands for Different Development Modes Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/dev-audio-os-input/architect-response-os-audio.md Provides examples of CLI commands to start the development server with different configurations, including OS audio integration and WASM support. ```bash wavecraft start # Browser (synthetic meters) wavecraft start --with-audio # OS audio integration testing wavecraft start --wasm # Browser WASM audio (future) ``` -------------------------------- ### Oscillator Code Example in Getting Started Guide Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/template-processors-module/test-plan.md Presents the complete and correct oscillator code example as featured in the SDK getting started guide. ```rust use wavecraft::ProcessorParams; use wavecraft_dsp::{ParamRange, Processor, Transport}; #[derive(ProcessorParams, Default, Clone)] pub struct OscillatorParams { #[param(min = 20.0, max = 5000.0, default = 440.0, unit = "Hz", factor = 2.5)] pub frequency: f32, #[param(min = 0.0, max = 1.0, default = 0.5, unit = "%")] pub level: f32, } pub struct Oscillator { phase: f32, sample_rate: f32, } impl Oscillator { pub fn new() -> Self { Oscillator { phase: 0.0, sample_rate: 44100.0 } } } impl Processor for Oscillator { type Params = OscillatorParams; fn set_sample_rate(&mut self, sample_rate: f32) { self.sample_rate = sample_rate; } fn reset(&mut self) { self.phase = 0.0; } fn process(&mut self, params: &Self::Params, _transport: &Transport) -> f32 { // Phase accumulation with wraparound self.phase = (self.phase + params.frequency / self.sample_rate).fract(); // Sine wave calculation let sine = (2.0 * std::f32::consts::PI * self.phase).sin(); // Apply level sine * params.level } } ``` -------------------------------- ### VstKit Documentation Structure Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/developer-sdk/low-level-design-developer-sdk.md Outlines the directory structure for VstKit documentation, categorizing content into getting started, concepts, guides, API references, and examples. ```tree docs/ ├── getting-started.md ← 15-minute quickstart ├── concepts/ │ ├── architecture.md ← How VstKit works │ ├── parameters.md ← Parameter system deep dive │ ├── ui-bridge.md ← UI ↔ Engine communication │ └── real-time-safety.md ← Audio thread constraints │ ├── guides/ │ ├── custom-dsp.md ← Implementing your DSP │ ├── custom-ui.md ← Customizing the React UI │ ├── macos-signing.md ← Code signing and notarization │ └── debugging.md ← Common issues and solutions │ ├── api/ │ ├── rust/ ← Generated from rustdoc │ └── typescript/ ← Generated from TypeDoc │ └── examples/ ├── gain-plugin/ ← Minimal example ├── eq-plugin/ ← Multi-band EQ └── delay-plugin/ ← Stateful DSP example ``` -------------------------------- ### Adding a Processor Step 4 in Getting Started Guide Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/template-processors-module/test-plan.md Details step 4 of adding a processor in the SDK getting started guide, showing direct use of custom processors in SignalChain. ```rust use processors::{Oscillator, Filter}; // Custom processors are used directly in SignalChain (no wavecraft_processor! wrapper needed) SignalChain![InputGain, Oscillator, Filter, OutputGain]; ``` -------------------------------- ### Verify SDK Documentation Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/developer-sdk/test-plan.md Check for the existence and content of SDK architecture documentation and the getting started guide. Also, verify that the README file contains the correct link to the SDK getting started guide. ```bash cat /Users/ronhouben/code/private/vstkit/docs/architecture/high-level-design.md | grep -A 50 "SDK Architecture" ``` ```bash ls -la /Users/ronhouben/code/private/vstkit/docs/guides/sdk-getting-started.md ``` ```bash grep "SDK Getting Started" /Users/ronhouben/code/private/vstkit/README.md ``` -------------------------------- ### Update SDK Getting Started Descriptions Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/docs-split-architecture/implementation-plan.md Updates descriptions for 'High-Level Design' and 'Coding Standards' in the SDK getting started guide to provide more comprehensive information. ```markdown - **[High-Level Design](../architecture/high-level-design.md)** — Architecture overview and detailed topic docs - **[Coding Standards](../architecture/coding-standards.md)** — Coding conventions and language-specific guides ``` -------------------------------- ### Create and Start a New Plugin Project Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-ui-assets/test-plan.md Steps to create a new plugin using the CLI and then start it, verifying that `wavecraft start` does not fail when `ui/dist` is missing. ```bash cargo run --manifest-path cli/Cargo.toml -- create MyPlugin cd MyPlugin cargo run --manifest-path /Users/ronhouben/code/private/wavecraft/cli/Cargo.toml -- start ``` -------------------------------- ### Start UI Development Server Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/code-quality-polish/test-plan.md Start the development server for the UI. ```bash cd ui && npm run dev ``` -------------------------------- ### Bash: Error Message - Dependencies Missing (--no-install) Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/low-level-design-cli-start-command.md Shows the error output when `wavecraft start --no-install` is run and dependencies are not found, guiding the user to install them manually or use the `--install` flag. ```bash $ wavecraft start --no-install Error: Dependencies not installed. Run `npm install` in the ui/ directory, or use `wavecraft start --install` to install automatically. ``` -------------------------------- ### @wavecraft/core Package README Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/open-source-readiness/implementation-plan-npm-ui-package.md Documentation for the core Wavecraft SDK package, including installation, quick start examples, and API references for hooks and utilities. ```APIDOC ## @wavecraft/core Core SDK for Wavecraft audio plugins — IPC bridge, hooks, and utilities. ### Installation ```bash npm install @wavecraft/core ``` ### Quick Start ```tsx import { useParameter, useMeterFrame, logger } from '@wavecraft/core'; function MyComponent() { const { param, setValue } = useParameter('gain'); const meterFrame = useMeterFrame(); return ( setValue(parseFloat(e.target.value))} /> ); } ``` ### API Reference #### Hooks | Hook | Description | |------|-------------| | `useParameter(id)` | Get/set a single parameter | | `useAllParameters()` | Get all plugin parameters | | `useParameterGroups()` | Get parameters organized by group | | `useMeterFrame()` | Get current audio meter levels | | `useConnectionStatus()` | Monitor IPC connection status | | `useRequestResize()` | Request plugin window resize | #### Utilities ```typescript import { linearToDb, dbToLinear } from '@wavecraft/core/meters'; linearToDb(0.5); // → -6.02 dB dbToLinear(-6); // → 0.501 ``` ### Advanced: IPC Bridge For custom implementations: ```typescript import { IpcBridge, ParameterClient } from '@wavecraft/core'; ``` ### Requirements - React 18+ ### License MIT ``` -------------------------------- ### Start SDK Dev Server Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/sdk-example-plugin/test-plan.md Initiate the development server from the SDK root directory. This command builds the `wavecraft-example` crate, starts a WebSocket server for communication, and launches a UI development server. ```bash cd /Users/ronhouben/code/private/wavecraft cargo xtask dev ``` -------------------------------- ### Dependency Detection with --no-install Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/test-plan.md When `ui/node_modules` is missing, running `wavecraft start --no-install` should fail with a specific error message guiding the user to install dependencies. ```bash Error: Dependencies not installed. Run `npm install` in the ui/ directory, or use `wavecraft start --install` to install automatically. Exit: 1 ``` -------------------------------- ### Start Development Server Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/websocket-ipc-bridge/test-plan.md Use this command to start the development servers for the project. ```bash cargo run -p xtask -- dev ``` -------------------------------- ### Standalone Binary Help Output Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/websocket-ipc-bridge/test-plan.md Example output of the --help command for the standalone binary, showing available options and descriptions. ```text VstKit standalone app for UI development and testing Usage: standalone [OPTIONS] Options: --dev-server Run in dev server mode (headless, WebSocket only) --port WebSocket server port (default: 9000) [default: 9000] --verbose Show verbose output (all JSON-RPC messages) -h, --help Print help ``` -------------------------------- ### Check SDK Development Documentation Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-auto-local-sdk/test-plan.md Verifies the content of the SDK Getting Started guide, specifically the 'SDK Development (Contributing to Wavecraft)' section. This ensures that auto-detection behavior, its triggers, and manual overrides are clearly documented. ```markdown docs/guides/sdk-getting-started.md ``` -------------------------------- ### Skip Dependency Installation with `wavecraft start --no-install` Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/user-stories.md Starts the development servers without checking for or installing missing dependencies. The command will fail if `node_modules` is not present. ```bash wavecraft start --no-install ``` -------------------------------- ### Bash: `wavecraft start` Command Help Output Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/low-level-design-cli-start-command.md Displays the help message for the `start` command, outlining its usage, available options, and default values. ```bash $ wavecraft start --help Start development servers for UI iteration Usage: wavecraft start [OPTIONS] Options: -p, --port WebSocket server port [default: 9000] --ui-port Vite UI server port [default: 5173] --install Auto-install npm dependencies without prompting --no-install Fail if dependencies missing (no prompt) -v, --verbose Show verbose output -h, --help Print help ``` -------------------------------- ### Full Build Process Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/webview-desktop-poc/low-level-design-webview-desktop-poc.md Outlines the steps to perform a full build of the UI and the desktop application, including installing dependencies, building the UI, and compiling the release version of the desktop app. ```bash # Build UI cd ui npm ci npm run build # Build desktop app (embeds ui/dist at compile time) cd ../engine cargo build -p desktop --release # Run ./target/release/vstkit-desktop ``` -------------------------------- ### Build and Install Plugin for DAW Testing Source: https://github.com/ronhouben/wavecraft/blob/main/docs/guides/sdk-getting-started.md Builds the plugin bundles and installs the VST3 version into the default audio plugin directory. This is the recommended entry point for building and installing plugins. ```bash wavecraft bundle --install ``` ```bash wavecraft bundle ``` ```bash wavecraft bundle --install ``` -------------------------------- ### Two-Phase Build for `wavecraft start` Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/build-time-param-discovery/low-level-design-build-time-param-discovery.md The `wavecraft start` command utilizes a two-phase build process. Phase 1 performs a fast parameter discovery by building the library with the `_param-discovery` feature, avoiding static initialization issues. Phase 2, if needed for audio-dev FFI, performs a full plugin build. ```bash Phase 1: Fast param discovery (no nih-plug static init) cargo build --lib --features _param-discovery dlopen → wavecraft_get_params_json() → instant, no hang close dylib Phase 2: Full plugin build (background, if audio-dev needed) cargo build --lib dlopen → wavecraft_dev_create_processor() → audio FFI ``` -------------------------------- ### Get Installed CLI Version Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-self-update/implementation-plan.md Retrieves the version of the installed Wavecraft CLI binary by executing `wavecraft --version`. ```rust fn get_installed_version() -> Result { let output = Command::new("wavecraft") .arg("--version") .output() .context("Failed to run 'wavecraft --version'")?; let stdout = String::from_utf8_lossy(&output.stdout); let version = stdout .trim() .strip_prefix("wavecraft ") .unwrap_or(stdout.trim()) .to_string(); Ok(version) } ``` -------------------------------- ### Create New Plugin with Options Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/open-source-readiness/implementation-plan.md Demonstrates creating a new plugin project using the Wavecraft CLI with specific vendor, email, and URL options for non-interactive setup. ```bash wavecraft new test --vendor "X" --email "x@x.com" --url "https://x.com" ``` -------------------------------- ### Start Engine Dev Server Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/websocket-ipc-bridge/test-plan.md Start the development server for the engine component. This command is part of the manual browser testing setup. ```bash cd engine && cargo run -p standalone --release -- --dev-server ``` -------------------------------- ### Build and Start Generated Plugin Source: https://github.com/ronhouben/wavecraft/blob/main/CONTRIBUTING.md Navigate into the generated test plugin directory and start it using the Wavecraft CLI, ensuring it installs and runs correctly. ```bash # Build and test the generated plugin cd target/tmp/test-plugin cargo run --manifest-path /path/to/wavecraft/cli/Cargo.toml -- start --install ``` -------------------------------- ### Rust: Start Command Implementation Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/browser-dev-audio-start-silence/implementation-progress.md Implementation details for the `start` command in `cli/src/commands/start.rs`, including canonicalized no-output-device startup semantics and diagnostic classification. ```rust cli/src/commands/start.rs ``` -------------------------------- ### Starting the Development Server Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/websocket-ipc-bridge/low-level-design-websocket-ipc-bridge.md Command to start the standalone development server with WebSocket capabilities enabled. ```bash cargo run -p standalone -- --dev-server ``` -------------------------------- ### Rust: Implementing the Start Command Variant Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/low-level-design-cli-start-command.md Defines the `Start` subcommand for the CLI, including its arguments for ports, dependency installation, and verbosity. This code is part of the main CLI application logic. ```rust mod commands; mod project; // NEW mod template; mod validation; use anyhow::Result; use clap::{Parser, Subcommand}; use std::path::PathBuf; use commands::{NewCommand, StartCommand}; // Updated // ... existing code ... #[derive(Subcommand)] enum Commands { /// Create a new plugin project from the template New { // ... existing fields ... }, /// Start development servers for UI iteration Start { /// WebSocket server port (default: 9000) #[arg(short, long, default_value_t = 9000)] port: u16, /// Vite UI server port (default: 5173) #[arg(long, default_value_t = 5173)] ui_port: u16, /// Auto-install npm dependencies without prompting #[arg(long, conflicts_with = "no_install")] install: bool, /// Fail if dependencies missing (no prompt) #[arg(long, conflicts_with = "install")] no_install: bool, /// Show verbose output #[arg(short, long)] verbose: bool, }, } fn main() -> Result<()> { let cli = Cli::parse(); match cli.command { Commands::New { ... } => { ... }, Commands::Start { port, ui_port, install, no_install, verbose, } => { let cmd = StartCommand { port, ui_port, install, no_install, verbose, }; cmd.execute()?; } } Ok(()) } ``` -------------------------------- ### Run UI Development Server Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/semantic-versioning/implementation-progress.md Navigate to the UI directory and start the development server. This mode loads the UI with mock data for local state testing. ```bash cd ui npm run dev ``` -------------------------------- ### Build and Install Plugin Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/resize-handle-visibility/test-plan.md Commands to bundle, sign, and install the plugin for testing in Ableton Live. These commands are used to create a release build of the plugin. ```bash cargo xtask bundle --release && cargo xtask sign --adhoc && cargo xtask install ``` -------------------------------- ### Bash: Error Message - npm install Failed Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/cli-start-command/low-level-design-cli-start-command.md Represents the scenario where `npm install` fails during the execution of `wavecraft start`, providing an error message that prompts the user to review the npm output for details. ```bash $ wavecraft start ? Dependencies not installed. Run npm install? [Y/n] y → Installing dependencies... npm ERR! code ERESOLVE ... Error: npm install failed. Please check the output above and try again. ``` -------------------------------- ### Create Example Plugin with VstKit Macros Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/developer-sdk/implementation-plan.md Demonstrates the creation of a minimal gain plugin using VstKit macros for parameter definition and plugin structure. ```rust use vstkit_core::prelude::*; vstkit_params! { Gain: { id: 0, name: "Gain", range: -24.0..=24.0, default: 0.0, unit: "dB" }, } vstkit_plugin! { name: "My Plugin", vendor: "My Company", url: "https://example.com", email: "contact@example.com", version: env!("CARGO_PKG_VERSION"), audio: { inputs: 2, outputs: 2 }, params: [Gain], processor: GainProcessor, } struct GainProcessor; impl vstkit_dsp::Processor for GainProcessor { fn process(&mut self, buffer: &mut [&mut [f32]], _transport: &Transport) { // Simple gain implementation } } ``` -------------------------------- ### Quick Start: Build Release with Real-time Safety Checks Source: https://github.com/ronhouben/wavecraft/blob/main/docs/feature-specs/_archive/plugin-skeleton/low-level-design-plugin-skeleton.md Builds the plugin in release mode with the 'assert_process_allocs' feature enabled. This is recommended for performance testing and ensuring real-time safety. ```bash # Build release with real-time safety checks cargo build --release --features assert_process_allocs -p plugin ```