From 1156912388f6b1680f6a7051fccb68bae0a362b8 Mon Sep 17 00:00:00 2001 From: "arrz.dev" <55147716+arrzdev@users.noreply.github.com> Date: Mon, 16 Nov 2026 02:57:24 +0000 Subject: [PATCH] chore(typecheck): typescript 7 runs the root and website typecheck, 2-5x faster TypeScript 7 has no JS API, so typescript 5.9.3 stays for tsdown's .d.ts build and the tests that import the compiler; typescript-7 (alias of typescript@7.0.2) runs the typecheck only. baseUrl is removed (7 dropped it; the paths entries resolve from the tsconfig), the CLI project pins strict: false (7 defaults it on), and three new Promise() calls in bin/ get a Promise type. --- CLAUDE.md | 4 + bin/adaptv.mjs | 8 +- bin/lib/exec.mjs | 1 + package.json | 3 +- pnpm-lock.yaml | 211 ++++++++++++++++++++++++++++++++++++++++++ tsconfig.bin.json | 1 + tsconfig.json | 1 - website/package.json | 2 +- website/tsconfig.json | 1 - 9 files changed, 226 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 5dc6b963..b73d1708 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,6 +27,10 @@ in `playground/` or `scripts/` ships. outside adaptv. - pnpm 11 (`packageManager`). `playground/` is a **second, independent pnpm project** with its own lockfile; `pnpm playground:setup` installs it. +- Two TypeScripts. `typescript` (5.9.3) is the compiler API that tsdown's `.d.ts` build and a few + tests import; TypeScript 7 has no JS API. `typescript-7` (an npm alias of `typescript@7.0.2`) + runs `pnpm typecheck` (root and `website/`) through `node_modules/typescript-7/bin/tsc`. Do not + re-add `baseUrl` to a tsconfig: 7 removed it. - `unzip` on `PATH` — one OTA test checks the zip with a second implementation. ## Before every commit diff --git a/bin/adaptv.mjs b/bin/adaptv.mjs index 9545374f..fdb16908 100755 --- a/bin/adaptv.mjs +++ b/bin/adaptv.mjs @@ -1929,7 +1929,8 @@ async function serveWebPreview(appRoot, opts) { detached: true, }) const seen = [] - await new Promise((resolve, reject) => { + /** @type {Promise} */ + const listening = new Promise((resolve, reject) => { const onData = (buf) => { const text = String(buf) if (verbose) rawOut(text) @@ -1970,6 +1971,7 @@ async function serveWebPreview(appRoot, opts) { ) }) }) + await listening //the addresses are their own block under this row return "" }, @@ -2022,7 +2024,8 @@ async function holdWebPreview(state) { //The SAME watcher row `dev` uses — bold key, its own line — rather than a second copy of //the idea. `keys: false` because there is nothing to reload or rebuild from here (R17). state.watcher = liveWatcher({ keys: false }) - await new Promise((resolve) => { + /** @type {Promise} */ + const closed = new Promise((resolve) => { state.child?.on("close", (code) => { state.stop() if (code && code !== 0) { @@ -2032,6 +2035,7 @@ async function holdWebPreview(state) { resolve() }) }) + await closed } /** diff --git a/bin/lib/exec.mjs b/bin/lib/exec.mjs index 048da50f..38130e39 100644 --- a/bin/lib/exec.mjs +++ b/bin/lib/exec.mjs @@ -211,6 +211,7 @@ function relayOff() { * @param {string} command * @param {string[]} args * @param {{ cwd?: string, env?: NodeJS.ProcessEnv, onLine?: (line: string) => void }} [opts] + * @returns {Promise} */ export function exec(command, args, { cwd, env, onLine } = {}) { return new Promise((resolve, reject) => { diff --git a/package.json b/package.json index e9be7ca5..b33c83e6 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "smoke:webkit": "bash .github/webkit-smoke/smoke.sh", "test": "vitest run", "test:coverage": "vitest run --coverage", - "typecheck": "tsc --noEmit && tsc -p tsconfig.bin.json", + "typecheck": "node node_modules/typescript-7/bin/tsc --noEmit && node node_modules/typescript-7/bin/tsc -p tsconfig.bin.json", "website:dev": "pnpm --dir website dev" }, "imports": { @@ -186,6 +186,7 @@ "tailwindcss": "4.2.4", "tsdown": "0.22.12", "typescript": "5.9.3", + "typescript-7": "npm:typescript@7.0.2", "vite": "8.1.6", "vitest": "4.1.12" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26703475..15dc58e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -195,6 +195,9 @@ importers: typescript: specifier: 5.9.3 version: 5.9.3 + typescript-7: + specifier: npm:typescript@7.0.2 + version: typescript@7.0.2 vite: specifier: 8.1.6 version: 8.1.6(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0) @@ -2060,6 +2063,126 @@ packages: '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + '@vitejs/plugin-react@5.2.0': resolution: {integrity: sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -4063,6 +4186,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true + ufo@1.6.4: resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==} @@ -6345,6 +6473,66 @@ snapshots: dependencies: '@types/node': 26.1.1 + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + '@vitejs/plugin-react@5.2.0(vite@8.1.6(@types/node@26.1.1)(esbuild@0.28.1)(jiti@2.7.0)(terser@5.49.0))': dependencies: '@babel/core': 7.29.7 @@ -8331,6 +8519,29 @@ snapshots: typescript@5.9.3: {} + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 + ufo@1.6.4: {} unbox-primitive@1.1.0: diff --git a/tsconfig.bin.json b/tsconfig.bin.json index e89eb53d..39104234 100644 --- a/tsconfig.bin.json +++ b/tsconfig.bin.json @@ -3,6 +3,7 @@ "allowJs": true, "checkJs": true, "noEmit": true, + "strict": false, "skipLibCheck": true, "target": "es2022", "module": "nodenext", diff --git a/tsconfig.json b/tsconfig.json index 807b65f5..fc5af17f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,6 @@ "module": "ESNext", "moduleResolution": "bundler", "allowImportingTsExtensions": true, - "baseUrl": ".", "paths": { "#adaptv/*": ["./src/*"], // The app supplies the real route tree through this same alias (adaptv stamps diff --git a/website/package.json b/website/package.json index 48a8b028..94105f09 100644 --- a/website/package.json +++ b/website/package.json @@ -9,7 +9,7 @@ "dev": "adaptv dev web", "preview": "adaptv preview web", "build": "adaptv build web", - "typecheck": "node scripts/generate-types.mjs && tsc --noEmit -p tsconfig.json", + "typecheck": "node scripts/generate-types.mjs && node ../node_modules/typescript-7/bin/tsc --noEmit -p tsconfig.json", "format": "../node_modules/.bin/biome format --write .", "lint": "../node_modules/.bin/biome check .", "test": "vitest run", diff --git a/website/tsconfig.json b/website/tsconfig.json index 1157ac67..40e42f6c 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -6,7 +6,6 @@ ], "exclude": ["node_modules", "dist", ".output"], "compilerOptions": { - "baseUrl": ".", "paths": { "#adaptv-route-tree": ["./.adaptv/routeTree.gen.ts"], "@/*": ["./src/*"],