commandkit 1.0.0-dev.20250501204509 → 1.0.0-dev.20250509144654
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/index.d.ts +13 -2
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1911,7 +1911,7 @@ interface CommandKitConfig {
|
|
|
1911
1911
|
/**
|
|
1912
1912
|
* Whether to ignore type checking during builds.
|
|
1913
1913
|
*/
|
|
1914
|
-
|
|
1914
|
+
ignoreBuildErrors?: boolean;
|
|
1915
1915
|
};
|
|
1916
1916
|
/**
|
|
1917
1917
|
* Whether to generate static command handler data in production builds.
|
|
@@ -2033,6 +2033,17 @@ declare function debounce<R, F extends (...args: any[]) => R>(fn: F, ms: number)
|
|
|
2033
2033
|
* ```
|
|
2034
2034
|
*/
|
|
2035
2035
|
declare function devOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
2036
|
+
/**
|
|
2037
|
+
* Custom error for stopping event propagation.
|
|
2038
|
+
*/
|
|
2039
|
+
declare class StopEventPropagationError extends Error {
|
|
2040
|
+
constructor();
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Stops event propagation.
|
|
2044
|
+
* @throws {StopEventPropagationError}
|
|
2045
|
+
*/
|
|
2046
|
+
declare function stopEvents(): never;
|
|
2036
2047
|
|
|
2037
2048
|
/**
|
|
2038
2049
|
* Creates a command line interface for CommandKit.
|
|
@@ -2041,4 +2052,4 @@ declare function devOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
|
2041
2052
|
*/
|
|
2042
2053
|
declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
|
|
2043
2054
|
|
|
2044
|
-
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type BootstrapFunction, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type ChatInputCommand, type ChatInputCommandContext, type Command, type CommandBuilderLike, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitHMREvent, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, type ContainerProps, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, File, type FileProps, Fragment, type FragmentElementProps, type GenericFunction, HMREventType, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MediaGallery, MediaGalleryItem, type MediaGalleryItemProps, type MediaGalleryProps, MemoryCache, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreRegisterCommandsEvent, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, Section, type SectionProps, type SelectMenuKitPredicate, type SelectMenuProps, Separator, type SeparatorProps, type Setup, ShortInput, type SlashCommandMiddlewareContext, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextDisplay, type TextDisplayProps, TextInput, type TextInputProps, Thumbnail, type ThumbnailProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, __SECRET_USE_CACHE_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, after, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfter, commandkit, createElement, createLogger, debounce, CommandKit as default, defineConfig, devOnly, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getSourceDirectories, invalidate, isCachedFunction, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, revalidate, useEnvironment, version };
|
|
2055
|
+
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type BootstrapFunction, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type ChatInputCommand, type ChatInputCommandContext, type Command, type CommandBuilderLike, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitHMREvent, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, type ContainerProps, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, File, type FileProps, Fragment, type FragmentElementProps, type GenericFunction, HMREventType, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MediaGallery, MediaGalleryItem, type MediaGalleryItemProps, type MediaGalleryProps, MemoryCache, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreRegisterCommandsEvent, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, Section, type SectionProps, type SelectMenuKitPredicate, type SelectMenuProps, Separator, type SeparatorProps, type Setup, ShortInput, type SlashCommandMiddlewareContext, StopEventPropagationError, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextDisplay, type TextDisplayProps, TextInput, type TextInputProps, Thumbnail, type ThumbnailProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, __SECRET_USE_CACHE_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, after, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfter, commandkit, createElement, createLogger, debounce, CommandKit as default, defineConfig, devOnly, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getSourceDirectories, invalidate, isCachedFunction, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, revalidate, stopEvents, useEnvironment, version };
|
package/dist/index.js
CHANGED
|
@@ -2885,7 +2885,7 @@ var init_default = __esm({
|
|
|
2885
2885
|
},
|
|
2886
2886
|
static: true,
|
|
2887
2887
|
typescript: {
|
|
2888
|
-
|
|
2888
|
+
ignoreBuildErrors: false
|
|
2889
2889
|
},
|
|
2890
2890
|
distDir: "dist",
|
|
2891
2891
|
env: {},
|
|
@@ -3016,7 +3016,10 @@ function devOnly(fn) {
|
|
|
3016
3016
|
}, "f");
|
|
3017
3017
|
return f;
|
|
3018
3018
|
}
|
|
3019
|
-
|
|
3019
|
+
function stopEvents() {
|
|
3020
|
+
throw new StopEventPropagationError();
|
|
3021
|
+
}
|
|
3022
|
+
var import_node_fs, import_node_path, appDir, currentDir, _StopEventPropagationError, StopEventPropagationError;
|
|
3020
3023
|
var init_utilities = __esm({
|
|
3021
3024
|
"src/utils/utilities.ts"() {
|
|
3022
3025
|
"use strict";
|
|
@@ -3032,6 +3035,15 @@ var init_utilities = __esm({
|
|
|
3032
3035
|
__name(findAppDirectory, "findAppDirectory");
|
|
3033
3036
|
__name(debounce, "debounce");
|
|
3034
3037
|
__name(devOnly, "devOnly");
|
|
3038
|
+
_StopEventPropagationError = class _StopEventPropagationError extends Error {
|
|
3039
|
+
constructor() {
|
|
3040
|
+
super("Event propagation stopped");
|
|
3041
|
+
this.name = "StopEventPropagationError";
|
|
3042
|
+
}
|
|
3043
|
+
};
|
|
3044
|
+
__name(_StopEventPropagationError, "StopEventPropagationError");
|
|
3045
|
+
StopEventPropagationError = _StopEventPropagationError;
|
|
3046
|
+
__name(stopEvents, "stopEvents");
|
|
3035
3047
|
}
|
|
3036
3048
|
});
|
|
3037
3049
|
|
|
@@ -4874,6 +4886,7 @@ var init_AppEventsHandler = __esm({
|
|
|
4874
4886
|
init_cjs_shims();
|
|
4875
4887
|
init_Logger();
|
|
4876
4888
|
init_resolve_file_url();
|
|
4889
|
+
init_utilities();
|
|
4877
4890
|
_AppEventsHandler = class _AppEventsHandler {
|
|
4878
4891
|
constructor(commandkit2) {
|
|
4879
4892
|
this.commandkit = commandkit2;
|
|
@@ -4941,6 +4954,12 @@ var init_AppEventsHandler = __esm({
|
|
|
4941
4954
|
try {
|
|
4942
4955
|
await listener.handler(...args);
|
|
4943
4956
|
} catch (e) {
|
|
4957
|
+
if (e instanceof StopEventPropagationError) {
|
|
4958
|
+
Logger.debug(
|
|
4959
|
+
`Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`
|
|
4960
|
+
);
|
|
4961
|
+
break;
|
|
4962
|
+
}
|
|
4944
4963
|
Logger.error(
|
|
4945
4964
|
`Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}`,
|
|
4946
4965
|
e
|
|
@@ -4955,6 +4974,12 @@ var init_AppEventsHandler = __esm({
|
|
|
4955
4974
|
await listener.handler(...args);
|
|
4956
4975
|
executedOnceListeners.add(listener.handler);
|
|
4957
4976
|
} catch (e) {
|
|
4977
|
+
if (e instanceof StopEventPropagationError) {
|
|
4978
|
+
Logger.debug(
|
|
4979
|
+
`Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`
|
|
4980
|
+
);
|
|
4981
|
+
break;
|
|
4982
|
+
}
|
|
4958
4983
|
Logger.error(
|
|
4959
4984
|
`Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}`,
|
|
4960
4985
|
e
|
|
@@ -5639,7 +5664,7 @@ var init_version = __esm({
|
|
|
5639
5664
|
"use strict";
|
|
5640
5665
|
init_cjs_shims();
|
|
5641
5666
|
version = /* @__MACRO__ $version */
|
|
5642
|
-
"1.0.0-dev.
|
|
5667
|
+
"1.0.0-dev.20250509144654";
|
|
5643
5668
|
}
|
|
5644
5669
|
});
|
|
5645
5670
|
|
|
@@ -5839,7 +5864,7 @@ async function buildApplication({
|
|
|
5839
5864
|
}) {
|
|
5840
5865
|
var _a;
|
|
5841
5866
|
const config = await loadConfigFile(configPath);
|
|
5842
|
-
if (!isDev && !((_a = config == null ? void 0 : config.typescript) == null ? void 0 : _a.
|
|
5867
|
+
if (!isDev && !((_a = config == null ? void 0 : config.typescript) == null ? void 0 : _a.ignoreBuildErrors)) {
|
|
5843
5868
|
await performTypeCheck(configPath || process.cwd());
|
|
5844
5869
|
}
|
|
5845
5870
|
const pluginRuntime = new CompilerPluginRuntime(plugins || []);
|
|
@@ -6557,6 +6582,7 @@ __export(index_exports, {
|
|
|
6557
6582
|
Section: () => Section,
|
|
6558
6583
|
Separator: () => Separator,
|
|
6559
6584
|
ShortInput: () => ShortInput,
|
|
6585
|
+
StopEventPropagationError: () => StopEventPropagationError,
|
|
6560
6586
|
StringSelectMenu: () => StringSelectMenu,
|
|
6561
6587
|
StringSelectMenuKit: () => StringSelectMenuKit,
|
|
6562
6588
|
StringSelectMenuOption: () => StringSelectMenuOption,
|
|
@@ -6602,6 +6628,7 @@ __export(index_exports, {
|
|
|
6602
6628
|
redirect: () => redirect,
|
|
6603
6629
|
rethrow: () => rethrow,
|
|
6604
6630
|
revalidate: () => revalidate,
|
|
6631
|
+
stopEvents: () => stopEvents,
|
|
6605
6632
|
useEnvironment: () => useEnvironment,
|
|
6606
6633
|
version: () => version
|
|
6607
6634
|
});
|
|
@@ -6939,6 +6966,7 @@ var index_default = CommandKit;
|
|
|
6939
6966
|
Section,
|
|
6940
6967
|
Separator,
|
|
6941
6968
|
ShortInput,
|
|
6969
|
+
StopEventPropagationError,
|
|
6942
6970
|
StringSelectMenu,
|
|
6943
6971
|
StringSelectMenuKit,
|
|
6944
6972
|
StringSelectMenuOption,
|
|
@@ -6983,6 +7011,7 @@ var index_default = CommandKit;
|
|
|
6983
7011
|
redirect,
|
|
6984
7012
|
rethrow,
|
|
6985
7013
|
revalidate,
|
|
7014
|
+
stopEvents,
|
|
6986
7015
|
useEnvironment,
|
|
6987
7016
|
version
|
|
6988
7017
|
});
|