jackellenberger / hubot-command-chaining

unix command line like chaining for hubot commands
1 stars 0 forks source link

ERROR ReferenceError: await is not defined #1

Open coderofsalvation opened 3 years ago

coderofsalvation commented 3 years ago

Love the idea of this plugin.

hubot> hubot echo hoi && hubot echo flop
[Tue Feb 23 2021 13:07:37 GMT+0100 (Central European Standard Time)] ERROR ReferenceError: await is not defined

Are you running a different coffeescript version? Mine:

$ grep -E '(coffeescript|version)' node_modules/hubot/package.json
   "coffeescript": "1.6.3",
  "version": "3.3.2"  <-- hubot
jackellenberger commented 3 years ago

Hey @coderofsalvation! I think the key will be upping your node version - await was introduced in node 7.6.0, but I've only been running hubot at 10.x and above. Hopefully that's doable!

Full disclosure I can't remember what state of functionality I left this project in, I remember being frustrated that so many hubot commands we had registered weren't well terminated so something like hubot echo hoi && hubot echo flop would just echo "hoi && hubot echo flop".

coderofsalvation commented 3 years ago

Hi, first of all thank you for your reply. Strangely I'm running >10.x, so I'm afraid it's the coffeescript AST complaining somehow. Good news however is, I've been studying the code and am quite close to a simplified version:

I love hubot and it's ecosystem, but there's also an incredible itch to refactor the whole thing. On the other hand, maybe some day we should release some kind of hubot-composable-scripts-repo. Basically a hubot-scripts repo (which is archived anyway) which doesn't rely on single regex-based coffee-commands, but pipe-able, &&-able js-commands using dashdash e.g. I've realized that it's better to start with a vanilla hubot + this plugin, and THEN start adding (+refactoring) plugins. That way you start developing composable commands from the start. I'm drifting off here, anyways..as soon as I've got something stable I'll let you know.

jackellenberger commented 3 years ago

Sounds great! I would not hold this project up as a paragon of functionality, so any and all improvements are welcome, or if you can instrument it better in your own repo i'll just archive this and use your project. This was just an afternoon of "how hard could it possibly be..." 😆