Skip to content

Upgrade project to TypeScript 6.0.3 and resolve TS6 type-system breakage#3

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/upgrade-typescript-dependency
Draft

Upgrade project to TypeScript 6.0.3 and resolve TS6 type-system breakage#3
Copilot wants to merge 2 commits into
masterfrom
copilot/upgrade-typescript-dependency

Conversation

Copy link
Copy Markdown

Copilot AI commented May 23, 2026

This updates the repo to the latest stable TypeScript and makes the minimal compatibility changes needed so the project remains buildable and CI-ready under TS6. The upgrade surfaced a recursive type-instantiation failure in schema union handling, which this PR addresses.

  • Dependency and CI alignment

    • Pinned typescript in devDependencies to 6.0.3.
    • Updated GitHub Actions matrix to install/test against 6.0.3 instead of the prior 4.x range.
  • TS6 compiler compatibility

    • Added ignoreDeprecations: "6.0" to tsconfig.json to keep the existing target: "es5" configuration valid under TS6 deprecation enforcement.
  • Type-level recursion fix in schema unions/intersections

    • Reworked AnyOfType / OneOfType / AllOfType evaluation from mapped-index expansion to direct union extraction to avoid TS6 “excessively deep and possibly infinite” instantiation.
// before
T extends AnyOfType<infer U> ? { [K in keyof U]: TSType<U[K]> }[number]

// after
T extends AnyOfType<infer U> ? TSType<U[number]>
Original prompt

Upgrade the repository dependency on TypeScript to the latest available version and make any necessary code, config, or test updates so the project builds and tests pass.

Repository: ptpt/json-schema-ts

Requirements:

  • Update TypeScript-related dependency declarations to the latest stable TypeScript version.
  • Adjust any tsconfig, build scripts, lint config, or test config required for compatibility.
  • Fix any type errors, compilation issues, or test failures introduced by the upgrade.
  • Ensure the repository remains functional and CI-ready after the upgrade.
  • Create a pull request with the changes.

Please inspect the repository to determine the current package manager, dependency locations, test/build commands, and any compatibility constraints before making changes.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: upgrade @ptpt/json-schema-ts to latest typescript

Assistant: What repository should I make that change in? If you mean the package repo itself, please confirm ptpt/json-schema-ts. Also, do you want me to just tell you the latest TypeScript version and the likely changes needed, or actually open a PR?What repository should I make that change in? If you mean the package repo itself, please confirm ptpt/json-schema-ts. Also, do you want me to just tell you the latest TypeScript version and the likely changes needed, or actually open a PR?

User: open a PR

Assistant: I’ve started the PR creation flow for ptpt/json-schema-ts and I’m waiting for the repository task to finish.

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Update TypeScript dependency to latest stable version Upgrade project to TypeScript 6.0.3 and resolve TS6 type-system breakage May 23, 2026
Copilot finished work on behalf of ptpt May 23, 2026 05:59
Copilot AI requested a review from ptpt May 23, 2026 05:59
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.

2 participants