aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--crates/mozart-registry/src/lockfile.rs17
-rw-r--r--crates/mozart/tests/installer.rs2
2 files changed, 18 insertions, 1 deletions
diff --git a/crates/mozart-registry/src/lockfile.rs b/crates/mozart-registry/src/lockfile.rs
index 70e4a42..5114fb7 100644
--- a/crates/mozart-registry/src/lockfile.rs
+++ b/crates/mozart-registry/src/lockfile.rs
@@ -636,6 +636,23 @@ fn packagist_version_to_locked_package(name: &str, pv: &PackagistVersion) -> Loc
serde_json::Value::String(notification_url.clone()),
);
}
+ // Propagate `abandoned` so the lock (and downstream installed.json
+ // round-trip) preserves the package's deprecation state. Mirrors
+ // Composer's `ArrayDumper::dump`, which emits the field when truthy
+ // (`true` for "abandoned, no replacement", a string for "abandoned,
+ // use this instead"). `false`/null collapse to "not abandoned" and
+ // are dropped.
+ if let Some(abandoned) = &pv.abandoned {
+ let keep = match abandoned {
+ serde_json::Value::Bool(b) => *b,
+ serde_json::Value::String(s) => !s.is_empty(),
+ serde_json::Value::Null => false,
+ _ => true,
+ };
+ if keep {
+ extra_fields.insert("abandoned".to_string(), abandoned.clone());
+ }
+ }
LockedPackage {
name: name.to_string(),
diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs
index fd8ab73..e0dcb42 100644
--- a/crates/mozart/tests/installer.rs
+++ b/crates/mozart/tests/installer.rs
@@ -407,7 +407,7 @@ installer_fixture!(
update_security_advisory_matching_indirect_dependency,
ignore
);
-installer_fixture!(update_syncs_outdated, ignore);
+installer_fixture!(update_syncs_outdated);
installer_fixture!(update_to_empty_from_blank);
installer_fixture!(update_to_empty_from_locked);
installer_fixture!(update_with_all_dependencies);