From 75209e12f19ca5d4a2a7c9008fba63a487ad8e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 15 Feb 2023 19:44:52 +0100 Subject: feat: wire up ext/node to the Node compatibility layer (#17785) This PR changes Node.js/npm compatibility layer to use polyfills for built-in Node.js embedded in the snapshot (that are coming from "ext/node" extension). As a result loading `std/node`, either from "https://deno.land/std@/" or from "DENO_NODE_COMPAT_URL" env variable were removed. All code that is imported via "npm:" specifiers now uses code embedded in the snapshot. Several fixes were applied to various modules in "ext/node" to make tests pass. --------- Co-authored-by: Yoshiya Hinosawa Co-authored-by: Divy Srivastava --- test_util/src/lib.rs | 1 - test_util/src/lsp.rs | 2 -- 2 files changed, 3 deletions(-) (limited to 'test_util/src') diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 2f85ca1b6..5aac13855 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -96,7 +96,6 @@ lazy_static! { pub fn env_vars_for_npm_tests_no_sync_download() -> Vec<(String, String)> { vec![ - ("DENO_NODE_COMPAT_URL".to_string(), std_file_url()), ("NPM_CONFIG_REGISTRY".to_string(), npm_registry_url()), ("NO_COLOR".to_string(), "1".to_string()), ] diff --git a/test_util/src/lsp.rs b/test_util/src/lsp.rs index 5694287eb..c4a81c63c 100644 --- a/test_util/src/lsp.rs +++ b/test_util/src/lsp.rs @@ -1,7 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. use crate::npm_registry_url; -use crate::std_file_url; use super::new_deno_dir; use super::TempDir; @@ -234,7 +233,6 @@ impl LspClient { let mut command = Command::new(deno_exe); command .env("DENO_DIR", deno_dir.path()) - .env("DENO_NODE_COMPAT_URL", std_file_url()) .env("NPM_CONFIG_REGISTRY", npm_registry_url()) .arg("lsp") .stdin(Stdio::piped()) -- cgit v1.2.3