diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-06-08 11:48:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 11:48:29 -0400 |
commit | 55f01508540e015563e5e54fd0652e81b347b9c1 (patch) | |
tree | dee62f23a86df0545801956aa4422825b940e821 /cli/npm/resolution.rs | |
parent | 976c38104569182ba41d9351a108e673f63ffb98 (diff) |
refactor(compile): store the npm snapshot in the eszip (#19343)
Diffstat (limited to 'cli/npm/resolution.rs')
-rw-r--r-- | cli/npm/resolution.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/cli/npm/resolution.rs b/cli/npm/resolution.rs index 66dfafb51..c02a992e7 100644 --- a/cli/npm/resolution.rs +++ b/cli/npm/resolution.rs @@ -18,7 +18,6 @@ use deno_npm::resolution::NpmResolutionSnapshotCreateOptions; use deno_npm::resolution::PackageNotFoundFromReferrerError; use deno_npm::resolution::PackageNvNotFoundError; use deno_npm::resolution::PackageReqNotFoundError; -use deno_npm::resolution::SerializedNpmResolutionSnapshot; use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot; use deno_npm::NpmPackageCacheFolderId; use deno_npm::NpmPackageId; @@ -50,7 +49,7 @@ impl std::fmt::Debug for NpmResolution { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let snapshot = self.snapshot.read(); f.debug_struct("NpmResolution") - .field("snapshot", &snapshot.as_serialized()) + .field("snapshot", &snapshot.as_valid_serialized().as_serialized()) .finish() } } @@ -263,8 +262,20 @@ impl NpmResolution { self.snapshot.read().clone() } - pub fn serialized_snapshot(&self) -> SerializedNpmResolutionSnapshot { - self.snapshot.read().as_serialized() + pub fn serialized_valid_snapshot( + &self, + ) -> ValidSerializedNpmResolutionSnapshot { + self.snapshot.read().as_valid_serialized() + } + + pub fn serialized_valid_snapshot_for_system( + &self, + system_info: &NpmSystemInfo, + ) -> ValidSerializedNpmResolutionSnapshot { + self + .snapshot + .read() + .as_valid_serialized_for_system(system_info) } pub fn lock(&self, lockfile: &mut Lockfile) -> Result<(), AnyError> { |