hubotio / generator-hubot

Hubot generator for Yeoman
MIT License
156 stars 83 forks source link

Less boilerplate in script's index.coffee #20

Closed technicalpickles closed 9 years ago

technicalpickles commented 9 years ago

Simplify index.coffee to just use robot.loadFile on the generated script in src/, as I proposed in https://github.com/github/generator-hubot/pull/19

cc @kballard https://github.com/github/hubot/pull/831

lilyball commented 9 years ago

I think this is a reasonable thing to do, as long as users aren't expecting that newly-added files to src/ will be sourced automatically (which is the current behavior).

mal commented 9 years ago

My only concern with this is that it will make all new scripts not support the

{
  "hubot-example": [
    "script1"
  ]
}

alternative style of external-scripts.json by default. If the idea is to phase that format out I guess this makes sense, otherwise it feels like an odd choice.

technicalpickles commented 9 years ago

@mal I think I did this before I remembered that was even supported :sweat: Given that, I don't think this PR makes sense as is.

It would be nice to have a single function on robot to call to load that thing. That will be a bit problematic though, because it means newer scripts would only work with bots that have the newest hubot installed, which will definitely be a support pain point. So, gonna close for now.