Files
Space-Game/scripts/dev.sh
francy51 7c93b8a1ae Add game UI panels, keyboard shortcuts, docs narrative overhaul, and unified dev script
- Add MiniStarMap, NpcMarketPanel, ShipStatusPanel, useKeyboardShortcuts
- Add progress bars for approach/mining operations and cargo fill indicator
- Rewrite docs from spreadsheet-first to exploration-first open-world RPG
- Replace dev:db + dev:standalone with unified dev script (scripts/dev.sh)
- Add Vite chunk splitting for three.js and spacetimedb
- Fix displayName dependency in useSpacetimeConnection
- Remove stale usePlayerSession.ts
- Add AGENTS.md files across all packages
2026-06-02 17:32:15 -04:00

62 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
STDB_DATA_DIR=".spacetime-dev"
STDB_HOST="http://127.0.0.1:3000"
STDB_DATABASE="void-nav-dev"
MAX_WAIT=30
PIDS=()
cleanup() {
echo ""
echo "Shutting down..."
for pid in "${PIDS[@]}"; do
kill "$pid" 2>/dev/null || true
done
wait 2>/dev/null
echo "Done."
exit 0
}
trap cleanup INT TERM
rm -rf "$STDB_DATA_DIR"
mkdir -p "$STDB_DATA_DIR"
echo "[dev] Starting SpacetimeDB (data: $STDB_DATA_DIR)..."
spacetime start --data-dir "$STDB_DATA_DIR" --in-memory &
PIDS+=($!)
echo "[dev] Waiting for SpacetimeDB at $STDB_HOST ..."
waited=0
until curl -sf "$STDB_HOST/v1/health" >/dev/null 2>&1; do
waited=$((waited + 1))
if [ "$waited" -ge "$MAX_WAIT" ]; then
echo "[dev] ERROR: SpacetimeDB did not start within ${MAX_WAIT}s"
cleanup
exit 1
fi
sleep 1
done
echo "[dev] SpacetimeDB is ready."
echo "[dev] Publishing module and generating bindings..."
spacetime dev --server local --delete-data -y --server-only &
PIDS+=($!)
sleep 3
echo "[dev] Starting game dev server on http://localhost:5175 ..."
pnpm --filter @void-nav/game dev --port 5175 &
PIDS+=($!)
echo ""
echo "=== VOID::NAV Dev Environment ==="
echo " SpacetimeDB: $STDB_HOST"
echo " Game: http://localhost:5175"
echo " Data dir: $STDB_DATA_DIR (ephemeral)"
echo " Press Ctrl+C to stop"
echo "=================================="
echo ""
wait