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

expose/isolate allowed package manager descriptors #326

Open
boneskull opened this issue Oct 27, 2023 · 3 comments
Open

expose/isolate allowed package manager descriptors #326

boneskull opened this issue Oct 27, 2023 · 3 comments

Comments

@boneskull
Copy link

It'd be super useful to be able to query whether or not a package manager string (e.g., yarn@3.2.3+sha224.953c8233f7a92884eee2de69a1b92d1f2ec1655e66d08071ba9a02fa or npm@latest) is valid without needing to invoke corepack. Or even the ability to grab a big list.

I haven't looked too closely at the source here, but it appears config.json determines how the package managers are found and downloaded, and Engine does that work. There's a CI job which updates config.json, too.

My use case is that I'm wrapping corepack and want to provide some input validation before I invoke it. Ideally, corepack could export some function I could call (resolveDescriptior()?)--instead of dropping into a child process. But that seems to be counter to the project goals, as it exports nothing.

What if some portion of the fetching/lookup were extracted into its own library, instead? Happy to look into this if you feel it's something you'd consider.

@boneskull boneskull changed the title expose/isolate known good releases expose/isolate package manager descriptors Oct 27, 2023
@boneskull boneskull changed the title expose/isolate package manager descriptors expose/isolate allowed package manager descriptors Oct 27, 2023
@boneskull
Copy link
Author

FWIW I wouldn't be opposed to extracting nearly all of corepack into a library. 😄

@arcanis
Copy link
Contributor

arcanis commented Oct 27, 2023

Seems interesting to me; main work to turn it into a library would probably be to document everything that's exposed.

@aduh95
Copy link
Contributor

aduh95 commented Feb 21, 2024

I agree that it would be useful to have Corepack as a library, if someone sends a PR, it would likely be accepted 👍

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

No branches or pull requests

3 participants