diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-11 02:05:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-11 02:05:34 +0900 |
| commit | 4df5f8491320e5795718cf0222e80fa27e57c8ad (patch) | |
| tree | 707e19f34dbdef18490ec3245d34389e3d189a57 /crates/mozart/src/commands/bump.rs | |
| parent | 8871b923fa3df1935c263db155cb8bc3d59705cd (diff) | |
| download | php-mozart-4df5f8491320e5795718cf0222e80fa27e57c8ad.tar.gz php-mozart-4df5f8491320e5795718cf0222e80fa27e57c8ad.tar.zst php-mozart-4df5f8491320e5795718cf0222e80fa27e57c8ad.zip | |
refactor(package): rename traits and switch dep maps to IndexMap
Rename Package/CompletePackage to PackageInterface/CompletePackageInterface
to mirror Composer's interface names, and split each into its own module
under crates/mozart-core/src/package/.
Switch dependency-link and metadata maps from BTreeMap to indexmap::IndexMap
so serialized JSON preserves the original key ordering rather than sorting
alphabetically — matching PHP associative-array semantics. The
--sort-packages behaviour in `require` is preserved via sort_unstable_keys.
Diffstat (limited to 'crates/mozart/src/commands/bump.rs')
| -rw-r--r-- | crates/mozart/src/commands/bump.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/mozart/src/commands/bump.rs b/crates/mozart/src/commands/bump.rs index 351be01..2d6eea8 100644 --- a/crates/mozart/src/commands/bump.rs +++ b/crates/mozart/src/commands/bump.rs @@ -3,7 +3,7 @@ use clap::Args; use indexmap::IndexMap; use mozart_core::composer::LocalRepository; use mozart_core::console::IoInterface; -use mozart_core::package::{Link, Package as _}; +use mozart_core::package::PackageInterface as _; use mozart_core::{console_writeln, console_writeln_error}; use std::collections::BTreeMap; use std::path::Path; @@ -151,7 +151,7 @@ pub async fn do_bump( } } - let mut tasks: Vec<(&'static str, &BTreeMap<String, Link>)> = Vec::new(); + let mut tasks = Vec::new(); if !dev_only { tasks.push(("require", composer.package().requires())); } @@ -386,11 +386,11 @@ mod tests { version_normalized: Some(format!("{version}.0")), source: None, dist: None, - require: BTreeMap::new(), - require_dev: BTreeMap::new(), - conflict: BTreeMap::new(), - provide: BTreeMap::new(), - replace: BTreeMap::new(), + require: indexmap::IndexMap::new(), + require_dev: indexmap::IndexMap::new(), + conflict: indexmap::IndexMap::new(), + provide: indexmap::IndexMap::new(), + replace: indexmap::IndexMap::new(), suggest: None, package_type: None, autoload: None, @@ -403,7 +403,7 @@ mod tests { support: None, funding: None, time: None, - extra_fields: BTreeMap::new(), + extra_fields: indexmap::IndexMap::new(), } } |
