Closed guybedford closed 2 years ago
Depends on https://github.com/guybedford/chomp/issues/13.
Added in https://github.com/guybedford/chomp/commit/d0c39b80f579b648fd2f075937741de236025d14 using a global environment variable second argument to templates.
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.