| Age | Commit message (Collapse) | Author |
|
Add per-fixture #[test] entries (187 total) via a small declarative
macro that reads files directly from the composer submodule. For now
each test only asserts the file parses; execution and EXPECT-* checks
will be layered on as the harness gains comparison helpers.
|
|
Foundation for porting Composer's installer integration fixtures.
Parser covers the 13 sections of InstallerTest.php; runner sets up a
tempdir from COMPOSER/LOCK/INSTALLED and invokes the mozart binary.
No fixtures are migrated in this commit.
|
|
files_cache was Option<&Cache> and install_from_lock always passed None,
so downloaded zip/tar archives were never cached. Make the parameter
non-optional (&Cache) and wire it through every command that downloads
dist archives (install, update, require, remove, create-project,
archive). The Cache internally respects --no-cache via its enabled flag,
so the Option wrapper was unnecessary.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
The watch graph's propagateLiteral used a cloned chain for iteration
while checking the live chain for bounds. After move_watch removed a
node, the stale clone kept re-reading the same node index, causing an
infinite loop on large dependency sets (e.g. laravel/laravel).
Now re-fetch the live chain each iteration, matching Composer's
SplDoublyLinkedList semantics where remove() advances the iterator.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
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 <noreply@anthropic.com>
|
|
Add #[tracing::instrument] and debug logs to all HTTP-calling
functions in mozart-registry and mozart-vcs for request-level
observability (URL, status code, cache hits, download size).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace direct println\!/eprintln\! calls with console.write(),
console.info(), and console.write_stdout() across all command
handlers to respect verbosity settings.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Migrate eprintln\! to Console for consistent colored output
- Use Composer terminology in lock file operations: Locking instead of
Installing, Upgrading/Downgrading instead of Updating
- Add is_downgrade() helper to distinguish upgrades from downgrades
- Pass Console through install_from_lock for proper output handling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
`parse_hyphen_range` was using `<=` for all upper bounds, but Composer
treats partial versions (1-2 segments) differently: `8.1 - 8.5` should
mean `>=8.1.0 <8.6.0-dev`, not `>=8.1.0 <=8.5.0`. This caused
constraints like `php 8.1 - 8.5` to reject PHP 8.5.3.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Improves testability and ensures proper resource cleanup by returning
errors through the existing MozartError/exit_code mechanism instead of
terminating the process directly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Sync descriptions with upstream Composer. Replace product name
references (Composer/composer) with Mozart.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace manual tokio::runtime::Handle::current().block_on() calls with
native async/await throughout all VCS drivers. Introduce AnyVcsDriver
enum for static dispatch to avoid dyn trait with async methods.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Implement VCS driver/downloader infrastructure mirroring Composer's VCS
subsystem. Includes drivers for GitHub, GitLab, Bitbucket, Forgejo, Git,
Hg, and SVN with API-based metadata resolution, plus source downloaders
for Git/Hg/SVN. Integrates into mozart-registry via vcs_bridge module to
scan VCS repositories and feed discovered packages into the SAT resolver.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Detect scripts-descriptions and scripts-aliases keys referencing
non-existent scripts and emit warnings matching Composer's behavior
- Respect config.lock=false in composer.json to skip lock file checks
unless --check-lock is explicitly passed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- clean-backups now preserves the most recent backup for rollback
- Rollback no longer deletes the backup file after restoring
- Show version and channel in update/already-up-to-date messages
- Print rollback suggestion after successful update
- Show version instead of file path in rollback output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer stores repositories as {"name": {"type":...}} while Mozart
only understood [{"name":"name","type":...}]. This adds normalization
so Mozart can read both formats for list, get-url, set-url, and remove.
Also distinguishes "no URL" from "not found" in get-url errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Use installed packages by default instead of always preferring lock file
- Error on unknown needle package instead of misleading "can be installed"
- Return exit code 1 when prohibitors are found
- Deduplicate output rows in dependency table
- Print resolution hint suggesting require/update --dry-run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
passthrough
- Parse and apply --with temporary constraints to the resolver
- Support inline constraint shorthand (vendor/pkg:1.0.*)
- Reject --lock combined with specific package names
- Filter magic keywords (lock/nothing/mirrors) from package list
- Pass APCu CLI flags through to InstallConfig instead of hardcoding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Reject invalid option combinations: --direct with --all/--platform/--available,
--tree with --all/--available/--latest/--path, --self with package argument
- Reject unsupported --format values (only "text" and "json" allowed)
- Warn when --ignore is used without --outdated
- Support wildcard patterns in --ignore values via matches_wildcard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Revert composer.json and composer.lock to original content on resolution failure
- Detect and remove packages from opposite section to prevent duplicates
- Block self-require (requiring the root package itself)
- Read sort-packages, optimize-autoloader, classmap-authoritative, and
apcu-autoloader from composer.json config as defaults
- Pass APCu CLI flags through to InstallConfig instead of hardcoding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer
- Extract matches_wildcard to mozart-core for reuse across commands
- Support wildcard patterns in --package and --ignore arguments
- Use ^<installed_version> for semver-safe classification instead of root constraint
- Replace std::process::exit(1) with bail_silent for proper cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Match Composer's help output by adding long_about with a description
and link to https://getcomposer.org/doc/03-cli.md#suggests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Switch from blocklist to whitelist for script event blocking, detect
all namespaced PHP callbacks (not just *Command), use bail_silent for
exit codes, remove redundant COMPOSER_DEV_MODE env_overrides, handle
--timeout 0 as no timeout, and respect --no-scripts flag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
COMPOSER_DEV_MODE
Emit per-pattern warnings for unmatched package names, read
optimize-autoloader/classmap-authoritative/apcu-autoloader from
composer.json config section, and set COMPOSER_DEV_MODE env var.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Match Composer's Symfony Table formatting: add Name/Version/Licenses
header row to text output and use bordered ASCII table for summary.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Add COMPOSER_DEFAULT_VENDOR env var support for package name default
- Swap USERNAME/USER check order to match Composer (matters on Windows)
- Add COMPOSER_DEFAULT_AUTHOR/COMPOSER_DEFAULT_EMAIL env var support
- Require both name and email for author (Composer behavior)
- Use bail_silent for abort to prevent double error message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Style vendor names with <comment> (yellow) and package names with
<info> (green) to match Composer's Symfony Console output. Route all
output through Console::write_stdout() so --quiet is respected.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace std::process::exit() with bail_silent() so Rust cleanup runs
properly. Style the binary listing output with console_format\! markup
to match Composer's Symfony Console styling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace std::process::exit() with bail_silent() so Rust cleanup and
Drop handlers run properly on non-zero exit. Add a check for git
color.ui=always which is known to cause issues with git output parsing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Extend self.version replacement to conflict, provide, and replace
link types (previously only require and require-dev)
- Only rewrite self.version when VCS metadata is actually removed,
matching Composer's behavior
- Read optimize-autoloader, classmap-authoritative, and apcu-autoloader
from the project's composer.json config section instead of hardcoding
false
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer auto-detects the shell from the $SHELL environment variable
when the shell argument is not provided. Mozart previously required
the argument and errored without it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Match Composer's ClearCacheCommand behavior:
- Print per-directory status messages (clearing/GC) instead of a single summary
- Skip read-only caches with an informational message
- Print message for non-existent cache directories instead of silently skipping
- Catch filesystem errors and always return exit code 0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer writes advisory and abandoned-package output to stderr,
reserving stdout for JSON format only. Mozart was writing everything
to stdout, which breaks piping and scripting workflows.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer's BumpCommand uses ERROR_LOCK_OUTDATED=2 for stale lock files,
but Mozart was using LOCK_FILE_INVALID=4. Define a local constant to
avoid conflicting with the global exit code registry.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
symlink detection
- Route headers and hints to stderr, package paths to stdout
- Show full install path instead of vendor/<name> (M)
- Detect symlinked packages and report instead of diffing
- Add verbose hint message when not using -v
- Replace std::process::exit(1) with bail_silent for proper cleanup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Replace two-line output (name+counts, indented description) with
Composer's single-line aligned format: padded name, abandoned warning,
and terminal-width-aware description truncation. Remove summary header
and download/faver count display from text output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
output messages
- Pass --apcu-autoloader and --apcu-autoloader-prefix through to
InstallConfig instead of hardcoding false/None
- Set --audit-format default to "summary" matching Composer behavior
- Print "./composer.json has been updated" after modification
- Print "Running composer update <packages>" before resolution step
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
apcu-prefix implicit enable
- Restrict --prefer-install to source/dist/auto and --audit-format to
table/plain/json/summary via clap value_parser
- Error when --prefer-install is combined with --prefer-source/--prefer-dist
- Wire --download-only through InstallConfig to skip autoloader and installed.json
- Implicitly enable --apcu-autoloader when --apcu-autoloader-prefix is set
- Apply same validation fixes to update, require, remove, create-project commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Rewrite composer_home() with Composer-compatible resolution: detect XDG
environment (any XDG_* var or /etc/xdg), prefer existing directories,
and fall back to ~/.composer for legacy systems. Consolidate duplicate
composer_home_dir() from global.rs into shared config_helpers. Accept
no subcommand gracefully with a helpful error instead of a parse error.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Read optimize-autoloader, classmap-authoritative, apcu-autoloader from
composer.json config section. Reject --dev with --no-dev and --strict-psr/
--strict-ambiguous without --optimize. Emit pre/post generation messages
with class count in optimized mode. Track ambiguous class mappings and
exit with code 2 when --strict-ambiguous detects conflicts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Without --locked, prefer vendor/composer/installed.json over composer.lock
to match Composer's data source priority. Add platform packages (php, ext-*,
lib-*) from detect_platform() so queries like `depends php` work. Show a
specific error message when a platform package is not found.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Add 18 missing config keys to config_value_type() including cache-read-only
(was in defaults but unmanageable), audit.* dotted keys, and bool-or-enum
keys like store-auths and bump-after-update. Implement --absolute flag to
resolve *-dir values to absolute paths. Fix render_value() to JSON-encode
arrays and use lowercase "null", matching Composer output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Emit Composer-compatible stderr messages indicating which source is used
(lock file, vendor dir, or fallback). Detect empty installed.json and
fall back to the lock file with a warning instead of silently succeeding.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer-compatible output
Add value_parser for --format to enable shell completion with valid formats.
Parse @stability suffix (e.g. 1.0@beta) from version constraints before
resolution. Align output messages with Composer: "Searching for the specified
package.", match reporting, and split "Created:" across stderr/stdout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
launch
Replace simple prefix check in is_valid_url with url::Url::parse() for
structural validation (e.g. "https://" with no host now correctly
rejected). Update Windows open_browser to use `start "web" explorer`
matching Composer's HomeCommand behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Validate license input against SPDX identifiers, also accepting
"proprietary". Interactive mode re-prompts on invalid input;
non-interactive mode exits with an error. Fall back to
COMPOSER_DEFAULT_LICENSE env var when no --license flag is given.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Strip constraint suffixes (`:^2.0`, `=2.0`, ` ^2.0`) from filter args
and replace exact matching with glob pattern matching (`psr/*`) to match
Composer's BumpCommand behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
platform
Remove hardcoded early-return that always marked lib-*, composer-plugin-api,
and composer-runtime-api as Missing. These packages now go through the normal
platform lookup, matching Composer's behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer returns exit code 1 and writes to stderr when no packages
match the reinstall patterns. Mozart was returning 0 with a stdout
message, which could mislead CI pipelines into thinking the command
succeeded.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Composer errors when more than one of --major-only, --minor-only, or
--patch-only is specified. Mozart was silently giving --major-only
precedence. Now both show and outdated commands validate mutual
exclusivity with the same error message as Composer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|