commandkit 1.0.0-dev.20250611020404 → 1.0.0-dev.20250611125312
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/dist/ActionRow-CmTHbo2t.js.map +1 -1
- package/dist/{ActionRow-D0wafJhZ.d.ts → ActionRow-DKnFVDME.d.ts} +6 -2
- package/dist/{Button-Bl5nbwTS.d.ts → Button-4ZUXdA56.d.ts} +11 -4
- package/dist/{ButtonKit-BSI7lCI0.d.ts → ButtonKit-C7r7RPNf.d.ts} +21 -2
- package/dist/{ChannelSelectMenuKit-L15A2jpT.d.ts → ChannelSelectMenuKit-BrXvBYNH.d.ts} +19 -3
- package/dist/{CommandKit-B-mjdP5x.d.ts → CommandKit-BkMUDbou.d.ts} +806 -9
- package/dist/{CommandKit-CnLBu_7m.js → CommandKit-C0W3U6jh.js} +621 -20
- package/dist/CommandKit-C0W3U6jh.js.map +1 -0
- package/dist/CommandKit.d.ts +25 -25
- package/dist/CommandKit.js +26 -26
- package/dist/CommandKitEventsChannel-BL_YN3Rm.js +87 -0
- package/dist/CommandKitEventsChannel-BL_YN3Rm.js.map +1 -0
- package/dist/CommandsRouter-CoOA7hkf.d.ts +146 -0
- package/dist/{CommandsRouter-BHaPno8o.js → CommandsRouter-DFRh47qD.js} +87 -1
- package/dist/CommandsRouter-DFRh47qD.js.map +1 -0
- package/dist/{CompilerPlugin-DrnhOC1c.js → CompilerPlugin-Bmy4izKz.js} +13 -2
- package/dist/CompilerPlugin-Bmy4izKz.js.map +1 -0
- package/dist/{CompilerPluginRuntime-C9wmPMQf.js → CompilerPluginRuntime-CgVU_gU0.js} +59 -1
- package/dist/CompilerPluginRuntime-CgVU_gU0.js.map +1 -0
- package/dist/DefaultLogger-pWzrSxMd.d.ts +60 -0
- package/dist/{EventInterceptor-Bvh05z7n.js → EventInterceptor-DWCHCGRh.js} +5 -1
- package/dist/EventInterceptor-DWCHCGRh.js.map +1 -0
- package/dist/{EventInterceptor-D_oEWSnF.d.ts → EventInterceptor-x-R2qshQ.d.ts} +8 -1
- package/dist/{EventWorkerContext-BYXamZ_4.d.ts → EventWorkerContext-DoFZMT8u.d.ts} +25 -2
- package/dist/{EventWorkerContext-BAKiTqJz.js → EventWorkerContext-DxfS_0fJ.js} +24 -1
- package/dist/EventWorkerContext-DxfS_0fJ.js.map +1 -0
- package/dist/ILogger-Cs5SFzqd.d.ts +34 -0
- package/dist/Logger-5ew_YS4P.d.ts +37 -0
- package/dist/{MentionableSelectMenuKit-BiUSKUtZ.d.ts → MentionableSelectMenuKit-CPTKqx-O.d.ts} +14 -3
- package/dist/{MessageCommandParser-D02-wpZN.js → MessageCommandParser-Cz-3I-wL.js} +70 -2
- package/dist/MessageCommandParser-Cz-3I-wL.js.map +1 -0
- package/dist/MessageCommandParser-ROLibZPX.d.ts +195 -0
- package/dist/{Modal-Cxm6cs5c.d.ts → Modal-C6UTRdYQ.d.ts} +8 -4
- package/dist/{ModalKit-CKtQ8eXW.d.ts → ModalKit-Btz58KYn.d.ts} +23 -2
- package/dist/{PluginCommon-DPqnQngK.js → PluginCommon-D_Z8Oiic.js} +23 -1
- package/dist/PluginCommon-D_Z8Oiic.js.map +1 -0
- package/dist/{RoleSelectMenuKit-BSMKkru2.d.ts → RoleSelectMenuKit-C26lU3sN.d.ts} +19 -3
- package/dist/{RuntimePlugin-BJoDa8ZR.js → RuntimePlugin-CehKbceZ.js} +5 -2
- package/dist/RuntimePlugin-CehKbceZ.js.map +1 -0
- package/dist/SelectMenu-Diy87_ba.d.ts +137 -0
- package/dist/{StringSelectMenuKit-B9FHTe48.d.ts → StringSelectMenuKit-Bhs8U6WI.d.ts} +19 -3
- package/dist/{UserSelectMenuKit-DiP0imyo.d.ts → UserSelectMenuKit-CfqFJdxz.d.ts} +19 -3
- package/dist/analytics/analytics-engine.d.ts +25 -25
- package/dist/analytics/analytics-engine.js +26 -26
- package/dist/analytics/analytics-provider.d.ts +25 -25
- package/dist/analytics/constants.d.ts +13 -0
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.d.ts +13 -0
- package/dist/analytics/utils.js +26 -26
- package/dist/app/commands/AppCommandRunner.d.ts +25 -25
- package/dist/app/commands/AppCommandRunner.js +26 -26
- package/dist/app/commands/Context.d.ts +25 -25
- package/dist/app/commands/Context.js +26 -26
- package/dist/app/commands/MessageCommandParser.d.ts +1 -1
- package/dist/app/commands/MessageCommandParser.js +2 -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 +26 -26
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +25 -25
- package/dist/app/handlers/AppCommandHandler.js +26 -26
- package/dist/app/handlers/AppEventsHandler.d.ts +25 -25
- package/dist/app/handlers/AppEventsHandler.js +26 -26
- package/dist/app/index.d.ts +25 -25
- package/dist/app/index.js +27 -27
- package/dist/app/middleware/signals.js +2 -2
- package/dist/app/register/CommandRegistrar.d.ts +25 -25
- package/dist/app/register/CommandRegistrar.js +26 -26
- package/dist/app/router/CommandsRouter.d.ts +1 -1
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/index.d.ts +1 -1
- package/dist/app/router/index.js +1 -1
- package/dist/{app-process-YbSHvqf-.js → app-process-Bo-LedP8.js} +11 -3
- package/dist/app-process-Bo-LedP8.js.map +1 -0
- package/dist/{build-BejatFZX.js → build-CWrpkal-.js} +14 -6
- package/dist/build-CWrpkal-.js.map +1 -0
- package/dist/cli/app-process.d.ts +5 -0
- package/dist/cli/app-process.js +5 -5
- package/dist/cli/build.d.ts +33 -25
- package/dist/cli/build.js +29 -29
- package/dist/cli/common.d.ts +57 -27
- package/dist/cli/common.js +3 -3
- package/dist/cli/development.d.ts +4 -0
- package/dist/cli/development.js +46 -30
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.d.ts +32 -0
- package/dist/cli/env.js +1 -1
- package/dist/cli/generators.d.ts +8 -0
- package/dist/cli/generators.js +27 -3
- package/dist/cli/generators.js.map +1 -1
- package/dist/cli/information.d.ts +4 -0
- package/dist/cli/information.js +17 -1
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.js +27 -27
- package/dist/cli/production.d.ts +9 -0
- package/dist/cli/production.js +39 -31
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.d.ts +2 -0
- package/dist/cli/type-checker.js +4 -4
- package/dist/cli/utils.d.ts +5 -0
- package/dist/cli/utils.js +1 -1
- package/dist/{common-pvPJVTfe.d.ts → common-DOCvOVC4.d.ts} +7 -2
- package/dist/{common-CW8v7gAn.js → common-Dasi9oKU.js} +44 -2
- package/dist/common-Dasi9oKU.js.map +1 -0
- package/dist/{common-CeO-vn8Y.js → common-vnMIelAE.js} +4 -1
- package/dist/common-vnMIelAE.js.map +1 -0
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/EventInterceptor.js +1 -1
- package/dist/components/common/element.d.ts +4 -4
- package/dist/components/common/element.js +2 -2
- package/dist/components/index.d.ts +20 -20
- package/dist/components/index.js +26 -26
- package/dist/components/v1/action-row/ActionRow.d.ts +5 -5
- package/dist/components/v1/button/Button.d.ts +5 -5
- package/dist/components/v1/button/Button.js +26 -26
- package/dist/components/v1/button/ButtonKit.d.ts +2 -2
- package/dist/components/v1/button/ButtonKit.js +26 -26
- package/dist/components/v1/modal/Modal.d.ts +5 -5
- package/dist/components/v1/modal/Modal.js +26 -26
- package/dist/components/v1/modal/ModalKit.d.ts +2 -2
- package/dist/components/v1/modal/ModalKit.js +26 -26
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/SelectMenu.d.ts +8 -8
- package/dist/components/v1/select-menu/SelectMenu.js +26 -26
- package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/common.d.ts +2 -2
- package/dist/components/v2/common.d.ts +4 -0
- package/dist/components/v2/common.js +1 -1
- package/dist/components/v2/container.d.ts +1 -1
- package/dist/components/v2/container.js +2 -2
- package/dist/components/v2/file.d.ts +1 -1
- package/dist/components/v2/file.js +1 -1
- package/dist/components/v2/index.d.ts +6 -6
- package/dist/components/v2/index.js +7 -7
- package/dist/components/v2/media-gallery.d.ts +1 -1
- package/dist/components/v2/media-gallery.js +2 -2
- package/dist/components/v2/section.d.ts +1 -1
- package/dist/components/v2/section.js +2 -2
- package/dist/components/v2/separator.d.ts +1 -1
- package/dist/components/v2/separator.js +1 -1
- package/dist/components/v2/text-display.d.ts +1 -1
- package/dist/components/v2/text-display.js +1 -1
- package/dist/config/config.d.ts +28 -28
- package/dist/config/config.js +26 -26
- package/dist/config/default.d.ts +30 -27
- package/dist/config/default.js +26 -26
- package/dist/config/loader.d.ts +33 -27
- package/dist/config/loader.js +26 -26
- package/dist/config/types.d.ts +26 -26
- package/dist/config/utils.d.ts +27 -27
- package/dist/config/utils.js +3 -0
- package/dist/config/utils.js.map +1 -1
- package/dist/{config-BjmEZYpx.d.ts → config-aCpqqs1C.d.ts} +3 -3
- package/dist/constants-BTttfrm3.d.ts +42 -0
- package/dist/{constants-DWe181uQ.js → constants-CXwjhIYH.js} +9 -1
- package/dist/constants-CXwjhIYH.js.map +1 -0
- package/dist/{constants-CCqS_v55.js → constants-DDRctWlU.js} +14 -8
- package/dist/constants-DDRctWlU.js.map +1 -0
- package/dist/{container-CpuiLsZM.js → container-DCjIgp-B.js} +12 -2
- package/dist/container-DCjIgp-B.js.map +1 -0
- package/dist/container-DaUKKPm-.d.ts +24 -0
- package/dist/context/async-context.d.ts +25 -25
- package/dist/context/async-context.js +26 -26
- package/dist/context/environment.d.ts +25 -25
- package/dist/context/environment.js +26 -26
- package/dist/element-CAXu1XtK.d.ts +72 -0
- package/dist/{element-DcqNz1dV.js → element-Cq-LoDjk.js} +27 -2
- package/dist/element-Cq-LoDjk.js.map +1 -0
- package/dist/{env-ERkaRfQO.js → env-DemeP-uq.js} +33 -1
- package/dist/env-DemeP-uq.js.map +1 -0
- package/dist/{error-codes-C_UO39jz.js → error-codes-CxlUBdF6.js} +20 -1
- package/dist/error-codes-CxlUBdF6.js.map +1 -0
- package/dist/events/CommandKitEventsChannel.d.ts +25 -25
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{feature-flags-BFiGn38a.js → feature-flags-CLZLGnAs.js} +4 -4
- package/dist/feature-flags-CLZLGnAs.js.map +1 -0
- package/dist/file-DTrr-p09.d.ts +24 -0
- package/dist/{file-DE69SSOP.js → file-DVZC0QXI.js} +11 -1
- package/dist/file-DVZC0QXI.js.map +1 -0
- package/dist/flags/FlagProvider.d.ts +25 -25
- package/dist/flags/feature-flags.d.ts +25 -25
- package/dist/flags/feature-flags.js +27 -27
- package/dist/flags/store.d.ts +25 -25
- package/dist/flags/store.js +1 -1
- package/dist/{helpers-CswC9gKF.js → helpers-CnfXqF_k.js} +11 -1
- package/dist/helpers-CnfXqF_k.js.map +1 -0
- package/dist/helpers-Wg6P5fRQ.d.ts +23 -0
- package/dist/index.d.ts +34 -34
- package/dist/index.js +30 -31
- package/dist/{init-BDgyvx9E.js → init-_FwacDcI.js} +6 -6
- package/dist/{init-BDgyvx9E.js.map → init-_FwacDcI.js.map} +1 -1
- package/dist/logger/DefaultLogger.d.ts +2 -2
- package/dist/logger/DefaultLogger.js +26 -26
- package/dist/logger/ILogger.d.ts +1 -1
- package/dist/logger/Logger.d.ts +2 -2
- package/dist/logger/Logger.js +26 -26
- package/dist/media-gallery-BMsXSot3.d.ts +49 -0
- package/dist/{media-gallery-nUEHqKVF.js → media-gallery-CIKypjbJ.js} +27 -2
- package/dist/media-gallery-CIKypjbJ.js.map +1 -0
- package/dist/plugins/CompilerPlugin.d.ts +25 -25
- package/dist/plugins/CompilerPlugin.js +2 -2
- package/dist/plugins/PluginCommon.d.ts +25 -25
- package/dist/plugins/PluginCommon.js +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +25 -25
- package/dist/plugins/RuntimePlugin.js +2 -2
- package/dist/plugins/index.d.ts +25 -25
- package/dist/plugins/index.js +26 -26
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +25 -25
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +26 -26
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +25 -25
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +25 -25
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +26 -26
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +37 -25
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +26 -26
- package/dist/plugins/plugin-runtime/runtime.d.ts +25 -25
- package/dist/plugins/types.d.ts +25 -25
- package/dist/{section-D6t7tyEZ.js → section-CuYr0Inu.js} +22 -2
- package/dist/section-CuYr0Inu.js.map +1 -0
- package/dist/section-Dh_FhPeC.d.ts +45 -0
- package/dist/separator-CMf6Cyy5.d.ts +22 -0
- package/dist/{separator-DYAFK-Jj.js → separator-DLdWBjSN.js} +11 -1
- package/dist/separator-DLdWBjSN.js.map +1 -0
- package/dist/{signals-scJdEbly.js → signals-CSSSZAZ6.js} +2 -2
- package/dist/{signals-scJdEbly.js.map → signals-CSSSZAZ6.js.map} +1 -1
- package/dist/{store-Ci6ib2C9.js → store-x93NXUy_.js} +5 -1
- package/dist/store-x93NXUy_.js.map +1 -0
- package/dist/{text-display-Dy6JHB5X.js → text-display--p2-BoUa.js} +13 -1
- package/dist/text-display--p2-BoUa.js.map +1 -0
- package/dist/text-display-DRw3r_lK.d.ts +33 -0
- package/dist/{type-checker-CXVdS7qc.js → type-checker-P8oyY259.js} +6 -2
- package/dist/type-checker-P8oyY259.js.map +1 -0
- package/dist/{types-DjL43eQS.d.ts → types-DwmPE0nY.d.ts} +2 -2
- package/dist/{types-package-CTSNSM93.js → types-package-BpY3acyl.js} +8 -2
- package/dist/types-package-BpY3acyl.js.map +1 -0
- package/dist/types.d.ts +25 -25
- package/dist/{utilities-DQT4lzAB.d.ts → utilities-D_MFPmTe.d.ts} +45 -2
- package/dist/utils/colors.d.ts +2 -2
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -2
- package/dist/utils/dev-hooks.d.ts +26 -26
- package/dist/utils/dev-hooks.js +26 -26
- package/dist/utils/error-codes.d.ts +34 -0
- package/dist/utils/error-codes.js +1 -1
- package/dist/utils/types-package.d.ts +6 -0
- package/dist/utils/types-package.js +2 -2
- package/dist/utils/utilities.d.ts +1 -1
- package/dist/utils/utilities.js +26 -26
- package/dist/utils/warn-unstable.d.ts +10 -0
- package/dist/utils/warn-unstable.js +1 -1
- package/dist/{utils-IYtoeTur.js → utils-C8a_hMvn.js} +5 -1
- package/dist/utils-C8a_hMvn.js.map +1 -0
- package/dist/{utils-VCdd7XhD.d.ts → utils-DS6OiGvg.d.ts} +12 -2
- package/dist/{version-CS1EiTrw.js → version-IoXx-oYe.js} +5 -2
- package/dist/version-IoXx-oYe.js.map +1 -0
- package/dist/version.js +1 -1
- package/dist/{warn-unstable-DHLaxPC8.js → warn-unstable-CttBdmlS.js} +11 -1
- package/dist/warn-unstable-CttBdmlS.js.map +1 -0
- package/package.json +2 -2
- package/dist/CommandKit-CnLBu_7m.js.map +0 -1
- package/dist/CommandKitEventsChannel-B6LKgxmv.js +0 -44
- package/dist/CommandKitEventsChannel-B6LKgxmv.js.map +0 -1
- package/dist/CommandsRouter-BHaPno8o.js.map +0 -1
- package/dist/CommandsRouter-C7X-eXE2.d.ts +0 -67
- package/dist/CompilerPlugin-DrnhOC1c.js.map +0 -1
- package/dist/CompilerPluginRuntime-C9wmPMQf.js.map +0 -1
- package/dist/DefaultLogger-CcW-Fuq5.d.ts +0 -30
- package/dist/EventInterceptor-Bvh05z7n.js.map +0 -1
- package/dist/EventWorkerContext-BAKiTqJz.js.map +0 -1
- package/dist/ILogger-kqwb2kUu.d.ts +0 -11
- package/dist/Logger-B4B_URL-.d.ts +0 -17
- package/dist/MessageCommandParser-D02-wpZN.js.map +0 -1
- package/dist/MessageCommandParser-tzroBwij.d.ts +0 -62
- package/dist/PluginCommon-DPqnQngK.js.map +0 -1
- package/dist/RuntimePlugin-BJoDa8ZR.js.map +0 -1
- package/dist/SelectMenu-b7jgrkjO.d.ts +0 -36
- package/dist/app-process-YbSHvqf-.js.map +0 -1
- package/dist/build-BejatFZX.js.map +0 -1
- package/dist/common-CW8v7gAn.js.map +0 -1
- package/dist/common-CeO-vn8Y.js.map +0 -1
- package/dist/constants-BPWSrMkn.d.ts +0 -18
- package/dist/constants-CCqS_v55.js.map +0 -1
- package/dist/constants-DWe181uQ.js.map +0 -1
- package/dist/container-CpuiLsZM.js.map +0 -1
- package/dist/container-CwEATQy2.d.ts +0 -10
- package/dist/element-D_nyVwgB.d.ts +0 -30
- package/dist/element-DcqNz1dV.js.map +0 -1
- package/dist/env-ERkaRfQO.js.map +0 -1
- package/dist/error-codes-C_UO39jz.js.map +0 -1
- package/dist/feature-flags-BFiGn38a.js.map +0 -1
- package/dist/file-BdyYwkaI.d.ts +0 -10
- package/dist/file-DE69SSOP.js.map +0 -1
- package/dist/helpers-CswC9gKF.js.map +0 -1
- package/dist/helpers-DAmE106r.d.ts +0 -9
- package/dist/media-gallery-DCu02VXc.d.ts +0 -17
- package/dist/media-gallery-nUEHqKVF.js.map +0 -1
- package/dist/section-D6t7tyEZ.js.map +0 -1
- package/dist/section-fktaECHL.d.ts +0 -18
- package/dist/separator-CuesaLrC.d.ts +0 -8
- package/dist/separator-DYAFK-Jj.js.map +0 -1
- package/dist/store-Ci6ib2C9.js.map +0 -1
- package/dist/text-display-DNMwmGHJ.d.ts +0 -12
- package/dist/text-display-Dy6JHB5X.js.map +0 -1
- package/dist/type-checker-CXVdS7qc.js.map +0 -1
- package/dist/types-package-CTSNSM93.js.map +0 -1
- package/dist/utils/clone.d.ts +0 -5
- package/dist/utils/clone.js +0 -9
- package/dist/utils/clone.js.map +0 -1
- package/dist/utils/get-paths.d.ts +0 -6
- package/dist/utils/get-paths.js +0 -34
- package/dist/utils/get-paths.js.map +0 -1
- package/dist/utils-IYtoeTur.js.map +0 -1
- package/dist/version-CS1EiTrw.js.map +0 -1
- package/dist/warn-unstable-DHLaxPC8.js.map +0 -1
package/dist/CommandKit.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { BootstrapFunction, CommandKit, CommandKitConfiguration, commandkit, onApplicationBootstrap, onBootstrap } from "./CommandKit-
|
|
2
|
-
import "./EventInterceptor-
|
|
3
|
-
import "./ButtonKit-
|
|
4
|
-
import "./ModalKit-
|
|
5
|
-
import "./element-
|
|
6
|
-
import "./ActionRow-
|
|
1
|
+
import { BootstrapFunction, CommandKit, CommandKitConfiguration, commandkit, onApplicationBootstrap, onBootstrap } from "./CommandKit-BkMUDbou.js";
|
|
2
|
+
import "./EventInterceptor-x-R2qshQ.js";
|
|
3
|
+
import "./ButtonKit-C7r7RPNf.js";
|
|
4
|
+
import "./ModalKit-Btz58KYn.js";
|
|
5
|
+
import "./element-CAXu1XtK.js";
|
|
6
|
+
import "./ActionRow-DKnFVDME.js";
|
|
7
7
|
import "./types-CJ-XvOFN.js";
|
|
8
|
-
import "./Button-
|
|
9
|
-
import "./Modal-
|
|
10
|
-
import "./common-
|
|
11
|
-
import "./StringSelectMenuKit-
|
|
12
|
-
import "./ChannelSelectMenuKit-
|
|
13
|
-
import "./MentionableSelectMenuKit-
|
|
14
|
-
import "./UserSelectMenuKit-
|
|
15
|
-
import "./RoleSelectMenuKit-
|
|
16
|
-
import "./SelectMenu-
|
|
17
|
-
import "./container-
|
|
18
|
-
import "./file-
|
|
19
|
-
import "./media-gallery-
|
|
20
|
-
import "./section-
|
|
21
|
-
import "./separator-
|
|
22
|
-
import "./text-display-
|
|
8
|
+
import "./Button-4ZUXdA56.js";
|
|
9
|
+
import "./Modal-C6UTRdYQ.js";
|
|
10
|
+
import "./common-DOCvOVC4.js";
|
|
11
|
+
import "./StringSelectMenuKit-Bhs8U6WI.js";
|
|
12
|
+
import "./ChannelSelectMenuKit-BrXvBYNH.js";
|
|
13
|
+
import "./MentionableSelectMenuKit-CPTKqx-O.js";
|
|
14
|
+
import "./UserSelectMenuKit-CfqFJdxz.js";
|
|
15
|
+
import "./RoleSelectMenuKit-C26lU3sN.js";
|
|
16
|
+
import "./SelectMenu-Diy87_ba.js";
|
|
17
|
+
import "./container-DaUKKPm-.js";
|
|
18
|
+
import "./file-DTrr-p09.js";
|
|
19
|
+
import "./media-gallery-BMsXSot3.js";
|
|
20
|
+
import "./section-Dh_FhPeC.js";
|
|
21
|
+
import "./separator-CMf6Cyy5.js";
|
|
22
|
+
import "./text-display-DRw3r_lK.js";
|
|
23
23
|
import "./index-Dw5cCt-A.js";
|
|
24
24
|
import "./index-E7Wvm5uX.js";
|
|
25
|
-
import "./MessageCommandParser-
|
|
25
|
+
import "./MessageCommandParser-ROLibZPX.js";
|
|
26
26
|
import "./signals-DUoWkeZ7.js";
|
|
27
|
-
import "./helpers-
|
|
28
|
-
import "./CommandsRouter-
|
|
27
|
+
import "./helpers-Wg6P5fRQ.js";
|
|
28
|
+
import "./CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "./EventsRouter-BacqK6z3.js";
|
|
30
30
|
import "./index-CUPkUUOR.js";
|
|
31
|
-
import "./constants-
|
|
31
|
+
import "./constants-BTttfrm3.js";
|
|
32
32
|
export { BootstrapFunction, CommandKit, CommandKitConfiguration, commandkit, onApplicationBootstrap, onBootstrap };
|
package/dist/CommandKit.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
require('./colors-Cd4Oz-r-.js');
|
|
2
2
|
require('./ActionRow-CmTHbo2t.js');
|
|
3
|
-
require('./error-codes-
|
|
4
|
-
const require_CommandKit = require('./CommandKit-
|
|
3
|
+
require('./error-codes-CxlUBdF6.js');
|
|
4
|
+
const require_CommandKit = require('./CommandKit-C0W3U6jh.js');
|
|
5
5
|
require('./common-CcfjYnPG.js');
|
|
6
|
-
require('./common-
|
|
7
|
-
require('./container-
|
|
8
|
-
require('./file-
|
|
9
|
-
require('./media-gallery-
|
|
10
|
-
require('./section-
|
|
11
|
-
require('./separator-
|
|
12
|
-
require('./text-display-
|
|
6
|
+
require('./common-vnMIelAE.js');
|
|
7
|
+
require('./container-DCjIgp-B.js');
|
|
8
|
+
require('./file-DVZC0QXI.js');
|
|
9
|
+
require('./media-gallery-CIKypjbJ.js');
|
|
10
|
+
require('./section-CuYr0Inu.js');
|
|
11
|
+
require('./separator-DLdWBjSN.js');
|
|
12
|
+
require('./text-display--p2-BoUa.js');
|
|
13
13
|
require('./v2-DofkPKHs.js');
|
|
14
|
-
require('./warn-unstable-
|
|
15
|
-
require('./element-
|
|
14
|
+
require('./warn-unstable-CttBdmlS.js');
|
|
15
|
+
require('./element-Cq-LoDjk.js');
|
|
16
16
|
require('./types-B5VPP9ig.js');
|
|
17
|
-
require('./EventInterceptor-
|
|
18
|
-
require('./constants-
|
|
19
|
-
require('./PluginCommon-
|
|
20
|
-
require('./CompilerPlugin-
|
|
21
|
-
require('./RuntimePlugin-
|
|
17
|
+
require('./EventInterceptor-DWCHCGRh.js');
|
|
18
|
+
require('./constants-DDRctWlU.js');
|
|
19
|
+
require('./PluginCommon-D_Z8Oiic.js');
|
|
20
|
+
require('./CompilerPlugin-Bmy4izKz.js');
|
|
21
|
+
require('./RuntimePlugin-CehKbceZ.js');
|
|
22
22
|
require('./types-Bq0EWaM3.js');
|
|
23
|
-
require('./CompilerPluginRuntime-
|
|
23
|
+
require('./CompilerPluginRuntime-CgVU_gU0.js');
|
|
24
24
|
require('./runtime-D0JnztkU.js');
|
|
25
|
-
require('./EventWorkerContext-
|
|
25
|
+
require('./EventWorkerContext-DxfS_0fJ.js');
|
|
26
26
|
require('./resolve-file-url-ifwdwqmq.js');
|
|
27
|
-
require('./MessageCommandParser-
|
|
28
|
-
require('./signals-
|
|
29
|
-
require('./constants-
|
|
30
|
-
require('./types-package-
|
|
31
|
-
require('./CommandsRouter-
|
|
27
|
+
require('./MessageCommandParser-Cz-3I-wL.js');
|
|
28
|
+
require('./signals-CSSSZAZ6.js');
|
|
29
|
+
require('./constants-CXwjhIYH.js');
|
|
30
|
+
require('./types-package-BpY3acyl.js');
|
|
31
|
+
require('./CommandsRouter-DFRh47qD.js');
|
|
32
32
|
require('./EventsRouter-CqnrlbjN.js');
|
|
33
33
|
require('./router-Dn35v30f.js');
|
|
34
|
-
require('./common-
|
|
35
|
-
require('./CommandKitEventsChannel-
|
|
36
|
-
require('./store-
|
|
34
|
+
require('./common-Dasi9oKU.js');
|
|
35
|
+
require('./CommandKitEventsChannel-BL_YN3Rm.js');
|
|
36
|
+
require('./store-x93NXUy_.js');
|
|
37
37
|
|
|
38
38
|
exports.CommandKit = require_CommandKit.CommandKit;
|
|
39
39
|
exports.commandkit = require_CommandKit.commandkit;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
+
const node_events = require_chunk.__toESM(require("node:events"));
|
|
3
|
+
|
|
4
|
+
//#region src/events/CommandKitEventsChannel.ts
|
|
5
|
+
/**
|
|
6
|
+
* Represents a channel for emitting and listening to events in CommandKit.
|
|
7
|
+
* This class provides methods to manage event listeners and emit events
|
|
8
|
+
* within a specific namespace.
|
|
9
|
+
*/
|
|
10
|
+
var CommandKitEventsChannel = class {
|
|
11
|
+
emitter = new node_events.default();
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new instance of CommandKitEventsChannel.
|
|
14
|
+
* @param commandkit The CommandKit instance that this channel belongs to.
|
|
15
|
+
*/
|
|
16
|
+
constructor(commandkit) {
|
|
17
|
+
this.commandkit = commandkit;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates a namespaced event channel. This allows you to manage events
|
|
21
|
+
* within a specific namespace, preventing conflicts with other event channels.
|
|
22
|
+
* This is useful for organizing events related to different parts of your application.
|
|
23
|
+
* @param namespace The namespace for the event channel.
|
|
24
|
+
* @returns An object containing methods for managing events within the namespace.
|
|
25
|
+
* @example commandkit.events.to('customNamespace').emit('eventName', data);
|
|
26
|
+
*/
|
|
27
|
+
to(namespace) {
|
|
28
|
+
return {
|
|
29
|
+
on: this.on.bind(this, namespace),
|
|
30
|
+
off: this.off.bind(this, namespace),
|
|
31
|
+
once: this.once.bind(this, namespace),
|
|
32
|
+
emit: this.emit.bind(this, namespace),
|
|
33
|
+
removeAllListeners: this.removeAllListeners.bind(this, namespace)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Register an event listener for a specific event within the namespace.
|
|
38
|
+
* @param namespace The namespace for the event channel.
|
|
39
|
+
* @param event The name of the event to listen for.
|
|
40
|
+
* @param listener The function to call when the event is emitted.
|
|
41
|
+
*/
|
|
42
|
+
on(namespace, event, listener) {
|
|
43
|
+
this.emitter.on(`${namespace}:${event}`, listener);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Unregister an event listener for a specific event within the namespace.
|
|
47
|
+
* @param namespace The namespace for the event channel.
|
|
48
|
+
* @param event The name of the event to stop listening for.
|
|
49
|
+
* @param listener The function that was registered as the listener.
|
|
50
|
+
*/
|
|
51
|
+
off(namespace, event, listener) {
|
|
52
|
+
this.emitter.off(`${namespace}:${event}`, listener);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Register an event listener that will be called only once for a specific event
|
|
56
|
+
* within the namespace.
|
|
57
|
+
* @param namespace The namespace for the event channel.
|
|
58
|
+
* @param event The name of the event to listen for.
|
|
59
|
+
* @param listener The function to call when the event is emitted.
|
|
60
|
+
*/
|
|
61
|
+
once(namespace, event, listener) {
|
|
62
|
+
this.emitter.once(`${namespace}:${event}`, listener);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Emit an event within the specified namespace, calling all registered listeners.
|
|
66
|
+
* @param namespace The namespace for the event channel.
|
|
67
|
+
* @param event The name of the event to emit.
|
|
68
|
+
* @param args The arguments to pass to the listeners.
|
|
69
|
+
* @returns A boolean indicating whether any listeners were called.
|
|
70
|
+
*/
|
|
71
|
+
emit(namespace, event, ...args) {
|
|
72
|
+
return this.emitter.emit(`${namespace}:${event}`, ...args);
|
|
73
|
+
}
|
|
74
|
+
removeAllListeners(namespace, event) {
|
|
75
|
+
if (event) this.emitter.removeAllListeners(`${namespace}:${event}`);
|
|
76
|
+
else this.emitter.removeAllListeners(namespace);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
Object.defineProperty(exports, 'CommandKitEventsChannel', {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () {
|
|
84
|
+
return CommandKitEventsChannel;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=CommandKitEventsChannel-BL_YN3Rm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandKitEventsChannel-BL_YN3Rm.js","names":[],"sources":["../src/events/CommandKitEventsChannel.ts"],"sourcesContent":["import EventEmitter from 'node:events';\nimport type { CommandKit } from '../CommandKit';\nimport type { AsyncFunction, GenericFunction } from '../context/async-context';\n\n/**\n * The function type for event listeners.\n */\nexport type ListenerFunction = GenericFunction | AsyncFunction;\n\n/**\n * Represents a channel for emitting and listening to events in CommandKit.\n * This class provides methods to manage event listeners and emit events\n * within a specific namespace.\n */\nexport class CommandKitEventsChannel {\n private emitter = new EventEmitter();\n\n /**\n * Creates a new instance of CommandKitEventsChannel.\n * @param commandkit The CommandKit instance that this channel belongs to.\n */\n public constructor(public readonly commandkit: CommandKit) {}\n\n /**\n * Creates a namespaced event channel. This allows you to manage events\n * within a specific namespace, preventing conflicts with other event channels.\n * This is useful for organizing events related to different parts of your application.\n * @param namespace The namespace for the event channel.\n * @returns An object containing methods for managing events within the namespace.\n * @example commandkit.events.to('customNamespace').emit('eventName', data);\n */\n public to(namespace: string) {\n return {\n on: this.on.bind(this, namespace),\n off: this.off.bind(this, namespace),\n once: this.once.bind(this, namespace),\n emit: this.emit.bind(this, namespace),\n removeAllListeners: this.removeAllListeners.bind(this, namespace),\n };\n }\n\n /**\n * Register an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public on(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.on(`${namespace}:${event}`, listener);\n }\n\n /**\n * Unregister an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to stop listening for.\n * @param listener The function that was registered as the listener.\n */\n public off(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.off(`${namespace}:${event}`, listener);\n }\n\n /**\n * Register an event listener that will be called only once for a specific event\n * within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public once(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.once(`${namespace}:${event}`, listener);\n }\n\n /**\n * Emit an event within the specified namespace, calling all registered listeners.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to emit.\n * @param args The arguments to pass to the listeners.\n * @returns A boolean indicating whether any listeners were called.\n */\n public emit(namespace: string, event: string, ...args: any[]) {\n return this.emitter.emit(`${namespace}:${event}`, ...args);\n }\n\n /**\n * Remove all listeners for a specific event or all events within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to remove listeners for. If not provided, all listeners for all events in the namespace will be removed.\n */\n public removeAllListeners(namespace: string): void;\n public removeAllListeners(namespace: string, event: string): void;\n public removeAllListeners(namespace: string, event?: string): void {\n if (event) {\n this.emitter.removeAllListeners(`${namespace}:${event}`);\n } else {\n this.emitter.removeAllListeners(namespace);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,0BAAb,MAAqC;CACnC,AAAQ,UAAU,IAAI;;;;;CAMtB,AAAO,YAA4B,YAAwB;EAAxB;CAAyB;;;;;;;;;CAU5D,AAAO,GAAG,WAAmB;AAC3B,SAAO;GACL,IAAI,KAAK,GAAG,KAAK,MAAM,UAAU;GACjC,KAAK,KAAK,IAAI,KAAK,MAAM,UAAU;GACnC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,oBAAoB,KAAK,mBAAmB,KAAK,MAAM,UAAU;EAClE;CACH;;;;;;;CAQA,AAAO,GAAG,WAAmB,OAAe,UAA4B;AACtE,OAAK,QAAQ,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;CACpD;;;;;;;CAQA,AAAO,IAAI,WAAmB,OAAe,UAA4B;AACvE,OAAK,QAAQ,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;CACrD;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,UAA4B;AACxE,OAAK,QAAQ,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;CACtD;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,GAAG,MAAa;AAC5D,SAAO,KAAK,QAAQ,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,GAAG,KAAK;CAC5D;CASA,AAAO,mBAAmB,WAAmB,OAAsB;AACjE,MAAI,MACF,MAAK,QAAQ,oBAAoB,EAAE,UAAU,GAAG,MAAM,EAAE;MAExD,MAAK,QAAQ,mBAAmB,UAAU;CAE9C;AACF"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Collection } from "discord.js";
|
|
2
|
+
|
|
3
|
+
//#region src/app/router/CommandsRouter.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a command with its metadata and middleware associations.
|
|
7
|
+
*/
|
|
8
|
+
interface Command {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
path: string;
|
|
12
|
+
relativePath: string;
|
|
13
|
+
parentPath: string;
|
|
14
|
+
middlewares: Array<string>;
|
|
15
|
+
category: string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Represents a middleware with its metadata and scope.
|
|
19
|
+
*/
|
|
20
|
+
interface Middleware {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
path: string;
|
|
24
|
+
relativePath: string;
|
|
25
|
+
parentPath: string;
|
|
26
|
+
global: boolean;
|
|
27
|
+
command: string | null;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Data structure containing parsed commands and middleware.
|
|
31
|
+
*/
|
|
32
|
+
interface ParsedCommandData {
|
|
33
|
+
commands: Record<string, Command>;
|
|
34
|
+
middlewares: Record<string, Middleware>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Configuration options for the commands router.
|
|
38
|
+
*/
|
|
39
|
+
interface CommandsRouterOptions {
|
|
40
|
+
entrypoint: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Handles discovery and parsing of command and middleware files in the filesystem.
|
|
44
|
+
*/
|
|
45
|
+
declare class CommandsRouter {
|
|
46
|
+
private readonly options;
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
private commands;
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
private middlewares;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new CommandsRouter instance.
|
|
59
|
+
* @param options - Configuration options for the router
|
|
60
|
+
*/
|
|
61
|
+
constructor(options: CommandsRouterOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Populates the router with existing command and middleware data.
|
|
64
|
+
* @param data - Parsed command data to populate with
|
|
65
|
+
*/
|
|
66
|
+
populate(data: ParsedCommandData): void;
|
|
67
|
+
/**
|
|
68
|
+
* Checks if the configured entrypoint path exists.
|
|
69
|
+
* @returns True if the path exists
|
|
70
|
+
*/
|
|
71
|
+
isValidPath(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @private
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
private isCommand;
|
|
77
|
+
/**
|
|
78
|
+
* @private
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
private isMiddleware;
|
|
82
|
+
/**
|
|
83
|
+
* @private
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
private isCategory;
|
|
87
|
+
/**
|
|
88
|
+
* Clears all loaded commands and middleware.
|
|
89
|
+
*/
|
|
90
|
+
clear(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Scans the filesystem for commands and middleware files.
|
|
93
|
+
* @returns Parsed command data
|
|
94
|
+
*/
|
|
95
|
+
scan(): Promise<{
|
|
96
|
+
commands: {
|
|
97
|
+
[k: string]: Command;
|
|
98
|
+
};
|
|
99
|
+
middlewares: {
|
|
100
|
+
[k: string]: Middleware;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* Gets the raw command and middleware collections.
|
|
105
|
+
* @returns Object containing commands and middlewares collections
|
|
106
|
+
*/
|
|
107
|
+
getData(): {
|
|
108
|
+
commands: Collection<string, Command>;
|
|
109
|
+
middlewares: Collection<string, Middleware>;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Converts the loaded data to a JSON-serializable format.
|
|
113
|
+
* @returns Plain object with commands and middlewares
|
|
114
|
+
*/
|
|
115
|
+
toJSON(): {
|
|
116
|
+
commands: {
|
|
117
|
+
[k: string]: Command;
|
|
118
|
+
};
|
|
119
|
+
middlewares: {
|
|
120
|
+
[k: string]: Middleware;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* @private
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
private traverse;
|
|
128
|
+
/**
|
|
129
|
+
* @private
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
private handle;
|
|
133
|
+
/**
|
|
134
|
+
* @private
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
private applyMiddlewares;
|
|
138
|
+
/**
|
|
139
|
+
* @private
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
private replaceEntrypoint;
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
export { Command, CommandsRouter, CommandsRouterOptions, Middleware, ParsedCommandData };
|
|
146
|
+
//# sourceMappingURL=CommandsRouter-CoOA7hkf.d.ts.map
|
|
@@ -5,37 +5,99 @@ const node_path = require_chunk.__toESM(require("node:path"));
|
|
|
5
5
|
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
6
6
|
|
|
7
7
|
//#region src/app/router/CommandsRouter.ts
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
8
12
|
const MIDDLEWARE_PATTERN = /^\+middleware\.(m|c)?(j|t)sx?$/;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
9
17
|
const COMMAND_MIDDLEWARE_PATTERN = /^\+([^+().][^().]*)\.middleware\.(m|c)?(j|t)sx?$/;
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
10
22
|
const GLOBAL_MIDDLEWARE_PATTERN = /^\+global-middleware\.(m|c)?(j|t)sx?$/;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
11
27
|
const COMMAND_PATTERN = /^([^+().][^().]*)\.(m|c)?(j|t)sx?$/;
|
|
28
|
+
/**
|
|
29
|
+
* @private
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
12
32
|
const CATEGORY_PATTERN = /^\(.+\)$/;
|
|
33
|
+
/**
|
|
34
|
+
* Handles discovery and parsing of command and middleware files in the filesystem.
|
|
35
|
+
*/
|
|
13
36
|
var CommandsRouter = class {
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
14
41
|
commands = new discord_js.Collection();
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
15
46
|
middlewares = new discord_js.Collection();
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new CommandsRouter instance.
|
|
49
|
+
* @param options - Configuration options for the router
|
|
50
|
+
*/
|
|
16
51
|
constructor(options) {
|
|
17
52
|
this.options = options;
|
|
18
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Populates the router with existing command and middleware data.
|
|
56
|
+
* @param data - Parsed command data to populate with
|
|
57
|
+
*/
|
|
19
58
|
populate(data) {
|
|
20
59
|
for (const [id, command] of Object.entries(data.commands)) this.commands.set(id, command);
|
|
21
60
|
for (const [id, middleware] of Object.entries(data.middlewares)) this.middlewares.set(id, middleware);
|
|
22
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Checks if the configured entrypoint path exists.
|
|
64
|
+
* @returns True if the path exists
|
|
65
|
+
*/
|
|
23
66
|
isValidPath() {
|
|
24
67
|
return (0, node_fs.existsSync)(this.options.entrypoint);
|
|
25
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* @private
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
26
73
|
isCommand(name) {
|
|
27
74
|
return COMMAND_PATTERN.test(name);
|
|
28
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* @private
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
29
80
|
isMiddleware(name) {
|
|
30
81
|
return MIDDLEWARE_PATTERN.test(name) || GLOBAL_MIDDLEWARE_PATTERN.test(name) || COMMAND_MIDDLEWARE_PATTERN.test(name);
|
|
31
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @private
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
32
87
|
isCategory(name) {
|
|
33
88
|
return CATEGORY_PATTERN.test(name);
|
|
34
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Clears all loaded commands and middleware.
|
|
92
|
+
*/
|
|
35
93
|
clear() {
|
|
36
94
|
this.commands.clear();
|
|
37
95
|
this.middlewares.clear();
|
|
38
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Scans the filesystem for commands and middleware files.
|
|
99
|
+
* @returns Parsed command data
|
|
100
|
+
*/
|
|
39
101
|
async scan() {
|
|
40
102
|
const entries = await (0, node_fs_promises.readdir)(this.options.entrypoint, { withFileTypes: true });
|
|
41
103
|
for (const entry of entries) {
|
|
@@ -49,18 +111,30 @@ var CommandsRouter = class {
|
|
|
49
111
|
await this.applyMiddlewares();
|
|
50
112
|
return this.toJSON();
|
|
51
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Gets the raw command and middleware collections.
|
|
116
|
+
* @returns Object containing commands and middlewares collections
|
|
117
|
+
*/
|
|
52
118
|
getData() {
|
|
53
119
|
return {
|
|
54
120
|
commands: this.commands,
|
|
55
121
|
middlewares: this.middlewares
|
|
56
122
|
};
|
|
57
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Converts the loaded data to a JSON-serializable format.
|
|
126
|
+
* @returns Plain object with commands and middlewares
|
|
127
|
+
*/
|
|
58
128
|
toJSON() {
|
|
59
129
|
return {
|
|
60
130
|
commands: Object.fromEntries(this.commands.entries()),
|
|
61
131
|
middlewares: Object.fromEntries(this.middlewares.entries())
|
|
62
132
|
};
|
|
63
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* @private
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
64
138
|
async traverse(path, category) {
|
|
65
139
|
const entries = await (0, node_fs_promises.readdir)(path, { withFileTypes: true });
|
|
66
140
|
for (const entry of entries) {
|
|
@@ -73,6 +147,10 @@ var CommandsRouter = class {
|
|
|
73
147
|
}
|
|
74
148
|
}
|
|
75
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
76
154
|
async handle(entry, category = null) {
|
|
77
155
|
const name = entry.name;
|
|
78
156
|
const path = (0, node_path.join)(entry.parentPath, entry.name);
|
|
@@ -100,6 +178,10 @@ var CommandsRouter = class {
|
|
|
100
178
|
this.middlewares.set(middleware.id, middleware);
|
|
101
179
|
}
|
|
102
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* @private
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
103
185
|
applyMiddlewares() {
|
|
104
186
|
this.commands.forEach((command) => {
|
|
105
187
|
const commandPath = command.parentPath;
|
|
@@ -111,6 +193,10 @@ var CommandsRouter = class {
|
|
|
111
193
|
command.middlewares = Array.from(new Set([...command.middlewares, ...samePathMiddlewares]));
|
|
112
194
|
});
|
|
113
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @private
|
|
198
|
+
* @internal
|
|
199
|
+
*/
|
|
114
200
|
replaceEntrypoint(path) {
|
|
115
201
|
const normalized = (0, node_path.normalize)(path);
|
|
116
202
|
return normalized.replace(this.options.entrypoint, "");
|
|
@@ -124,4 +210,4 @@ Object.defineProperty(exports, 'CommandsRouter', {
|
|
|
124
210
|
return CommandsRouter;
|
|
125
211
|
}
|
|
126
212
|
});
|
|
127
|
-
//# sourceMappingURL=CommandsRouter-
|
|
213
|
+
//# sourceMappingURL=CommandsRouter-DFRh47qD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandsRouter-DFRh47qD.js","names":[],"sources":["../src/app/router/CommandsRouter.ts"],"sourcesContent":["import { Collection } from 'discord.js';\nimport { Dirent, existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, extname, join, normalize } from 'node:path';\n\n/**\n * Represents a command with its metadata and middleware associations.\n */\nexport interface Command {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n middlewares: Array<string>;\n category: string | null;\n}\n\n/**\n * Represents a middleware with its metadata and scope.\n */\nexport interface Middleware {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n global: boolean;\n command: string | null;\n}\n\n/**\n * Data structure containing parsed commands and middleware.\n */\nexport interface ParsedCommandData {\n commands: Record<string, Command>;\n middlewares: Record<string, Middleware>;\n}\n\n/**\n * Configuration options for the commands router.\n */\nexport interface CommandsRouterOptions {\n entrypoint: string;\n}\n\n/**\n * @private\n * @internal\n */\nconst MIDDLEWARE_PATTERN = /^\\+middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_MIDDLEWARE_PATTERN =\n /^\\+([^+().][^().]*)\\.middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst GLOBAL_MIDDLEWARE_PATTERN = /^\\+global-middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_PATTERN = /^([^+().][^().]*)\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst CATEGORY_PATTERN = /^\\(.+\\)$/;\n\n/**\n * Handles discovery and parsing of command and middleware files in the filesystem.\n */\nexport class CommandsRouter {\n /**\n * @private\n * @internal\n */\n private commands = new Collection<string, Command>();\n\n /**\n * @private\n * @internal\n */\n private middlewares = new Collection<string, Middleware>();\n\n /**\n * Creates a new CommandsRouter instance.\n * @param options - Configuration options for the router\n */\n public constructor(private readonly options: CommandsRouterOptions) {}\n\n /**\n * Populates the router with existing command and middleware data.\n * @param data - Parsed command data to populate with\n */\n public populate(data: ParsedCommandData) {\n for (const [id, command] of Object.entries(data.commands)) {\n this.commands.set(id, command);\n }\n\n for (const [id, middleware] of Object.entries(data.middlewares)) {\n this.middlewares.set(id, middleware);\n }\n }\n\n /**\n * Checks if the configured entrypoint path exists.\n * @returns True if the path exists\n */\n public isValidPath(): boolean {\n return existsSync(this.options.entrypoint);\n }\n\n /**\n * @private\n * @internal\n */\n private isCommand(name: string): boolean {\n return COMMAND_PATTERN.test(name);\n }\n\n /**\n * @private\n * @internal\n */\n private isMiddleware(name: string): boolean {\n return (\n MIDDLEWARE_PATTERN.test(name) ||\n GLOBAL_MIDDLEWARE_PATTERN.test(name) ||\n COMMAND_MIDDLEWARE_PATTERN.test(name)\n );\n }\n\n /**\n * @private\n * @internal\n */\n private isCategory(name: string): boolean {\n return CATEGORY_PATTERN.test(name);\n }\n\n /**\n * Clears all loaded commands and middleware.\n */\n public clear() {\n this.commands.clear();\n this.middlewares.clear();\n }\n\n /**\n * Scans the filesystem for commands and middleware files.\n * @returns Parsed command data\n */\n public async scan() {\n const entries = await readdir(this.options.entrypoint, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n const fullPath = join(this.options.entrypoint, entry.name);\n\n if (entry.isDirectory()) {\n const category = this.isCategory(entry.name)\n ? entry.name.slice(1, -1)\n : null;\n\n await this.traverse(fullPath, category);\n } else {\n await this.handle(entry);\n }\n }\n\n await this.applyMiddlewares();\n\n return this.toJSON();\n }\n\n /**\n * Gets the raw command and middleware collections.\n * @returns Object containing commands and middlewares collections\n */\n public getData() {\n return {\n commands: this.commands,\n middlewares: this.middlewares,\n };\n }\n\n /**\n * Converts the loaded data to a JSON-serializable format.\n * @returns Plain object with commands and middlewares\n */\n public toJSON() {\n return {\n commands: Object.fromEntries(this.commands.entries()),\n middlewares: Object.fromEntries(this.middlewares.entries()),\n };\n }\n\n /**\n * @private\n * @internal\n */\n private async traverse(path: string, category: string | null) {\n const entries = await readdir(path, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n if (entry.isFile()) {\n if (this.isCommand(entry.name) || this.isMiddleware(entry.name)) {\n await this.handle(entry, category);\n }\n } else if (\n entry.isDirectory() &&\n this.isCategory(entry.name) &&\n category\n ) {\n // nested category\n const nestedCategory = this.isCategory(entry.name)\n ? `${category}:${entry.name.slice(1, -1)}`\n : null;\n await this.traverse(join(path, entry.name), nestedCategory);\n }\n\n // TODO: handle subcommands\n }\n }\n\n /**\n * @private\n * @internal\n */\n private async handle(entry: Dirent, category: string | null = null) {\n const name = entry.name;\n const path = join(entry.parentPath, entry.name);\n\n if (this.isCommand(name)) {\n const command: Command = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n category,\n parentPath: entry.parentPath,\n relativePath: this.replaceEntrypoint(path),\n middlewares: [],\n };\n\n this.commands.set(command.id, command);\n } else if (this.isMiddleware(name)) {\n const middleware: Middleware = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n relativePath: this.replaceEntrypoint(path),\n parentPath: entry.parentPath,\n global: GLOBAL_MIDDLEWARE_PATTERN.test(name),\n command: COMMAND_MIDDLEWARE_PATTERN.test(name)\n ? name.split('.')[0] || null\n : null,\n };\n\n this.middlewares.set(middleware.id, middleware);\n }\n }\n\n /**\n * @private\n * @internal\n */\n private applyMiddlewares() {\n this.commands.forEach((command) => {\n const commandPath = command.parentPath;\n const samePathMiddlewares = Array.from(this.middlewares.values())\n .filter((middleware) => {\n if (middleware.global) return true;\n if (middleware.command) return middleware.command === command.name;\n return middleware.parentPath === commandPath;\n })\n .map((middleware) => middleware.id);\n\n command.middlewares = Array.from(\n new Set([...command.middlewares, ...samePathMiddlewares]),\n );\n });\n }\n\n /**\n * @private\n * @internal\n */\n private replaceEntrypoint(path: string) {\n const normalized = normalize(path);\n return normalized.replace(this.options.entrypoint, '');\n }\n}\n"],"mappings":";;;;;;;;;;;AAkDA,MAAM,qBAAqB;;;;;AAM3B,MAAM,6BACN;;;;;AAMA,MAAM,4BAA4B;;;;;AAMlC,MAAM,kBAAkB;;;;;AAMxB,MAAM,mBAAmB;;;;AAKzB,IAAa,iBAAb,MAA4B;;;;;CAK1B,AAAQ,WAAW,IAAI;;;;;CAMvB,AAAQ,cAAc,IAAI;;;;;CAM1B,AAAO,YAA6B,SAAgC;EAAhC;CAAiC;;;;;CAMrE,AAAO,SAAS,MAAyB;AACvC,OAAK,MAAM,CAAC,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,SAAS,CACvD,MAAK,SAAS,IAAI,IAAI,QAAQ;AAGhC,OAAK,MAAM,CAAC,IAAI,WAAW,IAAI,OAAO,QAAQ,KAAK,YAAY,CAC7D,MAAK,YAAY,IAAI,IAAI,WAAW;CAExC;;;;;CAMA,AAAO,cAAuB;AAC5B,SAAO,wBAAW,KAAK,QAAQ,WAAW;CAC5C;;;;;CAMA,AAAQ,UAAU,MAAuB;AACvC,SAAO,gBAAgB,KAAK,KAAK;CACnC;;;;;CAMA,AAAQ,aAAa,MAAuB;AAC1C,SACE,mBAAmB,KAAK,KAAK,IAC7B,0BAA0B,KAAK,KAAK,IACpC,2BAA2B,KAAK,KAAI;CAExC;;;;;CAMA,AAAQ,WAAW,MAAuB;AACxC,SAAO,iBAAiB,KAAK,KAAK;CACpC;;;;CAKA,AAAO,QAAQ;AACb,OAAK,SAAS,OAAO;AACrB,OAAK,YAAY,OAAO;CAC1B;;;;;CAMA,MAAa,OAAO;EAClB,MAAM,UAAU,MAAM,8BAAQ,KAAK,QAAQ,YAAY,EACrD,eAAe,KAChB,EAAC;AAEF,OAAK,MAAM,SAAS,SAAS;AAE3B,OAAI,MAAM,KAAK,WAAW,IAAI,CAAE;GAEhC,MAAM,WAAW,oBAAK,KAAK,QAAQ,YAAY,MAAM,KAAK;AAE1D,OAAI,MAAM,aAAa,EAAE;IACvB,MAAM,WAAW,KAAK,WAAW,MAAM,KAAI,GAC3C,MAAM,KAAK,MAAM,GAAG,GAAG,GACvB;AAEA,UAAM,KAAK,SAAS,UAAU,SAAS;GACxC,MACC,OAAM,KAAK,OAAO,MAAM;EAE5B;AAEA,QAAM,KAAK,kBAAkB;AAE7B,SAAO,KAAK,QAAQ;CACtB;;;;;CAMA,AAAO,UAAU;AACf,SAAO;GACL,UAAU,KAAK;GACf,aAAa,KAAK;EACnB;CACH;;;;;CAMA,AAAO,SAAS;AACd,SAAO;GACL,UAAU,OAAO,YAAY,KAAK,SAAS,SAAS,CAAC;GACrD,aAAa,OAAO,YAAY,KAAK,YAAY,SAAS,CAAC;EAC5D;CACH;;;;;CAMA,MAAc,SAAS,MAAc,UAAyB;EAC5D,MAAM,UAAU,MAAM,8BAAQ,MAAM,EAClC,eAAe,KAChB,EAAC;AAEF,OAAK,MAAM,SAAS,SAAS;AAE3B,OAAI,MAAM,KAAK,WAAW,IAAI,CAAE;AAEhC,OAAI,MAAM,QAAQ,EAChB;QAAI,KAAK,UAAU,MAAM,KAAK,IAAI,KAAK,aAAa,MAAM,KAAK,CAC7D,OAAM,KAAK,OAAO,OAAO,SAAS;GACpC,WAEF,MAAM,aAAa,IACnB,KAAK,WAAW,MAAM,KAAK,IAC3B,UACA;IAEE,MAAM,iBAAiB,KAAK,WAAW,MAAM,KAAI,IAChD,EAAE,SAAS,GAAG,MAAM,KAAK,MAAM,GAAG,GAAG,CAAC,IACvC;AACA,UAAM,KAAK,SAAS,oBAAK,MAAM,MAAM,KAAK,EAAE,eAAe;GAC7D;EAGF;CACF;;;;;CAMA,MAAc,OAAO,OAAe,WAA0B,MAAM;EAClE,MAAM,OAAO,MAAM;EACnB,MAAM,OAAO,oBAAK,MAAM,YAAY,MAAM,KAAK;AAE/C,MAAI,KAAK,UAAU,KAAK,EAAE;GACxB,MAAM,UAAmB;IACvB,IAAI,OAAO,YAAY;IACvB,MAAM,wBAAS,MAAM,uBAAQ,KAAK,CAAC;IACnC;IACA;IACA,YAAY,MAAM;IAClB,cAAc,KAAK,kBAAkB,KAAK;IAC1C,aAAa,CAAE;GAChB;AAED,QAAK,SAAS,IAAI,QAAQ,IAAI,QAAQ;EACvC,WAAU,KAAK,aAAa,KAAK,EAAE;GAClC,MAAM,aAAyB;IAC7B,IAAI,OAAO,YAAY;IACvB,MAAM,wBAAS,MAAM,uBAAQ,KAAK,CAAC;IACnC;IACA,cAAc,KAAK,kBAAkB,KAAK;IAC1C,YAAY,MAAM;IAClB,QAAQ,0BAA0B,KAAK,KAAK;IAC5C,SAAS,2BAA2B,KAAK,KAAI,GAC7C,KAAK,MAAM,IAAI,CAAC,MAAM,OACtB;GACD;AAED,QAAK,YAAY,IAAI,WAAW,IAAI,WAAW;EACjD;CACF;;;;;CAMA,AAAQ,mBAAmB;AACzB,OAAK,SAAS,QAAQ,CAAC,YAAY;GACjC,MAAM,cAAc,QAAQ;GAC5B,MAAM,sBAAsB,MAAM,KAAK,KAAK,YAAY,QAAQ,CAAA,CAChE,OAAO,CAAC,eAAe;AACrB,QAAI,WAAW,OAAQ,QAAO;AAC9B,QAAI,WAAW,QAAS,QAAO,WAAW,YAAY,QAAQ;AAC9D,WAAO,WAAW,eAAe;GAClC,EAAC,CACF,IAAI,CAAC,eAAe,WAAW,GAAG;AAElC,WAAQ,cAAc,MAAM,KAC1B,IAAI,IAAI,CAAC,GAAG,QAAQ,aAAa,GAAG,mBAAoB,GACzD;EACF,EAAC;CACJ;;;;;CAMA,AAAQ,kBAAkB,MAAc;EACtC,MAAM,aAAa,yBAAU,KAAK;AAClC,SAAO,WAAW,QAAQ,KAAK,QAAQ,YAAY,GAAG;CACxD;AACF"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
const require_PluginCommon = require('./PluginCommon-
|
|
1
|
+
const require_PluginCommon = require('./PluginCommon-D_Z8Oiic.js');
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/CompilerPlugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* CommandKit plugin that runs at compile time.
|
|
6
|
+
*/
|
|
4
7
|
var CompilerPlugin = class extends require_PluginCommon.PluginCommon {
|
|
8
|
+
/**
|
|
9
|
+
* The type of the plugin, which is Compiler.
|
|
10
|
+
*/
|
|
5
11
|
type = require_PluginCommon.PluginType.Compiler;
|
|
6
12
|
/**
|
|
7
13
|
* Called when transformation is requested to this plugin
|
|
@@ -12,6 +18,11 @@ var CompilerPlugin = class extends require_PluginCommon.PluginCommon {
|
|
|
12
18
|
return null;
|
|
13
19
|
}
|
|
14
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Type guard to check if the given object is a CompilerPlugin.
|
|
23
|
+
* @param plugin The object to check.
|
|
24
|
+
* @returns Boolean indicating whether the object is a CompilerPlugin.
|
|
25
|
+
*/
|
|
15
26
|
function isCompilerPlugin(plugin) {
|
|
16
27
|
return plugin instanceof CompilerPlugin || require_PluginCommon.isPlugin(plugin) && plugin.type === require_PluginCommon.PluginType.Compiler;
|
|
17
28
|
}
|
|
@@ -29,4 +40,4 @@ Object.defineProperty(exports, 'isCompilerPlugin', {
|
|
|
29
40
|
return isCompilerPlugin;
|
|
30
41
|
}
|
|
31
42
|
});
|
|
32
|
-
//# sourceMappingURL=CompilerPlugin-
|
|
43
|
+
//# sourceMappingURL=CompilerPlugin-Bmy4izKz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompilerPlugin-Bmy4izKz.js","names":[],"sources":["../src/plugins/CompilerPlugin.ts"],"sourcesContent":["import {\n isPlugin,\n PluginCommon,\n PluginOptions,\n PluginType,\n} from './PluginCommon';\nimport { MaybeFalsey } from './types';\nimport { CompilerPluginRuntime } from './plugin-runtime/CompilerPluginRuntime';\n\n/**\n * The parameters for the transformation function of a compiler plugin.\n */\nexport interface PluginTransformParameters {\n /**\n * The code to be transformed.\n */\n code: string;\n /**\n * The filename of the code being transformed.\n */\n id: string;\n}\n\nexport interface TransformedResult {\n /**\n * The transformed code.\n */\n code?: string;\n /**\n * The source map for the transformed code, if applicable.\n */\n map?: string | null;\n}\n\n/**\n * CommandKit plugin that runs at compile time.\n */\nexport abstract class CompilerPlugin<\n T extends PluginOptions = PluginOptions,\n> extends PluginCommon<T, CompilerPluginRuntime> {\n /**\n * The type of the plugin, which is Compiler.\n */\n public readonly type = PluginType.Compiler;\n\n /**\n * Called when transformation is requested to this plugin\n * @param params The parameters for the transformation\n * @returns The transformed result\n */\n public async transform(\n params: PluginTransformParameters,\n ): Promise<MaybeFalsey<TransformedResult>> {\n return null;\n }\n}\n\n/**\n * Type guard to check if the given object is a CompilerPlugin.\n * @param plugin The object to check.\n * @returns Boolean indicating whether the object is a CompilerPlugin.\n */\nexport function isCompilerPlugin(plugin: unknown): plugin is CompilerPlugin {\n return (\n plugin instanceof CompilerPlugin ||\n (isPlugin(plugin) && plugin.type === PluginType.Compiler)\n );\n}\n"],"mappings":";;;;;;AAqCA,IAAsB,iBAAtB,cAEA,kCAAuC;;;;CAIrC,AAAgB,OAAO,gCAAW;;;;;;CAOlC,MAAa,UACb,QAC0C;AACxC,SAAO;CACT;AACF;;;;;;AAOA,SAAgB,iBAAiB,QAA2C;AAC1E,QACE,kBAAkB,kBAClB,8BAAS,OAAO,IAAI,OAAO,SAAS,gCAAW;AAEnD"}
|