summaryrefslogtreecommitdiff
path: root/cli/args
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-04-02 23:43:03 +0100
committerGitHub <noreply@github.com>2024-04-03 00:43:03 +0200
commitc0b7454175afdefa0b8e73a04aadeb874eb2e766 (patch)
tree6872a1169a0dc8afcdc132041973755ea594383b /cli/args
parent29085895c9e7dc348f393c1154f7890663008612 (diff)
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
Diffstat (limited to 'cli/args')
-rw-r--r--cli/args/mod.rs10
1 files changed, 9 insertions, 1 deletions
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<PathBuf> {
@@ -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