Prepare tooling for repository-wide ESM - #9615
Closed
dibarbet wants to merge 1 commit into
Closed
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fe7d6411-cf1e-4cc8-97a8-8561d9404205
dibarbet
force-pushed
the
dibarbet-esm-tooling-foundation
branch
from
August 4, 2026 00:42
97cc912 to
fd7f51c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prepares the vscode-csharp repository’s tooling for a future switch to repository-wide ESM by replacing the ts-node task runner with tsx, migrating build/test configs to explicit .mjs modules, and centralizing Jest project naming.
Changes:
- Replace
ts-nodeusage in npm scripts and VS Code launch configs withtsx(CLI +--import tsxloader). - Convert esbuild + Jest configuration files to
.mjs, update references, and introduce an ESM-awarets-jestpreset selection mechanism. - Centralize Jest project
displayNamestrings via a sharedjestProjectNamesmodule and update callers.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Stops excluding removed/renamed Jest config files from compilation. |
| test/untrustedWorkspace/integrationTests/jest.config.mjs | Migrates project Jest config to ESM + shared base config/project names. |
| test/untrustedWorkspace/integrationTests/index.ts | Uses centralized Jest project name for selecting the Jest project. |
| test/tasks/jest.config.mjs | Migrates tasks Jest config to ESM + shared base config/project names. |
| test/runIntegrationTests.ts | Points integration test runner to jest.config.mjs at repo root. |
| test/razor/razorTests/jest.config.mjs | Migrates Razor unit Jest config to ESM + centralized project names. |
| test/razor/razorIntegrationTests/jest.config.mjs | Migrates Razor integration Jest config to ESM + centralized project names. |
| test/razor/razorIntegrationTests/index.ts | Uses centralized Jest project name for selecting the Jest project. |
| test/omnisharp/omnisharpUnitTests/jest.config.mjs | Migrates OmniSharp unit Jest config to ESM + centralized project names. |
| test/omnisharp/omnisharpIntegrationTests/jest.config.mjs | Migrates OmniSharp integration Jest config to ESM + centralized project names. |
| test/omnisharp/omnisharpIntegrationTests/index.ts | Uses centralized Jest project name for selecting the Jest project. |
| test/lsptoolshost/unitTests/jest.config.mjs | Migrates LSP Tools Host unit Jest config to ESM + centralized project names. |
| test/lsptoolshost/integrationTests/jest.config.mjs | Migrates LSP Tools Host integration Jest config to ESM + centralized project names. |
| test/lsptoolshost/integrationTests/index.ts | Uses centralized Jest project name for selecting the Jest project. |
| test/lsptoolshost/artifactTests/jest.config.mjs | Migrates artifact Jest config to ESM + centralized project names. |
| test/jestProjectNames.mjs | Introduces centralized Jest project display names (ESM module). |
| test/jestProjectNames.d.mts | Adds types for the centralized Jest project names module. |
| tasks/tests/testTasks.ts | Updates task test orchestration to use centralized Jest project names. |
| tasks/tests/testHelpers.ts | Updates Jest runner to use jest.config.mjs. |
| tasks/tests/omnisharptestTasks.ts | Updates OmniSharp test tasks to use centralized Jest project names. |
| package.json | Switches task runner scripts to tsx; renames esbuild.js → esbuild.mjs; bumps ts-jest; adds tsx. |
| package-lock.json | Reflects dependency changes from ts-node to tsx and ts-jest update. |
| jest.config.mjs | Updates root Jest config to reference .mjs project configs. |
| eslint.config.mjs | Updates ignored build file name from esbuild.js to esbuild.mjs. |
| esbuild.mjs | Converts the build script to ESM imports and updates formatting. |
| baseJestConfig.ts | Removes the old TypeScript base Jest config. |
| baseJestConfig.mjs | Adds new ESM base Jest config with conditional ESM/CJS ts-jest preset selection. |
| .vscodeignore | Updates ignored build script name to esbuild.mjs. |
| .vscode/launch.json | Updates task/debug launch configs to run TS scripts via node --import tsx. |
Copilot's findings
- Files reviewed: 27/29 changed files
- Comments generated: 6
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'; | ||
|
|
Comment on lines
6
to
9
| import path from 'path'; | ||
| import { integrationTestProjects, runDevKitIntegrationTests, runIntegrationTest, runJestTest } from './testHelpers'; | ||
| import { jestArtifactTestsProjectName } from '../../test/lsptoolshost/artifactTests/jest.config'; | ||
| import { jestUnitTestProjectName } from '../../test/lsptoolshost/unitTests/jest.config'; | ||
| import { razorTestProjectName } from '../../test/razor/razorTests/jest.config'; | ||
| import { jestTasksTestProjectName } from '../../test/tasks/jest.config'; | ||
| import { jestProjectNames } from '../../test/jestProjectNames.mjs'; | ||
|
|
Comment on lines
6
to
10
| import path from 'path'; | ||
| import { codeExtensionPath, rootPath } from '../projectPaths'; | ||
| import { runJestIntegrationTest, runJestTest } from './testHelpers'; | ||
| import { jestOmniSharpUnitTestProjectName } from '../../test/omnisharp/omnisharpUnitTests/jest.config'; | ||
| import { jestProjectNames } from '../../test/jestProjectNames.mjs'; | ||
|
|
Member
Author
|
Superseded by #9631 on |
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 bridgeValidation
npm run compileDevnpm run test:unitnpm run packageDevnode --import tsx tasks/tests/testUnit.tsJEST_USE_ESM=true