[code-infra] Make @mui/internal-docs-utils compatible with TypeScript 6 by Janpot · Pull Request #48594 · mui/material-ui (original) (raw)

Summary

Makes @mui/internal-docs-utils compatible with TypeScript 6 ahead of the repo-wide TS 6 upgrade.

The package re-exports the TypeScript compiler API types (ts.Symbol, ts.Type, ts.Program, ts.Node) in its public API and operates on AST nodes its consumers create. So it must share a single typescript instance with whoever consumes it — a bundled dependencies copy invites duplicate-typescript type incompatibilities and SyntaxKind enum mismatches.

The previous ^5.9.3 direct dependency excluded 6.x, which would have caused pnpm to resolve a separate typescript@5.9.3 for this package — silently keeping its typecheck on 5.9 and creating a version mismatch for consumers on TS 6.

The source itself required no changes: it already typechecks and emits declarations cleanly against typescript@6.0.0-dev (verified locally).

Downstream note

This is a published package also consumed by mui-x. Moving typescript to peerDependencies is a (minor) change to the published dependency contract, but both in-repo consumers (api-docs-builder, scripts) and mui-x already depend on typescript, so the peer requirement stays satisfied.