Repository navigation
Migrate the whole codebase to TypeScript - #25
Merged
Merged
Conversation
Convert all ~59 remaining JS modules to TypeScript (in-place sibling emit): main.ts, src/**, preload/**, scripts/**, and the renderer windows. Runtime .js is now compiled output and gitignored wholesale; the .ts files are the sources. Main world (tsconfig.main.json) is fully strict and compiles clean. The renderer (tsconfig.renderer.json) relaxes strict/noImplicitAny/ strictNullChecks for the legacy global-scope <script> layer, typed via per-window globals.d.ts declaring only external globals (window bridges, Chart/Leaflet/pdfmake vendors, geo payloads) β cross-file hub symbols share automatically as script globals. Flag one pre-existing bug (showPermissionPanel, called but never defined) in globals.d.ts. CI type-checks via tsc; postinstall/prestart/pretest/predist compile first; .ts excluded from the packaged app. Verified: tsc clean, npm test passes, app boots, dist:mac builds.
README and QUICKSTART said "no build step β plain JS loads directly", which is no longer true after the migration. Note that npm start compiles TypeScript (build:ts) first, and add a build:ts row to the QUICKSTART scripts table.
AGENTS.md (the cross-tool agent-instructions filename read by Codex, Cursor, etc.) existed only as a stale, untracked local copy predating the TypeScript migration. Commit it as an exact copy of the current CLAUDE.md so every agent tool gets the same up-to-date project instructions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the entire app from plain JS to TypeScript ahead of the BI expansion, using in-place sibling emit (foo.ts compiles to a gitignored foo.js next to it) so require paths, <script> tags, CSP, and electron-builder packaging never change.
Scope
typescript+@types/node;build:tsruns via postinstall/prestart/pretest/predist so every entry point compiles first. CI type-checks with tsc.Strictness
tsconfig.main.json, NodeNext CommonJS) is fully strict and compiles clean.tsconfig.renderer.json) relaxesstrict/noImplicitAny/strictNullChecksfor the legacy global-scope<script>layer. Cross-file hub symbols share automatically as script globals; per-windowglobals.d.tsdeclare only genuinely external globals (preload bridges, Chart/Leaflet/pdfmake/pptx/docx vendors, baked geo payloads). Documented as tighten-later.Verified
npm run build:tsstrict-clean (0 errors),npm testpasses,npm startboots (hotkey registers, CLI detection runs),npm run dist:macbuilds with the afterSign seal intact and no .ts in the asar.Notes
globals.d.ts:showPermissionPanel()is called in a click handler but defined nowhere (identical in the original JS β throws at runtime). Declared ambient to preserve exact behavior; fix separately.