Prepare tooling for repository-wide ESM - #9631
Closed
dibarbet wants to merge 2 commits into
Closed
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fe7d6411-cf1e-4cc8-97a8-8561d9404205 (cherry picked from commit fd7f51c)
This was referenced Aug 4, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d7d912c6-9485-44f0-a1ad-ede156ecd575
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prepares the repo’s tooling for an eventual repository-wide ESM migration by switching task execution from ts-node to tsx, converting build/test configuration entrypoints to explicit .mjs modules, and centralizing Jest project display names for consistent selection across unit/integration test entrypoints.
Changes:
- Replace
ts-nodeusage in npm scripts and VS Code launch configurations withtsx(npx tsx/node --import tsx). - Convert Jest + esbuild configuration entrypoints to
.mjs, and update callers to reference the new module paths. - Add a centralized
test/jestProjectNames.mjs(with.d.mts) and update Jest project configs + test runners to use it.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Enables allowJs and adds explicit files entries to include/emit test/jestProjectNames.mjs for tooling compatibility. |
| package.json | Switches task scripts to npx tsx, updates packaging to use esbuild.mjs, bumps ts-jest, replaces ts-node with tsx. |
| package-lock.json | Reflects dependency updates for ts-jest and new tsx install (and related transitive changes). |
| esbuild.mjs | Migrates esbuild driver script to ESM imports and minor formatting cleanup. |
| eslint.config.mjs | Updates ignore list to match esbuild.mjs rename. |
| .vscodeignore | Updates ignored build script name to esbuild.mjs. |
| .vscode/launch.json | Updates task debugging to run TS directly via node --import tsx instead of ts-node bin. |
| jest.config.mjs | Updates root Jest config to reference per-project jest.config.mjs files. |
| baseJestConfig.ts | Deletes the legacy TS base Jest config. |
| baseJestConfig.mjs | Introduces ESM base Jest config that selects ts-jest ESM preset when appropriate and resolves tsconfig path reliably. |
| test/jestProjectNames.mjs | Adds centralized frozen map of Jest project display names (ESM). |
| test/jestProjectNames.d.mts | Adds type declarations for jestProjectNames for TS consumers. |
| test/runIntegrationTests.ts | Points integration test runner at jest.config.mjs instead of jest.config.ts. |
| test/lsptoolshost/artifactTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/lsptoolshost/unitTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/lsptoolshost/integrationTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/lsptoolshost/integrationTests/index.ts | Updates integration entrypoint to use centralized project name constant. |
| test/omnisharp/omnisharpUnitTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/omnisharp/omnisharpIntegrationTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/omnisharp/omnisharpIntegrationTests/index.ts | Updates integration entrypoint to use centralized project name constant. |
| test/razor/razorTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/razor/razorIntegrationTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/razor/razorIntegrationTests/index.ts | Updates integration entrypoint to use centralized project name constant. |
| test/untrustedWorkspace/integrationTests/jest.config.mjs | Converts project config to ESM and uses centralized jestProjectNames. |
| test/untrustedWorkspace/integrationTests/index.ts | Updates integration entrypoint to use centralized project name constant. |
| test/tasks/jest.config.mjs | Converts tasks unit test project config to ESM and uses centralized jestProjectNames. |
| tasks/tests/testTasks.ts | Switches task test orchestration to use centralized jestProjectNames instead of importing from per-project configs. |
| tasks/tests/testHelpers.ts | Updates unit-test Jest runner to use jest.config.mjs. |
| tasks/tests/omnisharptestTasks.ts | Switches OmniSharp test task to use centralized jestProjectNames. |
Copilot's findings
- Files reviewed: 27/29 changed files
- Comments generated: 4
Comment on lines
6
to
8
| import { runIntegrationTests } from '../../runIntegrationTests'; | ||
| import { jestIntegrationTestProjectName } from './jest.config'; | ||
| import { jestProjectNames } from '../../jestProjectNames.mjs'; | ||
|
|
Comment on lines
6
to
8
| import { runIntegrationTests } from '../../runIntegrationTests'; | ||
| import { jestIntegrationTestProjectName } from './jest.config'; | ||
| import { jestProjectNames } from '../../jestProjectNames.mjs'; | ||
|
|
Comment on lines
6
to
8
| import { runIntegrationTests } from '../../runIntegrationTests'; | ||
| import { jestIntegrationTestProjectName } from './jest.config'; | ||
| import { jestProjectNames } from '../../jestProjectNames.mjs'; | ||
|
|
Comment on lines
6
to
8
| import { runIntegrationTests } from '../../runIntegrationTests'; | ||
| import { jestIntegrationTestProjectName } from './jest.config'; | ||
| import { jestProjectNames } from '../../jestProjectNames.mjs'; | ||
|
|
Member
Author
|
Superseded by #9635, which consolidates the complete native ESM migration into one final-state commit and removes intermediate workaround history. |
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
ts-nodetask runner with the ESM-capabletsxCLI and loader paths.mjsmodules and update all referencesdist/extension.mjsbundle and itscreateRequirecompatibility bridgedev/*branch stack so CI runs againstdev/esm-extension-pilotThis layer intentionally excludes the repository-wide NodeNext source conversion and later audit cleanup.
CI fix design
allowJsin the existingtsc -p tsconfig.jsoncompilation and listtest/jestProjectNames.mjsbefore its colocated declaration so TypeScript emitsout/test/jestProjectNames.mjs.tsinclude globs forsrc,tasks,test,typings, and__mocks__; no other JavaScript or.mjsconfiguration file is a compiler inputtsconfig.jsonpath relative tobaseJestConfig.mjs, so integration launchers work when VS Code changes the process working directoryValidation
npm run compileDevtest/jestProjectNames.mjsis the only JavaScript input andtest/jestProjectNames.d.mtsremains includedout/test/jestProjectNames.mjsexists, exports match the source, and zeroout/**/jest.config.mjsfiles are emittednpm run test:unit; post-fixnpx tsx tasks/tests/testUnit.tsnpm run packageDev../../jestProjectNames.mjsnpx tsx tasks/tests/testIntegrationUntrusted.tsnpx tsx tasks/tests/testIntegrationCsharp.ts.omnisharpgit diff --check39d6e800f5d4b8f280962a9253f9747409a8e21e..fd7f51ce8210568a57590a93cbb9ed832af77517ontobf96ad36dccdcb799bd838345db8c693503ba147