mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-11-07 06:19:43 -10:00
* fix(types): compile cleanly under the TypeScript 7 native compiler tsgo (@typescript/native-preview) reported 48 errors across the typecheck projects while tsc 5.8 reported none. This removes all of them without changing what tsc emits, so a tsgo typecheck lane or a later compiler switch can start from a clean tree. - Drop `baseUrl` from five tsconfigs. TypeScript 7 removed it, and every `paths` target here is already relative to its tsconfig. - Set `rootDir` where TypeScript 7 no longer infers it (web-shell declarations, sdk-typescript), and list node types explicitly for cua-driver now that @types are no longer included by default. - Annotate Buffers built by Node's Buffer factories as `Buffer<ArrayBuffer>` (or widen to `Buffer` where a variable later receives stream chunks); the ES2024 lib no longer treats ArrayBufferLike as an ArrayBuffer, so these failed at fetch, Blob, and Response call sites. The two call sites that take caller- or interface-supplied bytes assert `BodyInit`, matching the existing XMLHttpRequest upload path. - Remove three redundant `?? []` / `?? undefined` operands that the newer checker reports as unreachable. - Declare `*.css` modules for the two integrations that import stylesheets, now that side-effect imports are checked. * fix(types): include web-shell client declarations in the build config The config's include listed only client/index.tsx, so client/vite-env.d.ts and client/local-files/file-system-access.d.ts never entered the program. Removing baseUrl unmasked 227 tsgo errors (and 222 under tsc 5.8) for the CSS module and File System Access declarations they provide. --------- Co-authored-by: Shaojin Wen <[email protected]>
63 lines
2.0 KiB
JSON
63 lines
2.0 KiB
JSON
{
|
|
"compilerOptions": {
|
|
/* Language and Environment */
|
|
"target": "ES2022",
|
|
"lib": ["ES2022", "DOM"],
|
|
"module": "ESNext",
|
|
"moduleResolution": "bundler",
|
|
|
|
/* Emit */
|
|
"declaration": true,
|
|
"declarationMap": true,
|
|
"sourceMap": true,
|
|
"outDir": "./dist",
|
|
// The core sources mapped in `paths` below sit outside this package, so the
|
|
// project root is the packages directory. TypeScript 5 infers that; newer
|
|
// compilers default rootDir to this directory and reject those files.
|
|
"rootDir": "..",
|
|
"removeComments": true,
|
|
"importHelpers": false,
|
|
|
|
/* Interop Constraints */
|
|
"esModuleInterop": true,
|
|
"allowSyntheticDefaultImports": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"isolatedModules": true,
|
|
|
|
/* Type Checking */
|
|
"strict": true,
|
|
"noUnusedLocals": true,
|
|
"noUnusedParameters": true,
|
|
"noFallthroughCasesInSwitch": true,
|
|
"noImplicitReturns": true,
|
|
"noUncheckedIndexedAccess": true,
|
|
"exactOptionalPropertyTypes": false,
|
|
|
|
/* Completeness */
|
|
"skipLibCheck": true,
|
|
|
|
/* Module Resolution */
|
|
"resolveJsonModule": true,
|
|
"types": ["node"],
|
|
// The cli bundle pulls these sources in through the cli tsconfig
|
|
// `@qwen-code/sdk/*` mapping, and mainBuild discovers this file per
|
|
// importing file (it passes no `tsconfig` option). Without a named entry
|
|
// here, core subpath imports fall back to the `exports` map and bundle a
|
|
// packages/core/dist copy next to the packages/core/src copy every
|
|
// package-root import loads. Mirrors packages/acp-bridge/tsconfig.json.
|
|
"paths": {
|
|
"@qwen-code/qwen-code-core/shellResult": [
|
|
"../core/src/utils/shell-result.ts"
|
|
],
|
|
"@qwen-code/qwen-code-core/transcriptRecords": [
|
|
"../core/src/utils/transcript-records.ts"
|
|
],
|
|
"@qwen-code/qwen-code-core/telemetryConstants": [
|
|
"../core/src/telemetry/constants.ts"
|
|
]
|
|
}
|
|
},
|
|
"include": ["src/**/*.ts"],
|
|
"exclude": ["node_modules", "dist", "test", ".integration-tests"]
|
|
}
|