Package app as installer + move Riot key to Settings (Rung 1) #1

Merged
joeyr merged 2 commits from feat/packaging-rung1 into main 2026-07-06 22:03:02 -05:00
Owner

Rung 1 of the packaging plan — ship a real installed/portable .exe instead of npm start, and make the Riot API key a first-class in-app setting.

Packaging (electron-builder)

  • dist / dist:dir scripts + a build config targeting NSIS (per-user, no admin) + portable; placeholder build/icon.ico
  • asarUnpack the koffi native addon at @koromix/koffi-win32-x64 (where koffi 3.x actually ships the .node, not node_modules/koffi) and the tesseract worker dep subtree (tesseract.js(-core), wasm-feature-detect, bmp-js, is-url, zlibjs, regenerator-runtime)
  • bundle eng.traineddata as an extraResource — now tracked in git so npm run dist is reproducible on a clean clone
  • cs-ocr: pass packaged worker/lang/cache paths to tesseract when app.isPackaged (corePath is unused in node; workerPath must point at the unpacked script)
  • logger: write debug.log into %APPDATA%/<app>/ when packaged, detected from process (not app.getPath, which is unsafe that early and crashed SonicBoom)

Riot key → Settings only (no env/.env fallback in the app)

  • riotApiKey setting + masked field in the Settings panel + set-riot-api-key IPC + preload/store wiring; read via readRiotApiKey(settings)
  • the standalone harvest:benchmarks CLI still reads RIOT_API_KEY from the env
  • refreshed now-stale env/.env references in README, .env.example, logs, and the auth-rejected error

Verification

  • typecheck + 504 tests green
  • packaged exe launches with League closed: assistant.started, cs_ocr.ready, debug.log in userData, no crash
  • the asar carries prod deps only (no src/, debug.log, or .env)

🤖 Generated with Claude Code

Rung 1 of the packaging plan — ship a real installed/portable `.exe` instead of `npm start`, and make the Riot API key a first-class in-app setting. ## Packaging (electron-builder) - `dist` / `dist:dir` scripts + a `build` config targeting **NSIS** (per-user, no admin) + **portable**; placeholder `build/icon.ico` - asarUnpack the koffi native addon at `@koromix/koffi-win32-x64` (where koffi 3.x actually ships the `.node`, not `node_modules/koffi`) and the tesseract worker dep subtree (`tesseract.js(-core)`, `wasm-feature-detect`, `bmp-js`, `is-url`, `zlibjs`, `regenerator-runtime`) - bundle `eng.traineddata` as an extraResource — now **tracked in git** so `npm run dist` is reproducible on a clean clone - `cs-ocr`: pass packaged worker/lang/cache paths to tesseract when `app.isPackaged` (`corePath` is unused in node; `workerPath` must point at the unpacked script) - `logger`: write `debug.log` into `%APPDATA%/<app>/` when packaged, detected from `process` (not `app.getPath`, which is unsafe that early and crashed SonicBoom) ## Riot key → Settings only (no env/.env fallback in the app) - `riotApiKey` setting + masked field in the Settings panel + `set-riot-api-key` IPC + preload/store wiring; read via `readRiotApiKey(settings)` - the standalone `harvest:benchmarks` CLI still reads `RIOT_API_KEY` from the env - refreshed now-stale env/.env references in README, .env.example, logs, and the auth-rejected error ## Verification - typecheck + **504 tests** green - packaged exe launches with League closed: `assistant.started`, `cs_ocr.ready`, `debug.log` in userData, no crash - the asar carries prod deps only (no `src/`, `debug.log`, or `.env`) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Rung 1 of the packaging plan: ship a real installed/portable .exe instead of
`npm start`, and make the Riot API key a first-class in-app setting.

Packaging (electron-builder):
- add electron-builder + `dist`/`dist:dir` scripts and a `build` config
  targeting NSIS (per-user, no admin) + portable; placeholder build/icon.ico
- asarUnpack the koffi native addon at @koromix/koffi-win32-x64 (where koffi 3.x
  actually ships the .node, not node_modules/koffi) and the tesseract worker dep
  subtree (tesseract.js(-core), wasm-feature-detect, bmp-js, is-url, zlibjs,
  regenerator-runtime); bundle eng.traineddata as an extraResource
- cs-ocr: pass packaged worker/lang/cache paths to tesseract when app.isPackaged
  (corePath is unused in node; workerPath must point at the unpacked script)
- logger: write debug.log into %APPDATA%/<app>/ when packaged, detected from
  `process` (not app.getPath, which is unsafe that early and crashes SonicBoom)

Riot key -> Settings only (no env/.env fallback in the app):
- add `riotApiKey` to the settings schema, a masked field in the Settings panel,
  a set-riot-api-key IPC message + preload/store wiring, and read it via
  readRiotApiKey(settings)
- the standalone `harvest:benchmarks` CLI still reads RIOT_API_KEY from the env
- refresh now-stale env/.env references in README, .env.example, logs, and the
  auth-rejected error message

Verified: typecheck + 504 tests green; packaged exe launches with League closed
(assistant.started, cs_ocr.ready, debug.log in userData, no crash); the asar
carries prod deps only (no src/, debug.log, or .env).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Track eng.traineddata as a packaging asset
All checks were successful
CI / build-and-test (pull_request) Successful in 1m35s
77842af1a4
The OCR language model is now a required build input (electron-builder
extraResource), not just the transient copy tesseract.js auto-downloads into
cwd during dev. Add a `!/eng.traineddata` exception to the `*.traineddata`
ignore and commit the root copy so `npm run dist` is reproducible on a clean
clone / CI instead of relying on the file happening to exist locally.

This is the exact version-matched model that produced `cs_ocr.ready` in the
packaged build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
joeyr merged commit c9c987cf81 into main 2026-07-06 22:03:02 -05:00
joeyr deleted branch feat/packaging-rung1 2026-07-06 22:03:03 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joeyr/lol-companion!1
No description provided.