#16480: fix(build): replace bash A2UI bundle script with cross-platform TypeScript
scripts
stale
size: S
Cluster:
Build and Fix Enhancements
## Summary
- `scripts/bundle-a2ui.sh` fails on Windows because the `bash` subprocess cannot locate `node` in its PATH, even when Node is available in the parent PowerShell/CMD environment.
- Replaces the bash script with `scripts/bundle-a2ui.ts` - a cross-platform TypeScript equivalent that runs via `node --import tsx`. Same logic (hash check, tsc, rolldown), works on Windows/macOS/Linux without bash.
- Updates `package.json` `canvas:a2ui:bundle` script accordingly.
## Test plan
- [x] `pnpm build` completes successfully on Windows (previously failed at A2UI bundling step).
- [x] Hash-based skip logic works correctly (re-running skips when sources unchanged).
- [x] Docker/missing-sources fallback preserved (keeps prebuilt bundle if sources absent).
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Replaces the bash script `scripts/bundle-a2ui.sh` with a cross-platform TypeScript equivalent to fix Windows build failures caused by bash subprocess PATH issues. The new implementation preserves all original functionality: hash-based incremental bundling, Docker environment fallback for prebuilt bundles, and identical build command execution (tsc + rolldown). The conversion is straightforward and faithful to the original logic.
<h3>Confidence Score: 5/5</h3>
- Safe to merge - straightforward script migration with preserved logic and successful test validation
- This is a simple bash-to-TypeScript conversion that addresses a legitimate cross-platform issue. The implementation faithfully replicates the original logic (hash computation, file walking, command execution), and the PR author has validated it on Windows with successful builds and correct hash-skip behavior. No functional changes or risky modifications.
- No files require special attention
<sub>Last reviewed commit: 974a706</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19905: build: replace bash script with cross-platform node script for a2ui...
by luolin-ai · 2026-02-18
87.9%
#10292: Build: migrate A2UI packaging script from bash to TypeScript
by JAVA-LW · 2026-02-06
86.2%
#11951: Prepending Windows Node to PATH didn’t help
by tranhoangtu-it · 2026-02-08
82.2%
#18493: making pnpm build:ui and pnpm build to work on windows
by darkpowerxo · 2026-02-16
80.0%
#3006: fix(scripts): use local pnpm binary in run-node.mjs if global is mi...
by elliotsecops · 2026-01-27
76.0%
#23775: fix(build): stabilize Windows script execution and Telegram monitor...
by ly85206559 · 2026-02-22
75.1%
#22425: chore: make prepare git hooks setup cross-platform
by OldFineDev · 2026-02-21
74.9%
#5168: Fix: force UTF-8 for Windows exec
by ManojINaik · 2026-01-31
74.3%
#20843: docs: add troubleshooting for A2UI bundling and missing node_modules
by yahiag04 · 2026-02-19
73.8%
#9250: Fix: Add shell:true for Windows .cmd files to prevent spawn EINVAL ...
by vishaltandale00 · 2026-02-05
73.2%