zkochan / packages

Zoltan Kochan's npm packages
MIT License
99 stars 26 forks source link

Detect yarn classic/berry #162

Open Andarist opened 2 years ago

Andarist commented 2 years ago

It could be useful if packages like preferred-pm could distinguish between those 2 as the difference between them is quite massive.

It seems that there is quite an easy way to do that. The only thing that needs to be checked is the __metadata: field in the lock file. Berry is checking it like this: https://github.com/yarnpkg/berry/blob/83311e1d4dec7fb6c0ead21f37efa9b687be58b9/packages/yarnpkg-core/sources/scriptUtils.ts#L86-L95

zkochan commented 2 years ago

sounds good