NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

Can we have dependency graph feature ? (Showing Parent & Child relationship of different dependencies) #12218

Closed rohitcoder closed 1 year ago

rohitcoder commented 1 year ago

NuGet Product(s) Involved

dotnet.exe, NuGet SDK, Other/NA

The Elevator Pitch

We need a JSON output of the parent & child dependencies list, right now we're using dotnet list /tmp/project package --include-transitive but this doesn't show a relationship and this is not in JSON format, since we already have a PR https://github.com/NuGet/NuGet.Client/pull/4855 related to JSON output of dependencies, now it's time to work on Making these dependency graphs.

Additional Context and Details

No response

nkolev92 commented 1 year ago

Duplicate in https://github.com/NuGet/Home/issues/6339.

harshsikhwal commented 1 year ago

I have implemented my own version of dependency generator: NuGet-Visualizer

An interactive python script which helps users to generate dependencies for both NuGet and .NET Solution.

Graph for Microsoft.CodeAnalysis.CSharp: codeanalysis graph

Hope this helps!

pombredanne commented 1 year ago

@rohitcoder you wrote:

We need a JSON output of the parent & child dependencies list, right now we're using dotnet list /tmp/project package --include-transitive but this doesn't show a relationship and this is not in JSON format, since we already have a PR NuGet/NuGet.Client#4855 related to JSON output of dependencies, now it's time to work on Making these dependency graphs.

Try this new, work-in-progress (standalone) tool at https://github.com/nexB/nuget-inspector

From a proj or sln file, it outputs a resolved dependency tree in JSON. It honors both legacy and current manifests and lockfiles (project.lock.json lockfile, project.json, packages.config) and (proj projectreferences and project.assets.json lockfile)... and calls the nuget libraries to resolve dependencies live as needed. It is designed to run as a self-contained, standalone CLI utility on Linux/Windows/macOS no donet installation needed. feedback mucho welcomed!