summaryrefslogtreecommitdiff
path: root/ext/node_resolver/env.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-09-28 19:17:48 -0400
committerGitHub <noreply@github.com>2024-09-28 19:17:48 -0400
commit5faf769ac61b627d14710cdf487de7cd4eb3f9d3 (patch)
tree2cc4ab975522b3c8845ab3040c010fd998a769a6 /ext/node_resolver/env.rs
parent3138478f66823348eb745c7f0c2d34eed378a3f0 (diff)
refactor: extract out sloppy imports resolution from CLI crate (#25920)
This is slow progress towards creating a `deno_resolver` crate. Waiting on: * https://github.com/denoland/deno/pull/25918 * https://github.com/denoland/deno/pull/25916
Diffstat (limited to 'ext/node_resolver/env.rs')
-rw-r--r--ext/node_resolver/env.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/ext/node_resolver/env.rs b/ext/node_resolver/env.rs
deleted file mode 100644
index b520ece0f..000000000
--- a/ext/node_resolver/env.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-
-use std::path::Path;
-use std::path::PathBuf;
-
-use crate::sync::MaybeSend;
-use crate::sync::MaybeSync;
-
-pub struct NodeResolverFsStat {
- pub is_file: bool,
- pub is_dir: bool,
- pub is_symlink: bool,
-}
-
-pub trait NodeResolverEnv: std::fmt::Debug + MaybeSend + MaybeSync {
- fn is_builtin_node_module(&self, specifier: &str) -> bool;
-
- fn realpath_sync(&self, path: &Path) -> std::io::Result<PathBuf>;
-
- fn stat_sync(&self, path: &Path) -> std::io::Result<NodeResolverFsStat>;
-
- fn exists_sync(&self, path: &Path) -> bool;
-
- fn is_file_sync(&self, path: &Path) -> bool {
- self
- .stat_sync(path)
- .map(|stat| stat.is_file)
- .unwrap_or(false)
- }
-
- fn is_dir_sync(&self, path: &Path) -> bool {
- self
- .stat_sync(path)
- .map(|stat| stat.is_dir)
- .unwrap_or(false)
- }
-
- fn pkg_json_fs(&self) -> &dyn deno_package_json::fs::DenoPkgJsonFs;
-}