docs: clarify compiler setup for TypeScript 7 applications - #2862
Open
shreyam1008 wants to merge 1 commit into
Open
docs: clarify compiler setup for TypeScript 7 applications#2862shreyam1008 wants to merge 1 commit into
shreyam1008 wants to merge 1 commit into
Conversation
👷 Deploy request for openapi-ts pending review.Visit the deploys page to approve it
|
|
This was referenced Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Correct the setup commands in the quickstart and Node API guide to install
typescript@5, matching the currently publishedopenapi-typescript@7.13.0peer range. Installing an unqualifiedtypescriptnow selects TypeScript 7, whose root module does not provide the classic compiler API used by the generator.For TS7 applications, explain how to keep the native application compiler unchanged and run generation in a separate tooling package. Custom transforms and returned AST nodes must share the generator's JS compiler; the generated source is the boundary between that tool and the TS7 application.
Related to #2841. This is a documented workaround, not native TS7 API support, and does not close the underlying compatibility issue. It does not duplicate #2818's proposed TS6 peer-range change or change compiler ownership/runtime dependencies.
How to Review
Only
docs/introduction.mdanddocs/node.mdchange. No package, lockfile, runtime, generated output, or AST contract changes.Verified locally with Node 22.12.0 and Bun 1.4.0 using two independent package directories:
typescript@7.0.2.openapi-typescript@7.13.0andtypescript@5.9.3.nameand optional date-timecreatedAt.componentstype using the application's TS7 compiler,--noEmit --strict --skipLibCheck false; a valid assignment passes and an intentional numeric-name assignment is rejected via@ts-expect-error.transformreturnsts.factory.createTypeReferenceNode("Date"); printing yieldscreatedAt?: Date. Returned nodes can be inspected withts.isInterfaceDeclaration.typescriptmodule, version 5.9.3.git diff --checkpasses.The complete documentation site build and repository-wide suites were not run for this small Markdown correction. No claim of testing native TS7 AST interoperability is made.
Microsoft's explanation: https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0 . The examples here retain TS5 because it is the currently declared supported peer, whereas TS6 widening remains proposed separately.
Checklist
docs/updated (if necessary)pnpm run update:examplesrun — not applicable: no generator output change.Separate note: AI assistance
Prepared with Codex/Astra assistance. The recommendation was independently checked against the public AST API and the documented setup was executed locally before submission. A private-compiler runtime patch was deliberately not included because it could break existing custom transforms using a different compiler's AST.