-
Notifications
You must be signed in to change notification settings - Fork 762
Detect which version of yarn is being used #12633
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
Conversation
Change the install args based on yarn 1.x or 2+
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12633Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12633" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the default Yarn install arguments in publish mode by adding version detection logic. The code now differentiates between Yarn 1.x (Classic) and Yarn 2+ (Berry) and uses the appropriate flag for each version.
Key changes:
- Modified
GetDefaultYarnInstallArgsto detect Yarn version based on presence of.yarnrc.ymlor.yarn/releasesdirectory - Changed default behavior to use
--frozen-lockfilefor Yarn 1.x and--immutablefor Yarn 2+ - Added test coverage for the new Yarn version detection logic
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Aspire.Hosting.NodeJs/NodeExtensions.cs |
Implemented Yarn version detection logic in GetDefaultYarnInstallArgs to return appropriate install flags based on detected version |
tests/Aspire.Hosting.NodeJs.Tests/PackageInstallationTests.cs |
Updated existing test to expect --frozen-lockfile for Yarn 1.x and added two new tests verifying --immutable flag when Yarn 2+ indicators are present |
Co-authored-by: Copilot <[email protected]>
adamint
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, other than adding a comment for additional context
|
/backport to release/13 |
|
Started backporting to release/13: https://github.com/dotnet/aspire/actions/runs/19048867211 |
|
@eerhardt an error occurred while backporting to "release/13", please check the run log for details! Error: The specified backport target branch "release/13" wasn't found in the repo. |
|
/backport to release/13.0 |
|
Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19048879965 |
Description
Change the install args based on yarn 1.x or 2+
Checklist