aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/factory.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-04 22:37:18 +0900
committernsfisis <nsfisis@gmail.com>2026-06-04 22:37:53 +0900
commit20d665bb1247500d514f05b160d01f5f8e223a38 (patch)
tree0d49d9f928021380b4c932f4f14272415afa9272 /crates/shirabe/src/factory.rs
parentf429396f1cada5b7096d12c3cfaeea113018406c (diff)
downloadphp-shirabe-20d665bb1247500d514f05b160d01f5f8e223a38.tar.gz
php-shirabe-20d665bb1247500d514f05b160d01f5f8e223a38.tar.zst
php-shirabe-20d665bb1247500d514f05b160d01f5f8e223a38.zip
feat(loader): wire RootPackageLoader::load end-to-end
Resolve the remaining todo!()/placeholder sites in RootPackageLoader::load so the root package loads with real data: - Unbox config at use sites and change load()'s parameter from IndexMap<String, Box<PhpMixed>> to IndexMap<String, PhpMixed>, matching ArrayLoader::load / VersionGuesser::guess_version and dropping the redundant box/unbox round-trip at the factory call site. - Expose replace_version through CompletePackage/RootPackage inherent delegation and a RootPackageHandle method (PHP Package::replaceVersion, inherited), and apply it for the auto-versioned default. - Collect require/require-dev links via getter dispatch and build the pretty-string map feeding extractAliases/StabilityFlags/References. Also reconcile the package repositories type with Config: change CompletePackageInterface::{get,set}_repositories from Vec<IndexMap<String, PhpMixed>> to IndexMap<String, PhpMixed> (PHP's array<int|string, mixed>), wire setRepositories(config.getRepositories()), and dump repositories verbatim as a keyed array (matching PHP ArrayDumper) instead of forcing a list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/factory.rs')
-rw-r--r--crates/shirabe/src/factory.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/shirabe/src/factory.rs b/crates/shirabe/src/factory.rs
index ce45306..24ac2e0 100644
--- a/crates/shirabe/src/factory.rs
+++ b/crates/shirabe/src/factory.rs
@@ -673,10 +673,7 @@ impl Factory {
io.clone(),
);
let package = loader.load(
- local_config_data
- .iter()
- .map(|(k, v)| (k.clone(), Box::new(v.clone())))
- .collect(),
+ local_config_data.clone(),
"Composer\\Package\\RootPackage",
Some(&cwd),
)?;