preactjs / compressed-size-action

GitHub Action that adds compressed size changes to your PRs.
https://github.com/marketplace/actions/compressed-size-action
MIT License
602 stars 84 forks source link

Support yarn #1

Closed stephenmathieson closed 4 years ago

stephenmathieson commented 4 years ago

It would be nice to support installing deps with Yarn rather than npm. Alternatively just doing npm install rather than npm ci for projects without package-lock.json files would work

developit commented 4 years ago

@stephenmathieson I think npm ci falls back to npm i in cases where there is no package-lock? I would be happy to switch between npm and yarn based on the existence of a yarn.lock (once I get this action working).

stephenmathieson commented 4 years ago

Unfortunately it does not:

$ npm ci
npm WARN prepare removing existing node_modules/ before installation
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/stephen/.npm/_logs/2020-01-23T16_08_47_954Z-debug.log
developit commented 4 years ago

Alright, I've added support for checking package-lock.json and yarn.lock in 95122d396b7923377f6fca032b38b648aa45fbe2, released as a patch to v1.

stephenmathieson commented 4 years ago

Thanks!