nuke icon indicating copy to clipboard operation
nuke copied to clipboard

Add yarn tool with support for basic commands

Open stijnwop opened this issue 1 year ago • 4 comments

We've (in our company) been using Nuke Tool for Yarn in our build stack for quite some time, since I just saw the open request (#1145) I thought why not open a PR.

public interface IYarn : INukeBuild
{
    AbsolutePath SourceDirectory => RootDirectory / "app";

    Target Lint => _ => _
        .Executes(() =>
        {
            YarnTasks.YarnRun(o => o
                .SetCommand("lint")
                .SetArguments("--no-fix")
                .SetProcessWorkingDirectory(sourceDirectory));
        });
 
    Target Install => _ => _
        .Executes(() =>
        {
            YarnTasks.YarnInstall(o => o.SetProcessWorkingDirectory(SourceDirectory));
        });

    Target Build => _ => _
        .DependsOn(Install)
        .Executes(() =>
        {
            YarnTasks.YarnRun(o => o
                .SetCommand("build")
                .SetArguments("--production")
                .SetProcessWorkingDirectory(SourceDirectory));
        });
}

I confirm that the pull-request:

  • [x] Follows the contribution guidelines
  • [x] Is based on my own work
  • [x] Is in compliance with my employer

stijnwop avatar Apr 12 '23 15:04 stijnwop

Need one of these for pnpm as well. :) Guessing I can just clone this pr for pnpm...

jafin avatar Apr 14 '23 05:04 jafin

@stijnwop Do you mind adding the --silent parameter? :)

Like yarn --silent install or yarn --silent run xxx

ITaluone avatar May 23 '23 13:05 ITaluone

@stijnwop Did you gave up on this? This would be a great addition.

IT-VBFK avatar Jan 06 '24 13:01 IT-VBFK

@IT-VBFK No, but it depends on when this will be approved and used by the code owner..

stijnwop avatar Jan 10 '24 10:01 stijnwop