From 610b8cc2bf6404d0905cc273b31d85555a6912e9 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 17 Feb 2023 09:12:22 -0500 Subject: refactor: add `NpmPackageId` back from deno_graph as `NpmPackageNodeId` (#17804) The `NpmPackageId` struct is being renamed to `NpmPackageNodeId`. In a future PR it will be moved down into only npm dependency resolution and a `NpmPackageId` struct will be introduced in `deno_graph` that only has the name and version of the package (no peer dependency identifier information). So a `NpmPackageReq` will map to an `NpmPackageId`, which will map to an `NpmPackageNodeId` in the npm resolution. --- cli/npm/resolvers/common.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cli/npm/resolvers/common.rs') diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs index 99af7352b..69950bee9 100644 --- a/cli/npm/resolvers/common.rs +++ b/cli/npm/resolvers/common.rs @@ -10,7 +10,6 @@ use deno_core::error::AnyError; use deno_core::futures; use deno_core::futures::future::BoxFuture; use deno_core::url::Url; -use deno_graph::npm::NpmPackageId; use deno_graph::npm::NpmPackageReq; use deno_runtime::deno_node::NodePermissions; use deno_runtime::deno_node::NodeResolutionMode; @@ -19,6 +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::NpmResolutionPackage; pub trait InnerNpmPackageResolver: Send + Sync { @@ -39,7 +39,10 @@ pub trait InnerNpmPackageResolver: Send + Sync { specifier: &ModuleSpecifier, ) -> Result; - fn package_size(&self, package_id: &NpmPackageId) -> Result; + fn package_size( + &self, + package_id: &NpmPackageNodeId, + ) -> Result; fn has_packages(&self) -> bool; -- cgit v1.2.3