aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/show.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-08 02:41:45 +0900
committernsfisis <nsfisis@gmail.com>2026-05-08 02:41:45 +0900
commitb3fcdf3b5cf0d6b43109c4bcb3dfcbb6576abce5 (patch)
tree14c5270d7f39932a57acbfb176f05faa4ec74a8f /crates/mozart/src/commands/show.rs
parent2fee33109dbc81dadeb152f38bea3050c4a0bfa2 (diff)
downloadphp-mozart-b3fcdf3b5cf0d6b43109c4bcb3dfcbb6576abce5.tar.gz
php-mozart-b3fcdf3b5cf0d6b43109c4bcb3dfcbb6576abce5.tar.zst
php-mozart-b3fcdf3b5cf0d6b43109c4bcb3dfcbb6576abce5.zip
fix(browse): mirror Composer's HomeCommand semantics
Replace the hand-rolled composer.json -> composer.lock -> Packagist fallback with a BrowseRepos composite that dispatches via a uniform find_packages(name) over the root package, the local installed repository, and the Packagist remote -- matching HomeCommand's initializeRepos() + findPackages() loop. - Extend InstalledPackageEntry with homepage/support so the local repo carries the same fields HomeCommand reads off CompletePackageInterface; propagate them through locked_to_installed_entry. - Collapse three extract_url_from_* helpers into a single handle_package mirror. - Relax is_valid_url to a filter_var(FILTER_VALIDATE_URL) analog (drop the http/https scheme allowlist). - Route warnings and "No package specified" notices to stderr; match HomeCommand's exact wording. - Merge the macOS/Linux open_browser branches; add the literal "web" window-title argument on Windows.
Diffstat (limited to 'crates/mozart/src/commands/show.rs')
-rw-r--r--crates/mozart/src/commands/show.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/show.rs b/crates/mozart/src/commands/show.rs
index 7b87403..c675d54 100644
--- a/crates/mozart/src/commands/show.rs
+++ b/crates/mozart/src/commands/show.rs
@@ -2062,6 +2062,8 @@ mod tests {
install_path: None,
autoload: None,
aliases: vec![],
+ homepage: None,
+ support: None,
extra_fields: extra,
};
assert_eq!(get_installed_description(&pkg), "A logging library");
@@ -2080,6 +2082,8 @@ mod tests {
install_path: None,
autoload: None,
aliases: vec![],
+ homepage: None,
+ support: None,
extra_fields: BTreeMap::new(),
};
assert_eq!(get_installed_description(&pkg), "");
@@ -2103,6 +2107,8 @@ mod tests {
install_path: None,
autoload: None,
aliases: vec![],
+ homepage: None,
+ support: None,
extra_fields: extra,
};
assert_eq!(get_installed_keywords(&pkg), "log, psr3, logging");