1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

refactor: rename built-in node modules from ext:deno_node/ to node: (#19680)

Closes https://github.com/denoland/deno/issues/19510
This commit is contained in:
Bartek Iwańczuk 2023-07-02 20:19:30 +02:00 committed by GitHub
parent 805497a9a5
commit 01f0d03ae8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
99 changed files with 422 additions and 554 deletions

12
Cargo.lock generated
View file

@ -958,9 +958,9 @@ dependencies = [
[[package]]
name = "deno_core"
version = "0.193.0"
version = "0.194.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d7eeb863655f377ffe22d5a90f01d1b57b4d4ad0acbfeec266d5d3faf4cd1cf"
checksum = "cc857567cdff39a7d554c686b0353cc89958cd2b34319dd11793541323531e9d"
dependencies = [
"anyhow",
"bytes",
@ -1331,9 +1331,9 @@ dependencies = [
[[package]]
name = "deno_ops"
version = "0.71.0"
version = "0.72.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dd95626e113f292ce758f216bb12e50c9c58e886195bcd85231e715c73d6470"
checksum = "5229c9b8b4fe7805123794727c4be2a8af46c41c49681ce07d20bca09978e74d"
dependencies = [
"deno-proc-macro-rules",
"lazy-regex",
@ -4366,9 +4366,9 @@ dependencies = [
[[package]]
name = "serde_v8"
version = "0.104.0"
version = "0.105.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2481189a5019f43a6b68620193578623701323754409555c36588c81ee2487de"
checksum = "4b30e810bbf80dff0dfa2a13eeeb9060a4038b210bb230410c9b3f5b33669afe"
dependencies = [
"bytes",
"derive_more",

View file

@ -41,9 +41,9 @@ repository = "https://github.com/denoland/deno"
v8 = { version = "0.74.1", default-features = false }
deno_ast = { version = "0.27.0", features = ["transpiling"] }
deno_core = { version = "0.193.0" }
deno_ops = { version = "0.70.0" }
serde_v8 = { version = "0.103.0" }
deno_core = { version = "0.194.0" }
deno_ops = { version = "0.71.0" }
serde_v8 = { version = "0.104.0" }
deno_runtime = { version = "0.117.0", path = "./runtime" }
napi_sym = { version = "0.39.0", path = "./cli/napi/sym" }

View file

@ -38,10 +38,7 @@ mod ts {
fn op_build_info(state: &mut OpState) -> Value {
let build_specifier = "asset:///bootstrap.ts";
let node_built_in_module_names = SUPPORTED_BUILTIN_NODE_MODULES
.iter()
.map(|p| p.module_name())
.collect::<Vec<&str>>();
let node_built_in_module_names = SUPPORTED_BUILTIN_NODE_MODULES.to_vec();
let build_libs = state.borrow::<Vec<&str>>();
json!({
"buildSpecifier": build_specifier,

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Module } from "node:module";
import { createRequire, Module } from "node:module";
import {
assert,
assertEquals,
@ -58,3 +58,18 @@ Deno.test("[node/module _nodeModulePaths] prevents duplicate root /node_modules"
"Missing root 'node_modules' directory",
);
});
Deno.test("Built-in Node modules have `node:` prefix", () => {
let thrown = false;
try {
// @ts-ignore We want to explicitly test wrong call signature
createRequire();
} catch (e) {
thrown = true;
const stackLines = e.stack.split("\n");
// Assert that built-in node modules have `node:<mod_name>` specifiers.
assert(stackLines.some((line: string) => line.includes("(node:module:")));
}
assert(thrown);
});

View file

@ -31,8 +31,8 @@ mod resolution;
pub use package_json::PackageJson;
pub use path::PathClean;
pub use polyfill::is_builtin_node_module;
pub use polyfill::NodeModulePolyfill;
pub use polyfill::SUPPORTED_BUILTIN_NODE_MODULES;
pub use polyfill::SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX;
pub use resolution::NodeModuleKind;
pub use resolution::NodeResolution;
pub use resolution::NodeResolutionMode;
@ -251,7 +251,6 @@ deno_core::extension!(deno_node,
esm = [
dir "polyfills",
"00_globals.js",
"01_require.js",
"02_init.js",
"_brotli.js",
"_events.mjs",
@ -315,27 +314,7 @@ deno_core::extension!(deno_node,
"_utils.ts",
"_zlib_binding.mjs",
"_zlib.mjs",
"assert.ts",
"assert/strict.ts",
"assertion_error.ts",
"async_hooks.ts",
"buffer.ts",
"child_process.ts",
"cluster.ts",
"console.ts",
"constants.ts",
"crypto.ts",
"dgram.ts",
"diagnostics_channel.ts",
"dns.ts",
"dns/promises.ts",
"domain.ts",
"events.ts",
"fs.ts",
"fs/promises.ts",
"http.ts",
"http2.ts",
"https.ts",
"inspector.ts",
"internal_binding/_libuv_winerror.ts",
"internal_binding/_listen.ts",
@ -435,9 +414,6 @@ deno_core::extension!(deno_node,
"internal/util/inspect.mjs",
"internal/util/types.ts",
"internal/validators.mjs",
"net.ts",
"os.ts",
"path.ts",
"path/_constants.ts",
"path/_interface.ts",
"path/_util.ts",
@ -445,34 +421,61 @@ deno_core::extension!(deno_node,
"path/_win32.ts",
"path/common.ts",
"path/mod.ts",
"path/posix.ts",
"path/separator.ts",
"path/win32.ts",
"perf_hooks.ts",
"process.ts",
"punycode.ts",
"querystring.ts",
"readline.ts",
"readline/promises.ts",
"repl.ts",
"stream.ts",
"stream/consumers.mjs",
"stream/promises.mjs",
"stream/web.ts",
"string_decoder.ts",
"sys.ts",
"timers.ts",
"timers/promises.ts",
"tls.ts",
"tty.ts",
"url.ts",
"util.ts",
"util/types.ts",
"v8.ts",
"vm.ts",
"wasi.ts",
"worker_threads.ts",
"zlib.ts",
"wasi.ts"
],
esm_with_specifiers = [
dir "polyfills",
("node:assert", "assert.ts"),
("node:assert/strict", "assert/strict.ts"),
("node:async_hooks", "async_hooks.ts"),
("node:buffer", "buffer.ts"),
("node:child_process", "child_process.ts"),
("node:cluster", "cluster.ts"),
("node:console", "console.ts"),
("node:constants", "constants.ts"),
("node:crypto", "crypto.ts"),
("node:dgram", "dgram.ts"),
("node:diagnostics_channel", "diagnostics_channel.ts"),
("node:dns", "dns.ts"),
("node:dns/promises", "dns/promises.ts"),
("node:domain", "domain.ts"),
("node:events", "events.ts"),
("node:fs", "fs.ts"),
("node:fs/promises", "fs/promises.ts"),
("node:http", "http.ts"),
("node:http2", "http2.ts"),
("node:https", "https.ts"),
("node:module", "01_require.js"),
("node:net", "net.ts"),
("node:os", "os.ts"),
("node:path", "path.ts"),
("node:path/posix", "path/posix.ts"),
("node:path/win32", "path/win32.ts"),
("node:perf_hooks", "perf_hooks.ts"),
("node:process", "process.ts"),
("node:punycode", "punycode.ts"),
("node:querystring", "querystring.ts"),
("node:readline", "readline.ts"),
("node:stream", "stream.ts"),
("node:stream/consumers", "stream/consumers.mjs"),
("node:stream/promises", "stream/promises.mjs"),
("node:stream/web", "stream/web.ts"),
("node:string_decoder", "string_decoder.ts"),
("node:sys", "sys.ts"),
("node:timers", "timers.ts"),
("node:timers/promises", "timers/promises.ts"),
("node:tls", "tls.ts"),
("node:tty", "tty.ts"),
("node:url", "url.ts"),
("node:util", "util.ts"),
("node:util/types", "util/types.ts"),
("node:v8", "v8.ts"),
("node:vm", "vm.ts"),
("node:worker_threads", "worker_threads.ts"),
("node:zlib", "zlib.ts"),
],
options = {
maybe_npm_resolver: Option<NpmResolverRc>,
@ -488,7 +491,7 @@ deno_core::extension!(deno_node,
npm_resolver,
)))
}
},
}
);
pub fn initialize_runtime(

View file

@ -4,214 +4,73 @@
pub fn is_builtin_node_module(module_name: &str) -> bool {
SUPPORTED_BUILTIN_NODE_MODULES
.iter()
.any(|m| m.module_name() == module_name)
.any(|m| *m == module_name)
}
pub struct NodeModulePolyfill {
/// Name of the module like "assert" or "timers/promises"
pub specifier: &'static str,
pub ext_specifier: &'static str,
}
macro_rules! generate_builtin_node_module_lists {
($( $module_name:literal ,)+) => {
pub static SUPPORTED_BUILTIN_NODE_MODULES: &[&str] = &[
$(
$module_name,
)+
];
impl NodeModulePolyfill {
pub fn module_name(&self) -> &'static str {
debug_assert!(self.specifier.starts_with("node:"));
&self.specifier[5..]
}
pub static SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX: &[&str] = &[
$(
concat!("node:", $module_name),
)+
];
};
}
// NOTE(bartlomieju): keep this list in sync with `ext/node/polyfills/01_require.js`
pub static SUPPORTED_BUILTIN_NODE_MODULES: &[NodeModulePolyfill] = &[
NodeModulePolyfill {
specifier: "node:assert",
ext_specifier: "ext:deno_node/assert.ts",
},
NodeModulePolyfill {
specifier: "node:assert/strict",
ext_specifier: "ext:deno_node/assert/strict.ts",
},
NodeModulePolyfill {
specifier: "node:async_hooks",
ext_specifier: "ext:deno_node/async_hooks.ts",
},
NodeModulePolyfill {
specifier: "node:buffer",
ext_specifier: "ext:deno_node/buffer.ts",
},
NodeModulePolyfill {
specifier: "node:child_process",
ext_specifier: "ext:deno_node/child_process.ts",
},
NodeModulePolyfill {
specifier: "node:cluster",
ext_specifier: "ext:deno_node/cluster.ts",
},
NodeModulePolyfill {
specifier: "node:console",
ext_specifier: "ext:deno_node/console.ts",
},
NodeModulePolyfill {
specifier: "node:constants",
ext_specifier: "ext:deno_node/constants.ts",
},
NodeModulePolyfill {
specifier: "node:crypto",
ext_specifier: "ext:deno_node/crypto.ts",
},
NodeModulePolyfill {
specifier: "node:dgram",
ext_specifier: "ext:deno_node/dgram.ts",
},
NodeModulePolyfill {
specifier: "node:diagnostics_channel",
ext_specifier: "ext:deno_node/diagnostics_channel.ts",
},
NodeModulePolyfill {
specifier: "node:dns",
ext_specifier: "ext:deno_node/dns.ts",
},
NodeModulePolyfill {
specifier: "node:dns/promises",
ext_specifier: "ext:deno_node/dns/promises.ts",
},
NodeModulePolyfill {
specifier: "node:domain",
ext_specifier: "ext:deno_node/domain.ts",
},
NodeModulePolyfill {
specifier: "node:events",
ext_specifier: "ext:deno_node/events.ts",
},
NodeModulePolyfill {
specifier: "node:fs",
ext_specifier: "ext:deno_node/fs.ts",
},
NodeModulePolyfill {
specifier: "node:fs/promises",
ext_specifier: "ext:deno_node/fs/promises.ts",
},
NodeModulePolyfill {
specifier: "node:http",
ext_specifier: "ext:deno_node/http.ts",
},
NodeModulePolyfill {
specifier: "node:http2",
ext_specifier: "ext:deno_node/http2.ts",
},
NodeModulePolyfill {
specifier: "node:https",
ext_specifier: "ext:deno_node/https.ts",
},
NodeModulePolyfill {
specifier: "node:module",
ext_specifier: "ext:deno_node/01_require.js",
},
NodeModulePolyfill {
specifier: "node:net",
ext_specifier: "ext:deno_node/net.ts",
},
NodeModulePolyfill {
specifier: "node:os",
ext_specifier: "ext:deno_node/os.ts",
},
NodeModulePolyfill {
specifier: "node:path",
ext_specifier: "ext:deno_node/path.ts",
},
NodeModulePolyfill {
specifier: "node:path/posix",
ext_specifier: "ext:deno_node/path/posix.ts",
},
NodeModulePolyfill {
specifier: "node:path/win32",
ext_specifier: "ext:deno_node/path/win32.ts",
},
NodeModulePolyfill {
specifier: "node:perf_hooks",
ext_specifier: "ext:deno_node/perf_hooks.ts",
},
NodeModulePolyfill {
specifier: "node:process",
ext_specifier: "ext:deno_node/process.ts",
},
NodeModulePolyfill {
specifier: "node:punycode",
ext_specifier: "ext:deno_node/punycode.ts",
},
NodeModulePolyfill {
specifier: "node:querystring",
ext_specifier: "ext:deno_node/querystring.ts",
},
NodeModulePolyfill {
specifier: "node:readline",
ext_specifier: "ext:deno_node/readline.ts",
},
NodeModulePolyfill {
specifier: "node:stream",
ext_specifier: "ext:deno_node/stream.ts",
},
NodeModulePolyfill {
specifier: "node:stream/consumers",
ext_specifier: "ext:deno_node/stream/consumers.mjs",
},
NodeModulePolyfill {
specifier: "node:stream/promises",
ext_specifier: "ext:deno_node/stream/promises.mjs",
},
NodeModulePolyfill {
specifier: "node:stream/web",
ext_specifier: "ext:deno_node/stream/web.ts",
},
NodeModulePolyfill {
specifier: "node:string_decoder",
ext_specifier: "ext:deno_node/string_decoder.ts",
},
NodeModulePolyfill {
specifier: "node:sys",
ext_specifier: "ext:deno_node/sys.ts",
},
NodeModulePolyfill {
specifier: "node:timers",
ext_specifier: "ext:deno_node/timers.ts",
},
NodeModulePolyfill {
specifier: "node:timers/promises",
ext_specifier: "ext:deno_node/timers/promises.ts",
},
NodeModulePolyfill {
specifier: "node:tls",
ext_specifier: "ext:deno_node/tls.ts",
},
NodeModulePolyfill {
specifier: "node:tty",
ext_specifier: "ext:deno_node/tty.ts",
},
NodeModulePolyfill {
specifier: "node:url",
ext_specifier: "ext:deno_node/url.ts",
},
NodeModulePolyfill {
specifier: "node:util",
ext_specifier: "ext:deno_node/util.ts",
},
NodeModulePolyfill {
specifier: "node:util/types",
ext_specifier: "ext:deno_node/util/types.ts",
},
NodeModulePolyfill {
specifier: "node:v8",
ext_specifier: "ext:deno_node/v8.ts",
},
NodeModulePolyfill {
specifier: "node:vm",
ext_specifier: "ext:deno_node/vm.ts",
},
NodeModulePolyfill {
specifier: "node:worker_threads",
ext_specifier: "ext:deno_node/worker_threads.ts",
},
NodeModulePolyfill {
specifier: "node:zlib",
ext_specifier: "ext:deno_node/zlib.ts",
},
];
generate_builtin_node_module_lists! {
"assert",
"assert/strict",
"async_hooks",
"buffer",
"child_process",
"cluster",
"console",
"constants",
"crypto",
"dgram",
"diagnostics_channel",
"dns",
"dns/promises",
"domain",
"events",
"fs",
"fs/promises",
"http",
"http2",
"https",
"module",
"net",
"os",
"path",
"path/posix",
"path/win32",
"perf_hooks",
"process",
"punycode",
"querystring",
"readline",
"stream",
"stream/consumers",
"stream/promises",
"stream/web",
"string_decoder",
"sys",
"timers",
"timers/promises",
"tls",
"tty",
"url",
"util",
"util/types",
"v8",
"vm",
"worker_threads",
"zlib",
}

View file

@ -48,26 +48,26 @@ 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 assert from "ext:deno_node/assert.ts";
import assertStrict from "ext:deno_node/assert/strict.ts";
import asyncHooks from "ext:deno_node/async_hooks.ts";
import buffer from "ext:deno_node/buffer.ts";
import childProcess from "ext:deno_node/child_process.ts";
import cluster from "ext:deno_node/cluster.ts";
import console from "ext:deno_node/console.ts";
import constants from "ext:deno_node/constants.ts";
import crypto from "ext:deno_node/crypto.ts";
import dgram from "ext:deno_node/dgram.ts";
import diagnosticsChannel from "ext:deno_node/diagnostics_channel.ts";
import dns from "ext:deno_node/dns.ts";
import dnsPromises from "ext:deno_node/dns/promises.ts";
import domain from "ext:deno_node/domain.ts";
import events from "ext:deno_node/events.ts";
import fs from "ext:deno_node/fs.ts";
import fsPromises from "ext:deno_node/fs/promises.ts";
import http from "ext:deno_node/http.ts";
import http2 from "ext:deno_node/http2.ts";
import https from "ext:deno_node/https.ts";
import assert from "node:assert";
import assertStrict from "node:assert/strict";
import asyncHooks from "node:async_hooks";
import buffer from "node:buffer";
import childProcess from "node:child_process";
import cluster from "node:cluster";
import console from "node:console";
import constants from "node:constants";
import crypto from "node:crypto";
import dgram from "node:dgram";
import diagnosticsChannel from "node:diagnostics_channel";
import dns from "node:dns";
import dnsPromises from "node:dns/promises";
import domain from "node:domain";
import events from "node:events";
import fs from "node:fs";
import fsPromises from "node:fs/promises";
import http from "node:http";
import http2 from "node:http2";
import https from "node:https";
import inspector from "ext:deno_node/inspector.ts";
import internalCp from "ext:deno_node/internal/child_process.ts";
import internalCryptoCertificate from "ext:deno_node/internal/crypto/certificate.ts";
@ -98,36 +98,36 @@ import internalTestBinding from "ext:deno_node/internal/test/binding.ts";
import internalTimers from "ext:deno_node/internal/timers.mjs";
import internalUtil from "ext:deno_node/internal/util.mjs";
import internalUtilInspect from "ext:deno_node/internal/util/inspect.mjs";
import net from "ext:deno_node/net.ts";
import os from "ext:deno_node/os.ts";
import pathPosix from "ext:deno_node/path/posix.ts";
import pathWin32 from "ext:deno_node/path/win32.ts";
import path from "ext:deno_node/path.ts";
import perfHooks from "ext:deno_node/perf_hooks.ts";
import punycode from "ext:deno_node/punycode.ts";
import process from "ext:deno_node/process.ts";
import querystring from "ext:deno_node/querystring.ts";
import readline from "ext:deno_node/readline.ts";
import net from "node:net";
import os from "node:os";
import pathPosix from "node:path/posix";
import pathWin32 from "node:path/win32";
import path from "node:path";
import perfHooks from "node:perf_hooks";
import punycode from "node:punycode";
import process from "node:process";
import querystring from "node:querystring";
import readline from "node:readline";
import readlinePromises from "ext:deno_node/readline/promises.ts";
import repl from "ext:deno_node/repl.ts";
import stream from "ext:deno_node/stream.ts";
import streamConsumers from "ext:deno_node/stream/consumers.mjs";
import streamPromises from "ext:deno_node/stream/promises.mjs";
import streamWeb from "ext:deno_node/stream/web.ts";
import stringDecoder from "ext:deno_node/string_decoder.ts";
import sys from "ext:deno_node/sys.ts";
import timers from "ext:deno_node/timers.ts";
import timersPromises from "ext:deno_node/timers/promises.ts";
import tls from "ext:deno_node/tls.ts";
import tty from "ext:deno_node/tty.ts";
import url from "ext:deno_node/url.ts";
import utilTypes from "ext:deno_node/util/types.ts";
import util from "ext:deno_node/util.ts";
import v8 from "ext:deno_node/v8.ts";
import vm from "ext:deno_node/vm.ts";
import workerThreads from "ext:deno_node/worker_threads.ts";
import stream from "node:stream";
import streamConsumers from "node:stream/consumers";
import streamPromises from "node:stream/promises";
import streamWeb from "node:stream/web";
import stringDecoder from "node:string_decoder";
import sys from "node:sys";
import timers from "node:timers";
import timersPromises from "node:timers/promises";
import tls from "node:tls";
import tty from "node:tty";
import url from "node:url";
import utilTypes from "node:util/types";
import util from "node:util";
import v8 from "node:v8";
import vm from "node:vm";
import workerThreads from "node:worker_threads";
import wasi from "ext:deno_node/wasi.ts";
import zlib from "ext:deno_node/zlib.ts";
import zlib from "node:zlib";
const nativeModuleExports = ObjectCreate(null);
const builtinModules = [];

View file

@ -7,7 +7,7 @@ const requireImpl = internals.requireImpl;
const primordials = globalThis.__bootstrap.primordials;
const { ObjectDefineProperty } = primordials;
import { nodeGlobals, nodeGlobalThis } from "ext:deno_node/00_globals.js";
import "ext:deno_node/01_require.js";
import "node:module";
let initialized = false;

View file

@ -5,8 +5,8 @@
import { zlib as constants } from "ext:deno_node/internal_binding/constants.ts";
import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { Transform } from "ext:deno_node/stream.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Transform } from "node:stream";
import { Buffer } from "node:buffer";
const { core } = globalThis.__bootstrap;
const { ops } = core;

View file

@ -13,7 +13,7 @@ import {
getValidatedPath,
getValidMode,
} from "ext:deno_node/internal/fs/utils.mjs";
import type { Buffer } from "ext:deno_node/buffer.ts";
import type { Buffer } from "node:buffer";
import { promisify } from "ext:deno_node/internal/util.mjs";
export function access(

View file

@ -5,9 +5,9 @@
import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import * as pathModule from "ext:deno_node/path.ts";
import * as pathModule from "node:path";
import { parseFileMode } from "ext:deno_node/internal/validators.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { promisify } from "ext:deno_node/internal/util.mjs";
export function chmod(

View file

@ -11,9 +11,9 @@ import {
getValidatedPath,
kMaxUserId,
} from "ext:deno_node/internal/fs/utils.mjs";
import * as pathModule from "ext:deno_node/path.ts";
import * as pathModule from "node:path";
import { validateInteger } from "ext:deno_node/internal/validators.mjs";
import type { Buffer } from "ext:deno_node/buffer.ts";
import type { Buffer } from "node:buffer";
import { promisify } from "ext:deno_node/internal/util.mjs";
/**

View file

@ -5,7 +5,7 @@
import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { makeCallback } from "ext:deno_node/_fs/_fs_common.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
getValidatedPath,
getValidMode,

View file

@ -16,7 +16,7 @@ import { parseFileMode } from "ext:deno_node/internal/validators.mjs";
import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import { FileHandle } from "ext:deno_node/internal/fs/handle.ts";
import type { Buffer } from "ext:deno_node/buffer.ts";
import type { Buffer } from "node:buffer";
function existsSync(filePath: string | URL): boolean {
try {

View file

@ -4,7 +4,7 @@
// deno-lint-ignore-file prefer-primordials
import Dir from "ext:deno_node/_fs/_fs_dir.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
getOptions,
getValidatedPath,

View file

@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import * as io from "ext:deno_io/12_io.js";
import * as fs from "ext:deno_fs/30_fs.js";

View file

@ -9,7 +9,7 @@ import {
getEncoding,
TextOptionsArgument,
} from "ext:deno_node/_fs/_fs_common.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { readAll } from "ext:deno_io/12_io.js";
import { FileHandle } from "ext:deno_node/internal/fs/handle.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";

View file

@ -8,7 +8,7 @@ import { asyncIterableToCallback } from "ext:deno_node/_fs/_fs_watch.ts";
import Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { promisify } from "ext:deno_node/internal/util.mjs";
function toDirent(val: Deno.DirEntry): Dirent {

View file

@ -10,12 +10,12 @@ import {
validateRmOptions,
validateRmOptionsSync,
} from "ext:deno_node/internal/fs/utils.mjs";
import { toNamespacedPath } from "ext:deno_node/path.ts";
import { toNamespacedPath } from "node:path";
import {
denoErrorToNodeError,
ERR_FS_RMDIR_ENOTDIR,
} from "ext:deno_node/internal/errors.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { promisify } from "ext:deno_node/internal/util.mjs";
type rmdirOptions = {

View file

@ -3,15 +3,15 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { basename } from "ext:deno_node/path.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { basename } from "node:path";
import { EventEmitter } from "node:events";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { promisify } from "ext:deno_node/util.ts";
import { promisify } from "node:util";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { stat, Stats } from "ext:deno_node/_fs/_fs_stat.ts";
import { Stats as StatsClass } from "ext:deno_node/internal/fs/utils.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { delay } from "ext:deno_node/_util/async.ts";
const statPromisified = promisify(stat);

View file

@ -4,7 +4,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { validateEncoding, validateInteger } from "ext:deno_node/internal/validators.mjs";
import * as io from "ext:deno_io/12_io.js";
import * as fs from "ext:deno_fs/30_fs.js";

View file

@ -5,7 +5,7 @@
import { Encodings } from "ext:deno_node/_utils.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
CallbackWithError,
checkEncoding,

View file

@ -4,7 +4,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { validateBufferArray } from "ext:deno_node/internal/fs/utils.mjs";
import { getValidatedFd } from "ext:deno_node/internal/fs/utils.mjs";
import { maybeCallback } from "ext:deno_node/_fs/_fs_common.ts";

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { EventEmitter } from "ext:deno_node/_events.d.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
/** One of:
* | "ascii"

View file

@ -4,13 +4,13 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import * as net from "ext:deno_node/net.ts";
import EventEmitter from "ext:deno_node/events.ts";
import * as net from "node:net";
import EventEmitter from "node:events";
import { debuglog } from "ext:deno_node/internal/util/debuglog.ts";
let debug = debuglog("http", (fn) => {
debug = fn;
});
import { AsyncResource } from "ext:deno_node/async_hooks.ts";
import { AsyncResource } from "node:async_hooks";
import { symbols } from "ext:deno_node/internal/async_hooks.ts";
// deno-lint-ignore camelcase
const { async_id_symbol } = symbols;

View file

@ -7,17 +7,17 @@
const core = globalThis.__bootstrap.core;
import { getDefaultHighWaterMark } from "ext:deno_node/internal/streams/state.mjs";
import assert from "ext:deno_node/internal/assert.mjs";
import EE from "ext:deno_node/events.ts";
import { Stream } from "ext:deno_node/stream.ts";
import { deprecate } from "ext:deno_node/util.ts";
import type { Socket } from "ext:deno_node/net.ts";
import EE from "node:events";
import { Stream } from "node:stream";
import { deprecate } from "node:util";
import type { Socket } from "node:net";
import {
kNeedDrain,
kOutHeaders,
// utcDate,
} from "ext:deno_node/internal/http.ts";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
_checkInvalidHeaderChar as checkInvalidHeaderChar,
_checkIsHttpToken as checkIsHttpToken,

View file

@ -4,14 +4,14 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
clearLine,
clearScreenDown,
cursorTo,
moveCursor,
} from "ext:deno_node/internal/readline/callbacks.mjs";
import { Duplex, Readable, Writable } from "ext:deno_node/stream.ts";
import { Duplex, Readable, Writable } from "node:stream";
import { isWindows } from "ext:deno_node/_util/os.ts";
import { fs as fsConstants } from "ext:deno_node/internal_binding/constants.ts";
import * as io from "ext:deno_io/12_io.js";

View file

@ -6,7 +6,7 @@
import { Abortable, EventEmitter } from "ext:deno_node/_events.d.ts";
import * as promises from "ext:deno_node/readline/promises.ts";
import { ReadableStream, WritableStream } from "ext:deno_node/_global.d.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import type {
AsyncCompleter,
Completer,

View file

@ -35,7 +35,7 @@ import promises from "ext:deno_node/readline/promises.ts";
import { validateAbortSignal } from "ext:deno_node/internal/validators.mjs";
import { promisify } from "ext:deno_node/internal/util.mjs";
import { AbortError } from "ext:deno_node/internal/errors.ts";
import process from "ext:deno_node/process.ts";
import process from "node:process";
import {
Interface as _Interface,

View file

@ -3,7 +3,7 @@
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4f538975138678878fed5b2555c0672aa578ab7d/types/node/stream.d.ts
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { Abortable, EventEmitter } from "ext:deno_node/_events.d.ts";
import {
Buffered,

View file

@ -5,7 +5,7 @@
import { nextTick } from "ext:deno_node/_next_tick.ts";
import { AbortController } from "ext:deno_web/03_abort_signal.js";
import { Blob } from "ext:deno_web/09_file.js";
import { StringDecoder } from "ext:deno_node/string_decoder.ts";
import { StringDecoder } from "node:string_decoder";
import {
createDeferredPromise,
kEmptyObject,
@ -49,9 +49,9 @@ import {
// $ esbuild --bundle --legal-comments=none --target=es2022 --tree-shaking=true --format=esm .
// ... then making sure the file uses the existing ext:deno_node stuff instead of bundling it
const __process$ = { nextTick };
import __buffer$ from "ext:deno_node/buffer.ts";
import __string_decoder$ from "ext:deno_node/string_decoder.ts";
import __events$ from "ext:deno_node/events.ts";
import __buffer$ from "node:buffer";
import __string_decoder$ from "node:string_decoder";
import __events$ from "node:events";
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) =>
@ -5722,7 +5722,7 @@ import {
isWritable,
isWritableEnded,
} from "ext:deno_node/internal/streams/utils.mjs";
import { ReadableStream, WritableStream } from "ext:deno_node/stream/web.ts";
import { ReadableStream, WritableStream } from "node:stream/web";
import {
validateBoolean,
validateObject,

View file

@ -9,11 +9,11 @@ import {
StringPrototypeReplace,
} from "ext:deno_node/internal/primordials.mjs";
import assert from "ext:deno_node/internal/assert.mjs";
import * as net from "ext:deno_node/net.ts";
import * as net from "node:net";
import { createSecureContext } from "ext:deno_node/_tls_common.ts";
import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts";
import { connResetException } from "ext:deno_node/internal/errors.ts";
import { emitWarning } from "ext:deno_node/process.ts";
import { emitWarning } from "node:process";
import { debuglog } from "ext:deno_node/internal/util/debuglog.ts";
import {
constants as TCPConstants,
@ -23,7 +23,7 @@ import {
constants as PipeConstants,
Pipe,
} from "ext:deno_node/internal_binding/pipe_wrap.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { nextTick } from "ext:deno_node/_next_tick.ts";

View file

@ -4,11 +4,11 @@
// deno-lint-ignore-file
import { Buffer, kMaxLength } from "ext:deno_node/buffer.ts";
import { Transform } from "ext:deno_node/stream.ts";
import { Buffer, kMaxLength } from "node:buffer";
import { Transform } from "node:stream";
import * as binding from "ext:deno_node/_zlib_binding.mjs";
import util from "ext:deno_node/util.ts";
import { ok as assert } from "ext:deno_node/assert.ts";
import util from "node:util";
import { ok as assert } from "node:assert";
import { zlib as zlibConstants } from "ext:deno_node/internal_binding/constants.ts";
import { nextTick } from "ext:deno_node/_next_tick.ts";

View file

@ -8,7 +8,7 @@ import {
AssertionErrorConstructorOptions,
} from "ext:deno_node/assertion_error.ts";
import * as asserts from "ext:deno_node/_util/std_asserts.ts";
import { inspect } from "ext:deno_node/util.ts";
import { inspect } from "node:util";
import {
ERR_AMBIGUOUS_ARGUMENT,
ERR_INVALID_ARG_TYPE,

View file

@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { strict } from "ext:deno_node/assert.ts";
import { strict } from "node:assert";
export {
AssertionError,
@ -20,7 +20,7 @@ export {
rejects,
strictEqual,
throws,
} from "ext:deno_node/assert.ts";
} from "node:assert";
export { strict };
export default strict;

View file

@ -24,7 +24,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { inspect } from "ext:deno_node/util.ts";
import { inspect } from "node:util";
import { stripColor as removeColors } from "ext:deno_node/_util/std_fmt_colors.ts";
import * as io from "ext:deno_io/12_io.js";

View file

@ -38,10 +38,10 @@ import {
ObjectAssign,
StringPrototypeSlice,
} from "ext:deno_node/internal/primordials.mjs";
import { getSystemErrorName, promisify } from "ext:deno_node/util.ts";
import { getSystemErrorName, promisify } from "node:util";
import { createDeferredPromise } from "ext:deno_node/internal/util.mjs";
import process from "ext:deno_node/process.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import process from "node:process";
import { Buffer } from "node:buffer";
import {
convertToValidSignal,
kEmptyObject,

View file

@ -2,8 +2,8 @@
// Based on: https://github.com/nodejs/node/blob/0646eda/lib/constants.js
import { constants as fsConstants } from "ext:deno_node/fs.ts";
import { constants as osConstants } from "ext:deno_node/os.ts";
import { constants as fsConstants } from "node:fs";
import { constants as osConstants } from "node:os";
export default {
...fsConstants,

View file

@ -23,9 +23,9 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { lookup as defaultLookup } from "ext:deno_node/dns.ts";
import { Buffer } from "node:buffer";
import { EventEmitter } from "node:events";
import { lookup as defaultLookup } from "node:dns";
import type {
ErrnoException,
NodeSystemErrorCtx,
@ -62,8 +62,8 @@ import {
} from "ext:deno_node/internal/validators.mjs";
import { guessHandleType } from "ext:deno_node/internal_binding/util.ts";
import { os } from "ext:deno_node/internal_binding/constants.ts";
import { nextTick } from "ext:deno_node/process.ts";
import { channel } from "ext:deno_node/diagnostics_channel.ts";
import { nextTick } from "node:process";
import { channel } from "node:diagnostics_channel";
import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts";
const { UV_UDP_REUSEADDR, UV_UDP_IPV6ONLY } = os;

View file

@ -5,7 +5,7 @@
import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { nextTick } from "ext:deno_node/process.ts";
import { nextTick } from "node:process";
type Subscriber = (message: unknown, name?: string) => void;

View file

@ -92,7 +92,7 @@ import {
GetAddrInfoReqWrap,
QueryReqWrap,
} from "ext:deno_node/internal_binding/cares_wrap.ts";
import { toASCII } from "ext:deno_node/punycode.ts";
import { toASCII } from "node:punycode";
import { notImplemented } from "ext:deno_node/_utils.ts";
function onlookup(

View file

@ -19,7 +19,7 @@
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
import { promises } from "ext:deno_node/dns.ts";
import { promises } from "node:dns";
export const {
getServers,
lookup,

View file

@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { promises as fsPromises } from "ext:deno_node/fs.ts";
import { promises as fsPromises } from "node:fs";
export const access = fsPromises.access;
export const copyFile = fsPromises.copyFile;

View file

@ -13,10 +13,10 @@ import {
// createConnection,
ListenOptions,
Socket,
} from "ext:deno_node/net.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
} from "node:net";
import { Buffer } from "node:buffer";
import { ERR_SERVER_NOT_RUNNING } from "ext:deno_node/internal/errors.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
import { nextTick } from "ext:deno_node/_next_tick.ts";
import {
validateBoolean,
@ -29,13 +29,13 @@ import {
finished,
Readable as NodeReadable,
Writable as NodeWritable,
} from "ext:deno_node/stream.ts";
} from "node:stream";
import {
OutgoingMessage,
parseUniqueHeadersOption,
validateHeaderName,
} from "ext:deno_node/_http_outgoing.ts";
import { ok as assert } from "ext:deno_node/assert.ts";
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";

View file

@ -5,12 +5,12 @@
// deno-lint-ignore-file prefer-primordials
import { notImplemented, warnNotImplemented } from "ext:deno_node/_utils.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Server, Socket, TCP } from "ext:deno_node/net.ts";
import { EventEmitter } from "node:events";
import { Buffer } from "node:buffer";
import { Server, Socket, TCP } from "node:net";
import { TypedArray } from "ext:deno_node/internal/util/types.ts";
import { setStreamTimeout } from "ext:deno_node/internal/stream_base_commons.ts";
import { FileHandle } from "ext:deno_node/fs/promises.ts";
import { FileHandle } from "node:fs/promises";
import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts";
import { addTrailers, serveHttpOnConnection } from "ext:deno_http/00_serve.js";
import { type Deferred, deferred } from "ext:deno_node/_util/async.ts";

View file

@ -10,16 +10,13 @@ import {
ClientRequest,
IncomingMessageForClient as IncomingMessage,
type RequestOptions,
} from "ext:deno_node/http.ts";
} from "node:http";
import { Agent as HttpAgent } from "ext:deno_node/_http_agent.mjs";
import { createHttpClient } from "ext:deno_fetch/22_http_client.js";
import {
type ServerHandler,
ServerImpl as HttpServer,
} from "ext:deno_node/http.ts";
import { type ServerHandler, ServerImpl as HttpServer } from "node:http";
import { validateObject } from "ext:deno_node/internal/validators.mjs";
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
export class Server extends HttpServer {
constructor(opts, requestListener?: ServerHandler) {

View file

@ -4,7 +4,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
import { notImplemented } from "ext:deno_node/_utils.ts";
const connectionSymbol = Symbol("connectionProperty");

View file

@ -7,10 +7,10 @@
// deno-lint-ignore-file prefer-primordials
import { assert } from "ext:deno_node/_util/asserts.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
import { os } from "ext:deno_node/internal_binding/constants.ts";
import { notImplemented, warnNotImplemented } from "ext:deno_node/_utils.ts";
import { Readable, Stream, Writable } from "ext:deno_node/stream.ts";
import { Readable, Stream, Writable } from "node:stream";
import { deferred } from "ext:deno_node/_util/async.ts";
import { isWindows } from "ext:deno_node/_util/os.ts";
import { nextTick } from "ext:deno_node/_next_tick.ts";
@ -20,7 +20,7 @@ import {
ERR_INVALID_ARG_VALUE,
ERR_UNKNOWN_SIGNAL,
} from "ext:deno_node/internal/errors.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { errnoException } from "ext:deno_node/internal/errors.ts";
import { ErrnoException } from "ext:deno_node/_global.d.ts";
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
@ -43,7 +43,7 @@ import {
} from "ext:deno_node/internal/primordials.mjs";
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import process from "ext:deno_node/process.ts";
import process from "node:process";
export function mapValues<T, O>(
record: Readonly<Record<string, T>>,

View file

@ -28,7 +28,7 @@ const previewEntries = (iter, isKeyValue) => {
return [...iter];
}
};
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
const { isBuffer } = Buffer;
import { formatWithOptions, inspect } from "ext:deno_node/internal/util/inspect.mjs";
import {

View file

@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
export const MAX_RANDOM_VALUES = 65536;
export const MAX_SIZE = 4294967295;

View file

@ -6,7 +6,7 @@
import {
MAX_SIZE as kMaxUint32,
} from "ext:deno_node/internal/crypto/_randomBytes.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
const { core } = globalThis.__bootstrap;
const { ops } = core;

View file

@ -2,7 +2,7 @@
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
import { notImplemented } from "ext:deno_node/_utils.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { BinaryLike } from "ext:deno_node/internal/crypto/types.ts";
export class Certificate {

View file

@ -9,7 +9,7 @@ import {
validateInt32,
validateObject,
} from "ext:deno_node/internal/validators.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { notImplemented } from "ext:deno_node/_utils.ts";
import type { TransformOptions } from "ext:deno_node/_stream.d.ts";
import { Transform } from "ext:deno_node/_stream.mjs";

View file

@ -18,7 +18,7 @@ import {
validateInt32,
validateString,
} from "ext:deno_node/internal/validators.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
EllipticCurve,
ellipticCurves,

View file

@ -5,8 +5,8 @@
// deno-lint-ignore-file prefer-primordials
import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Transform } from "ext:deno_node/stream.ts";
import { Buffer } from "node:buffer";
import { Transform } from "node:stream";
import {
forgivingBase64Encode as encodeToBase64,
forgivingBase64UrlEncode as encodeToBase64Url,

View file

@ -26,7 +26,7 @@ import {
validateString,
validateUint32,
} from "ext:deno_node/internal/validators.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { KeyFormat, KeyType } from "ext:deno_node/internal/crypto/types.ts";
const { core } = globalThis.__bootstrap;

View file

@ -20,7 +20,7 @@ import type {
PrivateKeyInput,
PublicKeyInput,
} from "ext:deno_node/internal/crypto/types.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
isAnyArrayBuffer,
isArrayBufferView,

View file

@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { HASH_DATA } from "ext:deno_node/internal/crypto/types.ts";
const { core } = globalThis.__bootstrap;

View file

@ -26,7 +26,7 @@ SOFTWARE.
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { HASH_DATA } from "ext:deno_node/internal/crypto/types.ts";
const { core } = globalThis.__bootstrap;

View file

@ -9,7 +9,7 @@ import {
validateFunction,
validateString,
} from "ext:deno_node/internal/validators.mjs";
import { Buffer } from "ext:deno_node/buffer.ts";
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 type {

View file

@ -5,7 +5,7 @@
// deno-lint-ignore-file prefer-primordials
import { notImplemented } from "ext:deno_node/_utils.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
ERR_INVALID_ARG_TYPE,
hideStackFrames,

View file

@ -5,7 +5,7 @@
// deno-lint-ignore-file prefer-primordials
import { KeyObject } from "ext:deno_node/internal/crypto/keys.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts";
import { validateString } from "ext:deno_node/internal/validators.mjs";

View file

@ -23,7 +23,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { lookup as defaultLookup } from "ext:deno_node/dns.ts";
import { lookup as defaultLookup } from "node:dns";
import {
isInt32,
validateFunction,

View file

@ -59,7 +59,7 @@ import {
GetAddrInfoReqWrap,
QueryReqWrap,
} from "ext:deno_node/internal_binding/cares_wrap.ts";
import { toASCII } from "ext:deno_node/punycode.ts";
import { toASCII } from "node:punycode";
function onlookup(
this: GetAddrInfoReqWrap,

View file

@ -24,7 +24,7 @@
// deno-lint-ignore-file prefer-primordials
import { getOptionValue } from "ext:deno_node/internal/options.ts";
import { emitWarning } from "ext:deno_node/process.ts";
import { emitWarning } from "node:process";
import {
AI_ADDRCONFIG,
AI_ALL,

View file

@ -11,7 +11,7 @@ import {
ERR_MISSING_ARGS,
} from "ext:deno_node/internal/errors.ts";
import { validateObject, validateString } from "ext:deno_node/internal/validators.mjs";
import { emitWarning } from "ext:deno_node/process.ts";
import { emitWarning } from "node:process";
import { nextTick } from "ext:deno_node/_next_tick.ts";
import { Event as WebEvent, EventTarget as WebEventTarget } from "ext:deno_web/02_event.js";
@ -20,12 +20,12 @@ import {
kEmptyObject,
kEnumerableProperty,
} from "ext:deno_node/internal/util.mjs";
import { inspect } from "ext:deno_node/util.ts";
import { inspect } from "node:util";
const kIsEventTarget = Symbol.for("nodejs.event_target");
const kIsNodeEventTarget = Symbol("kIsNodeEventTarget");
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
const {
kMaxEventTargetListeners,
kMaxEventTargetListenersWarned,

View file

@ -3,9 +3,9 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { EventEmitter } from "ext:deno_node/events.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { promises, read, write } from "ext:deno_node/fs.ts";
import { EventEmitter } from "node:events";
import { Buffer } from "node:buffer";
import { promises, read, write } from "node:fs";
import {
BinaryOptionsArgument,
FileOptionsArgument,

View file

@ -3,9 +3,9 @@
// deno-lint-ignore-file no-explicit-any
import * as stream from "ext:deno_node/_stream.d.ts";
import * as promises from "ext:deno_node/fs/promises.ts";
import * as promises from "node:fs/promises";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { BufferEncoding, ErrnoException } from "ext:deno_node/_global.d.ts";
type PathLike = string | Buffer | URL;

View file

@ -6,7 +6,7 @@
import { ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE } from "ext:deno_node/internal/errors.ts";
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { deprecate } from "ext:deno_node/util.ts";
import { deprecate } from "node:util";
import { validateFunction, validateInteger } from "ext:deno_node/internal/validators.mjs";
import { errorOrDestroy } from "ext:deno_node/internal/streams/destroy.mjs";
import { open as fsOpen } from "ext:deno_node/_fs/_fs_open.ts";
@ -14,14 +14,14 @@ import { read as fsRead } from "ext:deno_node/_fs/_fs_read.ts";
import { write as fsWrite } from "ext:deno_node/_fs/_fs_write.mjs";
import { writev as fsWritev } from "ext:deno_node/_fs/_fs_writev.mjs";
import { close as fsClose } from "ext:deno_node/_fs/_fs_close.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
copyObject,
getOptions,
getValidatedFd,
validatePath,
} from "ext:deno_node/internal/fs/utils.mjs";
import { finished, Readable, Writable } from "ext:deno_node/stream.ts";
import { finished, Readable, Writable } from "node:stream";
import { toPathIfFileURL } from "ext:deno_node/internal/url.ts";
import { nextTick } from "ext:deno_node/_next_tick.ts";
const kIoDone = Symbol("kIoDone");

View file

@ -5,7 +5,7 @@
"use strict";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
ERR_FS_EISDIR,
ERR_FS_INVALID_SYMLINK_TYPE,
@ -23,7 +23,7 @@ import {
isUint8Array,
} from "ext:deno_node/internal/util/types.ts";
import { once } from "ext:deno_node/internal/util.mjs";
import { deprecate } from "ext:deno_node/util.ts";
import { deprecate } from "node:util";
import { toPathIfFileURL } from "ext:deno_node/internal/url.ts";
import {
validateAbortSignal,
@ -34,14 +34,14 @@ import {
validateObject,
validateUint32,
} from "ext:deno_node/internal/validators.mjs";
import pathModule from "ext:deno_node/path.ts";
import pathModule from "node:path";
const kType = Symbol("type");
const kStats = Symbol("stats");
import assert from "ext:deno_node/internal/assert.mjs";
import { lstat, lstatSync } from "ext:deno_node/_fs/_fs_lstat.ts";
import { stat, statSync } from "ext:deno_node/_fs/_fs_stat.ts";
import { isWindows } from "ext:deno_node/_util/os.ts";
import process from "ext:deno_node/process.ts";
import process from "node:process";
import {
fs as fsConstants,

View file

@ -4,7 +4,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { setUnrefTimeout } from "ext:deno_node/timers.ts";
import { setUnrefTimeout } from "node:timers";
import { notImplemented } from "ext:deno_node/_utils.ts";
let utcCache: string | undefined;

View file

@ -23,7 +23,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { uvException } from "ext:deno_node/internal/errors.ts";
import { writeBuffer } from "ext:deno_node/internal_binding/node_file.ts";

View file

@ -25,13 +25,13 @@
import { charLengthAt, CSI, emitKeys } from "ext:deno_node/internal/readline/utils.mjs";
import { kSawKeyPress } from "ext:deno_node/internal/readline/symbols.mjs";
import { clearTimeout, setTimeout } from "ext:deno_node/timers.ts";
import { clearTimeout, setTimeout } from "node:timers";
const {
kEscape,
} = CSI;
import { StringDecoder } from "ext:deno_node/string_decoder.ts";
import { StringDecoder } from "node:string_decoder";
const KEYPRESS_DECODER = Symbol("keypress-decoder");
const ESCAPE_DECODER = Symbol("escape-decoder");

View file

@ -36,7 +36,7 @@ import {
getStringWidth,
stripVTControlCharacters,
} from "ext:deno_node/internal/util/inspect.mjs";
import EventEmitter from "ext:deno_node/events.ts";
import EventEmitter from "node:events";
import { emitKeypressEvents } from "ext:deno_node/internal/readline/emitKeypressEvents.mjs";
import {
charLengthAt,
@ -46,9 +46,9 @@ import {
} from "ext:deno_node/internal/readline/utils.mjs";
import { clearScreenDown, cursorTo, moveCursor } from "ext:deno_node/internal/readline/callbacks.mjs";
import { Readable } from "ext:deno_node/_stream.mjs";
import process from "ext:deno_node/process.ts";
import process from "node:process";
import { StringDecoder } from "ext:deno_node/string_decoder.ts";
import { StringDecoder } from "node:string_decoder";
import {
kAddHistory,
kDecoder,

View file

@ -35,10 +35,10 @@ import {
import { isUint8Array } from "ext:deno_node/internal/util/types.ts";
import { errnoException } from "ext:deno_node/internal/errors.ts";
import { getTimerDuration, kTimeout } from "ext:deno_node/internal/timers.mjs";
import { setUnrefTimeout } from "ext:deno_node/timers.ts";
import { setUnrefTimeout } from "node:timers";
import { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
export const kMaybeDestroy = Symbol("kMaybeDestroy");
export const kUpdateTimer = Symbol("kUpdateTimer");

View file

@ -2,7 +2,7 @@
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
// deno-lint-ignore-file
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { inspect } from "ext:deno_node/internal/util/inspect.mjs";
class BufferList {

View file

@ -3,7 +3,7 @@
// deno-lint-ignore-file
import { getDefaultEncoding } from "ext:deno_node/internal/crypto/util.ts";
import stream from "ext:deno_node/stream.ts";
import stream from "node:stream";
function LazyTransform(options) {
this._options = options;

View file

@ -7,7 +7,7 @@
import { inspect } from "ext:deno_node/internal/util/inspect.mjs";
import { validateFunction, validateNumber } from "ext:deno_node/internal/validators.mjs";
import { ERR_OUT_OF_RANGE } from "ext:deno_node/internal/errors.ts";
import { emitWarning } from "ext:deno_node/process.ts";
import { emitWarning } from "node:process";
import {
setTimeout as setTimeout_,
clearTimeout as clearTimeout_,

View file

@ -3,8 +3,8 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { fileURLToPath } from "ext:deno_node/url.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { fileURLToPath } from "node:url";
import { Buffer } from "node:buffer";
const searchParams = Symbol("query");

View file

@ -21,7 +21,7 @@ import {
isTypedArray,
} from "ext:deno_node/internal/util/types.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
getOwnNonIndexProperties,
ONLY_ENUMERABLE,

View file

@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
function assert(cond) {
if (!cond) {

View file

@ -31,7 +31,7 @@
// deno-lint-ignore-file prefer-primordials
import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { HandleWrap } from "ext:deno_node/internal_binding/handle_wrap.ts";
import {

View file

@ -34,7 +34,7 @@ import { HandleWrap } from "ext:deno_node/internal_binding/handle_wrap.ts";
import { ownerSymbol } from "ext:deno_node/internal_binding/symbols.ts";
import { codeMap, errorMap } from "ext:deno_node/internal_binding/uv.ts";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import type { ErrnoException } from "ext:deno_node/internal/errors.ts";
import { isIP } from "ext:deno_node/internal/net.ts";
import * as net from "ext:deno_net/01_net.js";

View file

@ -24,14 +24,14 @@
// deno-lint-ignore-file prefer-primordials
import { notImplemented } from "ext:deno_node/_utils.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
import {
isIP,
isIPv4,
isIPv6,
normalizedArgsSymbol,
} from "ext:deno_node/internal/net.ts";
import { Duplex } from "ext:deno_node/stream.ts";
import { Duplex } from "node:stream";
import {
asyncIdSymbol,
defaultTriggerAsyncIdScope,
@ -74,7 +74,7 @@ import {
DTRACE_NET_SERVER_CONNECTION,
DTRACE_NET_STREAM_END,
} from "ext:deno_node/internal/dtrace.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import type { LookupOneOptions } from "ext:deno_node/internal/dns/utils.ts";
import {
validateAbortSignal,
@ -97,14 +97,14 @@ import {
import { ShutdownWrap } from "ext:deno_node/internal_binding/stream_wrap.ts";
import { assert } from "ext:deno_node/_util/asserts.ts";
import { isWindows } from "ext:deno_node/_util/os.ts";
import { ADDRCONFIG, lookup as dnsLookup } from "ext:deno_node/dns.ts";
import { ADDRCONFIG, lookup as dnsLookup } from "node:dns";
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
import { guessHandleType } from "ext:deno_node/internal_binding/util.ts";
import { debuglog } from "ext:deno_node/internal/util/debuglog.ts";
import type { DuplexOptions } from "ext:deno_node/_stream.d.ts";
import type { BufferEncoding } from "ext:deno_node/_global.d.ts";
import type { Abortable } from "ext:deno_node/_events.d.ts";
import { channel } from "ext:deno_node/diagnostics_channel.ts";
import { channel } from "node:diagnostics_channel";
let debug = debuglog("net", (fn) => {
debug = fn;

View file

@ -25,7 +25,7 @@
import { notImplemented } from "ext:deno_node/_utils.ts";
import { validateIntegerRange } from "ext:deno_node/_utils.ts";
import process from "ext:deno_node/process.ts";
import process from "node:process";
import { isWindows, osType } from "ext:deno_node/_util/os.ts";
import { os } from "ext:deno_node/internal_binding/constants.ts";
import { osUptime } from "ext:runtime/30_os.js";

View file

@ -7,7 +7,7 @@
const internals = globalThis.__bootstrap.internals;
const { core } = globalThis.__bootstrap;
import { notImplemented, warnNotImplemented } from "ext:deno_node/_utils.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { EventEmitter } from "node:events";
import { validateString } from "ext:deno_node/internal/validators.mjs";
import {
ERR_INVALID_ARG_TYPE,
@ -16,7 +16,7 @@ import {
} from "ext:deno_node/internal/errors.ts";
import { getOptionValue } from "ext:deno_node/internal/options.ts";
import { assert } from "ext:deno_node/_util/asserts.ts";
import { join } from "ext:deno_node/path.ts";
import { join } from "node:path";
import { pathFromURL } from "ext:deno_web/00_infra.js";
import {
arch as arch_,

View file

@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import { encodeStr, hexTable } from "ext:deno_node/internal/querystring.ts";
/**

View file

@ -5,7 +5,7 @@
// deno-lint-ignore-file prefer-primordials
import { TextDecoder } from "ext:deno_web/08_text_encoding.js";
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
/**
* @typedef {import('../_global.d.ts').ReadableStream

View file

@ -23,7 +23,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts";
import { Buffer } from "node:buffer";
import {
normalizeEncoding as castEncoding,
notImplemented,

View file

@ -1,3 +1,3 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
export * from "ext:deno_node/util.ts";
export { default } from "ext:deno_node/util.ts";
export * from "node:util";
export { default } from "node:util";

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { promisify } from "ext:deno_node/util.ts";
import timers from "ext:deno_node/timers.ts";
import { promisify } from "node:util";
import timers from "node:timers";
export const setTimeout = promisify(timers.setTimeout),
setImmediate = promisify(timers.setImmediate),

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Socket } from "ext:deno_node/net.ts";
import { Socket } from "node:net";
// Returns true when the given numeric fd is associated with a TTY and false otherwise.
function isatty(fd: number) {

View file

@ -69,15 +69,12 @@ import {
CHAR_VERTICAL_LINE,
CHAR_ZERO_WIDTH_NOBREAK_SPACE,
} from "ext:deno_node/path/_constants.ts";
import * as path from "ext:deno_node/path.ts";
import { toASCII, toUnicode } from "ext:deno_node/punycode.ts";
import * as path from "node:path";
import { toASCII, toUnicode } from "node:punycode";
import { isWindows, osType } from "ext:deno_node/_util/os.ts";
import { encodeStr, hexTable } from "ext:deno_node/internal/querystring.ts";
import querystring from "ext:deno_node/querystring.ts";
import type {
ParsedUrlQuery,
ParsedUrlQueryInput,
} from "ext:deno_node/querystring.ts";
import querystring from "node:querystring";
import type { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
import { URL, URLSearchParams } from "ext:deno_url/00_url.js";
const forwardSlashRegEx = /\//g;

View file

@ -13,10 +13,10 @@ import {
stripVTControlCharacters,
} from "ext:deno_node/internal/util/inspect.mjs";
import { codes } from "ext:deno_node/internal/error_codes.ts";
import types from "ext:deno_node/util/types.ts";
import { Buffer } from "ext:deno_node/buffer.ts";
import types from "node:util/types";
import { Buffer } from "node:buffer";
import { isDeepStrictEqual } from "ext:deno_node/internal/util/comparisons.ts";
import process from "ext:deno_node/process.ts";
import process from "node:process";
import { validateString } from "ext:deno_node/internal/validators.mjs";
export {

View file

@ -4,9 +4,9 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
import { isAbsolute, resolve } from "ext:deno_node/path.ts";
import { isAbsolute, resolve } from "node:path";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { EventEmitter, once } from "ext:deno_node/events.ts";
import { EventEmitter, once } from "node:events";
import { BroadcastChannel } from "ext:deno_broadcast_channel/01_broadcast_channel.js";
import { MessageChannel, MessagePort } from "ext:deno_web/13_message_port.js";

View file

@ -24,16 +24,23 @@ mod startup_snapshot {
fn transpile_ts_for_snapshotting(
file_source: &ExtensionFileSource,
) -> Result<ModuleCode, AnyError> {
let media_type = MediaType::from_path(Path::new(&file_source.specifier));
// Always transpile `node:` built-in modules, since they might be TypeScript.
let media_type = if file_source.specifier.starts_with("node:") {
MediaType::TypeScript
} else {
MediaType::from_path(Path::new(&file_source.specifier))
};
let should_transpile = match media_type {
MediaType::JavaScript => false,
MediaType::Mjs => false,
MediaType::TypeScript => true,
_ => panic!(
_ => {
panic!(
"Unsupported media type for snapshotting {media_type:?} for file {}",
file_source.specifier
),
)
}
};
let code = file_source.load()?;
@ -284,7 +291,6 @@ mod startup_snapshot {
runtime_main,
deps = [runtime],
customizer = |ext: &mut deno_core::ExtensionBuilder| {
eprintln!("I am here!!!");
ext.esm_entry_point("ext:runtime/90_deno_ns.js");
}
);

View file

@ -38,6 +38,7 @@ use deno_fs::FileSystem;
use deno_http::DefaultHttpPropertyExtractor;
use deno_io::Stdio;
use deno_kv::sqlite::SqliteDbHandler;
use deno_node::SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX;
use deno_tls::RootCertStoreProvider;
use deno_web::create_entangled_message_port;
use deno_web::BlobStore;
@ -484,14 +485,10 @@ impl WebWorker {
let startup_snapshot = options.startup_snapshot
.expect("deno_runtime startup snapshot is not available with 'create_runtime_snapshot' Cargo feature.");
// Clear extension modules from the module map, except preserve `ext:deno_node`
// Clear extension modules from the module map, except preserve `node:*`
// modules as `node:` specifiers.
let rename_modules = Some(
deno_node::SUPPORTED_BUILTIN_NODE_MODULES
.iter()
.map(|p| (p.ext_specifier, p.specifier))
.collect(),
);
let preserve_snapshotted_modules =
Some(SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX);
let mut js_runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(options.module_loader.clone()),
@ -502,7 +499,7 @@ impl WebWorker {
compiled_wasm_module_store: options.compiled_wasm_module_store.clone(),
extensions,
inspector: options.maybe_inspector_server.is_some(),
rename_modules,
preserve_snapshotted_modules,
..Default::default()
});

View file

@ -34,6 +34,7 @@ use deno_fs::FileSystem;
use deno_http::DefaultHttpPropertyExtractor;
use deno_io::Stdio;
use deno_kv::sqlite::SqliteDbHandler;
use deno_node::SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX;
use deno_tls::RootCertStoreProvider;
use deno_web::BlobStore;
use log::debug;
@ -313,14 +314,10 @@ impl MainWorker {
let startup_snapshot = options.startup_snapshot
.expect("deno_runtime startup snapshot is not available with 'create_runtime_snapshot' Cargo feature.");
// Clear extension modules from the module map, except preserve `ext:deno_node`
// modules as `node:` specifiers.
let rename_modules = Some(
deno_node::SUPPORTED_BUILTIN_NODE_MODULES
.iter()
.map(|p| (p.ext_specifier, p.specifier))
.collect(),
);
// Clear extension modules from the module map, except preserve `node:*`
// modules.
let preserve_snapshotted_modules =
Some(SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX);
let mut js_runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(options.module_loader.clone()),
@ -331,7 +328,7 @@ impl MainWorker {
shared_array_buffer_store: options.shared_array_buffer_store.clone(),
compiled_wasm_module_store: options.compiled_wasm_module_store.clone(),
extensions,
rename_modules,
preserve_snapshotted_modules,
inspector: options.maybe_inspector_server.is_some(),
is_main: true,
..Default::default()

View file

@ -52,27 +52,27 @@
"ext:deno_node/_utils.ts": "../ext/node/polyfills/_utils.ts",
"ext:deno_node/_zlib_binding.mjs": "../ext/node/polyfills/_zlib_binding.mjs",
"ext:deno_node/00_globals.js": "../ext/node/polyfills/00_globals.js",
"ext:deno_node/01_require.js": "../ext/node/polyfills/01_require.js",
"ext:deno_node/assert.ts": "../ext/node/polyfills/assert.ts",
"ext:deno_node/assert/strict.ts": "../ext/node/polyfills/assert/strict.ts",
"ext:deno_node/async_hooks.ts": "../ext/node/polyfills/async_hooks.ts",
"ext:deno_node/buffer.ts": "../ext/node/polyfills/buffer.ts",
"ext:deno_node/child_process.ts": "../ext/node/polyfills/child_process.ts",
"ext:deno_node/cluster.ts": "../ext/node/polyfills/cluster.ts",
"ext:deno_node/console.ts": "../ext/node/polyfills/console.ts",
"ext:deno_node/constants.ts": "../ext/node/polyfills/constants.ts",
"ext:deno_node/crypto.ts": "../ext/node/polyfills/crypto.ts",
"ext:deno_node/dgram.ts": "../ext/node/polyfills/dgram.ts",
"ext:deno_node/diagnostics_channel.ts": "../ext/node/polyfills/diagnostics_channel.ts",
"ext:deno_node/dns.ts": "../ext/node/polyfills/dns.ts",
"ext:deno_node/dns/promises.ts": "../ext/node/polyfills/dns/promises.ts",
"ext:deno_node/domain.ts": "../ext/node/polyfills/domain.ts",
"ext:deno_node/events.ts": "../ext/node/polyfills/events.ts",
"ext:deno_node/fs.ts": "../ext/node/polyfills/fs.ts",
"ext:deno_node/fs/promises.ts": "../ext/node/polyfills/fs/promises.ts",
"ext:deno_node/http.ts": "../ext/node/polyfills/http.ts",
"ext:deno_node/http2.ts": "../ext/node/polyfills/http2.ts",
"ext:deno_node/https.ts": "../ext/node/polyfills/https.ts",
"node:module": "../ext/node/polyfills/01_require.js",
"node:assert": "../ext/node/polyfills/assert.ts",
"node:assert/strict": "../ext/node/polyfills/assert/strict.ts",
"node:async_hooks": "../ext/node/polyfills/async_hooks.ts",
"node:buffer": "../ext/node/polyfills/buffer.ts",
"node:child_process": "../ext/node/polyfills/child_process.ts",
"node:cluster": "../ext/node/polyfills/cluster.ts",
"node:console": "../ext/node/polyfills/console.ts",
"node:constants": "../ext/node/polyfills/constants.ts",
"node:crypto": "../ext/node/polyfills/crypto.ts",
"node:dgram": "../ext/node/polyfills/dgram.ts",
"node:diagnostics_channel": "../ext/node/polyfills/diagnostics_channel.ts",
"node:dns": "../ext/node/polyfills/dns.ts",
"node:dns/promises": "../ext/node/polyfills/dns/promises.ts",
"node:domain": "../ext/node/polyfills/domain.ts",
"node:events": "../ext/node/polyfills/events.ts",
"node:fs": "../ext/node/polyfills/fs.ts",
"node:fs/promises": "../ext/node/polyfills/fs/promises.ts",
"node:http": "../ext/node/polyfills/http.ts",
"node:http2": "../ext/node/polyfills/http2.ts",
"node:https": "../ext/node/polyfills/https.ts",
"ext:deno_node/inspector.ts": "../ext/node/polyfills/inspector.ts",
"ext:deno_node/internal_binding/_libuv_winerror.ts": "../ext/node/polyfills/internal_binding/_libuv_winerror.ts",
"ext:deno_node/internal_binding/_listen.ts": "../ext/node/polyfills/internal_binding/_listen.ts",
@ -164,43 +164,43 @@
"ext:deno_node/internal/util/inspect.mjs": "../ext/node/polyfills/internal/util/inspect.mjs",
"ext:deno_node/internal/util/types.ts": "../ext/node/polyfills/internal/util/types.ts",
"ext:deno_node/internal/validators.mjs": "../ext/node/polyfills/internal/validators.mjs",
"ext:deno_node/net.ts": "../ext/node/polyfills/net.ts",
"ext:deno_node/os.ts": "../ext/node/polyfills/os.ts",
"ext:deno_node/path.ts": "../ext/node/polyfills/path.ts",
"node:net": "../ext/node/polyfills/net.ts",
"node:os": "../ext/node/polyfills/os.ts",
"node:path": "../ext/node/polyfills/path.ts",
"ext:deno_node/path/_constants.ts": "../ext/node/polyfills/path/_constants.ts",
"ext:deno_node/path/_interface.ts": "../ext/node/polyfills/path/_interface.ts",
"ext:deno_node/path/_posix.ts": "../ext/node/polyfills/path/_posix.ts",
"ext:deno_node/path/_util.ts": "../ext/node/polyfills/path/_util.ts",
"ext:deno_node/path/_win32.ts": "../ext/node/polyfills/path/_win32.ts",
"ext:deno_node/path/mod.ts": "../ext/node/polyfills/path/mod.ts",
"ext:deno_node/path/posix.ts": "../ext/node/polyfills/path/posix.ts",
"node:path/posix": "../ext/node/polyfills/path/posix.ts",
"ext:deno_node/path/separator.ts": "../ext/node/polyfills/path/separator.ts",
"ext:deno_node/path/win32.ts": "../ext/node/polyfills/path/win32.ts",
"ext:deno_node/perf_hooks.ts": "../ext/node/polyfills/perf_hooks.ts",
"ext:deno_node/process.ts": "../ext/node/polyfills/process.ts",
"ext:deno_node/punycode.ts": "../ext/node/polyfills/punycode.ts",
"ext:deno_node/querystring.ts": "../ext/node/polyfills/querystring.ts",
"ext:deno_node/readline.ts": "../ext/node/polyfills/readline.ts",
"node:path/win32": "../ext/node/polyfills/path/win32.ts",
"node:perf_hooks": "../ext/node/polyfills/perf_hooks.ts",
"node:process": "../ext/node/polyfills/process.ts",
"node:punycode": "../ext/node/polyfills/punycode.ts",
"node:querystring": "../ext/node/polyfills/querystring.ts",
"node:readline": "../ext/node/polyfills/readline.ts",
"ext:deno_node/readline/promises.ts": "../ext/node/polyfills/readline/promises.ts",
"ext:deno_node/repl.ts": "../ext/node/polyfills/repl.ts",
"ext:deno_node/stream.ts": "../ext/node/polyfills/stream.ts",
"ext:deno_node/stream/consumers.mjs": "../ext/node/polyfills/stream/consumers.mjs",
"ext:deno_node/stream/promises.mjs": "../ext/node/polyfills/stream/promises.mjs",
"ext:deno_node/stream/web.ts": "../ext/node/polyfills/stream/web.ts",
"ext:deno_node/string_decoder.ts": "../ext/node/polyfills/string_decoder.ts",
"ext:deno_node/sys.ts": "../ext/node/polyfills/sys.ts",
"ext:deno_node/timers.ts": "../ext/node/polyfills/timers.ts",
"ext:deno_node/timers/promises.ts": "../ext/node/polyfills/timers/promises.ts",
"ext:deno_node/tls.ts": "../ext/node/polyfills/tls.ts",
"ext:deno_node/tty.ts": "../ext/node/polyfills/tty.ts",
"ext:deno_node/url.ts": "../ext/node/polyfills/url.ts",
"ext:deno_node/util.ts": "../ext/node/polyfills/util.ts",
"ext:deno_node/util/types.ts": "../ext/node/polyfills/util/types.ts",
"ext:deno_node/v8.ts": "../ext/node/polyfills/v8.ts",
"ext:deno_node/vm.ts": "../ext/node/polyfills/vm.ts",
"node:stream": "../ext/node/polyfills/stream.ts",
"node:stream/consumers": "../ext/node/polyfills/stream/consumers.mjs",
"node:stream/promises": "../ext/node/polyfills/stream/promises.mjs",
"node:stream/web": "../ext/node/polyfills/stream/web.ts",
"node:string_decoder": "../ext/node/polyfills/string_decoder.ts",
"node:sys": "../ext/node/polyfills/sys.ts",
"node:timers": "../ext/node/polyfills/timers.ts",
"node:timers/promises": "../ext/node/polyfills/timers/promises.ts",
"node:tls": "../ext/node/polyfills/tls.ts",
"node:tty": "../ext/node/polyfills/tty.ts",
"node:url": "../ext/node/polyfills/url.ts",
"node:util": "../ext/node/polyfills/util.ts",
"node:util/types": "../ext/node/polyfills/util/types.ts",
"node:v8": "../ext/node/polyfills/v8.ts",
"node:vm": "../ext/node/polyfills/vm.ts",
"ext:deno_node/wasi.ts": "../ext/node/polyfills/wasi.ts",
"ext:deno_node/worker_threads.ts": "../ext/node/polyfills/worker_threads.ts",
"ext:deno_node/zlib.ts": "../ext/node/polyfills/zlib.ts",
"node:worker_threads": "../ext/node/polyfills/worker_threads.ts",
"node:zlib": "../ext/node/polyfills/zlib.ts",
"ext:deno_url/00_url.js": "../ext/url/00_url.js",
"ext:deno_url/01_urlpattern.js": "../ext/url/01_urlpattern.js",
"ext:deno_web/00_infra.js": "../ext/web/00_infra.js",