fix(npm-script): make Windows dev spawns reliable in android dev#2156
fix(npm-script): make Windows dev spawns reliable in android dev#2156UnschooledGamer wants to merge 5 commits into
Conversation
Greptile SummaryThis PR replaces Windows-fragile command-shim spawns (
Confidence Score: 5/5Safe to merge — the change is scoped to the dev orchestration script and directly targets a real Windows compatibility gap with a well-understood fix. The primary fix (using local Node+script entrypoints for rspack and Cordova) is correct and addresses the root cause of the Windows spawn failures. The previously flagged issues are resolved. Remaining concerns are limited to fallback code paths that only trigger when local bins are absent. utils/scripts/dev.js — the Windows Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Dev script starts] --> B[startRspackWatch]
B --> C{local rspackBin exists?}
C -- yes --> D[spawn node rspackBin]
C -- no --> E[warn: fallback to npx]
E --> F[spawn npx.cmd on Windows]
D --> G[rspack compiles]
F --> G
G --> H{error event?}
H -- yes --> I[log warn + process.exit 1]
H -- no --> J{stdout has compiled?}
J -- yes --> K[onCompiled callback]
K --> L{appLaunched?}
L -- no --> M[launchApp after 3s]
L -- yes --> N[broadcast reload]
M --> O{local CORDOVA_BIN exists?}
O -- yes --> P[spawn node CORDOVA_BIN args]
O -- no --> Q[spawn cordova.cmd args]
P --> R[Cordova run]
Q --> R
Reviews (2): Last reviewed commit: "chore: revert & fmt greptile suggestion" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
@greptile_apps review again |
Summary:
Why:
Windows command shim spawning (npx/cordova.cmd) was causing spawn EINVAL/ENOENT during dev startup. Direct Node CLI entrypoints make process execution reliable across shells.