NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.55k stars 643 forks source link

NuGet.org should have a NuGet version/framework service equivalent to npm semver calculator #7828

Open nkolev92 opened 4 years ago

nkolev92 commented 4 years ago

Is your feature request related to a problem? Please describe.

NuGet's versioning can get rather complex. The version range schema requires an explanation that goes beyond just examples. Same thing applies to the frameworks. As an eco system we are trying to cognitive load needed but we're not there yet, and honestly it'd be helpful despite that :) Now the question might be whether nuget.org is the right place for that, but I don't think we have a better place for it.

Describe the solution you'd like

A semver parsing service equivalent to https://semver.npmjs.com/. This would ideally do versions + frameworks because frameworks are a .NET complexity.

Fortunately for us, @joelverhagen has implemented a very good starting point http://nugettoolsdev.azurewebsites.net/.

Additional context

Our initial implementation doesn't have to be as fancy as npms, I think we should only focus on the:

joelverhagen commented 4 years ago

I've started playing around with this idea a bit. I think an exciting model for this application would be:

  1. Blazor WebAssembly app
  2. Depend on NuGet.Versioning .NET Standard 2.0
  3. Fetch versions per ID like the NPM tool from the V3 API since they support CORS
  4. All logic lives client-side
  5. Deploy to Azure Blob Storage

I don't know how far I will get but one of the drawbacks of my https://nugettoolsdev.azurewebsites.net tool is that it runs in an app service, meaning it costs compute, and that it runs in .NET Framework. I did this because I wanted to run multiple versions of NuGet code in parallel via App Domains.

Perhaps we can trick Blazor into running multiple versions of assemblies in parallel and also lie about the compatibility of older NuGet package versions that only targeted .NET Framework or < .NET Standard 2.0...

Anyways a good start is to just target the latest version of NuGet libraries and run in browser 😄.

nkolev92 commented 4 years ago

Perhaps we can trick Blazor into running multiple versions of assemblies in parallel and

I don't see why https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext?view=netcore-3.1 shoudln't work. Then again, I don't think this is a heavily exercised approach :D

also lie about the compatibility of older NuGet package versions that only targeted .NET Framework or < .NET Standard 2.0

Yeah that happens by default for all .NET Core projects :) There are no fancy APIs used in NuGet.Versioning, all the APis have been ported to .NET Core.