Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use import() in SlashCreator#registerCommandsIn() #445

Open
Snazzah opened this issue Mar 9, 2023 · 2 comments
Open

Use import() in SlashCreator#registerCommandsIn() #445

Snazzah opened this issue Mar 9, 2023 · 2 comments
Labels
help wanted Extra attention is needed semver: minor PRs that contain new features and will be on the next minor release status: pinned Should not be labeled as stale

Comments

@Snazzah
Copy link
Owner

Snazzah commented Mar 9, 2023

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.

@Snazzah Snazzah added status: pinned Should not be labeled as stale semver: major PRs that contain breaking changes and will be on the next major release labels Mar 9, 2023
@axieum
Copy link

axieum commented Oct 22, 2023

+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().

@Snazzah Snazzah mentioned this issue Oct 24, 2023
9 tasks
@Snazzah Snazzah added help wanted Extra attention is needed semver: minor PRs that contain new features and will be on the next minor release and removed semver: major PRs that contain breaking changes and will be on the next major release labels Nov 7, 2023
@Snazzah
Copy link
Owner Author

Snazzah commented Nov 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed semver: minor PRs that contain new features and will be on the next minor release status: pinned Should not be labeled as stale
Projects
None yet
Development

No branches or pull requests

2 participants