commandkit 1.0.0-dev.20250614124732 → 1.0.0-dev.20250615124821
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/README.md +1 -2
- package/dist/{CommandKit-CT3K-Cac.js → CommandKit-B3ayOjOW.js} +20 -60
- package/dist/CommandKit-B3ayOjOW.js.map +1 -0
- package/dist/CommandKit.d.ts +1 -1
- package/dist/CommandKit.js +24 -25
- package/dist/{CommandKitEventsChannel-BL_YN3Rm.js → CommandKitEventsChannel-Bgw0XCOl.js} +1 -1
- package/dist/{CommandKitEventsChannel-BL_YN3Rm.js.map → CommandKitEventsChannel-Bgw0XCOl.js.map} +1 -1
- package/dist/{CommandsRouter-DFRh47qD.js → CommandsRouter-CJJ0_WSr.js} +1 -1
- package/dist/{CommandsRouter-DFRh47qD.js.map → CommandsRouter-CJJ0_WSr.js.map} +1 -1
- package/dist/{CompilerPlugin-Bmy4izKz.js → CompilerPlugin-CjoZAAR8.js} +2 -2
- package/dist/{CompilerPlugin-Bmy4izKz.js.map → CompilerPlugin-CjoZAAR8.js.map} +1 -1
- package/dist/{CompilerPluginRuntime-CgVU_gU0.js → CompilerPluginRuntime-OliJW0v-.js} +1 -1
- package/dist/{CompilerPluginRuntime-CgVU_gU0.js.map → CompilerPluginRuntime-OliJW0v-.js.map} +1 -1
- package/dist/{EventInterceptor-DWCHCGRh.js → EventInterceptor-CQ4PBpBJ.js} +1 -1
- package/dist/{EventInterceptor-DWCHCGRh.js.map → EventInterceptor-CQ4PBpBJ.js.map} +1 -1
- package/dist/{EventWorkerContext-DxfS_0fJ.js → EventWorkerContext-CSlD9rbx.js} +1 -1
- package/dist/{EventWorkerContext-DxfS_0fJ.js.map → EventWorkerContext-CSlD9rbx.js.map} +1 -1
- package/dist/{EventsRouter-CqnrlbjN.js → EventsRouter-C_J0M3uO.js} +1 -1
- package/dist/{EventsRouter-CqnrlbjN.js.map → EventsRouter-C_J0M3uO.js.map} +1 -1
- package/dist/{MessageCommandParser-ClkDMI8g.js → MessageCommandParser-Dw8jeqmB.js} +2 -2
- package/dist/{MessageCommandParser-ClkDMI8g.js.map → MessageCommandParser-Dw8jeqmB.js.map} +1 -1
- package/dist/{PluginCommon-D_Z8Oiic.js → PluginCommon-Di1xIa8d.js} +1 -1
- package/dist/{PluginCommon-D_Z8Oiic.js.map → PluginCommon-Di1xIa8d.js.map} +1 -1
- package/dist/{RuntimePlugin-CehKbceZ.js → RuntimePlugin-CBgBLXTG.js} +2 -2
- package/dist/{RuntimePlugin-CehKbceZ.js.map → RuntimePlugin-CBgBLXTG.js.map} +1 -1
- package/dist/analytics/analytics-engine.d.ts +1 -1
- package/dist/analytics/analytics-engine.js +24 -25
- package/dist/analytics/analytics-provider.d.ts +1 -1
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.js +24 -25
- package/dist/app/commands/AppCommandRunner.d.ts +1 -1
- package/dist/app/commands/AppCommandRunner.js +24 -25
- package/dist/app/commands/Context.d.ts +1 -1
- package/dist/app/commands/Context.js +24 -25
- package/dist/app/commands/MessageCommandParser.js +2 -2
- package/dist/app/commands/helpers.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +1 -1
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
- package/dist/app/handlers/AppCommandHandler.js +24 -25
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
- package/dist/app/handlers/AppEventsHandler.js +24 -25
- package/dist/app/index.d.ts +2 -2
- package/dist/app/index.js +28 -28
- package/dist/app/interrupt/signals.d.ts +2 -0
- package/dist/app/interrupt/signals.js +8 -0
- package/dist/app/register/CommandRegistrar.d.ts +1 -1
- package/dist/app/register/CommandRegistrar.js +24 -25
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/EventsRouter.js +1 -1
- package/dist/app/router/index.js +3 -3
- package/dist/{app-process-DKNuvPMz.js → app-process-pMHblAN_.js} +3 -3
- package/dist/{app-process-DKNuvPMz.js.map → app-process-pMHblAN_.js.map} +1 -1
- package/dist/{build-CpZp-wxh.js → build-CfX0NQAn.js} +16 -6
- package/dist/build-CfX0NQAn.js.map +1 -0
- package/dist/cli/app-process.js +5 -5
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +27 -28
- package/dist/cli/common.d.ts +1 -1
- package/dist/cli/common.js +3 -3
- package/dist/cli/development.js +28 -29
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.js +1 -1
- package/dist/cli/generators.js +3 -3
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.js +25 -26
- package/dist/cli/production.js +29 -30
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.js +4 -4
- package/dist/cli/utils.js +1 -1
- package/dist/{common-D11Ax__S.js → common-CfxtI2et.js} +2 -2
- package/dist/{common-D11Ax__S.js.map → common-CfxtI2et.js.map} +1 -1
- package/dist/components/common/EventInterceptor.js +1 -1
- package/dist/components/common/element.js +1 -2
- package/dist/components/common/types.js +1 -1
- package/dist/components/index.js +24 -25
- package/dist/components/v1/button/Button.js +24 -25
- package/dist/components/v1/button/ButtonKit.js +24 -25
- package/dist/components/v1/modal/Modal.js +24 -25
- package/dist/components/v1/modal/ModalKit.js +24 -25
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +24 -25
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +24 -25
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +24 -25
- package/dist/components/v1/select-menu/SelectMenu.js +24 -25
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +24 -25
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +24 -25
- package/dist/config/config.d.ts +1 -1
- package/dist/config/config.js +24 -25
- package/dist/config/default.d.ts +1 -1
- package/dist/config/default.js +24 -25
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.js +24 -25
- package/dist/config/types.d.ts +1 -1
- package/dist/config/utils.d.ts +1 -1
- package/dist/{constants-DDRctWlU.js → constants-BttALJIr.js} +1 -1
- package/dist/{constants-DDRctWlU.js.map → constants-BttALJIr.js.map} +1 -1
- package/dist/{constants-CXwjhIYH.js → constants-CUND8XkG.js} +1 -1
- package/dist/{constants-CXwjhIYH.js.map → constants-CUND8XkG.js.map} +1 -1
- package/dist/context/async-context.d.ts +1 -1
- package/dist/context/async-context.js +24 -25
- package/dist/context/environment.d.ts +1 -1
- package/dist/context/environment.js +24 -25
- package/dist/{element-Cq-LoDjk.js → element-Bak9llw_.js} +1 -4
- package/dist/{element-Cq-LoDjk.js.map → element-Bak9llw_.js.map} +1 -1
- package/dist/{env-DemeP-uq.js → env-_68PRRoA.js} +1 -1
- package/dist/{env-DemeP-uq.js.map → env-_68PRRoA.js.map} +1 -1
- package/dist/{error-codes-CxlUBdF6.js → error-codes-DXOuid4c.js} +3 -2
- package/dist/error-codes-DXOuid4c.js.map +1 -0
- package/dist/events/CommandKitEventsChannel.d.ts +1 -1
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{feature-flags-B1rI-fjI.js → feature-flags-CiXayAME.js} +4 -4
- package/dist/{feature-flags-B1rI-fjI.js.map → feature-flags-CiXayAME.js.map} +1 -1
- package/dist/flags/FlagProvider.d.ts +1 -1
- package/dist/flags/feature-flags.d.ts +1 -1
- package/dist/flags/feature-flags.js +25 -26
- package/dist/flags/store.d.ts +1 -1
- package/dist/flags/store.js +1 -1
- package/dist/{helpers-CnfXqF_k.js → helpers-BUlN3lIz.js} +1 -1
- package/dist/{helpers-CnfXqF_k.js.map → helpers-BUlN3lIz.js.map} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +31 -33
- package/dist/index.js.map +1 -1
- package/dist/{init-Da3dcKxi.js → init-CLXvyIZh.js} +6 -6
- package/dist/{init-Da3dcKxi.js.map → init-CLXvyIZh.js.map} +1 -1
- package/dist/logger/DefaultLogger.js +24 -25
- package/dist/logger/ILogger.js +1 -1
- package/dist/logger/Logger.js +24 -25
- package/dist/plugins/CompilerPlugin.d.ts +1 -1
- package/dist/plugins/CompilerPlugin.js +2 -2
- package/dist/plugins/PluginCommon.d.ts +1 -1
- package/dist/plugins/PluginCommon.js +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +1 -1
- package/dist/plugins/RuntimePlugin.js +2 -2
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +24 -25
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +24 -25
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +24 -25
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +24 -25
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/runtime.js +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/plugins/types.js +1 -1
- package/dist/{resolve-file-url-ifwdwqmq.js → resolve-file-url-DHTQj2mU.js} +1 -1
- package/dist/{resolve-file-url-ifwdwqmq.js.map → resolve-file-url-DHTQj2mU.js.map} +1 -1
- package/dist/signals-BQbEfy3X.d.ts +41 -0
- package/dist/{signals-CSSSZAZ6.js → signals-CMIyUXUZ.js} +34 -3
- package/dist/signals-CMIyUXUZ.js.map +1 -0
- package/dist/{store-x93NXUy_.js → store-CiqLHedg.js} +1 -1
- package/dist/{store-x93NXUy_.js.map → store-CiqLHedg.js.map} +1 -1
- package/dist/{type-checker-BgT1Ukbb.js → type-checker-BLpiXCUL.js} +2 -2
- package/dist/{type-checker-BgT1Ukbb.js.map → type-checker-BLpiXCUL.js.map} +1 -1
- package/dist/{types-package-TSiYacaj.js → types-package-BY7QWDFc.js} +2 -2
- package/dist/{types-package-TSiYacaj.js.map → types-package-BY7QWDFc.js.map} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{utilities-D_MFPmTe.d.ts → utilities-CQUaua43.d.ts} +2 -22
- package/dist/utils/colors.d.ts +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/dev-hooks.d.ts +1 -1
- package/dist/utils/dev-hooks.js +24 -25
- package/dist/utils/error-codes.d.ts +4 -0
- package/dist/utils/error-codes.js +1 -1
- package/dist/utils/resolve-file-url.js +1 -1
- package/dist/utils/types-package.js +2 -2
- package/dist/utils/utilities.d.ts +2 -2
- package/dist/utils/utilities.js +25 -28
- package/dist/utils/warn-unstable.js +25 -3
- package/dist/utils/warn-unstable.js.map +1 -0
- package/dist/{utils-C8a_hMvn.js → utils-DCSnVAZ6.js} +1 -1
- package/dist/{utils-C8a_hMvn.js.map → utils-DCSnVAZ6.js.map} +1 -1
- package/dist/{version-BLJ00Jyk.js → version-B8MRBIes.js} +2 -2
- package/dist/{version-BLJ00Jyk.js.map → version-B8MRBIes.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/CommandKit-CT3K-Cac.js.map +0 -1
- package/dist/app/middleware/signals.d.ts +0 -2
- package/dist/app/middleware/signals.js +0 -6
- package/dist/build-CpZp-wxh.js.map +0 -1
- package/dist/error-codes-CxlUBdF6.js.map +0 -1
- package/dist/signals-CSSSZAZ6.js.map +0 -1
- package/dist/signals-DUoWkeZ7.d.ts +0 -20
- package/dist/warn-unstable-CttBdmlS.js +0 -36
- package/dist/warn-unstable-CttBdmlS.js.map +0 -1
- /package/dist/{ILogger-DucYb0bG.js → ILogger-dQ7Y9X1f.js} +0 -0
- /package/dist/{app-CXCbKsPz.js → app-HN1cVg8J.js} +0 -0
- /package/dist/{router-Dn35v30f.js → router-DHnFRADH.js} +0 -0
- /package/dist/{runtime-D0JnztkU.js → runtime-DB9CiPfe.js} +0 -0
- /package/dist/{types-B5VPP9ig.js → types-CUZOquUl.js} +0 -0
- /package/dist/{types-Bq0EWaM3.js → types-q0Nm882H.js} +0 -0
package/README.md
CHANGED
|
@@ -41,10 +41,9 @@ You can find the full documentation [here](https://commandkit.dev).
|
|
|
41
41
|
|
|
42
42
|
To create a new CommandKit project, you can use the following command:
|
|
43
43
|
|
|
44
|
-
<!-- TODO: use stable version -->
|
|
45
44
|
|
|
46
45
|
```bash
|
|
47
|
-
npm create commandkit
|
|
46
|
+
npm create commandkit
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
This will prompt you to enter few details about your project. Once you have entered the details, you can simply run `commandkit dev` to start the bot application.
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
2
|
const require_colors = require('./colors-Cd4Oz-r-.js');
|
|
3
|
-
const require_error_codes = require('./error-codes-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const require_store = require('./store-x93NXUy_.js');
|
|
3
|
+
const require_error_codes = require('./error-codes-DXOuid4c.js');
|
|
4
|
+
const require_element = require('./element-Bak9llw_.js');
|
|
5
|
+
const require_EventInterceptor = require('./EventInterceptor-CQ4PBpBJ.js');
|
|
6
|
+
const require_constants = require('./constants-BttALJIr.js');
|
|
7
|
+
const require_CompilerPlugin = require('./CompilerPlugin-CjoZAAR8.js');
|
|
8
|
+
const require_RuntimePlugin = require('./RuntimePlugin-CBgBLXTG.js');
|
|
9
|
+
const require_resolve_file_url = require('./resolve-file-url-DHTQj2mU.js');
|
|
10
|
+
const require_types_package = require('./types-package-BY7QWDFc.js');
|
|
11
|
+
const require_EventWorkerContext = require('./EventWorkerContext-CSlD9rbx.js');
|
|
12
|
+
const require_signals = require('./signals-CMIyUXUZ.js');
|
|
13
|
+
const require_constants$1 = require('./constants-CUND8XkG.js');
|
|
14
|
+
const require_MessageCommandParser = require('./MessageCommandParser-Dw8jeqmB.js');
|
|
15
|
+
const require_CommandsRouter = require('./CommandsRouter-CJJ0_WSr.js');
|
|
16
|
+
const require_EventsRouter = require('./EventsRouter-C_J0M3uO.js');
|
|
17
|
+
const require_common = require('./common-CfxtI2et.js');
|
|
18
|
+
const require_CommandKitEventsChannel = require('./CommandKitEventsChannel-Bgw0XCOl.js');
|
|
19
|
+
const require_store = require('./store-CiqLHedg.js');
|
|
21
20
|
const node_events = require_chunk.__toESM(require("node:events"));
|
|
22
21
|
const discord_js = require_chunk.__toESM(require("discord.js"));
|
|
23
22
|
const node_async_hooks = require_chunk.__toESM(require("node:async_hooks"));
|
|
@@ -1723,32 +1722,6 @@ function devOnly(fn) {
|
|
|
1723
1722
|
return f;
|
|
1724
1723
|
}
|
|
1725
1724
|
/**
|
|
1726
|
-
* Custom error for stopping event propagation.
|
|
1727
|
-
*/
|
|
1728
|
-
var StopEventPropagationError = class extends Error {
|
|
1729
|
-
constructor() {
|
|
1730
|
-
super("Event propagation stopped");
|
|
1731
|
-
this.name = "StopEventPropagationError";
|
|
1732
|
-
}
|
|
1733
|
-
};
|
|
1734
|
-
/**
|
|
1735
|
-
* Stops event propagation. This function should be called inside an event handler
|
|
1736
|
-
* to prevent further event handling.
|
|
1737
|
-
* @throws {StopEventPropagationError}
|
|
1738
|
-
* @example // src/app/events/messageCreate/handler.ts
|
|
1739
|
-
* import { stopEvents } from 'commandkit';
|
|
1740
|
-
*
|
|
1741
|
-
* export default async function messageCreateHandler() {
|
|
1742
|
-
* console.log('Message created');
|
|
1743
|
-
* // Stop further event propagation
|
|
1744
|
-
* stopEvents();
|
|
1745
|
-
* }
|
|
1746
|
-
*/
|
|
1747
|
-
function stopEvents() {
|
|
1748
|
-
if (!require_EventWorkerContext.eventWorkerContext.getStore()) throw new Error("stopEvents() may only be called inside an event handler");
|
|
1749
|
-
throw new StopEventPropagationError();
|
|
1750
|
-
}
|
|
1751
|
-
/**
|
|
1752
1725
|
* Creates a simple proxy object that mirrors the target object.
|
|
1753
1726
|
* @param target The target object to proxy.
|
|
1754
1727
|
* @returns The proxied object.
|
|
@@ -3124,7 +3097,7 @@ var AppEventsHandler = class {
|
|
|
3124
3097
|
for (const listener of onListeners) try {
|
|
3125
3098
|
await listener.handler(...args);
|
|
3126
3099
|
} catch (e) {
|
|
3127
|
-
if (e
|
|
3100
|
+
if (require_error_codes.isErrorType(e, require_error_codes.CommandKitErrorCodes.StopEvents)) {
|
|
3128
3101
|
Logger.debug(`Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`);
|
|
3129
3102
|
break;
|
|
3130
3103
|
}
|
|
@@ -3166,7 +3139,7 @@ var AppEventsHandler = class {
|
|
|
3166
3139
|
await listener.handler(...args);
|
|
3167
3140
|
executedOnceListeners.add(listener.handler);
|
|
3168
3141
|
} catch (e) {
|
|
3169
|
-
if (e
|
|
3142
|
+
if (require_error_codes.isErrorType(e, require_error_codes.CommandKitErrorCodes.StopEvents)) {
|
|
3170
3143
|
Logger.debug(`Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`);
|
|
3171
3144
|
broken = true;
|
|
3172
3145
|
}
|
|
@@ -3379,7 +3352,6 @@ var AnalyticsEngine = class {
|
|
|
3379
3352
|
* @param provider The analytics provider to register.
|
|
3380
3353
|
*/
|
|
3381
3354
|
registerProvider(provider) {
|
|
3382
|
-
require_warn_unstable.warnUnstable("analytics");
|
|
3383
3355
|
this.#provider = provider;
|
|
3384
3356
|
}
|
|
3385
3357
|
/**
|
|
@@ -3919,12 +3891,6 @@ Object.defineProperty(exports, 'ShortInput', {
|
|
|
3919
3891
|
return ShortInput;
|
|
3920
3892
|
}
|
|
3921
3893
|
});
|
|
3922
|
-
Object.defineProperty(exports, 'StopEventPropagationError', {
|
|
3923
|
-
enumerable: true,
|
|
3924
|
-
get: function () {
|
|
3925
|
-
return StopEventPropagationError;
|
|
3926
|
-
}
|
|
3927
|
-
});
|
|
3928
3894
|
Object.defineProperty(exports, 'StringSelectMenu', {
|
|
3929
3895
|
enumerable: true,
|
|
3930
3896
|
get: function () {
|
|
@@ -4123,16 +4089,10 @@ Object.defineProperty(exports, 'registerDevHooks', {
|
|
|
4123
4089
|
return registerDevHooks;
|
|
4124
4090
|
}
|
|
4125
4091
|
});
|
|
4126
|
-
Object.defineProperty(exports, 'stopEvents', {
|
|
4127
|
-
enumerable: true,
|
|
4128
|
-
get: function () {
|
|
4129
|
-
return stopEvents;
|
|
4130
|
-
}
|
|
4131
|
-
});
|
|
4132
4092
|
Object.defineProperty(exports, 'useEnvironment', {
|
|
4133
4093
|
enumerable: true,
|
|
4134
4094
|
get: function () {
|
|
4135
4095
|
return useEnvironment;
|
|
4136
4096
|
}
|
|
4137
4097
|
});
|
|
4138
|
-
//# sourceMappingURL=CommandKit-
|
|
4098
|
+
//# sourceMappingURL=CommandKit-B3ayOjOW.js.map
|