pushkin-consortium / pushkin

A customizable, scalable ecosystem for massive online psychological experiments
https://pushkin-consortium.github.io/pushkin/
MIT License
24 stars 10 forks source link

Hard code the package manager into the CLI #278

Open jessestorbeck opened 7 months ago

jessestorbeck commented 7 months ago

The CLI currently contains a file (https://github.com/pushkin-consortium/pushkin/blob/main/packages/pushkin-cli/src/pMan.js) intended to detect whether the user has installed yarn and, if not, substitute npm. The name of the package manager then gets imported anywhere in the CLI needs to execute a command through the package manager like:

exec(${pacMan} install);

The issue with this approach is that yarn and npm aren't 100% substitutable, so some commands would fail without manual adjustment, e.g. ${pacMan} --mutex network install. The pacMan thing is apparently historical from before Pushkin had committed to yarn. At this point, it could be removed for the sake of readability with the package manager hard-coded into the exec commands.

This is related to the much bigger issue of when Pushkin might want to upgrade from Yarn 1, since we have had some recent issues with it (#272). To @jkhartshorne's recollection, the original reason for committing to yarn over npm was the ability to use yalc, but it seems now that yalc is compatible with both npm and yarn (https://www.npmjs.com/package/yalc). It may not make sense to get rid of the pacMan thing until after it's decided which package manager we'd like to upgrade to.