diff options
Diffstat (limited to 'cli/npm/managed/resolvers')
-rw-r--r-- | cli/npm/managed/resolvers/common.rs | 9 | ||||
-rw-r--r-- | cli/npm/managed/resolvers/global.rs | 14 | ||||
-rw-r--r-- | cli/npm/managed/resolvers/local.rs | 10 | ||||
-rw-r--r-- | cli/npm/managed/resolvers/mod.rs | 9 |
4 files changed, 7 insertions, 35 deletions
diff --git a/cli/npm/managed/resolvers/common.rs b/cli/npm/managed/resolvers/common.rs index 2d540accd..4cdad1f99 100644 --- a/cli/npm/managed/resolvers/common.rs +++ b/cli/npm/managed/resolvers/common.rs @@ -21,7 +21,6 @@ use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::NodePermissions; use deno_runtime::deno_node::NodeResolutionMode; -use crate::http_util::HttpClient; use crate::npm::managed::cache::TarballCache; /// Part of the resolution that interacts with the file system. @@ -50,10 +49,7 @@ pub trait NpmPackageFsResolver: Send + Sync { specifier: &ModuleSpecifier, ) -> Result<Option<NpmPackageCacheFolderId>, AnyError>; - async fn cache_packages( - &self, - http_client: &Arc<HttpClient>, - ) -> Result<(), AnyError>; + async fn cache_packages(&self) -> Result<(), AnyError>; fn ensure_read_permission( &self, @@ -131,13 +127,12 @@ impl RegistryReadPermissionChecker { pub async fn cache_packages( packages: Vec<NpmResolutionPackage>, tarball_cache: &Arc<TarballCache>, - http_client: &Arc<HttpClient>, ) -> Result<(), AnyError> { let mut futures_unordered = futures::stream::FuturesUnordered::new(); for package in packages { futures_unordered.push(async move { tarball_cache - .ensure_package(&package.id.nv, &package.dist, http_client) + .ensure_package(&package.id.nv, &package.dist) .await }); } diff --git a/cli/npm/managed/resolvers/global.rs b/cli/npm/managed/resolvers/global.rs index 4ffcb251f..a6a071e07 100644 --- a/cli/npm/managed/resolvers/global.rs +++ b/cli/npm/managed/resolvers/global.rs @@ -20,8 +20,6 @@ use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::NodePermissions; use deno_runtime::deno_node::NodeResolutionMode; -use crate::http_util::HttpClient; - use super::super::super::common::types_package_name; use super::super::cache::NpmCache; use super::super::cache::TarballCache; @@ -129,20 +127,12 @@ impl NpmPackageFsResolver for GlobalNpmPackageResolver { ) } - async fn cache_packages( - &self, - http_client: &Arc<HttpClient>, - ) -> Result<(), AnyError> { + async fn cache_packages(&self) -> Result<(), AnyError> { let package_partitions = self .resolution .all_system_packages_partitioned(&self.system_info); - cache_packages( - package_partitions.packages, - &self.tarball_cache, - http_client, - ) - .await?; + cache_packages(package_partitions.packages, &self.tarball_cache).await?; // create the copy package folders for copy in package_partitions.copy_packages { diff --git a/cli/npm/managed/resolvers/local.rs b/cli/npm/managed/resolvers/local.rs index 5c3b1f15e..1de8f4066 100644 --- a/cli/npm/managed/resolvers/local.rs +++ b/cli/npm/managed/resolvers/local.rs @@ -14,7 +14,6 @@ use std::path::PathBuf; use std::sync::Arc; use crate::cache::CACHE_PERM; -use crate::http_util::HttpClient; use crate::npm::cache_dir::mixed_case_package_name_decode; use crate::util::fs::atomic_write_file; use crate::util::fs::canonicalize_path_maybe_not_exists_with_fs; @@ -229,14 +228,10 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver { Ok(get_package_folder_id_from_folder_name(&folder_name)) } - async fn cache_packages( - &self, - http_client: &Arc<HttpClient>, - ) -> Result<(), AnyError> { + async fn cache_packages(&self) -> Result<(), AnyError> { sync_resolution_with_fs( &self.resolution.snapshot(), &self.cache, - http_client, &self.progress_bar, &self.tarball_cache, &self.root_node_modules_path, @@ -260,7 +255,6 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver { async fn sync_resolution_with_fs( snapshot: &NpmResolutionSnapshot, cache: &Arc<NpmCache>, - http_client: &Arc<HttpClient>, progress_bar: &ProgressBar, tarball_cache: &Arc<TarballCache>, root_node_modules_dir_path: &Path, @@ -330,7 +324,7 @@ async fn sync_resolution_with_fs( let bin_entries_to_setup = bin_entries.clone(); cache_futures.push(async move { tarball_cache - .ensure_package(&package.id.nv, &package.dist, http_client) + .ensure_package(&package.id.nv, &package.dist) .await?; let pb_guard = progress_bar.update_with_prompt( ProgressMessagePrompt::Initialize, diff --git a/cli/npm/managed/resolvers/mod.rs b/cli/npm/managed/resolvers/mod.rs index 5f0343805..2d812a2be 100644 --- a/cli/npm/managed/resolvers/mod.rs +++ b/cli/npm/managed/resolvers/mod.rs @@ -7,7 +7,6 @@ mod local; use std::path::PathBuf; use std::sync::Arc; -use deno_npm::npm_rc::ResolvedNpmRc; use deno_npm::NpmSystemInfo; use deno_runtime::deno_fs::FileSystem; @@ -25,18 +24,12 @@ use super::resolution::NpmResolution; pub fn create_npm_fs_resolver( fs: Arc<dyn FileSystem>, npm_cache: Arc<NpmCache>, - npm_rc: Arc<ResolvedNpmRc>, progress_bar: &ProgressBar, resolution: Arc<NpmResolution>, + tarball_cache: Arc<TarballCache>, maybe_node_modules_path: Option<PathBuf>, system_info: NpmSystemInfo, ) -> Arc<dyn NpmPackageFsResolver> { - let tarball_cache = Arc::new(TarballCache::new( - npm_cache.clone(), - fs.clone(), - npm_rc, - progress_bar.clone(), - )); match maybe_node_modules_path { Some(node_modules_folder) => Arc::new(LocalNpmPackageResolver::new( npm_cache, |