guybedford / chomp

'JS Make' - parallel task runner for the frontend ecosystem with a JS extension system.
https://chompbuild.com
Apache License 2.0
138 stars 7 forks source link

Support package managers other than npm in install template #14

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

Ideally, the install template should use a lockfile or other detection to determine the package manager to use, then apply it.

Effectively this is task branching of a sort.

One mechanism to do this is via multiple targets as the package locks, based on the different package locks used by the different package managers, where the target check takes the first found, resulting in that dependency path being taken. This will fully handle the use case, down to the package lock file being necessarily located otherwise it would default to npm.

Alternatively more advanced task predicates could be constructed, but I'd prefer not to open that box anytime soon.

We could also look at a corepack integration.

guybedford commented 2 years ago

Depends on https://github.com/guybedford/chomp/issues/13.

guybedford commented 2 years ago

Added in https://github.com/guybedford/chomp/commit/d0c39b80f579b648fd2f075937741de236025d14 using a global environment variable second argument to templates.