composer-npm-bridge icon indicating copy to clipboard operation
composer-npm-bridge copied to clipboard

Add support for Yarn

Open ezzatron opened this issue 6 years ago • 1 comments

Yarn is great. It would be nice to support it.

Interestingly, yarn install features a --pure-lockfile flag, which seems perfect for usage with composer-npm-bridge. It's a pity that NPM doesn't support something similar.

Relates to #20.

ezzatron avatar Dec 06 '18 02:12 ezzatron

I just found out about npm ci, which looks awesome.

So the behavior could be something like this:

  • Choose a "driver":
    • Can be manually specified in composer.json extra.npm-bridge.driver
    • Defaults to "yarn" if yarn.lock is present in the package root
    • Falls back to "npm"
  • If using the Yarn driver:
    • If the lock file is present, install packages with yarn install --pure-lockfile
    • If the lock file is absent, install packages with yarn install --no-lockfile
  • If using the NPM driver:
    • If the lock file is present, install packages with npm ci
    • If the lock file is absent, install packages with npm install --no-package-lock

ezzatron avatar Dec 06 '18 02:12 ezzatron