Skip to content

Update Node.js core modules #62201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12026,7 +12026,7 @@ export function isSideEffectImport(node: Node): boolean {
return !!ancestor && !ancestor.importClause;
}

// require('module').builtinModules.filter(x => !x.startsWith('_'))
// require('module').builtinModules.filter(x => !x.match(/^(?:_|node:)/))
const unprefixedNodeCoreModulesList = [
"assert",
"assert/strict",
Expand Down Expand Up @@ -12069,7 +12069,6 @@ const unprefixedNodeCoreModulesList = [
"stream/web",
"string_decoder",
"sys",
"test/mock_loader",
"timers",
"timers/promises",
"tls",
Expand All @@ -12088,11 +12087,10 @@ const unprefixedNodeCoreModulesList = [
/** @internal */
export const unprefixedNodeCoreModules: Set<string> = new Set(unprefixedNodeCoreModulesList);

// await fetch('https://nodejs.org/docs/latest/api/all.json').then(r => r.text()).then(t =>
// new Set(t.match(/(?<=')node:.+?(?=')/g))
// .difference(new Set(require('module').builtinModules.map(x => `node:${x}`))))
// require('module').builtinModules.filter(x => x.startsWith('node:'))
/** @internal */
export const exclusivelyPrefixedNodeCoreModules: Set<string> = new Set([
"node:quic",
"node:sea",
"node:sqlite",
"node:test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1330,38 +1330,6 @@ TI:: [hh:mm:ss:mss] Finished typings discovery:
]
}

ts.JsTyping.discoverTypings::
Copy link
Member

Choose a reason for hiding this comment

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

This entire log was removed; is the test testing something that was removed and needs to be updated?

Copy link
Contributor Author

@Renegade334 Renegade334 Aug 5, 2025

Choose a reason for hiding this comment

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

It's due to a removed "unqualified" module from the list (test/mock_loader), which was an internal module that was previously populated onto the public list, so there's one less resolution.

{
"fileNames": [
"/home/src/projects/project/app.js"
],
"projectRootPath": "/home/src/projects/project",
"safeList": {},
"packageNameToTypingLocation": {},
"typeAcquisition": {
"enable": true
},
"unresolvedImports": [
"test/mock_loader",
"somename"
],
"typesRegistry": {},
"compilerOptions": {}
}
TI:: [hh:mm:ss:mss] Inferred typings from unresolved imports: ["node","somename"]
TI:: [hh:mm:ss:mss] Finished typings discovery:
{
"cachedTypingPaths": [],
"newTypingNames": [
"node",
"somename"
],
"filesToWatch": [
"/home/src/projects/project/bower_components",
"/home/src/projects/project/node_modules"
]
}

ts.JsTyping.discoverTypings::
{
"fileNames": [
Expand Down Expand Up @@ -3102,7 +3070,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:test/mock_loader",
"node:timers",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3134,7 +3102,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:timers",
"node:timers/promises",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3166,7 +3134,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:timers/promises",
"node:tls",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3198,7 +3166,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:tls",
"node:trace_events",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3230,7 +3198,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:trace_events",
"node:tty",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3262,7 +3230,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:tty",
"node:url",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3294,7 +3262,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:url",
"node:util",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3326,7 +3294,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:util",
"node:util/types",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3358,7 +3326,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:util/types",
"node:v8",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3390,7 +3358,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:v8",
"node:vm",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3422,7 +3390,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:vm",
"node:wasi",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3454,7 +3422,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:wasi",
"node:worker_threads",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3486,7 +3454,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:worker_threads",
"node:zlib",
"somename"
],
"typesRegistry": {},
Expand Down Expand Up @@ -3518,7 +3486,7 @@ ts.JsTyping.discoverTypings::
"enable": true
},
"unresolvedImports": [
"node:zlib",
"node:quic",
Copy link
Member

Choose a reason for hiding this comment

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

I was very confused why everything in this list got changed until I realized it's because one module was removed and one was added, so the diff makes it look like the code shifted

"somename"
],
"typesRegistry": {},
Expand Down
Loading