summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-09-12 01:52:08 +0100
committerGitHub <noreply@github.com>2024-09-12 00:52:08 +0000
commitf794781ffba941085343b95dd5a9c1ad74a322a2 (patch)
tree395ad9feae6a3bf4078d0f03053eed8ce85b3396
parent8476bbff9af28408bc6a9b0a7b2303cb3803422e (diff)
feat(ext/node): expose ES modules for _ modules (#25588)
Exposes following modules: - `"node:_http_agent"` - `"node:_http_common"` - `"node:_http_outgoing"` - `"node:_http_server"` - `"node:_stream_duplex"` - `"node:_stream_passthrough"` - `"node:_stream_readable"` - `"node:_stream_transform"` - `"node:_stream_writable"` - `"node:_tls_common"` - `"node:_tls_wrap"`
-rw-r--r--ext/node/lib.rs21
-rw-r--r--ext/node/polyfills/01_require.js22
-rw-r--r--ext/node/polyfills/_http_common.ts61
-rw-r--r--ext/node/polyfills/_http_outgoing.ts6
-rw-r--r--ext/node/polyfills/_http_server.ts136
-rw-r--r--ext/node/polyfills/_tls_wrap.ts2
-rw-r--r--ext/node/polyfills/http.ts180
-rw-r--r--ext/node/polyfills/http2.ts2
-rw-r--r--ext/node/polyfills/https.ts2
-rw-r--r--ext/node/polyfills/internal/crypto/sig.ts2
-rw-r--r--ext/node/polyfills/tls.ts4
-rw-r--r--tools/core_import_map.json19
12 files changed, 249 insertions, 208 deletions
diff --git a/ext/node/lib.rs b/ext/node/lib.rs
index a589a99be..9cc5e445b 100644
--- a/ext/node/lib.rs
+++ b/ext/node/lib.rs
@@ -442,17 +442,12 @@ deno_core::extension!(deno_node,
"_fs/_fs_write.mjs",
"_fs/_fs_writeFile.ts",
"_fs/_fs_writev.mjs",
- "_http_agent.mjs",
- "_http_common.ts",
- "_http_outgoing.ts",
"_next_tick.ts",
"_process/exiting.ts",
"_process/process.ts",
"_process/streams.mjs",
"_readline.mjs",
"_stream.mjs",
- "_tls_common.ts",
- "_tls_wrap.ts",
"_util/_util_callbackify.js",
"_util/asserts.ts",
"_util/async.ts",
@@ -547,15 +542,10 @@ deno_core::extension!(deno_node,
"internal/streams/add-abort-signal.mjs",
"internal/streams/buffer_list.mjs",
"internal/streams/destroy.mjs",
- "internal/streams/duplex.mjs",
"internal/streams/end-of-stream.mjs",
"internal/streams/lazy_transform.mjs",
- "internal/streams/passthrough.mjs",
- "internal/streams/readable.mjs",
"internal/streams/state.mjs",
- "internal/streams/transform.mjs",
"internal/streams/utils.mjs",
- "internal/streams/writable.mjs",
"internal/test/binding.ts",
"internal/timers.mjs",
"internal/url.ts",
@@ -576,6 +566,17 @@ deno_core::extension!(deno_node,
"path/mod.ts",
"path/separator.ts",
"readline/promises.ts",
+ "node:_http_agent" = "_http_agent.mjs",
+ "node:_http_common" = "_http_common.ts",
+ "node:_http_outgoing" = "_http_outgoing.ts",
+ "node:_http_server" = "_http_server.ts",
+ "node:_stream_duplex" = "internal/streams/duplex.mjs",
+ "node:_stream_passthrough" = "internal/streams/passthrough.mjs",
+ "node:_stream_readable" = "internal/streams/readable.mjs",
+ "node:_stream_transform" = "internal/streams/transform.mjs",
+ "node:_stream_writable" = "internal/streams/writable.mjs",
+ "node:_tls_common" = "_tls_common.ts",
+ "node:_tls_wrap" = "_tls_wrap.ts",
"node:assert" = "assert.ts",
"node:assert/strict" = "assert/strict.ts",
"node:async_hooks" = "async_hooks.ts",
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js
index b84765d31..d9ecce690 100644
--- a/ext/node/polyfills/01_require.js
+++ b/ext/node/polyfills/01_require.js
@@ -67,13 +67,17 @@ const {
import { nodeGlobals } from "ext:deno_node/00_globals.js";
-import _httpAgent from "ext:deno_node/_http_agent.mjs";
-import _httpOutgoing from "ext:deno_node/_http_outgoing.ts";
-import _streamDuplex from "ext:deno_node/internal/streams/duplex.mjs";
-import _streamPassthrough from "ext:deno_node/internal/streams/passthrough.mjs";
-import _streamReadable from "ext:deno_node/internal/streams/readable.mjs";
-import _streamTransform from "ext:deno_node/internal/streams/transform.mjs";
-import _streamWritable from "ext:deno_node/internal/streams/writable.mjs";
+import _httpAgent from "node:_http_agent";
+import _httpCommon from "node:_http_common";
+import _httpOutgoing from "node:_http_outgoing";
+import _httpServer from "node:_http_server";
+import _streamDuplex from "node:_stream_duplex";
+import _streamPassthrough from "node:_stream_passthrough";
+import _streamReadable from "node:_stream_readable";
+import _streamTransform from "node:_stream_transform";
+import _streamWritable from "node:_stream_writable";
+import _tlsCommon from "node:_tls_common";
+import _tlsWrap from "node:_tls_wrap";
import assert from "node:assert";
import assertStrict from "node:assert/strict";
import asyncHooks from "node:async_hooks";
@@ -163,12 +167,16 @@ const builtinModules = [];
function setupBuiltinModules() {
const nodeModules = {
"_http_agent": _httpAgent,
+ "_http_common": _httpCommon,
"_http_outgoing": _httpOutgoing,
+ "_http_server": _httpServer,
"_stream_duplex": _streamDuplex,
"_stream_passthrough": _streamPassthrough,
"_stream_readable": _streamReadable,
"_stream_transform": _streamTransform,
"_stream_writable": _streamWritable,
+ "_tls_common": _tlsCommon,
+ "_tls_wrap": _tlsWrap,
assert,
"assert/strict": assertStrict,
"async_hooks": asyncHooks,
diff --git a/ext/node/polyfills/_http_common.ts b/ext/node/polyfills/_http_common.ts
index 24dae6f30..8fb7758a5 100644
--- a/ext/node/polyfills/_http_common.ts
+++ b/ext/node/polyfills/_http_common.ts
@@ -2,8 +2,53 @@
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
import { primordials } from "ext:core/mod.js";
-const { RegExpPrototypeTest, SafeRegExp } = primordials;
+const {
+ RegExpPrototypeTest,
+ SafeRegExp,
+ Symbol,
+} = primordials;
+
+export const CRLF = "\r\n";
+export const kIncomingMessage = Symbol("IncomingMessage");
const tokenRegExp = new SafeRegExp(/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/);
+
+export const methods = [
+ "ACL",
+ "BIND",
+ "CHECKOUT",
+ "CONNECT",
+ "COPY",
+ "DELETE",
+ "GET",
+ "HEAD",
+ "LINK",
+ "LOCK",
+ "M-SEARCH",
+ "MERGE",
+ "MKACTIVITY",
+ "MKCALENDAR",
+ "MKCOL",
+ "MOVE",
+ "NOTIFY",
+ "OPTIONS",
+ "PATCH",
+ "POST",
+ "PROPFIND",
+ "PROPPATCH",
+ "PURGE",
+ "PUT",
+ "REBIND",
+ "REPORT",
+ "SEARCH",
+ "SOURCE",
+ "SUBSCRIBE",
+ "TRACE",
+ "UNBIND",
+ "UNLINK",
+ "UNLOCK",
+ "UNSUBSCRIBE",
+];
+
/**
* Verifies that the given val is a valid HTTP token
* per the rules defined in RFC 7230
@@ -25,7 +70,21 @@ function checkInvalidHeaderChar(val: string) {
}
export const chunkExpression = new SafeRegExp(/(?:^|\W)chunked(?:$|\W)/i);
+export const continueExpression = new SafeRegExp(
+ /(?:^|\W)100-continue(?:$|\W)/i,
+);
+
export {
checkInvalidHeaderChar as _checkInvalidHeaderChar,
checkIsHttpToken as _checkIsHttpToken,
};
+
+export default {
+ _checkInvalidHeaderChar: checkInvalidHeaderChar,
+ _checkIsHttpToken: checkIsHttpToken,
+ chunkExpression,
+ CRLF,
+ continueExpression,
+ kIncomingMessage,
+ methods,
+};
diff --git a/ext/node/polyfills/_http_outgoing.ts b/ext/node/polyfills/_http_outgoing.ts
index 3c253f5a6..4da6b73e8 100644
--- a/ext/node/polyfills/_http_outgoing.ts
+++ b/ext/node/polyfills/_http_outgoing.ts
@@ -21,7 +21,7 @@ import {
_checkInvalidHeaderChar as checkInvalidHeaderChar,
_checkIsHttpToken as checkIsHttpToken,
chunkExpression as RE_TE_CHUNKED,
-} from "ext:deno_node/_http_common.ts";
+} from "node:_http_common";
import {
defaultTriggerAsyncIdScope,
symbols,
@@ -54,6 +54,8 @@ let debug = debuglog("http", (fn) => {
const HIGH_WATER_MARK = getDefaultHighWaterMark();
+export const kUniqueHeaders = Symbol("kUniqueHeaders");
+export const kHighWaterMark = Symbol("kHighWaterMark");
const kCorked = Symbol("corked");
const nop = () => {};
@@ -891,6 +893,8 @@ function _onFinish(outmsg: any) {
}
export default {
+ kUniqueHeaders,
+ kHighWaterMark,
validateHeaderName,
validateHeaderValue,
parseUniqueHeadersOption,
diff --git a/ext/node/polyfills/_http_server.ts b/ext/node/polyfills/_http_server.ts
new file mode 100644
index 000000000..c2867de0c
--- /dev/null
+++ b/ext/node/polyfills/_http_server.ts
@@ -0,0 +1,136 @@
+// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+export enum STATUS_CODES {
+ /** RFC 7231, 6.2.1 */
+ Continue = 100,
+ /** RFC 7231, 6.2.2 */
+ SwitchingProtocols = 101,
+ /** RFC 2518, 10.1 */
+ Processing = 102,
+ /** RFC 8297 **/
+ EarlyHints = 103,
+
+ /** RFC 7231, 6.3.1 */
+ OK = 200,
+ /** RFC 7231, 6.3.2 */
+ Created = 201,
+ /** RFC 7231, 6.3.3 */
+ Accepted = 202,
+ /** RFC 7231, 6.3.4 */
+ NonAuthoritativeInfo = 203,
+ /** RFC 7231, 6.3.5 */
+ NoContent = 204,
+ /** RFC 7231, 6.3.6 */
+ ResetContent = 205,
+ /** RFC 7233, 4.1 */
+ PartialContent = 206,
+ /** RFC 4918, 11.1 */
+ MultiStatus = 207,
+ /** RFC 5842, 7.1 */
+ AlreadyReported = 208,
+ /** RFC 3229, 10.4.1 */
+ IMUsed = 226,
+
+ /** RFC 7231, 6.4.1 */
+ MultipleChoices = 300,
+ /** RFC 7231, 6.4.2 */
+ MovedPermanently = 301,
+ /** RFC 7231, 6.4.3 */
+ Found = 302,
+ /** RFC 7231, 6.4.4 */
+ SeeOther = 303,
+ /** RFC 7232, 4.1 */
+ NotModified = 304,
+ /** RFC 7231, 6.4.5 */
+ UseProxy = 305,
+ /** RFC 7231, 6.4.7 */
+ TemporaryRedirect = 307,
+ /** RFC 7538, 3 */
+ PermanentRedirect = 308,
+
+ /** RFC 7231, 6.5.1 */
+ BadRequest = 400,
+ /** RFC 7235, 3.1 */
+ Unauthorized = 401,
+ /** RFC 7231, 6.5.2 */
+ PaymentRequired = 402,
+ /** RFC 7231, 6.5.3 */
+ Forbidden = 403,
+ /** RFC 7231, 6.5.4 */
+ NotFound = 404,
+ /** RFC 7231, 6.5.5 */
+ MethodNotAllowed = 405,
+ /** RFC 7231, 6.5.6 */
+ NotAcceptable = 406,
+ /** RFC 7235, 3.2 */
+ ProxyAuthRequired = 407,
+ /** RFC 7231, 6.5.7 */
+ RequestTimeout = 408,
+ /** RFC 7231, 6.5.8 */
+ Conflict = 409,
+ /** RFC 7231, 6.5.9 */
+ Gone = 410,
+ /** RFC 7231, 6.5.10 */
+ LengthRequired = 411,
+ /** RFC 7232, 4.2 */
+ PreconditionFailed = 412,
+ /** RFC 7231, 6.5.11 */
+ RequestEntityTooLarge = 413,
+ /** RFC 7231, 6.5.12 */
+ RequestURITooLong = 414,
+ /** RFC 7231, 6.5.13 */
+ UnsupportedMediaType = 415,
+ /** RFC 7233, 4.4 */
+ RequestedRangeNotSatisfiable = 416,
+ /** RFC 7231, 6.5.14 */
+ ExpectationFailed = 417,
+ /** RFC 7168, 2.3.3 */
+ Teapot = 418,
+ /** RFC 7540, 9.1.2 */
+ MisdirectedRequest = 421,
+ /** RFC 4918, 11.2 */
+ UnprocessableEntity = 422,
+ /** RFC 4918, 11.3 */
+ Locked = 423,
+ /** RFC 4918, 11.4 */
+ FailedDependency = 424,
+ /** RFC 8470, 5.2 */
+ TooEarly = 425,
+ /** RFC 7231, 6.5.15 */
+ UpgradeRequired = 426,
+ /** RFC 6585, 3 */
+ PreconditionRequired = 428,
+ /** RFC 6585, 4 */
+ TooManyRequests = 429,
+ /** RFC 6585, 5 */
+ RequestHeaderFieldsTooLarge = 431,
+ /** RFC 7725, 3 */
+ UnavailableForLegalReasons = 451,
+
+ /** RFC 7231, 6.6.1 */
+ InternalServerError = 500,
+ /** RFC 7231, 6.6.2 */
+ NotImplemented = 501,
+ /** RFC 7231, 6.6.3 */
+ BadGateway = 502,
+ /** RFC 7231, 6.6.4 */
+ ServiceUnavailable = 503,
+ /** RFC 7231, 6.6.5 */
+ GatewayTimeout = 504,
+ /** RFC 7231, 6.6.6 */
+ HTTPVersionNotSupported = 505,
+ /** RFC 2295, 8.1 */
+ VariantAlsoNegotiates = 506,
+ /** RFC 4918, 11.5 */
+ InsufficientStorage = 507,
+ /** RFC 5842, 7.2 */
+ LoopDetected = 508,
+ /** RFC 2774, 7 */
+ NotExtended = 510,
+ /** RFC 6585, 6 */
+ NetworkAuthenticationRequired = 511,
+}
+
+export default {
+ STATUS_CODES,
+};
diff --git a/ext/node/polyfills/_tls_wrap.ts b/ext/node/polyfills/_tls_wrap.ts
index ed2bdd0a3..a614b45df 100644
--- a/ext/node/polyfills/_tls_wrap.ts
+++ b/ext/node/polyfills/_tls_wrap.ts
@@ -10,7 +10,7 @@ import {
} from "ext:deno_node/internal/primordials.mjs";
import assert from "ext:deno_node/internal/assert.mjs";
import * as net from "node:net";
-import { createSecureContext } from "ext:deno_node/_tls_common.ts";
+import { createSecureContext } from "node:_tls_common";
import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts";
import { connResetException } from "ext:deno_node/internal/errors.ts";
import { emitWarning } from "node:process";
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index a9eee0019..f3f6f86ed 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -36,16 +36,16 @@ import {
Writable as NodeWritable,
} from "node:stream";
import {
+ kUniqueHeaders,
OutgoingMessage,
parseUniqueHeadersOption,
validateHeaderName,
validateHeaderValue,
-} from "ext:deno_node/_http_outgoing.ts";
+} from "node:_http_outgoing";
import { ok as assert } from "node:assert";
import { kOutHeaders } from "ext:deno_node/internal/http.ts";
-import { _checkIsHttpToken as checkIsHttpToken } from "ext:deno_node/_http_common.ts";
-import { Agent, globalAgent } from "ext:deno_node/_http_agent.mjs";
-// import { chunkExpression as RE_TE_CHUNKED } from "ext:deno_node/_http_common.ts";
+import { _checkIsHttpToken as checkIsHttpToken } from "node:_http_common";
+import { Agent, globalAgent } from "node:_http_agent";
import { urlToHttpOptions } from "ext:deno_node/internal/url.ts";
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { constants, TCP } from "ext:deno_node/internal_binding/tcp_wrap.ts";
@@ -67,178 +67,12 @@ import { timerId } from "ext:deno_web/03_abort_signal.js";
import { clearTimeout as webClearTimeout } from "ext:deno_web/02_timers.js";
import { resourceForReadableStream } from "ext:deno_web/06_streams.js";
import { TcpConn } from "ext:deno_net/01_net.js";
+import { STATUS_CODES } from "node:_http_server";
+import { methods as METHODS } from "node:_http_common";
const { internalRidSymbol } = core;
const { ArrayIsArray } = primordials;
-enum STATUS_CODES {
- /** RFC 7231, 6.2.1 */
- Continue = 100,
- /** RFC 7231, 6.2.2 */
- SwitchingProtocols = 101,
- /** RFC 2518, 10.1 */
- Processing = 102,
- /** RFC 8297 **/
- EarlyHints = 103,
-
- /** RFC 7231, 6.3.1 */
- OK = 200,
- /** RFC 7231, 6.3.2 */
- Created = 201,
- /** RFC 7231, 6.3.3 */
- Accepted = 202,
- /** RFC 7231, 6.3.4 */
- NonAuthoritativeInfo = 203,
- /** RFC 7231, 6.3.5 */
- NoContent = 204,
- /** RFC 7231, 6.3.6 */
- ResetContent = 205,
- /** RFC 7233, 4.1 */
- PartialContent = 206,
- /** RFC 4918, 11.1 */
- MultiStatus = 207,
- /** RFC 5842, 7.1 */
- AlreadyReported = 208,
- /** RFC 3229, 10.4.1 */
- IMUsed = 226,
-
- /** RFC 7231, 6.4.1 */
- MultipleChoices = 300,
- /** RFC 7231, 6.4.2 */
- MovedPermanently = 301,
- /** RFC 7231, 6.4.3 */
- Found = 302,
- /** RFC 7231, 6.4.4 */
- SeeOther = 303,
- /** RFC 7232, 4.1 */
- NotModified = 304,
- /** RFC 7231, 6.4.5 */
- UseProxy = 305,
- /** RFC 7231, 6.4.7 */
- TemporaryRedirect = 307,
- /** RFC 7538, 3 */
- PermanentRedirect = 308,
-
- /** RFC 7231, 6.5.1 */
- BadRequest = 400,
- /** RFC 7235, 3.1 */
- Unauthorized = 401,
- /** RFC 7231, 6.5.2 */
- PaymentRequired = 402,
- /** RFC 7231, 6.5.3 */
- Forbidden = 403,
- /** RFC 7231, 6.5.4 */
- NotFound = 404,
- /** RFC 7231, 6.5.5 */
- MethodNotAllowed = 405,
- /** RFC 7231, 6.5.6 */
- NotAcceptable = 406,
- /** RFC 7235, 3.2 */
- ProxyAuthRequired = 407,
- /** RFC 7231, 6.5.7 */
- RequestTimeout = 408,
- /** RFC 7231, 6.5.8 */
- Conflict = 409,
- /** RFC 7231, 6.5.9 */
- Gone = 410,
- /** RFC 7231, 6.5.10 */
- LengthRequired = 411,
- /** RFC 7232, 4.2 */
- PreconditionFailed = 412,
- /** RFC 7231, 6.5.11 */
- RequestEntityTooLarge = 413,
- /** RFC 7231, 6.5.12 */
- RequestURITooLong = 414,
- /** RFC 7231, 6.5.13 */
- UnsupportedMediaType = 415,
- /** RFC 7233, 4.4 */
- RequestedRangeNotSatisfiable = 416,
- /** RFC 7231, 6.5.14 */
- ExpectationFailed = 417,
- /** RFC 7168, 2.3.3 */
- Teapot = 418,
- /** RFC 7540, 9.1.2 */
- MisdirectedRequest = 421,
- /** RFC 4918, 11.2 */
- UnprocessableEntity = 422,
- /** RFC 4918, 11.3 */
- Locked = 423,
- /** RFC 4918, 11.4 */
- FailedDependency = 424,
- /** RFC 8470, 5.2 */
- TooEarly = 425,
- /** RFC 7231, 6.5.15 */
- UpgradeRequired = 426,
- /** RFC 6585, 3 */
- PreconditionRequired = 428,
- /** RFC 6585, 4 */
- TooManyRequests = 429,
- /** RFC 6585, 5 */
- RequestHeaderFieldsTooLarge = 431,
- /** RFC 7725, 3 */
- UnavailableForLegalReasons = 451,
-
- /** RFC 7231, 6.6.1 */
- InternalServerError = 500,
- /** RFC 7231, 6.6.2 */
- NotImplemented = 501,
- /** RFC 7231, 6.6.3 */
- BadGateway = 502,
- /** RFC 7231, 6.6.4 */
- ServiceUnavailable = 503,
- /** RFC 7231, 6.6.5 */
- GatewayTimeout = 504,
- /** RFC 7231, 6.6.6 */
- HTTPVersionNotSupported = 505,
- /** RFC 2295, 8.1 */
- VariantAlsoNegotiates = 506,
- /** RFC 4918, 11.5 */
- InsufficientStorage = 507,
- /** RFC 5842, 7.2 */
- LoopDetected = 508,
- /** RFC 2774, 7 */
- NotExtended = 510,
- /** RFC 6585, 6 */
- NetworkAuthenticationRequired = 511,
-}
-
-const METHODS = [
- "ACL",
- "BIND",
- "CHECKOUT",
- "CONNECT",
- "COPY",
- "DELETE",
- "GET",
- "HEAD",
- "LINK",
- "LOCK",
- "M-SEARCH",
- "MERGE",
- "MKACTIVITY",
- "MKCALENDAR",
- "MKCOL",
- "MOVE",
- "NOTIFY",
- "OPTIONS",
- "PATCH",
- "POST",
- "PROPFIND",
- "PROPPATCH",
- "PURGE",
- "PUT",
- "REBIND",
- "REPORT",
- "SEARCH",
- "SOURCE",
- "SUBSCRIBE",
- "TRACE",
- "UNBIND",
- "UNLINK",
- "UNLOCK",
- "UNSUBSCRIBE",
-];
-
type Chunk = string | Buffer | Uint8Array;
const ENCODER = new TextEncoder();
@@ -283,8 +117,6 @@ function validateHost(host, name) {
const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;
const kError = Symbol("kError");
-const kUniqueHeaders = Symbol("kUniqueHeaders");
-
class FakeSocket extends EventEmitter {
constructor(
opts: {
diff --git a/ext/node/polyfills/http2.ts b/ext/node/polyfills/http2.ts
index b4cda65f8..cab7aa26c 100644
--- a/ext/node/polyfills/http2.ts
+++ b/ext/node/polyfills/http2.ts
@@ -67,7 +67,7 @@ import {
ERR_SOCKET_CLOSED,
ERR_STREAM_WRITE_AFTER_END,
} from "ext:deno_node/internal/errors.ts";
-import { _checkIsHttpToken } from "ext:deno_node/_http_common.ts";
+import { _checkIsHttpToken } from "node:_http_common";
const {
StringPrototypeTrim,
FunctionPrototypeBind,
diff --git a/ext/node/polyfills/https.ts b/ext/node/polyfills/https.ts
index c1f1237b1..f60c5e471 100644
--- a/ext/node/polyfills/https.ts
+++ b/ext/node/polyfills/https.ts
@@ -11,7 +11,7 @@ import {
IncomingMessageForClient as IncomingMessage,
type RequestOptions,
} from "node:http";
-import { Agent as HttpAgent } from "ext:deno_node/_http_agent.mjs";
+import { Agent as HttpAgent } from "node:_http_agent";
import { createHttpClient } from "ext:deno_fetch/22_http_client.js";
import { type ServerHandler, ServerImpl as HttpServer } from "node:http";
import { validateObject } from "ext:deno_node/internal/validators.mjs";
diff --git a/ext/node/polyfills/internal/crypto/sig.ts b/ext/node/polyfills/internal/crypto/sig.ts
index bcbcb469b..a05f16478 100644
--- a/ext/node/polyfills/internal/crypto/sig.ts
+++ b/ext/node/polyfills/internal/crypto/sig.ts
@@ -20,7 +20,7 @@ import {
} from "ext:deno_node/internal/validators.mjs";
import { Buffer } from "node:buffer";
import type { WritableOptions } from "ext:deno_node/_stream.d.ts";
-import Writable from "ext:deno_node/internal/streams/writable.mjs";
+import Writable from "node:_stream_writable";
import type {
BinaryLike,
BinaryToTextEncoding,
diff --git a/ext/node/polyfills/tls.ts b/ext/node/polyfills/tls.ts
index a60469083..7d00bc6e5 100644
--- a/ext/node/polyfills/tls.ts
+++ b/ext/node/polyfills/tls.ts
@@ -5,8 +5,8 @@
// deno-lint-ignore-file prefer-primordials
import { notImplemented } from "ext:deno_node/_utils.ts";
-import tlsCommon from "ext:deno_node/_tls_common.ts";
-import tlsWrap from "ext:deno_node/_tls_wrap.ts";
+import tlsCommon from "node:_tls_common";
+import tlsWrap from "node:_tls_wrap";
// openssl -> rustls
const cipherMap = {
diff --git a/tools/core_import_map.json b/tools/core_import_map.json
index 15affc2b7..aae4e63a4 100644
--- a/tools/core_import_map.json
+++ b/tools/core_import_map.json
@@ -40,9 +40,10 @@
"ext:deno_node/_fs/_fs_write.mjs": "../ext/node/polyfills/_fs/_fs_write.mjs",
"ext:deno_node/_fs/_fs_writev.mjs": "../ext/node/polyfills/_fs/_fs_writev.mjs",
"ext:deno_node/_global.d.ts": "../ext/node/polyfills/_global.d.ts",
- "ext:deno_node/_http_agent.mjs": "../ext/node/polyfills/_http_agent.mjs",
- "ext:deno_node/_http_common.ts": "../ext/node/polyfills/_http_common.ts",
- "ext:deno_node/_http_outgoing.ts": "../ext/node/polyfills/_http_outgoing.ts",
+ "node:_http_agent": "../ext/node/polyfills/_http_agent.mjs",
+ "node:_http_common": "../ext/node/polyfills/_http_common.ts",
+ "node:_http_outgoing": "../ext/node/polyfills/_http_outgoing.ts",
+ "node:_http_server": "../ext/node/polyfills/_http_server.ts",
"ext:deno_node/_next_tick.ts": "../ext/node/polyfills/_next_tick.ts",
"ext:deno_node/_process/exiting.ts": "../ext/node/polyfills/_process/exiting.ts",
"ext:deno_node/_process/process.ts": "../ext/node/polyfills/_process/process.ts",
@@ -50,7 +51,7 @@
"ext:deno_node/_readline_shared_types.d.ts": "../ext/node/polyfills/_readline_shared_types.d.ts",
"ext:deno_node/_stream.d.ts": "../ext/node/polyfills/_stream.d.ts",
"ext:deno_node/_stream.mjs": "../ext/node/polyfills/_stream.mjs",
- "ext:deno_node/_tls_common.ts": "../ext/node/polyfills/_tls_common.ts",
+ "node:_tls_common": "../ext/node/polyfills/_tls_common.ts",
"ext:deno_node/_util/asserts.ts": "../ext/node/polyfills/_util/asserts.ts",
"ext:deno_node/_util/async.ts": "../ext/node/polyfills/_util/async.ts",
"ext:deno_node/_util/os.ts": "../ext/node/polyfills/_util/os.ts",
@@ -154,15 +155,15 @@
"ext:deno_node/internal/streams/add-abort-signal.mjs": "../ext/node/polyfills/internal/streams/add-abort-signal.mjs",
"ext:deno_node/internal/streams/buffer_list.mjs": "../ext/node/polyfills/internal/streams/buffer_list.mjs",
"ext:deno_node/internal/streams/destroy.mjs": "../ext/node/polyfills/internal/streams/destroy.mjs",
- "ext:deno_node/internal/streams/duplex.mjs": "../ext/node/polyfills/internal/streams/duplex.mjs",
+ "node:_stream_duplex": "../ext/node/polyfills/internal/streams/duplex.mjs",
"ext:deno_node/internal/streams/end-of-stream.mjs": "../ext/node/polyfills/internal/streams/end-of-stream.mjs",
"ext:deno_node/internal/streams/lazy_transform.mjs": "../ext/node/polyfills/internal/streams/lazy_transform.mjs",
- "ext:deno_node/internal/streams/passthrough.mjs": "../ext/node/polyfills/internal/streams/passthrough.mjs",
- "ext:deno_node/internal/streams/readable.mjs": "../ext/node/polyfills/internal/streams/readable.mjs",
+ "node:_stream_readable": "../ext/node/polyfills/internal/streams/readable.mjs",
+ "node:_stream_passthrough": "../ext/node/polyfills/internal/streams/passthrough.mjs",
"ext:deno_node/internal/streams/state.mjs": "../ext/node/polyfills/internal/streams/state.mjs",
- "ext:deno_node/internal/streams/transform.mjs": "../ext/node/polyfills/internal/streams/transform.mjs",
"ext:deno_node/internal/streams/utils.mjs": "../ext/node/polyfills/internal/streams/utils.mjs",
- "ext:deno_node/internal/streams/writable.mjs": "../ext/node/polyfills/internal/streams/writable.mjs",
+ "node:_stream_transform": "../ext/node/polyfills/internal/streams/transform.mjs",
+ "node:_stream_writable": "../ext/node/polyfills/internal/streams/writable.mjs",
"ext:deno_node/internal/test/binding.ts": "../ext/node/polyfills/internal/test/binding.ts",
"ext:deno_node/internal/timers.mjs": "../ext/node/polyfills/internal/timers.mjs",
"ext:deno_node/internal/url.ts": "../ext/node/polyfills/internal/url.ts",