janet-lang / jpm

Janet Project Manager
MIT License
68 stars 22 forks source link

show dependency tree for a package #35

Open uvtc opened 2 years ago

uvtc commented 2 years ago

Before installing a package, it would be useful to first see what other packages would be pulled in during its installation.

Would it make sense for jpm to be able to figure out and display a package depependency tree?

sogaiu commented 1 year ago

In the general case, I think it's currently necessary to fetch the direct dependencies in order to start the recursive process of determining what all of the transitive dependencies are (which may lead to additional fetching).

One way to learn what all dependencies for a given project are without having to "install" those things into one's default JANET_PATH is to use --local / -l like: jpm -l deps [1].

That will fetch all required dependencies and place them in jpm_tree where they could then be inspected.

Perhaps not quite what the original idea was but at least a significant portion of the desired information can be obtained this way (not the dependency tree per se, but at least an enumeration of all of the dependencies).


[1] If a location other than the default is desired for this, I guess one can use the --tree option to specify something different.