summaryrefslogtreecommitdiff
path: root/cli/npm/resolvers/common.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/npm/resolvers/common.rs')
-rw-r--r--cli/npm/resolvers/common.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs
index 8b8be5ce2..a31459a70 100644
--- a/cli/npm/resolvers/common.rs
+++ b/cli/npm/resolvers/common.rs
@@ -3,6 +3,7 @@
use std::io::ErrorKind;
use std::path::Path;
use std::path::PathBuf;
+use std::sync::Arc;
use async_trait::async_trait;
use deno_ast::ModuleSpecifier;
@@ -26,11 +27,10 @@ pub trait NpmPackageFsResolver: Send + Sync {
/// The local node_modules folder if it is applicable to the implementation.
fn node_modules_path(&self) -> Option<PathBuf>;
- fn resolve_package_folder_from_deno_module(
+ fn package_folder(
&self,
- id: &NpmPackageId,
+ package_id: &NpmPackageId,
) -> Result<PathBuf, AnyError>;
-
fn resolve_package_folder_from_package(
&self,
name: &str,
@@ -43,8 +43,6 @@ pub trait NpmPackageFsResolver: Send + Sync {
specifier: &ModuleSpecifier,
) -> Result<PathBuf, AnyError>;
- fn package_size(&self, package_id: &NpmPackageId) -> Result<u64, AnyError>;
-
async fn cache_packages(&self) -> Result<(), AnyError>;
fn ensure_read_permission(
@@ -57,7 +55,7 @@ pub trait NpmPackageFsResolver: Send + Sync {
/// Caches all the packages in parallel.
pub async fn cache_packages(
mut packages: Vec<NpmResolutionPackage>,
- cache: &NpmCache,
+ cache: &Arc<NpmCache>,
registry_url: &Url,
) -> Result<(), AnyError> {
let sync_download = should_sync_download();