diff --git a/README.md b/README.md index db403f20..5b06c1e3 100644 --- a/README.md +++ b/README.md @@ -533,3 +533,14 @@ nix develop ``` The flake provides all necessary development dependencies including Node.js, pnpm, and other build tools. + +### TypeScript compilers + +`pnpm test` runs Vitest type checks with stable native TypeScript 7 through the +explicit `@typescript/native` executable path. The pinned TypeScript 5.9.3 package +remains available for compiler API consumers and the published-package consumer +compatibility test. `pnpm build` retains its existing native-preview declaration +compiler. + +Use these scripts or an explicit compiler path when adding checks: both compiler +packages expose a `tsc` command, so bare `tsc` and `pnpm exec tsc` are ambiguous. diff --git a/knip.config.ts b/knip.config.ts index 41dc38bb..83f926b0 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -14,7 +14,8 @@ export default { }, ignore: ['**/*.test.ts', '**/*.spec.ts', '**/*.test-d.ts'], ignoreBinaries: ['only-allow', 'oxfmt', 'oxlint', 'tsx'], - ignoreDependencies: ['@typescript/native-preview'], + // Vitest spawns the native checker through an explicit file path. + ignoreDependencies: ['@typescript/native-preview', '@typescript/native'], rules: { optionalPeerDependencies: 'off', devDependencies: 'warn', diff --git a/package.json b/package.json index 79369320..f4b9c883 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "@fast-check/vitest": "catalog:dev", "@hono/mcp": "catalog:dev", "@types/node": "catalog:dev", + "@typescript/native": "catalog:dev", "@vitest/coverage-v8": "catalog:dev", "ai": "catalog:dev", "hono": "catalog:dev", @@ -77,6 +78,7 @@ "publint": "catalog:dev", "tsdown": "catalog:dev", "type-fest": "catalog:dev", + "typescript": "catalog:dev", "unplugin-unused": "catalog:dev", "vitest": "catalog:dev", "zod": "catalog:dev" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a35ce51f..6c5ee2e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,9 @@ catalogs: '@types/node': specifier: ^22.13.5 version: 22.19.1 + '@typescript/native': + specifier: npm:typescript@7.0.2 + version: 7.0.2 '@vitest/coverage-v8': specifier: ^4.0.15 version: 4.0.15 @@ -42,6 +45,9 @@ catalogs: type-fest: specifier: ^4.41.0 version: 4.41.0 + typescript: + specifier: 5.9.3 + version: 5.9.3 unplugin-unused: specifier: ^0.5.4 version: 0.5.6 @@ -96,6 +102,9 @@ importers: '@types/node': specifier: catalog:dev version: 22.19.1 + '@typescript/native': + specifier: catalog:dev + version: typescript@7.0.2 '@vitest/coverage-v8': specifier: catalog:dev version: 4.0.15(supports-color@7.2.0)(vitest@4.0.15(@opentelemetry/api@1.9.0)(@types/node@22.19.1)(jiti@2.6.1)(msw@2.12.3(@types/node@22.19.1)(typescript@5.9.3))(tsx@4.21.0)(yaml@2.8.2)) @@ -126,6 +135,9 @@ importers: type-fest: specifier: catalog:dev version: 4.41.0 + typescript: + specifier: catalog:dev + version: 5.9.3 unplugin-unused: specifier: catalog:dev version: 0.5.6 @@ -172,6 +184,131 @@ importers: packages: + '@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] + + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true + '@ai-sdk/gateway@4.0.36': resolution: {integrity: sha512-N1P6bdW/aC5rxLeuGYgx3X4el3DoZy8UWlky+g+AeIZSmxaEi/AToHJL4cmZ6nCPHk1byqJWwC+PaOZG0hK0dw==} engines: {node: '>=22'} @@ -2327,6 +2464,89 @@ packages: snapshots: + '@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 + + 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 + '@ai-sdk/gateway@4.0.36(zod@4.3.5)': dependencies: '@ai-sdk/provider': 4.0.4 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c86d87b9..612748cd 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -11,6 +11,7 @@ catalogs: '@fast-check/vitest': ^0.2.0 '@hono/mcp': ^0.1.4 '@types/node': ^22.13.5 + '@typescript/native': npm:typescript@7.0.2 '@vitest/coverage-v8': ^4.0.15 hono: ^4.9.10 knip: ^5.72.0 @@ -18,6 +19,7 @@ catalogs: publint: ^0.3.12 tsdown: ^0.17.2 type-fest: ^4.41.0 + typescript: 5.9.3 unplugin-unused: ^0.5.4 vitest: ^4.0.15 zod: ^4.3.0 diff --git a/scripts/package-exports.test.ts b/scripts/package-exports.test.ts index a2d9d5f6..a7a2c40e 100644 --- a/scripts/package-exports.test.ts +++ b/scripts/package-exports.test.ts @@ -124,9 +124,12 @@ describe('published package output', () => { try { const consumerDir = await createConsumerFixture(tempDir); try { - // The consumer fixture has no TypeScript install of its own, so tsc - // runs from the repository's pnpm context. - await execFileAsync('pnpm', ['exec', 'tsc', '-p', consumerDir], { cwd: rootDir }); + // Keep consumer compatibility covered by the pinned JavaScript compiler. + await execFileAsync( + process.execPath, + [path.join(rootDir, 'node_modules/typescript/bin/tsc'), '-p', consumerDir], + { cwd: rootDir }, + ); } catch (error) { const execError = (error ?? {}) as { stdout?: string; stderr?: string }; const output = `${execError.stdout ?? ''}${execError.stderr ?? ''}`.trim(); diff --git a/vitest.config.ts b/vitest.config.ts index a6cefa7d..075bb3c5 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -22,6 +22,7 @@ export default defineConfig({ exclude: ['node_modules', 'dist', 'examples'], typecheck: { enabled: true, + checker: './node_modules/@typescript/native/bin/tsc', include: ['src/**/*.test.ts', 'src/**/*.test-d.ts'], }, },