Skip to content

build(deps): make _shared a proper TypeScript composite module; fix TS 6.0 compat across JS actions#4074

Closed
Copilot wants to merge 2 commits intodependabot/npm_and_yarn/js/appauth/dependencies-2474829eb6from
copilot/dependabot-rebuild-dist-files
Closed

build(deps): make _shared a proper TypeScript composite module; fix TS 6.0 compat across JS actions#4074
Copilot wants to merge 2 commits intodependabot/npm_and_yarn/js/appauth/dependencies-2474829eb6from
copilot/dependabot-rebuild-dist-files

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

The dependabot dep bump to TypeScript 6.0 broke all JS action builds because _shared was included in consuming packages by widening rootDir — TS 6.0 makes this a hard error. Additionally, dist/ bundles needed rebuilding against the new deps.

js/_shared → TypeScript composite project

Added js/_shared/tsconfig.json:

{
  "compilerOptions": {
    "composite": true,
    "declaration": true,
    "emitDeclarationOnly": true,
    "lib": ["ES2022", "DOM"],
    ...
  }
}
  • emitDeclarationOnly — emits only .d.ts declarations (no .js), so jest doesn't accidentally resolve the compiled output instead of the source
  • Committed generated js/_shared/retry/index.d.ts

Consuming packages use project references

appauth/tsconfig.json and checks/tsconfig.json now declare:

"references": [{ "path": "../../_shared" }]

TypeScript resolves import from '../../_shared/retry' via the declaration file — no rootDir violation, no source leakage into the compilation.

TypeScript 6.0 compatibility fixes

  • All tsconfig.test.json files: added "ignoreDeprecations": "6.0" to suppress the moduleResolution=node deprecation warning ts-jest forces at runtime
  • mutex/tsconfig.json: added "jest" to types (was ["node"] only), consistent with all other packages

ts-jest ConfigSet caching bug workaround (appauth, mutex)

ts-jest 29 has a bug where the .js transform's ConfigSet (keyed on the shared jest config object reference) is created first and reused for all transforms, ignoring the .ts transform's tsconfig path. Fixed in jest.config.js for both packages by adding a globals['ts-jest'] stanza that is always read before any transform-level override:

globals: {
  'ts-jest': {
    tsconfig: 'tsconfig.test.json',
    diagnostics: { ignoreCodes: [5011, 5107] },
  },
},

Rebuilt dist/ bundles

Rebuilt dist for: dispatch, github/checks, hashfiles, retest.

Original prompt

Dependabot PR #4072 (#4072) bumps JS dependencies across 9 directories under js/ (appauth, dispatch, github/checks, github/mutex, github/script/run, hashfiles, jq, retest, torun) but the committed dist/ bundles for each action have not been rebuilt to reflect the new dependencies, which causes CI to fail.

Task

Rebuild and commit the dist/ files for every JS action affected by PR #4072 so that CI passes.

Steps

  1. Check out the PR branch dependabot/npm_and_yarn/js/appauth/dependencies-2474829eb6 (this is the base branch for your PR — open your PR against that branch so it stacks on top of build(deps): bump the dependencies group across 9 directories with 11 updates #4072).

  2. For each of the following directories:

    • js/appauth
    • js/dispatch
    • js/github/checks
    • js/github/mutex
    • js/github/script/run
    • js/hashfiles
    • js/jq
    • js/retest
    • js/torun

    Run the appropriate install + build commands (likely npm ci then npm run build or npm run package/ncc build — inspect each package.json scripts block to determine the correct command). Use the same Node version the repo's CI uses (check .github/workflows/ and any .nvmrc/engines field).

  3. Commit the resulting changes to each dist/ directory. Do NOT modify package.json or package-lock.json — only the rebuilt dist/ artifacts should change.

  4. Verify by running the action's local tests where available (npm test) so we know the rebuilt bundle works with the upgraded deps, particularly given the TypeScript 5.9 → 6.0 major bump.

  5. If TypeScript 6.0 introduces compile errors that block the build, fix them minimally in source (TS files) so the build succeeds — but prefer not to touch source unless necessary.

Notes

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

User: this pr fails because it needs the dist files to be rebuilt - can you pr to resolve

Assistant: I'm waiting for your confirmation on the dialog to dispatch the coding agent to rebuild the dist/ files for PR #4072.

This pull request was created from Copilot chat.

…references

- Add js/_shared/tsconfig.json as composite project (emitDeclarationOnly)
- Generate js/_shared/retry/index.d.ts type declarations
- Add project references to consuming packages (appauth, checks)
- Fix TypeScript 6.0 compatibility: ignoreDeprecations, types, rootDir
- Fix ts-jest caching bug in appauth/mutex via globals config
- Rebuild dist for dispatch, checks, hashfiles, retest

Agent-Logs-Url: https://github.com/envoyproxy/toolshed/sessions/349649d7-a46f-49a8-b9a4-2ebc6c7dbbf7

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot AI changed the title [WIP] Rebuild and commit dist files for JS actions build(deps): make _shared a proper TypeScript composite module; fix TS 6.0 compat across JS actions May 4, 2026
Copilot AI requested a review from phlax May 4, 2026 11:12
Copilot finished work on behalf of phlax May 4, 2026 11:12
@dependabot dependabot Bot deleted the branch dependabot/npm_and_yarn/js/appauth/dependencies-2474829eb6 May 4, 2026 12:23
@dependabot dependabot 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