Migrate electron frontend to TypeScript (#1032)#1034
Merged
Conversation
Converts all 5 source files to TypeScript using the same conventions as the recent client migration: strict null checks, NodeNext modules, and @typescript-eslint v8. Adds a tsc compilation step (output to dist/) since the Electron main process needs real .js files unlike the Vite-built client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Client Test Results128 tests 128 ✅ 0s ⏱️ Results for commit 259e6e2. ♻️ This comment has been updated with latest results. |
Python Test Results 1 files 1 suites 1m 27s ⏱️ Results for commit 259e6e2. ♻️ This comment has been updated with latest results. |
Regenerated lockfile from scratch to include transitive deps (encoding, iconv-lite) introduced by the TypeScript devDependencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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.



Summary
tsccompilation step outputting todist/— required because the Electron main process needs real.jsfiles (unlike the Vite-built client which usesnoEmit)run-typecheck-electronCI job tonodelint.ymlalongside the existing lint jobKey changes
main.js→main.ts: typedConnectionManagervariable; localwinpattern increateWindow()removes the unused module-levelmainWindowrefpreload.cjs→preload.cts:.ctsextension signals CommonJS within an ESM project;tsccompiles it todist/preload.cjs(Electron sandbox requires CJS preloads)services/ConnectionManager.ts:Connection,ConnectionInput,ConnectionStoreSchemainterfaces;Store<ConnectionStoreSchema>for type-safe CRUDservices/MDNSDiscovery.ts:DiscoveredServer/DiscoveredServerWithVersioninterfaces;Servicetype frombonjour-serviceservices/VersionChecker.ts:VersionCheckResultinterface;NodeJS.ErrnoExceptionfor typed error code checkseslint.config.mjs: replaced JS config blocks with@typescript-eslintparser/plugin blocks for.ts/.cts;no-undef: offfor TS files (TypeScript handles this natively)tsconfig.json:NodeNextmodules +ES2022lib (no DOM); same strictness flags as client (strictNullChecks,strictFunctionTypes)Test plan
npm run typecheck— zero errorsnpm run ci-lint— zero errors (Prettier + ESLint)npx tsc—dist/main.js,dist/preload.cjs,dist/services/*.jsall produced correctlynpm run dev— app starts and loads DigiScript UI🤖 Generated with Claude Code