chore: update TypeScript configuration and scripts (#9792)

- Added support for TypeScript incremental builds by enabling the `incremental` option and specifying the `tsBuildInfoFile` in both `tsconfig.node.json` and `tsconfig.web.json`.
- Updated the `typecheck` script in `package.json` to use `concurrently` for running node and web type checks in parallel.
- Added `.tsbuildinfo` to `.gitignore` to prevent build info files from being tracked.
This commit is contained in:
beyondkmp 2025-09-02 16:21:09 +08:00 committed by GitHub
parent 2c0391da81
commit d6dcb471f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 1 deletions

3
.gitignore vendored
View File

@ -60,6 +60,9 @@ coverage
.vitest-cache
vitest.config.*.timestamp-*
# TypeScript incremental build
.tsbuildinfo
# playwright
playwright-report
test-results

View File

@ -47,7 +47,7 @@
"generate:icons": "electron-icon-builder --input=./build/logo.png --output=build",
"analyze:renderer": "VISUALIZER_RENDERER=true yarn build",
"analyze:main": "VISUALIZER_MAIN=true yarn build",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
"typecheck": "concurrently -n \"node,web\" -c \"cyan,magenta\" \"npm run typecheck:node\" \"npm run typecheck:web\"",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
"check:i18n": "tsx scripts/check-i18n.ts",
@ -200,6 +200,7 @@
"cli-progress": "^3.12.0",
"code-inspector-plugin": "^0.20.14",
"color": "^5.0.0",
"concurrently": "^9.2.1",
"country-flag-emoji-polyfill": "0.1.8",
"dayjs": "^1.11.11",
"dexie": "^4.0.8",

View File

@ -12,6 +12,8 @@
"src/renderer/src/services/traceApi.ts" ],
"compilerOptions": {
"composite": true,
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo/tsconfig.node.tsbuildinfo",
"types": [
"electron-vite/node",
"vitest/globals"

View File

@ -12,6 +12,8 @@
],
"compilerOptions": {
"composite": true,
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo/tsconfig.web.tsbuildinfo",
"jsx": "react-jsx",
"baseUrl": ".",
"moduleResolution": "bundler",