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.
This commit is contained in:
David Sherret 2023-02-17 09:12:22 -05:00 committed by GitHub
parent f8435d20b0
commit 610b8cc2bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 494 additions and 243 deletions

View file

@ -11,7 +11,6 @@ use deno_core::error::custom_error;
use deno_core::error::AnyError;
use deno_core::parking_lot::Mutex;
use deno_core::serde_json;
use deno_graph::npm::NpmPackageId;
use deno_graph::npm::NpmPackageReq;
use deno_runtime::deno_node::NodePermissions;
use deno_runtime::deno_node::NodeResolutionMode;
@ -32,6 +31,7 @@ use crate::util::fs::canonicalize_path_maybe_not_exists;
use self::common::InnerNpmPackageResolver;
use self::local::LocalNpmPackageResolver;
use super::NpmCache;
use super::NpmPackageNodeId;
use super::NpmResolutionSnapshot;
use super::RealNpmRegistryApi;
@ -225,7 +225,7 @@ impl NpmPackageResolver {
/// Attempts to get the package size in bytes.
pub fn package_size(
&self,
package_id: &NpmPackageId,
package_id: &NpmPackageNodeId,
) -> Result<u64, AnyError> {
self.inner.package_size(package_id)
}