summaryrefslogtreecommitdiff
path: root/cli/npm/resolution
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-01-23 23:41:02 +0100
committerGitHub <noreply@github.com>2023-01-23 23:41:02 +0100
commitbf237c6241f53122e37341a0dda65ef9e3b51a49 (patch)
treee352b4f60887e4d009cacdef250b7e8c294ff829 /cli/npm/resolution
parentcd192313064bc2e9d65e3e734930cfaf15f4191b (diff)
refactor: Move lockfile to a separate crate (#17503)
Moves the lockfile implementation to a separate crate so other projects like Deploy can use it as well.
Diffstat (limited to 'cli/npm/resolution')
-rw-r--r--cli/npm/resolution/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/npm/resolution/mod.rs b/cli/npm/resolution/mod.rs
index c4d05598c..f10678cbe 100644
--- a/cli/npm/resolution/mod.rs
+++ b/cli/npm/resolution/mod.rs
@@ -397,10 +397,13 @@ impl NpmResolution {
pub fn lock(&self, lockfile: &mut Lockfile) -> Result<(), AnyError> {
let snapshot = self.snapshot.read();
for (package_req, package_id) in snapshot.package_reqs.iter() {
- lockfile.insert_npm_specifier(package_req, package_id);
+ lockfile.insert_npm_specifier(
+ package_req.to_string(),
+ package_id.as_serialized(),
+ );
}
for package in snapshot.all_packages() {
- lockfile.check_or_insert_npm_package(&package)?;
+ lockfile.check_or_insert_npm_package(package.into())?;
}
Ok(())
}