Skip to content

Adopt TypeScript 7 once TypeDoc and twoslash support it #612

Description

@ScriptedAlchemy

Why this is blocked

Root tsc is already TypeScript 7.0.2 (native tsc via @typescript/typescript-linux-x64). Website still pins typescript@6.0.3 because the docsite and its plugins import the JavaScript compiler API, which typescript@7.0.2 no longer exports.

Dependabot #606 (website 6.0.3 → 7.0.2) was closed. Ignore PR: #611. Proven in a scratch worktree on the #606 head after pnpm install:

Tool Installed Peer / contract TS 7.0.2? Evidence
website/rspress.config.ts import ts from 'typescript' readConfigFile / sys / flattenDiagnosticMessageText No pnpm --filter @agent-bundle/docs typecheckTS2339 on typeof import(".../typescript@7.0.2/.../lib/version")
twoslash 0.3.9 (latest) ^5.5.0 || ^6.0.0 No twoslasher('const x: number = 1', 'ts')TypeError: Cannot read properties of undefined (reading 'readFile') (ts.sys)
@rspress/plugin-twoslash 2.0.21 (latest) typescript: ^6.0.3 No same twoslash crash; no newer release
typedoc 0.28.20 (latest; also latest via @rspress/plugin-typedoc@2.0.21) 5.0.x || … || 6.0.x No import('typedoc')TypeError: Cannot read properties of undefined (reading 'PropertyDeclaration')
TypeDoc roadmap TypeStrong/typedoc#3098 targeting TS 7.1, not 7.0 not yet maintainer: beta around 7.1 RC

A typescript-5 alias on the website would fix rspress.config.ts typecheck only. Twoslash and TypeDoc still import('typescript') and crash at docs-build time. No released version accepts 7.

What must change before website can move to TypeScript 7

  1. TypeDoc ships a release whose peer includes 7.x and that runs against the TS 7.1 JS/native API (TypeStrong/typedoc#3098). Then bump @rspress/plugin-typedoc (today pins typedoc@0.28.20).
  2. twoslash ships a release whose peer includes 7.x and that can type-query without ts.sys / the old compiler API. Then @rspress/plugin-twoslash must widen its typescript: ^6.0.3 peer.
  3. website/rspress.config.ts readSourceMappedPaths must stop importing the compiler API from typescript (use the existing typescript-5 alias, or drop readConfigFile for a JSONC parse).
  4. Remove the Dependabot ignore for typescript majors in .github/dependabot.yml.
  5. Bump website typescript to 7.x and run pnpm docs:site:build (typecheck + Rspress + TypeDoc + twoslash).

Already on TS 7 (do not regress)

  • Root devDependencies.typescript is 7.0.2. pnpm typecheck runs that native tsc for the root tsconfig, workbench, create-agent-bundle, and rsc-markdown-stream.
  • Package AST/compiler-API work already uses typescript-5 (npm:typescript@5.9.3) in packages/agent-bundle (src/routes/{syntax,input-schema,typegen-program,...}.ts).
  • @rslib/core@1.0.0 DTS (dts: truersbuild-plugin-dts, tsc/tsgo, not API Extractor unless dts.bundle) peers ^5 \|\| ^6 \|\| ^7. Release gates on build(deps-dev): bump typescript from 6.0.3 to 7.0.2 #606 were green.
  • @rstest/core@0.11.12 does not import typescript.
  • scripts/check-declaration-imports.mjs parses .d.ts text; no compiler API.
  • attw@0.18.5 vendors its own typescript@5.6.1-rc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions