aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/packagist.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-21 12:40:07 +0900
committernsfisis <nsfisis@gmail.com>2026-02-21 12:40:07 +0900
commit70881be20ebedad2834566065444f76a67e7cc8c (patch)
tree944fb174756da817eede4a3af1cc29b752744c05 /crates/mozart/src/packagist.rs
parent18761d9b67a09c0148ae606da10db0d1266932f9 (diff)
downloadphp-mozart-70881be20ebedad2834566065444f76a67e7cc8c.tar.gz
php-mozart-70881be20ebedad2834566065444f76a67e7cc8c.tar.zst
php-mozart-70881be20ebedad2834566065444f76a67e7cc8c.zip
feat(lockfile): generate lock file from resolver results
Add lock file generation pipeline that converts resolved packages into a complete composer.lock structure. Extends PackagistVersion with 15 metadata fields (authors, license, autoload, etc.), implements BFS-based dev package classification, platform requirements extraction, and content-hash computation. Cleans up unused skip_serializing_if attributes on the Deserialize-only PackagistVersion struct. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/packagist.rs')
-rw-r--r--crates/mozart/src/packagist.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/mozart/src/packagist.rs b/crates/mozart/src/packagist.rs
index 7246ee6..b589a77 100644
--- a/crates/mozart/src/packagist.rs
+++ b/crates/mozart/src/packagist.rs
@@ -32,6 +32,41 @@ pub struct PackagistVersion {
pub conflict: BTreeMap<String, String>,
pub dist: Option<PackagistDist>,
pub source: Option<PackagistSource>,
+
+ #[serde(rename = "require-dev", default)]
+ pub require_dev: BTreeMap<String, String>,
+
+ #[serde(default)]
+ pub suggest: Option<BTreeMap<String, String>>,
+
+ #[serde(rename = "type")]
+ pub package_type: Option<String>,
+
+ pub autoload: Option<serde_json::Value>,
+
+ #[serde(rename = "autoload-dev")]
+ pub autoload_dev: Option<serde_json::Value>,
+
+ pub license: Option<Vec<String>>,
+
+ pub description: Option<String>,
+
+ pub homepage: Option<String>,
+
+ pub keywords: Option<Vec<String>>,
+
+ pub authors: Option<Vec<serde_json::Value>>,
+
+ pub support: Option<serde_json::Value>,
+
+ pub funding: Option<Vec<serde_json::Value>>,
+
+ pub time: Option<String>,
+
+ pub extra: Option<serde_json::Value>,
+
+ #[serde(rename = "notification-url")]
+ pub notification_url: Option<String>,
}
/// Parse a Packagist p2 API JSON response.