Skip to content

Convert TypeScript sources to NodeNext ESM - #9632

Closed
dibarbet wants to merge 2 commits into
dev/esm-tooling-foundationfrom
dev/esm-nodenext-conversion
Closed

Convert TypeScript sources to NodeNext ESM#9632
dibarbet wants to merge 2 commits into
dev/esm-tooling-foundationfrom
dev/esm-nodenext-conversion

Conversation

@dibarbet

@dibarbet dibarbet commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

Replacement for #9617, rebuilt on the dev/esm-tooling-foundation replacement layer (#9631) so the dev-branch stack receives the intended CI coverage.

  • set the package to ESM and upgrade TypeScript to 5.7.3
  • compile the main repository with NodeNext/NodeNext, allowJs, and rewriteRelativeImportExtensions, using normal tsc emit
  • inherit Jest project-name support-file emission from Prepare tooling for repository-wide ESM #9631: tsc emits test/jestProjectNames.mjs directly, with no separate copy task
  • use explicit .ts relative source specifiers (1,448 after deleting the copy task and its sole .ts import) plus six intentional .mjs imports, which emit as runtime .js/.mjs imports
  • keep the ESM bundle's createRequire interop while removing the temporary __dirname/__filename shim and retaining targeted CommonJS compatibility fixes
  • keep integration Jest transformation isolated without a Preserve/Bundler split build configuration

Validation

  • targeted ESLint --fix plus npm run compileDev
  • compiler-owned out/test/jestProjectNames.mjs exists and exports values semantically identical to the source; zero out/**/jest.config.mjs
  • emitted JavaScript audit: zero relative .ts imports; all four integration runners import runIntegrationTests.js and jestProjectNames.mjs
  • raw Node import of all four emitted integration runners
  • npm run packageDev and node --check dist/extension.mjs
  • npm run test:unit (514 passed)
  • npm run omnisharptest:unit (401 passed)
  • npm run test:integration:untrusted (1 passed)
  • npm run test:integration:csharp (73 passed, 3 skipped)
  • git diff --check

dibarbet and others added 2 commits August 4, 2026 15:39
Replayed-from: fc515fe
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 322f42db-e5cd-45bc-bd65-a4e6ff8652ab
Applies the final net state from fc515fe through 47f8595; the temporary Preserve/Bundler configuration is intentionally not replayed.

Replayed-from: 47f8595
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 322f42db-e5cd-45bc-bd65-a4e6ff8652ab
Copilot AI review requested due to automatic review settings August 4, 2026 22:56
@dibarbet
dibarbet force-pushed the dev/esm-nodenext-conversion branch from 26b5aed to c6cd3b8 Compare August 4, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@dibarbet

dibarbet commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Superseded by #9635, which consolidates the complete native ESM migration into one final-state commit and removes intermediate workaround history.

@dibarbet dibarbet closed this Aug 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