lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

Create a fly plugin #259

Closed Swizz closed 7 years ago

Swizz commented 7 years ago

Hi there !

I am considering writing some fly plugin for steal, flow checking, flow striping and zeit/serve (and more soon). I have assess a lot of fly-plugins, and found a lot of way to define plugin.

So right now, I am hesitating about the right way to do that.

//extract from generator-fly

module.exports = function () {
  return this.filter('fly-plugin', (data, options) => {
    // plugin internal
  });
};
//extract from fly-concat also in doc

module.exports = function () {
  this.plugin('fly-plugin', {every: false}, function * (data, options) {
    // plugin internal
  });
};
//extract from fly-xo also in doc

module.exports = {
  name: 'fly-plugin',
  every: false,
  files: false,
  * func(data, options) {
    // plugin internal
  }
};

So, which one do I need to choose ?

Cheers,

lukeed commented 7 years ago

Hey there,

Thanks for reporting. Admittedly, I still need to update generator-fly. That syntax is outdated.

The other two methods are synonymous and you can use them. See docs on external plugins for more explanation & examples. 😄

Let me know if you still have questions. 👍

Swizz commented 7 years ago

Thank you. I can concern at the yeoman generator, if I have time.

But I am not a yeoman user. (Never taken a look to, then)

lukeed commented 7 years ago

Thanks, I'll get to it this week =)

hzlmn commented 7 years ago

@lukeed I can send PR for generator if you are busy.

lukeed commented 7 years ago

Thanks @hzlmn 😄 I'm actually doing it right now. @Swizz inspired me.