aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-core/src/installer
AgeCommit message (Collapse)Author
2026-05-11chore(lint): add Ruby linter scripts and apply rulesnsfisis
Adds scripts/lint with linters for mod.rs naming, contiguous use blocks, use-as aliasing, sorted Cargo dependencies, std::collections maps, and workspace dependency requirements. Renames mod.rs files, reorders use statements, drops unnecessary import aliases, and sorts Cargo.toml entries to satisfy the new rules.
2026-05-11refactor(package): rename traits and switch dep maps to IndexMapnsfisis
Rename Package/CompletePackage to PackageInterface/CompletePackageInterface to mirror Composer's interface names, and split each into its own module under crates/mozart-core/src/package/. Switch dependency-link and metadata maps from BTreeMap to indexmap::IndexMap so serialized JSON preserves the original key ordering rather than sorting alphabetically — matching PHP associative-array semantics. The --sort-packages behaviour in `require` is preserved via sort_unstable_keys.
2026-05-10refactor(io): introduce IoInterface trait mirroring Composer IOInterfacensfisis
Add an `IoInterface` trait in mozart-core::console that mirrors `\Composer\IO\IOInterface`, implement it for `Console`, and switch commands, the auditor, and the suggested-packages reporter to accept the abstracted IO (typically `Arc<Mutex<Box<dyn IoInterface>>>` at the command boundary, `&dyn IoInterface` deeper down) instead of `&Console`. The console_writeln\!/write\! macros now go through `IoInterface::verbosity()` via the lock so any implementor works.
2026-05-08fix(check-platform-reqs): align with Composer's CheckPlatformReqsCommand flownsfisis
Mirror `CheckPlatformReqsCommand::execute` end-to-end: build an `InstalledRepoLite` from lock/installed plus the root and the real PlatformRepository, ksort the combined `$requires`, and run the candidate matching loop with `findPackagesWithReplacersAndProviders` so an installed package that `provide`s or `replace`s a platform name (e.g. `symfony/polyfill-mbstring` providing `ext-mbstring`) is now recognised as satisfying the requirement. Fixes the JSON output schema to match Composer: `failed_requirement` is the `{source, type, target, constraint}` object (or null), `provider` is the bare "provided by …" string (or null), and `status` is the unwrapped `success`/`failed`/`missing`. Also switches `--format` to a clap `value_parser` and replaces the "No installed packages found" hard error with Composer's warn-then- proceed path so an empty lock yields `[]` and exit 0. Adds `mozart_core::installer::InstalledCandidate` plus `InstalledRepoLite::add_candidate` / `find_with_replacers_and_providers` as the shared substrate for future commands (`depends`, `prohibits`, `audit`) that need the same provider/replacer index.