summaryrefslogtreecommitdiff
path: root/cli/factory.rs
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2024-08-16 12:48:48 +0900
committerGitHub <noreply@github.com>2024-08-16 12:48:48 +0900
commit105d27bc7db5c0d2fd18cb26f41bd3193be74639 (patch)
tree0ab08bb52a67345702eb7ff016091d35b4f540be /cli/factory.rs
parentb6c74aab240430fa70c057be825ce766d2314e02 (diff)
fix(ext/node): improve shelljs compat with managed npm execution (#24912)
This change improves the Node.js compatibility in managed npm resolution mode by disabling the discovery of `node_modules` when the main specifier is inside of `DENO_DIR`. closes #22732 closes #24589
Diffstat (limited to 'cli/factory.rs')
-rw-r--r--cli/factory.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/cli/factory.rs b/cli/factory.rs
index 942aefd25..25f6afa74 100644
--- a/cli/factory.rs
+++ b/cli/factory.rs
@@ -158,7 +158,6 @@ impl<T> Deferred<T> {
#[derive(Default)]
struct CliFactoryServices {
cli_options: Deferred<Arc<CliOptions>>,
- deno_dir_provider: Deferred<Arc<DenoDirProvider>>,
caches: Deferred<Arc<Caches>>,
file_fetcher: Deferred<Arc<FileFetcher>>,
global_http_cache: Deferred<Arc<GlobalHttpCache>>,
@@ -236,11 +235,7 @@ impl CliFactory {
}
pub fn deno_dir_provider(&self) -> Result<&Arc<DenoDirProvider>, AnyError> {
- self.services.deno_dir_provider.get_or_try_init(|| {
- Ok(Arc::new(DenoDirProvider::new(
- self.cli_options()?.maybe_custom_root().clone(),
- )))
- })
+ Ok(&self.cli_options()?.deno_dir_provider)
}
pub fn deno_dir(&self) -> Result<&DenoDir, AnyError> {