- yarn --version
- yarn install
- detect the configured NodeJS version from
- yarn.lock
- package-lock.json
- .nvmrc
<?php
use Sweetchuck\Robo\Yarn\YarnTaskLoader;
use Robo\Contract\TaskInterface;
use Robo\Tasks;
class RoboFile extends Tasks
{
use YarnTaskLoader;
public function yarnVersion(string $dir): TaskInterface
{
return $this->taskYarnVersion([
'workingDirectory' => $dir,
]);
}
public function yarnInstall(string $dir): TaskInterface
{
return $this->taskYarnInstall([
'workingDirectory' => $dir,
]);
}
}