Skip to content

Added full support for Nuget package resolution#23

Open
pingu2k4 wants to merge 1 commit intovercel-labs:mainfrom
pingu2k4:feature/support-nuget
Open

Added full support for Nuget package resolution#23
pingu2k4 wants to merge 1 commit intovercel-labs:mainfrom
pingu2k4:feature/support-nuget

Conversation

@pingu2k4
Copy link

This pull request adds support for NuGet packages to the opensrc CLI tool, enabling source code fetching, listing, and removal for .NET packages alongside existing npm, PyPI, and crates.io registries. It also introduces command-line options and documentation updates to reflect NuGet support. The most important changes are grouped below:

NuGet Registry Support

  • Added NuGet registry support throughout the CLI, including fetch, list, and remove commands, and recognized aliases (dotnet:, nupkg:) for NuGet packages. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Updated CLI program options and help text to include NuGet, and ensured registry detection logic recognizes NuGet and its aliases. [1] [2] [3]

Command Enhancements

  • Added --allow-prerelease option to fetch the latest NuGet package including prerelease versions, wired through CLI and fetch logic. [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated the list command to show NuGet packages in their own section, and display NuGet in supported registries when no packages are fetched. [1] [2] [3]
  • Modified remove command logic to fall back to NuGet registry if default lookup fails, and added CLI support for removing only NuGet packages. [1] [2] [3] [4] [5]

Documentation Updates

  • Updated README.md and AGENTS.md to document NuGet support, CLI usage examples, and registry aliases. [1] [2] [3] [4] [5]

Testing

  • Added and updated tests for NuGet registry detection, CLI routing, fetch, list, and remove commands to ensure NuGet support is robust. [1] [2] [3] [4] [5] [6] [7]

Path Handling

  • Updated path handling in tests to use join for improved cross-platform compatibility. [1] [2]

These changes collectively enable seamless handling of NuGet packages in the opensrc tool, making it more useful for .NET developers and teams.

@vercel
Copy link

vercel bot commented Feb 27, 2026

@pingu2k4 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines +82 to +83
const [aCore, aPre] = aMain.split("-", 2);
const [bCore, bPre] = bMain.split("-", 2);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [aCore, aPre] = aMain.split("-", 2);
const [bCore, bPre] = bMain.split("-", 2);
const aHyphen = aMain.indexOf("-");
const aCore = aHyphen >= 0 ? aMain.slice(0, aHyphen) : aMain;
const aPre = aHyphen >= 0 ? aMain.slice(aHyphen + 1) : undefined;
const bHyphen = bMain.indexOf("-");
const bCore = bHyphen >= 0 ? bMain.slice(0, bHyphen) : bMain;
const bPre = bHyphen >= 0 ? bMain.slice(bHyphen + 1) : undefined;

compareNuGetVersions truncates prerelease labels containing hyphens (e.g., dev-02419 becomes dev), causing distinct prerelease versions to compare as equal.

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant