From 8ecb8e5ea476886cb3f62a8efa4a8189e2aa4740 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 21 Feb 2026 11:18:26 +0900 Subject: feat(autoload): generate Composer-compatible PHP autoloader files Implement autoloader generation that produces all standard Composer autoloader files (autoload.php, autoload_real.php, autoload_static.php, autoload_psr4.php, autoload_namespaces.php, autoload_classmap.php, autoload_files.php, installed.php) plus embeds ClassLoader.php, InstalledVersions.php, and LICENSE from the Composer submodule. Wire into the install command (gated by --no-autoloader) and replace the todo!() in dump-autoload with a working implementation. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/install.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crates/mozart/src/commands/install.rs') diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index ddf7be8..97f42e7 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -395,6 +395,22 @@ pub fn execute(args: &InstallArgs, cli: &super::Cli) -> anyhow::Result<()> { } new_installed.write(&vendor_dir)?; + + // Step 14: Generate autoloader (unless --no-autoloader) + if !args.no_autoloader { + eprintln!("Generating autoload files"); + + let suffix = lock.content_hash.clone(); + + crate::autoload::generate(&crate::autoload::AutoloadConfig { + project_dir: working_dir.clone(), + vendor_dir: vendor_dir.clone(), + dev_mode, + suffix, + })?; + + eprintln!("Generated autoload files"); + } } Ok(()) -- cgit v1.3.1