Merge 6f75941a94960fed02274eceed92c73a53bd3f39 into 598f1826d8b2bc969aace2c6459824737667218c

This commit is contained in:
Bin Deng 2026-03-21 11:39:58 +08:00 committed by GitHub
commit 649c89dc03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,21 @@ if [[ ! -d "$A2UI_RENDERER_DIR" || ! -d "$A2UI_APP_DIR" ]]; then
exit 1
fi
# WSL detection: when pnpm runs "bash" on Windows it resolves to WSL
# (C:\Windows\System32\bash.exe), where native Node.js is typically absent.
# The pnpm wrappers for tsc/rolldown also invoke node internally, so the
# entire build pipeline fails. Only activate the guard when Node.js is
# missing — WSL-primary developers with node installed can build normally.
if grep -qi microsoft /proc/version 2>/dev/null && ! command -v node >/dev/null 2>&1; then
if [[ -f "$OUTPUT_FILE" ]]; then
echo "WSL detected (no Node.js available); using prebuilt A2UI bundle."
exit 0
fi
echo "WSL environment detected but Node.js is not installed and no prebuilt bundle found." >&2
echo "Either install Node.js inside WSL, or build outside WSL (e.g. Git Bash): pnpm canvas:a2ui:bundle" >&2
exit 1
fi
INPUT_PATHS=(
"$ROOT_DIR/package.json"
"$ROOT_DIR/pnpm-lock.yaml"