diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-02-17 09:12:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-17 09:12:22 -0500 |
commit | 610b8cc2bf6404d0905cc273b31d85555a6912e9 (patch) | |
tree | 8e7bf0a56a90e6bb33462a86e6d886501fb4c621 /cli/npm/resolvers/common.rs | |
parent | f8435d20b0e9408e50bfb24793becc0e476cc285 (diff) |
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.
Diffstat (limited to 'cli/npm/resolvers/common.rs')
-rw-r--r-- | cli/npm/resolvers/common.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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<PathBuf, AnyError>; - fn package_size(&self, package_id: &NpmPackageId) -> Result<u64, AnyError>; + fn package_size( + &self, + package_id: &NpmPackageNodeId, + ) -> Result<u64, AnyError>; fn has_packages(&self) -> bool; |