fix(electron): keep the backend specs on the base compile target

The ES2022 target moves from apps/electron-backend/tsconfig.json to
tsconfig.app.json, so it applies to the main-process and preload build
only. Compiling the Jest specs for ES2022 dropped the downleveled helpers
from Istanbul's statement counts (downloads.events.ts: 126 -> 111
statements, 79 -> 71 covered, 62.69% -> 63.96%) and tripped the absolute
minimumCovered ratchet in tools/coverage/coverage-policy.json without any
coverage being lost. The shipped bundles are byte-identical either way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-09-30 07:28:08 +02:00
1 parent 9b0b9b6944
commit 33e4fc9c9a
3 files changed
+13 -8

No files matched your search

+3 -1
View File
@@ -3,7 +3,9 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"],
"importHelpers": false
"importHelpers": false,
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["../../global.d.ts"],
"exclude": [
+1 -3
View File
@@ -4,9 +4,7 @@
"types": ["node"],
"moduleResolution": "nodenext",
"module": "NodeNext",
"ignoreDeprecations": "6.0",
"target": "ES2022",
"useDefineForClassFields": false
"ignoreDeprecations": "6.0"
},
"include": ["**/*.ts"]
}
+9 -4
View File
@@ -135,10 +135,15 @@ from `app.asar`. The preload is
[DB worker](../architecture/sqlite-db-worker.md) for worker ownership and
[Electron security](../architecture/electron-security.md) for bridge boundaries.
`apps/electron-backend/tsconfig.json` sets `"target": "ES2022"` for the
main-process bundles (`main.js`, `main.app.js`, `deferred-events.js`), the
preloads and the backend's Jest specs; `tsconfig.base.json` stays at `es2015`
because other projects inherit it. Electron 43 (Node 24 and Chromium's V8) runs
`apps/electron-backend/tsconfig.app.json` sets `"target": "ES2022"` for the
main-process bundles (`main.js`, `main.app.js`, `deferred-events.js`) and the
preloads; `tsconfig.base.json` stays at `es2015` because other projects
inherit it. The Jest specs (`tsconfig.spec.json`) keep the base target on
purpose: Istanbul counts the statements of the emitted code, so an ES2022 spec
build drops the downleveled helpers from the counts (for example
`downloads.events.ts` from 126 to 111 statements) and would trip the absolute
`minimumCovered` ratchets in `tools/coverage/coverage-policy.json` without any
coverage being lost. Electron 43 (Node 24 and Chromium's V8) runs
ES2022 natively in the main process and in the sandboxed preload, so
async/await, optional chaining and `??` are no longer downleveled.
`"useDefineForClassFields": false` keeps the class-field semantics of the old