Skip to content

test: add bundled TypeScript import helper#496

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-test-import-helper
Closed

test: add bundled TypeScript import helper#496
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-test-import-helper

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the dependency-free-only scripts/lib/ts-import.mjs transform with an esbuild bundle-backed TS/TSX import helper.
  • Add safe default stubs for Electron, React/JSX, common renderer globals, and static assets so selected production modules can be imported in Node tests.
  • Convert the shallow browser-search history export grep into an executable import test that loads src/main/browser-search-history.ts and exercises resolveInput() through its relative resolver dependency.

Baseline

scripts/test-browser-search-lag-fix.mjs previously read source text and grepped for browser-search history names. That proved text existed, but it could not prove the module loaded, that relative imports resolved, or that exported behavior still worked.

Validation

  • Codex LSP diagnostics: no errors for scripts/lib/ts-import.mjs and scripts/test-browser-search-lag-fix.mjs.
  • node --test scripts/test-browser-search-lag-fix.mjs: 11 pass, 0 fail.
  • TSX smoke check: importTs(src/renderer/src/icons/Calendar.tsx) returned a default function.
  • npm test: 25 pass, 0 fail, 1 skipped (Renderer crash recovery (live Electron) skipped because Electron is not launchable here).

Risks

  • The helper intentionally stubs host APIs; tests that need real Electron or browser behavior should still use dedicated live harnesses.
  • Default stubs are broad enough for import-time tests, but module-specific behavior tests may need custom stubs via importTs(..., { stubs }).

@JustYannicc JustYannicc changed the title [codex] Add bundled TS import helper for tests test: add bundled TypeScript import helper Jul 3, 2026
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by #532 (fix(validation): restore project checks), which consolidates this validation/build change with the related source PRs. Closing this PR in favor of the upstream replacement.

@JustYannicc JustYannicc closed this Jul 3, 2026
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