Unverified 提交 c08b2311 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Speed up TS checks (#2111)

<!-- CURSOR_SUMMARY --> > [!NOTE] > Improves TypeScript check performance and dev ergonomics. > > - Switches `ts:main` from `tsc` to `tsgo` with `--incremental`; adds `--incremental` to `ts:workers` > - Adds `@typescript/native-preview` (and platform binaries) to dev deps/lockfile to support `tsgo` > - Moves lint-staged config from `package.json` to `lint-staged.config.js` and runs `npm run ts` on staged `*.ts,*.tsx` > - Updates TS configs to remove `baseUrl` and add catch‑all `paths` mapping (`"*": ["./*"]`) across `tsconfig*.json` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d25edc6782daf89b40d7c45c3ac25e6ad5bf5ee5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
上级 b7d38b0f
module.exports = {
"**/*.{ts,tsx}": () => "npm run ts",
"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,astro,svelte}": "oxlint",
"*.{js,css,md,ts,tsx,jsx,json,yml,yaml}": "prettier --write",
};
......@@ -125,6 +125,7 @@
"@types/react-dom": "^19.0.4",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@typescript/native-preview": "^7.0.0-dev.20260107.1",
"@vitest/ui": "^3.1.1",
"cross-env": "^7.0.3",
"drizzle-kit": "^0.30.6",
......@@ -7727,6 +7728,123 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript/native-preview": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-GkMZ4alU9Pr/5pUjZRzA9NMQ2wadrCPN+YHhjOlr8VM2gCFoSg5+ewLVMu4ZcdjdJDs8DUcCyuHQiW6Zr5iBvQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsgo": "bin/tsgo.js"
},
"optionalDependencies": {
"@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260107.1",
"@typescript/native-preview-darwin-x64": "7.0.0-dev.20260107.1",
"@typescript/native-preview-linux-arm": "7.0.0-dev.20260107.1",
"@typescript/native-preview-linux-arm64": "7.0.0-dev.20260107.1",
"@typescript/native-preview-linux-x64": "7.0.0-dev.20260107.1",
"@typescript/native-preview-win32-arm64": "7.0.0-dev.20260107.1",
"@typescript/native-preview-win32-x64": "7.0.0-dev.20260107.1"
}
},
"node_modules/@typescript/native-preview-darwin-arm64": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-IlmAcBuRJ16iP458tHhnsuE5ANzZkkO0m9y5WSgxrSj2Y5pVHa8mE5mC9SMFDLeUiLUAJ0kyXU0/LeDUOYtxXQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@typescript/native-preview-darwin-x64": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-33mTAoeFzwrfikWpo+nfWDgasAAuoLLtRoAZAVYQmCTVZed0yqrNED2tI8bsHYAsqlau/T66qb7cWXQjJ6aT5g==",
"cpu": [
"x64"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@typescript/native-preview-linux-arm": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-zYrp5E/Mda2nKTR+ahT2+hPOXJE7MoJdhyxw8Uzdoy/buETnS+UBCEdahb9Wx2cxFyXpZpiHuNOOGujfJgIv+Q==",
"cpu": [
"arm"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@typescript/native-preview-linux-arm64": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-3euY/vSJQ0L8WfMYDQ/2DtImNtnBevIN+g3qU18LiKv1Be/MNld/Wk7zmvAdvbQ1lXCAFeGG8dGa5NHpVIQE2A==",
"cpu": [
"arm64"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@typescript/native-preview-linux-x64": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-5lD2j5RyG6ShedMghgMZ+yK4sFf0KnqQhRBndgC9PY6W+QaqvyVrCUURN28TAj4C6oea/Xs8DYMCafEGrv7pPA==",
"cpu": [
"x64"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@typescript/native-preview-win32-arm64": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-eGPP25i28mhjtAsaQLG85HMWYagaz4c6KE5HmSn0z1Tr3CZFet2wnmoBe71mcFQJbLfXJ37PCJg6GB6oNuJh5Q==",
"cpu": [
"arm64"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@typescript/native-preview-win32-x64": {
"version": "7.0.0-dev.20260107.1",
"resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20260107.1.tgz",
"integrity": "sha512-t7UCZLnQqE93RGSP1YAqu1eegVJX5KhgwSuaTO62cf+UeptEz7cuIP0vPVNxyzial5bKvOoXekkWXQ4u5G1wlQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "Apache-2.0",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@ungap/structured-clone": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",
......
......@@ -21,8 +21,8 @@
"publish": "npm run clean && electron-forge publish",
"verify-release": "node scripts/verify-release-assets.js",
"ts": "npm run ts:main && npm run ts:workers",
"ts:main": "npx tsc -p tsconfig.app.json --noEmit",
"ts:workers": "npx tsc -p workers/tsc/tsconfig.json --noEmit",
"ts:main": "npx tsgo -p tsconfig.app.json --noEmit --incremental",
"ts:workers": "npx tsc -p workers/tsc/tsconfig.json --noEmit --incremental",
"lint": "npx oxlint --fix",
"lint:fix": "npx oxlint --fix --fix-suggestions --fix-dangerously",
"db:generate": "drizzle-kit generate",
......@@ -66,6 +66,7 @@
"@types/node": "^22.14.0",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@typescript/native-preview": "^7.0.0-dev.20260107.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitest/ui": "^3.1.1",
......@@ -179,10 +180,6 @@
"uuid": "^11.1.0",
"zod": "^3.25.76"
},
"lint-staged": {
"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,astro,svelte}": "oxlint",
"*.{js,css,md,ts,tsx,jsx,json}": "prettier --write"
},
"overrides": {
"@vercel/sdk": {
"@modelcontextprotocol/sdk": "$@modelcontextprotocol/sdk"
......
......@@ -22,8 +22,8 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,
// import
"baseUrl": ".",
"paths": {
"*": ["./*"],
"@/*": ["./src/*"]
}
},
......
......@@ -9,8 +9,8 @@
}
],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": ["./*"],
"@/*": ["./src/*"]
},
"skipLibCheck": true
......
......@@ -8,10 +8,12 @@
"esModuleInterop": true,
"noImplicitAny": true,
"sourceMap": true,
"baseUrl": ".",
"outDir": "dist",
"moduleResolution": "bundler",
"resolveJsonModule": true
"resolveJsonModule": true,
"paths": {
"*": ["./*"]
}
// /* Bundler mode */
// // "moduleResolution": "bundler",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论