commandkit 0.1.11-dev.20250406081911 → 0.1.11-dev.20250407135241

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 CHANGED
@@ -1717,6 +1717,35 @@ interface CommandKitConfiguration {
1717
1717
  getMessageCommandPrefix: (message: Message$1) => Awaitable<string | string[]>;
1718
1718
  }
1719
1719
  declare let commandkit: CommandKit;
1720
+ type BootstrapFunction = GenericFunction<[CommandKit]> | AsyncFunction<[CommandKit]>;
1721
+ /**
1722
+ * Registers a bootstrap hook that will be called when the CommandKit instance is created.
1723
+ * This is useful for plugins that need to run some code after the CommandKit instance is fully initialized.
1724
+ * Note that not all commandkit dependiencs are available at this point. It is recommended to use the `onApplicationBootstrap` hook instead,
1725
+ * if you need access to the commandkit dependencies.
1726
+ * @param fn The bootstrap function to register.
1727
+ * @example ```ts
1728
+ * import { onBootstrap } from 'commandkit';
1729
+ *
1730
+ * onBootstrap(async (commandkit) => {
1731
+ * // Do something with the commandkit instance
1732
+ * })
1733
+ * ```
1734
+ */
1735
+ declare function onBootstrap<F extends BootstrapFunction>(fn: F): void;
1736
+ /**
1737
+ * Registers a bootstrap hook that will be called when the CommandKit instance is created.
1738
+ * This is useful for plugins that need to run some code after the CommandKit instance is fully initialized.
1739
+ * @param fn The bootstrap function to register.
1740
+ * @example ```ts
1741
+ * import { onApplicationBootstrap } from 'commandkit';
1742
+ *
1743
+ * onApplicationBootstrap(async (commandkit) => {
1744
+ * // Do something with the commandkit instance
1745
+ * })
1746
+ * ```
1747
+ */
1748
+ declare function onApplicationBootstrap<F extends BootstrapFunction>(fn: F): void;
1720
1749
  declare class CommandKit extends EventEmitter {
1721
1750
  #private;
1722
1751
  private readonly options;
@@ -1970,4 +1999,4 @@ declare function devOnly<T extends (...args: any[]) => any>(fn: T): T;
1970
1999
  */
1971
2000
  declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
1972
2001
 
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 };
2002
+ 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 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, onApplicationBootstrap, onBootstrap, 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
@@ -4249,9 +4249,9 @@ var init_AppCommandRunner = __esm({
4249
4249
  });
4250
4250
 
4251
4251
  // src/utils/types-package.ts
4252
- async function generateTypesPackage() {
4252
+ async function generateTypesPackage(force = false) {
4253
4253
  const location = (0, import_node_path2.join)(process.cwd(), "node_modules", "commandkit-types");
4254
- if (!COMMANDKIT_IS_DEV) return location;
4254
+ if (!COMMANDKIT_IS_DEV && !force) return location;
4255
4255
  const packageJSON = (0, import_node_path2.join)(location, "package.json");
4256
4256
  const index = (0, import_node_path2.join)(location, "index.js");
4257
4257
  const types = (0, import_node_path2.join)(location, "index.d.ts");
@@ -5095,12 +5095,52 @@ async function ensureTypeScript(target) {
5095
5095
  await loadTypeScript();
5096
5096
  return true;
5097
5097
  }
5098
+ function detectPackageManager() {
5099
+ if (packageManager) return packageManager;
5100
+ const lockfiles = {
5101
+ "yarn.lock": "yarn",
5102
+ "pnpm-lock.yaml": "pnpm",
5103
+ "package-lock.json": "npm",
5104
+ "bun.lock": "bun",
5105
+ "bun.lockb": "bun"
5106
+ };
5107
+ for (const [lockfile, manager] of Object.entries(lockfiles)) {
5108
+ if (import_node_fs5.default.existsSync((0, import_node_path5.join)(process.cwd(), lockfile))) {
5109
+ packageManager = manager;
5110
+ break;
5111
+ }
5112
+ }
5113
+ if (!packageManager) {
5114
+ packageManager = "npm";
5115
+ }
5116
+ return packageManager;
5117
+ }
5098
5118
  async function loadTypeScript(e) {
5099
5119
  if (ts) return ts;
5100
5120
  try {
5101
5121
  ts = await import("typescript");
5102
- } catch {
5103
- panic(e || "TypeScript must be installed to use TypeScript config files.");
5122
+ } catch (e2) {
5123
+ if (e2 instanceof Error && "code" in e2 && e2.code === "MODULE_NOT_FOUND") {
5124
+ try {
5125
+ const packageManager2 = detectPackageManager();
5126
+ (0, import_node_child_process.execSync)(`${packageManager2} add typescript`, {
5127
+ stdio: "inherit",
5128
+ cwd: process.cwd()
5129
+ });
5130
+ console.log(
5131
+ colors_default.cyan(
5132
+ `TypeScript has been installed automatically, restarting...`
5133
+ )
5134
+ );
5135
+ ts = await import("typescript");
5136
+ return ts;
5137
+ } catch {
5138
+ panic(
5139
+ "TypeScript is not installed and could not be installed automatically. Please install it manually."
5140
+ );
5141
+ }
5142
+ }
5143
+ panic(e2 || "TypeScript must be installed to use TypeScript config files.");
5104
5144
  }
5105
5145
  return ts;
5106
5146
  }
@@ -5154,7 +5194,7 @@ async function copyLocaleFiles(_from, _to) {
5154
5194
  });
5155
5195
  }
5156
5196
  }
5157
- var import_rimraf, import_node_path5, import_node_fs5, ts;
5197
+ var import_rimraf, import_node_path5, import_node_fs5, import_node_child_process, ts, packageManager;
5158
5198
  var init_common2 = __esm({
5159
5199
  "src/cli/common.ts"() {
5160
5200
  "use strict";
@@ -5164,9 +5204,11 @@ var init_common2 = __esm({
5164
5204
  import_node_fs5 = __toESM(require("fs"));
5165
5205
  init_colors();
5166
5206
  init_types_package();
5207
+ import_node_child_process = require("child_process");
5167
5208
  __name(write, "write");
5168
5209
  __name(panic, "panic");
5169
5210
  __name(ensureTypeScript, "ensureTypeScript");
5211
+ __name(detectPackageManager, "detectPackageManager");
5170
5212
  __name(loadTypeScript, "loadTypeScript");
5171
5213
  __name(loadConfigFileFromPath, "loadConfigFileFromPath");
5172
5214
  __name(ensureExists, "ensureExists");
@@ -5331,7 +5373,13 @@ var init_CommandKitEventsChannel = __esm({
5331
5373
  });
5332
5374
 
5333
5375
  // src/CommandKit.ts
5334
- var import_node_events2, import_discord19, import_node_path7, import_node_fs7, commandkit, _started, _CommandKit_instances, init_fn, initCommands_fn, initEvents_fn, _CommandKit, CommandKit;
5376
+ function onBootstrap(fn) {
5377
+ bootstrapHooks.add(fn);
5378
+ }
5379
+ function onApplicationBootstrap(fn) {
5380
+ onApplicationBootstrapHooks.add(fn);
5381
+ }
5382
+ var import_node_events2, import_discord19, import_node_path7, import_node_fs7, commandkit, bootstrapHooks, onApplicationBootstrapHooks, _started, _CommandKit_instances, bootstrapHooks_fn, applicationBootstrapHooks_fn, init_fn, initCommands_fn, initEvents_fn, _CommandKit, CommandKit;
5335
5383
  var init_CommandKit = __esm({
5336
5384
  "src/CommandKit.ts"() {
5337
5385
  "use strict";
@@ -5357,6 +5405,10 @@ var init_CommandKit = __esm({
5357
5405
  init_plugins();
5358
5406
  init_types_package();
5359
5407
  init_Logger();
5408
+ bootstrapHooks = /* @__PURE__ */ new Set();
5409
+ onApplicationBootstrapHooks = /* @__PURE__ */ new Set();
5410
+ __name(onBootstrap, "onBootstrap");
5411
+ __name(onApplicationBootstrap, "onApplicationBootstrap");
5360
5412
  _CommandKit = class _CommandKit extends import_node_events2.default {
5361
5413
  /**
5362
5414
  * Create a new command and event handler with CommandKit.
@@ -5401,6 +5453,7 @@ var init_CommandKit = __esm({
5401
5453
  _CommandKit.instance = this;
5402
5454
  }
5403
5455
  commandkit = _CommandKit.instance;
5456
+ __privateMethod(this, _CommandKit_instances, bootstrapHooks_fn).call(this);
5404
5457
  }
5405
5458
  /**
5406
5459
  * Starts the commandkit application.
@@ -5447,6 +5500,7 @@ var init_CommandKit = __esm({
5447
5500
  await this.commandHandler.registrar.register();
5448
5501
  }
5449
5502
  __privateSet(this, _started, true);
5503
+ await __privateMethod(this, _CommandKit_instances, applicationBootstrapHooks_fn).call(this);
5450
5504
  }
5451
5505
  /**
5452
5506
  * Loads all the plugins.
@@ -5559,6 +5613,30 @@ var init_CommandKit = __esm({
5559
5613
  };
5560
5614
  _started = new WeakMap();
5561
5615
  _CommandKit_instances = new WeakSet();
5616
+ bootstrapHooks_fn = /* @__PURE__ */ __name(async function() {
5617
+ for (const hook of bootstrapHooks) {
5618
+ try {
5619
+ await hook(this);
5620
+ } catch (e) {
5621
+ Logger.error("Error while executing bootstrap hook: ", e);
5622
+ } finally {
5623
+ bootstrapHooks.delete(hook);
5624
+ }
5625
+ }
5626
+ bootstrapHooks.clear();
5627
+ }, "#bootstrapHooks");
5628
+ applicationBootstrapHooks_fn = /* @__PURE__ */ __name(async function() {
5629
+ for (const hook of onApplicationBootstrapHooks) {
5630
+ try {
5631
+ await hook(this);
5632
+ } catch (e) {
5633
+ Logger.error("Error while executing application bootstrap hook: ", e);
5634
+ } finally {
5635
+ onApplicationBootstrapHooks.delete(hook);
5636
+ }
5637
+ }
5638
+ onApplicationBootstrapHooks.clear();
5639
+ }, "#applicationBootstrapHooks");
5562
5640
  init_fn = /* @__PURE__ */ __name(async function() {
5563
5641
  const appDir2 = this.getAppDirectory();
5564
5642
  if (!appDir2) return;
@@ -5617,7 +5695,7 @@ var init_version = __esm({
5617
5695
  "use strict";
5618
5696
  init_cjs_shims();
5619
5697
  version = /* @__MACRO__ $version */
5620
- "0.1.11-dev.20250406081911";
5698
+ "0.1.11-dev.20250407135241";
5621
5699
  }
5622
5700
  });
5623
5701
 
@@ -5663,7 +5741,7 @@ function createAppProcess(fileName, cwd, isDev) {
5663
5741
  panic(`Could not locate the entrypoint file: ${fileName}`);
5664
5742
  }
5665
5743
  const stdio = getStdio(isDev);
5666
- const ps = (0, import_node_child_process.spawn)(
5744
+ const ps = (0, import_node_child_process2.spawn)(
5667
5745
  "node",
5668
5746
  [
5669
5747
  `--title="CommandKit ${isDev ? "Development" : "Production"}"`,
@@ -5681,12 +5759,12 @@ function createAppProcess(fileName, cwd, isDev) {
5681
5759
  (_b = ps.stderr) == null ? void 0 : _b.pipe(process.stderr);
5682
5760
  return ps;
5683
5761
  }
5684
- var import_node_child_process, import_node_path8, import_node_fs8;
5762
+ var import_node_child_process2, import_node_path8, import_node_fs8;
5685
5763
  var init_app_process = __esm({
5686
5764
  "src/cli/app-process.ts"() {
5687
5765
  "use strict";
5688
5766
  init_cjs_shims();
5689
- import_node_child_process = require("child_process");
5767
+ import_node_child_process2 = require("child_process");
5690
5768
  init_env();
5691
5769
  import_node_path8 = require("path");
5692
5770
  import_node_fs8 = require("fs");
@@ -6401,7 +6479,7 @@ function findPackageVersion(packageName) {
6401
6479
  }
6402
6480
  function getBinaryVersion(binary) {
6403
6481
  try {
6404
- const version2 = (0, import_node_child_process2.execSync)(`${binary} --version`).toString().trim();
6482
+ const version2 = (0, import_node_child_process3.execSync)(`${binary} --version`).toString().trim();
6405
6483
  return version2;
6406
6484
  } catch {
6407
6485
  return null;
@@ -6469,13 +6547,13 @@ async function showInformation() {
6469
6547
  }
6470
6548
  console.log(output.trim());
6471
6549
  }
6472
- var import_node_os, import_node_child_process2, import_node_fs10, import_node_path11;
6550
+ var import_node_os, import_node_child_process3, import_node_fs10, import_node_path11;
6473
6551
  var init_information = __esm({
6474
6552
  "src/cli/information.ts"() {
6475
6553
  "use strict";
6476
6554
  init_cjs_shims();
6477
6555
  import_node_os = __toESM(require("os"));
6478
- import_node_child_process2 = require("child_process");
6556
+ import_node_child_process3 = require("child_process");
6479
6557
  init_version();
6480
6558
  import_node_fs10 = __toESM(require("fs"));
6481
6559
  import_node_path11 = __toESM(require("path"));
@@ -6565,6 +6643,8 @@ __export(index_exports, {
6565
6643
  isMessageSource: () => isMessageSource,
6566
6644
  isRuntimePlugin: () => isRuntimePlugin,
6567
6645
  makeContextAwareFunction: () => makeContextAwareFunction,
6646
+ onApplicationBootstrap: () => onApplicationBootstrap,
6647
+ onBootstrap: () => onBootstrap,
6568
6648
  provideContext: () => provideContext,
6569
6649
  redirect: () => redirect,
6570
6650
  rethrow: () => rethrow,
@@ -6622,6 +6702,7 @@ init_cjs_shims();
6622
6702
  var import_node_fs11 = require("fs");
6623
6703
  var import_promises8 = require("fs/promises");
6624
6704
  var import_node_path12 = require("path");
6705
+ init_types_package();
6625
6706
  async function bootstrapCommandkitCLI(argv, options) {
6626
6707
  process.title = "CommandKit CLI";
6627
6708
  const { Command } = await import("commander");
@@ -6663,12 +6744,14 @@ async function bootstrapCommandkitCLI(argv, options) {
6663
6744
  console.error("Please specify what to create: --command or --event");
6664
6745
  }
6665
6746
  });
6666
- await program.parseAsync(argv, options);
6667
6747
  const types = (0, import_node_path12.join)(process.cwd(), "node_modules", "commandkit-types");
6668
6748
  if (!(0, import_node_fs11.existsSync)(types)) {
6669
6749
  await (0, import_promises8.mkdir)(types, { recursive: true }).catch(() => {
6670
6750
  });
6751
+ await generateTypesPackage(true).catch(() => {
6752
+ });
6671
6753
  }
6754
+ await program.parseAsync(argv, options);
6672
6755
  }
6673
6756
  __name(bootstrapCommandkitCLI, "bootstrapCommandkitCLI");
6674
6757
 
@@ -6752,6 +6835,8 @@ var index_default = CommandKit;
6752
6835
  isMessageSource,
6753
6836
  isRuntimePlugin,
6754
6837
  makeContextAwareFunction,
6838
+ onApplicationBootstrap,
6839
+ onBootstrap,
6755
6840
  provideContext,
6756
6841
  redirect,
6757
6842
  rethrow,