chore(deps): typescript 6 — silence node10 moduleResolution deprecation#4082
Closed
Copilot wants to merge 7 commits intorenovate/typescript-6.xfrom
Closed
chore(deps): typescript 6 — silence node10 moduleResolution deprecation#4082Copilot wants to merge 7 commits intorenovate/typescript-6.xfrom
Copilot wants to merge 7 commits intorenovate/typescript-6.xfrom
Conversation
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
…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>
ec6e797 to
cb6fa6c
Compare
… 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>
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.
"types": ["node"]+ exclude test files to basetsconfig.jsonfor: dispatch, github/checks, github/mutex, github/script/run, hashfiles, jq, retest, torun, appauth--skipLibChecktogithub/script/runbuild commandnpm run build+npm testfor every package — all 9 passOriginal prompt
Context
Renovate PR #3887 (branch
renovate/typescript-6.x) bumpstypescriptfrom^5.4.2to^6.0.0across the JS actions. CI fails with a single, well-understood error from theJavaScript CIworkflow:js/utilsis now a proper composite TypeScript package referenced via project references from every consuming JS action (this work landed separately in #4080). Each consumer'spretest/prebuildrunstsc -b ../utils, which fails immediately onjs/utils/tsconfig.jsonbecause of"moduleResolution": "node"(==node10) — deprecated in TS 6, hard error to silence.A previous combined attempt (#4074) mixed this fix with
_sharedcomposite-module setup anddist/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
js/utils/tsconfig.json— add"ignoreDeprecations": "6.0"tocompilerOptions. Do not changemoduleResolution. This unblockstsc -b ../utilsfor every consumer.js/utils/package.json— bump the devDependency"typescript"from"^5.4.2"to"^6.0.0"(renovate didn't touch this file becausejs/utilspost-dates its branch creation). Runnpm installinjs/utilsto refreshpackage-lock.jsonif one exists; if not, no lockfile change is needed.Each of the following
tsconfig.test.jsonfiles — add"ignoreDeprecations": "6.0"tocompilerOptions(each currently sets"moduleResolution": "node"for ts-jest):js/appauth/tsconfig.test.jsonjs/dispatch/tsconfig.test.jsonjs/github/checks/tsconfig.test.jsonjs/github/mutex/tsconfig.test.jsonjs/github/script/run/tsconfig.test.jsonjs/hashfiles/tsconfig.test.jsonjs/jq/tsconfig.test.jsonjs/retest/tsconfig.test.jsonjs/torun/tsconfig.test.jsonDo not modify any other field in these files.
Validation
For each JS package directory, run the equivalent of:
If
npm testsurfaces ts-jest runtime diagnostics for codes 5011 or 5107 (these are the deprecation diagnostics that ts-jest sometimes emits even whenignoreDeprecationsis set, because of itsConfigSetcaching), add a minimalglobals['ts-jest'].diagnostics.ignoreCodes: [5011, 5107]stanza to that package'sjest.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
dist/files. Leave alldist/index.jsand related bundled output untouched.*.tssource files.tsconfig.jsonother thanjs/utils/tsconfig.json.moduleResolutionvalues, project references,rootDir, ortypesarrays.package.jsonfiles other thanjs/utils/package.json.ignoreDeprecationsto packages that don't need it.PR
chore(deps): typescript 6 — silence node10 moduleResolution deprecationrenovate/typescript-6.xtsc -b ../utilsand 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/_shared→js/utilsalready landed (#4080),utilsis 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: