commandkit 1.2.0-rc.12 → 1.2.0-rc.13
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-B-7n9MMr.d.ts → ActionRow-B-CGmjDp.d.ts} +3 -4
- 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/{Button-RMp-w8HV.d.ts → Button-C-GPeFA3.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-CnT5ymYe.js} +2 -2
- package/dist/{CommandKitEventsChannel-2l9Za-le.js.map → CommandKitEventsChannel-CnT5ymYe.js.map} +1 -1
- package/dist/{CommandsRouter-CBdsqaWK.d.ts → CommandsRouter-C7dZEepB.d.ts} +49 -50
- package/dist/{CommandsRouter-CWMipIis.js → CommandsRouter-C_HLsrGX.js} +2 -6
- package/dist/{CommandsRouter-CWMipIis.js.map → CommandsRouter-C_HLsrGX.js.map} +1 -1
- package/dist/{CompilerPlugin-CZ4412Zm.js → CompilerPlugin-CUsGAfgl.js} +2 -2
- package/dist/{CompilerPlugin-CZ4412Zm.js.map → CompilerPlugin-CUsGAfgl.js.map} +1 -1
- package/dist/EventInterceptor-BWoEJMHZ.js.map +1 -1
- package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-CZmWpS08.d.ts} +40 -40
- package/dist/{EventWorkerContext-D_9q1Bm2.js → EventWorkerContext-Dfhgv329.js} +2 -3
- package/dist/{EventWorkerContext-D_9q1Bm2.js.map → EventWorkerContext-Dfhgv329.js.map} +1 -1
- package/dist/EventsRouter-DZ37r54v.d.ts +90 -0
- package/dist/{EventsRouter-C04XqRKf.js → EventsRouter-DZYIha6m.js} +2 -6
- package/dist/{EventsRouter-C04XqRKf.js.map → EventsRouter-DZYIha6m.js.map} +1 -1
- package/dist/MentionableSelectMenuKit-7URDUM3-.d.ts +61 -0
- package/dist/{MessageCommandParser-CKh-tM97.js → MessageCommandParser-Bs9fimmd.js} +2 -3
- package/dist/{MessageCommandParser-CKh-tM97.js.map → MessageCommandParser-Bs9fimmd.js.map} +1 -1
- package/dist/MessageCommandParser-q3dQcE5N.d.ts +194 -0
- package/dist/{Modal-Calb46SJ.d.ts → Modal-CZT9MZsy.d.ts} +20 -10
- package/dist/{ModalKit-Cq2ns6jv.d.ts → ModalKit-BWXI3Z26.d.ts} +33 -34
- package/dist/{PluginCommon-CPWV5xuX.js → PluginCommon-BLxWww5u.js} +6 -7
- package/dist/{PluginCommon-CPWV5xuX.js.map → PluginCommon-BLxWww5u.js.map} +1 -1
- package/dist/RoleSelectMenuKit-BY-JJ18w.d.ts +66 -0
- package/dist/{RuntimePlugin-COeXe8rP.js → RuntimePlugin-CtobluSU.js} +2 -2
- package/dist/{RuntimePlugin-COeXe8rP.js.map → RuntimePlugin-CtobluSU.js.map} +1 -1
- package/dist/{SelectMenu-VcDhOGoJ.d.ts → SelectMenu-q_b3Mjv9.d.ts} +9 -10
- 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 +22 -37
- package/dist/analytics/analytics-provider.d.ts +1 -33
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.js +22 -37
- package/dist/{analytics-engine-NOInIjv8.d.ts → analytics-engine-WQhXmx3H.d.ts} +844 -841
- package/dist/app/commands/AppCommandRunner.d.ts +1 -33
- package/dist/app/commands/AppCommandRunner.js +22 -37
- package/dist/app/commands/Context.d.ts +1 -33
- package/dist/app/commands/Context.js +22 -37
- 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 +22 -37
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -33
- package/dist/app/handlers/AppEventsHandler.js +22 -37
- package/dist/app/index.d.ts +4 -33
- package/dist/app/index.js +22 -38
- 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 +22 -37
- package/dist/app/register/CommandRegistrar.d.ts +1 -33
- package/dist/app/register/CommandRegistrar.js +22 -37
- 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 +2 -2
- 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 +189 -42
- 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 +41 -49
- 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 +100 -39
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/production.d.ts +0 -1
- package/dist/cli/production.js +36 -49
- 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-SIjTLD2R.js} +145 -46
- package/dist/commandkit-SIjTLD2R.js.map +1 -0
- package/dist/commandkit.d.ts +1 -33
- package/dist/commandkit.js +22 -37
- package/dist/{common-CCx-FJI4.js → common-CEordwf3.js} +1 -1
- package/dist/{common-CCx-FJI4.js.map → common-CEordwf3.js.map} +1 -1
- package/dist/{common-fIO6fqGZ.js → common-DSRs_mfw.js} +9 -12
- package/dist/{common-fIO6fqGZ.js.map → common-DSRs_mfw.js.map} +1 -1
- package/dist/{common-DHTTnX82.d.ts → common-DnwCYit8.d.ts} +3 -4
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/element.d.ts +1 -4
- 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 +1 -1
- package/dist/components/display/container.d.ts +1 -1
- package/dist/components/display/container.js +1 -2
- 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 +8 -9
- package/dist/components/display/label.d.ts +1 -1
- package/dist/components/display/label.js +1 -2
- package/dist/components/display/media-gallery.d.ts +1 -1
- package/dist/components/display/media-gallery.js +1 -2
- 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 +1 -2
- 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 +23 -36
- 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 +22 -37
- package/dist/components/interactive/button/ButtonKit.d.ts +1 -2
- package/dist/components/interactive/button/ButtonKit.js +22 -37
- package/dist/components/interactive/modal/Modal.d.ts +2 -7
- package/dist/components/interactive/modal/Modal.js +23 -37
- package/dist/components/interactive/modal/ModalKit.d.ts +1 -2
- package/dist/components/interactive/modal/ModalKit.js +22 -37
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +22 -37
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +22 -37
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +22 -37
- package/dist/components/interactive/select-menu/SelectMenu.d.ts +1 -9
- package/dist/components/interactive/select-menu/SelectMenu.js +22 -37
- package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/StringSelectMenuKit.js +22 -37
- package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +1 -3
- package/dist/components/interactive/select-menu/UserSelectMenuKit.js +22 -37
- 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 +22 -37
- package/dist/config/default.d.ts +1 -33
- package/dist/config/default.js +22 -37
- package/dist/config/loader.d.ts +1 -33
- package/dist/config/loader.js +22 -37
- package/dist/config/types.d.ts +1 -33
- package/dist/config/utils.d.ts +1 -33
- package/dist/constants-BFFK-hfP.js +27 -0
- package/dist/{constants-AH-9qJ89.js.map → constants-BFFK-hfP.js.map} +1 -1
- package/dist/{constants-DqnSDZ6l.d.ts → constants-CuYW0K10.d.ts} +14 -8
- package/dist/{constants-D0dawKxO.js → constants-Cw8VjCVz.js} +2 -3
- package/dist/{constants-D0dawKxO.js.map → constants-Cw8VjCVz.js.map} +1 -1
- package/dist/{constants-BMWH2YUr.js → constants-CxkFFZ7p.js} +16 -1
- package/dist/constants-CxkFFZ7p.js.map +1 -0
- package/dist/{constants-CCFSX2NG.d.ts → constants-EpKcj0dH.d.ts} +2 -2
- package/dist/{container-DC0eQigs.js → container-DCPljKVH.js} +3 -4
- package/dist/{container-DC0eQigs.js.map → container-DCPljKVH.js.map} +1 -1
- 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 +22 -37
- package/dist/context/environment.d.ts +1 -33
- package/dist/context/environment.js +22 -37
- package/dist/element-DibzzA5L.js.map +1 -1
- package/dist/{element-CvNhvLZ8.d.ts → element-wQo0heGj.d.ts} +4 -5
- package/dist/{env-8yY-6pbC.js → env-CmspDhHy.js} +7 -3
- package/dist/env-CmspDhHy.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-DAUOZYhC.js → file-Ca1kpEtE.js} +2 -3
- package/dist/{file-DAUOZYhC.js.map → file-Ca1kpEtE.js.map} +1 -1
- package/dist/{file-n2yl_-vl.d.ts → file-CrV4lSnl.d.ts} +2 -3
- package/dist/flags/FlagProvider.d.ts +1 -33
- package/dist/flags/feature-flags.d.ts +1 -33
- package/dist/flags/feature-flags.js +163 -41
- package/dist/flags/feature-flags.js.map +1 -0
- 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-Btx1FSZx.js} +2 -3
- package/dist/{helpers-D2_1jih6.js.map → helpers-Btx1FSZx.js.map} +1 -1
- package/dist/index.d.ts +41 -44
- package/dist/index.js +39 -45
- package/dist/index.js.map +1 -1
- 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/{label-D-uJWRZ0.js → label-B6vXvwLM.js} +4 -5
- package/dist/{label-D-uJWRZ0.js.map → label-B6vXvwLM.js.map} +1 -1
- package/dist/logger/DefaultLogger.d.ts +66 -3
- package/dist/logger/DefaultLogger.js +22 -37
- 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 +22 -37
- package/dist/logger/NoopLogger.d.ts +36 -37
- package/dist/{media-gallery-BzG70ued.d.ts → media-gallery-Ci3I4ElH.d.ts} +2 -3
- package/dist/{media-gallery-BLhwe5lO.js → media-gallery-u3gjX7yD.js} +3 -4
- package/dist/{media-gallery-BLhwe5lO.js.map → media-gallery-u3gjX7yD.js.map} +1 -1
- 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 +24 -37
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -33
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +22 -37
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -33
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +22 -37
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -33
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +22 -37
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -33
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +22 -37
- 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-Bc6rjeUS.js → poll-CFe8yvoJ.js} +12 -13
- package/dist/{poll-Bc6rjeUS.js.map → poll-CFe8yvoJ.js.map} +1 -1
- package/dist/{poll-HnaJcB0o.d.ts → poll-Ddtapd6n.d.ts} +8 -9
- package/dist/{resolve-file-url-CJoD0FAn.js → resolve-file-url-CdHqwWs3.js} +2 -2
- package/dist/{resolve-file-url-CJoD0FAn.js.map → resolve-file-url-CdHqwWs3.js.map} +1 -1
- package/dist/{section-BMcHN97i.js → section-BC8LF-B2.js} +3 -4
- package/dist/{section-BMcHN97i.js.map → section-BC8LF-B2.js.map} +1 -1
- package/dist/{section-BOaJKXiy.d.ts → section-DkUKULnB.d.ts} +2 -3
- package/dist/{separator-C___2K-f.js → separator-BUTiW7uz.js} +2 -3
- package/dist/{separator-C___2K-f.js.map → separator-BUTiW7uz.js.map} +1 -1
- package/dist/{separator-Cb7-6T6N.d.ts → separator-CbXsIFCa.d.ts} +2 -3
- package/dist/{signals-Cnqe9dFV.js → signals-B8z1wJ6W.js} +2 -2
- package/dist/{signals-Cnqe9dFV.js.map → signals-B8z1wJ6W.js.map} +1 -1
- package/dist/{signals-DBS60vTo.d.ts → signals-BbTgTc0i.d.ts} +2 -2
- package/dist/{store-ZwL2gN6a.js → store-D8r_hryO.js} +2 -3
- package/dist/{store-ZwL2gN6a.js.map → store-D8r_hryO.js.map} +1 -1
- package/dist/{text-display-B_hpz50P.d.ts → text-display-D7j39VC-.d.ts} +2 -3
- package/dist/{text-display-BtQR88kY.js → text-display-DANahMN3.js} +2 -3
- package/dist/{text-display-BtQR88kY.js.map → text-display-DANahMN3.js.map} +1 -1
- package/dist/{type-checker-CEFHoQoV.js → type-checker-cVd3Hpnh.js} +4 -6
- package/dist/{type-checker-CEFHoQoV.js.map → type-checker-cVd3Hpnh.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-CsTNfvv2.js} +3 -6
- package/dist/{types-package-D11rQXLs.js.map → types-package-CsTNfvv2.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 +22 -37
- 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 +25 -38
- package/dist/utils-Br3eenD1.js.map +1 -1
- package/dist/version.d.ts +8 -2
- package/dist/version.js +12 -2
- package/dist/version.js.map +1 -0
- package/dist/warning-CszH8HeS.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-CrjK9yWX.js +0 -0
- 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-0Iw8ZeM6.js +0 -0
- 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/dotprops-DvJUE8fw.js +0 -36
- package/dist/dotprops-DvJUE8fw.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/init-CBb0StSB.js +0 -91
- package/dist/init-CBb0StSB.js.map +0 -1
- package/dist/init-DSYckXwx.d.ts +0 -13
- package/dist/resolve-file-url-DFtR8jRR.d.ts +0 -11
- 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/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-DC4j2ZwU.js +0 -18
- package/dist/version-DC4j2ZwU.js.map +0 -1
- package/dist/version-DggMfP_1.d.ts +0 -8
- /package/dist/{ILogger-B0q7p7L1.js → common-C2jAjX4U.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
|
@@ -1,2 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/utils/utilities.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns the current working directory of the CommandKit application.
|
|
4
|
+
* This is typically the directory where the source code is located.
|
|
5
|
+
*/
|
|
6
|
+
declare function getCurrentDirectory(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the possible source directories for the CommandKit application.
|
|
9
|
+
* This includes the `src`, `.commandkit`, and the distribution directory.
|
|
10
|
+
* @returns An array of possible source directories.
|
|
11
|
+
*/
|
|
12
|
+
declare function getSourceDirectories(): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Returns the path to the app directory.
|
|
15
|
+
* @returns The path to the app directory or `null` if not found.
|
|
16
|
+
*/
|
|
17
|
+
declare function findAppDirectory(): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Debounces a function.
|
|
20
|
+
* @param fn The function to debounce.
|
|
21
|
+
* @param ms The debounce time in milliseconds.
|
|
22
|
+
* @returns The debounced function.
|
|
23
|
+
* @example
|
|
24
|
+
* const debouncedFn = debounce(() => {
|
|
25
|
+
* console.log('Debounced function called');
|
|
26
|
+
* }, 300);
|
|
27
|
+
*
|
|
28
|
+
* debouncedFn(); // Will only execute after 300ms of inactivity
|
|
29
|
+
* debouncedFn(); // Will reset the timer
|
|
30
|
+
* debouncedFn(); // Will reset the timer again
|
|
31
|
+
*/
|
|
32
|
+
declare function debounce<R, F extends (...args: any[]) => R>(fn: F, ms: number): F;
|
|
33
|
+
/**
|
|
34
|
+
* Defers the execution of a function.
|
|
35
|
+
* @param fn The function to defer.
|
|
36
|
+
* @param timeout The time in milliseconds to wait before executing the function. Defaults to 0.
|
|
37
|
+
* @example
|
|
38
|
+
* defer(() => {
|
|
39
|
+
* console.log('This will run after a delay');
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* console.log('This will run immediately');
|
|
43
|
+
*/
|
|
44
|
+
declare function defer<T>(fn: () => T, timeout?: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* Serializes a value to JSON.
|
|
47
|
+
* @param value The value to serialize.
|
|
48
|
+
* @param defaultValue The default value to return if the value is not serializable.
|
|
49
|
+
* @returns The serialized value.
|
|
50
|
+
*/
|
|
51
|
+
declare function JsonSerialize<R = any>(value: any, defaultValue?: R): R;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a function from the given function that runs only in development mode.
|
|
54
|
+
* @param fn The function to run in development mode.
|
|
55
|
+
* @returns The function that runs only in development mode.
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const devOnlyFn = devOnly(() => {
|
|
59
|
+
* console.log('This function runs only in development mode');
|
|
60
|
+
* });
|
|
61
|
+
* devOnlyFn(); // This will log the message only in development mode
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare function devOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a function from the given function that runs only in build mode.
|
|
67
|
+
* @param fn The function to run in build mode.
|
|
68
|
+
* @returns The function that runs only in build mode.
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const buildOnlyFn = buildOnly(() => {
|
|
72
|
+
* console.log('This function runs only in build mode');
|
|
73
|
+
* });
|
|
74
|
+
* buildOnlyFn(); // This will log the message only in build mode
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
declare function buildOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a function from the given function that runs only outside of build mode.
|
|
80
|
+
* @param fn The function to run outside of build mode.
|
|
81
|
+
* @returns The function that runs only outside of build mode.
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const noBuildOnlyFn = noBuildOnly(() => {
|
|
85
|
+
* console.log('This function runs only outside of build mode');
|
|
86
|
+
* });
|
|
87
|
+
* noBuildOnlyFn(); // This will log the message only outside of build mode
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare function noBuildOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
91
|
+
/**
|
|
92
|
+
* Represents a simple proxy object that mirrors a target object.
|
|
93
|
+
*/
|
|
94
|
+
interface SimpleProxy<T extends object> {
|
|
95
|
+
/**
|
|
96
|
+
* The proxied object that mirrors the target.
|
|
97
|
+
*/
|
|
98
|
+
proxy: T;
|
|
99
|
+
/**
|
|
100
|
+
* Sets a new target object for the proxy.
|
|
101
|
+
* @param newTarget The new target object to set.
|
|
102
|
+
*/
|
|
103
|
+
setTarget(newTarget: T): void;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Creates a simple proxy object that mirrors the target object.
|
|
107
|
+
* @param target The target object to proxy.
|
|
108
|
+
* @returns The proxied object.
|
|
109
|
+
*/
|
|
110
|
+
declare function createProxy<T extends object>(target: T): SimpleProxy<T>;
|
|
111
|
+
//#endregion
|
|
112
|
+
export { JsonSerialize, SimpleProxy, buildOnly, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, noBuildOnly };
|
|
113
|
+
//# sourceMappingURL=utilities.d.ts.map
|
package/dist/utils/utilities.js
CHANGED
|
@@ -1,48 +1,35 @@
|
|
|
1
|
-
require('../colors-
|
|
2
|
-
require('../ActionRow-
|
|
3
|
-
require('../
|
|
4
|
-
|
|
5
|
-
require('../
|
|
6
|
-
require('../
|
|
7
|
-
require('../
|
|
8
|
-
require('../
|
|
9
|
-
require('../
|
|
10
|
-
require('../
|
|
11
|
-
require('../
|
|
12
|
-
require('../separator-C___2K-f.js');
|
|
13
|
-
require('../text-display-BtQR88kY.js');
|
|
14
|
-
require('../label-D-uJWRZ0.js');
|
|
15
|
-
require('../poll-Bc6rjeUS.js');
|
|
1
|
+
require('../colors-Csc0X4QJ.js');
|
|
2
|
+
require('../ActionRow-CSN_UKmM.js');
|
|
3
|
+
const require_commandkit = require('../commandkit-SIjTLD2R.js');
|
|
4
|
+
require('../container-DCPljKVH.js');
|
|
5
|
+
require('../file-Ca1kpEtE.js');
|
|
6
|
+
require('../media-gallery-u3gjX7yD.js');
|
|
7
|
+
require('../section-BC8LF-B2.js');
|
|
8
|
+
require('../separator-BUTiW7uz.js');
|
|
9
|
+
require('../text-display-DANahMN3.js');
|
|
10
|
+
require('../label-B6vXvwLM.js');
|
|
11
|
+
require('../poll-CFe8yvoJ.js');
|
|
16
12
|
require('../display-WDb9wMCv.js');
|
|
17
|
-
require('../
|
|
18
|
-
require('../types-
|
|
19
|
-
require('../
|
|
20
|
-
require('../
|
|
21
|
-
require('../
|
|
22
|
-
require('../
|
|
23
|
-
require('../
|
|
24
|
-
require('../
|
|
25
|
-
require('../
|
|
26
|
-
require('../runtime-Skt5NiOc.js');
|
|
27
|
-
require('../utils-Br3eenD1.js');
|
|
28
|
-
require('../types-package-D11rQXLs.js');
|
|
29
|
-
require('../constants-D0dawKxO.js');
|
|
30
|
-
require('../EventWorkerContext-D_9q1Bm2.js');
|
|
31
|
-
require('../signals-Cnqe9dFV.js');
|
|
32
|
-
require('../helpers-D2_1jih6.js');
|
|
33
|
-
require('../MessageCommandParser-CKh-tM97.js');
|
|
34
|
-
require('../CommandsRouter-CWMipIis.js');
|
|
35
|
-
require('../EventsRouter-C04XqRKf.js');
|
|
13
|
+
require('../constants-CxkFFZ7p.js');
|
|
14
|
+
require('../types-package-CsTNfvv2.js');
|
|
15
|
+
require('../constants-Cw8VjCVz.js');
|
|
16
|
+
require('../EventWorkerContext-Dfhgv329.js');
|
|
17
|
+
require('../signals-B8z1wJ6W.js');
|
|
18
|
+
require('../helpers-Btx1FSZx.js');
|
|
19
|
+
require('../MessageCommandParser-Bs9fimmd.js');
|
|
20
|
+
require('../CommandsRouter-C_HLsrGX.js');
|
|
21
|
+
require('../EventsRouter-DZYIha6m.js');
|
|
36
22
|
require('../router-BvamdzoF.js');
|
|
37
|
-
require('../common-
|
|
38
|
-
require('../
|
|
39
|
-
require('../store-ZwL2gN6a.js');
|
|
23
|
+
require('../common-DSRs_mfw.js');
|
|
24
|
+
require('../store-D8r_hryO.js');
|
|
40
25
|
|
|
41
26
|
exports.JsonSerialize = require_commandkit.JsonSerialize;
|
|
27
|
+
exports.buildOnly = require_commandkit.buildOnly;
|
|
42
28
|
exports.createProxy = require_commandkit.createProxy;
|
|
43
29
|
exports.debounce = require_commandkit.debounce;
|
|
44
30
|
exports.defer = require_commandkit.defer;
|
|
45
31
|
exports.devOnly = require_commandkit.devOnly;
|
|
46
32
|
exports.findAppDirectory = require_commandkit.findAppDirectory;
|
|
47
33
|
exports.getCurrentDirectory = require_commandkit.getCurrentDirectory;
|
|
48
|
-
exports.getSourceDirectories = require_commandkit.getSourceDirectories;
|
|
34
|
+
exports.getSourceDirectories = require_commandkit.getSourceDirectories;
|
|
35
|
+
exports.noBuildOnly = require_commandkit.noBuildOnly;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-Br3eenD1.js","names":[],"sources":["../src/config/utils.ts"],"sourcesContent":["import { CommandKitConfig } from './types';\n\n/**\n * @private\n */\nexport type DeepRequired<T, OptionalKeys extends keyof T = never> = {\n [P in keyof T]-?: P extends OptionalKeys ? Partial<T[P]> : DeepRequired<T[P]>;\n};\n\n/**\n * @private\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: DeepPartial<T[P]>;\n};\n\n/**\n * @private\n * @example\n * ```ts\n * const target = { a: 1, b: { c: 2 } };\n * const source = { b: { d: 3 } };\n * const result = mergeDeep(target, source);\n * // result = { a: 1, b: { c: 2, d: 3 } }\n * ```\n */\nexport const mergeDeep = <T extends Record<string, any>>(\n target: T,\n source?: T,\n tracker = new WeakMap<object, boolean>(),\n): T => {\n if (!source) return target;\n const isObject = (obj: unknown) =>\n obj && typeof obj === 'object' && !Array.isArray(obj);\n\n // Prevent infinite recursion\n if (tracker.has(target)) {\n return target;\n }\n\n // Mark the target as visited\n tracker.set(target, true);\n\n const output: T = { ...target };\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key) => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, { [key]: source[key] });\n } else {\n output[key as keyof T] = mergeDeep(target[key], source[key], tracker);\n }\n } else {\n Object.assign(output, { [key]: source[key] });\n }\n });\n }\n\n return output as T;\n};\n\nexport type ResolvedCommandKitConfig = DeepRequired<\n CommandKitConfig,\n 'compilerOptions'\n>;\n"],"mappings":";;;;;;;;;;;;AA0BA,MAAa,aACb,QACA,QACA,0BAAU,
|
|
1
|
+
{"version":3,"file":"utils-Br3eenD1.js","names":[],"sources":["../src/config/utils.ts"],"sourcesContent":["import { CommandKitConfig } from './types';\n\n/**\n * @private\n */\nexport type DeepRequired<T, OptionalKeys extends keyof T = never> = {\n [P in keyof T]-?: P extends OptionalKeys ? Partial<T[P]> : DeepRequired<T[P]>;\n};\n\n/**\n * @private\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: DeepPartial<T[P]>;\n};\n\n/**\n * @private\n * @example\n * ```ts\n * const target = { a: 1, b: { c: 2 } };\n * const source = { b: { d: 3 } };\n * const result = mergeDeep(target, source);\n * // result = { a: 1, b: { c: 2, d: 3 } }\n * ```\n */\nexport const mergeDeep = <T extends Record<string, any>>(\n target: T,\n source?: T,\n tracker = new WeakMap<object, boolean>(),\n): T => {\n if (!source) return target;\n const isObject = (obj: unknown) =>\n obj && typeof obj === 'object' && !Array.isArray(obj);\n\n // Prevent infinite recursion\n if (tracker.has(target)) {\n return target;\n }\n\n // Mark the target as visited\n tracker.set(target, true);\n\n const output: T = { ...target };\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach((key) => {\n if (isObject(source[key])) {\n if (!(key in target)) {\n Object.assign(output, { [key]: source[key] });\n } else {\n output[key as keyof T] = mergeDeep(target[key], source[key], tracker);\n }\n } else {\n Object.assign(output, { [key]: source[key] });\n }\n });\n }\n\n return output as T;\n};\n\nexport type ResolvedCommandKitConfig = DeepRequired<\n CommandKitConfig,\n 'compilerOptions'\n>;\n"],"mappings":";;;;;;;;;;;;AA0BA,MAAa,aACb,QACA,QACA,0BAAU,IAAE,SAA4B,KACjC;AACL,KAAI,CAAC,OAAQ,QAAO;CACpB,MAAM,YAAY,QAClB,OAAO,OAAE,QAAa,YAAY,CAAC,MAAE,QAAM,IAAQ;AAGnD,KAAI,QAAQ,IAAI,OAAO,CACrB,QAAO;AAIT,SAAQ,IAAI,QAAQ,KAAK;CAEzB,MAAM,SAAY,EAAE,GAAG,QAAQ;AAC/B,KAAI,SAAS,OAAO,IAAI,SAAS,OAAO,CACtC,QAAO,KAAK,OAAO,CAAC,SAAS,QAAQ;AACnC,MAAI,SAAS,OAAO,KAAK,CACvB,KAAI,EAAE,OAAO,QACX,QAAO,OAAO,QAAQ,GAAG,MAAM,OAAO,MAAM,CAAC;MAE7C,QAAO,OAAkB,UAAU,OAAO,MAAM,OAAO,MAAM,QAAQ;MAGvE,QAAO,OAAO,QAAQ,GAAG,MAAM,OAAO,MAAM,CAAC;GAE/C;AAGJ,QAAO"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
const require_version = require('./version-DC4j2ZwU.js');
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
//#region src/version.ts
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The current version of CommandKit.
|
|
8
|
+
*/
|
|
9
|
+
const version = "1.2.0-rc.13";
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.version = version;
|
|
13
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../src/version.ts"],"sourcesContent":["/**\n * @private\n */\nfunction $version(): string {\n 'use macro';\n return require('../package.json').version;\n}\n\n/**\n * The current version of CommandKit.\n */\nexport const version: string = $version();\n"],"mappings":";;;;;;;;AAWA,MAAa,UAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warning-CszH8HeS.js","names":[],"sources":["../src/utils/warning.ts"],"sourcesContent":["const WARNED_KEYS = new Set<string>();\nconst DEPRECATED_KEYS = new Set<string>();\n\n/**\n * Emit a warning message to the console as a CommandKitWarning.\n * @param message - The warning message to emit.\n * @param code - The warning code (default is 'CommandKitWarning').\n */\nexport function emitWarning(message: string, code = 'CommandKitWarning') {\n process.emitWarning(message, { code });\n}\n\n/**\n * Emit a warning for unstable features in CommandKit.\n * @param name - The name of the unstable feature.\n * @example warnUnstable('MyUnstableFeature');\n */\nexport function warnUnstable(name: string) {\n if (WARNED_KEYS.has(name)) return;\n\n WARNED_KEYS.add(name);\n\n emitWarning(\n `${name} is unstable and may change in future versions.`,\n 'CommandKitUnstableWarning',\n );\n}\nexport function warnDeprecated({\n what,\n message,\n where,\n}: {\n what: string;\n where?: string;\n message?: string;\n}) {\n const name = `${what}:${where}`;\n\n if (DEPRECATED_KEYS.has(name)) return;\n\n DEPRECATED_KEYS.add(name);\n\n emitWarning(\n [\n `${what} is deprecated`,\n where ? `in ${where}` : '',\n message || 'and may be removed in future versions.',\n ]\n .filter(Boolean)\n .join(' '),\n 'CommandKitDeprecatedWarning',\n );\n}\n"],"mappings":";;AAAA,MAAM,8BAAc,IAAI,KAAa;AACrC,MAAM,kCAAkB,IAAI,KAAa;;;;;;AAOzC,SAAgB,YAAY,SAAiB,OAAO,qBAAqB;AACvE,SAAQ,YAAY,SAAS,EAAE,MAAM,CAAC;;;;;;;AAQxC,SAAgB,aAAa,MAAc;AACzC,KAAI,YAAY,IAAI,KAAK,CAAE;AAE3B,aAAY,IAAI,KAAK;AAErB,aACE,GAAG,KAAK,kDACR,4BACD;;AAEH,SAAgB,eAAe,EAC7B,MACA,SACA,SAKC;CACD,MAAM,OAAO,GAAG,KAAK,GAAG;AAExB,KAAI,gBAAgB,IAAI,KAAK,CAAE;AAE/B,iBAAgB,IAAI,KAAK;AAEzB,aACE;EACA,GAAG,
|
|
1
|
+
{"version":3,"file":"warning-CszH8HeS.js","names":[],"sources":["../src/utils/warning.ts"],"sourcesContent":["const WARNED_KEYS = new Set<string>();\nconst DEPRECATED_KEYS = new Set<string>();\n\n/**\n * Emit a warning message to the console as a CommandKitWarning.\n * @param message - The warning message to emit.\n * @param code - The warning code (default is 'CommandKitWarning').\n */\nexport function emitWarning(message: string, code = 'CommandKitWarning') {\n process.emitWarning(message, { code });\n}\n\n/**\n * Emit a warning for unstable features in CommandKit.\n * @param name - The name of the unstable feature.\n * @example warnUnstable('MyUnstableFeature');\n */\nexport function warnUnstable(name: string) {\n if (WARNED_KEYS.has(name)) return;\n\n WARNED_KEYS.add(name);\n\n emitWarning(\n `${name} is unstable and may change in future versions.`,\n 'CommandKitUnstableWarning',\n );\n}\nexport function warnDeprecated({\n what,\n message,\n where,\n}: {\n what: string;\n where?: string;\n message?: string;\n}) {\n const name = `${what}:${where}`;\n\n if (DEPRECATED_KEYS.has(name)) return;\n\n DEPRECATED_KEYS.add(name);\n\n emitWarning(\n [\n `${what} is deprecated`,\n where ? `in ${where}` : '',\n message || 'and may be removed in future versions.',\n ]\n .filter(Boolean)\n .join(' '),\n 'CommandKitDeprecatedWarning',\n );\n}\n"],"mappings":";;AAAA,MAAM,8BAAc,IAAI,KAAa;AACrC,MAAM,kCAAkB,IAAI,KAAa;;;;;;AAOzC,SAAgB,YAAY,SAAiB,OAAO,qBAAqB;AACvE,SAAQ,YAAY,SAAS,EAAE,MAAM,CAAC;;;;;;;AAQxC,SAAgB,aAAa,MAAc;AACzC,KAAI,YAAY,IAAI,KAAK,CAAE;AAE3B,aAAY,IAAI,KAAK;AAErB,aACE,GAAG,KAAK,kDACR,4BACD;;AAEH,SAAgB,eAAe,EAC7B,MACA,SACA,SAKC;CACD,MAAM,OAAO,GAAG,KAAK,GAAG;AAExB,KAAI,gBAAgB,IAAI,KAAK,CAAE;AAE/B,iBAAgB,IAAI,KAAK;AAEzB,aACE;EACA,GAAG,KAAE;EACL,QAAQ,MAAM,UAAU;EACxB,WAAW;EAAyC,CAEpD,OAAG,QAAO,CACV,KAAG,IAAM,EACT,8BACD"}
|
package/hooks.cjs
CHANGED
|
@@ -9,11 +9,18 @@ const {
|
|
|
9
9
|
} = require('./dist/app/events/EventWorkerContext.js');
|
|
10
10
|
|
|
11
11
|
function useAnyEnvironment() {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
try {
|
|
13
|
+
const commandCtx = getContext();
|
|
14
|
+
if (commandCtx) return commandCtx;
|
|
15
|
+
} catch {}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const eventWorkerCtx = getEventWorkerContext();
|
|
19
|
+
if (eventWorkerCtx) return eventWorkerCtx;
|
|
20
|
+
} catch {}
|
|
14
21
|
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
22
|
+
const maybeCommandKit = getCommandKit();
|
|
23
|
+
if (maybeCommandKit) return { commandkit: maybeCommandKit };
|
|
17
24
|
|
|
18
25
|
throw new Error(
|
|
19
26
|
'No environment found. This hook must be used within a CommandKit environment.',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commandkit",
|
|
3
3
|
"description": "Beginner friendly command & event handler for Discord.js",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.13",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -46,7 +46,9 @@
|
|
|
46
46
|
"./mutex.cjs",
|
|
47
47
|
"./mutex.d.ts",
|
|
48
48
|
"./kv.cjs",
|
|
49
|
-
"./kv.d.ts"
|
|
49
|
+
"./kv.d.ts",
|
|
50
|
+
"./cli.cjs",
|
|
51
|
+
"./cli.d.ts"
|
|
50
52
|
],
|
|
51
53
|
"exports": {
|
|
52
54
|
".": {
|
|
@@ -143,11 +145,16 @@
|
|
|
143
145
|
"require": "./semaphore.cjs",
|
|
144
146
|
"import": "./semaphore.cjs",
|
|
145
147
|
"types": "./semaphore.d.ts"
|
|
148
|
+
},
|
|
149
|
+
"./cli": {
|
|
150
|
+
"require": "./cli.cjs",
|
|
151
|
+
"import": "./cli.cjs",
|
|
152
|
+
"types": "./cli.d.ts"
|
|
146
153
|
}
|
|
147
154
|
},
|
|
148
155
|
"repository": {
|
|
149
156
|
"type": "git",
|
|
150
|
-
"url": "https://github.com/
|
|
157
|
+
"url": "https://github.com/neplextech/commandkit",
|
|
151
158
|
"directory": "packages/commandkit"
|
|
152
159
|
},
|
|
153
160
|
"homepage": "https://commandkit.dev",
|
|
@@ -169,18 +176,18 @@
|
|
|
169
176
|
"picocolors": "^1.1.1",
|
|
170
177
|
"rfdc": "^1.3.1",
|
|
171
178
|
"rimraf": "^6.0.0",
|
|
172
|
-
"tsdown": "^0.
|
|
179
|
+
"tsdown": "^0.20.0-beta.3",
|
|
173
180
|
"use-macro": "^1.1.0"
|
|
174
181
|
},
|
|
175
182
|
"devDependencies": {
|
|
176
183
|
"@types/ms": "^2.0.0",
|
|
177
184
|
"@types/node": "^22.10.2",
|
|
178
185
|
"@types/yargs": "^17.0.32",
|
|
179
|
-
"discord.js": "^14.
|
|
186
|
+
"discord.js": "^14.24.0",
|
|
180
187
|
"tsx": "^4.19.2",
|
|
181
|
-
"typescript": "^5.
|
|
188
|
+
"typescript": "^5.9.3",
|
|
182
189
|
"vitest": "^3.0.5",
|
|
183
|
-
"tsconfig": "0.0.0-rc.
|
|
190
|
+
"tsconfig": "0.0.0-rc.13"
|
|
184
191
|
},
|
|
185
192
|
"engines": {
|
|
186
193
|
"node": ">=24"
|
|
@@ -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 { ChannelSelectMenuBuilder, ChannelSelectMenuInteraction } from "discord.js";
|
|
4
|
-
|
|
5
|
-
//#region src/components/interactive/select-menu/ChannelSelectMenuKit.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Type for the handler function that is called when the channel select menu is submitted.
|
|
9
|
-
*/
|
|
10
|
-
type OnChannelSelectMenuKitSubmit = OnSelectMenuKitSubmit<ChannelSelectMenuInteraction, ChannelSelectMenuKit>;
|
|
11
|
-
/**
|
|
12
|
-
* Type for the predicate function that filters channel select menu interactions.
|
|
13
|
-
* It receives a ChannelSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
|
|
14
|
-
*/
|
|
15
|
-
type ChannelSelectMenuKitPredicate = SelectMenuKitPredicate<ChannelSelectMenuInteraction>;
|
|
16
|
-
/**
|
|
17
|
-
* A builder for creating channel select menus with additional features like interaction collectors and event handling.
|
|
18
|
-
* This class extends the ChannelSelectMenuBuilder from discord.js and adds methods for handling interactions.
|
|
19
|
-
* It allows you to set a handler for when the channel select menu is submitted, filter interactions, and handle the end of the interaction collector.
|
|
20
|
-
*/
|
|
21
|
-
declare class ChannelSelectMenuKit extends ChannelSelectMenuBuilder {
|
|
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 ChannelSelectMenuKit()
|
|
31
|
-
* .setTitle('My Modal')
|
|
32
|
-
* .setCustomId('my-modal')
|
|
33
|
-
* .filter((interaction) => interaction.Channel.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<ChannelSelectMenuInteraction, ChannelSelectMenuKit>, 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<ChannelSelectMenuInteraction>): this;
|
|
59
|
-
private get customId();
|
|
60
|
-
/**
|
|
61
|
-
* Cleans up the interaction collector and removes the handler.
|
|
62
|
-
*/
|
|
63
|
-
dispose(): this;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { ChannelSelectMenuKit, ChannelSelectMenuKitPredicate, OnChannelSelectMenuKitSubmit };
|
|
67
|
-
//# sourceMappingURL=ChannelSelectMenuKit-CsYgIyKe.d.ts.map
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ILogger } from "./ILogger-BQ2ew4zR.js";
|
|
2
|
-
|
|
3
|
-
//#region src/logger/DefaultLogger.d.ts
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Default logger implementation that logs messages to the console.
|
|
7
|
-
* It formats the log messages with timestamps, log levels, and context information.
|
|
8
|
-
*/
|
|
9
|
-
declare class DefaultLogger implements ILogger {
|
|
10
|
-
stdout: NodeJS.WriteStream & {
|
|
11
|
-
fd: 1;
|
|
12
|
-
};
|
|
13
|
-
stderr: NodeJS.WriteStream & {
|
|
14
|
-
fd: 2;
|
|
15
|
-
};
|
|
16
|
-
private logger;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new instance of DefaultLogger.
|
|
19
|
-
* @param stdout The output stream for standard messages (default: process.stdout).
|
|
20
|
-
* @param stderr The output stream for error messages (default: process.stderr).
|
|
21
|
-
*/
|
|
22
|
-
constructor(stdout?: NodeJS.WriteStream & {
|
|
23
|
-
fd: 1;
|
|
24
|
-
}, stderr?: NodeJS.WriteStream & {
|
|
25
|
-
fd: 2;
|
|
26
|
-
});
|
|
27
|
-
private _formatTime;
|
|
28
|
-
private _getContext;
|
|
29
|
-
private _getLevelLabel;
|
|
30
|
-
private _getPrefix;
|
|
31
|
-
private _log;
|
|
32
|
-
private _logTemplate;
|
|
33
|
-
/**
|
|
34
|
-
* Logs a debug message.
|
|
35
|
-
* @param message The message to log.
|
|
36
|
-
*/
|
|
37
|
-
debug(message: any): void;
|
|
38
|
-
debug(strings: TemplateStringsArray, ...values: any[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Logs an error message.
|
|
41
|
-
* @param message The error message to log.
|
|
42
|
-
*/
|
|
43
|
-
error(message: any): void;
|
|
44
|
-
error(strings: TemplateStringsArray, ...values: any[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* Logs a default message.
|
|
47
|
-
* @param message The message to log.
|
|
48
|
-
*/
|
|
49
|
-
log(message: any): void;
|
|
50
|
-
log(strings: TemplateStringsArray, ...values: any[]): void;
|
|
51
|
-
/**
|
|
52
|
-
* Logs an info message.
|
|
53
|
-
* @param message The informational message to log.
|
|
54
|
-
*/
|
|
55
|
-
info(message: any): void;
|
|
56
|
-
info(strings: TemplateStringsArray, ...values: any[]): void;
|
|
57
|
-
/**
|
|
58
|
-
* Logs a warning message.
|
|
59
|
-
* @param message The warning message to log.
|
|
60
|
-
*/
|
|
61
|
-
warn(message: any): void;
|
|
62
|
-
warn(strings: TemplateStringsArray, ...values: any[]): void;
|
|
63
|
-
private _isTemplateStringsArray;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
export { DefaultLogger };
|
|
67
|
-
//# sourceMappingURL=DefaultLogger-CHMVsizQ.d.ts.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CommandKit } from "./analytics-engine-NOInIjv8.js";
|
|
2
|
-
import { ParsedEvent } from "./EventsRouter-4pT6vj-U.js";
|
|
3
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
-
|
|
5
|
-
//#region src/app/events/EventWorkerContext.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Context object containing information about the currently executing event.
|
|
9
|
-
*/
|
|
10
|
-
interface EventWorkerContext {
|
|
11
|
-
event: string;
|
|
12
|
-
namespace: string | null;
|
|
13
|
-
data: ParsedEvent;
|
|
14
|
-
commandkit: CommandKit;
|
|
15
|
-
arguments: any[];
|
|
16
|
-
variables: Map<string, any>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Async local storage for event worker context.
|
|
20
|
-
*/
|
|
21
|
-
declare const eventWorkerContext: AsyncLocalStorage<EventWorkerContext>;
|
|
22
|
-
/**
|
|
23
|
-
* Runs a callback within an event worker context.
|
|
24
|
-
* @param context - The event worker context
|
|
25
|
-
* @param callback - The callback to execute
|
|
26
|
-
* @returns The result of the callback
|
|
27
|
-
*/
|
|
28
|
-
declare function runInEventWorkerContext<T>(context: EventWorkerContext, callback: () => T): T;
|
|
29
|
-
/**
|
|
30
|
-
* Gets the current event worker context.
|
|
31
|
-
* @returns The current event worker context
|
|
32
|
-
* @throws Error if no context is found
|
|
33
|
-
*/
|
|
34
|
-
declare function getEventWorkerContext(): EventWorkerContext;
|
|
35
|
-
/**
|
|
36
|
-
* Type guard to check if an object is an event worker context.
|
|
37
|
-
* @param worker - The object to check
|
|
38
|
-
* @returns True if the object is an event worker context
|
|
39
|
-
*/
|
|
40
|
-
declare function isEventWorkerContext(worker: any): worker is EventWorkerContext;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
43
|
-
//# sourceMappingURL=EventWorkerContext-CLhZRHhH.d.ts.map
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
//#region src/app/router/EventsRouter.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Configuration options for the EventsRouter
|
|
4
|
-
* @interface EventsRouterOptions
|
|
5
|
-
*/
|
|
6
|
-
interface EventsRouterOptions {
|
|
7
|
-
/** Root directory path where event handlers are located */
|
|
8
|
-
entrypoints: string[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Represents a parsed event with its handlers
|
|
12
|
-
* @interface ParsedEvent
|
|
13
|
-
*/
|
|
14
|
-
interface ParsedEvent {
|
|
15
|
-
/** Name of the event derived from directory name */
|
|
16
|
-
event: string;
|
|
17
|
-
/** Absolute path to the event directory */
|
|
18
|
-
path: string;
|
|
19
|
-
/** Array of file paths to event listener handlers */
|
|
20
|
-
listeners: string[];
|
|
21
|
-
/** Namespace of the event */
|
|
22
|
-
namespace: string | null;
|
|
23
|
-
}
|
|
24
|
-
/** Collection of event names to their parsed metadata */
|
|
25
|
-
type EventsTree = Record<string, ParsedEvent>;
|
|
26
|
-
/**
|
|
27
|
-
* Router for discovering and managing event handler files in a directory structure.
|
|
28
|
-
* Events are represented by directories, and handlers are files within those directories.
|
|
29
|
-
*/
|
|
30
|
-
declare class EventsRouter {
|
|
31
|
-
private options;
|
|
32
|
-
/** Internal storage of parsed events */
|
|
33
|
-
private events;
|
|
34
|
-
/**
|
|
35
|
-
* Creates a new EventsRouter instance
|
|
36
|
-
* @param options - Configuration options for the router
|
|
37
|
-
* @throws Error if entrypoint is not provided
|
|
38
|
-
*/
|
|
39
|
-
constructor(options: EventsRouterOptions);
|
|
40
|
-
/**
|
|
41
|
-
* Adds new entrypoints to the router
|
|
42
|
-
* @param entrypoints - Array of new entrypoint paths
|
|
43
|
-
*/
|
|
44
|
-
addEntrypoints(entrypoints: string[]): void;
|
|
45
|
-
/**
|
|
46
|
-
* Find a parsed event by its name
|
|
47
|
-
* @param event - Name of the event to find
|
|
48
|
-
* @returns Parsed event metadata or null if not found
|
|
49
|
-
*/
|
|
50
|
-
match(event: string): ParsedEvent | null;
|
|
51
|
-
/**
|
|
52
|
-
* Get the entrypoint directory path
|
|
53
|
-
* @returns Entrypoint directory path
|
|
54
|
-
*/
|
|
55
|
-
get entrypoints(): string[];
|
|
56
|
-
/**
|
|
57
|
-
* Checks if the entrypoint path is valid
|
|
58
|
-
*/
|
|
59
|
-
isValidPath(): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Clear all parsed events
|
|
62
|
-
*/
|
|
63
|
-
clear(): void;
|
|
64
|
-
/**
|
|
65
|
-
* Reload and re-scan the entrypoint directory for events
|
|
66
|
-
* @returns Promise resolving to the updated events tree
|
|
67
|
-
*/
|
|
68
|
-
reload(): Promise<EventsTree>;
|
|
69
|
-
/**
|
|
70
|
-
* Scan the entrypoint directory for events and their handlers
|
|
71
|
-
* @returns Promise resolving to the events tree
|
|
72
|
-
*/
|
|
73
|
-
scan(): Promise<EventsTree>;
|
|
74
|
-
/**
|
|
75
|
-
* Convert the internal events Collection to a plain object
|
|
76
|
-
* @returns Events tree as a plain object
|
|
77
|
-
*/
|
|
78
|
-
toJSON(): EventsTree;
|
|
79
|
-
/**
|
|
80
|
-
* Recursively scan a directory for event handlers
|
|
81
|
-
* @param event - Name of the event
|
|
82
|
-
* @param path - Path to the event directory
|
|
83
|
-
* @param listeners - Array to collect listener file paths
|
|
84
|
-
* @returns Promise resolving to the parsed event metadata
|
|
85
|
-
*/
|
|
86
|
-
private scanEvent;
|
|
87
|
-
}
|
|
88
|
-
//#endregion
|
|
89
|
-
export { EventsRouter, EventsRouterOptions, EventsTree, ParsedEvent };
|
|
90
|
-
//# sourceMappingURL=EventsRouter-4pT6vj-U.d.ts.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//#region src/logger/ILogger.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* ILogger interface for logging functionality.
|
|
4
|
-
*/
|
|
5
|
-
interface ILogger {
|
|
6
|
-
/**
|
|
7
|
-
* Logs a message with the default log level.
|
|
8
|
-
* @param message The message to log.
|
|
9
|
-
*/
|
|
10
|
-
log(message: any): void;
|
|
11
|
-
/**
|
|
12
|
-
* Logs a message with the default log level using template literals.
|
|
13
|
-
* @param strings The template literal strings.
|
|
14
|
-
* @param values The values to interpolate.
|
|
15
|
-
*/
|
|
16
|
-
log(strings: TemplateStringsArray, ...values: any[]): void;
|
|
17
|
-
/**
|
|
18
|
-
* Logs an error message.
|
|
19
|
-
* @param message The error message to log.
|
|
20
|
-
*/
|
|
21
|
-
error(message: any): void;
|
|
22
|
-
/**
|
|
23
|
-
* Logs an error message using template literals.
|
|
24
|
-
* @param strings The template literal strings.
|
|
25
|
-
* @param values The values to interpolate.
|
|
26
|
-
*/
|
|
27
|
-
error(strings: TemplateStringsArray, ...values: any[]): void;
|
|
28
|
-
/**
|
|
29
|
-
* Logs a warning message.
|
|
30
|
-
* @param message The warning message to log.
|
|
31
|
-
*/
|
|
32
|
-
warn(message: any): void;
|
|
33
|
-
/**
|
|
34
|
-
* Logs a warning message using template literals.
|
|
35
|
-
* @param strings The template literal strings.
|
|
36
|
-
* @param values The values to interpolate.
|
|
37
|
-
*/
|
|
38
|
-
warn(strings: TemplateStringsArray, ...values: any[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Logs an informational message.
|
|
41
|
-
* @param message The informational message to log.
|
|
42
|
-
*/
|
|
43
|
-
info(message: any): void;
|
|
44
|
-
/**
|
|
45
|
-
* Logs an informational message using template literals.
|
|
46
|
-
* @param strings The template literal strings.
|
|
47
|
-
* @param values The values to interpolate.
|
|
48
|
-
*/
|
|
49
|
-
info(strings: TemplateStringsArray, ...values: any[]): void;
|
|
50
|
-
/**
|
|
51
|
-
* Logs a debug message.
|
|
52
|
-
* @param message The debug message to log.
|
|
53
|
-
*/
|
|
54
|
-
debug(message: any): void;
|
|
55
|
-
/**
|
|
56
|
-
* Logs a debug message using template literals.
|
|
57
|
-
* @param strings The template literal strings.
|
|
58
|
-
* @param values The values to interpolate.
|
|
59
|
-
*/
|
|
60
|
-
debug(strings: TemplateStringsArray, ...values: any[]): void;
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { ILogger };
|
|
64
|
-
//# sourceMappingURL=ILogger-BQ2ew4zR.d.ts.map
|