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

Validation should be configurable based on operation #406

Open
GeoffreyBooth opened this issue Feb 27, 2024 · 4 comments
Open

Validation should be configurable based on operation #406

GeoffreyBooth opened this issue Feb 27, 2024 · 4 comments

Comments

@GeoffreyBooth
Copy link
Member

It should be possible to define package manager constraints separately for certain operations, for example install/uninstall operations could get validation but run would allow any package manager. This would allow mixing and matching of package managers, for example pnpm to install packages but then Bun to run scripts.

Split off from #402.

@aduh95
Copy link
Contributor

aduh95 commented Feb 27, 2024

Currently you can use an env variable to disable validation, but I think you’re asking about something else. Do you have a specific format for the configuration in mind?

@arcanis
Copy link
Contributor

arcanis commented Feb 27, 2024

This would allow mixing and matching of package managers, for example pnpm to install packages but then Bun to run scripts.

Fwiw as a package manager author that's exactly why I'd prefer Corepack to not support this.

Mixing package managers together has been a relatively frequent source of issues, going from crashes (since the loader hooks aren't setup) to subtly incorrect behaviour (since the Yarn configuration and internal hooks are skipped).

If this feature was supported, we'd likely strongly advise our users against it - perhaps even making it a warning or error if we detected this pattern.

@GeoffreyBooth
Copy link
Member Author

GeoffreyBooth commented Feb 27, 2024

Most packages managers don't install loader hooks. Like npm for install and Bun for run should work perfectly well together I'd think. Maybe Yarn would advise against it and that's fine, but I don't think that's universal.

Most people seem to version pin to avoid corrupting lockfiles. That only matters for adding or removing dependencies. If those are the only operations those users need version pinning for, it would open up other use cases to allow validation to be enforced only for those operations.

@darcyclarke
Copy link
Member

darcyclarke commented Feb 27, 2024

Mixing package managers together has been a relatively frequent source of issues, going from crashes (since the loader hooks aren't setup) to subtly incorrect behaviour (since the Yarn configuration and internal hooks are skipped).

If this feature was supported, we'd likely strongly advise our users against it - perhaps even making it a warning or error if we detected this pattern.

So you might say one of Corepack's goals is to ensure package managers do not work together?

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

4 participants