diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 14:30:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 14:30:17 +0900 |
| commit | 9148d0c707394f6e2529f04a767a602163d5bd95 (patch) | |
| tree | 6eeef1fc4341d9c95288d346c21e094d7aa899d9 /crates/mozart/src/commands/require.rs | |
| parent | 2d46dc9091c4fa1b68361425c561dad773a343b4 (diff) | |
| download | php-mozart-9148d0c707394f6e2529f04a767a602163d5bd95.tar.gz php-mozart-9148d0c707394f6e2529f04a767a602163d5bd95.tar.zst php-mozart-9148d0c707394f6e2529f04a767a602163d5bd95.zip | |
feat(install): add InstallConfig, platform warnings, and download progress
Replace positional boolean parameters in install_from_lock with a
structured InstallConfig. Add platform requirement warnings, download
progress display, classmap-authoritative autoloader support, and
prefer-source detection across install/update/require/remove commands.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/require.rs')
| -rw-r--r-- | crates/mozart/src/commands/require.rs | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs index ee40d54..b9ec258 100644 --- a/crates/mozart/src/commands/require.rs +++ b/crates/mozart/src/commands/require.rs @@ -477,13 +477,36 @@ pub fn execute(args: &RequireArgs, cli: &super::Cli) -> anyhow::Result<()> { // Install packages (unless --no-install or --dry-run) if !args.no_install && !args.dry_run { + // Warn about prefer-source (not yet supported) + let prefer_source = args.prefer_source + || args + .prefer_install + .as_deref() + .map(|s| s.eq_ignore_ascii_case("source")) + .unwrap_or(false); + if prefer_source { + eprintln!( + "{}", + crate::console::warning( + "Warning: Source installs are not yet supported. Falling back to dist." + ) + ); + } + super::install::install_from_lock( &new_lock, &working_dir, &vendor_dir, - dev_mode, - false, // dry_run already handled above - false, // no_autoloader: always generate autoloader + &super::install::InstallConfig { + dev_mode, + dry_run: false, // dry_run already handled above + no_autoloader: false, // always generate autoloader + no_progress: args.no_progress, + ignore_platform_reqs: args.ignore_platform_reqs, + ignore_platform_req: args.ignore_platform_req.clone(), + optimize_autoloader: args.optimize_autoloader, + classmap_authoritative: args.classmap_authoritative, + }, )?; } |
