commandkit 0.1.11-dev.20250405091951 → 0.1.11-dev.20250406075610
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 +2 -1
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1582,6 +1582,7 @@ declare abstract class PluginCommon<T extends PluginOptions = PluginOptions, C e
|
|
|
1582
1582
|
declare const COMMANDKIT_CACHE_TAG: unique symbol;
|
|
1583
1583
|
declare const COMMANDKIT_IS_DEV: boolean;
|
|
1584
1584
|
declare const COMMANDKIT_IS_TEST: boolean;
|
|
1585
|
+
declare const COMMANDKIT_BOOTSTRAP_MODE: "development" | "production";
|
|
1585
1586
|
/**
|
|
1586
1587
|
* Types of Hot Module Replacement events
|
|
1587
1588
|
*/
|
|
@@ -1969,4 +1970,4 @@ declare function devOnly<T extends (...args: any[]) => any>(fn: T): T;
|
|
|
1969
1970
|
*/
|
|
1970
1971
|
declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
|
|
1971
1972
|
|
|
1972
|
-
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, 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, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, 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, 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, type SelectMenuKitPredicate, type SelectMenuProps, type Setup, ShortInput, type SlashCommand, type SlashCommandContext, type SlashCommandMiddlewareContext, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextInput, type TextInputProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, afterCommand, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfterCommand, 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, provideContext, redirect, rethrow, revalidate, useEnvironment, version, zzz_commandkit_secret_internal_use_cache_wrapper_do_not_use_or_you_will_be_fired };
|
|
1973
|
+
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, 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 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, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, 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, 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, type SelectMenuKitPredicate, type SelectMenuProps, type Setup, ShortInput, type SlashCommand, type SlashCommandContext, type SlashCommandMiddlewareContext, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextInput, type TextInputProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, afterCommand, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfterCommand, 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, provideContext, redirect, rethrow, revalidate, useEnvironment, version, zzz_commandkit_secret_internal_use_cache_wrapper_do_not_use_or_you_will_be_fired };
|
package/dist/index.js
CHANGED
|
@@ -1872,14 +1872,15 @@ var init_components = __esm({
|
|
|
1872
1872
|
});
|
|
1873
1873
|
|
|
1874
1874
|
// src/utils/constants.ts
|
|
1875
|
-
var COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, HMREventType;
|
|
1875
|
+
var COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, COMMANDKIT_BOOTSTRAP_MODE, HMREventType;
|
|
1876
1876
|
var init_constants = __esm({
|
|
1877
1877
|
"src/utils/constants.ts"() {
|
|
1878
1878
|
"use strict";
|
|
1879
1879
|
init_cjs_shims();
|
|
1880
1880
|
COMMANDKIT_CACHE_TAG = Symbol("kCommandKitCacheTag");
|
|
1881
|
-
COMMANDKIT_IS_DEV =
|
|
1881
|
+
COMMANDKIT_IS_DEV = process.env.COMMANDKIT_IS_DEV === "true";
|
|
1882
1882
|
COMMANDKIT_IS_TEST = process.env.COMMANDKIT_IS_TEST === "true";
|
|
1883
|
+
COMMANDKIT_BOOTSTRAP_MODE = process.env.COMMANDKIT_BOOTSTRAP_MODE || "development";
|
|
1883
1884
|
HMREventType = {
|
|
1884
1885
|
ReloadCommands: "reload-commands",
|
|
1885
1886
|
ReloadEvents: "reload-events",
|
|
@@ -5133,6 +5134,26 @@ async function ensureExists(loc) {
|
|
|
5133
5134
|
throw new Error(`File not found: ${loc}`);
|
|
5134
5135
|
}
|
|
5135
5136
|
}
|
|
5137
|
+
async function copyLocaleFiles(_from, _to) {
|
|
5138
|
+
const resolvedFrom = (0, import_node_path5.join)(process.cwd(), _from);
|
|
5139
|
+
const resolvedTo = (0, import_node_path5.join)(process.cwd(), _to);
|
|
5140
|
+
const localePaths = ["app/locales"];
|
|
5141
|
+
const srcLocalePaths = localePaths.map((path3) => (0, import_node_path5.join)(resolvedFrom, path3));
|
|
5142
|
+
const destLocalePaths = localePaths.map((path3) => (0, import_node_path5.join)(resolvedTo, path3));
|
|
5143
|
+
for (const localePath of srcLocalePaths) {
|
|
5144
|
+
if (!import_node_fs5.default.existsSync(localePath)) {
|
|
5145
|
+
continue;
|
|
5146
|
+
}
|
|
5147
|
+
const destLocalePath = destLocalePaths[srcLocalePaths.indexOf(localePath)];
|
|
5148
|
+
if (!import_node_fs5.default.existsSync(destLocalePath)) {
|
|
5149
|
+
import_node_fs5.default.promises.mkdir(destLocalePath, { recursive: true });
|
|
5150
|
+
}
|
|
5151
|
+
await import_node_fs5.default.promises.cp(localePath, destLocalePath, {
|
|
5152
|
+
recursive: true,
|
|
5153
|
+
force: true
|
|
5154
|
+
});
|
|
5155
|
+
}
|
|
5156
|
+
}
|
|
5136
5157
|
var import_rimraf, import_node_path5, import_node_fs5, ts;
|
|
5137
5158
|
var init_common2 = __esm({
|
|
5138
5159
|
"src/cli/common.ts"() {
|
|
@@ -5149,6 +5170,7 @@ var init_common2 = __esm({
|
|
|
5149
5170
|
__name(loadTypeScript, "loadTypeScript");
|
|
5150
5171
|
__name(loadConfigFileFromPath, "loadConfigFileFromPath");
|
|
5151
5172
|
__name(ensureExists, "ensureExists");
|
|
5173
|
+
__name(copyLocaleFiles, "copyLocaleFiles");
|
|
5152
5174
|
}
|
|
5153
5175
|
});
|
|
5154
5176
|
|
|
@@ -5595,7 +5617,7 @@ var init_version = __esm({
|
|
|
5595
5617
|
"use strict";
|
|
5596
5618
|
init_cjs_shims();
|
|
5597
5619
|
version = /* @__MACRO__ $version */
|
|
5598
|
-
"0.1.11-dev.
|
|
5620
|
+
"0.1.11-dev.20250406075610";
|
|
5599
5621
|
}
|
|
5600
5622
|
});
|
|
5601
5623
|
|
|
@@ -5835,6 +5857,7 @@ async function buildApplication({
|
|
|
5835
5857
|
"!**/*.spec.*"
|
|
5836
5858
|
]
|
|
5837
5859
|
});
|
|
5860
|
+
await copyLocaleFiles("src", dest);
|
|
5838
5861
|
await injectEntryFile(configPath || process.cwd(), !!isDev, config.distDir);
|
|
5839
5862
|
} catch (error) {
|
|
5840
5863
|
console.error("Build failed:", error);
|
|
@@ -5886,6 +5909,7 @@ var init_build = __esm({
|
|
|
5886
5909
|
init_env();
|
|
5887
5910
|
import_rimraf2 = require("rimraf");
|
|
5888
5911
|
init_type_checker();
|
|
5912
|
+
init_common2();
|
|
5889
5913
|
__name(buildApplication, "buildApplication");
|
|
5890
5914
|
envScript = /* @__PURE__ */ __name((dev) => `// --- Environment Variables Loader ---
|
|
5891
5915
|
const $env = [${(dev ? devEnvFileArgs : prodEnvFileArgs).map((p) => `"${p}"`).join(", ")}];
|
|
@@ -5954,6 +5978,7 @@ async function buildAndStart(configPath, skipStart = false) {
|
|
|
5954
5978
|
return ps;
|
|
5955
5979
|
}
|
|
5956
5980
|
async function bootstrapDevelopmentServer(configPath) {
|
|
5981
|
+
process.env.COMMANDKIT_BOOTSTRAP_MODE = "development";
|
|
5957
5982
|
const start = performance.now();
|
|
5958
5983
|
const cwd = configPath || process.cwd();
|
|
5959
5984
|
const configPaths = getPossibleConfigPaths(cwd);
|
|
@@ -6045,6 +6070,7 @@ async function bootstrapDevelopmentServer(configPath) {
|
|
|
6045
6070
|
}, 300);
|
|
6046
6071
|
const isConfigUpdate = /* @__PURE__ */ __name((path3) => {
|
|
6047
6072
|
const isConfig = configPaths.some((configPath2) => path3 === configPath2);
|
|
6073
|
+
if (!isConfig) return false;
|
|
6048
6074
|
console.log(
|
|
6049
6075
|
colors_default.yellowBright(
|
|
6050
6076
|
"It seems like commandkit config file was updated, please restart the server manually to apply changes."
|
|
@@ -6150,6 +6176,7 @@ __export(production_exports, {
|
|
|
6150
6176
|
createProductionBuild: () => createProductionBuild
|
|
6151
6177
|
});
|
|
6152
6178
|
async function bootstrapProductionServer(configPath) {
|
|
6179
|
+
process.env.COMMANDKIT_BOOTSTRAP_MODE = "production";
|
|
6153
6180
|
const cwd = configPath || process.cwd();
|
|
6154
6181
|
const config = await loadConfigFile(cwd);
|
|
6155
6182
|
const mainFile = (0, import_path3.join)(config.distDir, "index.js");
|
|
@@ -6161,6 +6188,7 @@ async function bootstrapProductionServer(configPath) {
|
|
|
6161
6188
|
return createAppProcess(mainFile, cwd, true);
|
|
6162
6189
|
}
|
|
6163
6190
|
async function createProductionBuild(configPath) {
|
|
6191
|
+
process.env.COMMANDKIT_BOOTSTRAP_MODE = "production";
|
|
6164
6192
|
const cwd = configPath || process.cwd();
|
|
6165
6193
|
const config = await loadConfigFile(cwd);
|
|
6166
6194
|
const spinner = await createSpinner(
|
|
@@ -6463,6 +6491,7 @@ __export(index_exports, {
|
|
|
6463
6491
|
AppCommandHandler: () => AppCommandHandler,
|
|
6464
6492
|
Button: () => Button,
|
|
6465
6493
|
ButtonKit: () => ButtonKit,
|
|
6494
|
+
COMMANDKIT_BOOTSTRAP_MODE: () => COMMANDKIT_BOOTSTRAP_MODE,
|
|
6466
6495
|
COMMANDKIT_CACHE_TAG: () => COMMANDKIT_CACHE_TAG,
|
|
6467
6496
|
COMMANDKIT_IS_DEV: () => COMMANDKIT_IS_DEV,
|
|
6468
6497
|
COMMANDKIT_IS_TEST: () => COMMANDKIT_IS_TEST,
|
|
@@ -6650,6 +6679,7 @@ var index_default = CommandKit;
|
|
|
6650
6679
|
AppCommandHandler,
|
|
6651
6680
|
Button,
|
|
6652
6681
|
ButtonKit,
|
|
6682
|
+
COMMANDKIT_BOOTSTRAP_MODE,
|
|
6653
6683
|
COMMANDKIT_CACHE_TAG,
|
|
6654
6684
|
COMMANDKIT_IS_DEV,
|
|
6655
6685
|
COMMANDKIT_IS_TEST,
|