From af0df92e1ecc82823a510646b7545278caeac4b8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 24 Feb 2026 00:23:30 +0900 Subject: feat(cache): enable repo cache for all Packagist API calls Remove the Option wrapper from repo_cache in ResolveRequest, LockFileGenerationRequest, and fetch_package_versions. All commands now initialize a Cache via build_cache_config(cli.no_cache), ensuring Packagist metadata is cached to disk (respecting --no-cache flag). Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/create_project.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/mozart/src/commands/create_project.rs') diff --git a/crates/mozart/src/commands/create_project.rs b/crates/mozart/src/commands/create_project.rs index 83ad21d..63d8a1a 100644 --- a/crates/mozart/src/commands/create_project.rs +++ b/crates/mozart/src/commands/create_project.rs @@ -272,7 +272,10 @@ pub async fn execute( )); console.info("Loading composer repositories with package information"); - let versions = packagist::fetch_package_versions(&package_name, None).await?; + let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache); + let repo_cache = mozart_registry::cache::Cache::repo(&cache_config); + + let versions = packagist::fetch_package_versions(&package_name, &repo_cache).await?; // Find the best candidate matching the version constraint and stability let best = if let Some(ref constraint) = version_constraint { @@ -411,7 +414,7 @@ pub async fn execute( platform: PlatformConfig::new(), ignore_platform_reqs: args.ignore_platform_reqs, ignore_platform_req_list: args.ignore_platform_req.clone(), - repo_cache: None, + repo_cache: repo_cache.clone(), temporary_constraints: HashMap::new(), repositories: raw.repositories.clone(), }; @@ -432,7 +435,7 @@ pub async fn execute( composer_json_content: composer_json_content.clone(), composer_json: raw.clone(), include_dev: dev_mode, - repo_cache: None, + repo_cache: repo_cache.clone(), }) .await?; -- cgit v1.3.1