hyper/.gitignore
Philip Peterson 5713d94db9
Switch from yarn to pnpm (#305)
Duplicate @types/react TypeScript error (package.json, pnpm-lock.yaml)
What: Added "pnpm": { "overrides": { "@types/react": "18.3.12" } } to the root package.json.

Why: @types/react-dom@18.3.1, @types/hoist-non-react-statics, and @types/styled-jsx all declare @types/react:
"" as a plain dependency. With yarn this was resolved by the resolutions field. With pnpm, resolutions is
ignored — pnpm only reads pnpm.overrides. Without the override, each of those packages resolved "" to the
latest @types/react@19.1.2 and nested it under their own node_modules/. TypeScript then saw two incompatible
definitions for the same React types simultaneously, producing the TS2344: Type 'C' does not satisfy the
constraint 'ComponentType' error in react-redux/es/types.d.ts.

The nested @types/react@19.1.2 directories were also stale artifacts from pre-override installs — pnpm's
--force flag reinstalls packages but does not scrub orphaned nested node_modules subdirectories. They were
removed manually, and the pnpm.overrides prevents them from reappearing on future installs.

Cannot find module 'execa' crash at app startup (app/package.json, app/session.ts)
What: Upgraded shell-env from 3.0.1 to 4.0.3, added execa@5.1.1 as a direct app dependency, removed
os-locale@5.0.0, replaced its one usage with Intl.DateTimeFormat().resolvedOptions().locale, and updated the
shellEnv.sync() call to the new named export shellEnvSync.

Why: This was a layered problem rooted in how electron-builder packages the app when using pnpm.

electron-builder builds the asar by walking pnpm's flat (hoisted) node_modules dependency tree. When two
packages need incompatible major versions of the same dependency, pnpm cannot hoist both — it puts the
minority version in a nested node_modules/ inside the requiring package's directory. electron-builder's pnpm
integration only scans the flat level; it emits "dependency not found on disk" for anything nested, and those
nested packages are silently excluded from the asar.

shell-env@3.0.1 needed execa@^1.0.0. The hoisted top-level was execa@4.1.0. So pnpm nested execa@1.0.0 under
node_modules/shell-env/node_modules/execa/. electron-builder missed it. At runtime, require('shell-env') →
require('execa') → crash, even on macOS where the shellEnv.sync() call is never actually reached (the import
itself triggers the error).

Upgrading shell-env to 4.0.3 alone would have just shifted the nesting from execa@1 to execa@5 (since 4.0.3
uses ^5.1.1). And os-locale@5.0.0 used ^4.0.0, which would then become the nested one instead. There is no
version of either package where both use the same execa major, so they can't both be hoisted simultaneously.

The fix makes execa@5.1.1 the explicit top-level dependency. shell-env@4.0.3 (needs ^5.1.1) is satisfied
without nesting. os-locale is removed entirely and its one call site replaced with
Intl.DateTimeFormat().resolvedOptions().locale, which returns the same locale string from a V8 built-in — no
execa chain at all.

CI frozen-lockfile failure inside electron-builder install-app-deps (app/.npmrc)
What: Added frozen-lockfile=false to app/.npmrc.

Why: target/ is the electron-builder app directory and is fully gitignored. That means target/pnpm-lock.yaml
is never committed. In CI, pnpm automatically enables frozen-lockfile=true when it detects CI=true in the
environment — this applies to every pnpm invocation in the process tree, including child processes.

The postinstall sequence is: webpack copies app/ to target/ → electron-builder install-app-deps runs pnpm
install inside target/. Because app/.npmrc contains ignore-workspace=true, pnpm treats target/ as a standalone
project rather than part of the workspace, and looks for a target/-local lockfile. On a fresh CI checkout
there is none. With frozen-lockfile=true inherited from the CI environment, pnpm refuses to generate one and
exits with ERR_PNPM_OUTDATED_LOCKFILE.

Locally this was invisible because target/pnpm-lock.yaml accumulated from previous runs and was simply reused.
Adding frozen-lockfile=false to app/.npmrc (which webpack copies to target/.npmrc) overrides the CI
environment default specifically for the target/ context, allowing pnpm to generate a fresh lockfile on each
CI run.

app/session.ts locale — removal of os-locale
Already covered under point 2, but worth noting separately: osLocale.sync() was the only call site.
Intl.DateTimeFormat().resolvedOptions().locale is a direct replacement — it returns the OS locale (e.g. en-US)
in the same format, available in all modern Node/Electron versions with no external dependencies. The
.replace(/-/, '_') transforms it to POSIX LANG format (en_US) exactly as before.
2026-05-28 16:13:19 -07:00

28 lines
305 B
Text

# build output
dist
app/renderer
target
bin/cli.*
cache
build/config.gypi
# claude code
.claude
# dependencies
node_modules
.pnpm-store/
# logs
npm-debug.log
pnpm-debug.log
# optional dev config file and plugins directory
hyper.json
schema.json
plugins
.DS_Store
.vscode/*
!.vscode/launch.json
.idea