-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(nuget): Add workspaces support for sequential publishing #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Add automatic discovery of NuGet packages from .sln/.csproj files - Topologically sort packages by dependencies for correct publish order - Change from parallel (Promise.all) to sequential publishing - Remove --skip-duplicate flag (no longer needed with proper ordering) - Add workspace config options: workspaces, solutionPath, includeWorkspaces, excludeWorkspaces, artifactTemplate - Security: All discovery uses static file parsing only (no code execution) Closes #649
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
|
…tPattern Refactor escapeRegex helper to top-level function and use it in packageIdToNugetArtifactPattern to properly escape all regex meta-characters, not just dots.
…pattern - Export escapeRegex from workspaces.ts for reuse - Fix packageNameToArtifactPattern to escape all regex special chars - Use shared escapeRegex in dotnetWorkspaces.ts and powershell.ts
Instead of fully sequential publishing, use p-limit to allow up to 3 concurrent package uploads. This provides a good balance between speed and avoiding overwhelming NuGet.org.
|
hey @BYK , thanks for looking at improving the nuget upload experience. Uploading things in order is probably an improvement (though processing the packages happen async so not sure nuget.org will actually process them in order too) Did you try this out with our SDK? Some things worth noting: Our SDK doesn't only rely on Wrt parsing .sln, note that there's a .slnx file now and we plan (should at least) to migrate over to it eventually once tooling is more mature around it. One other thing is that we have solution filters in the repo, which we use to develop different parts (Mobile vs Web etc) but I don't think this will affect craft or your PR. But worth mentioning for context. Lastly and this might affect this PR is that we output not only nupkg but also snupkg files, which contain the debug symbols. But if at the end of the day it's judt running Hope this context helps. Lets hear from @Flash0ver who is the maintainer of .NET he might have other/more context here. |
- Artifact patterns now match both .nupkg and .snupkg (symbol packages) - Add .slnx (XML-based solution) file format support - Add explicit tests for escapeRegex backslash handling - Prefer .slnx over .sln when both exist
|
@bruno-garcia thanks a lot for the great feedback! I'm just vibe coding this to get the ball rolling. Fed your feedback to Cursor and it did some more things: f0be729 I'll wait for @Flash0ver's review and tests on the SDK repo as this is being done mostly for our own SDK :) |
Summary
Add workspaces support to the NuGet target, enabling automatic discovery of .NET packages from solution files, topological sorting based on project dependencies, and sequential publishing in the correct order.
Closes #649
Changes
New utility module (
src/utils/dotnetWorkspaces.ts):.slnfiles using regex (static text parsing).csprojfiles using XML parser to extract package info and dependenciesNuGet target enhancements (
src/targets/nuget.ts):expand()method for workspace expansionworkspaces,solutionPath,includeWorkspaces,excludeWorkspaces,artifactTemplate--skip-duplicateflag (no longer needed with proper ordering)Promise.alltoforEachChainedfor sequential publishingSecurity: All discovery uses static file parsing only - no code execution from target repo
Tests: 29 new unit tests for the utility and target expansion
Documentation: Updated
nuget.mdwith workspace configuration options and examplesExample Configuration