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

View file

@ -41,9 +41,9 @@ repository = "https://github.com/denoland/deno"
v8 = { version = "0.74.1", default-features = false } v8 = { version = "0.74.1", default-features = false }
deno_ast = { version = "0.27.0", features = ["transpiling"] } deno_ast = { version = "0.27.0", features = ["transpiling"] }
deno_core = { version = "0.193.0" } deno_core = { version = "0.194.0" }
deno_ops = { version = "0.70.0" } deno_ops = { version = "0.71.0" }
serde_v8 = { version = "0.103.0" } serde_v8 = { version = "0.104.0" }
deno_runtime = { version = "0.117.0", path = "./runtime" } deno_runtime = { version = "0.117.0", path = "./runtime" }
napi_sym = { version = "0.39.0", path = "./cli/napi/sym" } 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 { fn op_build_info(state: &mut OpState) -> Value {
let build_specifier = "asset:///bootstrap.ts"; let build_specifier = "asset:///bootstrap.ts";
let node_built_in_module_names = SUPPORTED_BUILTIN_NODE_MODULES let node_built_in_module_names = SUPPORTED_BUILTIN_NODE_MODULES.to_vec();
.iter()
.map(|p| p.module_name())
.collect::<Vec<&str>>();
let build_libs = state.borrow::<Vec<&str>>(); let build_libs = state.borrow::<Vec<&str>>();
json!({ json!({
"buildSpecifier": build_specifier, "buildSpecifier": build_specifier,

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Module } from "node:module"; import { createRequire, Module } from "node:module";
import { import {
assert, assert,
assertEquals, assertEquals,
@ -58,3 +58,18 @@ Deno.test("[node/module _nodeModulePaths] prevents duplicate root /node_modules"
"Missing root 'node_modules' directory", "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 package_json::PackageJson;
pub use path::PathClean; pub use path::PathClean;
pub use polyfill::is_builtin_node_module; 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;
pub use polyfill::SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX;
pub use resolution::NodeModuleKind; pub use resolution::NodeModuleKind;
pub use resolution::NodeResolution; pub use resolution::NodeResolution;
pub use resolution::NodeResolutionMode; pub use resolution::NodeResolutionMode;
@ -251,7 +251,6 @@ deno_core::extension!(deno_node,
esm = [ esm = [
dir "polyfills", dir "polyfills",
"00_globals.js", "00_globals.js",
"01_require.js",
"02_init.js", "02_init.js",
"_brotli.js", "_brotli.js",
"_events.mjs", "_events.mjs",
@ -315,27 +314,7 @@ deno_core::extension!(deno_node,
"_utils.ts", "_utils.ts",
"_zlib_binding.mjs", "_zlib_binding.mjs",
"_zlib.mjs", "_zlib.mjs",
"assert.ts",
"assert/strict.ts",
"assertion_error.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", "inspector.ts",
"internal_binding/_libuv_winerror.ts", "internal_binding/_libuv_winerror.ts",
"internal_binding/_listen.ts", "internal_binding/_listen.ts",
@ -435,9 +414,6 @@ deno_core::extension!(deno_node,
"internal/util/inspect.mjs", "internal/util/inspect.mjs",
"internal/util/types.ts", "internal/util/types.ts",
"internal/validators.mjs", "internal/validators.mjs",
"net.ts",
"os.ts",
"path.ts",
"path/_constants.ts", "path/_constants.ts",
"path/_interface.ts", "path/_interface.ts",
"path/_util.ts", "path/_util.ts",
@ -445,34 +421,61 @@ deno_core::extension!(deno_node,
"path/_win32.ts", "path/_win32.ts",
"path/common.ts", "path/common.ts",
"path/mod.ts", "path/mod.ts",
"path/posix.ts",
"path/separator.ts", "path/separator.ts",
"path/win32.ts",
"perf_hooks.ts",
"process.ts",
"punycode.ts",
"querystring.ts",
"readline.ts",
"readline/promises.ts", "readline/promises.ts",
"repl.ts", "repl.ts",
"stream.ts", "wasi.ts"
"stream/consumers.mjs", ],
"stream/promises.mjs", esm_with_specifiers = [
"stream/web.ts", dir "polyfills",
"string_decoder.ts", ("node:assert", "assert.ts"),
"sys.ts", ("node:assert/strict", "assert/strict.ts"),
"timers.ts", ("node:async_hooks", "async_hooks.ts"),
"timers/promises.ts", ("node:buffer", "buffer.ts"),
"tls.ts", ("node:child_process", "child_process.ts"),
"tty.ts", ("node:cluster", "cluster.ts"),
"url.ts", ("node:console", "console.ts"),
"util.ts", ("node:constants", "constants.ts"),
"util/types.ts", ("node:crypto", "crypto.ts"),
"v8.ts", ("node:dgram", "dgram.ts"),
"vm.ts", ("node:diagnostics_channel", "diagnostics_channel.ts"),
"wasi.ts", ("node:dns", "dns.ts"),
"worker_threads.ts", ("node:dns/promises", "dns/promises.ts"),
"zlib.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 = { options = {
maybe_npm_resolver: Option<NpmResolverRc>, maybe_npm_resolver: Option<NpmResolverRc>,
@ -488,7 +491,7 @@ deno_core::extension!(deno_node,
npm_resolver, npm_resolver,
))) )))
} }
}, }
); );
pub fn initialize_runtime( pub fn initialize_runtime(

View file

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

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

View file

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

View file

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

View file

@ -13,7 +13,7 @@ import {
getValidatedPath, getValidatedPath,
getValidMode, getValidMode,
} from "ext:deno_node/internal/fs/utils.mjs"; } 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"; import { promisify } from "ext:deno_node/internal/util.mjs";
export function access( export function access(

View file

@ -5,9 +5,9 @@
import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts"; import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; 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 { 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"; import { promisify } from "ext:deno_node/internal/util.mjs";
export function chmod( export function chmod(

View file

@ -11,9 +11,9 @@ import {
getValidatedPath, getValidatedPath,
kMaxUserId, kMaxUserId,
} from "ext:deno_node/internal/fs/utils.mjs"; } 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 { 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"; 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 type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
import { makeCallback } 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 { import {
getValidatedPath, getValidatedPath,
getValidMode, 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 { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import { FileHandle } from "ext:deno_node/internal/fs/handle.ts"; 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 { function existsSync(filePath: string | URL): boolean {
try { try {

View file

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

View file

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

View file

@ -9,7 +9,7 @@ import {
getEncoding, getEncoding,
TextOptionsArgument, TextOptionsArgument,
} from "ext:deno_node/_fs/_fs_common.ts"; } 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 { readAll } from "ext:deno_io/12_io.js";
import { FileHandle } from "ext:deno_node/internal/fs/handle.ts"; import { FileHandle } from "ext:deno_node/internal/fs/handle.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js"; 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 Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts"; import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs"; 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"; import { promisify } from "ext:deno_node/internal/util.mjs";
function toDirent(val: Deno.DirEntry): Dirent { function toDirent(val: Deno.DirEntry): Dirent {

View file

@ -10,12 +10,12 @@ import {
validateRmOptions, validateRmOptions,
validateRmOptionsSync, validateRmOptionsSync,
} from "ext:deno_node/internal/fs/utils.mjs"; } from "ext:deno_node/internal/fs/utils.mjs";
import { toNamespacedPath } from "ext:deno_node/path.ts"; import { toNamespacedPath } from "node:path";
import { import {
denoErrorToNodeError, denoErrorToNodeError,
ERR_FS_RMDIR_ENOTDIR, ERR_FS_RMDIR_ENOTDIR,
} from "ext:deno_node/internal/errors.ts"; } 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"; import { promisify } from "ext:deno_node/internal/util.mjs";
type rmdirOptions = { type rmdirOptions = {

View file

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

View file

@ -4,7 +4,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // 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 { validateEncoding, validateInteger } from "ext:deno_node/internal/validators.mjs";
import * as io from "ext:deno_io/12_io.js"; import * as io from "ext:deno_io/12_io.js";
import * as fs from "ext:deno_fs/30_fs.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 { Encodings } from "ext:deno_node/_utils.ts";
import { pathFromURL } from "ext:deno_web/00_infra.js"; import { pathFromURL } from "ext:deno_web/00_infra.js";
import { Buffer } from "ext:deno_node/buffer.ts"; import { Buffer } from "node:buffer";
import { import {
CallbackWithError, CallbackWithError,
checkEncoding, checkEncoding,

View file

@ -4,7 +4,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // 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 { validateBufferArray } from "ext:deno_node/internal/fs/utils.mjs";
import { getValidatedFd } 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"; 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. // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { EventEmitter } from "ext:deno_node/_events.d.ts"; import { EventEmitter } from "ext:deno_node/_events.d.ts";
import { Buffer } from "ext:deno_node/buffer.ts"; import { Buffer } from "node:buffer";
/** One of: /** One of:
* | "ascii" * | "ascii"

View file

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

View file

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

View file

@ -4,14 +4,14 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts"; import { Buffer } from "node:buffer";
import { import {
clearLine, clearLine,
clearScreenDown, clearScreenDown,
cursorTo, cursorTo,
moveCursor, moveCursor,
} from "ext:deno_node/internal/readline/callbacks.mjs"; } 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 { isWindows } from "ext:deno_node/_util/os.ts";
import { fs as fsConstants } from "ext:deno_node/internal_binding/constants.ts"; import { fs as fsConstants } from "ext:deno_node/internal_binding/constants.ts";
import * as io from "ext:deno_io/12_io.js"; 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 { Abortable, EventEmitter } from "ext:deno_node/_events.d.ts";
import * as promises from "ext:deno_node/readline/promises.ts"; import * as promises from "ext:deno_node/readline/promises.ts";
import { ReadableStream, WritableStream } from "ext:deno_node/_global.d.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 { import type {
AsyncCompleter, AsyncCompleter,
Completer, 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 { validateAbortSignal } from "ext:deno_node/internal/validators.mjs";
import { promisify } from "ext:deno_node/internal/util.mjs"; import { promisify } from "ext:deno_node/internal/util.mjs";
import { AbortError } from "ext:deno_node/internal/errors.ts"; import { AbortError } from "ext:deno_node/internal/errors.ts";
import process from "ext:deno_node/process.ts"; import process from "node:process";
import { import {
Interface as _Interface, Interface as _Interface,

View file

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

View file

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

View file

@ -9,11 +9,11 @@ import {
StringPrototypeReplace, StringPrototypeReplace,
} from "ext:deno_node/internal/primordials.mjs"; } from "ext:deno_node/internal/primordials.mjs";
import assert from "ext:deno_node/internal/assert.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 { createSecureContext } from "ext:deno_node/_tls_common.ts";
import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts"; import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts";
import { connResetException } from "ext:deno_node/internal/errors.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 { debuglog } from "ext:deno_node/internal/util/debuglog.ts";
import { import {
constants as TCPConstants, constants as TCPConstants,
@ -23,7 +23,7 @@ import {
constants as PipeConstants, constants as PipeConstants,
Pipe, Pipe,
} from "ext:deno_node/internal_binding/pipe_wrap.ts"; } 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 { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { nextTick } from "ext:deno_node/_next_tick.ts"; import { nextTick } from "ext:deno_node/_next_tick.ts";

View file

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

View file

@ -8,7 +8,7 @@ import {
AssertionErrorConstructorOptions, AssertionErrorConstructorOptions,
} from "ext:deno_node/assertion_error.ts"; } from "ext:deno_node/assertion_error.ts";
import * as asserts from "ext:deno_node/_util/std_asserts.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 { import {
ERR_AMBIGUOUS_ARGUMENT, ERR_AMBIGUOUS_ARGUMENT,
ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_TYPE,

View file

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

View file

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

View file

@ -38,10 +38,10 @@ import {
ObjectAssign, ObjectAssign,
StringPrototypeSlice, StringPrototypeSlice,
} from "ext:deno_node/internal/primordials.mjs"; } 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 { createDeferredPromise } from "ext:deno_node/internal/util.mjs";
import process from "ext:deno_node/process.ts"; import process from "node:process";
import { Buffer } from "ext:deno_node/buffer.ts"; import { Buffer } from "node:buffer";
import { import {
convertToValidSignal, convertToValidSignal,
kEmptyObject, kEmptyObject,

View file

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

View file

@ -23,9 +23,9 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // deno-lint-ignore-file prefer-primordials
import { Buffer } from "ext:deno_node/buffer.ts"; import { Buffer } from "node:buffer";
import { EventEmitter } from "ext:deno_node/events.ts"; import { EventEmitter } from "node:events";
import { lookup as defaultLookup } from "ext:deno_node/dns.ts"; import { lookup as defaultLookup } from "node:dns";
import type { import type {
ErrnoException, ErrnoException,
NodeSystemErrorCtx, NodeSystemErrorCtx,
@ -62,8 +62,8 @@ import {
} from "ext:deno_node/internal/validators.mjs"; } from "ext:deno_node/internal/validators.mjs";
import { guessHandleType } from "ext:deno_node/internal_binding/util.ts"; import { guessHandleType } from "ext:deno_node/internal_binding/util.ts";
import { os } from "ext:deno_node/internal_binding/constants.ts"; import { os } from "ext:deno_node/internal_binding/constants.ts";
import { nextTick } from "ext:deno_node/process.ts"; import { nextTick } from "node:process";
import { channel } from "ext:deno_node/diagnostics_channel.ts"; import { channel } from "node:diagnostics_channel";
import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts"; import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts";
const { UV_UDP_REUSEADDR, UV_UDP_IPV6ONLY } = os; 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 { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import { validateFunction } from "ext:deno_node/internal/validators.mjs"; 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; type Subscriber = (message: unknown, name?: string) => void;

View file

@ -92,7 +92,7 @@ import {
GetAddrInfoReqWrap, GetAddrInfoReqWrap,
QueryReqWrap, QueryReqWrap,
} from "ext:deno_node/internal_binding/cares_wrap.ts"; } 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"; import { notImplemented } from "ext:deno_node/_utils.ts";
function onlookup( function onlookup(

View file

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

View file

@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // 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 access = fsPromises.access;
export const copyFile = fsPromises.copyFile; export const copyFile = fsPromises.copyFile;

View file

@ -13,10 +13,10 @@ import {
// createConnection, // createConnection,
ListenOptions, ListenOptions,
Socket, Socket,
} from "ext:deno_node/net.ts"; } from "node:net";
import { Buffer } from "ext:deno_node/buffer.ts"; import { Buffer } from "node:buffer";
import { ERR_SERVER_NOT_RUNNING } from "ext:deno_node/internal/errors.ts"; 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 { nextTick } from "ext:deno_node/_next_tick.ts";
import { import {
validateBoolean, validateBoolean,
@ -29,13 +29,13 @@ import {
finished, finished,
Readable as NodeReadable, Readable as NodeReadable,
Writable as NodeWritable, Writable as NodeWritable,
} from "ext:deno_node/stream.ts"; } from "node:stream";
import { import {
OutgoingMessage, OutgoingMessage,
parseUniqueHeadersOption, parseUniqueHeadersOption,
validateHeaderName, validateHeaderName,
} from "ext:deno_node/_http_outgoing.ts"; } 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 { kOutHeaders } from "ext:deno_node/internal/http.ts";
import { _checkIsHttpToken as checkIsHttpToken } from "ext:deno_node/_http_common.ts"; import { _checkIsHttpToken as checkIsHttpToken } from "ext:deno_node/_http_common.ts";
import { Agent, globalAgent } from "ext:deno_node/_http_agent.mjs"; import { Agent, globalAgent } from "ext:deno_node/_http_agent.mjs";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // 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_RANDOM_VALUES = 65536;
export const MAX_SIZE = 4294967295; export const MAX_SIZE = 4294967295;

View file

@ -6,7 +6,7 @@
import { import {
MAX_SIZE as kMaxUint32, MAX_SIZE as kMaxUint32,
} from "ext:deno_node/internal/crypto/_randomBytes.ts"; } 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 { core } = globalThis.__bootstrap;
const { ops } = core; const { ops } = core;

View file

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

View file

@ -9,7 +9,7 @@ import {
validateInt32, validateInt32,
validateObject, validateObject,
} from "ext:deno_node/internal/validators.mjs"; } 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 { notImplemented } from "ext:deno_node/_utils.ts";
import type { TransformOptions } from "ext:deno_node/_stream.d.ts"; import type { TransformOptions } from "ext:deno_node/_stream.d.ts";
import { Transform } from "ext:deno_node/_stream.mjs"; import { Transform } from "ext:deno_node/_stream.mjs";

View file

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

View file

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

View file

@ -26,7 +26,7 @@ import {
validateString, validateString,
validateUint32, validateUint32,
} from "ext:deno_node/internal/validators.mjs"; } 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"; import { KeyFormat, KeyType } from "ext:deno_node/internal/crypto/types.ts";
const { core } = globalThis.__bootstrap; const { core } = globalThis.__bootstrap;

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ import {
validateFunction, validateFunction,
validateString, validateString,
} from "ext:deno_node/internal/validators.mjs"; } 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 type { WritableOptions } from "ext:deno_node/_stream.d.ts";
import Writable from "ext:deno_node/internal/streams/writable.mjs"; import Writable from "ext:deno_node/internal/streams/writable.mjs";
import type { import type {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,9 +3,9 @@
// deno-lint-ignore-file no-explicit-any // deno-lint-ignore-file no-explicit-any
import * as stream from "ext:deno_node/_stream.d.ts"; 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"; import { BufferEncoding, ErrnoException } from "ext:deno_node/_global.d.ts";
type PathLike = string | Buffer | URL; 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 { 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 { 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 { validateFunction, validateInteger } from "ext:deno_node/internal/validators.mjs";
import { errorOrDestroy } from "ext:deno_node/internal/streams/destroy.mjs"; import { errorOrDestroy } from "ext:deno_node/internal/streams/destroy.mjs";
import { open as fsOpen } from "ext:deno_node/_fs/_fs_open.ts"; 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 { write as fsWrite } from "ext:deno_node/_fs/_fs_write.mjs";
import { writev as fsWritev } from "ext:deno_node/_fs/_fs_writev.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 { 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 { import {
copyObject, copyObject,
getOptions, getOptions,
getValidatedFd, getValidatedFd,
validatePath, validatePath,
} from "ext:deno_node/internal/fs/utils.mjs"; } 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 { toPathIfFileURL } from "ext:deno_node/internal/url.ts";
import { nextTick } from "ext:deno_node/_next_tick.ts"; import { nextTick } from "ext:deno_node/_next_tick.ts";
const kIoDone = Symbol("kIoDone"); const kIoDone = Symbol("kIoDone");

View file

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

View file

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

View file

@ -23,7 +23,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // 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 { uvException } from "ext:deno_node/internal/errors.ts";
import { writeBuffer } from "ext:deno_node/internal_binding/node_file.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 { charLengthAt, CSI, emitKeys } from "ext:deno_node/internal/readline/utils.mjs";
import { kSawKeyPress } from "ext:deno_node/internal/readline/symbols.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 { const {
kEscape, kEscape,
} = CSI; } = CSI;
import { StringDecoder } from "ext:deno_node/string_decoder.ts"; import { StringDecoder } from "node:string_decoder";
const KEYPRESS_DECODER = Symbol("keypress-decoder"); const KEYPRESS_DECODER = Symbol("keypress-decoder");
const ESCAPE_DECODER = Symbol("escape-decoder"); const ESCAPE_DECODER = Symbol("escape-decoder");

View file

@ -36,7 +36,7 @@ import {
getStringWidth, getStringWidth,
stripVTControlCharacters, stripVTControlCharacters,
} from "ext:deno_node/internal/util/inspect.mjs"; } 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 { emitKeypressEvents } from "ext:deno_node/internal/readline/emitKeypressEvents.mjs";
import { import {
charLengthAt, charLengthAt,
@ -46,9 +46,9 @@ import {
} from "ext:deno_node/internal/readline/utils.mjs"; } from "ext:deno_node/internal/readline/utils.mjs";
import { clearScreenDown, cursorTo, moveCursor } from "ext:deno_node/internal/readline/callbacks.mjs"; import { clearScreenDown, cursorTo, moveCursor } from "ext:deno_node/internal/readline/callbacks.mjs";
import { Readable } from "ext:deno_node/_stream.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 { import {
kAddHistory, kAddHistory,
kDecoder, kDecoder,

View file

@ -35,10 +35,10 @@ import {
import { isUint8Array } from "ext:deno_node/internal/util/types.ts"; import { isUint8Array } from "ext:deno_node/internal/util/types.ts";
import { errnoException } from "ext:deno_node/internal/errors.ts"; import { errnoException } from "ext:deno_node/internal/errors.ts";
import { getTimerDuration, kTimeout } from "ext:deno_node/internal/timers.mjs"; 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 { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { codeMap } from "ext:deno_node/internal_binding/uv.ts"; 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 kMaybeDestroy = Symbol("kMaybeDestroy");
export const kUpdateTimer = Symbol("kUpdateTimer"); export const kUpdateTimer = Symbol("kUpdateTimer");

View file

@ -2,7 +2,7 @@
// Copyright Joyent and Node contributors. All rights reserved. MIT license. // Copyright Joyent and Node contributors. All rights reserved. MIT license.
// deno-lint-ignore-file // 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"; import { inspect } from "ext:deno_node/internal/util/inspect.mjs";
class BufferList { class BufferList {

View file

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

View file

@ -7,7 +7,7 @@
import { inspect } from "ext:deno_node/internal/util/inspect.mjs"; import { inspect } from "ext:deno_node/internal/util/inspect.mjs";
import { validateFunction, validateNumber } from "ext:deno_node/internal/validators.mjs"; import { validateFunction, validateNumber } from "ext:deno_node/internal/validators.mjs";
import { ERR_OUT_OF_RANGE } from "ext:deno_node/internal/errors.ts"; 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 { import {
setTimeout as setTimeout_, setTimeout as setTimeout_,
clearTimeout as clearTimeout_, clearTimeout as clearTimeout_,

View file

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

View file

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

View file

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

View file

@ -31,7 +31,7 @@
// deno-lint-ignore-file prefer-primordials // deno-lint-ignore-file prefer-primordials
import { TextEncoder } from "ext:deno_web/08_text_encoding.js"; 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 { notImplemented } from "ext:deno_node/_utils.ts";
import { HandleWrap } from "ext:deno_node/internal_binding/handle_wrap.ts"; import { HandleWrap } from "ext:deno_node/internal_binding/handle_wrap.ts";
import { 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 { ownerSymbol } from "ext:deno_node/internal_binding/symbols.ts";
import { codeMap, errorMap } from "ext:deno_node/internal_binding/uv.ts"; import { codeMap, errorMap } from "ext:deno_node/internal_binding/uv.ts";
import { notImplemented } from "ext:deno_node/_utils.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 type { ErrnoException } from "ext:deno_node/internal/errors.ts";
import { isIP } from "ext:deno_node/internal/net.ts"; import { isIP } from "ext:deno_node/internal/net.ts";
import * as net from "ext:deno_net/01_net.js"; import * as net from "ext:deno_net/01_net.js";

View file

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

View file

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

View file

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

View file

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

View file

@ -5,7 +5,7 @@
// deno-lint-ignore-file prefer-primordials // deno-lint-ignore-file prefer-primordials
import { TextDecoder } from "ext:deno_web/08_text_encoding.js"; 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 * @typedef {import('../_global.d.ts').ReadableStream

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // 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. // Returns true when the given numeric fd is associated with a TTY and false otherwise.
function isatty(fd: number) { function isatty(fd: number) {

View file

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

View file

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

View file

@ -4,9 +4,9 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills // TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials // 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 { 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 { BroadcastChannel } from "ext:deno_broadcast_channel/01_broadcast_channel.js";
import { MessageChannel, MessagePort } from "ext:deno_web/13_message_port.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( fn transpile_ts_for_snapshotting(
file_source: &ExtensionFileSource, file_source: &ExtensionFileSource,
) -> Result<ModuleCode, AnyError> { ) -> 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 { let should_transpile = match media_type {
MediaType::JavaScript => false, MediaType::JavaScript => false,
MediaType::Mjs => false, MediaType::Mjs => false,
MediaType::TypeScript => true, MediaType::TypeScript => true,
_ => panic!( _ => {
"Unsupported media type for snapshotting {media_type:?} for file {}", panic!(
file_source.specifier "Unsupported media type for snapshotting {media_type:?} for file {}",
), file_source.specifier
)
}
}; };
let code = file_source.load()?; let code = file_source.load()?;
@ -284,7 +291,6 @@ mod startup_snapshot {
runtime_main, runtime_main,
deps = [runtime], deps = [runtime],
customizer = |ext: &mut deno_core::ExtensionBuilder| { customizer = |ext: &mut deno_core::ExtensionBuilder| {
eprintln!("I am here!!!");
ext.esm_entry_point("ext:runtime/90_deno_ns.js"); 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_http::DefaultHttpPropertyExtractor;
use deno_io::Stdio; use deno_io::Stdio;
use deno_kv::sqlite::SqliteDbHandler; use deno_kv::sqlite::SqliteDbHandler;
use deno_node::SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX;
use deno_tls::RootCertStoreProvider; use deno_tls::RootCertStoreProvider;
use deno_web::create_entangled_message_port; use deno_web::create_entangled_message_port;
use deno_web::BlobStore; use deno_web::BlobStore;
@ -484,14 +485,10 @@ impl WebWorker {
let startup_snapshot = options.startup_snapshot let startup_snapshot = options.startup_snapshot
.expect("deno_runtime startup snapshot is not available with 'create_runtime_snapshot' Cargo feature."); .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. // modules as `node:` specifiers.
let rename_modules = Some( let preserve_snapshotted_modules =
deno_node::SUPPORTED_BUILTIN_NODE_MODULES Some(SUPPORTED_BUILTIN_NODE_MODULES_WITH_PREFIX);
.iter()
.map(|p| (p.ext_specifier, p.specifier))
.collect(),
);
let mut js_runtime = JsRuntime::new(RuntimeOptions { let mut js_runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(options.module_loader.clone()), module_loader: Some(options.module_loader.clone()),
@ -502,7 +499,7 @@ impl WebWorker {
compiled_wasm_module_store: options.compiled_wasm_module_store.clone(), compiled_wasm_module_store: options.compiled_wasm_module_store.clone(),
extensions, extensions,
inspector: options.maybe_inspector_server.is_some(), inspector: options.maybe_inspector_server.is_some(),
rename_modules, preserve_snapshotted_modules,
..Default::default() ..Default::default()
}); });

View file

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

View file

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