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
feat(desktop-main): fix-path on boot to inherit login-shell PATH (#225)
Closes#148
## Summary
- Adds `fix-path ^4.0.0` as a runtime dependency of
`@hyveon/desktop-main`
- Creates `fix-path-bootstrap.ts` — a thin wrapper that calls `fix-path`
on macOS/Linux and is a no-op on Windows; `process.platform` is read at
call-time so tests can stub it cleanly
- Calls `applyFixPath()` as the very first executable statement in
`main.ts`, before the Electron-version guard and `bootstrap()`, ensuring
PATH is fixed before any `child_process.spawn` for terraform/aws
- Adds 3 unit tests in `fix-path-bootstrap.test.ts` (darwin calls
fix-path, linux calls fix-path, win32 skips) and extends `main.test.ts`
with a spy asserting `applyFixPath` is invoked during bootstrap (500
tests passing)
## Implementation notes
- `fix-path` v4 is pure ESM, compatible with `desktop-main`'s `"type":
"module"` and the ESNext module target in `tsconfig.base.json`
- The indirection through `fix-path-bootstrap.ts` is required so
`main.test.ts` can intercept the module boundary with `vi.mock` — a
top-level ESM side-effect in `main.ts` itself would race the test setup
- The issue acceptance criterion "integration test asserts
`process.env.PATH` includes `/opt/homebrew/bin` on a fixture machine" is
deferred to a future issue — the Electron e2e tier (Epic F, #135) does
not exist yet. The unit tests here prove the wiring is correct; a real
fixture test can be added once the Playwright Electron tier lands.
## Test plan
- [ ] `npm run app:test` — 500 tests pass
- [ ] `npm run app:lint` — 0 errors
- [ ] On macOS with Homebrew: packaged app can find `terraform` on PATH
(manual smoke test)
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments