From c0b7454175afdefa0b8e73a04aadeb874eb2e766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 2 Apr 2024 23:43:03 +0100 Subject: FUTURE: enable BYONM by default (#23194) When `DENO_FUTURE=1` env var is present, then BYONM ("bring your own node_modules") is enabled by default. That means that is there's a `package.json` present, users are expected to explicitly install dependencies from that file. Towards https://github.com/denoland/deno/issues/23151 --- cli/args/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cli/args') diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 76de434fd..e138e9d0b 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1102,7 +1102,11 @@ impl CliOptions { } pub fn has_node_modules_dir(&self) -> bool { - self.maybe_node_modules_folder.is_some() || self.unstable_byonm() + if self.enable_future_features() { + self.maybe_node_modules_folder.is_some() + } else { + self.maybe_node_modules_folder.is_some() || self.unstable_byonm() + } } pub fn node_modules_dir_path(&self) -> Option { @@ -1590,6 +1594,10 @@ impl CliOptions { .unwrap_or(false) } + pub fn use_byonm(&self) -> bool { + self.enable_future_features() + } + pub fn unstable_byonm(&self) -> bool { self.flags.unstable_config.byonm || NPM_PROCESS_STATE -- cgit v1.2.3