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

Add Yarn 2 support #41

Closed kroofy closed 2 years ago

kroofy commented 4 years ago

Even though it says in the docs that:

For backward compatibility we offer an alias under the name of --frozen-lockfile, but it will be removed in a later release.

I couldn't get it to work in Yarn 2.2.2, hence this change.

.yarnrc.yml is exclusive to Yarn 2 so it should be a safe assumption, see: https://yarnpkg.com/configuration/yarnrc

Starting from the v2, they must be written in valid Yaml and have the right extension (simply calling your file .yarnrc won't do).

merceyz commented 4 years ago

The existance, or lack thereof, of a .yarnrc.yml file isn't enough to detect Yarn V2, the correct way to check is to grep yarn.lock for __metadata:

github-actions[bot] commented 3 years ago

Size Change: 0 B

Total Size: 75.5 kB

ℹ️ View Unchanged | Filename | Size | Change | | :--- | :---: | :---: | | `index.js` | 75.5 kB | 0 B |

compressed-size-action

kroofy commented 3 years ago

The existance, or lack thereof, of a .yarnrc.yml file isn't enough to detect Yarn V2, the correct way to check is to grep yarn.lock for __metadata:

Sorry for taking a while. Thanks for you reply. I did update the code, hope it better conforms to how Yarn v2 works.

merceyz commented 2 years ago

We fixed the --frozen-lockfile alias in https://github.com/yarnpkg/berry/pull/2488 so this is no longer necessary