Skip to content

sg: use `package.json` `packageManager` field to check `yarn` version

Administrator requested to merge vb/sg-setup-check-yarn into contractors/SG-39284.base

Created by: valerybugakov

Context

We install yarn v1 via asdf and then use yarn v3 because of the package.json packageManager field. See more context in the yarn upgrade PR.

This PR changes the logic of the sg setup -check command for the yarn version. It parses package.json and extracts the yarn version specified in the packageManager field and compares it to the output of the yarn --version command.

Test plan

  1. yarn install
  2. ensure that yarn --version outputs 3.2.3.
  3. go run ./dev/sg setup -check passed without errors.

Merge request reports

Loading