Skip to content
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

Support corepack #1157

Merged
merged 4 commits into from
Aug 11, 2024
Merged

Support corepack #1157

merged 4 commits into from
Aug 11, 2024

Conversation

stevestorey
Copy link
Contributor

Summary

Adds support for using corepack to manage the package manager in use on a given build project.

Tests and Documentation

README is updated, an integration example has been provided

Fixes: #1032

This adds some basic support for using corepack to manage the tooling
via the 'packageManager' field in the package.json. Here we add the
ability to download a version of it along with a node version, along
with the ability to execute command via corepack such as 'pnpm install'
or 'yarn install' depending on the selected package manager.

Later we ought to work out how to use the version packaged with the node
runtime, but this was inspired by the pnpm download which is downloaded
separately, and so this is too.
@ansgarkroger
Copy link

@eirslett, do you think there's a chance to get this PR merged and released? Corepack seems to be the best way to support modern Yarn (only way I got it to work in my project)

@davidmedinasigasi
Copy link

@eirslett, any change this could get merged? my team would really benefit from this

In most uses, users will want to ues the version of corepack provided
with the NodeJS version they are using, and the plugin now supports this
mode of usage by default if no corepack version is explicitly provided.
@stevestorey
Copy link
Contributor Author

I've added one more commit to use the corepack version provided with the Node install if no override version is provided (which is probably what most people want to do)

@eirslett
Copy link
Owner

Thanks! Looks like this is a much requested feature, so I'll merge it in! (given that the test suite works)

@eirslett eirslett merged commit 8c26a6d into eirslett:master Aug 11, 2024
3 checks passed
@benkelaar
Copy link

@eirslett Anything I can do to help get this released?

I was slightly thrown off by the corepack targets in the readme that didn't seem to work :-)

@eirslett
Copy link
Owner

Hey! Sorry, I tried to release it but I got some auth issues from Sonatype. It will probably take a few hours of digging :-/
And I was a bit surprised by the news that Node.js will (probably?) stop bundling Coreback. So maybe this plugin shouldn't support using the bundled one.

@stevestorey
Copy link
Contributor Author

And I was a bit surprised by the news that Node.js will (probably?) stop bundling Coreback

Thanks for highlighting. That's very disappointing :( - tho as yet they've not put a timeframe on dropping it from the bundle.

maybe this plugin shouldn't support using the bundled one.

I would suggest that until they do set a timeframe, we can safely continue to use the bundled version.

Since bumping the node version on the plugin is an explicit step, even if we changed nothing and a new version of Node is published without corepack - nothing should break for existing users' builds.

When they bump their node version on the plugin, they'll pretty quickly realise they need to set a corepack version as well (which, from what I read, should still work and be a supported config).

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.

Support for corepack
5 participants