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

[Feature] Add hash for packageManager to set version CLI command #6657

Open
1 of 2 tasks
MikeMcC399 opened this issue Jan 16, 2025 · 1 comment
Open
1 of 2 tasks

[Feature] Add hash for packageManager to set version CLI command #6657

MikeMcC399 opened this issue Jan 16, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@MikeMcC399
Copy link

MikeMcC399 commented Jan 16, 2025

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

As a package creator or maintainer, I want to add or update the version of Yarn stored in the packageManager key of the package.json manifest for use when Corepack is enabled.
I want to have consistent results whether I use the

to set the Yarn package manager version.

Describe the solution you'd like

When the Yarn CLI command set version is executed, and it places a packageManager key into the package.json manifest, the key should include a hash. The effect should be the same as executing corepack use.

Describe the drawbacks of your solution

There should not be any drawbacks, because Corepack already uses and generates a packageManager key with a hash, and Yarn is already using this.

Describe alternatives you've considered

This is an update to an existing Yarn CLI command, so it could not easily be put into a plugin.

Other

package.json examples:

Example yarn (4.6.0)

Execute yarn set version 4.6.0

{
  "packageManager": "[email protected]"
}

Example corepack (0.30.0)

Execute corepack use [email protected]

{
  "packageManager": "[email protected]+sha512.5383cc12567a95f1d668fbe762dfe0075c595b4bfff433be478dbbe24e05251a8e8c3eb992a986667c1d53b6c3a9c85b8398c35a960587fbd9fa3a0915406728"
}
@MikeMcC399 MikeMcC399 added the enhancement New feature or request label Jan 16, 2025
@MikeMcC399
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant