#19905: build: replace bash script with cross-platform node script for a2ui bundling
docs
app: web-ui
cli
scripts
commands
agents
size: XL
Cluster:
Build and Fix Enhancements
### Problem
The `canvas:a2ui:bundle` command failed on Windows because it tried to run a [.sh](cci:7://file:///k:/github/GitHub/openclawWeComzh/scripts/bundle-a2ui.sh:0:0-0:0) script.
### Solution
Converted the A2UI bundle script to a cross-platform Node.mjs script.
### Changes
- **NEW**: [scripts/bundle-a2ui.mjs](cci:7://file:///k:/github/GitHub/openclawWeComzh/scripts/bundle-a2ui.mjs:0:0-0:0)
- **DELETE**: [scripts/bundle-a2ui.sh](cci:7://file:///k:/github/GitHub/openclawWeComzh/scripts/bundle-a2ui.sh:0:0-0:0)
- **MODIFY**: [package.json](cci:7://file:///k:/github/GitHub/openclawWeComzh/package.json:0:0-0:0)
- **MODIFY**: [AGENTS.md](cci:7://file:///k:/github/GitHub/openclawWeComzh/AGENTS.md:0:0-0:0)
### Verification
- Verified by running `pnpm canvas:a2ui:bundle` on Windows.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Replaces the bash-only `scripts/bundle-a2ui.sh` with a cross-platform `scripts/bundle-a2ui.mjs` Node script, fixing the `canvas:a2ui:bundle` command on Windows.
- The new Node script faithfully reproduces the original logic: source existence checks, SHA-256 content hashing for incremental builds, `tsc` + `rolldown` invocations, and hash file caching
- Hash computation is identical between old and new scripts, so existing `.bundle.hash` files remain valid
- `package.json` command updated from `bash scripts/bundle-a2ui.sh` to `node scripts/bundle-a2ui.mjs`
- `AGENTS.md` reference updated accordingly; no stale references remain
- The old bash script is properly deleted
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — it is a straightforward, faithful port of a bash script to Node.js with no logic changes.
- The new Node script faithfully mirrors the original bash script's logic. Hash computation is identical (no forced rebuilds). All references to the old script have been updated. The change has been verified on Windows per the PR description.
- No files require special attention.
<sub>Last reviewed commit: f2b903a</sub>
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#16480: fix(build): replace bash A2UI bundle script with cross-platform Typ...
by colddonkey · 2026-02-14
87.9%
#11951: Prepending Windows Node to PATH didn’t help
by tranhoangtu-it · 2026-02-08
83.9%
#10292: Build: migrate A2UI packaging script from bash to TypeScript
by JAVA-LW · 2026-02-06
82.2%
#18493: making pnpm build:ui and pnpm build to work on windows
by darkpowerxo · 2026-02-16
80.2%
#3006: fix(scripts): use local pnpm binary in run-node.mjs if global is mi...
by elliotsecops · 2026-01-27
75.8%
#6064: fix(daemon): prefer bundled node from install-cli.sh over system node
by joyshmitz · 2026-02-01
75.1%
#22425: chore: make prepare git hooks setup cross-platform
by OldFineDev · 2026-02-21
73.8%
#18676: feat: add patch-ui.sh
by jasonkneen · 2026-02-16
71.9%
#20843: docs: add troubleshooting for A2UI bundling and missing node_modules
by yahiag04 · 2026-02-19
71.8%
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
70.4%