diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-10 00:32:08 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-10 00:32:08 +0900 |
| commit | 8cc1ba8a02c0318b65658f1634de378c780392b9 (patch) | |
| tree | fdd5cb61e488018891a486b25991b87c84220bb8 /crates/mozart/src/commands/remove.rs | |
| parent | 72b2e877c01e67ba7edd37e34ac2eadb7a1c62c4 (diff) | |
| download | php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.tar.gz php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.tar.zst php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.zip | |
refactor(workspace): consolidate crates into mozart-core
Merged mozart-archiver, mozart-autoload, mozart-registry,
mozart-sat-resolver, and mozart-vcs into mozart-core to align
the source layout with Composer's structure.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/remove.rs')
| -rw-r--r-- | crates/mozart/src/commands/remove.rs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/crates/mozart/src/commands/remove.rs b/crates/mozart/src/commands/remove.rs index d4d727f..c2d4d47 100644 --- a/crates/mozart/src/commands/remove.rs +++ b/crates/mozart/src/commands/remove.rs @@ -3,9 +3,9 @@ use indexmap::{IndexMap, IndexSet}; use mozart_core::console_format; use mozart_core::console_writeln; use mozart_core::package; -use mozart_registry::installed; -use mozart_registry::lockfile; -use mozart_registry::resolver::{self, PlatformConfig, ResolveRequest}; +use mozart_core::repository::installed; +use mozart_core::repository::lockfile; +use mozart_core::repository::resolver::{self, PlatformConfig, ResolveRequest}; #[derive(Args)] pub struct RemoveArgs { @@ -102,8 +102,8 @@ pub async fn execute( cli: &super::Cli, console: &mozart_core::console::Console, ) -> anyhow::Result<()> { - let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache); - let repo_cache = mozart_registry::cache::Cache::repo(&cache_config); + let cache_config = mozart_core::repository::cache::build_cache_config(cli.no_cache); + let repo_cache = mozart_core::repository::cache::Cache::repo(&cache_config); if args.packages.is_empty() && !args.unused { anyhow::bail!("Not enough arguments (missing: \"packages\")."); @@ -242,7 +242,7 @@ pub async fn execute( ignore_platform_reqs: args.ignore_platform_reqs, ignore_platform_req_list: args.ignore_platform_req.clone(), repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist(repo_cache.clone()), + mozart_core::repository::repository::RepositorySet::with_packagist(repo_cache.clone()), ), temporary_constraints: IndexMap::new(), raw_repositories: composer.repositories.clone(), @@ -344,7 +344,7 @@ pub async fn execute( composer_json: composer.clone(), include_dev: dev_mode, repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist(repo_cache.clone()), + mozart_core::repository::repository::RepositorySet::with_packagist(repo_cache.clone()), ), previous_lock: old_lock.clone(), lock_pinned_names: IndexSet::new(), @@ -430,10 +430,10 @@ pub async fn execute( } if !args.no_install && !args.dry_run { - let cache_config = mozart_registry::cache::build_cache_config(no_cache); - let files_cache = mozart_registry::cache::Cache::files(&cache_config); + let cache_config = mozart_core::repository::cache::build_cache_config(no_cache); + let files_cache = mozart_core::repository::cache::Cache::files(&cache_config); let mut executor = - mozart_registry::installer_executor::FilesystemExecutor::new(files_cache); + mozart_core::repository::installer_executor::FilesystemExecutor::new(files_cache); super::install::install_from_lock( &new_lock, &working_dir, @@ -499,7 +499,7 @@ async fn remove_unused( composer: &package::RawPackageData, working_dir: &std::path::Path, args: &RemoveArgs, - repo_cache: &mozart_registry::cache::Cache, + repo_cache: &mozart_core::repository::cache::Cache, no_cache: bool, console: &mozart_core::console::Console, ) -> anyhow::Result<()> { @@ -546,7 +546,7 @@ async fn remove_unused( ignore_platform_reqs: args.ignore_platform_reqs, ignore_platform_req_list: args.ignore_platform_req.clone(), repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist(repo_cache.clone()), + mozart_core::repository::repository::RepositorySet::with_packagist(repo_cache.clone()), ), temporary_constraints: IndexMap::new(), raw_repositories: composer.repositories.clone(), @@ -625,7 +625,7 @@ async fn remove_unused( composer_json: composer.clone(), include_dev: dev_mode, repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist(repo_cache.clone()), + mozart_core::repository::repository::RepositorySet::with_packagist(repo_cache.clone()), ), previous_lock: Some(old_lock.clone()), lock_pinned_names: IndexSet::new(), @@ -637,10 +637,10 @@ async fn remove_unused( if !args.no_install { let vendor_dir = working_dir.join("vendor"); - let cache_config = mozart_registry::cache::build_cache_config(no_cache); - let files_cache = mozart_registry::cache::Cache::files(&cache_config); + let cache_config = mozart_core::repository::cache::build_cache_config(no_cache); + let files_cache = mozart_core::repository::cache::Cache::files(&cache_config); let mut executor = - mozart_registry::installer_executor::FilesystemExecutor::new(files_cache); + mozart_core::repository::installer_executor::FilesystemExecutor::new(files_cache); super::install::install_from_lock( &new_lock, working_dir, @@ -672,7 +672,7 @@ async fn remove_unused( mod tests { use super::*; use mozart_core::package::RawPackageData; - use mozart_registry::lockfile; + use mozart_core::repository::lockfile; use std::collections::BTreeMap; fn make_locked_package(name: &str, version: &str) -> lockfile::LockedPackage { @@ -920,8 +920,8 @@ mod tests { #[ignore] async fn test_remove_full_e2e() { use indexmap::{IndexMap, IndexSet}; - use mozart_registry::lockfile::{LockFileGenerationRequest, generate_lock_file}; - use mozart_registry::resolver::{ResolveRequest, resolve}; + use mozart_core::repository::lockfile::{LockFileGenerationRequest, generate_lock_file}; + use mozart_core::repository::resolver::{ResolveRequest, resolve}; use tempfile::tempdir; let dir = tempdir().unwrap(); @@ -944,12 +944,12 @@ mod tests { stability_flags: IndexMap::new(), prefer_stable: true, prefer_lowest: false, - platform: mozart_registry::resolver::PlatformConfig::new(), + platform: mozart_core::repository::resolver::PlatformConfig::new(), ignore_platform_reqs: false, ignore_platform_req_list: vec![], repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist( - mozart_registry::cache::Cache::new( + mozart_core::repository::repository::RepositorySet::with_packagist( + mozart_core::repository::cache::Cache::new( std::env::temp_dir().join("mozart-test-cache"), false, ), @@ -976,8 +976,8 @@ mod tests { composer_json: composer.clone(), include_dev: false, repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist( - mozart_registry::cache::Cache::new( + mozart_core::repository::repository::RepositorySet::with_packagist( + mozart_core::repository::cache::Cache::new( std::env::temp_dir().join("mozart-test-cache"), false, ), @@ -1005,12 +1005,12 @@ mod tests { stability_flags: IndexMap::new(), prefer_stable: true, prefer_lowest: false, - platform: mozart_registry::resolver::PlatformConfig::new(), + platform: mozart_core::repository::resolver::PlatformConfig::new(), ignore_platform_reqs: false, ignore_platform_req_list: vec![], repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist( - mozart_registry::cache::Cache::new( + mozart_core::repository::repository::RepositorySet::with_packagist( + mozart_core::repository::cache::Cache::new( std::env::temp_dir().join("mozart-test-cache"), false, ), @@ -1039,8 +1039,8 @@ mod tests { composer_json: composer, include_dev: false, repositories: std::sync::Arc::new( - mozart_registry::repository::RepositorySet::with_packagist( - mozart_registry::cache::Cache::new( + mozart_core::repository::repository::RepositorySet::with_packagist( + mozart_core::repository::cache::Cache::new( std::env::temp_dir().join("mozart-test-cache"), false, ), |
