You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(FR-2607): align Electron publicPath patch with Vite output
Resolves the gap between PR #6871 (Vite spike for `es6://` publicPath via
`renderBuiltUrl`) and PR #6765 / FR-2612 (single React build + post-patch
policy). The post-patch script was still searching for CRA-era `/static/...`
paths after the Vite migration emitted `/assets/...`, so `make dep` produced
an Electron staging dir that referenced root-relative `/assets/...` that
Electron could not serve via the `es6://` scheme handler.
- `bash scripts/verify.sh` → Relay / Lint / Format / TypeScript ALL PASS
- `make clean && make dep` → "Patched 2 file(s). Verification passed: index.html contains es6://assets/"
- `make dep` run twice → idempotent skip ("Electron app already prepared, skipping")
- `pnpm run electron:d` → renderer spawns with `es6://` scheme registered, login UI renders, all stylesheets load (rule counts > 0), body bg = rgb(247, 247, 246), `did-fail-load` / `webRequest err` / 404s = 0
- `make mac_arm64` → `compile_localproxy` + `electron-packager` (.app) produced cleanly. (DMG step fails on a local `NODE_MODULE_VERSION` mismatch in a globally-installed `electron-installer-dmg`; unrelated to this fix and does not affect CI which uses `npx`.)
- Replace CRA-era patch patterns (`/static/js`, `/static/css`, `asset-manifest.json`, webpack runtime `.p='/'` rewrites) with Vite-aware patterns.
- Patch `index.html`: rewrite `="/assets/` → `="es6://assets/` on `src`/`href` attributes only.
- Patch CSS files under `assets/`: `url(/assets/...)` → `url(es6://assets/...)` in all quote styles.
- Drop dead Webpack-specific code paths (`asset-manifest.json`, `static/{js,css}`, webpack runtime `publicPath` assignment) that no longer exist in Vite output.
- Update verification marker from `es6://static/js/main` to `es6://assets/`.
- Leave `<base href="/">` untouched: the renderer loads `index.html` via `file://`, and rewriting `<base>` to `es6://` would break `window.location`/origin alignment (history API, same-origin checks). Webpack-era patch script also did not touch `<base>`.
- Verification failure now exits non-zero so the Makefile recipe aborts instead of silently continuing.
- Update `dep_electron` idempotency marker from `es6://static/js/main` to `es6://assets/` to match the new patch script.
- Replace `;` chaining with `&&` between the `dep_electron` commands so a failed patch script aborts the recipe.
- Update inline comment that referenced the old marker.
- Remove the `BUILD_TARGET=electron` + `experimental.renderBuiltUrl` branch (PR #6871 spike). FR-2612 mandates a single web build with post-patch; the `renderBuiltUrl` path would require a second `vite build` per release and was never wired into the Makefile, making it dead code with regression risk if anyone toggled `BUILD_TARGET=electron`.
- Drop the now-unused `command` parameter from `defineConfig`.
- Remove three unused CRA-era devDependencies: `@svgr/webpack` (Vite uses `vite-plugin-svgr`), `react-scripts` (CRA core, retired in FR-2611), `react-dev-utils` (no imports anywhere). All three were verified to have zero references in source.
Sits on top of #7113 (FR-2606 residual build-time warnings).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments