diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-09 02:29:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-09 02:29:49 +0900 |
| commit | f0192390ae1d89981f59395307e885a595f86eef (patch) | |
| tree | 45810437c406c2a6c5bc062b30f2dbbf1326eb59 /crates/mozart/src/commands/require.rs | |
| parent | 720430c0d08817f1113cbf35b541eaf673679fb9 (diff) | |
| download | php-mozart-f0192390ae1d89981f59395307e885a595f86eef.tar.gz php-mozart-f0192390ae1d89981f59395307e885a595f86eef.tar.zst php-mozart-f0192390ae1d89981f59395307e885a595f86eef.zip | |
refactor(update): Slice A — align update.rs with Composer's UpdateCommand pipeline
- Rename ChangeKind::Remove → Uninstall, drop Unchanged variant (propagate
to remove.rs / require.rs); mirrors Composer's UninstallOperation naming
- Fix magic-keyword mirrors detection: use Composer's count-diff semantic
(any keyword triggers mirrors mode) instead of all-are-magic; mutex check
now fires correctly for mixed lists like `update foo lock`
- Add --patch-only pre-solve lock-presence check (previously missing;
Composer throws InvalidArgumentException when no lock exists)
- Add --patch-only pre-solve constraint injection: inject >=M.N.P.0,<M.(N+1).0.0
into temporary_constraints before the resolver runs, mirroring
UpdateCommand::execute 177-195
- Delegate --bump-after-update to bump::do_bump (mirrors Composer's
BumpCommand::doBump delegate); add \!--lock guard per Composer 280-282
- Drop parse_minimum_stability wrapper; call package::Stability::parse directly
- Replace is_platform_dep with is_platform_package from mozart_core::platform
(the local variant was incomplete: missed hhvm and composer pseudo-packages)
- Wrap "Lock file operations" and "Writing lock file" in <info> tags
- Update --no-suggest deprecation wording to match Composer 3 message
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/require.rs')
| -rw-r--r-- | crates/mozart/src/commands/require.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs index 39b055f..22f7a8d 100644 --- a/crates/mozart/src/commands/require.rs +++ b/crates/mozart/src/commands/require.rs @@ -464,7 +464,7 @@ async fn do_update( .collect(); let removals: Vec<_> = changes .iter() - .filter(|c| matches!(c.kind, super::update::ChangeKind::Remove { .. })) + .filter(|c| matches!(c.kind, super::update::ChangeKind::Uninstall { .. })) .collect(); console.info(&format!( @@ -479,7 +479,7 @@ async fn do_update( for change in &changes { match &change.kind { - super::update::ChangeKind::Remove { old_version } => { + super::update::ChangeKind::Uninstall { old_version } => { if args.dry_run { console.info(&format!(" - Would remove {} ({old_version})", change.name)); } else { @@ -512,7 +512,6 @@ async fn do_update( )); } } - super::update::ChangeKind::Unchanged => {} } } |
