Skip to content

fix(ui): run TypeScript 6 API side-by-side with 7 for openapi-ts - #41

Merged
lorenzofelletti merged 2 commits into
mainfrom
worktree-fix-openapi-ts-typescript7
Nov 10, 2026
Merged

lorenzofelletti merged 2 commits into
mainfrom
worktree-fix-openapi-ts-typescript7

Conversation

@lorenzofelletti

Copy link
Copy Markdown
Contributor

Problem

make api fails at the generate step with TypeError: Cannot read properties of undefined (reading 'AnyKeyword'). #38 bumped typescript to 7.0.2, which no longer ships the JS compiler API that @hey-api/openapi-ts 0.99.0 needs. Its peer range lets 7 through, so pnpm did not complain.

Fix

Microsoft's documented side-by-side setup, in web/ui/package.json:

  • typescript → npm:@typescript/[email protected] (the 6.x API, for openapi-ts and other API consumers)
  • @typescript/native → npm:[email protected] (still provides tsc, so build and typecheck stay on 7)

The fix upstream exists only on a 0.0.0-next-* prerelease (hey-api/hey-api#4235), which is a rewrite and sorts below every stable release, so it is not used here. Drop the aliases once a stable release works with TypeScript 7.

Verification

  • OpenAPI export, frozen-lockfile install and generate run clean; web/api/openapi.json and web/ui/src/api are unchanged
  • tsc --version reports 7.0.2
  • pnpm build (vite + tsc -b) completes; 267 UI tests pass

Run with pnpm 10.34.9 via npx on Node 26, not through corepack, so make api itself has not been run end to end.

🤖 Generated with Claude Code

lorenzofelletti and others added 2 commits November 10, 2026 22:04
TypeScript 7 no longer ships the JS compiler API, so @hey-api/openapi-ts 0.99.0 crashes at import and `make api` fails. Alias `typescript` to the @typescript/typescript6 compatibility package for API consumers and keep 7 as @typescript/native, which still provides `tsc`.

Drop the aliases once hey-api ships a stable release that works with TypeScript 7: hey-api/hey-api#4235

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@lorenzofelletti
lorenzofelletti merged commit 17ffd1d into main Nov 10, 2026
4 checks passed
@lorenzofelletti
lorenzofelletti deleted the worktree-fix-openapi-ts-typescript7 branch November 10, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant