Skip to content

chore(deps): typescript 6 — silence node10 moduleResolution deprecation#4082

Closed
Copilot wants to merge 7 commits intorenovate/typescript-6.xfrom
copilot/fix-tsconfig-module-resolution-error
Closed

chore(deps): typescript 6 — silence node10 moduleResolution deprecation#4082
Copilot wants to merge 7 commits intorenovate/typescript-6.xfrom
copilot/fix-tsconfig-module-resolution-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

  • Add "types": ["node"] + exclude test files to base tsconfig.json for: dispatch, github/checks, github/mutex, github/script/run, hashfiles, jq, retest, torun, appauth
  • Add --skipLibCheck to github/script/run build command
  • Run npm run build + npm test for every package — all 9 pass
Original prompt

Context

Renovate PR #3887 (branch renovate/typescript-6.x) bumps typescript from ^5.4.2 to ^6.0.0 across the JS actions. CI fails with a single, well-understood error from the JavaScript CI workflow:

../utils/tsconfig.json(8,25): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

js/utils is now a proper composite TypeScript package referenced via project references from every consuming JS action (this work landed separately in #4080). Each consumer's pretest/prebuild runs tsc -b ../utils, which fails immediately on js/utils/tsconfig.json because of "moduleResolution": "node" (== node10) — deprecated in TS 6, hard error to silence.

A previous combined attempt (#4074) mixed this fix with _shared composite-module setup and dist/ rebuilds for an unrelated dependabot bump. Both of those concerns are now resolved separately. This PR's scope is strictly the TS 6.0 deprecation fix — nothing else.

Task

Apply the minimum changes needed to make renovate/typescript-6.x (PR #3887) pass CI.

Open the PR against base branch renovate/typescript-6.x (so it stacks onto the renovate branch). Repository: envoyproxy/toolshed.

Changes required

  1. js/utils/tsconfig.json — add "ignoreDeprecations": "6.0" to compilerOptions. Do not change moduleResolution. This unblocks tsc -b ../utils for every consumer.

  2. js/utils/package.json — bump the devDependency "typescript" from "^5.4.2" to "^6.0.0" (renovate didn't touch this file because js/utils post-dates its branch creation). Run npm install in js/utils to refresh package-lock.json if one exists; if not, no lockfile change is needed.

  3. Each of the following tsconfig.test.json files — add "ignoreDeprecations": "6.0" to compilerOptions (each currently sets "moduleResolution": "node" for ts-jest):

    • js/appauth/tsconfig.test.json
    • js/dispatch/tsconfig.test.json
    • js/github/checks/tsconfig.test.json
    • js/github/mutex/tsconfig.test.json
    • js/github/script/run/tsconfig.test.json
    • js/hashfiles/tsconfig.test.json
    • js/jq/tsconfig.test.json
    • js/retest/tsconfig.test.json
    • js/torun/tsconfig.test.json

    Do not modify any other field in these files.

Validation

For each JS package directory, run the equivalent of:

npm ci
npm run pretest   # if defined; otherwise the project's standard build/test entrypoints
npm test

If npm test surfaces ts-jest runtime diagnostics for codes 5011 or 5107 (these are the deprecation diagnostics that ts-jest sometimes emits even when ignoreDeprecations is set, because of its ConfigSet caching), add a minimal globals['ts-jest'].diagnostics.ignoreCodes: [5011, 5107] stanza to that package's jest.config.js — but only for packages where the test run actually fails. Do not add this pre-emptively to packages whose tests pass.

Out of scope — do NOT do any of these

  • Do NOT rebuild dist/ files. Leave all dist/index.js and related bundled output untouched.
  • Do NOT modify any *.ts source files.
  • Do NOT modify any non-test tsconfig.json other than js/utils/tsconfig.json.
  • Do NOT change moduleResolution values, project references, rootDir, or types arrays.
  • Do NOT touch package.json files other than js/utils/package.json.
  • Do NOT add ignoreDeprecations to packages that don't need it.

PR

  • Title: chore(deps): typescript 6 — silence node10 moduleResolution deprecation
  • Target branch: renovate/typescript-6.x
  • Body should briefly explain that this stacks onto Renovate PR chore(deps): update dependency typescript to v6 #3887 and contains only the TS 6.0 deprecation suppression needed for tsc -b ../utils and ts-jest test compilation.

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

User: this pr fails - if you check recent (closed) prs from me and/or copilot - you will see there were some previous attempt/s to get typescript 6 working - but it was getting mashed up with other things

between the failed ci here and the previous attempts (which i think might have been imperfect) can we formulate a plan to update to typescript 6 - just that - other concerns have either been seperately resolved already or will be after

Assistant: ## Where things stand

The single CI failure on #3887 is now very narrow. With js/_sharedjs/utils already landed (#4080), utils is a proper composite TS module with project references wired in from consumers, so most of the scaffolding from the earlier attempt (#4074) is no longer needed.

The only remaining TS 6.0 issue, from the JS workflow log on 606b7a8:

../utils/tsconfig.json(8,25): error TS5107: Option 'moduleResolution=node10' is deprecated
and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this er...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Add "ignoreDeprecations": "6.0" to compilerOptions in:
- js/utils/tsconfig.json (fixes tsc -b ../utils for all consumers)
- js/appauth/tsconfig.test.json
- js/dispatch/tsconfig.test.json
- js/github/checks/tsconfig.test.json
- js/github/mutex/tsconfig.test.json
- js/github/script/run/tsconfig.test.json
- js/hashfiles/tsconfig.test.json
- js/jq/tsconfig.test.json
- js/retest/tsconfig.test.json
- js/torun/tsconfig.test.json

Stacks onto renovate PR #3887 (renovate/typescript-6.x branch).

Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/d2c76c0b-6a07-46ad-bf56-d29e48c4a2e7

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix TypeScript module resolution error in JS actions chore(deps): typescript 6 — silence node10 moduleResolution deprecation May 4, 2026
Copilot finished work on behalf of phlax May 4, 2026 13:30
Copilot AI requested a review from phlax May 4, 2026 13:30
…or TS6

- tsconfig.test.json: add "rootDir": "." to fix TS5011 (TypeScript 6 requires
  explicit rootDir; ts-jest compiles test files individually, making TypeScript
  infer __tests__/ as the common source dir)
- jest.config.js: add diagnostics.ignoreCodes: [5011, 5107] to guard against
  ts-jest ConfigSet bypassing ignoreDeprecations from tsconfig.test.json

Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/b24228c9-3481-47fc-af3b-9ffb5ba4c76d

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
… packages

TypeScript 6 requires rootDir to be explicitly set (TS5011). Without it,
ts-jest infers __tests__/ as the common source dir and fails to load global
types from @types/jest and @types/node, cascading into TS2593/TS2304/TS2591
("Cannot find name 'beforeEach'/'jest'/'process'").

- tsconfig.test.json: add "rootDir": "." for all 8 packages
- jest.config.js: add diagnostics.ignoreCodes: [5011, 5107] for all 8 packages

Affected: dispatch, github/checks, github/mutex, github/script/run,
          hashfiles, jq, retest, torun

Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/e738a6c1-4551-4c2a-a31e-ad9384e7b3e0

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot finished work on behalf of phlax May 4, 2026 14:07
@phlax phlax force-pushed the renovate/typescript-6.x branch from ec6e797 to cb6fa6c Compare May 4, 2026 14:08
… packages

Root cause: two ts-jest transform entries (ts/tsx and js/jsx) share the
same jest config object reference, so the first one to run (js/jsx, for
node_modules) creates the ts-jest config-set using the wrong tsconfig
(falls back to tsconfig.json instead of tsconfig.test.json). All subsequent
transforms reuse this wrong config-set, causing TS2593/TS2304/TS2591 errors.

Fix: merge both transform entries into a single '^.+\\.[tj]sx?$' entry
using tsconfig.test.json, and add allowJs+isolatedModules to tsconfig.test.json
so it can handle both TypeScript and JavaScript files in transpile-only mode.

Also fix github/script/run test command to use tsconfig.test.json.

Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/973198b3-d36b-4f15-81b3-07d15bce622a

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
….json files

TypeScript 6 with moduleResolution:bundler no longer auto-includes @types/node,
causing TS2591/TS2584 errors on process/console/buffer in source files.
The base tsconfig.json also included test files via include:**/*.ts, causing
TS2593/TS2304 errors on jest globals in the build step.

Fix for all packages:
- Add "types":["node"] to base tsconfig.json compilerOptions
- Exclude __tests__/**/*.ts from base tsconfig.json (build should not typecheck tests)
- Add --skipLibCheck to github/script/run build command (consistent with others)

Verified: npm run build + npm test pass for all 9 packages.

Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/155a0e86-5700-4e4a-8939-f1180d542b61

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot finished work on behalf of phlax May 4, 2026 15:24
@renovate renovate Bot deleted the branch renovate/typescript-6.x May 4, 2026 15:29
@renovate renovate Bot closed this May 4, 2026
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