Skip to content

Use corepack to run Yarn#5859

Merged
valadas merged 5 commits intodnnsoftware:developfrom
bdukes:use-yarn-via-corepack
Nov 6, 2023
Merged

Use corepack to run Yarn#5859
valadas merged 5 commits intodnnsoftware:developfrom
bdukes:use-yarn-via-corepack

Conversation

@bdukes
Copy link
Copy Markdown
Contributor

@bdukes bdukes commented Nov 6, 2023

Summary

As demonstrated in #5858, the Cake build does not work when Yarn has not been installed. The recommended way to install Yarn is via Corepack, which is included with Node.js since version 16.9.0.

Corepack will read the packageManager field from package.json to determine the correct package manager and its version, and get a copy dynamically, instead of using the JS file checked into the repository.

This PR updates the build task which runs Yarn commands to do so via Corepack, to avoid an extra install step. It also adds a check for Corepack and fails the build if it is not available.

@bdukes bdukes added this to the 9.13.1 milestone Nov 6, 2023
Copy link
Copy Markdown
Contributor

@mitchelsellers mitchelsellers left a comment

Choose a reason for hiding this comment

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

This is awesome!

Copy link
Copy Markdown
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

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

AwesomeGrandmaGIF

@valadas valadas merged commit a94acf8 into dnnsoftware:develop Nov 6, 2023
@bdukes bdukes deleted the use-yarn-via-corepack branch November 6, 2023 18:27
@KirillOsenkov
Copy link
Copy Markdown

Hey @bdukes, this is amazing, thanks so much!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants