summaryrefslogtreecommitdiff
path: root/cli/standalone
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-09-28 08:50:16 -0400
committerGitHub <noreply@github.com>2024-09-28 08:50:16 -0400
commit1bb47805d6331ad048bd5e7ea2581aa230e8fc93 (patch)
tree7f8707f40415e26530f6e6ccd5cde86b22903163 /cli/standalone
parentfc739dc5eb2769e4608ccf08d23ca8ff0fcc19c5 (diff)
refactor: move NpmCacheDir to deno_cache_dir (#25916)
Part of the ongoing work to move more of Deno's resolution out of the CLI crate (for use in Wasm and other things) Includes: * https://github.com/denoland/deno_cache_dir/pull/60
Diffstat (limited to 'cli/standalone')
-rw-r--r--cli/standalone/file_system.rs4
-rw-r--r--cli/standalone/mod.rs4
2 files changed, 5 insertions, 3 deletions
diff --git a/cli/standalone/file_system.rs b/cli/standalone/file_system.rs
index 536b17f27..314444630 100644
--- a/cli/standalone/file_system.rs
+++ b/cli/standalone/file_system.rs
@@ -102,7 +102,7 @@ impl FileSystem for DenoCompileFileSystem {
&self,
path: &Path,
recursive: bool,
- mode: u32,
+ mode: Option<u32>,
) -> FsResult<()> {
self.error_if_in_vfs(path)?;
RealFs.mkdir_sync(path, recursive, mode)
@@ -111,7 +111,7 @@ impl FileSystem for DenoCompileFileSystem {
&self,
path: PathBuf,
recursive: bool,
- mode: u32,
+ mode: Option<u32>,
) -> FsResult<()> {
self.error_if_in_vfs(&path)?;
RealFs.mkdir_async(path, recursive, mode).await
diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs
index c501d2d6b..93ac6002b 100644
--- a/cli/standalone/mod.rs
+++ b/cli/standalone/mod.rs
@@ -6,6 +6,7 @@
#![allow(unused_imports)]
use deno_ast::MediaType;
+use deno_cache_dir::npm::NpmCacheDir;
use deno_config::workspace::MappedResolution;
use deno_config::workspace::MappedResolutionError;
use deno_config::workspace::ResolverWorkspaceJsrPackage;
@@ -55,6 +56,7 @@ use crate::args::StorageKeyResolver;
use crate::cache::Caches;
use crate::cache::DenoDirProvider;
use crate::cache::NodeAnalysisCache;
+use crate::cache::RealDenoCacheEnv;
use crate::http_util::HttpClientProvider;
use crate::node::CliCjsCodeAnalyzer;
use crate::npm::create_cli_npm_resolver;
@@ -62,7 +64,6 @@ use crate::npm::CliNpmResolverByonmCreateOptions;
use crate::npm::CliNpmResolverCreateOptions;
use crate::npm::CliNpmResolverManagedCreateOptions;
use crate::npm::CliNpmResolverManagedSnapshotOption;
-use crate::npm::NpmCacheDir;
use crate::resolver::CjsResolutionStore;
use crate::resolver::CliNodeResolver;
use crate::resolver::NpmModuleLoader;
@@ -464,6 +465,7 @@ pub async fn run(
let main_module = root_dir_url.join(&metadata.entrypoint_key).unwrap();
let root_node_modules_path = root_path.join("node_modules");
let npm_cache_dir = NpmCacheDir::new(
+ &RealDenoCacheEnv,
root_node_modules_path.clone(),
vec![npm_registry_url.clone()],
);