aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core/src/package.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart-core/src/package.rs')
-rw-r--r--crates/mozart-core/src/package.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/mozart-core/src/package.rs b/crates/mozart-core/src/package.rs
index 02ec935..8bda13d 100644
--- a/crates/mozart-core/src/package.rs
+++ b/crates/mozart-core/src/package.rs
@@ -461,6 +461,13 @@ pub struct RawPackageData {
#[serde(default = "default_root_package_name")]
pub name: String,
+ /// Root project's version, when explicitly set. Composer falls back to
+ /// `1.0.0+no-version-set` when this is missing; we keep the raw `Option`
+ /// here and let the resolver apply that default so the in-memory shape
+ /// stays close to the JSON input.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub version: Option<String>,
+
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
@@ -554,6 +561,7 @@ impl RawPackageData {
pub fn new(name: String) -> Self {
Self {
name,
+ version: None,
description: None,
package_type: None,
homepage: None,