Official Yarn step

Description of the feature request

Would be nice to have an official yarn step.

Use case / for what or how I would use it

Yarn is commonly used as a npm replacement. It’s also popular with react native mobile apps.

Makes sense, especially that we have a step for NPM - thanks for the #feature-request @bootstraponline! :slight_smile:

Actually there’s already an “unofficial” step for this, available in the StepLib right now: https://github.com/jonoirwinrsa/steps-yarn

Yeah, I’m not sure I want to pull in a shell script from a random GitHub account. I think having the logic in golang, especially for installing, may be a bit more reliable.

It does work though.

1 Like

Thanks for the info @bootstraponline, we’ll keep this #feature-request then, for an official step :slight_smile:

https://github.com/jonoirwinrsa/steps-yarn also only works for Ubuntu when installing yarn (apt-get). I need yarn on macOS. :smile:

I think an official step would support yarn correctly on both Linux and macOS.

1 Like

Got it, added it to our internal tracker, but can’t promise anything / set an ETA yet :wink:

In the meantime, if you have some time, send a PR to the currently available (3rd party) Yarn step, I’m sure they’d be happy :wink:

Actually I just checked that step and it declares yarn as a dependency so the CLI should auto install it with brew.

Are you sure that you tested it on MacOS @bootstraponline?

It works on macOS, however I though that was because the osx-box-bootstrap already has yarn installed. I didn’t notice it’s auto installing via brew in step.yml, I only briefly looked at the apt-get logic.

Sounds like it already has the required features.

1 Like

Indeed, the step seems to be right, when yarn is not installed the CLI will install it for it (using brew - https://github.com/jonoirwinrsa/steps-yarn/blob/master/step.yml#L21)

But if yarn is already installed then the CLI will not install it. Unfortunately the current deps definition only allows to define the presence (and install method) of a given tool, it’s not possible right now to define any version for the tool. So with a deps def like the step has the CLI will only ensure that yarn is available, it’ll never attempt to update it / it’ll skip it entirely if it’s already installed.

1 Like

I’m using the latest stable yarn so that is a good match for my needs.

Ideally we’d match the same yarn version used to create yarnfile.lock Buddybuild raised an issue upstream and it looks like this feature has been added.