Skip to content

fix: embed build-time secrets so Genius API works in packaged app#81

Merged
JoePittsy merged 1 commit into
mainfrom
feature/jdp/dev-enhancements
May 7, 2026
Merged

fix: embed build-time secrets so Genius API works in packaged app#81
JoePittsy merged 1 commit into
mainfrom
feature/jdp/dev-enhancements

Conversation

@JoePittsy
Copy link
Copy Markdown
Member

Summary

  • build:main now writes dist/build-env.json with GENIUS_ACCESS_TOKEN and APPINSIGHTS_CONNECTION_STRING baked in from the CI environment at build time
  • main.ts loads this file at startup and back-fills any env vars that dotenv did not cover — dev .env still takes priority
  • Adds --remote-debugging-port=9333 to the dev script and documents the agent-browser visual verification workflow in CLAUDE.md

Root cause

tsc only transpiles; it does not substitute process.env values. In the packaged app there is no .env file and user machines do not have GENIUS_ACCESS_TOKEN set, so the IPC handler silently returned null every time.

Test plan

  • Merge triggers CI publish; confirm dist/build-env.json is present in the asar
  • Install published build and verify Genius descriptions appear in the lyrics panel

Generated with Claude Code

tsc doesn't substitute env vars, so GENIUS_ACCESS_TOKEN was undefined
at runtime in packaged builds — the handler silently returned null.

build:main now writes dist/build-env.json with both GENIUS_ACCESS_TOKEN
and APPINSIGHTS_CONNECTION_STRING baked in from the CI environment.
main.ts loads this file at startup and back-fills any vars that dotenv
didn't cover (dev .env still takes priority).

Also adds --remote-debugging-port=9333 to the dev script and documents
the agent-browser visual verification workflow in CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 81.16% 1668 / 2055
🔵 Statements 78.18% 1932 / 2471
🔵 Functions 73.98% 546 / 738
🔵 Branches 71.89% 1768 / 2459
File CoverageNo changed files found.
Generated in workflow #122 for commit ebbfcfc by the Vitest Coverage Report Action

@JoePittsy JoePittsy merged commit 49a800d into main May 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant