You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature request is not exactly the same than the one mentioned in #57. As introduced in the docs here, command corepack <binary name>[@<version>] [... args] allows to execute a package manager of our choice with custom arguments. This command checks whether the local project is configured for the given package manager.
I personnally would be interested with a command such as corepack exec [... args] (exec may not be the most relevant term however), that would take the exact release set in the packageManager property. I guess it is possible because in the command above, I assume corepack parses property packageManager in the package.json file to verify consistency with <binary name>.
Thus, I could run a command of the package manager whatever it is, and without repeating the binary name. This may be useful in writing plugins/extensions for build tools such as Maven, Gradle, acting as a bridge to launch npm/pnpm/yarn commands, without having to parse the package.json file and discover the package manager.
Thanks in advance for your comments.
BR
The text was updated successfully, but these errors were encountered:
Issue #57 deals explicitly with <packageManager> run commands, and having the package manager automatically added in the PATH for recursion. I didn't want to pollute the original request.
Both examples you introduced corepack exec run build and corepack exec install are typical UC I'm interested in. I don't see the subtleness for corepack itself between the 2 examples, Am I missing something?
My UC: I'm working on this Gradle plugin, that allows integrating a build of a Node.js-based project into a Gradle build. Actually, if the plugin needs to run a command of the selected package manager (I mean the one defined in the package.json file), it must repeat the binary name with corepack <binary name>[@<version>] [... args]. This is just redundant and it requires some additional work whereas corepack knows the selected package manager. That's why I'd like such shortcut.
Hi,
This feature request is not exactly the same than the one mentioned in #57. As introduced in the docs here, command
corepack <binary name>[@<version>] [... args]
allows to execute a package manager of our choice with custom arguments. This command checks whether the local project is configured for the given package manager.I personnally would be interested with a command such as
corepack exec [... args]
(exec
may not be the most relevant term however), that would take the exact release set in thepackageManager
property. I guess it is possible because in the command above, I assume corepack parses propertypackageManager
in thepackage.json
file to verify consistency with<binary name>
.Thus, I could run a command of the package manager whatever it is, and without repeating the binary name. This may be useful in writing plugins/extensions for build tools such as Maven, Gradle, acting as a bridge to launch npm/pnpm/yarn commands, without having to parse the
package.json
file and discover the package manager.Thanks in advance for your comments.
BR
The text was updated successfully, but these errors were encountered: