aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/run_script.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-06 18:05:27 +0900
committernsfisis <nsfisis@gmail.com>2026-05-06 18:05:27 +0900
commit3d128352f93c4416d087069947920e9fa864df7d (patch)
tree52026a6ae07ad0dbc2a62e487dd4d9550992e3b8 /crates/mozart/src/commands/run_script.rs
parent4a9aff1af9fc74d2928fe54210d6aad5f0afd0b7 (diff)
downloadphp-mozart-3d128352f93c4416d087069947920e9fa864df7d.tar.gz
php-mozart-3d128352f93c4416d087069947920e9fa864df7d.tar.zst
php-mozart-3d128352f93c4416d087069947920e9fa864df7d.zip
feat(core): port Factory::createComposer and AutoloadGenerator::dump
Add the Composer state-container types (LocalRepository, RepositoryManager, InstallationManager, AutoloadGenerator, AutoloadDumpOptions, PlatformRequirementFilter, Locker) plus the factory wiring that builds them from composer.json and vendor/composer/installed.json. AutoloadGenerator::dump lives in mozart-autoload as an extension trait so the orchestrating algorithm sits next to the classmap scanner while the state container stays in mozart-core. Rework dump-autoload to drive both, mirroring $composer->getAutoloadGenerator()->dump(...).
Diffstat (limited to 'crates/mozart/src/commands/run_script.rs')
-rw-r--r--crates/mozart/src/commands/run_script.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/mozart/src/commands/run_script.rs b/crates/mozart/src/commands/run_script.rs
index f7ce7b9..77ed1c7 100644
--- a/crates/mozart/src/commands/run_script.rs
+++ b/crates/mozart/src/commands/run_script.rs
@@ -1,4 +1,5 @@
use clap::Args;
+use mozart_core::composer::Composer;
use mozart_core::console_writeln;
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
@@ -79,7 +80,7 @@ pub async fn execute(
let working_dir = cli.working_dir()?;
// RunScriptCommand uses requireComposer in Composer; composer.json must exist.
- let composer = mozart_core::composer::Composer::require(&working_dir)?;
+ let composer = Composer::require(&working_dir)?;
let (scripts, descriptions) = load_scripts(&working_dir)?;
@@ -444,7 +445,7 @@ fn wait_with_timeout(
}
}
-fn resolve_bin_dir(working_dir: &Path, composer: &mozart_core::composer::Composer) -> PathBuf {
+fn resolve_bin_dir(working_dir: &Path, composer: &Composer) -> PathBuf {
// bin-dir's `{$vendor-dir}` placeholder is already resolved by Composer::load.
working_dir.join(&composer.config().bin_dir)
}