commandkit 1.0.0-dev.20250615021934 → 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.d.ts +1 -1
- package/dist/cli/init.js +25 -26
- package/dist/cli/production.d.ts +2 -2
- 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 +4 -4
- 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/{init-_e3eZTUb.d.ts → init-CT348Okf.d.ts} +3 -3
- 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/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-CZ6umS_v.js → version-B8MRBIes.js} +2 -2
- package/dist/{version-CZ6umS_v.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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const require_error_codes = require('./error-codes-
|
|
1
|
+
const require_error_codes = require('./error-codes-DXOuid4c.js');
|
|
2
|
+
const require_EventWorkerContext = require('./EventWorkerContext-CSlD9rbx.js');
|
|
2
3
|
|
|
3
|
-
//#region src/app/
|
|
4
|
+
//#region src/app/interrupt/signals.ts
|
|
4
5
|
/**
|
|
5
6
|
* Cancel upcoming middleware execution.
|
|
6
7
|
* If this is called inside pre-stage middleware, the next run will be the actual command, skipping all other pre-stage middlewares.
|
|
@@ -13,6 +14,14 @@ function exitMiddleware() {
|
|
|
13
14
|
/**
|
|
14
15
|
* Rethrow the error if it is a CommandKit error.
|
|
15
16
|
* @param error The error to rethrow.
|
|
17
|
+
* @example try {
|
|
18
|
+
* doSomething();
|
|
19
|
+
* } catch(e) {
|
|
20
|
+
* // do something
|
|
21
|
+
*
|
|
22
|
+
* // throw the error if it's a commandkit error
|
|
23
|
+
* rethrow(e)
|
|
24
|
+
* }
|
|
16
25
|
*/
|
|
17
26
|
function rethrow(error) {
|
|
18
27
|
if (require_error_codes.isCommandKitError(error)) throw error;
|
|
@@ -23,6 +32,22 @@ function rethrow(error) {
|
|
|
23
32
|
function redirect() {
|
|
24
33
|
throw require_error_codes.createCommandKitError(require_error_codes.CommandKitErrorCodes.ForwardedCommand);
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Stops event propagation. This function should be called inside an event handler
|
|
37
|
+
* to prevent further event handling.
|
|
38
|
+
* @example // src/app/events/messageCreate/handler.ts
|
|
39
|
+
* import { stopEvents } from 'commandkit';
|
|
40
|
+
*
|
|
41
|
+
* export default async function messageCreateHandler() {
|
|
42
|
+
* console.log('Message created');
|
|
43
|
+
* // Stop further event propagation
|
|
44
|
+
* stopEvents();
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
function stopEvents() {
|
|
48
|
+
if (!require_EventWorkerContext.eventWorkerContext.getStore()) throw new Error("stopEvents() may only be called inside an event handler");
|
|
49
|
+
throw require_error_codes.createCommandKitError(require_error_codes.CommandKitErrorCodes.StopEvents);
|
|
50
|
+
}
|
|
26
51
|
|
|
27
52
|
//#endregion
|
|
28
53
|
Object.defineProperty(exports, 'exitMiddleware', {
|
|
@@ -43,4 +68,10 @@ Object.defineProperty(exports, 'rethrow', {
|
|
|
43
68
|
return rethrow;
|
|
44
69
|
}
|
|
45
70
|
});
|
|
46
|
-
|
|
71
|
+
Object.defineProperty(exports, 'stopEvents', {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function () {
|
|
74
|
+
return stopEvents;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=signals-CMIyUXUZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signals-CMIyUXUZ.js","names":[],"sources":["../src/app/interrupt/signals.ts"],"sourcesContent":["import {\n CommandKitErrorCodes,\n createCommandKitError,\n isCommandKitError,\n} from '../../utils/error-codes';\nimport { eventWorkerContext } from '../events/EventWorkerContext';\n\n/**\n * Cancel upcoming middleware execution.\n * If this is called inside pre-stage middleware, the next run will be the actual command, skipping all other pre-stage middlewares.\n * If this is called inside a command itself, it will skip all post-stage middlewares.\n * If this is called inside post-stage middleware, it will skip all other post-stage middlewares.\n */\nexport function exitMiddleware(): never {\n throw createCommandKitError(CommandKitErrorCodes.ExitMiddleware);\n}\n\n/**\n * Rethrow the error if it is a CommandKit error.\n * @param error The error to rethrow.\n * @example try {\n * doSomething();\n * } catch(e) {\n * // do something\n *\n * // throw the error if it's a commandkit error\n * rethrow(e)\n * }\n */\nexport function rethrow(error: unknown): void {\n if (isCommandKitError(error)) throw error;\n}\n\n/**\n * Stops current command assuming it has been redirected to another command.\n */\nexport function redirect(): never {\n throw createCommandKitError(CommandKitErrorCodes.ForwardedCommand);\n}\n\n/**\n * Stops event propagation. This function should be called inside an event handler\n * to prevent further event handling.\n * @example // src/app/events/messageCreate/handler.ts\n * import { stopEvents } from 'commandkit';\n *\n * export default async function messageCreateHandler() {\n * console.log('Message created');\n * // Stop further event propagation\n * stopEvents();\n * }\n */\nexport function stopEvents(): never {\n if (!eventWorkerContext.getStore()) {\n throw new Error('stopEvents() may only be called inside an event handler');\n }\n\n throw createCommandKitError(CommandKitErrorCodes.StopEvents);\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,iBAAwB;AACtC,OAAM,0CAAsB,yCAAqB,eAAe;AAClE;;;;;;;;;;;;;AAcA,SAAgB,QAAQ,OAAsB;AAC5C,KAAI,sCAAkB,MAAM,CAAE,OAAM;AACtC;;;;AAKA,SAAgB,WAAkB;AAChC,OAAM,0CAAsB,yCAAqB,iBAAiB;AACpE;;;;;;;;;;;;;AAcA,SAAgB,aAAoB;AAClC,MAAK,8CAAmB,UAAU,CAChC,OAAM,IAAI,MAAM;AAGlB,OAAM,0CAAsB,yCAAqB,WAAW;AAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-
|
|
1
|
+
{"version":3,"file":"store-CiqLHedg.js","names":[],"sources":["../src/flags/store.ts"],"sourcesContent":["import type { FeatureFlag } from './feature-flags';\nimport { Collection } from 'discord.js';\n\n/**\n * Represents a store for feature flags.\n * This store extends the Collection class to manage feature flags by their keys.\n */\nexport class FlagStore extends Collection<string, FeatureFlag<any, any>> {}\n"],"mappings":";;;;;;;;AAOA,IAAa,YAAb,cAA+B,sBAA0C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
2
|
const require_colors = require('./colors-Cd4Oz-r-.js');
|
|
3
|
-
const require_common = require('./common-
|
|
3
|
+
const require_common = require('./common-CfxtI2et.js');
|
|
4
4
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
5
5
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
6
|
|
|
@@ -85,4 +85,4 @@ Object.defineProperty(exports, 'performTypeCheck', {
|
|
|
85
85
|
return performTypeCheck;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
//# sourceMappingURL=type-checker-
|
|
88
|
+
//# sourceMappingURL=type-checker-BLpiXCUL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-checker-
|
|
1
|
+
{"version":3,"file":"type-checker-BLpiXCUL.js","names":[],"sources":["../src/cli/type-checker.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { loadTypeScript } from './common';\nimport { join, relative } from 'node:path';\nimport colors from '../utils/colors';\n\nconst TS_NOT_FOUND_ERR = `TypeScript must be installed in order to use the type checker. Please install it using \\`npm install typescript\\` or \\`yarn add typescript\\``;\n\n/**\n * Formats a TypeScript diagnostic message in a pretty, readable format\n * @private\n * @internal\n */\nfunction formatDiagnostic(\n ts: typeof import('typescript'),\n diagnostic: import('typescript').Diagnostic,\n cwd: string,\n): string {\n const messageText = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n '\\n',\n );\n\n if (!diagnostic.file) {\n return `${colors.red('error')}: ${messageText}`;\n }\n\n const { line, character } = ts.getLineAndCharacterOfPosition(\n diagnostic.file,\n diagnostic.start!,\n );\n const fileName = relative(cwd, diagnostic.file.fileName);\n const position = `${line + 1}:${character + 1}`;\n const errorCode = diagnostic.code ? `TS${diagnostic.code}` : '';\n\n // Format the error message nicely\n return [\n `${colors.bold(colors.cyan(fileName))}:${colors.bold(colors.yellow(position))} - ${colors.red('error')} ${colors.gray(errorCode)}`,\n `${messageText}`,\n ].join('\\n');\n}\n\n/**\n * Performs a type check on the project using TypeScript.\n * @param path The project root or cwd\n * @private\n * @internal\n */\nexport async function performTypeCheck(path: string) {\n const tsconfigPath = join(path, 'tsconfig.json');\n\n if (!existsSync(tsconfigPath)) return;\n\n const ts = await loadTypeScript(TS_NOT_FOUND_ERR);\n\n // Format host for error reporting\n const formatHost = {\n getCanonicalFileName: (path: string) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n };\n\n // Read tsconfig.json\n const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n\n if (configFile.error) {\n console.error(\n colors.red(\n `Error reading tsconfig.json: ${ts.formatDiagnostic(configFile.error, formatHost)}`,\n ),\n );\n process.exit(1);\n }\n\n // Parse the config file\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n path,\n );\n\n // Force noEmit to true as we only want type checking\n parsedConfig.options.noEmit = true;\n\n // Create a program\n const program = ts.createProgram({\n rootNames: parsedConfig.fileNames,\n options: parsedConfig.options,\n projectReferences: parsedConfig.projectReferences,\n });\n\n // Get the diagnostics\n const diagnostics = [\n ...program.getOptionsDiagnostics(),\n ...program.getGlobalDiagnostics(),\n ...program.getSyntacticDiagnostics(),\n ...program.getSemanticDiagnostics(),\n ];\n\n // Report any errors\n if (diagnostics.length > 0) {\n console.log('');\n console.error(\n colors.bold(\n colors.red('Type checking failed with the following errors:'),\n ),\n );\n console.log('');\n\n // Group diagnostics by file for better readability\n const byFile = new Map<string, import('typescript').Diagnostic[]>();\n\n for (const diagnostic of diagnostics) {\n const fileName = diagnostic.file ? diagnostic.file.fileName : 'Global';\n if (!byFile.has(fileName)) {\n byFile.set(fileName, []);\n }\n byFile.get(fileName)!.push(diagnostic);\n }\n\n // Pretty-print each diagnostic\n const totalErrors = diagnostics.length;\n let counter = 0;\n\n for (const [_, fileDiags] of byFile) {\n for (const diagnostic of fileDiags) {\n counter++;\n console.log(formatDiagnostic(ts, diagnostic, path));\n // Add separator between errors for better readability, except for the last one\n if (counter < totalErrors) {\n console.log('');\n }\n }\n }\n\n console.log('');\n console.error(\n colors.bold(\n colors.red(`Found ${totalErrors} error${totalErrors > 1 ? 's' : ''}`),\n ),\n );\n console.log('');\n\n process.exit(1);\n }\n\n console.log(colors.green('✓ Type checking completed successfully.'));\n}\n"],"mappings":";;;;;;;AAKA,MAAM,oBAAoB;;;;;;AAO1B,SAAS,iBACT,IACA,YACA,KACS;CACP,MAAM,cAAc,GAAG,6BACrB,WAAW,aACX,KACD;AAED,MAAK,WAAW,KACd,SAAQ,EAAE,8BAAO,IAAI,QAAQ,CAAC,IAAI,YAAY;CAGhD,MAAM,EAAE,MAAM,WAAW,GAAG,GAAG,8BAC7B,WAAW,MACX,WAAW,MACZ;CACD,MAAM,WAAW,wBAAS,KAAK,WAAW,KAAK,SAAS;CACxD,MAAM,YAAY,EAAE,OAAO,EAAE,GAAG,YAAY,EAAE;CAC9C,MAAM,YAAY,WAAW,QAAQ,IAAI,WAAW,KAAK,IAAI;AAG7D,QAAO,EACN,EAAE,8BAAO,KAAK,8BAAO,KAAK,SAAS,CAAC,CAAC,GAAG,8BAAO,KAAK,8BAAO,OAAO,SAAS,CAAC,CAAC,KAAK,8BAAO,IAAI,QAAQ,CAAC,GAAG,8BAAO,KAAK,UAAU,CAAC,IAChI,EAAE,YAAY,CAAE,EACjB,KAAK,KAAK;AACZ;;;;;;;AAQA,eAAsB,iBAAiB,MAAc;CACnD,MAAM,eAAe,oBAAK,MAAM,gBAAgB;AAEhD,MAAK,wBAAW,aAAa,CAAE;CAE/B,MAAM,KAAK,MAAM,8BAAe,iBAAiB;CAGjD,MAAM,aAAa;EACjB,sBAAsB,CAAC,WAAiB;EACxC,qBAAqB,GAAG,IAAI;EAC5B,YAAY,MAAM,GAAG,IAAI;CAC1B;CAGD,MAAM,aAAa,GAAG,eAAe,cAAc,GAAG,IAAI,SAAS;AAEnE,KAAI,WAAW,OAAO;AACpB,UAAQ,MACN,8BAAO,KACJ,+BAA+B,GAAG,iBAAiB,WAAW,OAAO,WAAW,CAAC,EACnF,CACF;AACD,UAAQ,KAAK,EAAE;CACjB;CAGA,MAAM,eAAe,GAAG,2BACtB,WAAW,QACX,GAAG,KACH,KACD;AAGD,cAAa,QAAQ,SAAS;CAG9B,MAAM,UAAU,GAAG,cAAc;EAC/B,WAAW,aAAa;EACxB,SAAS,aAAa;EACtB,mBAAmB,aAAa;CACjC,EAAC;CAGF,MAAM,cAAc;EACpB,GAAG,QAAQ,uBAAuB;EAClC,GAAG,QAAQ,sBAAsB;EACjC,GAAG,QAAQ,yBAAyB;EACpC,GAAG,QAAQ,wBAAwB;CAAC;AAIpC,KAAI,YAAY,SAAS,GAAG;AAC1B,UAAQ,IAAI,GAAG;AACf,UAAQ,MACN,8BAAO,KACL,8BAAO,IAAI,kDAAkD,CAC9D,CACF;AACD,UAAQ,IAAI,GAAG;EAGf,MAAM,yBAAS,IAAI;AAEnB,OAAK,MAAM,cAAc,aAAa;GACpC,MAAM,WAAW,WAAW,OAAO,WAAW,KAAK,WAAW;AAC9D,QAAK,OAAO,IAAI,SAAS,CACvB,QAAO,IAAI,UAAU,CAAE,EAAC;AAE1B,UAAO,IAAI,SAAS,CAAE,KAAK,WAAW;EACxC;EAGA,MAAM,cAAc,YAAY;EAChC,IAAI,UAAU;AAEd,OAAK,MAAM,CAAC,GAAG,UAAU,IAAI,OAC3B,MAAK,MAAM,cAAc,WAAW;AAClC;AACA,WAAQ,IAAI,iBAAiB,IAAI,YAAY,KAAK,CAAC;AAEnD,OAAI,UAAU,YACZ,SAAQ,IAAI,GAAG;EAEnB;AAGF,UAAQ,IAAI,GAAG;AACf,UAAQ,MACN,8BAAO,KACL,8BAAO,KAAK,QAAQ,YAAY,QAAQ,cAAc,IAAI,MAAM,GAAG,EAAE,CACtE,CACF;AACD,UAAQ,IAAI,GAAG;AAEf,UAAQ,KAAK,EAAE;CACjB;AAEA,SAAQ,IAAI,8BAAO,MAAM,0CAA0C,CAAC;AACtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
const require_constants = require('./constants-
|
|
2
|
+
const require_constants = require('./constants-BttALJIr.js');
|
|
3
3
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
@@ -69,4 +69,4 @@ Object.defineProperty(exports, 'rewriteCommandDeclaration', {
|
|
|
69
69
|
return rewriteCommandDeclaration;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
//# sourceMappingURL=types-package-
|
|
72
|
+
//# sourceMappingURL=types-package-BY7QWDFc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-package-
|
|
1
|
+
{"version":3,"file":"types-package-BY7QWDFc.js","names":[],"sources":["../src/utils/types-package.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { COMMANDKIT_IS_DEV } from './constants';\nimport { existsSync } from 'node:fs';\n\n/**\n * @private\n */\nexport async function generateTypesPackage(force = false) {\n const location = join(process.cwd(), 'node_modules', 'commandkit-types');\n if (!COMMANDKIT_IS_DEV && !force) return location;\n const packageJSON = join(location, 'package.json');\n const index = join(location, 'index.js');\n const types = join(location, 'index.d.ts');\n const command = join(location, 'command.d.ts');\n\n const packageJSONContent = {\n name: 'commandkit-types',\n version: '1.0.0',\n description: 'CommandKit types package',\n type: 'commonjs',\n main: 'index.js',\n types: 'index.d.ts',\n };\n\n const indexContent = `module.exports = {};`;\n\n // Restructuring the type declarations to properly extend rather than replace types\n const typesContent = `// Main types index file - imports all type declarations\nimport './command';\nexport {};\n`;\n\n // Properly set up command types to extend the CommandTypeData interface\n const commandTypesContent = `// Auto-generated command types\n export {};\ndeclare module 'commandkit' {\n type CommandTypeData = string\n}`;\n\n await mkdir(location, { recursive: true }).catch(() => {});\n await writeFile(packageJSON, JSON.stringify(packageJSONContent, null, 2));\n await writeFile(index, indexContent);\n await writeFile(types, typesContent);\n await writeFile(command, commandTypesContent);\n\n return location;\n}\n\n/**\n * @private\n */\nexport async function rewriteCommandDeclaration(data: string) {\n const commandTypesContent = `// Auto-generated command types\n declare module 'commandkit' {\n ${data}\n}\n export {};\n`;\n\n const location = join(process.cwd(), 'node_modules', 'commandkit-types');\n\n if (!existsSync(location)) return;\n\n const type = join(location, 'command.d.ts');\n\n await writeFile(type, commandTypesContent, { encoding: 'utf-8' });\n}\n"],"mappings":";;;;;;;;;;AAQA,eAAsB,qBAAqB,QAAQ,OAAO;CACxD,MAAM,WAAW,oBAAK,QAAQ,KAAK,EAAE,gBAAgB,mBAAmB;AACxE,MAAK,wCAAsB,MAAO,QAAO;CACzC,MAAM,cAAc,oBAAK,UAAU,eAAe;CAClD,MAAM,QAAQ,oBAAK,UAAU,WAAW;CACxC,MAAM,QAAQ,oBAAK,UAAU,aAAa;CAC1C,MAAM,UAAU,oBAAK,UAAU,eAAe;CAE9C,MAAM,qBAAqB;EACzB,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,MAAM;EACN,OAAO;CACR;CAED,MAAM,gBAAgB;CAGtB,MAAM,gBAAgB;;;;CAMtB,MAAM,uBAAuB;;;;;AAM7B,OAAM,4BAAM,UAAU,EAAE,WAAW,KAAM,EAAC,CAAC,MAAM,MAAM,CAAE,EAAC;AAC1D,OAAM,gCAAU,aAAa,KAAK,UAAU,oBAAoB,MAAM,EAAE,CAAC;AACzE,OAAM,gCAAU,OAAO,aAAa;AACpC,OAAM,gCAAU,OAAO,aAAa;AACpC,OAAM,gCAAU,SAAS,oBAAoB;AAE7C,QAAO;AACT;;;;AAKA,eAAsB,0BAA0B,MAAc;CAC5D,MAAM,uBAAuB;;MAEzB,KAAI;;;;CAKR,MAAM,WAAW,oBAAK,QAAQ,KAAK,EAAE,gBAAgB,mBAAmB;AAExE,MAAK,wBAAW,SAAS,CAAE;CAE3B,MAAM,OAAO,oBAAK,UAAU,eAAe;AAE3C,OAAM,gCAAU,MAAM,qBAAqB,EAAE,UAAU,QAAS,EAAC;AACnE"}
|
package/dist/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import "./text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "./index-Dw5cCt-A.js";
|
|
24
24
|
import "./index-E7Wvm5uX.js";
|
|
25
25
|
import "./MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "./signals-
|
|
26
|
+
import "./signals-BQbEfy3X.js";
|
|
27
27
|
import "./helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "./CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "./EventsRouter-BacqK6z3.js";
|
|
@@ -62,26 +62,6 @@ declare function JsonSerialize<R = any>(value: any, defaultValue?: R): R;
|
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
64
|
declare function devOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
65
|
-
/**
|
|
66
|
-
* Custom error for stopping event propagation.
|
|
67
|
-
*/
|
|
68
|
-
declare class StopEventPropagationError extends Error {
|
|
69
|
-
constructor();
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Stops event propagation. This function should be called inside an event handler
|
|
73
|
-
* to prevent further event handling.
|
|
74
|
-
* @throws {StopEventPropagationError}
|
|
75
|
-
* @example // src/app/events/messageCreate/handler.ts
|
|
76
|
-
* import { stopEvents } from 'commandkit';
|
|
77
|
-
*
|
|
78
|
-
* export default async function messageCreateHandler() {
|
|
79
|
-
* console.log('Message created');
|
|
80
|
-
* // Stop further event propagation
|
|
81
|
-
* stopEvents();
|
|
82
|
-
* }
|
|
83
|
-
*/
|
|
84
|
-
declare function stopEvents(): never;
|
|
85
65
|
/**
|
|
86
66
|
* Represents a simple proxy object that mirrors a target object.
|
|
87
67
|
*/
|
|
@@ -103,5 +83,5 @@ interface SimpleProxy<T extends object> {
|
|
|
103
83
|
*/
|
|
104
84
|
declare function createProxy<T extends object>(target: T): SimpleProxy<T>;
|
|
105
85
|
//#endregion
|
|
106
|
-
export { JsonSerialize, SimpleProxy,
|
|
107
|
-
//# sourceMappingURL=utilities-
|
|
86
|
+
export { JsonSerialize, SimpleProxy, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories };
|
|
87
|
+
//# sourceMappingURL=utilities-CQUaua43.d.ts.map
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_constants = require('../constants-
|
|
1
|
+
const require_constants = require('../constants-BttALJIr.js');
|
|
2
2
|
|
|
3
3
|
exports.COMMANDKIT_BOOTSTRAP_MODE = require_constants.COMMANDKIT_BOOTSTRAP_MODE;
|
|
4
4
|
exports.COMMANDKIT_IS_CLI = require_constants.COMMANDKIT_IS_CLI;
|
|
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
|
|
|
23
23
|
import "../index-Dw5cCt-A.js";
|
|
24
24
|
import "../index-E7Wvm5uX.js";
|
|
25
25
|
import "../MessageCommandParser-ROLibZPX.js";
|
|
26
|
-
import "../signals-
|
|
26
|
+
import "../signals-BQbEfy3X.js";
|
|
27
27
|
import "../helpers-Wg6P5fRQ.js";
|
|
28
28
|
import "../CommandsRouter-CoOA7hkf.js";
|
|
29
29
|
import "../EventsRouter-BacqK6z3.js";
|
package/dist/utils/dev-hooks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-DXOuid4c.js');
|
|
4
|
+
const require_CommandKit = require('../CommandKit-B3ayOjOW.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-DCjIgp-B.js');
|
|
@@ -11,28 +11,27 @@ require('../section-CuYr0Inu.js');
|
|
|
11
11
|
require('../separator-DLdWBjSN.js');
|
|
12
12
|
require('../text-display--p2-BoUa.js');
|
|
13
13
|
require('../v2-DofkPKHs.js');
|
|
14
|
-
require('../
|
|
15
|
-
require('../
|
|
16
|
-
require('../
|
|
17
|
-
require('../
|
|
18
|
-
require('../
|
|
19
|
-
require('../
|
|
20
|
-
require('../
|
|
21
|
-
require('../
|
|
22
|
-
require('../
|
|
23
|
-
require('../
|
|
24
|
-
require('../
|
|
25
|
-
require('../
|
|
26
|
-
require('../
|
|
27
|
-
require('../
|
|
28
|
-
require('../
|
|
29
|
-
require('../
|
|
30
|
-
require('../
|
|
31
|
-
require('../
|
|
32
|
-
require('../
|
|
33
|
-
require('../
|
|
34
|
-
require('../
|
|
35
|
-
require('../
|
|
36
|
-
require('../store-x93NXUy_.js');
|
|
14
|
+
require('../element-Bak9llw_.js');
|
|
15
|
+
require('../types-CUZOquUl.js');
|
|
16
|
+
require('../EventInterceptor-CQ4PBpBJ.js');
|
|
17
|
+
require('../constants-BttALJIr.js');
|
|
18
|
+
require('../PluginCommon-Di1xIa8d.js');
|
|
19
|
+
require('../CompilerPlugin-CjoZAAR8.js');
|
|
20
|
+
require('../RuntimePlugin-CBgBLXTG.js');
|
|
21
|
+
require('../types-q0Nm882H.js');
|
|
22
|
+
require('../CompilerPluginRuntime-OliJW0v-.js');
|
|
23
|
+
require('../runtime-DB9CiPfe.js');
|
|
24
|
+
require('../resolve-file-url-DHTQj2mU.js');
|
|
25
|
+
require('../types-package-BY7QWDFc.js');
|
|
26
|
+
require('../EventWorkerContext-CSlD9rbx.js');
|
|
27
|
+
require('../signals-CMIyUXUZ.js');
|
|
28
|
+
require('../constants-CUND8XkG.js');
|
|
29
|
+
require('../MessageCommandParser-Dw8jeqmB.js');
|
|
30
|
+
require('../CommandsRouter-CJJ0_WSr.js');
|
|
31
|
+
require('../EventsRouter-C_J0M3uO.js');
|
|
32
|
+
require('../router-DHnFRADH.js');
|
|
33
|
+
require('../common-CfxtI2et.js');
|
|
34
|
+
require('../CommandKitEventsChannel-Bgw0XCOl.js');
|
|
35
|
+
require('../store-CiqLHedg.js');
|
|
37
36
|
|
|
38
37
|
exports.registerDevHooks = require_CommandKit.registerDevHooks;
|
|
@@ -19,6 +19,10 @@ declare const CommandKitErrorCodes: {
|
|
|
19
19
|
* Error code for plugin capture handle.
|
|
20
20
|
*/
|
|
21
21
|
readonly PluginCaptureHandle: symbol;
|
|
22
|
+
/**
|
|
23
|
+
* Error code for event interruption signal
|
|
24
|
+
*/
|
|
25
|
+
readonly StopEvents: symbol;
|
|
22
26
|
};
|
|
23
27
|
/**
|
|
24
28
|
* The type for CommandKit errors.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_error_codes = require('../error-codes-
|
|
1
|
+
const require_error_codes = require('../error-codes-DXOuid4c.js');
|
|
2
2
|
|
|
3
3
|
exports.CommandKitErrorCodes = require_error_codes.CommandKitErrorCodes;
|
|
4
4
|
exports.createCommandKitError = require_error_codes.createCommandKitError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('../constants-
|
|
2
|
-
const require_types_package = require('../types-package-
|
|
1
|
+
require('../constants-BttALJIr.js');
|
|
2
|
+
const require_types_package = require('../types-package-BY7QWDFc.js');
|
|
3
3
|
|
|
4
4
|
exports.generateTypesPackage = require_types_package.generateTypesPackage;
|
|
5
5
|
exports.rewriteCommandDeclaration = require_types_package.rewriteCommandDeclaration;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { JsonSerialize, SimpleProxy,
|
|
2
|
-
export { JsonSerialize, SimpleProxy,
|
|
1
|
+
import { JsonSerialize, SimpleProxy, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories } from "../utilities-CQUaua43.js";
|
|
2
|
+
export { JsonSerialize, SimpleProxy, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories };
|
package/dist/utils/utilities.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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-DXOuid4c.js');
|
|
4
|
+
const require_CommandKit = require('../CommandKit-B3ayOjOW.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-DCjIgp-B.js');
|
|
@@ -11,37 +11,34 @@ require('../section-CuYr0Inu.js');
|
|
|
11
11
|
require('../separator-DLdWBjSN.js');
|
|
12
12
|
require('../text-display--p2-BoUa.js');
|
|
13
13
|
require('../v2-DofkPKHs.js');
|
|
14
|
-
require('../
|
|
15
|
-
require('../
|
|
16
|
-
require('../
|
|
17
|
-
require('../
|
|
18
|
-
require('../
|
|
19
|
-
require('../
|
|
20
|
-
require('../
|
|
21
|
-
require('../
|
|
22
|
-
require('../
|
|
23
|
-
require('../
|
|
24
|
-
require('../
|
|
25
|
-
require('../
|
|
26
|
-
require('../
|
|
27
|
-
require('../
|
|
28
|
-
require('../
|
|
29
|
-
require('../
|
|
30
|
-
require('../
|
|
31
|
-
require('../
|
|
32
|
-
require('../
|
|
33
|
-
require('../
|
|
34
|
-
require('../
|
|
35
|
-
require('../
|
|
36
|
-
require('../store-x93NXUy_.js');
|
|
14
|
+
require('../element-Bak9llw_.js');
|
|
15
|
+
require('../types-CUZOquUl.js');
|
|
16
|
+
require('../EventInterceptor-CQ4PBpBJ.js');
|
|
17
|
+
require('../constants-BttALJIr.js');
|
|
18
|
+
require('../PluginCommon-Di1xIa8d.js');
|
|
19
|
+
require('../CompilerPlugin-CjoZAAR8.js');
|
|
20
|
+
require('../RuntimePlugin-CBgBLXTG.js');
|
|
21
|
+
require('../types-q0Nm882H.js');
|
|
22
|
+
require('../CompilerPluginRuntime-OliJW0v-.js');
|
|
23
|
+
require('../runtime-DB9CiPfe.js');
|
|
24
|
+
require('../resolve-file-url-DHTQj2mU.js');
|
|
25
|
+
require('../types-package-BY7QWDFc.js');
|
|
26
|
+
require('../EventWorkerContext-CSlD9rbx.js');
|
|
27
|
+
require('../signals-CMIyUXUZ.js');
|
|
28
|
+
require('../constants-CUND8XkG.js');
|
|
29
|
+
require('../MessageCommandParser-Dw8jeqmB.js');
|
|
30
|
+
require('../CommandsRouter-CJJ0_WSr.js');
|
|
31
|
+
require('../EventsRouter-C_J0M3uO.js');
|
|
32
|
+
require('../router-DHnFRADH.js');
|
|
33
|
+
require('../common-CfxtI2et.js');
|
|
34
|
+
require('../CommandKitEventsChannel-Bgw0XCOl.js');
|
|
35
|
+
require('../store-CiqLHedg.js');
|
|
37
36
|
|
|
38
37
|
exports.JsonSerialize = require_CommandKit.JsonSerialize;
|
|
39
|
-
exports.StopEventPropagationError = require_CommandKit.StopEventPropagationError;
|
|
40
38
|
exports.createProxy = require_CommandKit.createProxy;
|
|
41
39
|
exports.debounce = require_CommandKit.debounce;
|
|
42
40
|
exports.defer = require_CommandKit.defer;
|
|
43
41
|
exports.devOnly = require_CommandKit.devOnly;
|
|
44
42
|
exports.findAppDirectory = require_CommandKit.findAppDirectory;
|
|
45
43
|
exports.getCurrentDirectory = require_CommandKit.getCurrentDirectory;
|
|
46
|
-
exports.getSourceDirectories = require_CommandKit.getSourceDirectories;
|
|
47
|
-
exports.stopEvents = require_CommandKit.stopEvents;
|
|
44
|
+
exports.getSourceDirectories = require_CommandKit.getSourceDirectories;
|
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
const require_warn_unstable = require('../warn-unstable-CttBdmlS.js');
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
//#region src/utils/warn-unstable.ts
|
|
3
|
+
const WARNED_KEYS = /* @__PURE__ */ new Set();
|
|
4
|
+
/**
|
|
5
|
+
* Emit a warning message to the console as a CommandKitWarning.
|
|
6
|
+
* @param message - The warning message to emit.
|
|
7
|
+
* @param code - The warning code (default is 'CommandKitWarning').
|
|
8
|
+
*/
|
|
9
|
+
function emitWarning(message, code = "CommandKitWarning") {
|
|
10
|
+
process.emitWarning(message, { code });
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Emit a warning for unstable features in CommandKit.
|
|
14
|
+
* @param name - The name of the unstable feature.
|
|
15
|
+
* @example warnUnstable('MyUnstableFeature');
|
|
16
|
+
*/
|
|
17
|
+
function warnUnstable(name) {
|
|
18
|
+
if (WARNED_KEYS.has(name)) return;
|
|
19
|
+
WARNED_KEYS.add(name);
|
|
20
|
+
emitWarning(`${name} is unstable and may change in future versions.`, "CommandKitUnstableWarning");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.emitWarning = emitWarning;
|
|
25
|
+
exports.warnUnstable = warnUnstable;
|
|
26
|
+
//# sourceMappingURL=warn-unstable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warn-unstable.js","names":[],"sources":["../../src/utils/warn-unstable.ts"],"sourcesContent":["const WARNED_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}\n"],"mappings":";;AAAA,MAAM,8BAAc,IAAI;;;;;;AAOxB,SAAgB,YAAY,SAAiB,OAAO,qBAAqB;AACvE,SAAQ,YAAY,SAAS,EAAE,KAAM,EAAC;AACxC;;;;;;AAOA,SAAgB,aAAa,MAAc;AACzC,KAAI,YAAY,IAAI,KAAK,CAAE;AAE3B,aAAY,IAAI,KAAK;AAErB,cACG,EAAE,KAAK,kDACR,4BACD;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-DCSnVAZ6.js","names":[],"sources":["../src/cli/utils.ts"],"sourcesContent":["import type { Ora } from 'ora';\n\nlet ora: typeof import('ora') | undefined;\n\n/**\n * @private\n * @internal\n */\nexport async function createSpinner(text: string): Promise<Ora> {\n if (!ora) {\n ora = await import('ora');\n }\n\n return (ora.default || ora)({\n text,\n color: 'cyan',\n });\n}\n"],"mappings":";;AAEA,IAAI;;;;;AAMJ,eAAsB,cAAc,MAA4B;AAC9D,MAAK,IACH,OAAM,MAAM,OAAO;AAGrB,QAAO,CAAC,IAAI,WAAW,KAAK;EAC1B;EACA,OAAO;CACR,EAAC;AACJ"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* The current version of CommandKit.
|
|
8
8
|
*/
|
|
9
|
-
const version = "1.0.0-dev.
|
|
9
|
+
const version = "1.0.0-dev.20250615124821";
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
12
|
Object.defineProperty(exports, 'version', {
|
|
@@ -15,4 +15,4 @@ Object.defineProperty(exports, 'version', {
|
|
|
15
15
|
return version;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
//# sourceMappingURL=version-
|
|
18
|
+
//# sourceMappingURL=version-B8MRBIes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-
|
|
1
|
+
{"version":3,"file":"version-B8MRBIes.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"}
|
package/dist/version.js
CHANGED
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.0.0-dev.
|
|
4
|
+
"version": "1.0.0-dev.20250615124821",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"tsx": "^4.19.2",
|
|
137
137
|
"typescript": "^5.7.3",
|
|
138
138
|
"vitest": "^3.0.5",
|
|
139
|
-
"tsconfig": "0.0.0-dev.
|
|
139
|
+
"tsconfig": "0.0.0-dev.20250615124821"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
142
142
|
"discord.js": "^14"
|