dependency-cruiser icon indicating copy to clipboard operation
dependency-cruiser copied to clipboard

Feature request: Similar to reaches, add support for leaves

Open lambainsaan opened this issue 1 year ago • 2 comments

Add support for option leaves

Love this tool, but I am not able to solve one use case, when I want to understand what are the dependencies of a particular file.

focus gives incoming and outgoing nodes both, reaches gives incoming nodes, there is no option for just the outgoing nodes from a particular file.

Similar to https://github.com/sverweij/dependency-cruiser/issues/632, can we add support for --leaves command line argument.

Expected Behavior

If I have dependencies,

A -> B -> C and C -> E -> F and C -> G

if I pass the path B to leaves, it should generate the graph,

B -> C -> E -> F
       -> G

I can pick this up if there exists no way to achieve what I want.

lambainsaan avatar Sep 08 '22 07:09 lambainsaan

Hi @lambainsaan would pointing dependency-cruiser to the root file achieve what you want? E.g. (with the simple text reporter) like this:

depcruise src/B.ts -T text

# result would look something like this
# B.ts -> C.ts
# C.ts -> E.ts
# C.ts -> G.ts
# E.ts -> F.ts

The way dependency-cruiser works is it would look at B.ts, find its dependencies, look at each of these in the same way etc. until there's nothing more to find that hasn't already been visited.

sverweij avatar Sep 08 '22 16:09 sverweij

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Sep 16 '22 04:09 github-actions[bot]