Skip to content

module: expose configureTypeScript()#64556

Open
Rishikmanche wants to merge 1 commit into
nodejs:mainfrom
Rishikmanche:fix/issue-64518-configure-typescript
Open

module: expose configureTypeScript()#64556
Rishikmanche wants to merge 1 commit into
nodejs:mainfrom
Rishikmanche:fix/issue-64518-configure-typescript

Conversation

@Rishikmanche

Copy link
Copy Markdown

This PR resolves issue #64518 by exposing the full Amaro loader API via node:module.

Specifically:

  • Exposes module.configureTypeScript() through node:module
  • Restores mode: 'transform' in module.stripTypeScriptTypes()
  • Updates the compile cache to support kTransformedTypeScript and kTransformedTypeScriptWithSourceMaps
  • Bypasses isUnderNodeModules check when nodeModules is enabled in configuration
  • Dynamically registers the TypeScript formats in ESM extensionFormatMap

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/startup
  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Jul 17, 2026
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.51852% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.25%. Comparing base (a27fe21) to head (8662c0d).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/typescript.js 95.06% 4 Missing ⚠️
src/compile_cache.cc 33.33% 1 Missing and 1 partial ⚠️
lib/internal/process/execution.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64556   +/-   ##
=======================================
  Coverage   90.24%   90.25%           
=======================================
  Files         739      739           
  Lines      241698   241774   +76     
  Branches    45556    45558    +2     
=======================================
+ Hits       218129   218210   +81     
- Misses      15103    15106    +3     
+ Partials     8466     8458    -8     
Files with missing lines Coverage Δ
lib/internal/bootstrap/node.js 98.76% <100.00%> (+0.19%) ⬆️
lib/internal/main/eval_stdin.js 82.75% <100.00%> (+0.30%) ⬆️
lib/internal/main/eval_string.js 79.74% <100.00%> (+0.25%) ⬆️
lib/internal/main/worker_thread.js 94.37% <100.00%> (+0.01%) ⬆️
lib/internal/modules/cjs/loader.js 98.14% <100.00%> (ø)
lib/internal/modules/esm/get_format.js 95.23% <100.00%> (+0.03%) ⬆️
lib/internal/modules/run_main.js 97.66% <100.00%> (+0.01%) ⬆️
lib/internal/test_runner/utils.js 66.30% <100.00%> (+0.04%) ⬆️
lib/module.js 100.00% <100.00%> (ø)
src/compile_cache.h 100.00% <ø> (ø)
... and 3 more

... and 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Rishikmanche <rishikmanche@gmail.com>
@Rishikmanche
Rishikmanche force-pushed the fix/issue-64518-configure-typescript branch from 8662c0d to 9f90dfe Compare July 18, 2026 18:08
@GeoffreyBooth

Copy link
Copy Markdown
Member

I'm not sure this is a good idea. I think it would make it harder to release breaking changes in Amaro, and it would complicate configuring Node itself because now there's a runtime way to configure this subsystem in addition to the CLI flags and config file.

@Rishikmanche

Copy link
Copy Markdown
Author

I'm not sure this is a good idea. I think it would make it harder to release breaking changes in Amaro, and it would complicate configuring Node itself because now there's a runtime way to configure this subsystem in addition to the CLI flags and config file.

What's your preferred approach for users who need to customize TypeScript behavior programmatically? Is there a pattern you'd recommend instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants