Open Snazzah opened 1 year ago
+1, as this will allow consumers to use this in pure ESM projects. For now, I believe the only way is to import and then register each command class manually via the SlashCreator#registerCommand()
or SlashCreator#registerCommands()
.
Wasn't exactly able to get this done for v6, but SlashCreator#registerCommandsIn
is async, so this could be done in a minor version release. A hurdle was making the TypeScript config work well with both CJS and ESM environments without making the package ESM.
This mainly requires making the function async, and should also make directory listing also async. While this is gonna be a breaking change for the method, should probably also add a filter function to allow for manual file filtering instead of having a custom extensions array option.