Skip to content

TypeScript main process and shared modules (#67) - #104

Closed
jtklein-agents wants to merge 54 commits into
masterfrom
spec/67-main-typescript
Closed

jtklein-agents wants to merge 54 commits into
masterfrom
spec/67-main-typescript

Conversation

@jtklein-agents

Copy link
Copy Markdown
Owner

Closes #67.

What

Migrates the main process and the shared modules it loads (ipc, common utils/io/errors) to TypeScript with full typing. strict stays off; colocated main tests stay JavaScript; page, preload, and settings are untouched.

Changes (tickets, merged into spec/67-main-typescript)

Checks

  • yarn typecheck:baseline: no in-scope baseline lines remain
  • yarn test (main Jest suite stays green)
  • yarn build still emits out/main

🤖 Generated with Claude Code

jtklein-agents and others added 30 commits November 14, 2026 00:11
Main-loaded utils keep is/platform/quote only, drop the active-state import cycle, and clear the window.store baseline shelter.

Co-authored-by: Cursor <cursoragent@cursor.com>
Leaf of the main-process TypeScript migration: explicit constructor and field types so page and main keep the same extensionless import.

Co-authored-by: Cursor <cursoragent@cursor.com>
Leave api as thin ipc wiring so later tickets can type those modules in parallel without editing one shared file.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give those modules explicit export types while leaving colocated Jest in JavaScript.

Co-authored-by: Cursor <cursoragent@cursor.com>
Close the implicit-any gap on catch and drop unused exported type surfaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tils

Strip renderer-only branches from shared utils
Co-authored-by: Cursor <cursoragent@cursor.com>
Give main and preload a shared typed export surface without rewriting the preload.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Prune orphaned StoreBase and api getCurrentWindow entries the old check could not see.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep full typing under non-strict as a CI check for src/main TS, not a review-only rule.

Co-authored-by: Cursor <cursoragent@cursor.com>
…helpers

TypeScript main helpers (no ipc) (#75)
Extract run, model selection, and ASTRAL out of api
Fail typecheck baseline on unused src/ lines
Co-authored-by: Cursor <cursoragent@cursor.com>
Leaf of the main-process TypeScript migration: explicit parse/write export types so main keeps the same extensionless import while parsers stay JavaScript.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give is, platform, and quote explicit types so main keeps the same helpers without sheltering the platformKey diagnostics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give those modules explicit export types with Electron dialog typings while leaving colocated Jest in JavaScript.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extend the #67 eslint override so src/common leaves get the same explicit-module-boundary-types gate as main.

Co-authored-by: Cursor <cursoragent@cursor.com>
Jest jsdom uses a different Error realm than Node throws, so catch narrowing must read (error as Error).message.

Co-authored-by: Cursor <cursoragent@cursor.com>
TypeScript main dialogs and state report (#78)
Use Electron MenuItemConstructorOptions so menu constructor typings hold and clear the menu typecheck baseline.

Co-authored-by: Cursor <cursoragent@cursor.com>
The #78 lint rule bans that check under jsdom; cast like the other main catch sites.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the extract as a pure rename so the typing pass can land as a follow-up edit.

Co-authored-by: Cursor <cursoragent@cursor.com>
jtklein-agents and others added 24 commits November 14, 2026 12:10
Give static-bin and process exports explicit types, declare the shell __static inject module-locally, and leave caller exitCode mismatches sheltered until those modules are typed.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ss-helpers

TypeScript shared process helpers (#79)
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the extract as a pure rename so the typing pass can land as a follow-up edit.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Give the RUN_START handler and combine-output path explicit types, keep quiet-cancel guards, and shelter still-JS api.js exec overload details the startRun fingerprints used to cover.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pathless Overload detail lines no longer shelter another file's identical text when a leaf deletes its own baseline block.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the string|number union on main run helpers and align Jest and preload proofs with numeric run ids; alignment composites stay `${run.id}_${path}`.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ion-module

TypeScript model-selection module (#81)
Drop both sides' baseline lines: ASTRAL and model-selection are typed.

Co-authored-by: Cursor <cursoragent@cursor.com>
ASTRAL and start-run payloads use numeric run ids. Model selection keeps the alignment composite string. cancelRun/runProcess take TrackedId so both call sites type-check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Give every handler an explicit type, add a narrow __static ambient for the shell inject, and reuse the ExecOptions cast already used by start-run.

Co-authored-by: Cursor <cursoragent@cursor.com>
Dark mode takes a boolean; dialog and run-cancel ids are run numbers; alignment parse and model-selection cancel keep the composite string id.

Co-authored-by: Cursor <cursoragent@cursor.com>
…d-static-ambient

TypeScript thin api and __static ambient (#84)
Co-authored-by: Cursor <cursoragent@cursor.com>
Use Electron BrowserWindowConstructorOptions for the window options so the Linux icon assignment type-checks, and point the update source scan at the renamed entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Close out main TypeScript TODO
Comment thread src/main/api.ts
async function readalGetFormat( alignmentPath: string ): Promise<string | undefined> {
const readalPath = path.resolve( binaryDir, 'readal' );
const childCmd = `${quote( readalPath )} -in ${quote( alignmentPath )} -type -format`;
const { stdout, stderr } = await exec( childCmd, {
Comment thread src/main/api.ts
const readalPath = path.resolve( binaryDir, 'readal' );
const newPath = alignmentPath.replace( path.extname( alignmentPath ), '.fas' );
const childCmd = `${quote( readalPath )} -in ${quote( alignmentPath )} -out ${quote( newPath )} -fasta`;
const { stdout, stderr } = await exec( childCmd, {
@jtklein-agents

Copy link
Copy Markdown
Owner Author

Already merged upstream as AntonelliLab#498.

@jtklein-agents
jtklein-agents deleted the spec/67-main-typescript branch November 14, 2026 20:21
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.

Spec: main-process TypeScript

2 participants