aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core/src/package.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 01:07:59 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 01:57:21 +0900
commite532af7ea66f7245725feb3eb515cc467b23c405 (patch)
tree956bdcf0fcefbaccc2f4c305602861fed34dd4c2 /crates/mozart-core/src/package.rs
parent6676b4bb36159e161b6bb0edbe5b3762f43832f4 (diff)
downloadphp-mozart-e532af7ea66f7245725feb3eb515cc467b23c405.tar.gz
php-mozart-e532af7ea66f7245725feb3eb515cc467b23c405.tar.zst
php-mozart-e532af7ea66f7245725feb3eb515cc467b23c405.zip
fix(create-project): fix self.version rewriting and autoloader config
- Extend self.version replacement to conflict, provide, and replace link types (previously only require and require-dev) - Only rewrite self.version when VCS metadata is actually removed, matching Composer's behavior - Read optimize-autoloader, classmap-authoritative, and apcu-autoloader from the project's composer.json config section instead of hardcoding false Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart-core/src/package.rs')
-rw-r--r--crates/mozart-core/src/package.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/mozart-core/src/package.rs b/crates/mozart-core/src/package.rs
index 9904dc4..ce2ff12 100644
--- a/crates/mozart-core/src/package.rs
+++ b/crates/mozart-core/src/package.rs
@@ -488,6 +488,15 @@ pub struct RawPackageData {
)]
pub require_dev: BTreeMap<String, String>,
+ #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
+ pub conflict: BTreeMap<String, String>,
+
+ #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
+ pub provide: BTreeMap<String, String>,
+
+ #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
+ pub replace: BTreeMap<String, String>,
+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub repositories: Vec<RawRepository>,
@@ -534,6 +543,9 @@ impl RawPackageData {
minimum_stability: None,
require: BTreeMap::new(),
require_dev: BTreeMap::new(),
+ conflict: BTreeMap::new(),
+ provide: BTreeMap::new(),
+ replace: BTreeMap::new(),
repositories: Vec::new(),
autoload: None,
bin: Vec::new(),