#10292: Build: migrate A2UI packaging script from bash to TypeScript
scripts
size: S
Cluster:
Build and Fix Enhancements
-Added 'scripts/bundle-a2ui. ts' script to provide more reliable build caching and error handling -Update the 'canvas: a2ui: bundle' command in 'package. json' to call the new TypeScript script -The new script implements a caching mechanism based on file content hashing to avoid unnecessary duplicate constructions
https://github.com/openclaw/openclaw/issues/10070
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Replaces the A2UI bundling step (`canvas:a2ui:bundle`) from a bash script to a TypeScript script run via `node --import tsx`.
- New `scripts/bundle-a2ui.ts` computes a content hash over key inputs (lockfile, package.json, vendor/app sources) and skips bundling when unchanged.
- Bundling invokes `tsc` for the renderer and `rolldown` for the app, then records the computed hash in `src/canvas-host/a2ui/.bundle.hash` to support build caching.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge once the remaining bundling-script reliability issues are addressed.
- The change is localized (package script + new bundling script) and the intent is clear, but there are two concrete failure modes: (1) spawn failures can hang indefinitely due to missing 'error' handling, and (2) the cache hash can become incorrect because filesystem errors beyond ENOENT are silently ignored. Fixing these makes the build step deterministic and easier to debug across environments.
- scripts/bundle-a2ui.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#16480: fix(build): replace bash A2UI bundle script with cross-platform Typ...
by colddonkey · 2026-02-14
86.2%
#19905: build: replace bash script with cross-platform node script for a2ui...
by luolin-ai · 2026-02-18
82.2%
#11951: Prepending Windows Node to PATH didn’t help
by tranhoangtu-it · 2026-02-08
80.7%
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
74.4%
#20843: docs: add troubleshooting for A2UI bundling and missing node_modules
by yahiag04 · 2026-02-19
73.2%
#18493: making pnpm build:ui and pnpm build to work on windows
by darkpowerxo · 2026-02-16
72.8%
#3973: fix: enhance npm package integrity checks and include critical files
by YeSuX · 2026-01-29
72.4%
#16037: fix(canvas): resolve A2UI assets from dist + retry resolution
by AlexAnys · 2026-02-14
71.6%
#10589: fix: chrome extension install fails in bundled dist layout
by joetomasone · 2026-02-06
70.6%
#3337: fix(macos-app): patch SwiftPM Bundle.module accessor for app bundle
by skymoore · 2026-01-28
70.5%