aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/require.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-21 14:11:18 +0900
committernsfisis <nsfisis@gmail.com>2026-02-21 14:11:18 +0900
commit294bd3dd425a374eda13a52b925a2cd0c4db7f0a (patch)
treef63a008b88113ac2548affbd0a662879f14b1ed7 /crates/mozart/src/commands/require.rs
parent48e88e9e204a38d1e31483412003f1492fa8fdcf (diff)
downloadphp-mozart-294bd3dd425a374eda13a52b925a2cd0c4db7f0a.tar.gz
php-mozart-294bd3dd425a374eda13a52b925a2cd0c4db7f0a.tar.zst
php-mozart-294bd3dd425a374eda13a52b925a2cd0c4db7f0a.zip
feat(depends): implement depends and prohibits commands with shared dependency logic
Add the `depends` (why) and `prohibits` (why-not) commands that query the dependency graph to answer "which packages require X?" and "which packages prevent version Y of X from being installed?" respectively. Introduces the shared `dependency` module with package loading from lock file or installed.json, forward/inverted dependency graph walking, recursive traversal with cycle detection, and table/tree output formatters. Adds `conflict` field to LockedPackage for conflict-based prohibition detection, updating all struct literals across install, remove, require, and update test helpers. 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.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/require.rs b/crates/mozart/src/commands/require.rs
index 0bbd351..ee40d54 100644
--- a/crates/mozart/src/commands/require.rs
+++ b/crates/mozart/src/commands/require.rs
@@ -504,6 +504,7 @@ mod tests {
dist: None,
require: BTreeMap::new(),
require_dev: BTreeMap::new(),
+ conflict: BTreeMap::new(),
suggest: None,
package_type: Some("library".to_string()),
autoload: None,