Files
lefarcen 2bc281fe2f fix(packaged): lazy-load electron so headless can import config.ts
The packaged Linux headless entry crashed at module-load with
ERR_MODULE_NOT_FOUND for 'electron'. Trace from the CI artifact:

  Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'electron' imported
  from .../packaged/dist/headless.mjs
    at Object.getPackageJSONURL ...

Root cause: headless.ts pulls in `./config.js` for the
PACKAGED_NAMESPACE_ENV constant and the PackagedConfig type. config.ts
had a top-level `import { app } from "electron"`, so ESM had to resolve
electron at module load even though headless never calls the two
functions (readRawPackagedConfig / readPackagedConfig) that actually use
`app`. Headless deliberately ships without electron in its
node_modules, so resolution failed.

Move the electron `app` import behind a `loadElectronApp()` helper that
calls `await import("electron")` only when one of the two electron-only
functions runs. headless.ts can now load config.ts to read constants
and types without ever pulling electron in.
2026-05-15 20:13:40 +08:00
..
2026-05-14 19:15:16 +08:00

apps/packaged

Thin packaged Electron runtime entry for Open Design.

This package starts the packaged daemon and web sidecars, registers the od:// entry protocol, and then delegates to @open-design/desktop/main for the host window. Product logic stays in apps/daemon, apps/web, and apps/desktop.