commandkit 1.2.0-dev.20250819020008 → 1.2.0-dev.20250820015805
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/{EventWorkerContext-C7CG7hIP.d.ts → EventWorkerContext-DiMpRt1P.d.ts} +2 -2
- package/dist/analytics/analytics-engine.d.ts +1 -1
- package/dist/analytics/analytics-engine.js +1 -1
- package/dist/analytics/analytics-provider.d.ts +1 -1
- package/dist/analytics/utils.js +1 -1
- package/dist/{analytics-engine-nkyqvYAE.d.ts → analytics-engine-Ddw9axi4.d.ts} +82 -10
- package/dist/app/commands/AppCommandRunner.d.ts +1 -1
- package/dist/app/commands/AppCommandRunner.js +1 -1
- package/dist/app/commands/Context.d.ts +1 -1
- package/dist/app/commands/Context.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +2 -2
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
- package/dist/app/handlers/AppCommandHandler.js +1 -1
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
- package/dist/app/handlers/AppEventsHandler.js +1 -1
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +1 -1
- package/dist/app/middlewares/permissions.d.ts +42 -0
- package/dist/app/middlewares/permissions.js +38 -0
- package/dist/app/register/CommandRegistrar.d.ts +1 -1
- package/dist/app/register/CommandRegistrar.js +1 -1
- package/dist/{build-BoGqWPIS.js → build-BmDzPe4V.js} +2 -2
- package/dist/{build-BoGqWPIS.js.map → build-BmDzPe4V.js.map} +1 -1
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +2 -2
- package/dist/cli/common.d.ts +1 -1
- package/dist/cli/development.js +2 -2
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/production.js +2 -2
- package/dist/{commandkit-5VMG2thU.js → commandkit-C0BuNRSN.js} +185 -29
- package/dist/commandkit-C0BuNRSN.js.map +1 -0
- package/dist/commandkit.d.ts +1 -1
- package/dist/commandkit.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/v1/button/Button.js +1 -1
- package/dist/components/v1/button/ButtonKit.js +1 -1
- package/dist/components/v1/modal/Modal.js +1 -1
- package/dist/components/v1/modal/ModalKit.js +1 -1
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/SelectMenu.js +1 -1
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +1 -1
- package/dist/config/config.d.ts +2 -2
- package/dist/config/config.js +1 -1
- package/dist/config/default.d.ts +1 -1
- package/dist/config/default.js +1 -1
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.js +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/config/utils.d.ts +1 -1
- package/dist/{config-C1msSu1G.d.ts → config-C4nHXErw.d.ts} +2 -2
- package/dist/context/async-context.d.ts +1 -1
- package/dist/context/async-context.js +1 -1
- package/dist/context/environment.d.ts +1 -1
- package/dist/context/environment.js +1 -1
- package/dist/events/CommandKitEventsChannel.d.ts +1 -1
- package/dist/{feature-flags-C44dggkN.js → feature-flags-BZMExGfA.js} +2 -2
- package/dist/{feature-flags-C44dggkN.js.map → feature-flags-BZMExGfA.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 +2 -2
- package/dist/flags/store.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{init-ZjceQTSt.js → init-D20FhDjn.js} +2 -2
- package/dist/{init-ZjceQTSt.js.map → init-D20FhDjn.js.map} +1 -1
- package/dist/logger/DefaultLogger.js +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/plugins/CompilerPlugin.d.ts +1 -1
- package/dist/plugins/PluginCommon.d.ts +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +1 -1
- 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 +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +1 -1
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/dev-hooks.d.ts +1 -1
- package/dist/utils/dev-hooks.js +1 -1
- package/dist/utils/utilities.js +1 -1
- package/dist/{version-eRVLZxyL.js → version-CsNAUaEt.js} +2 -2
- package/dist/{version-eRVLZxyL.js.map → version-CsNAUaEt.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/commandkit-5VMG2thU.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKit } from "./analytics-engine-
|
|
1
|
+
import { CommandKit } from "./analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import { ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
|
|
@@ -40,4 +40,4 @@ declare function getEventWorkerContext(): EventWorkerContext;
|
|
|
40
40
|
declare function isEventWorkerContext(worker: any): worker is EventWorkerContext;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
43
|
-
//# sourceMappingURL=EventWorkerContext-
|
|
43
|
+
//# sourceMappingURL=EventWorkerContext-DiMpRt1P.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
package/dist/analytics/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -6,7 +6,7 @@ import { Command, CommandsRouter, Middleware } from "./CommandsRouter-CoOA7hkf.j
|
|
|
6
6
|
import { EventsRouter, ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
7
7
|
import { HMREventType } from "./constants-MKu-Q1jh.js";
|
|
8
8
|
import EventEmitter from "node:events";
|
|
9
|
-
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, Constructable, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
9
|
+
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, Constructable, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, PermissionsString, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
10
10
|
import { DirectiveTransformerOptions } from "directive-to-hof";
|
|
11
11
|
import { Options } from "tsdown";
|
|
12
12
|
|
|
@@ -38,18 +38,59 @@ interface CommandContext<T extends Interaction, Cached extends CacheType> {
|
|
|
38
38
|
*/
|
|
39
39
|
handler: CommandKit;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Represents the command metadata.
|
|
43
|
+
*/
|
|
44
|
+
interface CommandMetadata {
|
|
45
|
+
/**
|
|
46
|
+
* The guilds that the command is available in.
|
|
47
|
+
*/
|
|
48
|
+
guilds?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* The aliases of the command.
|
|
51
|
+
*/
|
|
52
|
+
aliases?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* The user permissions required to execute the command.
|
|
55
|
+
*/
|
|
56
|
+
userPermissions?: PermissionsString | PermissionsString[];
|
|
57
|
+
/**
|
|
58
|
+
* The bot permissions required to execute the command.
|
|
59
|
+
*/
|
|
60
|
+
botPermissions?: PermissionsString | PermissionsString[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Use `CommandMetadata` instead.
|
|
64
|
+
*/
|
|
65
|
+
interface LegacyCommandMetadata {
|
|
66
|
+
/**
|
|
67
|
+
* The aliases of the command.
|
|
68
|
+
* @deprecated Use `metadata.aliases` or `generateMetadata` instead.
|
|
69
|
+
*/
|
|
70
|
+
aliases?: string[];
|
|
71
|
+
/**
|
|
72
|
+
* The guilds that the command is available in.
|
|
73
|
+
* @deprecated Use `metadata.guilds` or `generateMetadata` instead.
|
|
74
|
+
*/
|
|
75
|
+
guilds?: string[];
|
|
76
|
+
}
|
|
41
77
|
/**
|
|
42
78
|
* Represents a command that can be executed by CommandKit.
|
|
43
79
|
*/
|
|
44
80
|
type CommandData = Prettify<Omit<RESTPostAPIApplicationCommandsJSONBody, 'description'> & {
|
|
81
|
+
/**
|
|
82
|
+
* The description of the command.
|
|
83
|
+
*/
|
|
45
84
|
description?: string;
|
|
46
|
-
|
|
47
|
-
aliases?: string[];
|
|
48
|
-
}>;
|
|
85
|
+
} & LegacyCommandMetadata>;
|
|
49
86
|
/**
|
|
50
87
|
* Represents an event handler for a specific event.
|
|
51
88
|
*/
|
|
52
89
|
type EventHandler<K extends keyof ClientEvents> = (...args: [...ClientEvents[K], Client<true>, CommandKit]) => void | Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* The command metadata function
|
|
92
|
+
*/
|
|
93
|
+
type CommandMetadataFunction = () => Promise<CommandMetadata> | CommandMetadata;
|
|
53
94
|
//#endregion
|
|
54
95
|
//#region src/app/commands/Context.d.ts
|
|
55
96
|
/**
|
|
@@ -359,7 +400,9 @@ declare class CommandRegistrar {
|
|
|
359
400
|
/**
|
|
360
401
|
* Gets the commands data.
|
|
361
402
|
*/
|
|
362
|
-
getCommandsData(): CommandData
|
|
403
|
+
getCommandsData(): (CommandData & {
|
|
404
|
+
__metadata?: CommandMetadata;
|
|
405
|
+
})[];
|
|
363
406
|
/**
|
|
364
407
|
* Registers loaded commands.
|
|
365
408
|
*/
|
|
@@ -367,11 +410,15 @@ declare class CommandRegistrar {
|
|
|
367
410
|
/**
|
|
368
411
|
* Updates the global commands.
|
|
369
412
|
*/
|
|
370
|
-
updateGlobalCommands(commands: CommandData
|
|
413
|
+
updateGlobalCommands(commands: (CommandData & {
|
|
414
|
+
__metadata?: CommandMetadata;
|
|
415
|
+
})[]): Promise<void>;
|
|
371
416
|
/**
|
|
372
417
|
* Updates the guild commands.
|
|
373
418
|
*/
|
|
374
|
-
updateGuildCommands(commands: CommandData
|
|
419
|
+
updateGuildCommands(commands: (CommandData & {
|
|
420
|
+
__metadata?: CommandMetadata;
|
|
421
|
+
})[]): Promise<void>;
|
|
375
422
|
}
|
|
376
423
|
//#endregion
|
|
377
424
|
//#region src/context/environment.d.ts
|
|
@@ -653,6 +700,8 @@ type RunCommand = <T extends AsyncFunction>(fn: T) => T;
|
|
|
653
700
|
*/
|
|
654
701
|
interface AppCommandNative {
|
|
655
702
|
command: CommandData | Record<string, any>;
|
|
703
|
+
generateMetadata?: CommandMetadataFunction;
|
|
704
|
+
metadata?: CommandMetadata;
|
|
656
705
|
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
657
706
|
autocomplete?: (ctx: Context) => Awaitable<unknown>;
|
|
658
707
|
message?: (ctx: Context) => Awaitable<unknown>;
|
|
@@ -684,8 +733,8 @@ interface AppCommandMiddleware {
|
|
|
684
733
|
*/
|
|
685
734
|
interface LoadedCommand {
|
|
686
735
|
command: Command;
|
|
736
|
+
metadata: CommandMetadata;
|
|
687
737
|
data: AppCommand;
|
|
688
|
-
guilds?: string[];
|
|
689
738
|
}
|
|
690
739
|
/**
|
|
691
740
|
* Type representing command data identifier.
|
|
@@ -727,8 +776,20 @@ declare const commandDataSchema: {
|
|
|
727
776
|
messageContextMenu: (c: unknown) => c is Function;
|
|
728
777
|
userContextMenu: (c: unknown) => c is Function;
|
|
729
778
|
};
|
|
779
|
+
/**
|
|
780
|
+
* @private
|
|
781
|
+
* @internal
|
|
782
|
+
*/
|
|
730
783
|
type CommandDataSchema = typeof commandDataSchema;
|
|
784
|
+
/**
|
|
785
|
+
* @private
|
|
786
|
+
* @internal
|
|
787
|
+
*/
|
|
731
788
|
type CommandDataSchemaKey = keyof CommandDataSchema;
|
|
789
|
+
/**
|
|
790
|
+
* @private
|
|
791
|
+
* @internal
|
|
792
|
+
*/
|
|
732
793
|
type CommandDataSchemaValue = CommandDataSchema[CommandDataSchemaKey];
|
|
733
794
|
/**
|
|
734
795
|
* Handles application commands for CommandKit, including loading, registration, and execution.
|
|
@@ -841,6 +902,12 @@ declare class AppCommandHandler {
|
|
|
841
902
|
* @internal
|
|
842
903
|
*/
|
|
843
904
|
private loadCommand;
|
|
905
|
+
/**
|
|
906
|
+
* Gets the metadata for a command.
|
|
907
|
+
* @param command - The command name to get metadata for
|
|
908
|
+
* @returns The command metadata or null if not found
|
|
909
|
+
*/
|
|
910
|
+
getMetadataFor(command: string): CommandMetadata | null;
|
|
844
911
|
}
|
|
845
912
|
//#endregion
|
|
846
913
|
//#region src/events/CommandKitEventsChannel.d.ts
|
|
@@ -1864,6 +1931,11 @@ interface CommandKitConfig {
|
|
|
1864
1931
|
* @default false
|
|
1865
1932
|
*/
|
|
1866
1933
|
disablePrefixCommands?: boolean;
|
|
1934
|
+
/**
|
|
1935
|
+
* Whether or not to disable the built-in permissions middleware. This only affects `botPermissions` and `userPermissions` in the command metadata.
|
|
1936
|
+
* @default false
|
|
1937
|
+
*/
|
|
1938
|
+
disablePermissionsMiddleware?: boolean;
|
|
1867
1939
|
/**
|
|
1868
1940
|
* Whether or not to show a warning when a prefix command is not found. This only affects development mode.
|
|
1869
1941
|
* @default true
|
|
@@ -2179,5 +2251,5 @@ declare class AnalyticsEngine {
|
|
|
2179
2251
|
track(event: AnalyticsEvent): Promise<void>;
|
|
2180
2252
|
}
|
|
2181
2253
|
//#endregion
|
|
2182
|
-
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitCompilerOptions, CommandKitConfig, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DeepPartial, DeepRequired, EvaluationContext, EventFlagContext, EventHandler, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolvedCommandKitConfig, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, mergeDeep, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
|
|
2183
|
-
//# sourceMappingURL=analytics-engine-
|
|
2254
|
+
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitCompilerOptions, CommandKitConfig, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandMetadata, CommandMetadataFunction, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DeepPartial, DeepRequired, EvaluationContext, EventFlagContext, EventHandler, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, LegacyCommandMetadata, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolvedCommandKitConfig, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, mergeDeep, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
|
|
2255
|
+
//# sourceMappingURL=analytics-engine-Ddw9axi4.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-
|
|
1
|
+
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-
|
|
1
|
+
import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../analytics-engine-
|
|
1
|
+
import "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -29,5 +29,5 @@ import "../../CommandsRouter-CoOA7hkf.js";
|
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
30
30
|
import "../../index-DKcmsWXw.js";
|
|
31
31
|
import "../../constants-MKu-Q1jh.js";
|
|
32
|
-
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-
|
|
32
|
+
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-DiMpRt1P.js";
|
|
33
33
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-
|
|
1
|
+
import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-
|
|
1
|
+
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
package/dist/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-
|
|
1
|
+
import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
package/dist/app/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MiddlewareContext } from "../../analytics-engine-Ddw9axi4.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
|
+
import "../../types-CJ-XvOFN.js";
|
|
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-DHBELeJ3.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
|
+
import "../../index-DSBMRX9A.js";
|
|
24
|
+
import "../../index-DdqikUQD.js";
|
|
25
|
+
import "../../MessageCommandParser-ROLibZPX.js";
|
|
26
|
+
import "../../signals-BQbEfy3X.js";
|
|
27
|
+
import "../../helpers-Wg6P5fRQ.js";
|
|
28
|
+
import "../../CommandsRouter-CoOA7hkf.js";
|
|
29
|
+
import "../../EventsRouter-BacqK6z3.js";
|
|
30
|
+
import "../../index-DKcmsWXw.js";
|
|
31
|
+
import "../../constants-MKu-Q1jh.js";
|
|
32
|
+
|
|
33
|
+
//#region src/app/middlewares/permissions.d.ts
|
|
34
|
+
declare const middlewareId: `${string}-${string}-${string}-${string}-${string}`;
|
|
35
|
+
/**
|
|
36
|
+
* @private
|
|
37
|
+
* @ignore
|
|
38
|
+
*/
|
|
39
|
+
declare function beforeExecute(ctx: MiddlewareContext): Promise<void>;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { beforeExecute, middlewareId };
|
|
42
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require('../../colors-Cd4Oz-r-.js');
|
|
2
|
+
require('../../ActionRow-CmTHbo2t.js');
|
|
3
|
+
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
|
+
require('../../common-CcfjYnPG.js');
|
|
6
|
+
require('../../common-vnMIelAE.js');
|
|
7
|
+
require('../../container-z621KfH5.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
|
+
require('../../v2-DofkPKHs.js');
|
|
14
|
+
require('../../element-Bak9llw_.js');
|
|
15
|
+
require('../../types-CUZOquUl.js');
|
|
16
|
+
require('../../EventInterceptor-CQ4PBpBJ.js');
|
|
17
|
+
require('../../constants-B5_Ta7PR.js');
|
|
18
|
+
require('../../PluginCommon-Di1xIa8d.js');
|
|
19
|
+
require('../../CompilerPlugin-CjoZAAR8.js');
|
|
20
|
+
require('../../RuntimePlugin-CBgBLXTG.js');
|
|
21
|
+
require('../../types-q0Nm882H.js');
|
|
22
|
+
require('../../runtime-5fxB4uhe.js');
|
|
23
|
+
require('../../utils-BnXM4eKk.js');
|
|
24
|
+
require('../../resolve-file-url-DHTQj2mU.js');
|
|
25
|
+
require('../../types-package-DrnIdWLg.js');
|
|
26
|
+
require('../../EventWorkerContext-CSlD9rbx.js');
|
|
27
|
+
require('../../signals-DHdYrd-n.js');
|
|
28
|
+
require('../../constants-CUND8XkG.js');
|
|
29
|
+
require('../../MessageCommandParser-B_BEQ3p8.js');
|
|
30
|
+
require('../../CommandsRouter-tMAivEfv.js');
|
|
31
|
+
require('../../EventsRouter-C_J0M3uO.js');
|
|
32
|
+
require('../../router-DHnFRADH.js');
|
|
33
|
+
require('../../common-DNADUU3_.js');
|
|
34
|
+
require('../../CommandKitEventsChannel-Bgw0XCOl.js');
|
|
35
|
+
require('../../store-CiqLHedg.js');
|
|
36
|
+
|
|
37
|
+
exports.beforeExecute = require_commandkit.beforeExecute;
|
|
38
|
+
exports.middlewareId = require_commandkit.middlewareId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-
|
|
1
|
+
import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-Ddw9axi4.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C-ViHyu-.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-z621KfH5.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
const require_commandkit = require('./commandkit-
|
|
2
|
+
const require_commandkit = require('./commandkit-C0BuNRSN.js');
|
|
3
3
|
const require_constants = require('./constants-B5_Ta7PR.js');
|
|
4
4
|
const require_utils = require('./utils-BnXM4eKk.js');
|
|
5
5
|
const require_common = require('./common-DNADUU3_.js');
|
|
@@ -167,4 +167,4 @@ Object.defineProperty(exports, 'buildApplication', {
|
|
|
167
167
|
return buildApplication;
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
-
//# sourceMappingURL=build-
|
|
170
|
+
//# sourceMappingURL=build-BmDzPe4V.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-
|
|
1
|
+
{"version":3,"file":"build-BmDzPe4V.js","names":[],"sources":["../src/cli/build.ts"],"sourcesContent":["import { build, Options } from 'tsdown';\nimport { CompilerPlugin, CompilerPluginRuntime } from '../plugins';\nimport { loadConfigFile } from '../config/loader';\nimport { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { DevEnv, devEnvFileArgs, ProdEnv, prodEnvFileArgs } from './env';\nimport { rimraf } from 'rimraf';\nimport { performTypeCheck } from './type-checker';\nimport { copyLocaleFiles } from './common';\nimport { MaybeArray } from '../components';\nimport { COMMANDKIT_CWD } from '../utils/constants';\nimport { mergeDeep } from '../config/utils';\nimport { existsSync } from 'node:fs';\n\n/**\n * @private\n * @internal\n */\nexport interface ApplicationBuildOptions {\n plugins?: MaybeArray<CompilerPlugin>[] | Array<CompilerPlugin>;\n rolldownPlugins?: any[];\n isDev?: boolean;\n configPath?: string;\n}\n\n// emit public env variables and given env variables\n/**\n * @private\n * @internal\n */\nfunction mergeDefinitionsIfNeeded(env: Record<string, string>, isDev: boolean) {\n const values = Object.fromEntries(\n Object.entries(process.env).filter(\n ([k]) => !(k in env) && k.startsWith('COMMANDKIT_PUBLIC_'),\n ),\n );\n\n return {\n ...env,\n ...values,\n ...(isDev\n ? {\n NODE_ENV: 'development',\n COMMANDKIT_BOOTSTRAP_MODE: 'development',\n COMMANDKIT_IS_DEV: 'true',\n COMMANDKIT_IS_TEST: 'false',\n }\n : {\n NODE_ENV: 'production',\n COMMANDKIT_BOOTSTRAP_MODE: 'production',\n COMMANDKIT_IS_DEV: 'false',\n COMMANDKIT_IS_TEST: 'false',\n }),\n };\n}\n\n/**\n * @private\n * @internal\n */\nexport async function buildApplication({\n plugins,\n rolldownPlugins,\n isDev,\n configPath,\n}: ApplicationBuildOptions) {\n const config = await loadConfigFile(configPath);\n\n if (!isDev && !config?.typescript?.ignoreBuildErrors) {\n await performTypeCheck(configPath || COMMANDKIT_CWD);\n }\n\n const pluginRuntime = new CompilerPluginRuntime(\n (plugins || []) as CompilerPlugin[],\n );\n\n rolldownPlugins ??= [];\n\n rolldownPlugins.push(pluginRuntime.toJSON());\n\n try {\n const dest = isDev ? '.commandkit' : config.distDir;\n\n // Clean the destination directory\n await rimraf(dest);\n\n await pluginRuntime.init();\n\n await build(\n mergeDeep(\n {\n watch: false,\n dts: false,\n clean: true,\n format: ['esm'],\n shims: true,\n minify: false,\n silent: !!isDev,\n inputOptions: {\n transform: {\n jsx: {\n runtime: 'automatic',\n importSource: 'commandkit',\n },\n },\n checks: {\n circularDependency: true,\n },\n onwarn: (warning, defaultWarn) => {\n if (warning?.message?.includes('compilerOptions.jsx')) return;\n\n return defaultWarn(warning);\n },\n onLog: (level, log, defaultLog) => {\n if (isDev) return;\n\n return defaultLog(level, log);\n },\n moduleTypes: {\n '.json': 'js',\n '.node': 'binary',\n },\n },\n plugins: rolldownPlugins,\n platform: 'node',\n skipNodeModulesBundle: true,\n sourcemap:\n config.sourceMap?.[isDev ? 'development' : 'production'] ?? true,\n target: 'node16',\n outDir: dest,\n env: mergeDefinitionsIfNeeded(config.env || {}, !!isDev),\n entry: Array.from(\n new Set([\n 'src/**/*.{js,cjs,mjs,ts,cts,mts,jsx,tsx}',\n `!${config.distDir}`,\n '!.commandkit',\n '!**/*.test.*',\n '!**/*.spec.*',\n ...(config.entrypoints ?? []),\n ]),\n ),\n unbundle: isDev\n ? true\n : (config.compilerOptions?.disableChunking ?? false),\n } satisfies Options,\n config.compilerOptions?.tsdown,\n ),\n );\n\n await copyLocaleFiles('src', dest);\n await injectEntryFile(\n configPath || COMMANDKIT_CWD,\n !!isDev,\n !!(\n config.antiCrashScript?.[isDev ? 'development' : 'production'] ??\n (isDev ? true : false)\n ),\n config.distDir,\n );\n } catch (error) {\n console.error('Build failed:', error);\n if (error instanceof Error) {\n console.error('Error details:', error.stack);\n }\n process.exit(1); // Force exit on error\n } finally {\n // Ensure plugins are cleaned up\n await pluginRuntime.destroy();\n }\n}\n\nconst envScript = (dev: boolean) => `// --- Environment Variables Loader ---\nconst $env = [${(dev ? devEnvFileArgs : prodEnvFileArgs).map((p) => `\"${p}\"`).join(', ')}];\nfor (const file of $env) {\n try {\n process.loadEnvFile(file);\n console.log('\\\\x1b[36m✔ Loaded \\\\x1b[0m\\\\x1b[33m%s\\\\x1b[0m', file);\n } catch {}\n}\n`;\n\nconst antiCrashScript = [\n '// --- CommandKit Anti-Crash Monitor ---',\n \" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process\",\n ' // instead of using it as a means to resume operation.',\n ' // But it exists here due to compatibility reasons with discord bot ecosystem.',\n \" const p = (t) => `\\\\x1b[31m${t}\\\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';\",\n ' if (!process.eventNames().includes(e1)) // skip if it is already handled',\n ' process.on(e1, (e) => {',\n ' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',\n ' })',\n ' if (!process.eventNames().includes(e2)) // skip if it is already handled',\n ' process.on(e2, (r) => {',\n ' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',\n ' });',\n '// --- CommandKit Anti-Crash Monitor ---',\n].join('\\n');\n\nconst wrapInAsyncIIFE = (code: string[]) =>\n `;await (async () => {\\n${code.join('\\n\\n')}\\n})();`;\n\nasync function injectEntryFile(\n configPath: string,\n isDev: boolean,\n emitAntiCrashScript: boolean,\n distDir?: string,\n) {\n const dist = isDev ? '.commandkit' : distDir || 'dist';\n const entryFilePath = join(configPath, dist, 'index.js');\n\n // skip if the entry file already exists\n if (existsSync(entryFilePath)) return;\n\n const code = `/* Entrypoint File Generated By CommandKit */\n${isDev ? `\\n\\n// Injected for development\\n${wrapInAsyncIIFE([envScript(isDev), emitAntiCrashScript ? antiCrashScript : ''])}\\n\\n` : wrapInAsyncIIFE([envScript(isDev)])}\n\nimport { commandkit } from 'commandkit';\nimport { Client } from 'discord.js';\n\nasync function bootstrap() {\n const app = await import('./app.js').then((m) => m.default ?? m);\n\n if (!app || !(app instanceof Client)) {\n throw new Error('The app file must default export the discord.js client instance');\n }\n\n commandkit.setClient(app);\n\n await commandkit.start();\n}\n\nawait bootstrap().catch((e) => {\n console.error('Failed to bootstrap CommandKit application:\\\\n', e.stack);\n})\n`;\n\n await writeFile(entryFilePath, code);\n}\n"],"mappings":"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"}
|
package/dist/cli/build.d.ts
CHANGED
package/dist/cli/build.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
require('../commandkit-
|
|
4
|
+
require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -35,6 +35,6 @@ require('../CommandKitEventsChannel-Bgw0XCOl.js');
|
|
|
35
35
|
require('../store-CiqLHedg.js');
|
|
36
36
|
require('../env-_68PRRoA.js');
|
|
37
37
|
require('../type-checker-1Iu1jJcy.js');
|
|
38
|
-
const require_build = require('../build-
|
|
38
|
+
const require_build = require('../build-BmDzPe4V.js');
|
|
39
39
|
|
|
40
40
|
exports.buildApplication = require_build.buildApplication;
|
package/dist/cli/common.d.ts
CHANGED
package/dist/cli/development.js
CHANGED
|
@@ -2,7 +2,7 @@ const require_chunk = require('../chunk-nOFOJqeH.js');
|
|
|
2
2
|
const require_colors = require('../colors-Cd4Oz-r-.js');
|
|
3
3
|
require('../ActionRow-CmTHbo2t.js');
|
|
4
4
|
require('../error-codes-C-ViHyu-.js');
|
|
5
|
-
const require_commandkit = require('../commandkit-
|
|
5
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
6
6
|
require('../common-CcfjYnPG.js');
|
|
7
7
|
require('../common-vnMIelAE.js');
|
|
8
8
|
require('../container-z621KfH5.js');
|
|
@@ -37,7 +37,7 @@ require('../store-CiqLHedg.js');
|
|
|
37
37
|
require('../env-_68PRRoA.js');
|
|
38
38
|
const require_app_process = require('../app-process-CjMovpoZ.js');
|
|
39
39
|
require('../type-checker-1Iu1jJcy.js');
|
|
40
|
-
const require_build = require('../build-
|
|
40
|
+
const require_build = require('../build-BmDzPe4V.js');
|
|
41
41
|
const node_crypto = require_chunk.__toESM(require("node:crypto"));
|
|
42
42
|
const path = require_chunk.__toESM(require("path"));
|
|
43
43
|
const chokidar = require_chunk.__toESM(require("chokidar"));
|
package/dist/cli/information.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('../chunk-nOFOJqeH.js');
|
|
2
2
|
const require_constants = require('../constants-B5_Ta7PR.js');
|
|
3
|
-
const require_version = require('../version-
|
|
3
|
+
const require_version = require('../version-CsNAUaEt.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
|
const node_child_process = require_chunk.__toESM(require("node:child_process"));
|
package/dist/cli/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C-ViHyu-.js');
|
|
4
|
-
require('../commandkit-
|
|
4
|
+
require('../commandkit-C0BuNRSN.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-z621KfH5.js');
|
|
@@ -33,6 +33,6 @@ require('../router-DHnFRADH.js');
|
|
|
33
33
|
require('../common-DNADUU3_.js');
|
|
34
34
|
require('../CommandKitEventsChannel-Bgw0XCOl.js');
|
|
35
35
|
require('../store-CiqLHedg.js');
|
|
36
|
-
const require_init = require('../init-
|
|
36
|
+
const require_init = require('../init-D20FhDjn.js');
|
|
37
37
|
|
|
38
38
|
exports.bootstrapCommandkitCLI = require_init.bootstrapCommandkitCLI;
|
package/dist/cli/production.js
CHANGED
|
@@ -2,7 +2,7 @@ const require_chunk = require('../chunk-nOFOJqeH.js');
|
|
|
2
2
|
require('../colors-Cd4Oz-r-.js');
|
|
3
3
|
require('../ActionRow-CmTHbo2t.js');
|
|
4
4
|
require('../error-codes-C-ViHyu-.js');
|
|
5
|
-
const require_commandkit = require('../commandkit-
|
|
5
|
+
const require_commandkit = require('../commandkit-C0BuNRSN.js');
|
|
6
6
|
require('../common-CcfjYnPG.js');
|
|
7
7
|
require('../common-vnMIelAE.js');
|
|
8
8
|
require('../container-z621KfH5.js');
|
|
@@ -37,7 +37,7 @@ require('../store-CiqLHedg.js');
|
|
|
37
37
|
require('../env-_68PRRoA.js');
|
|
38
38
|
const require_app_process = require('../app-process-CjMovpoZ.js');
|
|
39
39
|
require('../type-checker-1Iu1jJcy.js');
|
|
40
|
-
const require_build = require('../build-
|
|
40
|
+
const require_build = require('../build-BmDzPe4V.js');
|
|
41
41
|
const require_utils$1 = require('../utils-DCSnVAZ6.js');
|
|
42
42
|
const fs = require_chunk.__toESM(require("fs"));
|
|
43
43
|
|