commandkit 1.2.0-rc.12 → 1.2.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{COPYING.md → LICENSE.md} +3 -3
- package/README.md +3 -3
- package/bin/index.mjs +1 -1
- package/cli.d.ts +19 -0
- package/config.cjs +3 -0
- package/config.d.ts +1 -0
- package/dist/{ActionRow-uJxU4UGo.js → ActionRow-CSN_UKmM.js} +2 -3
- package/dist/{ActionRow-uJxU4UGo.js.map → ActionRow-CSN_UKmM.js.map} +1 -1
- package/dist/{ActionRow-B-7n9MMr.d.ts → ActionRow-CT-uyxW0.d.ts} +3 -4
- package/dist/{Button-RMp-w8HV.d.ts → Button-oMnlpF6W.d.ts} +6 -7
- package/dist/{ButtonKit-9k4yfhYD.d.ts → ButtonKit-DKu0VAe4.d.ts} +36 -37
- package/dist/ChannelSelectMenuKit-HQZ4hH5s.d.ts +66 -0
- package/dist/{CommandKitEventsChannel-2l9Za-le.js → CommandKitEventsChannel-DDI0UVh9.js} +2 -2
- package/dist/{CommandKitEventsChannel-2l9Za-le.js.map → CommandKitEventsChannel-DDI0UVh9.js.map} +1 -1
- package/dist/{CommandsRouter-CBdsqaWK.d.ts → CommandsRouter-C7dZEepB.d.ts} +49 -50
- package/dist/{CommandsRouter-CWMipIis.js → CommandsRouter-D5mGRFEr.js} +2 -6
- package/dist/{CommandsRouter-CWMipIis.js.map → CommandsRouter-D5mGRFEr.js.map} +1 -1
- package/dist/{CompilerPlugin-CZ4412Zm.js → CompilerPlugin-DZidFuHJ.js} +2 -2
- package/dist/{CompilerPlugin-CZ4412Zm.js.map → CompilerPlugin-DZidFuHJ.js.map} +1 -1
- package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-CZmWpS08.d.ts} +40 -40
- package/dist/{EventInterceptor-BWoEJMHZ.js → EventInterceptor-CxA95XYA.js} +1 -1
- package/dist/{EventInterceptor-BWoEJMHZ.js.map → EventInterceptor-CxA95XYA.js.map} +1 -1
- package/dist/{EventWorkerContext-D_9q1Bm2.js → EventWorkerContext-CfqamFWu.js} +2 -3
- package/dist/{EventWorkerContext-D_9q1Bm2.js.map → EventWorkerContext-CfqamFWu.js.map} +1 -1
- package/dist/{EventsRouter-C04XqRKf.js → EventsRouter-Be5NDOX4.js} +2 -6
- package/dist/{EventsRouter-C04XqRKf.js.map → EventsRouter-Be5NDOX4.js.map} +1 -1
- package/dist/EventsRouter-DZ37r54v.d.ts +90 -0
- package/dist/MentionableSelectMenuKit-7URDUM3-.d.ts +61 -0
- package/dist/{MessageCommandParser-CKh-tM97.js → MessageCommandParser-VMFFGs0R.js} +2 -3
- package/dist/{MessageCommandParser-CKh-tM97.js.map → MessageCommandParser-VMFFGs0R.js.map} +1 -1
- package/dist/MessageCommandParser-q3dQcE5N.d.ts +194 -0
- package/dist/{Modal-Calb46SJ.d.ts → Modal--iMEUqSm.d.ts} +20 -10
- package/dist/{ModalKit-Cq2ns6jv.d.ts → ModalKit-BWXI3Z26.d.ts} +33 -34
- package/dist/{PluginCommon-CPWV5xuX.js → PluginCommon-Bfs8d9s7.js} +6 -7
- package/dist/{PluginCommon-CPWV5xuX.js.map → PluginCommon-Bfs8d9s7.js.map} +1 -1
- package/dist/RoleSelectMenuKit-BY-JJ18w.d.ts +66 -0
- package/dist/{RuntimePlugin-COeXe8rP.js → RuntimePlugin-BYQXQO8w.js} +2 -2
- package/dist/{RuntimePlugin-COeXe8rP.js.map → RuntimePlugin-BYQXQO8w.js.map} +1 -1
- package/dist/{SelectMenu-VcDhOGoJ.d.ts → SelectMenu-DQbmOp1Y.d.ts} +16 -13
- package/dist/StringSelectMenuKit-lVhUMc3g.d.ts +66 -0
- package/dist/UserSelectMenuKit-CCj4Fpkr.d.ts +66 -0
- package/dist/analytics/analytics-engine.d.ts +1 -33
- package/dist/analytics/analytics-engine.js +19 -39
- package/dist/analytics/analytics-provider.d.ts +1 -33
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.js +19 -39
- package/dist/{analytics-engine-NOInIjv8.d.ts → analytics-engine-_urJ5QTH.d.ts} +850 -842
- package/dist/app/commands/AppCommandRunner.d.ts +1 -33
- package/dist/app/commands/AppCommandRunner.js +19 -39
- package/dist/app/commands/Context.d.ts +1 -33
- package/dist/app/commands/Context.js +19 -39
- package/dist/app/commands/MessageCommandParser.d.ts +1 -1
- package/dist/app/commands/MessageCommandParser.js +1 -2
- package/dist/app/commands/helpers.d.ts +1 -1
- package/dist/app/commands/helpers.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +42 -35
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -33
- package/dist/app/handlers/AppCommandHandler.js +19 -39
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -33
- package/dist/app/handlers/AppEventsHandler.js +19 -39
- package/dist/app/index.d.ts +4 -33
- package/dist/app/index.js +19 -40
- package/dist/app/interrupt/signals.d.ts +1 -1
- package/dist/app/interrupt/signals.js +2 -3
- package/dist/app/middlewares/permissions.d.ts +1 -33
- package/dist/app/middlewares/permissions.js +19 -39
- package/dist/app/register/CommandRegistrar.d.ts +1 -33
- package/dist/app/register/CommandRegistrar.js +19 -39
- package/dist/app/router/CommandsRouter.d.ts +1 -1
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/EventsRouter.d.ts +1 -1
- package/dist/app/router/EventsRouter.js +1 -1
- package/dist/app/router/index.d.ts +2 -3
- package/dist/app/router/index.js +3 -3
- package/dist/{chunk-nOFOJqeH.js → chunk-kSYXY2_d.js} +10 -6
- package/dist/cli/app-process.d.ts +0 -1
- package/dist/cli/app-process.js +62 -7
- package/dist/cli/app-process.js.map +1 -0
- package/dist/cli/build.d.ts +2 -33
- package/dist/cli/build.js +186 -44
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/common.d.ts +1 -33
- package/dist/cli/common.js +4 -4
- package/dist/cli/development.d.ts +18 -1
- package/dist/cli/development.js +38 -51
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.d.ts +4 -0
- package/dist/cli/env.js +1 -1
- package/dist/cli/generators.js +5 -8
- package/dist/cli/generators.js.map +1 -1
- package/dist/cli/information.js +5 -5
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.d.ts +12 -2
- package/dist/cli/init.js +97 -41
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/production.d.ts +0 -1
- package/dist/cli/production.js +33 -51
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.js +5 -5
- package/dist/cli/utils.d.ts +0 -1
- package/dist/cli/utils.js +17 -2
- package/dist/cli/utils.js.map +1 -0
- package/dist/{colors-DL3ucTiT.js → colors-Csc0X4QJ.js} +2 -3
- package/dist/{colors-DL3ucTiT.js.map → colors-Csc0X4QJ.js.map} +1 -1
- package/dist/{commandkit-DabqpQ6v.js → commandkit-B1_NP74k.js} +3187 -2630
- package/dist/commandkit-B1_NP74k.js.map +1 -0
- package/dist/commandkit.d.ts +1 -33
- package/dist/commandkit.js +19 -39
- package/dist/{common-DHTTnX82.d.ts → common-DnwCYit8.d.ts} +3 -4
- package/dist/{common-fIO6fqGZ.js → common-zQwj90Nz.js} +9 -12
- package/dist/{common-fIO6fqGZ.js.map → common-zQwj90Nz.js.map} +1 -1
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/EventInterceptor.js +1 -1
- package/dist/components/common/element.d.ts +2 -5
- package/dist/components/common/element.js +27 -8
- package/dist/components/common/types.d.ts +1 -1
- package/dist/components/common/types.js +0 -1
- package/dist/components/display/common.d.ts +0 -1
- package/dist/components/display/common.js +20 -2
- package/dist/components/display/container.d.ts +1 -1
- package/dist/components/display/container.js +20 -3
- package/dist/components/display/file.d.ts +1 -1
- package/dist/components/display/file.js +1 -1
- package/dist/components/display/index.d.ts +8 -9
- package/dist/components/display/index.js +25 -16
- package/dist/components/display/label.d.ts +1 -1
- package/dist/components/display/label.js +20 -3
- package/dist/components/display/media-gallery.d.ts +1 -1
- package/dist/components/display/media-gallery.js +21 -4
- package/dist/components/display/poll.d.ts +1 -1
- package/dist/components/display/poll.js +1 -1
- package/dist/components/display/section.d.ts +1 -1
- package/dist/components/display/section.js +21 -4
- package/dist/components/display/separator.d.ts +1 -1
- package/dist/components/display/separator.js +1 -1
- package/dist/components/display/text-display.d.ts +1 -1
- package/dist/components/display/text-display.js +1 -1
- package/dist/components/index.d.ts +23 -26
- package/dist/components/index.js +34 -52
- package/dist/components/interactive/action-row/ActionRow.d.ts +1 -5
- package/dist/components/interactive/action-row/ActionRow.js +1 -1
- package/dist/components/interactive/button/Button.d.ts +1 -6
- package/dist/components/interactive/button/Button.js +19 -39
- package/dist/components/interactive/button/ButtonKit.d.ts +1 -2
- package/dist/components/interactive/button/ButtonKit.js +19 -39
- package/dist/components/interactive/modal/Modal.d.ts +2 -7
- package/dist/components/interactive/modal/Modal.js +20 -39
- package/dist/components/interactive/modal/ModalKit.d.ts +1 -2
- package/dist/components/interactive/modal/ModalKit.js +19 -39
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +19 -39
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +19 -39
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +19 -39
- package/dist/components/interactive/select-menu/SelectMenu.d.ts +1 -9
- package/dist/components/interactive/select-menu/SelectMenu.js +19 -39
- package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/StringSelectMenuKit.js +19 -39
- package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/UserSelectMenuKit.js +19 -39
- package/dist/components/interactive/select-menu/common.d.ts +1 -2
- package/dist/components/interactive/select-menu/common.js +0 -1
- package/dist/config/config.d.ts +15 -35
- package/dist/config/config.js +19 -39
- package/dist/config/default.d.ts +1 -33
- package/dist/config/default.js +19 -39
- package/dist/config/loader.d.ts +1 -33
- package/dist/config/loader.js +19 -39
- package/dist/config/types.d.ts +1 -33
- package/dist/config/utils.d.ts +1 -33
- package/dist/config/utils.js +1 -1
- package/dist/{constants-D0dawKxO.js → constants-BA0TJU6e.js} +2 -3
- package/dist/{constants-D0dawKxO.js.map → constants-BA0TJU6e.js.map} +1 -1
- package/dist/constants-BS9N2avz.js +27 -0
- package/dist/{constants-AH-9qJ89.js.map → constants-BS9N2avz.js.map} +1 -1
- package/dist/{constants-BMWH2YUr.js → constants-CeIMhMD0.js} +16 -1
- package/dist/constants-CeIMhMD0.js.map +1 -0
- package/dist/{constants-DqnSDZ6l.d.ts → constants-CuYW0K10.d.ts} +14 -8
- package/dist/{constants-CCFSX2NG.d.ts → constants-EpKcj0dH.d.ts} +2 -2
- package/dist/{container-1ltvkavy.d.ts → container-DYcb7zGw.d.ts} +2 -3
- package/dist/context/async-context.d.ts +1 -33
- package/dist/context/async-context.js +19 -39
- package/dist/context/environment.d.ts +1 -33
- package/dist/context/environment.js +19 -39
- package/dist/{element-CvNhvLZ8.d.ts → element-DZeqbSTk.d.ts} +5 -5
- package/dist/{env-8yY-6pbC.js → env-FxaiNasU.js} +7 -3
- package/dist/env-FxaiNasU.js.map +1 -0
- package/dist/error-codes-Ds0bnPvT.js.map +1 -1
- package/dist/events/CommandKitEventsChannel.d.ts +1 -33
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{file-n2yl_-vl.d.ts → file-CrV4lSnl.d.ts} +2 -3
- package/dist/{file-DAUOZYhC.js → file-DqI3v90P.js} +2 -3
- package/dist/{file-DAUOZYhC.js.map → file-DqI3v90P.js.map} +1 -1
- package/dist/flags/FlagProvider.d.ts +1 -33
- package/dist/flags/feature-flags.d.ts +1 -33
- package/dist/flags/feature-flags.js +22 -43
- package/dist/flags/store.d.ts +1 -33
- package/dist/flags/store.js +1 -1
- package/dist/{helpers-hDh_tMb6.d.ts → helpers-AQPLVY35.d.ts} +2 -3
- package/dist/{helpers-D2_1jih6.js → helpers-DSy7EjzP.js} +2 -3
- package/dist/{helpers-D2_1jih6.js.map → helpers-DSy7EjzP.js.map} +1 -1
- package/dist/index.d.ts +41 -44
- package/dist/index.js +49 -68
- package/dist/kv/constants.d.ts +1 -1
- package/dist/kv/constants.js +1 -1
- package/dist/kv/dotprops.js +25 -3
- package/dist/kv/dotprops.js.map +1 -0
- package/dist/kv/kv.d.ts +289 -290
- package/dist/kv/kv.js +14 -16
- package/dist/kv/kv.js.map +1 -1
- package/dist/kv/serde.d.ts +12 -3
- package/dist/kv/serde.js +86 -4
- package/dist/kv/serde.js.map +1 -0
- package/dist/{label-D0KXeBhk.d.ts → label-37kaNWMH.d.ts} +4 -5
- package/dist/logger/DefaultLogger.d.ts +66 -3
- package/dist/logger/DefaultLogger.js +19 -39
- package/dist/logger/ILogger.d.ts +64 -2
- package/dist/logger/ILogger.js +0 -1
- package/dist/logger/Logger.d.ts +36 -3
- package/dist/logger/Logger.js +19 -39
- package/dist/logger/NoopLogger.d.ts +36 -37
- package/dist/{media-gallery-BzG70ued.d.ts → media-gallery-Ci3I4ElH.d.ts} +2 -3
- package/dist/plugins/CompilerPlugin.d.ts +1 -33
- package/dist/plugins/CompilerPlugin.js +1 -2
- package/dist/plugins/PluginCommon.d.ts +1 -33
- package/dist/plugins/PluginCommon.js +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +1 -33
- package/dist/plugins/RuntimePlugin.js +1 -2
- package/dist/plugins/index.d.ts +1 -33
- package/dist/plugins/index.js +21 -39
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -33
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +19 -39
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -33
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +19 -39
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -33
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +19 -39
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -33
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +19 -39
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -33
- package/dist/plugins/plugin-runtime/runtime.js +0 -1
- package/dist/plugins/types.d.ts +1 -33
- package/dist/plugins/types.js +0 -1
- package/dist/{poll-HnaJcB0o.d.ts → poll-Ddtapd6n.d.ts} +8 -9
- package/dist/{poll-Bc6rjeUS.js → poll-ziQQQbMU.js} +12 -13
- package/dist/{poll-Bc6rjeUS.js.map → poll-ziQQQbMU.js.map} +1 -1
- package/dist/{resolve-file-url-CJoD0FAn.js → resolve-file-url-BmjHzIKe.js} +2 -2
- package/dist/{resolve-file-url-CJoD0FAn.js.map → resolve-file-url-BmjHzIKe.js.map} +1 -1
- package/dist/{section-BOaJKXiy.d.ts → section-DkUKULnB.d.ts} +2 -3
- package/dist/{separator-Cb7-6T6N.d.ts → separator-CbXsIFCa.d.ts} +2 -3
- package/dist/{separator-C___2K-f.js → separator-DGwA_b1J.js} +2 -3
- package/dist/{separator-C___2K-f.js.map → separator-DGwA_b1J.js.map} +1 -1
- package/dist/{signals-DBS60vTo.d.ts → signals-BbTgTc0i.d.ts} +2 -2
- package/dist/{signals-Cnqe9dFV.js → signals-ewEPW2cO.js} +2 -2
- package/dist/{signals-Cnqe9dFV.js.map → signals-ewEPW2cO.js.map} +1 -1
- package/dist/{store-ZwL2gN6a.js → store-DK4JA-fQ.js} +2 -3
- package/dist/{store-ZwL2gN6a.js.map → store-DK4JA-fQ.js.map} +1 -1
- package/dist/{text-display-BtQR88kY.js → text-display-BVuG7dT-.js} +2 -3
- package/dist/{text-display-BtQR88kY.js.map → text-display-BVuG7dT-.js.map} +1 -1
- package/dist/{text-display-B_hpz50P.d.ts → text-display-D7j39VC-.d.ts} +2 -3
- package/dist/{type-checker-CEFHoQoV.js → type-checker-CFpKDDs8.js} +4 -6
- package/dist/{type-checker-CEFHoQoV.js.map → type-checker-CFpKDDs8.js.map} +1 -1
- package/dist/{types-CJ-XvOFN.d.ts → types-BywA9d2Z.d.ts} +2 -2
- package/dist/{types-package-D11rQXLs.js → types-package-Bjh_ap0V.js} +3 -6
- package/dist/{types-package-D11rQXLs.js.map → types-package-Bjh_ap0V.js.map} +1 -1
- package/dist/types.d.ts +1 -33
- package/dist/utils/colors.js +1 -1
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +3 -2
- package/dist/utils/dev-hooks.d.ts +1 -33
- package/dist/utils/dev-hooks.js +19 -39
- package/dist/utils/error-codes.d.ts +54 -2
- package/dist/utils/resolve-file-url.d.ts +11 -2
- package/dist/utils/resolve-file-url.js +1 -1
- package/dist/utils/types-package.js +2 -2
- package/dist/utils/useful-stuff/async-queue.d.ts +21 -21
- package/dist/utils/useful-stuff/mutex.d.ts +62 -62
- package/dist/utils/useful-stuff/ratelimiter.d.ts +56 -56
- package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
- package/dist/utils/useful-stuff/semaphore.d.ts +82 -82
- package/dist/utils/utilities.d.ts +113 -2
- package/dist/utils/utilities.js +22 -40
- package/dist/utils/warning.js +1 -1
- package/dist/{utils-Br3eenD1.js → utils-CVaVycsK.js} +1 -1
- package/dist/{utils-Br3eenD1.js.map → utils-CVaVycsK.js.map} +1 -1
- package/dist/{version-DC4j2ZwU.js → version-DNg-wh2E.js} +2 -2
- package/dist/{version-DC4j2ZwU.js.map → version-DNg-wh2E.js.map} +1 -1
- package/dist/version.d.ts +8 -2
- package/dist/version.js +1 -1
- package/dist/{warning-CszH8HeS.js → warning-BWiQltHE.js} +1 -1
- package/dist/{warning-CszH8HeS.js.map → warning-BWiQltHE.js.map} +1 -1
- package/hooks.cjs +11 -4
- package/package.json +14 -7
- package/dist/ChannelSelectMenuKit-CsYgIyKe.d.ts +0 -67
- package/dist/DefaultLogger-CHMVsizQ.d.ts +0 -67
- package/dist/EventWorkerContext-CLhZRHhH.d.ts +0 -43
- package/dist/EventsRouter-4pT6vj-U.d.ts +0 -90
- package/dist/ILogger-BQ2ew4zR.d.ts +0 -64
- package/dist/Logger-DyV7oli4.d.ts +0 -37
- package/dist/MentionableSelectMenuKit-CO9phWMf.d.ts +0 -62
- package/dist/MessageCommandParser-DEOl_ifb.d.ts +0 -195
- package/dist/RoleSelectMenuKit-DvBxzpWh.d.ts +0 -67
- package/dist/StringSelectMenuKit-CJ0MzUZJ.d.ts +0 -67
- package/dist/UserSelectMenuKit-C_J-9RJs.d.ts +0 -67
- package/dist/app-process-AQ3Cbf6j.js +0 -68
- package/dist/app-process-AQ3Cbf6j.js.map +0 -1
- package/dist/build-BYMHMOl_.js +0 -173
- package/dist/build-BYMHMOl_.js.map +0 -1
- package/dist/commandkit-DabqpQ6v.js.map +0 -1
- package/dist/common-CCx-FJI4.js +0 -17
- package/dist/common-CCx-FJI4.js.map +0 -1
- package/dist/config-DbgXt6mf.d.ts +0 -16
- package/dist/constants-AH-9qJ89.js +0 -27
- package/dist/constants-BMWH2YUr.js.map +0 -1
- package/dist/container-DC0eQigs.js +0 -44
- package/dist/container-DC0eQigs.js.map +0 -1
- package/dist/dotprops-DvJUE8fw.js +0 -36
- package/dist/dotprops-DvJUE8fw.js.map +0 -1
- package/dist/element-DibzzA5L.js +0 -84
- package/dist/element-DibzzA5L.js.map +0 -1
- package/dist/env-8yY-6pbC.js.map +0 -1
- package/dist/error-codes-BiNRVMiV.d.ts +0 -54
- package/dist/feature-flags-BoBV4Dsj.js +0 -160
- package/dist/feature-flags-BoBV4Dsj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init-CBb0StSB.js +0 -91
- package/dist/init-CBb0StSB.js.map +0 -1
- package/dist/init-DSYckXwx.d.ts +0 -13
- package/dist/label-D-uJWRZ0.js +0 -36
- package/dist/label-D-uJWRZ0.js.map +0 -1
- package/dist/media-gallery-BLhwe5lO.js +0 -62
- package/dist/media-gallery-BLhwe5lO.js.map +0 -1
- package/dist/resolve-file-url-DFtR8jRR.d.ts +0 -11
- package/dist/section-BMcHN97i.js +0 -60
- package/dist/section-BMcHN97i.js.map +0 -1
- package/dist/serde-D4H23l2F.d.ts +0 -12
- package/dist/serde-DHHwhltz.js +0 -97
- package/dist/serde-DHHwhltz.js.map +0 -1
- package/dist/types-Cdh4uaFR.js +0 -0
- package/dist/types-TC4g3w91.js +0 -0
- package/dist/utilities-CQUaua43.d.ts +0 -87
- package/dist/utils-Bf-3Eevb.js +0 -23
- package/dist/utils-Bf-3Eevb.js.map +0 -1
- package/dist/version-DggMfP_1.d.ts +0 -8
- /package/dist/{ILogger-B0q7p7L1.js → ILogger-JI8VGyJf.js} +0 -0
- /package/dist/{app-CrjK9yWX.js → common-vGj3fpz3.js} +0 -0
- /package/dist/{index-B5F3AfVc.d.ts → index-BJfko-dP.d.ts} +0 -0
- /package/dist/{index-BLwMeReG.d.ts → index-CCggO_hw.d.ts} +0 -0
- /package/dist/{index-h64gcVNJ.d.ts → index-CLjpoGi1.d.ts} +0 -0
- /package/dist/{common-0Iw8ZeM6.js → router-CtcApqrw.js} +0 -0
- /package/dist/{display-WDb9wMCv.js → runtime-UJIpkNww.js} +0 -0
- /package/dist/{router-BvamdzoF.js → types-Bx1EKe0v.js} +0 -0
- /package/dist/{runtime-Skt5NiOc.js → types-CAwOz52q.js} +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { ApplicationCommandOptionType, Attachment, CommandInteractionOption, GuildMember, Message, Role, User } from "discord.js";
|
|
2
|
-
import { Channel } from "diagnostics_channel";
|
|
3
|
-
|
|
4
|
-
//#region src/app/commands/MessageCommandParser.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Represents a parsed message command with its components.
|
|
8
|
-
*/
|
|
9
|
-
interface ParsedMessageCommand {
|
|
10
|
-
command: string;
|
|
11
|
-
options: {
|
|
12
|
-
name: string;
|
|
13
|
-
value: unknown;
|
|
14
|
-
}[];
|
|
15
|
-
subcommand?: string;
|
|
16
|
-
subcommandGroup?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Schema defining the types of options for a message command.
|
|
20
|
-
*/
|
|
21
|
-
type MessageCommandOptionsSchema = Record<string, ApplicationCommandOptionType>;
|
|
22
|
-
/**
|
|
23
|
-
* Parses message content into structured command data with options and subcommands.
|
|
24
|
-
*/
|
|
25
|
-
declare class MessageCommandParser {
|
|
26
|
-
#private;
|
|
27
|
-
message: Message;
|
|
28
|
-
private prefix;
|
|
29
|
-
private schema;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new message command parser.
|
|
32
|
-
* @param message - The Discord message to parse
|
|
33
|
-
* @param prefix - Array of valid command prefixes or a regular expression
|
|
34
|
-
* @param schema - Function that returns the options schema for a command
|
|
35
|
-
*/
|
|
36
|
-
constructor(message: Message, prefix: string[] | RegExp, schema: (command: string) => MessageCommandOptionsSchema);
|
|
37
|
-
/**
|
|
38
|
-
* Gets the parsed command arguments.
|
|
39
|
-
* @returns Array of command arguments
|
|
40
|
-
*/
|
|
41
|
-
getArgs(): string[];
|
|
42
|
-
/**
|
|
43
|
-
* Gets the message command options object for easy access to typed option values.
|
|
44
|
-
*/
|
|
45
|
-
get options(): MessageCommandOptions;
|
|
46
|
-
/**
|
|
47
|
-
* Gets a specific option value by name.
|
|
48
|
-
* @param name - The option name
|
|
49
|
-
* @returns The option value or undefined if not found
|
|
50
|
-
*/
|
|
51
|
-
getOption<T>(name: string): T | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Gets the main command name.
|
|
54
|
-
* @returns The command name
|
|
55
|
-
*/
|
|
56
|
-
getCommand(): string;
|
|
57
|
-
/**
|
|
58
|
-
* Gets the subcommand name if present.
|
|
59
|
-
* @returns The subcommand name or undefined
|
|
60
|
-
*/
|
|
61
|
-
getSubcommand(): string | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Gets the subcommand group name if present.
|
|
64
|
-
* @returns The subcommand group name or undefined
|
|
65
|
-
*/
|
|
66
|
-
getSubcommandGroup(): string | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Gets the prefix used in the message.
|
|
69
|
-
* @returns The matched prefix or undefined
|
|
70
|
-
*/
|
|
71
|
-
getPrefix(): string | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Gets the full command including subcommand group and subcommand.
|
|
74
|
-
* @returns The complete command string
|
|
75
|
-
*/
|
|
76
|
-
getFullCommand(): string;
|
|
77
|
-
/**
|
|
78
|
-
* Parses the message content into structured command data.
|
|
79
|
-
* @returns The parsed command data
|
|
80
|
-
*/
|
|
81
|
-
parse(): ParsedMessageCommand;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Provides typed access to message command options with methods similar to Discord.js interaction options.
|
|
85
|
-
*/
|
|
86
|
-
declare class MessageCommandOptions {
|
|
87
|
-
private parser;
|
|
88
|
-
/**
|
|
89
|
-
* Creates a new message command options instance.
|
|
90
|
-
* @param parser - The message command parser instance
|
|
91
|
-
*/
|
|
92
|
-
constructor(parser: MessageCommandParser);
|
|
93
|
-
/**
|
|
94
|
-
* @private
|
|
95
|
-
* @internal
|
|
96
|
-
*/
|
|
97
|
-
private assertOption;
|
|
98
|
-
/**
|
|
99
|
-
* Gets a guild member from the command options.
|
|
100
|
-
* @param name - The option name
|
|
101
|
-
* @param required - Whether the option is required
|
|
102
|
-
* @returns The guild member or null if not found
|
|
103
|
-
*/
|
|
104
|
-
getMember(name: string): GuildMember | null;
|
|
105
|
-
getMember(name: string, required: true): GuildMember;
|
|
106
|
-
/**
|
|
107
|
-
* Gets an attachment from the command options.
|
|
108
|
-
* @param name - The option name
|
|
109
|
-
* @param required - Whether the option is required
|
|
110
|
-
* @returns The attachment or null if not found
|
|
111
|
-
*/
|
|
112
|
-
getAttachment(name: string): Attachment | null;
|
|
113
|
-
getAttachment(name: string, required: true): Attachment;
|
|
114
|
-
/**
|
|
115
|
-
* Gets a boolean value from the command options.
|
|
116
|
-
* @param name - The option name
|
|
117
|
-
* @param required - Whether the option is required
|
|
118
|
-
* @returns The boolean value or null if not found
|
|
119
|
-
*/
|
|
120
|
-
getBoolean(name: string): boolean | null;
|
|
121
|
-
getBoolean(name: string, required: true): boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Gets a number value from the command options.
|
|
124
|
-
* @param name - The option name
|
|
125
|
-
* @param required - Whether the option is required
|
|
126
|
-
* @returns The number value or null if not found
|
|
127
|
-
*/
|
|
128
|
-
getNumber(name: string): number | null;
|
|
129
|
-
getNumber(name: string, required: true): number;
|
|
130
|
-
/**
|
|
131
|
-
* Gets a string value from the command options.
|
|
132
|
-
* @param name - The option name
|
|
133
|
-
* @param required - Whether the option is required
|
|
134
|
-
* @returns The string value or null if not found
|
|
135
|
-
*/
|
|
136
|
-
getString(name: string): string | null;
|
|
137
|
-
getString(name: string, required: true): string;
|
|
138
|
-
/**
|
|
139
|
-
* Gets an integer value from the command options.
|
|
140
|
-
* @param name - The option name
|
|
141
|
-
* @param required - Whether the option is required
|
|
142
|
-
* @returns The integer value or null if not found
|
|
143
|
-
*/
|
|
144
|
-
getInteger(name: string): number | null;
|
|
145
|
-
getInteger(name: string, required: true): number;
|
|
146
|
-
/**
|
|
147
|
-
* Gets a user from the command options.
|
|
148
|
-
* @param name - The option name
|
|
149
|
-
* @param required - Whether the option is required
|
|
150
|
-
* @returns The user or null if not found
|
|
151
|
-
*/
|
|
152
|
-
getUser(name: string): User | null;
|
|
153
|
-
getUser(name: string, required: true): User;
|
|
154
|
-
/**
|
|
155
|
-
* Gets a channel from the command options.
|
|
156
|
-
* @param name - The option name
|
|
157
|
-
* @param required - Whether the option is required
|
|
158
|
-
* @returns The channel or null if not found
|
|
159
|
-
*/
|
|
160
|
-
getChannel(name: string): Channel | null;
|
|
161
|
-
getChannel(name: string, required: true): Channel;
|
|
162
|
-
/**
|
|
163
|
-
* Gets a role from the command options.
|
|
164
|
-
* @param name - The option name
|
|
165
|
-
* @param required - Whether the option is required
|
|
166
|
-
* @returns The role or null if not found
|
|
167
|
-
*/
|
|
168
|
-
getRole(name: string): Role | null;
|
|
169
|
-
getRole(name: string, required: true): Role;
|
|
170
|
-
/**
|
|
171
|
-
* Gets a mentionable (user, member, or role) from the command options.
|
|
172
|
-
* @param name - The option name
|
|
173
|
-
* @param required - Whether the option is required
|
|
174
|
-
* @returns The mentionable or null if not found
|
|
175
|
-
*/
|
|
176
|
-
getMentionable(name: string): NonNullable<CommandInteractionOption['member' | 'role' | 'user']> | null;
|
|
177
|
-
getMentionable(name: string, required: true): NonNullable<CommandInteractionOption['member' | 'role' | 'user']>;
|
|
178
|
-
/**
|
|
179
|
-
* Gets the subcommand name from the command.
|
|
180
|
-
* @param required - Whether the subcommand is required
|
|
181
|
-
* @returns The subcommand name or null if not found
|
|
182
|
-
*/
|
|
183
|
-
getSubcommand(): string | null;
|
|
184
|
-
getSubcommand(required: true): string;
|
|
185
|
-
/**
|
|
186
|
-
* Gets the subcommand group name from the command.
|
|
187
|
-
* @param required - Whether the subcommand group is required
|
|
188
|
-
* @returns The subcommand group name or null if not found
|
|
189
|
-
*/
|
|
190
|
-
getSubcommandGroup(): string | null;
|
|
191
|
-
getSubcommandGroup(required: true): string;
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
|
-
export { MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, ParsedMessageCommand };
|
|
195
|
-
//# sourceMappingURL=MessageCommandParser-DEOl_ifb.d.ts.map
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
-
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DHTTnX82.js";
|
|
3
|
-
import { RoleSelectMenuBuilder, RoleSelectMenuInteraction } from "discord.js";
|
|
4
|
-
|
|
5
|
-
//#region src/components/interactive/select-menu/RoleSelectMenuKit.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Type for the handler function that is called when the role select menu is submitted.
|
|
9
|
-
*/
|
|
10
|
-
type OnRoleSelectMenuKitSubmit = OnSelectMenuKitSubmit<RoleSelectMenuInteraction, RoleSelectMenuKit>;
|
|
11
|
-
/**
|
|
12
|
-
* Type for the predicate function that filters role select menu interactions.
|
|
13
|
-
* It receives a RoleSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
-
*/
|
|
15
|
-
type RoleSelectMenuKitPredicate = SelectMenuKitPredicate<RoleSelectMenuInteraction>;
|
|
16
|
-
/**
|
|
17
|
-
* A builder for creating role select menus with additional features like interaction collectors and event handling.
|
|
18
|
-
* This class extends the RoleSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
-
* It allows you to set a handler for when the role select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
-
*/
|
|
21
|
-
declare class RoleSelectMenuKit extends RoleSelectMenuBuilder {
|
|
22
|
-
#private;
|
|
23
|
-
/**
|
|
24
|
-
* Sets the handler to run when the modal is submitted.
|
|
25
|
-
* @param handler - The handler to run when the modal is submitted.
|
|
26
|
-
* @param data - The context data for the interaction collector.
|
|
27
|
-
* @returns This instance of the modal builder.
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const modal = new RoleSelectMenuKit()
|
|
31
|
-
* .setTitle('My Modal')
|
|
32
|
-
* .setCustomId('my-modal')
|
|
33
|
-
* .filter((interaction) => interaction.Role.id === '1234567890')
|
|
34
|
-
* .onSelect(async (interaction) => {
|
|
35
|
-
* await interaction.reply('You submitted the modal!');
|
|
36
|
-
* })
|
|
37
|
-
* .addComponents(actionRow1, actionRow2);
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
onSelect(handler: CommandKitSelectMenuBuilderInteractionCollectorDispatch<RoleSelectMenuInteraction, RoleSelectMenuKit>, data?: CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData): this;
|
|
41
|
-
/**
|
|
42
|
-
* Sets the handler to run when the interaction collector ends.
|
|
43
|
-
* @param handler - The handler to run when the interaction collector ends.
|
|
44
|
-
* @returns This instance of the modal builder.
|
|
45
|
-
*/
|
|
46
|
-
onEnd(handler: CommandKitSelectMenuBuilderOnEnd): this;
|
|
47
|
-
/**
|
|
48
|
-
* Sets the handler to run when the interaction collector ends.
|
|
49
|
-
* @param handler - The handler to run when the interaction collector ends.
|
|
50
|
-
* @returns This instance of the modal builder.
|
|
51
|
-
*/
|
|
52
|
-
onError(handler: EventInterceptorErrorHandler): this;
|
|
53
|
-
/**
|
|
54
|
-
* Sets a filter for the interaction collector.
|
|
55
|
-
* @param predicate - The filter to use for the interaction collector.
|
|
56
|
-
* @returns This instance of the modal builder.
|
|
57
|
-
*/
|
|
58
|
-
filter(predicate: SelectMenuKitPredicate<RoleSelectMenuInteraction>): this;
|
|
59
|
-
private get customId();
|
|
60
|
-
/**
|
|
61
|
-
* Disposes of the role select menu kit, cleaning up any resources and event listeners.
|
|
62
|
-
*/
|
|
63
|
-
dispose(): this;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { OnRoleSelectMenuKitSubmit, RoleSelectMenuKit, RoleSelectMenuKitPredicate };
|
|
67
|
-
//# sourceMappingURL=RoleSelectMenuKit-DvBxzpWh.d.ts.map
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
-
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DHTTnX82.js";
|
|
3
|
-
import { StringSelectMenuBuilder, StringSelectMenuInteraction } from "discord.js";
|
|
4
|
-
|
|
5
|
-
//#region src/components/interactive/select-menu/StringSelectMenuKit.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Type for the handler function that is called when the string select menu is submitted.
|
|
9
|
-
*/
|
|
10
|
-
type OnStringSelectMenuKitSubmit = OnSelectMenuKitSubmit<StringSelectMenuInteraction, StringSelectMenuKit>;
|
|
11
|
-
/**
|
|
12
|
-
* Type for the predicate function that filters string select menu interactions.
|
|
13
|
-
* It receives a StringSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
-
*/
|
|
15
|
-
type StringSelectMenuKitPredicate = SelectMenuKitPredicate<StringSelectMenuInteraction>;
|
|
16
|
-
/**
|
|
17
|
-
* A builder for creating string select menus with additional features like interaction collectors and event handling.
|
|
18
|
-
* This class extends the StringSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
-
* It allows you to set a handler for when the string select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
-
*/
|
|
21
|
-
declare class StringSelectMenuKit extends StringSelectMenuBuilder {
|
|
22
|
-
#private;
|
|
23
|
-
/**
|
|
24
|
-
* Sets the handler to run when the modal is submitted.
|
|
25
|
-
* @param handler - The handler to run when the modal is submitted.
|
|
26
|
-
* @param data - The context data for the interaction collector.
|
|
27
|
-
* @returns This instance of the modal builder.
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const modal = new StringSelectMenuKit()
|
|
31
|
-
* .setTitle('My Modal')
|
|
32
|
-
* .setCustomId('my-modal')
|
|
33
|
-
* .filter((interaction) => interaction.user.id === '1234567890')
|
|
34
|
-
* .onSelect(async (interaction) => {
|
|
35
|
-
* await interaction.reply('You submitted the modal!');
|
|
36
|
-
* })
|
|
37
|
-
* .addComponents(actionRow1, actionRow2);
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
onSelect(handler: CommandKitSelectMenuBuilderInteractionCollectorDispatch<StringSelectMenuInteraction, StringSelectMenuKit>, data?: CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData): this;
|
|
41
|
-
/**
|
|
42
|
-
* Sets the handler to run when the interaction collector ends.
|
|
43
|
-
* @param handler - The handler to run when the interaction collector ends.
|
|
44
|
-
* @returns This instance of the modal builder.
|
|
45
|
-
*/
|
|
46
|
-
onEnd(handler: CommandKitSelectMenuBuilderOnEnd): this;
|
|
47
|
-
/**
|
|
48
|
-
* Sets the handler to run when the interaction collector ends.
|
|
49
|
-
* @param handler - The handler to run when the interaction collector ends.
|
|
50
|
-
* @returns This instance of the modal builder.
|
|
51
|
-
*/
|
|
52
|
-
onError(handler: EventInterceptorErrorHandler): this;
|
|
53
|
-
/**
|
|
54
|
-
* Sets a filter for the interaction collector.
|
|
55
|
-
* @param predicate - The filter to use for the interaction collector.
|
|
56
|
-
* @returns This instance of the modal builder.
|
|
57
|
-
*/
|
|
58
|
-
filter(predicate: SelectMenuKitPredicate<StringSelectMenuInteraction>): this;
|
|
59
|
-
private get customId();
|
|
60
|
-
/**
|
|
61
|
-
* Disposes of the interaction collector and cleans up resources.
|
|
62
|
-
*/
|
|
63
|
-
dispose(): this;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { OnStringSelectMenuKitSubmit, StringSelectMenuKit, StringSelectMenuKitPredicate };
|
|
67
|
-
//# sourceMappingURL=StringSelectMenuKit-CJ0MzUZJ.d.ts.map
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
-
import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DHTTnX82.js";
|
|
3
|
-
import { UserSelectMenuBuilder, UserSelectMenuInteraction } from "discord.js";
|
|
4
|
-
|
|
5
|
-
//#region src/components/interactive/select-menu/UserSelectMenuKit.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Type for the handler function that is called when the user select menu is submitted.
|
|
9
|
-
*/
|
|
10
|
-
type OnUserSelectMenuKitSubmit = OnSelectMenuKitSubmit<UserSelectMenuInteraction, UserSelectMenuKit>;
|
|
11
|
-
/**
|
|
12
|
-
* Type for the predicate function that filters user select menu interactions.
|
|
13
|
-
* It receives a UserSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
-
*/
|
|
15
|
-
type UserSelectMenuKitPredicate = SelectMenuKitPredicate<UserSelectMenuInteraction>;
|
|
16
|
-
/**
|
|
17
|
-
* A builder for creating user select menus with additional features like interaction collectors and event handling.
|
|
18
|
-
* This class extends the UserSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
-
* It allows you to set a handler for when the user select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
-
*/
|
|
21
|
-
declare class UserSelectMenuKit extends UserSelectMenuBuilder {
|
|
22
|
-
#private;
|
|
23
|
-
/**
|
|
24
|
-
* Sets the handler to run when the modal is submitted.
|
|
25
|
-
* @param handler - The handler to run when the modal is submitted.
|
|
26
|
-
* @param data - The context data for the interaction collector.
|
|
27
|
-
* @returns This instance of the modal builder.
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const modal = new UserSelectMenuKit()
|
|
31
|
-
* .setTitle('My Modal')
|
|
32
|
-
* .setCustomId('my-modal')
|
|
33
|
-
* .filter((interaction) => interaction.user.id === '1234567890')
|
|
34
|
-
* .onSelect(async (interaction) => {
|
|
35
|
-
* await interaction.reply('You submitted the modal!');
|
|
36
|
-
* })
|
|
37
|
-
* .addComponents(actionRow1, actionRow2);
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
onSelect(handler: CommandKitSelectMenuBuilderInteractionCollectorDispatch<UserSelectMenuInteraction, UserSelectMenuKit>, data?: CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData): this;
|
|
41
|
-
/**
|
|
42
|
-
* Sets the handler to run when the interaction collector ends.
|
|
43
|
-
* @param handler - The handler to run when the interaction collector ends.
|
|
44
|
-
* @returns This instance of the modal builder.
|
|
45
|
-
*/
|
|
46
|
-
onEnd(handler: CommandKitSelectMenuBuilderOnEnd): this;
|
|
47
|
-
/**
|
|
48
|
-
* Sets the handler to run when the interaction collector ends.
|
|
49
|
-
* @param handler - The handler to run when the interaction collector ends.
|
|
50
|
-
* @returns This instance of the modal builder.
|
|
51
|
-
*/
|
|
52
|
-
onError(handler: EventInterceptorErrorHandler): this;
|
|
53
|
-
/**
|
|
54
|
-
* Sets a filter for the interaction collector.
|
|
55
|
-
* @param predicate - The filter to use for the interaction collector.
|
|
56
|
-
* @returns This instance of the modal builder.
|
|
57
|
-
*/
|
|
58
|
-
filter(predicate: SelectMenuKitPredicate<UserSelectMenuInteraction>): this;
|
|
59
|
-
private get customId();
|
|
60
|
-
/**
|
|
61
|
-
* Disposes of the user select menu kit, cleaning up any collectors and handlers.
|
|
62
|
-
*/
|
|
63
|
-
dispose(): this;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { OnUserSelectMenuKitSubmit, UserSelectMenuKit, UserSelectMenuKitPredicate };
|
|
67
|
-
//# sourceMappingURL=UserSelectMenuKit-C_J-9RJs.d.ts.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
const require_common = require('./common-fIO6fqGZ.js');
|
|
3
|
-
const require_env = require('./env-8yY-6pbC.js');
|
|
4
|
-
let node_fs = require("node:fs");
|
|
5
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
6
|
-
let node_path = require("node:path");
|
|
7
|
-
node_path = require_chunk.__toESM(node_path);
|
|
8
|
-
let node_child_process = require("node:child_process");
|
|
9
|
-
node_child_process = require_chunk.__toESM(node_child_process);
|
|
10
|
-
|
|
11
|
-
//#region src/cli/app-process.ts
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
function getStdio(supportsCommands) {
|
|
17
|
-
if (supportsCommands) return [
|
|
18
|
-
"pipe",
|
|
19
|
-
"pipe",
|
|
20
|
-
"pipe",
|
|
21
|
-
"ipc"
|
|
22
|
-
];
|
|
23
|
-
return [
|
|
24
|
-
"pipe",
|
|
25
|
-
"pipe",
|
|
26
|
-
"pipe"
|
|
27
|
-
];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @private
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
function createAppProcess(fileName, cwd, isDev) {
|
|
34
|
-
var _ps$stdout, _ps$stderr;
|
|
35
|
-
if (!(0, node_fs.existsSync)((0, node_path.join)(cwd, fileName))) require_common.panic(`Could not locate the entrypoint file: ${fileName}`);
|
|
36
|
-
const stdio = getStdio(isDev);
|
|
37
|
-
const baseArgs = [`--title="CommandKit ${isDev ? "Development" : "Production"}"`, "--enable-source-maps"];
|
|
38
|
-
const nodeOptions = process.env.CK_NODE_OPTIONS || process.env.NODE_OPTIONS;
|
|
39
|
-
let nodeArgs = [...baseArgs];
|
|
40
|
-
if (nodeOptions) {
|
|
41
|
-
const options = nodeOptions.trim().split(/\s+/);
|
|
42
|
-
for (const option of options) {
|
|
43
|
-
const optionName = option.split("=")[0];
|
|
44
|
-
const existingIndex = nodeArgs.findIndex((arg) => arg.startsWith(optionName));
|
|
45
|
-
if (existingIndex !== -1) nodeArgs[existingIndex] = option;
|
|
46
|
-
else nodeArgs.push(option);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
nodeArgs.push(fileName);
|
|
50
|
-
const ps = (0, node_child_process.spawn)("node", nodeArgs, {
|
|
51
|
-
cwd,
|
|
52
|
-
windowsHide: true,
|
|
53
|
-
env: isDev ? require_env.DevEnv() : require_env.ProdEnv(),
|
|
54
|
-
stdio
|
|
55
|
-
});
|
|
56
|
-
(_ps$stdout = ps.stdout) === null || _ps$stdout === void 0 || _ps$stdout.pipe(process.stdout);
|
|
57
|
-
(_ps$stderr = ps.stderr) === null || _ps$stderr === void 0 || _ps$stderr.pipe(process.stderr);
|
|
58
|
-
return ps;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
//#endregion
|
|
62
|
-
Object.defineProperty(exports, 'createAppProcess', {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
get: function () {
|
|
65
|
-
return createAppProcess;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=app-process-AQ3Cbf6j.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-process-AQ3Cbf6j.js","names":[],"sources":["../src/cli/app-process.ts"],"sourcesContent":["import { IOType, spawn } from 'node:child_process';\nimport { DevEnv, ProdEnv } from './env';\nimport { join } from 'node:path';\nimport { existsSync } from 'node:fs';\nimport { panic } from './common';\n\n/**\n * @private\n * @internal\n */\nfunction getStdio(supportsCommands: boolean) {\n if (supportsCommands) {\n return ['pipe', 'pipe', 'pipe', 'ipc'];\n }\n\n return ['pipe', 'pipe', 'pipe'];\n}\n\n/**\n * @private\n * @internal\n */\nexport function createAppProcess(\n fileName: string,\n cwd: string,\n isDev: boolean,\n) {\n if (!existsSync(join(cwd, fileName))) {\n panic(`Could not locate the entrypoint file: ${fileName}`);\n }\n\n const stdio = getStdio(isDev) as IOType[];\n\n const baseArgs = [\n `--title=\"CommandKit ${isDev ? 'Development' : 'Production'}\"`,\n '--enable-source-maps',\n ];\n\n const nodeOptions = process.env.CK_NODE_OPTIONS || process.env.NODE_OPTIONS;\n let nodeArgs = [...baseArgs];\n\n if (nodeOptions) {\n const options = nodeOptions.trim().split(/\\s+/);\n\n for (const option of options) {\n const optionName = option.split('=')[0];\n const existingIndex = nodeArgs.findIndex((arg) =>\n arg.startsWith(optionName),\n );\n\n if (existingIndex !== -1) {\n nodeArgs[existingIndex] = option;\n } else {\n nodeArgs.push(option);\n }\n }\n }\n\n nodeArgs.push(fileName);\n\n const ps = spawn('node', nodeArgs, {\n cwd,\n windowsHide: true,\n env: isDev ? DevEnv() : ProdEnv(),\n stdio,\n });\n\n ps.stdout?.pipe(process.stdout);\n ps.stderr?.pipe(process.stderr);\n\n return ps;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAUA,SAAS,SAAS,kBAA2B;AAC3C,KAAI,iBACF,QAAO;EAAC;EAAQ;EAAQ;EAAQ;EAAM;AAGxC,QAAO;EAAC;EAAQ;EAAQ;EAAO;;;;;;AAOjC,SAAgB,iBAChB,UACA,KACA,OACA;;AACE,KAAI,6CAAiB,KAAK,SAAS,CAAC,CAClC,sBAAM,yCAAyC,WAAW;CAG5D,MAAM,QAAQ,SAAS,MAAM;CAE7B,MAAM,WAAW,CACjB,uBAAuB,QAAQ,gBAAgB,aAAa,IAC5D,uBAAuB;CAGvB,MAAM,cAAc,QAAQ,IAAI,mBAAmB,QAAQ,IAAI;CAC/D,IAAI,WAAW,CAAC,GAAG,SAAS;AAE5B,KAAI,aAAa;EACf,MAAM,UAAU,YAAY,MAAM,CAAC,MAAM,MAAM;AAE/C,OAAK,MAAM,UAAU,SAAS;GAC5B,MAAM,aAAa,OAAO,MAAM,IAAI,CAAC;GACrC,MAAM,gBAAgB,SAAS,WAAW,QAC1C,IAAI,WAAW,WAAW,CACzB;AAED,OAAI,kBAAkB,GACpB,UAAS,iBAAiB;OAE1B,UAAS,KAAK,OAAO;;;AAK3B,UAAS,KAAK,SAAS;CAEvB,MAAM,mCAAW,QAAQ,UAAU;EACjC;EACA,aAAa;EACb,KAAK,QAAQ,oBAAQ,GAAG,qBAAS;EACjC;EACD,CAAC;AAEF,kBAAG,wDAAQ,KAAK,QAAQ,OAAO;AAC/B,kBAAG,wDAAQ,KAAK,QAAQ,OAAO;AAE/B,QAAO"}
|
package/dist/build-BYMHMOl_.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
const require_commandkit = require('./commandkit-DabqpQ6v.js');
|
|
3
|
-
const require_constants = require('./constants-BMWH2YUr.js');
|
|
4
|
-
const require_utils = require('./utils-Br3eenD1.js');
|
|
5
|
-
const require_common = require('./common-fIO6fqGZ.js');
|
|
6
|
-
const require_env = require('./env-8yY-6pbC.js');
|
|
7
|
-
const require_type_checker = require('./type-checker-CEFHoQoV.js');
|
|
8
|
-
let node_fs = require("node:fs");
|
|
9
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
10
|
-
let node_path = require("node:path");
|
|
11
|
-
node_path = require_chunk.__toESM(node_path);
|
|
12
|
-
let node_fs_promises = require("node:fs/promises");
|
|
13
|
-
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
14
|
-
let rimraf = require("rimraf");
|
|
15
|
-
rimraf = require_chunk.__toESM(rimraf);
|
|
16
|
-
|
|
17
|
-
//#region src/cli/build.ts
|
|
18
|
-
/**
|
|
19
|
-
* @private
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
function mergeDefinitionsIfNeeded(env, isDev) {
|
|
23
|
-
const values = Object.fromEntries(Object.entries(process.env).filter(([k]) => !(k in env) && k.startsWith("COMMANDKIT_PUBLIC_")));
|
|
24
|
-
return {
|
|
25
|
-
...env,
|
|
26
|
-
...values,
|
|
27
|
-
...isDev ? {
|
|
28
|
-
NODE_ENV: "development",
|
|
29
|
-
COMMANDKIT_BOOTSTRAP_MODE: "development",
|
|
30
|
-
COMMANDKIT_IS_DEV: "true",
|
|
31
|
-
COMMANDKIT_IS_TEST: "false"
|
|
32
|
-
} : {
|
|
33
|
-
NODE_ENV: "production",
|
|
34
|
-
COMMANDKIT_BOOTSTRAP_MODE: "production",
|
|
35
|
-
COMMANDKIT_IS_DEV: "false",
|
|
36
|
-
COMMANDKIT_IS_TEST: "false"
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @private
|
|
42
|
-
* @internal
|
|
43
|
-
*/
|
|
44
|
-
async function buildApplication({ plugins, rolldownPlugins, isDev, configPath }) {
|
|
45
|
-
var _config$typescript;
|
|
46
|
-
const { build } = await require_common.loadTsdown();
|
|
47
|
-
const config = await require_commandkit.loadConfigFile(configPath);
|
|
48
|
-
if (!isDev && !(config === null || config === void 0 || (_config$typescript = config.typescript) === null || _config$typescript === void 0 ? void 0 : _config$typescript.ignoreBuildErrors)) await require_type_checker.performTypeCheck(configPath || require_constants.COMMANDKIT_CWD);
|
|
49
|
-
const pluginRuntime = new require_commandkit.CompilerPluginRuntime(plugins || []);
|
|
50
|
-
rolldownPlugins ??= [];
|
|
51
|
-
rolldownPlugins.push(pluginRuntime.toJSON());
|
|
52
|
-
try {
|
|
53
|
-
var _config$sourceMap, _config$compilerOptio, _config$compilerOptio2, _config$antiCrashScri;
|
|
54
|
-
const dest = isDev ? ".commandkit" : config.distDir;
|
|
55
|
-
await (0, rimraf.rimraf)(dest);
|
|
56
|
-
await pluginRuntime.init();
|
|
57
|
-
await build(require_utils.mergeDeep({
|
|
58
|
-
watch: false,
|
|
59
|
-
dts: false,
|
|
60
|
-
clean: true,
|
|
61
|
-
format: ["esm"],
|
|
62
|
-
shims: true,
|
|
63
|
-
minify: false,
|
|
64
|
-
silent: !!isDev,
|
|
65
|
-
inputOptions: {
|
|
66
|
-
transform: { jsx: {
|
|
67
|
-
runtime: "automatic",
|
|
68
|
-
importSource: "commandkit"
|
|
69
|
-
} },
|
|
70
|
-
checks: { circularDependency: true },
|
|
71
|
-
onwarn: (warning, defaultWarn) => {
|
|
72
|
-
var _warning$message;
|
|
73
|
-
if (warning === null || warning === void 0 || (_warning$message = warning.message) === null || _warning$message === void 0 ? void 0 : _warning$message.includes("compilerOptions.jsx")) return;
|
|
74
|
-
return defaultWarn(warning);
|
|
75
|
-
},
|
|
76
|
-
onLog: (level, log, defaultLog) => {
|
|
77
|
-
if (isDev) return;
|
|
78
|
-
return defaultLog(level, log);
|
|
79
|
-
},
|
|
80
|
-
moduleTypes: {
|
|
81
|
-
".json": "json",
|
|
82
|
-
".node": "binary"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
plugins: rolldownPlugins,
|
|
86
|
-
platform: "node",
|
|
87
|
-
skipNodeModulesBundle: true,
|
|
88
|
-
sourcemap: ((_config$sourceMap = config.sourceMap) === null || _config$sourceMap === void 0 ? void 0 : _config$sourceMap[isDev ? "development" : "production"]) ?? true,
|
|
89
|
-
target: "node16",
|
|
90
|
-
outDir: dest,
|
|
91
|
-
env: mergeDefinitionsIfNeeded(config.env || {}, !!isDev),
|
|
92
|
-
entry: Array.from(new Set([
|
|
93
|
-
"src/**/*.{js,cjs,mjs,ts,cts,mts,jsx,tsx}",
|
|
94
|
-
`!${config.distDir}`,
|
|
95
|
-
"!.commandkit",
|
|
96
|
-
"!**/*.test.*",
|
|
97
|
-
"!**/*.spec.*",
|
|
98
|
-
...config.entrypoints ?? []
|
|
99
|
-
])),
|
|
100
|
-
outputOptions: { sanitizeFileName: (name) => name },
|
|
101
|
-
unbundle: isDev ? true : ((_config$compilerOptio = config.compilerOptions) === null || _config$compilerOptio === void 0 ? void 0 : _config$compilerOptio.disableChunking) ?? false
|
|
102
|
-
}, (_config$compilerOptio2 = config.compilerOptions) === null || _config$compilerOptio2 === void 0 ? void 0 : _config$compilerOptio2.tsdown));
|
|
103
|
-
await require_common.copyLocaleFiles("src", dest);
|
|
104
|
-
await injectEntryFile(configPath || require_constants.COMMANDKIT_CWD, !!isDev, !!(((_config$antiCrashScri = config.antiCrashScript) === null || _config$antiCrashScri === void 0 ? void 0 : _config$antiCrashScri[isDev ? "development" : "production"]) ?? (isDev ? true : false)), config.distDir);
|
|
105
|
-
} catch (error) {
|
|
106
|
-
console.error("Build failed:", error);
|
|
107
|
-
if (error instanceof Error) console.error("Error details:", error.stack);
|
|
108
|
-
process.exit(1);
|
|
109
|
-
} finally {
|
|
110
|
-
await pluginRuntime.destroy();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const envScript = (dev) => `// --- Environment Variables Loader ---
|
|
114
|
-
const $env = [${(dev ? require_env.devEnvFileArgs : require_env.prodEnvFileArgs).map((p) => `"${p}"`).join(", ")}];
|
|
115
|
-
for (const file of $env) {
|
|
116
|
-
try {
|
|
117
|
-
process.loadEnvFile(file);
|
|
118
|
-
console.log('\\x1b[36m✔ Loaded \\x1b[0m\\x1b[33m%s\\x1b[0m', file);
|
|
119
|
-
} catch {}
|
|
120
|
-
}
|
|
121
|
-
`;
|
|
122
|
-
const antiCrashScript = [
|
|
123
|
-
"// --- CommandKit Anti-Crash Monitor ---",
|
|
124
|
-
" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process",
|
|
125
|
-
" // instead of using it as a means to resume operation.",
|
|
126
|
-
" // But it exists here due to compatibility reasons with discord bot ecosystem.",
|
|
127
|
-
" const p = (t) => `\\x1b[31m${t}\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';",
|
|
128
|
-
" if (!process.eventNames().includes(e1)) // skip if it is already handled",
|
|
129
|
-
" process.on(e1, (e) => {",
|
|
130
|
-
" l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));",
|
|
131
|
-
" })",
|
|
132
|
-
" if (!process.eventNames().includes(e2)) // skip if it is already handled",
|
|
133
|
-
" process.on(e2, (r) => {",
|
|
134
|
-
" l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));",
|
|
135
|
-
" });",
|
|
136
|
-
"// --- CommandKit Anti-Crash Monitor ---"
|
|
137
|
-
].join("\n");
|
|
138
|
-
const wrapInAsyncIIFE = (code) => `;await (async () => {\n${code.join("\n\n")}\n})();`;
|
|
139
|
-
async function injectEntryFile(configPath, isDev, emitAntiCrashScript, distDir) {
|
|
140
|
-
const entryFilePath = (0, node_path.join)(configPath, isDev ? ".commandkit" : distDir || "dist", "index.js");
|
|
141
|
-
if ((0, node_fs.existsSync)(entryFilePath)) return;
|
|
142
|
-
await (0, node_fs_promises.writeFile)(entryFilePath, `/* Entrypoint File Generated By CommandKit */
|
|
143
|
-
${isDev ? `\n\n// Injected for development\n${wrapInAsyncIIFE([envScript(isDev), emitAntiCrashScript ? antiCrashScript : ""])}\n\n` : wrapInAsyncIIFE([envScript(isDev)])}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
async function bootstrap() {
|
|
147
|
-
const { Client } = await import('discord.js');
|
|
148
|
-
const { commandkit } = await import('commandkit');
|
|
149
|
-
const app = await import('./app.js').then((m) => m.default ?? m);
|
|
150
|
-
|
|
151
|
-
if (!app || !(app instanceof Client)) {
|
|
152
|
-
throw new Error('The app file must default export the discord.js client instance');
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
commandkit.setClient(app);
|
|
156
|
-
|
|
157
|
-
await commandkit.start();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
await bootstrap().catch((e) => {
|
|
161
|
-
console.error('Failed to bootstrap CommandKit application:\\n', e.stack);
|
|
162
|
-
})
|
|
163
|
-
`);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
//#endregion
|
|
167
|
-
Object.defineProperty(exports, 'buildApplication', {
|
|
168
|
-
enumerable: true,
|
|
169
|
-
get: function () {
|
|
170
|
-
return buildApplication;
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
//# sourceMappingURL=build-BYMHMOl_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-BYMHMOl_.js","names":[],"sources":["../src/cli/build.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { rimraf } from 'rimraf';\nimport type { Options } from 'tsdown';\n\nimport { MaybeArray } from '../components';\nimport { loadConfigFile } from '../config/loader';\nimport { mergeDeep } from '../config/utils';\nimport { CompilerPlugin, CompilerPluginRuntime } from '../plugins';\nimport { COMMANDKIT_CWD } from '../utils/constants';\nimport { copyLocaleFiles, loadTsdown } from './common';\nimport { devEnvFileArgs, prodEnvFileArgs } from './env';\nimport { performTypeCheck } from './type-checker';\n\n/**\n * @private\n * @internal\n */\nexport interface ApplicationBuildOptions {\n plugins?: MaybeArray<CompilerPlugin>[] | Array<CompilerPlugin>;\n rolldownPlugins?: any[];\n isDev?: boolean;\n configPath?: string;\n}\n\n// emit public env variables and given env variables\n/**\n * @private\n * @internal\n */\nfunction mergeDefinitionsIfNeeded(env: Record<string, string>, isDev: boolean) {\n const values = Object.fromEntries(\n Object.entries(process.env).filter(\n ([k]) => !(k in env) && k.startsWith('COMMANDKIT_PUBLIC_'),\n ),\n );\n\n return {\n ...env,\n ...values,\n ...(isDev\n ? {\n NODE_ENV: 'development',\n COMMANDKIT_BOOTSTRAP_MODE: 'development',\n COMMANDKIT_IS_DEV: 'true',\n COMMANDKIT_IS_TEST: 'false',\n }\n : {\n NODE_ENV: 'production',\n COMMANDKIT_BOOTSTRAP_MODE: 'production',\n COMMANDKIT_IS_DEV: 'false',\n COMMANDKIT_IS_TEST: 'false',\n }),\n };\n}\n\n/**\n * @private\n * @internal\n */\nexport async function buildApplication({\n plugins,\n rolldownPlugins,\n isDev,\n configPath,\n}: ApplicationBuildOptions) {\n const { build } = await loadTsdown();\n const config = await loadConfigFile(configPath);\n\n if (!isDev && !config?.typescript?.ignoreBuildErrors) {\n await performTypeCheck(configPath || COMMANDKIT_CWD);\n }\n\n const pluginRuntime = new CompilerPluginRuntime(\n (plugins || []) as CompilerPlugin[],\n );\n\n rolldownPlugins ??= [];\n\n rolldownPlugins.push(pluginRuntime.toJSON());\n\n try {\n const dest = isDev ? '.commandkit' : config.distDir;\n\n // Clean the destination directory\n await rimraf(dest);\n\n await pluginRuntime.init();\n\n await build(\n mergeDeep(\n {\n watch: false,\n dts: false,\n clean: true,\n format: ['esm'],\n shims: true,\n minify: false,\n silent: !!isDev,\n inputOptions: {\n transform: {\n jsx: {\n runtime: 'automatic',\n importSource: 'commandkit',\n },\n },\n checks: {\n circularDependency: true,\n },\n onwarn: (warning, defaultWarn) => {\n if (warning?.message?.includes('compilerOptions.jsx')) return;\n\n return defaultWarn(warning);\n },\n onLog: (level, log, defaultLog) => {\n if (isDev) return;\n\n return defaultLog(level, log);\n },\n moduleTypes: {\n '.json': 'json',\n '.node': 'binary',\n },\n },\n plugins: rolldownPlugins,\n platform: 'node',\n skipNodeModulesBundle: true,\n sourcemap:\n config.sourceMap?.[isDev ? 'development' : 'production'] ?? true,\n target: 'node16',\n outDir: dest,\n env: mergeDefinitionsIfNeeded(config.env || {}, !!isDev),\n entry: Array.from(\n new Set([\n 'src/**/*.{js,cjs,mjs,ts,cts,mts,jsx,tsx}',\n `!${config.distDir}`,\n '!.commandkit',\n '!**/*.test.*',\n '!**/*.spec.*',\n ...(config.entrypoints ?? []),\n ]),\n ),\n outputOptions: {\n sanitizeFileName: (name) => name,\n },\n unbundle: isDev\n ? true\n : (config.compilerOptions?.disableChunking ?? false),\n } satisfies Options,\n config.compilerOptions?.tsdown,\n ),\n );\n\n await copyLocaleFiles('src', dest);\n await injectEntryFile(\n configPath || COMMANDKIT_CWD,\n !!isDev,\n !!(\n config.antiCrashScript?.[isDev ? 'development' : 'production'] ??\n (isDev ? true : false)\n ),\n config.distDir,\n );\n } catch (error) {\n console.error('Build failed:', error);\n if (error instanceof Error) {\n console.error('Error details:', error.stack);\n }\n process.exit(1); // Force exit on error\n } finally {\n // Ensure plugins are cleaned up\n await pluginRuntime.destroy();\n }\n}\n\nconst envScript = (dev: boolean) => `// --- Environment Variables Loader ---\nconst $env = [${(dev ? devEnvFileArgs : prodEnvFileArgs).map((p) => `\"${p}\"`).join(', ')}];\nfor (const file of $env) {\n try {\n process.loadEnvFile(file);\n console.log('\\\\x1b[36m✔ Loaded \\\\x1b[0m\\\\x1b[33m%s\\\\x1b[0m', file);\n } catch {}\n}\n`;\n\nconst antiCrashScript = [\n '// --- CommandKit Anti-Crash Monitor ---',\n \" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process\",\n ' // instead of using it as a means to resume operation.',\n ' // But it exists here due to compatibility reasons with discord bot ecosystem.',\n \" const p = (t) => `\\\\x1b[31m${t}\\\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';\",\n ' if (!process.eventNames().includes(e1)) // skip if it is already handled',\n ' process.on(e1, (e) => {',\n ' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',\n ' })',\n ' if (!process.eventNames().includes(e2)) // skip if it is already handled',\n ' process.on(e2, (r) => {',\n ' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',\n ' });',\n '// --- CommandKit Anti-Crash Monitor ---',\n].join('\\n');\n\nconst wrapInAsyncIIFE = (code: string[]) =>\n `;await (async () => {\\n${code.join('\\n\\n')}\\n})();`;\n\nasync function injectEntryFile(\n configPath: string,\n isDev: boolean,\n emitAntiCrashScript: boolean,\n distDir?: string,\n) {\n const dist = isDev ? '.commandkit' : distDir || 'dist';\n const entryFilePath = join(configPath, dist, 'index.js');\n\n // skip if the entry file already exists\n if (existsSync(entryFilePath)) return;\n\n const code = `/* Entrypoint File Generated By CommandKit */\n${isDev ? `\\n\\n// Injected for development\\n${wrapInAsyncIIFE([envScript(isDev), emitAntiCrashScript ? antiCrashScript : ''])}\\n\\n` : wrapInAsyncIIFE([envScript(isDev)])}\n\n\nasync function bootstrap() {\n const { Client } = await import('discord.js');\n const { commandkit } = await import('commandkit');\n const app = await import('./app.js').then((m) => m.default ?? m);\n\n if (!app || !(app instanceof Client)) {\n throw new Error('The app file must default export the discord.js client instance');\n }\n\n commandkit.setClient(app);\n\n await commandkit.start();\n}\n\nawait bootstrap().catch((e) => {\n console.error('Failed to bootstrap CommandKit application:\\\\n', e.stack);\n})\n`;\n\n await writeFile(entryFilePath, code);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BA,SAAS,yBAAyB,KAA6B,OAAgB;CAC7E,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,QAAQ,IAAI,CAAC,QACzB,CAAC,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,qBAAqB,CAC3D,CACF;AAED,QAAO;EACL,GAAG;EACH,GAAG;EACH,GAAI,QACJ;GACE,UAAU;GACV,2BAA2B;GAC3B,mBAAmB;GACnB,oBAAoB;GACrB,GACD;GACE,UAAU;GACV,2BAA2B;GAC3B,mBAAmB;GACnB,oBAAoB;GACrB;EACF;;;;;;AAOH,eAAsB,iBAAiB,EACrC,SACA,iBACA,OACA,cAC0B;;CAC1B,MAAM,EAAE,UAAU,MAAM,2BAAY;CACpC,MAAM,SAAS,MAAM,kCAAe,WAAW;AAE/C,KAAI,CAAC,SAAS,gEAAC,OAAQ,oFAAY,mBACjC,OAAM,sCAAiB,cAAc,iCAAe;CAGtD,MAAM,gBAAgB,IAAI,yCACvB,WAAW,EAAE,CACf;AAED,qBAAoB,EAAE;AAEtB,iBAAgB,KAAK,cAAc,QAAQ,CAAC;AAE5C,KAAI;;EACF,MAAM,OAAO,QAAQ,gBAAgB,OAAO;AAG5C,2BAAa,KAAK;AAElB,QAAM,cAAc,MAAM;AAE1B,QAAM,MACJ,wBACE;GACE,OAAO;GACP,KAAK;GACL,OAAO;GACP,QAAQ,CAAC,MAAM;GACf,OAAO;GACP,QAAQ;GACR,QAAQ,CAAC,CAAC;GACV,cAAc;IACZ,WAAW,EACT,KAAK;KACH,SAAS;KACT,cAAc;KACf,EACF;IACD,QAAQ,EACN,oBAAoB,MACrB;IACD,SAAS,SAAS,gBAAgB;;AAChC,uEAAI,QAAS,6EAAS,SAAS,sBAAsB,CAAE;AAEvD,YAAO,YAAY,QAAQ;;IAE7B,QAAQ,OAAO,KAAK,eAAe;AACjC,SAAI,MAAO;AAEX,YAAO,WAAW,OAAO,IAAI;;IAE/B,aAAa;KACX,SAAS;KACT,SAAS;KACV;IACF;GACD,SAAS;GACT,UAAU;GACV,uBAAuB;GACvB,iCACA,OAAO,iFAAY,QAAQ,gBAAgB,kBAAiB;GAC5D,QAAQ;GACR,QAAQ;GACR,KAAK,yBAAyB,OAAO,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM;GACxD,OAAO,MAAM,KACX,IAAI,IAAI;IACR;IACA,IAAI,OAAO;IACX;IACA;IACA;IACA,GAAI,OAAO,eAAe,EAAE;IAAE,CAC7B,CACF;GACD,eAAe,EACb,mBAAmB,SAAS,MAC7B;GACD,UAAU,QACV,iCACA,OAAO,+FAAiB,oBAAmB;GAC5C,4BACD,OAAO,iGAAiB,OACzB,CACF;AAED,QAAM,+BAAgB,OAAO,KAAK;AAClC,QAAM,gBACJ,cAAc,kCACd,CAAC,CAAC,OACF,CAAC,4BACD,OAAO,+FAAkB,QAAQ,gBAAgB,mBACjD,QAAQ,OAAO,SAEf,OAAO,QACR;UACM,OAAO;AACd,UAAQ,MAAM,iBAAiB,MAAM;AACrC,MAAI,iBAAiB,MACnB,SAAQ,MAAM,kBAAkB,MAAM,MAAM;AAE9C,UAAQ,KAAK,EAAE;WACP;AAER,QAAM,cAAc,SAAS;;;AAIjC,MAAM,aAAa,QAAiB;iBACnB,MAAM,6BAAiB,6BAAiB,KAAK,MAAM,IAAI,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC;;;;;;;;AASzF,MAAM,kBAAkB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAA2C,CAC3C,KAAK,KAAK;AAEV,MAAM,mBAAmB,SACzB,0BAA0B,KAAK,KAAK,OAAO,CAAC;AAE5C,eAAe,gBACf,YACA,OACA,qBACA,SACA;CAEE,MAAM,oCAAqB,YADd,QAAQ,gBAAgB,WAAW,QACH,WAAW;AAGxD,6BAAe,cAAc,CAAE;AAyB/B,uCAAgB,eAvBH;EACb,QAAQ,oCAAoC,gBAAgB,CAAC,UAAU,MAAM,EAAE,sBAAsB,kBAAkB,GAAG,CAAC,CAAC,QAAQ,gBAAgB,CAAC,UAAU,MAAM,CAAC,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;EAsBnI"}
|