Files
SivanCola 62a20c1c46 ci(desktop): drop the WebKitGTK/WebView2 toolchain and native smoke harnesses
Problem: CI and the packaging pipeline still installed the Wails-era native
toolchain (libwebkit2gtk headers, the webkit2_41 build tag, the wails CLI pin)
and ran the WebView2/WebKitGTK native smoke harnesses whose binaries no longer
exist.

Fix: delete the transcript-native-smoke workflow, the WebKitGTK install steps
in desktop-prepare/desktop-go, the WKWebView/WebView2 native transcript steps,
the WebView2 smoke scripts and the vendored-edge test step, and the wails pin
check (scripts, .wails-version, make wails-install). desktop-build.sh builds
the service without -tags webkit2_41, so Linux needs no WebKitGTK headers.
desktop/packaging reads the frozen product identity from a constant instead of
wails.json. The contract tests now pin the packaged-Electron startup smoke and
reject references to the retired harnesses. The root ./dev script drives the
Electron shell against a freshly built service plus the Vite dev server;
prod_test/prod_fast_test lose the Wails CLI pinning. The issue labeler
describes the desktop app as Electron. Browser-compatibility Playwright tests
(chromium/webkit) for the Web/Serve product are unchanged.

Verification: bash scripts/release-workflows.test.sh,
node scripts/check-desktop-build-contract.mjs,
node scripts/check-single-release-public-contract.mjs,
node --test scripts/desktop-release-artifacts.test.mjs scripts/ci-workflow.test.mjs,
desktop/frontend/scripts/check-motion-ci-contract.mjs and actionlint on the
release workflows all pass.
2026-09-09 10:44:35 +08:00

55 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
root="$(git rev-parse --show-toplevel)"
desktop_dir="$root/desktop"
vite_port="${REASONIX_DESKTOP_VITE_PORT:-}"
if [[ $# -gt 0 && "$1" =~ ^[0-9]+$ ]]; then
vite_port="$1"
shift
fi
if [[ -z "$vite_port" ]]; then
branch="$(git -C "$root" branch --show-current || true)"
if [[ -z "$branch" ]]; then
branch="$(git -C "$root" rev-parse --short HEAD)"
fi
key="$root:$branch"
hash="$(printf "%s" "$key" | cksum | awk '{print $1}')"
vite_port=$((5173 + (hash % 100)))
fi
if (( vite_port < 1024 || vite_port > 36000 )); then
echo "dev: Vite port must be between 1024 and 36000, got $vite_port" >&2
exit 2
fi
export REASONIX_DESKTOP_VITE_PORT="$vite_port"
export REASONIX_DEV=1
# pnpm honors npm_config_* not PNPM_CONFIG_*; suppress headless TTY purge prompt + age gate.
export npm_config_confirm_modules_purge=false
export npm_config_minimum_release_age=0
service="$desktop_dir/build/bin/reasonix-desktop-service"
if [[ "$OSTYPE" == msys* || "$OSTYPE" == cygwin* || "$OSTYPE" == win32* ]]; then
service="$service.exe"
fi
echo "Reasonix desktop dev (Electron shell)"
echo " worktree: $root"
echo " vite: http://127.0.0.1:$vite_port"
echo " service: $service"
mkdir -p "$(dirname "$service")"
(cd "$desktop_dir" && go build -o "$service" .)
# The Vite dev server hot-reloads the frontend; the Electron shell loads it via
# REASONIX_ELECTRON_DEV_URL (see desktop/electron/scripts/start.mjs).
(cd "$desktop_dir/frontend" && exec pnpm dev) &
vite_pid=$!
trap 'kill "$vite_pid" 2>/dev/null || true' EXIT
cd "$desktop_dir"
exec pnpm --dir electron dev "$@"