🪄Upgrading Yarn Scripts
Upgrading your Yarn Spinner 1.x scripts to Yarn Spinner 2.x is easy.
The Yarn Spinner Console (ysc) can upgrade your older .yarn scripts to the latest syntax.
To upgrade your scripts:
Install the version of Yarn Spinner Console that matches your version of Yarn Spinner. You can do this via the Yarn Spinner Console GitHub Project. Choose Releases in the sidebar, and download the appropriate binary for your platform. If you just want the latest release, you can find it here.
Run the upgrader on your scripts. To upgrade, you must run ysc on your command-line/terminal with the upgrade parameter and a path to a yarn file:
$ ysc upgrade myOldYarnFile.yarnYou can also run the upgrade on multiple scripts at once. To do this, you can pass in as many .yarn files as you want:
ysc upgrade myOldYarnFile.yarn myOtherOldYarnFile.yarnBy default, ysc will replace the existing .yarn files you've passed in, as part of the upgrade. If you don't want it to do this, either make sure you have a backup, or pass in the --output-directory option, after the upgrade parameter. For example:
ysc upgrade --output-directory ./output myOldYarnFile.yarnLast updated
Was this helpful?
