aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/create_project.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-10 00:32:08 +0900
committernsfisis <nsfisis@gmail.com>2026-05-10 00:32:08 +0900
commit8cc1ba8a02c0318b65658f1634de378c780392b9 (patch)
treefdd5cb61e488018891a486b25991b87c84220bb8 /crates/mozart/src/commands/create_project.rs
parent72b2e877c01e67ba7edd37e34ac2eadb7a1c62c4 (diff)
downloadphp-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/create_project.rs')
-rw-r--r--crates/mozart/src/commands/create_project.rs31
1 files changed, 16 insertions, 15 deletions
diff --git a/crates/mozart/src/commands/create_project.rs b/crates/mozart/src/commands/create_project.rs
index ff9776d..2b2fbe1 100644
--- a/crates/mozart/src/commands/create_project.rs
+++ b/crates/mozart/src/commands/create_project.rs
@@ -3,12 +3,12 @@ use indexmap::IndexMap;
use mozart_core::console::Console;
use mozart_core::console_format;
use mozart_core::package::{self, Stability};
+use mozart_core::repository::downloader;
+use mozart_core::repository::lockfile;
+use mozart_core::repository::packagist;
+use mozart_core::repository::resolver::{self, PlatformConfig, ResolveRequest};
+use mozart_core::repository::version;
use mozart_core::validation;
-use mozart_registry::downloader;
-use mozart_registry::lockfile;
-use mozart_registry::packagist;
-use mozart_registry::resolver::{self, PlatformConfig, ResolveRequest};
-use mozart_registry::version;
use std::path::{Path, PathBuf};
#[derive(Args)]
@@ -498,8 +498,8 @@ async fn install_project(
.and_then(|v| v.as_bool())
.unwrap_or(false);
- 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);
let request = ResolveRequest {
root_name: raw.name.clone(),
@@ -515,7 +515,7 @@ async fn install_project(
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: raw.repositories.clone(),
@@ -559,7 +559,7 @@ async fn install_project(
composer_json: raw.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: None,
lock_pinned_names: indexmap::IndexSet::new(),
@@ -611,9 +611,10 @@ async fn install_project(
.and_then(|v| v.as_bool())
.unwrap_or(false);
- let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache);
- let files_cache = mozart_registry::cache::Cache::files(&cache_config);
- let mut executor = mozart_registry::installer_executor::FilesystemExecutor::new(files_cache);
+ let cache_config = mozart_core::repository::cache::build_cache_config(cli.no_cache);
+ let files_cache = mozart_core::repository::cache::Cache::files(&cache_config);
+ let mut executor =
+ mozart_core::repository::installer_executor::FilesystemExecutor::new(files_cache);
super::install::install_from_lock(
&new_lock,
&target_dir,
@@ -726,9 +727,9 @@ async fn install_root_package(
let (_, minimum_stability) = resolve_stability(stability, package_version.as_deref())?;
// --- Find the best candidate matching constraint + stability ---
- let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache);
- let repo_cache = mozart_registry::cache::Cache::repo(&cache_config);
- let files_cache = mozart_registry::cache::Cache::files(&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);
+ let files_cache = mozart_core::repository::cache::Cache::files(&cache_config);
let versions = packagist::fetch_package_versions(&name, &repo_cache).await?;