diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ff2f13..ad89e06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `distro.just` build and installation - `distro::install`: now builds all 5 server binaries in one `cargo build --release` pass - - Added `vapora-a2a` and `vapora-mcp-server` to the explicit build list (were missing; copied from stale `target/release/` if present) - - Added `vapora-a2a` binary to the install copy list (was absent entirely) - - Added `UI=true` optional parameter: runs `trunk build --release` before copying; validates `trunk` is available first - - Missing binary → explicit warning with count instead of silent skip; exits non-zero if zero installed -- `distro::install-targets`: added `wasm32-unknown-unknown`; changed to idempotent check (`rustup target list --installed`) before calling `rustup target add` -- `distro::build-all-targets`: explicitly excludes `wasm32-unknown-unknown` from the workspace loop (WASM requires per-crate build via `trunk`; the loop would fail on non-WASM crates) + - Added `vapora-a2a` and `vapora-mcp-server` to the explicit build list (were missing; silently copied from stale `target/release/` if present, skipped otherwise) + - Added `vapora-a2a` to the install copy list (was absent entirely) + - Missing binary → explicit warning with count; exits non-zero if zero installed +- `distro::install-full`: new recipe — runs `install` as a dependency then `trunk build --release` + - Replaces the broken `UI=true` parameter approach: `just` 1.x treats `KEY=value` tokens as positional args to the first parameter when invoked via module syntax (`distro::recipe`), not as named overrides + - Validates `trunk` is in PATH before attempting the build +- `distro::install-targets`: added `wasm32-unknown-unknown`; idempotent — checks `rustup target list --installed` before calling `rustup target add` +- `distro::build-all-targets`: excludes `wasm32-unknown-unknown` from the workspace loop; WASM requires per-crate `trunk` build, not `cargo build --workspace --target wasm32` ### Added - NatsBridge + A2A JetStream Integration diff --git a/justfiles/distro.just b/justfiles/distro.just index e69590a..1dc5902 100644 --- a/justfiles/distro.just +++ b/justfiles/distro.just @@ -17,11 +17,12 @@ distro-help: @echo "" @echo "Installation:" @echo " just distro::install Install server binaries to ~/.local/bin" - @echo " just distro::install DIR=/path Install to custom directory" - @echo " just distro::install UI=true Also build frontend (trunk --release)" + @echo " just distro::install /usr/local Install to custom directory" + @echo " just distro::install-full Install server binaries + build frontend" + @echo " just distro::install-full /opt Custom dir + frontend" @echo "" - @echo " Binaries installed: vapora-backend, vapora-agents, vapora-mcp-server," - @echo " vapora-a2a, vapora (CLI)" + @echo " Binaries: vapora-backend, vapora-agents, vapora-mcp-server," + @echo " vapora-a2a, vapora (CLI)" @echo "" @echo "Utilities:" @echo " just distro::clean-targets Clean target build artifacts" @@ -106,36 +107,31 @@ build-all-targets: # === INSTALLATION === -# Build and install all release binaries. +# Install server binaries only (native targets). # # Usage: -# just distro::install → ~/.local/bin, native only -# just distro::install DIR=/usr/local/bin → custom dir, native only -# just distro::install UI=true → ~/.local/bin + trunk --release -# just distro::install DIR=/opt UI=true → custom dir + trunk --release +# just distro::install → ~/.local/bin +# just distro::install /usr/local/bin → custom dir # # Binaries: vapora-backend, vapora-agents, vapora-mcp-server, vapora-a2a, vapora (CLI) -[doc("Build and install server binaries (DIR=path, UI=true for frontend)")] -install DIR="" UI="false": +[doc("Build and install server binaries (default: ~/.local/bin)")] +install DIR="": #!/bin/bash set -e WORKSPACE="{{ WORKSPACE_ROOT }}" WORKSPACE="$(cd "$WORKSPACE" && pwd)" || { echo "✗ Failed to access workspace"; exit 1; } - if [ -z "{{ DIR }}" ]; then + INSTALL_DIR="{{ DIR }}" + if [ -z "$INSTALL_DIR" ]; then INSTALL_DIR="$HOME/.local/bin" - else - INSTALL_DIR="{{ DIR }}" fi - echo "=== Building and Installing VAPORA binaries ===" + echo "=== Building and Installing VAPORA server binaries ===" echo "Workspace: $WORKSPACE" echo "Install directory: $INSTALL_DIR" - echo "Frontend (UI): {{ UI }}" echo "" - # Build all server binaries in one pass (Cargo deduplicates shared deps) echo "Building release binaries..." cd "$WORKSPACE" cargo build --release \ @@ -148,35 +144,12 @@ install DIR="" UI="false": echo "✓ Native binaries built" echo "" - # Optionally build the Leptos frontend via trunk - if [ "{{ UI }}" = "true" ]; then - if ! command -v trunk &>/dev/null; then - echo "✗ trunk not found. Install with: cargo install trunk" - exit 1 - fi - echo "Building frontend (trunk --release)..." - cd "$WORKSPACE/crates/vapora-frontend" - trunk build --release - echo "✓ Frontend built → $WORKSPACE/crates/vapora-frontend/dist" - cd "$WORKSPACE" - echo "" - fi - - # Copy binaries to install dir mkdir -p "$INSTALL_DIR" || { echo "✗ Failed to create $INSTALL_DIR"; exit 1; } echo "Installing to $INSTALL_DIR..." - declare -a BINARIES=( - "vapora-backend" - "vapora-agents" - "vapora-mcp-server" - "vapora-a2a" - "vapora" - ) - INSTALLED=0 MISSING=0 - for BIN_NAME in "${BINARIES[@]}"; do + for BIN_NAME in vapora-backend vapora-agents vapora-mcp-server vapora-a2a vapora; do BIN_PATH="$WORKSPACE/target/release/$BIN_NAME" if [ -f "$BIN_PATH" ]; then cp "$BIN_PATH" "$INSTALL_DIR/" @@ -184,24 +157,15 @@ install DIR="" UI="false": echo " ✓ $BIN_NAME" INSTALLED=$((INSTALLED + 1)) else - echo " ✗ $BIN_NAME (not found in target/release — build may have failed)" + echo " ✗ $BIN_NAME (not found — build may have failed)" MISSING=$((MISSING + 1)) fi done echo "" - if [ "$INSTALLED" -eq 0 ]; then - echo "✗ No binaries were installed" - exit 1 - fi - - if [ "$MISSING" -gt 0 ]; then - echo "⚠ $MISSING binaries missing — check build output above" - fi - - echo "✓ Installation complete ($INSTALLED/$((INSTALLED + MISSING)) binaries)" - echo "" - echo "Install dir: $INSTALL_DIR" + [ "$INSTALLED" -eq 0 ] && { echo "✗ No binaries installed"; exit 1; } + [ "$MISSING" -gt 0 ] && echo "⚠ $MISSING binaries missing" + echo "✓ $INSTALLED/$((INSTALLED + MISSING)) binaries installed to $INSTALL_DIR" if echo "$INSTALL_DIR" | grep -q "\.local/bin"; then echo "" @@ -214,11 +178,31 @@ install DIR="" UI="false": echo " $INSTALL_DIR/vapora-backend --help" echo " $INSTALL_DIR/vapora-agents --help" echo " $INSTALL_DIR/vapora-a2a --help" + echo "" - if [ "{{ UI }}" = "true" ]; then - echo "" - echo "Frontend dist: $WORKSPACE/crates/vapora-frontend/dist" +# Install server binaries + build Leptos frontend via trunk. +# Calls install first, then runs trunk --release. +# +# Usage: +# just distro::install-full → ~/.local/bin + dist/ +# just distro::install-full /usr/local/bin → custom dir + dist/ +[doc("Build and install server binaries + Leptos frontend (trunk --release)")] +install-full DIR="": (install DIR) + #!/bin/bash + set -e + + WORKSPACE="{{ WORKSPACE_ROOT }}" + WORKSPACE="$(cd "$WORKSPACE" && pwd)" || { echo "✗ Failed to access workspace"; exit 1; } + + if ! command -v trunk &>/dev/null; then + echo "✗ trunk not found. Install with: cargo install trunk" + exit 1 fi + + echo "Building frontend (trunk --release)..." + cd "$WORKSPACE/crates/vapora-frontend" + trunk build --release + echo "✓ Frontend built → $WORKSPACE/crates/vapora-frontend/dist" echo "" # === UTILITIES ===