Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn.cmd is not being run in the workspace #1

Open
mrozbarry opened this issue Nov 6, 2017 · 2 comments
Open

yarn.cmd is not being run in the workspace #1

mrozbarry opened this issue Nov 6, 2017 · 2 comments

Comments

@mrozbarry
Copy link

Looks like nothing is automatically triggering yarn.cmd from https://github.com/clement-escolano/shipit-yarn/blob/master/tasks/yarn/index.js#L28.

I expected something like this to exist in there:

shipit.on('yarn:installed', function () {
  shipit.start('yarn:cmd');
});

shipit-npm doesn't support automatic commands, either, so I'm not sure if this is a bug or not, but most npm or yarn projects typically have more steps than just npm install. So maybe this is a bug for shipit-npm and not directly shipit-yarn.

Another option, which to me seems much more better for developers is supporting an array of npm commands rather than forcing install.

So currently, it would be something like:

{
  // ...
  yarn: {
    installArgs: ['--production'] // becomes `yarn install --production`
  }
}

But maybe this is better:

{
  // ...
  yarn: {
    commands: [
      'install --production' // becomes `yarn install --production`
      'build', // becomes `yarn build`
      'cleanup', // becomes `yarn cleanup`
    ]
  }
}

Makes it a lot more flexible to do things, and I think makes a lot more sense in terms of an install/build/deploy process.

@clement-escolano
Copy link
Owner

Indeed! I find myself writing things like

shipit.on('yarn:installed', function () {
  shipit.start('yarn:cmd');
});

all the time.

I will definitely look into it but I don't have much time right now. The feature will come soon ;)

@drdogbot7
Copy link

This is what worked for me. It's been a few years so I assume maybe some of the events have just changed.

  shipit.on('yarn_installed', function () {
    shipit.start('yarn:run');
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants