hubotio / hubot

A customizable life embetterment robot.
https://hubotio.github.io/hubot/
MIT License
16.64k stars 3.75k forks source link

feat: load adapter from local path with .mjs file extension; load .mjs scripts #1634

Closed joeyguerra closed 1 year ago

joeyguerra commented 1 year ago

BREAKING CHANGE: Loading the adapter is done with async/await semantics. You can now specify an adapter with the .mjs file extension and Hubot will look in ./src/adapters for the file. In addition, scripts with the .mjs file extension can be used. They will be loaded with async/await symantics via the ES6 import statement.

joeyguerra commented 1 year ago

I like the idea of splitting it up into multiple PRs. async might be required for loading '.mjs' files as adapters. But Let me see what I can do.

joeyguerra commented 1 year ago

It was too difficult for me to tease out the changes so I'm going to create separate PRs for each one and close this one, using it as reference. I'm already seeing some benefits in this approach. It forced me to hone an efficient development setup, come up with ideas on testing adapter integration, and add additional tests for adapter loading.