bjorkstromm / depends

Tool for generating dependency trees for .NET projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add nuget.org information for dependencies

damageboy opened this issue · comments

Would be nice to use the nuget repository for the discovered dependencies to figure out display stuff like:

  • Latest Version (outdated packages)
  • Short descriptions of the nuget dependency

I really like this project and would like to contribute. Could we come up with a more detailed specification for this issue so I could try my best to implement it?

@NikiforovAll thanks! Any thoughts on how you would like to implement this? One could just be as simple as opening the package over at nuget.org. Another would be to download the package metadata from the registration URL (https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource) and display it in a dialogue.

I think the main goal is to be able to peak at NuGet package without leaving the terminal.

Here is my take on it:

What

We could show next information:

  • items.items[:latest:].description // this gives as latest description of the package
  • items.items[:top5:].catalogEntry.version // latest 5 packages information
  • items.upper: "3.4.1"
  • items.lower: "3.0.0-beta"
  • 🔗 hyperlink to nuget.org (if relevant). Since Windows Terminal 1.4 supports hyperlinks, this would be nice addition.

E.g. https://api.nuget.org/v3/registration3/nuget.server.core/index.json

How

I think we could add another layout that could be toggled when the current dependency comes from NuGet.

image

@NikiforovAll sounds like you have a great plan! 👍 looking forward to your PR.

Please note we already have a dependency on the NuGet Client libs, so we can easily use the PackageMetadataResource in order to get registration info. More info here https://daveaglick.com/posts/exploring-the-nuget-v3-libraries-part-2 Here also some usage on NuGet Client libs inside Depends https://github.com/mholo65/depends/blob/master/src/Depends.Core/DependencyAnalyzer.cs#L42