diff options
Diffstat (limited to 'cli/npm/resolvers/common.rs')
-rw-r--r-- | cli/npm/resolvers/common.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs index 69950bee9..2b02e7721 100644 --- a/cli/npm/resolvers/common.rs +++ b/cli/npm/resolvers/common.rs @@ -18,7 +18,7 @@ use crate::args::Lockfile; use crate::npm::cache::should_sync_download; use crate::npm::resolution::NpmResolutionSnapshot; use crate::npm::NpmCache; -use crate::npm::NpmPackageNodeId; +use crate::npm::NpmPackageId; use crate::npm::NpmResolutionPackage; pub trait InnerNpmPackageResolver: Send + Sync { @@ -39,10 +39,7 @@ pub trait InnerNpmPackageResolver: Send + Sync { specifier: &ModuleSpecifier, ) -> Result<PathBuf, AnyError>; - fn package_size( - &self, - package_id: &NpmPackageNodeId, - ) -> Result<u64, AnyError>; + fn package_size(&self, package_id: &NpmPackageId) -> Result<u64, AnyError>; fn has_packages(&self) -> bool; @@ -79,7 +76,7 @@ pub async fn cache_packages( if sync_download { // we're running the tests not with --quiet // and we want the output to be deterministic - packages.sort_by(|a, b| a.id.cmp(&b.id)); + packages.sort_by(|a, b| a.pkg_id.cmp(&b.pkg_id)); } let mut handles = Vec::with_capacity(packages.len()); @@ -90,7 +87,7 @@ pub async fn cache_packages( let handle = tokio::task::spawn(async move { cache .ensure_package( - (package.id.name.as_str(), &package.id.version), + (package.pkg_id.nv.name.as_str(), &package.pkg_id.nv.version), &package.dist, ®istry_url, ) |