From c7e5e77e80a370a4a86f49be5b53086266f589f8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Mar 2026 09:21:39 +0000 Subject: [PATCH] build(deps): upgrade TypeScript from 5.x to 6.x TypeScript 6 now includes Navigation API types, so the @ts-expect-error directive in Router.tsx is no longer needed. Also added optional chaining for `navigation.transition` which can be null. https://claude.ai/code/session_019Ds1gqBPnpo5cDw6Fqzmw5 --- packages/docs/src/Router.tsx | 5 ++--- pnpm-lock.yaml | 26 +++++++++++++------------- pnpm-workspace.yaml | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/packages/docs/src/Router.tsx b/packages/docs/src/Router.tsx index ebfc3af..6dfa665 100644 --- a/packages/docs/src/Router.tsx +++ b/packages/docs/src/Router.tsx @@ -7,7 +7,6 @@ export const Router: React.FC = (props) => { // Auto scroll to top - this should be handled by the browser per spec, // but currently Chrome and Safari do not follow the spec. useEffect(() => { - // @ts-expect-error -- TypeScript does not yet know about the Navigation API const navigation = window.navigation; if (!navigation) { return; @@ -18,8 +17,8 @@ export const Router: React.FC = (props) => { () => { const transition = navigation.transition; if ( - transition.navigationType === "push" || - transition.navigationType === "replace" + transition?.navigationType === "push" || + transition?.navigationType === "replace" ) { // Safari is known to ignore scrolling immediately after a push/replace navigation, so we wait a bit // Also, Safari doesn't handle scrolling to 0, so we use the -1 trick diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7cdaeca..d302687 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,8 +19,8 @@ catalogs: specifier: ^19.2.4 version: 19.2.4 typescript: - specifier: ^5.9.3 - version: 5.9.3 + specifier: ^6.0.2 + version: 6.0.2 vite: specifier: ^8.0.3 version: 8.0.3 @@ -86,7 +86,7 @@ importers: version: 0.0.7 typescript: specifier: 'catalog:' - version: 5.9.3 + version: 6.0.2 vite: specifier: 'catalog:' version: 8.0.3(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(terser@5.46.1)(tsx@4.21.0) @@ -191,10 +191,10 @@ importers: version: 19.2.4(react@19.2.4) tsdown: specifier: ^0.21.7 - version: 0.21.7(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1)(typescript@5.9.3) + version: 0.21.7(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1)(typescript@6.0.2) typescript: specifier: 'catalog:' - version: 5.9.3 + version: 6.0.2 vite: specifier: 'catalog:' version: 8.0.3(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1)(@types/node@25.5.0)(esbuild@0.27.4)(terser@5.46.1)(tsx@4.21.0) @@ -2545,8 +2545,8 @@ packages: resolution: {integrity: sha512-FlJ8OD5Qcp0jTAM7E4a/RhUzRNds2GzKlyxHKA6N247VLy628rrxAGlMpIXSz6VB430+TiQDJ/SMl6PL1lu6wQ==} hasBin: true - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + typescript@6.0.2: + resolution: {integrity: sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==} engines: {node: '>=14.17'} hasBin: true @@ -4832,7 +4832,7 @@ snapshots: resolve-pkg-maps@1.0.0: {} - rolldown-plugin-dts@0.23.2(rolldown@1.0.0-rc.12(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1))(typescript@5.9.3): + rolldown-plugin-dts@0.23.2(rolldown@1.0.0-rc.12(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1))(typescript@6.0.2): dependencies: '@babel/generator': 8.0.0-rc.3 '@babel/helper-validator-identifier': 8.0.0-rc.3 @@ -4846,7 +4846,7 @@ snapshots: picomatch: 4.0.4 rolldown: 1.0.0-rc.12(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1) optionalDependencies: - typescript: 5.9.3 + typescript: 6.0.2 transitivePeerDependencies: - oxc-resolver @@ -5073,7 +5073,7 @@ snapshots: trough@2.2.0: {} - tsdown@0.21.7(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1)(typescript@5.9.3): + tsdown@0.21.7(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1)(typescript@6.0.2): dependencies: ansis: 4.2.0 cac: 7.0.0 @@ -5084,7 +5084,7 @@ snapshots: obug: 2.1.1 picomatch: 4.0.4 rolldown: 1.0.0-rc.12(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1) - rolldown-plugin-dts: 0.23.2(rolldown@1.0.0-rc.12(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1))(typescript@5.9.3) + rolldown-plugin-dts: 0.23.2(rolldown@1.0.0-rc.12(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1))(typescript@6.0.2) semver: 7.7.4 tinyexec: 1.0.4 tinyglobby: 0.2.15 @@ -5092,7 +5092,7 @@ snapshots: unconfig-core: 7.5.0 unrun: 0.2.34(@emnapi/core@1.9.0)(@emnapi/runtime@1.9.1) optionalDependencies: - typescript: 5.9.3 + typescript: 6.0.2 transitivePeerDependencies: - '@emnapi/core' - '@emnapi/runtime' @@ -5124,7 +5124,7 @@ snapshots: '@turbo/windows-64': 2.8.21 '@turbo/windows-arm64': 2.8.21 - typescript@5.9.3: {} + typescript@6.0.2: {} unconfig-core@7.5.0: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c9fdd6f..977db30 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -9,7 +9,7 @@ catalog: "@vitejs/plugin-react": ^6.0.1 react: ^19.2.4 react-dom: ^19.2.4 - typescript: ^5.9.3 + typescript: ^6.0.2 vite: ^8.0.3 onlyBuiltDependencies: