From 82667e0a1d2c728f2f8f084a5f7591e0fc006dcf Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 9 May 2026 00:20:06 +0900 Subject: refactor(install): Slice A — align install.rs with Composer's InstallCommand pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Match Composer's deprecation wording for --dev and --no-suggest (A1) - Add missing URL to lock-fallback warning (A2) - Reorder arg validation to match InstallCommand::execute order (A3) - Rename collect_install_* helpers to verify_lock_* and consolidate into a single verify_lock() entry point (A4) - Couple classmap_authoritative=true → optimize_autoloader=true, mirroring Composer's setter side-effects (Installer.php 1263-1272) (A5) - Centralise is_platform_package in mozart_core::platform, removing divergent local copies from install.rs and update.rs (A6) - Move compute_operations, topological_sort, alias helpers, and locked_to_installed_entry into mozart-registry::installer_executor:: transaction, re-exported from the parent module (A8) Co-Authored-By: Claude Sonnet 4.6 --- crates/mozart/src/commands/update.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'crates/mozart/src/commands/update.rs') diff --git a/crates/mozart/src/commands/update.rs b/crates/mozart/src/commands/update.rs index 92a998d..de9c5e3 100644 --- a/crates/mozart/src/commands/update.rs +++ b/crates/mozart/src/commands/update.rs @@ -2,6 +2,7 @@ use clap::Args; use indexmap::{IndexMap, IndexSet}; use mozart_core::console_format; use mozart_core::package::{self, Stability}; +use mozart_core::platform::is_platform_package; use mozart_registry::lockfile; use mozart_registry::resolver::{ self, LockedPackageInfo, PlatformConfig, ResolveRequest, ResolvedPackage, @@ -235,18 +236,6 @@ fn parse_minimum_stability(s: &str) -> Stability { package::Stability::parse(s) } -/// Check whether a package name refers to a platform package (php, ext-*, lib-*, composer-*). -fn is_platform_package(name: &str) -> bool { - let lower = name.to_lowercase(); - lower == "php" - || lower.starts_with("ext-") - || lower.starts_with("lib-") - || lower.starts_with("composer-") - || lower == "composer" - || lower == "composer-runtime-api" - || lower == "composer-plugin-api" -} - /// Compare old lock vs new lock to determine installs, updates, removals, and unchanged packages. /// /// Produces one `UpdateChange` per affected package. Packages that are identical in both -- cgit v1.3.1