Files
xplane-cockpit/scripts/prep-desktop.sh
T
karim 9aba24978b Auto-install Lua, smooth all panels, airspace overlay + launcher region picker
FlyWithLua auto-install: bridge drops fms-sync/ui-sync/terrain-probe into
X-Plane's FlyWithLua Scripts dir on startup and self-updates (content-compare).
Graceful when no X-Plane / no FlyWithLua. /api/lua/install + status in health.
Desktop app bundles the scripts and passes LUA_SRC_DIR to the sidecar.

Smoothing: shared useEased/useEasedAngle hook (api/ease.js) with render-bail on
settle. VFR steam gauges now interpolate to 60fps instead of stepping at the
~10Hz value stream. MFD ownship no longer vibrates — position/heading eased in a
single rAF loop, follow-pan without animated-panTo pile-up (pauses on range zoom).

Airspace overlay: server/airspace.js loads per-region GeoJSON, classifies
(B/C/D/TMA/CTR/MOA/Restricted/Prohibited/Danger), bbox query, and downloads
regions on demand — FAA (US, key-free) and OpenAIP (Europe, user key). New
AIRSPACE softkey draws chart-coloured boundaries (B blue, C magenta, D dashed),
non-interactive so map-clicks still drop waypoints. Launcher gains a "Lufträume"
section to pick/download regions via the running bridge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 13:57:50 +02:00

33 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Prepare the Tauri bundle inputs: build the web cockpit, copy it in as a
# resource, and compile the Node bridge into Bun single-file sidecars named with
# the Tauri target triples. Run from the repo root.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
export PATH="$HOME/.bun/bin:$PATH"
echo "==> building web cockpit"
( cd web && npm run build >/dev/null )
echo "==> copying cockpit into desktop resources"
rm -rf desktop/src-tauri/resources/web
mkdir -p desktop/src-tauri/resources/web
cp -R web/dist/. desktop/src-tauri/resources/web/
echo "==> copying FlyWithLua companion scripts into desktop resources"
rm -rf desktop/src-tauri/resources/plugins
mkdir -p desktop/src-tauri/resources/plugins
cp plugins/*.lua desktop/src-tauri/resources/plugins/
echo "==> compiling bridge sidecars (Bun)"
mkdir -p desktop/src-tauri/binaries
bun build --compile --target=bun-darwin-arm64 server/bridge.js \
--outfile desktop/src-tauri/binaries/xpbridge-aarch64-apple-darwin
bun build --compile --target=bun-linux-x64-baseline server/bridge.js \
--outfile desktop/src-tauri/binaries/xpbridge-x86_64-unknown-linux-gnu
chmod +x desktop/src-tauri/binaries/xpbridge-*
echo "==> done"
ls -lh desktop/src-tauri/binaries/