Repository navigation
Conversation
- Added allowBuilds for '@swc/core' and 'esbuild' in pnpm-workspace.yaml - Excluded minimum release age for nock@15.0.1 - Changed moduleResolution from 'Node' to 'Bundler' in tsconfig.json
…sistency - Updated type definitions in `githubContext.ts`, `githubFetcher.ts`, `githubParameters.ts`, and `githubSchemas.ts` to use single-line union types for better clarity. - Simplified the `RemoveIndex` type utility in `schemaToTypeAliasDeclaration.ts`. - Made minor formatting adjustments in `README.md` for consistency. - Updated `pnpm-workspace.yaml` to use consistent quotation marks. run check and fix
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fabien0102
reviewed
Oct 26, 2026
fabien0102
reviewed
Oct 26, 2026
… polyfill for Node 20
This was referenced Oct 26, 2026
Merged
# Conflicts: # .oxlintrc.json # cli/package.json # examples/frontend/package.json # package.json # plugins/typescript/package.json # plugins/typescript/src/typescript.ts # pnpm-lock.yaml
…t/typescript-7-upgrade
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.
Summary
This pull request prototypes the migration to TypeScript 7 (tested against
typescript@7.1.0-beta).In TypeScript 7, Microsoft fundamentally restructured the
typescriptpackage layout and AST compiler APIs as part of the native Go compiler rewrite (tracked in microsoft/TypeScript#63703). Rather than performing a high-risk, all-or-nothing rewrite of all 33 files that interact with TypeScript compiler APIs and breaking backwards compatibility for custom generator plugins, this PR introduces a Backwards-Compatibility Adapter Layer (plugins/typescript/src/typescript.ts) as Phase 1 of our migration roadmap.Technical Findings: Architectural Changes in TypeScript 7.x
1. Root Export Changes
In TypeScript ≤ 6.x,
import ts from "typescript"exported the entire compiler namespace (ts.factory,ts.SyntaxKind,ts.ScriptTarget,ts.createPrinter, etc.).In TypeScript 7.x (
7.0.2and7.1.0-beta), the root entry point only exports./lib/version.cjs({ version: "7.1.0-beta" }). All compiler symbols were removed from the root package.2. Subpath Modularization
TypeScript 7.1 exposes specialized subpath modules:
typescript/ast: Core AST types, scanners, visitor functions, syntax kinds, and node flags.typescript/ast/factory: Standalone factory functions (e.g.,createIdentifier,createCallExpression) rather than methods on a unifiedts.factoryobject.typescript/ast/is: Type guards (e.g.,isSourceFile,isImportDeclaration).typescript/sync: Synchronous IPC client (API,Printer) communicating with a native compiler binary.3. API Signature & Naming Breaking Changes
createPropertySignatureis renamed tocreatePropertySignatureDeclaration.createModifier(kind)was removed in favor ofcreateToken(kind).createTypeAliasDeclaration) strictly require AST node objects (such asIdentifier) rather than allowing raw string literals.ts.createPrinter()does not exist as a global JavaScript function. Emitting AST nodes is delegated to a native Go binary via an IPC RPC bridge (new sync.API().printer.printNode(node)).tsutilsis incompatible with TS7 because it accessedts.ScriptTarget.Lateston the root module.Architecture: The Backwards-Compatibility Adapter
To safeguard existing ecosystem plugins and allow our internal generators to transition smoothly, we are adopting an adapter-first approach:
Key Benefits of the Adapter
typescript/ast/*imports module-by-module.2-Phase Migration Roadmap
Phase 1: Compatibility Adapter Layer & Green CI (Completed)
typescript@7.1.0-beta.tsutilswith internalisValidIdentifierhelper.plugins/typescript/src/typescript.tsadapter:SyntaxKind,EmitHint,NewLineKind,ScriptTarget), and type guards (ts.is*).createPropertySignature->createPropertySignatureDeclaration,createModifier->createToken).new sync.API().printerand full comment/JSDoc injection fidelity.updateConfig.tsandInitCommand.ts).pnpm check:typesandpnpm test --runto 100% green (28/28 test suites, 243/243 tests pass, CI green).Phase 2: Direct TS 7 Native Modernization (33 Tracked Items)
Once Microsoft finalizes native comment/trivia printing in
typescript/sync, the 33 files below can transition from the compatibility adapter to directtypescript/ast/*imports:1. Generators (3 files)
plugins/typescript/src/generators/generateFetchers.tsplugins/typescript/src/generators/generateReactQueryComponents.tsplugins/typescript/src/generators/generateSchemaTypes.ts2. Core AST Declaration Builders (12 files)
plugins/typescript/src/core/createNamedImport.tsplugins/typescript/src/core/createNamespaceImport.tsplugins/typescript/src/core/createOperationFetcherFnNodes.tsplugins/typescript/src/core/createOperationQueryFnNodes.tsplugins/typescript/src/core/createWatermark.tsplugins/typescript/src/core/getDataResponseType.tsplugins/typescript/src/core/getErrorResponseType.tsplugins/typescript/src/core/getOperationTypes.tsplugins/typescript/src/core/getRequestBodyType.tsplugins/typescript/src/core/getVariablesType.tsplugins/typescript/src/core/schemaToEnumDeclaration.tsplugins/typescript/src/core/schemaToTypeAliasDeclaration.ts3. Core AST Utilities & Scanners (3 files)
plugins/typescript/src/core/analyzeImportUsage.tsplugins/typescript/src/core/getUsedImports.tsplugins/typescript/src/utils/isValidIdentifier.ts4. CLI AST Transformers & Utilities (6 files)
cli/src/commands/InitCommand.tscli/src/core/generateConfigProperty.tscli/src/core/generateConfigProperty.test.tscli/src/core/updateConfig.tscli/src/core/updateConfig.test.tscli/src/utils/getText.ts5. Plugin Test Suites & Test Helpers (8 files)
plugins/typescript/src/core/analyzeImportUsage.test.tsplugins/typescript/src/core/createNamedImport.test.tsplugins/typescript/src/core/getOperationTypes.test.tsplugins/typescript/src/core/getUsedImports.test.tsplugins/typescript/src/core/getVariablesType.test.tsplugins/typescript/src/core/schemaToEnumDeclaration.test.tsplugins/typescript/src/core/schemaToTypeAliasDeclaration.test.tsplugins/typescript/src/testUtils.ts6. Adapter Deprecation & Sunset (1 file)
plugins/typescript/src/typescript.ts(deprecate and sunset once all modules importtypescript/ast/*directly)Related Issues & PRs