commandkit 1.0.0-dev.20250605125234 → 1.0.0-dev.20250605135449
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/analytics.cjs +19 -0
- package/analytics.d.ts +8 -0
- package/dist/{CommandKit-LJlFFidn.d.ts → CommandKit-CEFWQpDo.d.ts} +31 -2
- package/dist/{CommandKit-O_Ra_xRL.js → CommandKit-CrZN2bV4.js} +130 -3
- package/dist/CommandKit-CrZN2bV4.js.map +1 -0
- package/dist/CommandKit.d.ts +1 -1
- package/dist/CommandKit.js +2 -1
- package/dist/EventWorkerContext-BAKiTqJz.js.map +1 -1
- package/dist/{EventWorkerContext-sHV9x0eB.d.ts → EventWorkerContext-Dk7c6sRe.d.ts} +3 -2
- package/dist/analytics/analytics-engine.d.ts +32 -0
- package/dist/analytics/analytics-engine.js +38 -0
- package/dist/analytics/analytics-provider.d.ts +32 -0
- package/dist/analytics/constants.d.ts +5 -0
- package/dist/analytics/constants.js +3 -0
- package/dist/analytics/utils.d.ts +6 -0
- package/dist/analytics/utils.js +39 -0
- package/dist/app/commands/AppCommandRunner.d.ts +1 -1
- package/dist/app/commands/AppCommandRunner.js +2 -1
- package/dist/app/commands/Context.d.ts +1 -1
- package/dist/app/commands/Context.js +2 -1
- package/dist/app/commands/helpers.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 +2 -1
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
- package/dist/app/handlers/AppEventsHandler.js +2 -1
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +4 -3
- package/dist/app/register/CommandRegistrar.d.ts +1 -1
- package/dist/app/register/CommandRegistrar.js +2 -1
- package/dist/app-CXCbKsPz.js +0 -0
- package/dist/{app-process-DGKqfi5y.js → app-process-WKSL23sj.js} +2 -2
- package/dist/{app-process-DGKqfi5y.js.map → app-process-WKSL23sj.js.map} +1 -1
- package/dist/{build-CTiPICEJ.js → build-BXBmyQOl.js} +4 -4
- package/dist/{build-CTiPICEJ.js.map → build-BXBmyQOl.js.map} +1 -1
- package/dist/cli/app-process.d.ts +2 -2
- package/dist/cli/app-process.js +2 -2
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +5 -4
- package/dist/cli/common.d.ts +5 -5
- package/dist/cli/development.js +6 -5
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.js +1 -1
- package/dist/cli/information.js +2 -1
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +3 -2
- package/dist/cli/production.d.ts +2 -2
- package/dist/cli/production.js +7 -6
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.js +1 -1
- package/dist/cli/utils.js +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/v1/button/Button.js +2 -1
- package/dist/components/v1/button/ButtonKit.js +2 -1
- package/dist/components/v1/modal/Modal.js +2 -1
- package/dist/components/v1/modal/ModalKit.js +2 -1
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +2 -1
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +2 -1
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +2 -1
- package/dist/components/v1/select-menu/SelectMenu.js +2 -1
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +2 -1
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +2 -1
- package/dist/config/config.d.ts +4 -4
- package/dist/config/config.js +2 -1
- package/dist/config/default.d.ts +3 -3
- package/dist/config/default.js +2 -1
- package/dist/config/loader.d.ts +3 -3
- package/dist/config/loader.js +2 -1
- package/dist/config/types.d.ts +2 -2
- package/dist/config/utils.d.ts +3 -3
- package/dist/{config-bs6v9gyT.d.ts → config-BX3KH7XB.d.ts} +3 -3
- package/dist/constants-CKVeDN4e.js +14 -0
- package/dist/constants-CKVeDN4e.js.map +1 -0
- package/dist/context/async-context.d.ts +1 -1
- package/dist/context/async-context.js +2 -1
- package/dist/context/environment.d.ts +1 -1
- package/dist/context/environment.js +2 -1
- package/dist/{env-D3rn_eei.js → env-ERkaRfQO.js} +1 -1
- package/dist/{env-D3rn_eei.js.map → env-ERkaRfQO.js.map} +1 -1
- package/dist/events/CommandKitEventsChannel.d.ts +1 -1
- package/dist/{feature-flags-BXVYbfWD.js → feature-flags-hv18wT96.js} +29 -3
- package/dist/feature-flags-hv18wT96.js.map +1 -0
- package/dist/flags/feature-flags.d.ts +1 -1
- package/dist/flags/feature-flags.js +3 -2
- package/dist/flags/store.d.ts +1 -1
- package/dist/{helpers-blGYXnUH.js → helpers-CswC9gKF.js} +1 -1
- package/dist/{helpers-blGYXnUH.js.map → helpers-CswC9gKF.js.map} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/{init-CEa28dgv.d.ts → init-CT348Okf.d.ts} +3 -3
- package/dist/{init-B0Ot1AgJ.js → init-DRva1YJD.js} +2 -2
- package/dist/{init-B0Ot1AgJ.js.map → init-DRva1YJD.js.map} +1 -1
- package/dist/logger/DefaultLogger.js +2 -1
- package/dist/logger/ILogger.js +1 -1
- package/dist/logger/Logger.js +2 -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 +2 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +2 -1
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +2 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +2 -1
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/{type-checker-FHABnKlq.js → type-checker-CfABUuLM.js} +1 -1
- package/dist/{type-checker-FHABnKlq.js.map → type-checker-CfABUuLM.js.map} +1 -1
- package/dist/{types--Jq7UV8B.d.ts → types-DFaFI0H7.d.ts} +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/{utilities-DpA7EalK.d.ts → utilities-DQT4lzAB.d.ts} +14 -2
- package/dist/utils/colors.d.ts +2 -2
- package/dist/utils/dev-hooks.d.ts +1 -1
- package/dist/utils/dev-hooks.js +2 -1
- package/dist/utils/utilities.d.ts +2 -2
- package/dist/utils/utilities.js +4 -1
- package/dist/{utils-BJAW-jcv.d.ts → utils-DOSJ2rn3.d.ts} +2 -2
- package/dist/{utils-CU2bkxji.js → utils-IYtoeTur.js} +1 -1
- package/dist/{utils-CU2bkxji.js.map → utils-IYtoeTur.js.map} +1 -1
- package/dist/{version-DexUmgnc.js → version-qguTa2LR.js} +2 -2
- package/dist/{version-DexUmgnc.js.map → version-qguTa2LR.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -3
- package/dist/CommandKit-O_Ra_xRL.js.map +0 -1
- package/dist/feature-flags-BXVYbfWD.js.map +0 -1
- /package/dist/{ILogger-dQ7Y9X1f.js → ILogger-DucYb0bG.js} +0 -0
- /package/dist/{app-HN1cVg8J.js → analytics/analytics-provider.js} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
const require_CommandKit = require('./CommandKit-
|
|
1
|
+
const require_CommandKit = require('./CommandKit-CrZN2bV4.js');
|
|
2
2
|
const require_EventWorkerContext = require('./EventWorkerContext-BAKiTqJz.js');
|
|
3
3
|
|
|
4
4
|
//#region src/flags/feature-flags.ts
|
|
5
5
|
var FeatureFlag = class {
|
|
6
|
+
commandkit;
|
|
6
7
|
constructor(options) {
|
|
7
8
|
this.options = options;
|
|
8
|
-
|
|
9
|
+
this.commandkit = require_CommandKit.getCommandKit(true);
|
|
10
|
+
const FlagStore = this.commandkit.flags;
|
|
9
11
|
if (FlagStore.has(options.key)) throw new Error(`Feature flag with key "${options.key}" already exists.`);
|
|
10
12
|
FlagStore.set(options.key, this);
|
|
11
13
|
}
|
|
@@ -49,11 +51,35 @@ var FeatureFlag = class {
|
|
|
49
51
|
}
|
|
50
52
|
async execute(res) {
|
|
51
53
|
const { decide, identify } = this.options;
|
|
54
|
+
const identificationStart = performance.now();
|
|
52
55
|
const entities = res ?? await (async () => {
|
|
53
56
|
const ctx = this.getContext();
|
|
54
57
|
return await (identify === null || identify === void 0 ? void 0 : identify(ctx)) ?? {};
|
|
55
58
|
})();
|
|
59
|
+
const identificationTime = performance.now() - identificationStart;
|
|
60
|
+
const decisionStart = performance.now();
|
|
56
61
|
const decisionResult = await decide({ entities });
|
|
62
|
+
const decisionTime = performance.now() - decisionStart;
|
|
63
|
+
require_CommandKit.defer(async () => {
|
|
64
|
+
await this.commandkit.analytics.track({
|
|
65
|
+
name: "feature_flag_metrics",
|
|
66
|
+
data: {
|
|
67
|
+
flag: this.options.key,
|
|
68
|
+
identificationTime: identificationTime.toFixed(2),
|
|
69
|
+
decisionTime: decisionTime.toFixed(2)
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
require_CommandKit.defer(async () => {
|
|
74
|
+
await this.commandkit.analytics.track({
|
|
75
|
+
name: "feature_flag_decision",
|
|
76
|
+
id: entities && typeof entities === "object" && "id" in entities && typeof entities.id === "string" ? entities.id : void 0,
|
|
77
|
+
data: {
|
|
78
|
+
flag: this.options.key,
|
|
79
|
+
decision: require_CommandKit.JsonSerialize(decisionResult, "unknown")
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
57
83
|
return decisionResult;
|
|
58
84
|
}
|
|
59
85
|
};
|
|
@@ -82,4 +108,4 @@ Object.defineProperty(exports, 'flag', {
|
|
|
82
108
|
return flag;
|
|
83
109
|
}
|
|
84
110
|
});
|
|
85
|
-
//# sourceMappingURL=feature-flags-
|
|
111
|
+
//# sourceMappingURL=feature-flags-hv18wT96.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-flags-hv18wT96.js","names":[],"sources":["../src/flags/feature-flags.ts"],"sourcesContent":["import { getCommandKit, getContext } from '../context/async-context';\nimport { eventWorkerContext } from '../app/events/EventWorkerContext';\nimport { ParsedEvent } from '../app/router';\nimport { CommandKit } from '../CommandKit';\nimport {\n AutocompleteInteraction,\n ChatInputCommandInteraction,\n Client,\n ClientEvents,\n ContextMenuCommandInteraction,\n Guild,\n Message,\n TextBasedChannel,\n} from 'discord.js';\nimport { LoadedCommand } from '../app';\nimport { defer, JsonSerialize } from '../utils/utilities';\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type IdentifyFunction<R> = (\n context: EvaluationContext,\n) => MaybePromise<R>;\n\nexport type DecideFunction<E, R> = (data: { entities: E }) => MaybePromise<R>;\n\nexport interface FeatureFlagDefinition<R, Entity> {\n key: string;\n description?: string;\n identify?: IdentifyFunction<Entity>;\n decide: DecideFunction<Entity, R>;\n}\n\nexport interface CommandFlagContext {\n client: Client<true>;\n commandkit: CommandKit;\n command: {\n interaction?:\n | ChatInputCommandInteraction\n | AutocompleteInteraction\n | ContextMenuCommandInteraction;\n message?: Message;\n guild: Guild | null;\n channel: TextBasedChannel | null;\n command: LoadedCommand;\n };\n event: null;\n}\n\nexport interface EventFlagContext {\n client: Client<true>;\n commandkit: CommandKit;\n event: {\n data: ParsedEvent;\n event: string;\n namespace: string | null;\n arguments: any[];\n argumentsAs<E extends keyof ClientEvents>(event: E): ClientEvents[E];\n };\n command: null;\n}\n\nexport type EvaluationContext = CommandFlagContext | EventFlagContext;\n\nexport type CustomEvaluationFunction<E> = () => MaybePromise<E>;\n\nexport type CustomEvaluationContext<E> = {\n identify: E | CustomEvaluationFunction<E>;\n};\n\nexport interface FlagRunner<E, R> {\n (): Promise<R>;\n run(context: CustomEvaluationContext<E>): Promise<R>;\n}\n\nexport class FeatureFlag<R, T> {\n private commandkit: CommandKit;\n public constructor(public readonly options: FeatureFlagDefinition<R, T>) {\n this.commandkit = getCommandKit(true);\n const FlagStore = this.commandkit.flags;\n\n if (FlagStore.has(options.key)) {\n throw new Error(`Feature flag with key \"${options.key}\" already exists.`);\n }\n\n FlagStore.set(options.key, this);\n }\n\n private getContext(): EvaluationContext {\n const env = getContext();\n\n if (env?.context) {\n const {\n client,\n commandkit,\n interaction,\n message,\n guild,\n channel,\n command,\n } = env.context;\n\n return {\n client: client as Client<true>,\n commandkit,\n command: {\n interaction,\n message,\n guild,\n channel,\n command,\n },\n event: null,\n };\n }\n\n const eventCtx = eventWorkerContext.getStore();\n\n if (eventCtx) {\n const { commandkit, data, event, namespace } = eventCtx;\n\n return {\n client: commandkit.client as Client<true>,\n commandkit,\n event: {\n data,\n event,\n namespace,\n arguments: eventCtx.arguments,\n argumentsAs: (eventName) => {\n const args = eventCtx.arguments as ClientEvents[typeof eventName];\n return args;\n },\n },\n command: null,\n };\n }\n\n throw new Error(\n 'Could not determine the execution context. Feature flags may only be used inside a command or event.',\n );\n }\n\n public async execute(res?: T): Promise<R> {\n const { decide, identify } = this.options;\n\n const identificationStart = performance.now();\n const entities =\n res ??\n (await (async () => {\n const ctx = this.getContext();\n return (await identify?.(ctx)) ?? ({} as T);\n })());\n const identificationTime = performance.now() - identificationStart;\n\n const decisionStart = performance.now();\n const decisionResult = await decide({\n entities,\n });\n const decisionTime = performance.now() - decisionStart;\n\n defer(async () => {\n await this.commandkit.analytics.track({\n name: 'feature_flag_metrics',\n data: {\n flag: this.options.key,\n identificationTime: identificationTime.toFixed(2),\n decisionTime: decisionTime.toFixed(2),\n },\n });\n });\n\n defer(async () => {\n await this.commandkit.analytics.track({\n name: 'feature_flag_decision',\n id:\n entities &&\n typeof entities === 'object' &&\n 'id' in entities &&\n typeof entities.id === 'string'\n ? entities.id\n : undefined,\n data: {\n flag: this.options.key,\n decision: JsonSerialize(decisionResult, 'unknown'),\n },\n });\n });\n\n return decisionResult as R;\n }\n}\n\nexport function flag<Returns = boolean, Entity = Record<any, any>>(\n options: FeatureFlagDefinition<Returns, Entity>,\n): FlagRunner<Entity, Returns> {\n const flag = new FeatureFlag<Returns, Entity>(options);\n const runner = flag.execute.bind(flag, undefined) as FlagRunner<\n Entity,\n Returns\n >;\n\n runner.run = async function (ctx) {\n if (!ctx?.identify) {\n throw new Error(\n 'Custom evaluation context must have an identify function or object.',\n );\n }\n\n const context = (\n typeof ctx === 'function'\n ? await (ctx as CustomEvaluationFunction<Entity>)()\n : ctx\n ) as Entity;\n\n const decisionResult = await flag.execute(context);\n\n return decisionResult;\n };\n\n return runner;\n}\n"],"mappings":";;;;AA0EA,IAAa,cAAb,MAA+B;CAC7B,AAAQ;CACR,AAAO,YAA4B,SAAsC;EAAtC;AACjC,OAAK,aAAa,iCAAc,KAAK;EACrC,MAAM,YAAY,KAAK,WAAW;AAElC,MAAI,UAAU,IAAI,QAAQ,IAAI,CAC5B,OAAM,IAAI,OAAO,yBAAyB,QAAQ,IAAI;AAGxD,YAAU,IAAI,QAAQ,KAAK,KAAK;CAClC;CAEA,AAAQ,aAAgC;EACtC,MAAM,MAAM,+BAAY;AAExB,gDAAI,IAAK,SAAS;GAChB,MAAM,EACJ,QACA,YACA,aACA,SACA,OACA,SACA,SACD,GAAG,IAAI;AAER,UAAO;IACG;IACR;IACA,SAAS;KACP;KACA;KACA;KACA;KACA;IACD;IACD,OAAO;GACR;EACH;EAEA,MAAM,WAAW,8CAAmB,UAAU;AAE9C,MAAI,UAAU;GACZ,MAAM,EAAE,YAAY,MAAM,OAAO,WAAW,GAAG;AAE/C,UAAO;IACL,QAAQ,WAAW;IACnB;IACA,OAAO;KACL;KACA;KACA;KACA,WAAW,SAAS;KACpB,aAAa,CAAC,cAAc;MAC1B,MAAM,OAAO,SAAS;AACtB,aAAO;KACR;IACF;IACD,SAAS;GACV;EACH;AAEA,QAAM,IAAI,MACR;CAEJ;CAEA,MAAa,QAAQ,KAAqB;EACxC,MAAM,EAAE,QAAQ,UAAU,GAAG,KAAK;EAElC,MAAM,sBAAsB,YAAY,KAAK;EAC7C,MAAM,WACN,OACA,MAAM,CAAC,YAAY;GACjB,MAAM,MAAM,KAAK,YAAY;AAC7B,UAAQ,2DAAM,SAAW,IAAI,KAAK,CAAE;EACrC,IAAG;EACJ,MAAM,qBAAqB,YAAY,KAAK,GAAG;EAE/C,MAAM,gBAAgB,YAAY,KAAK;EACvC,MAAM,iBAAiB,MAAM,OAAO,EAClC,SACD,EAAC;EACF,MAAM,eAAe,YAAY,KAAK,GAAG;AAEzC,2BAAM,YAAY;AAChB,SAAM,KAAK,WAAW,UAAU,MAAM;IACpC,MAAM;IACN,MAAM;KACJ,MAAM,KAAK,QAAQ;KACnB,oBAAoB,mBAAmB,QAAQ,EAAE;KACjD,cAAc,aAAa,QAAQ,EAAE;IACtC;GACF,EAAC;EACH,EAAC;AAEF,2BAAM,YAAY;AAChB,SAAM,KAAK,WAAW,UAAU,MAAM;IACpC,MAAM;IACN,IACA,mBACO,aAAa,YACpB,QAAQ,mBACD,SAAS,OAAO,WACvB,SAAS;IAET,MAAM;KACJ,MAAM,KAAK,QAAQ;KACnB,UAAU,iCAAc,gBAAgB,UAAU;IACnD;GACF,EAAC;EACH,EAAC;AAEF,SAAO;CACT;AACF;AAEA,SAAgB,KAChB,SAC8B;CAC5B,MAAM,SAAO,IAAI,YAA6B;CAC9C,MAAM,SAAS,OAAK,QAAQ,KAAK,eAAgB;AAKjD,QAAO,MAAM,eAAgB,KAAK;AAChC,kDAAK,IAAK,UACR,OAAM,IAAI,MACR;EAIJ,MAAM,iBACC,QAAQ,aACf,MAAM,AAAC,KAA0C,GACjD;EAGA,MAAM,iBAAiB,MAAM,OAAK,QAAQ,QAAQ;AAElD,SAAO;CACR;AAED,QAAO;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandFlagContext, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, FeatureFlag, FeatureFlagDefinition, FlagRunner, IdentifyFunction, MaybePromise, flag } from "../CommandKit-
|
|
1
|
+
import { CommandFlagContext, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, FeatureFlag, FeatureFlagDefinition, FlagRunner, IdentifyFunction, MaybePromise, flag } from "../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../ModalKit-CKtQ8eXW.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C_UO39jz.js');
|
|
4
|
-
require('../CommandKit-
|
|
4
|
+
require('../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-CeO-vn8Y.js');
|
|
7
7
|
require('../container-CpuiLsZM.js');
|
|
@@ -33,7 +33,8 @@ require('../router-DHnFRADH.js');
|
|
|
33
33
|
require('../common-CoUM9Czx.js');
|
|
34
34
|
require('../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../store-B9bo6On8.js');
|
|
36
|
-
|
|
36
|
+
require('../constants-CKVeDN4e.js');
|
|
37
|
+
const require_feature_flags = require('../feature-flags-hv18wT96.js');
|
|
37
38
|
|
|
38
39
|
exports.FeatureFlag = require_feature_flags.FeatureFlag;
|
|
39
40
|
exports.flag = require_feature_flags.flag;
|
package/dist/flags/store.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-
|
|
1
|
+
{"version":3,"file":"helpers-CswC9gKF.js","names":[],"sources":["../src/app/commands/helpers.ts"],"sourcesContent":["import { Interaction, Message } from 'discord.js';\n\nexport type CommandSource = Interaction | Message;\n\nexport function isMessageSource(source: CommandSource): source is Message {\n return source instanceof Message;\n}\n\nexport function isInteractionSource(\n source: CommandSource,\n): source is Interaction {\n return !isMessageSource(source);\n}\n"],"mappings":";;;;AAIA,SAAgB,gBAAgB,QAA0C;AACxE,QAAO,kBAAkB;AAC3B;AAEA,SAAgB,oBAChB,QACwB;AACtB,SAAQ,gBAAgB,OAAO;AACjC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AppCommandHandler, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, FeatureFlag, FeatureFlagDefinition, FlagRunner, GenericFunction, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, useEnvironment } from "./CommandKit-
|
|
1
|
+
import { AnyCommandExecute, AppCommandHandler, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, FeatureFlag, FeatureFlagDefinition, FlagRunner, GenericFunction, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, useEnvironment } from "./CommandKit-CEFWQpDo.js";
|
|
2
2
|
import { EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler } from "./EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import { ButtonKit, ButtonKitPredicate, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, OnButtonKitClick, OnButtonKitEnd } from "./ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import { CommandKitModalBuilderInteractionCollectorDispatch, CommandKitModalBuilderInteractionCollectorDispatchContextData, CommandKitModalBuilderOnEnd, ModalKit, ModalKitPredicate, OnModalKitEnd, OnModalKitSubmit } from "./ModalKit-CKtQ8eXW.js";
|
|
@@ -29,14 +29,14 @@ import { Command, CommandsRouter, CommandsRouterOptions, Middleware, ParsedComma
|
|
|
29
29
|
import { EventsRouter, EventsRouterOptions, EventsTree, ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
30
30
|
import "./index-CUPkUUOR.js";
|
|
31
31
|
import { COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_CLI, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, HMREventType } from "./constants-BPWSrMkn.js";
|
|
32
|
-
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "./EventWorkerContext-
|
|
33
|
-
import "./types
|
|
34
|
-
import "./utils-
|
|
35
|
-
import { bootstrapCommandkitCLI } from "./init-
|
|
36
|
-
import { defineConfig, getConfig } from "./config-
|
|
32
|
+
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "./EventWorkerContext-Dk7c6sRe.js";
|
|
33
|
+
import "./types-DFaFI0H7.js";
|
|
34
|
+
import "./utils-DOSJ2rn3.js";
|
|
35
|
+
import { bootstrapCommandkitCLI } from "./init-CT348Okf.js";
|
|
36
|
+
import { defineConfig, getConfig } from "./config-BX3KH7XB.js";
|
|
37
37
|
import { ILogger } from "./ILogger-kqwb2kUu.js";
|
|
38
38
|
import { DefaultLogger } from "./DefaultLogger-CcW-Fuq5.js";
|
|
39
39
|
import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "./Logger-B4B_URL-.js";
|
|
40
40
|
import { version } from "./version-DggMfP_1.js";
|
|
41
|
-
import { StopEventPropagationError, debounce, devOnly, getCurrentDirectory, getSourceDirectories, stopEvents } from "./utilities-
|
|
41
|
+
import { StopEventPropagationError, debounce, devOnly, getCurrentDirectory, getSourceDirectories, stopEvents } from "./utilities-DQT4lzAB.js";
|
|
42
42
|
export { ActionRow, ActionRowProps, AnyCommandExecute, AnyCommandKitElement, AppCommandHandler, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, Button, ButtonChildrenLike, ButtonKit, ButtonKitPredicate, ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_CLI, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, ChannelSelectMenu, ChannelSelectMenuKit, ChannelSelectMenuKitPredicate, ChannelSelectMenuProps, ChatInputCommand, ChatInputCommandContext, Command, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, CommandKitConfiguration, CommandKitElement, CommandKitElementData, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitHMREvent, CommandKitLoggerOptions, CommandKitModalBuilderInteractionCollectorDispatch, CommandKitModalBuilderInteractionCollectorDispatchContextData, CommandKitModalBuilderOnEnd, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, CommandSource, CommandTypeData, CommandsRouter, CommandsRouterOptions, CommonBuilderKit, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, ContainerProps, Context, ContextParameters, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DefaultLogger, ElementType, EvaluationContext, EventFlagContext, EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler, EventWorkerContext, EventsRouter, EventsRouterOptions, EventsTree, FeatureFlag, FeatureFlagDefinition, File, FileProps, FlagRunner, Fragment, FragmentElementProps, GenericFunction, HMREventType, ILogger, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, Logger, LoggerImpl, MaybeArray, MaybeFalsey, MaybePromise, MediaGallery, MediaGalleryItem, MediaGalleryItemProps, MediaGalleryProps, MentionableSelectMenu, MentionableSelectMenuKit, MentionableSelectMenuKitPredicate, MentionableSelectMenuProps, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, Middleware, MiddlewareContext, MiddlewareContextArgs, Modal, ModalKit, ModalKitPredicate, ModalProps, OnButtonKitClick, OnButtonKitEnd, OnChannelSelectMenuKitSubmit, OnMentionableSelectMenuKitSubmit, OnModalKitEnd, OnModalKitSubmit, OnRoleSelectMenuKitSubmit, OnSelectMenuKitEnd, OnSelectMenuKitSubmit, OnStringSelectMenuKitSubmit, OnUserSelectMenuKitSubmit, ParagraphInput, ParsedCommandData, ParsedEvent, ParsedMessageCommand, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolveBuilderInteraction, RoleSelectMenu, RoleSelectMenuKit, RoleSelectMenuKitPredicate, RoleSelectMenuProps, RunCommand, RuntimePlugin, Section, SectionProps, SelectMenuKitPredicate, SelectMenuProps, Separator, SeparatorProps, ShortInput, SlashCommandMiddlewareContext, StopEventPropagationError, StringEncodable, StringSelectMenu, StringSelectMenuKit, StringSelectMenuKitPredicate, StringSelectMenuOption, StringSelectMenuOptionProps, StringSelectMenuProps, TemplateHandler, TextDisplay, TextDisplayProps, TextInput, TextInputProps, Thumbnail, ThumbnailProps, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, UserSelectMenuKitPredicate, UserSelectMenuProps, after, bootstrapCommandkitCLI, cancelAfter, commandkit, createElement, createElement as jsx, createElement as jsxs, createLogger, debounce, CommandKit as default, defineConfig, devOnly, eventWorkerContext, exitContext, exitMiddleware, flag, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getEventWorkerContext, getSourceDirectories, isCommandKitElement, isCommandWorkerContext, isCompilerPlugin, isEventWorkerContext, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, runInEventWorkerContext, stopEvents, useEnvironment, version };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
2
2
|
require('./colors-Cd4Oz-r-.js');
|
|
3
3
|
const require_ActionRow = require('./ActionRow-CmTHbo2t.js');
|
|
4
4
|
require('./error-codes-C_UO39jz.js');
|
|
5
|
-
const require_CommandKit = require('./CommandKit-
|
|
5
|
+
const require_CommandKit = require('./CommandKit-CrZN2bV4.js');
|
|
6
6
|
require('./common-CcfjYnPG.js');
|
|
7
7
|
require('./common-CeO-vn8Y.js');
|
|
8
8
|
const require_container = require('./container-CpuiLsZM.js');
|
|
@@ -34,12 +34,13 @@ require('./router-DHnFRADH.js');
|
|
|
34
34
|
require('./common-CoUM9Czx.js');
|
|
35
35
|
require('./CommandKitEventsChannel-BnSPcFdq.js');
|
|
36
36
|
require('./store-B9bo6On8.js');
|
|
37
|
-
|
|
38
|
-
require('./
|
|
39
|
-
require('./
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const
|
|
37
|
+
require('./constants-CKVeDN4e.js');
|
|
38
|
+
const require_helpers = require('./helpers-CswC9gKF.js');
|
|
39
|
+
require('./app-CXCbKsPz.js');
|
|
40
|
+
require('./ILogger-DucYb0bG.js');
|
|
41
|
+
const require_version = require('./version-qguTa2LR.js');
|
|
42
|
+
const require_feature_flags = require('./feature-flags-hv18wT96.js');
|
|
43
|
+
const require_init = require('./init-DRva1YJD.js');
|
|
43
44
|
|
|
44
45
|
//#region src/index.ts
|
|
45
46
|
var src_default = require_CommandKit.CommandKit;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { CommandKit } from './CommandKit';\n\nexport default CommandKit;\n\nexport * from './CommandKit';\nexport * from './components';\nexport * from './config/config';\nexport * from './context/async-context';\nexport * from './context/environment';\nexport * from './app/index';\nexport * from './logger/DefaultLogger';\nexport * from './logger/ILogger';\nexport * from './logger/Logger';\nexport * from './app/router/index';\nexport type * from './types';\nexport * from './version';\nexport * from './plugins/index';\nexport * from './flags/feature-flags';\nexport {\n getCurrentDirectory,\n getSourceDirectories,\n devOnly,\n debounce,\n stopEvents,\n StopEventPropagationError,\n} from './utils/utilities';\nexport type { CommandKitHMREvent } from './utils/dev-hooks';\nexport * from './utils/constants';\nexport * from './app/events/EventWorkerContext';\n\n// cli\nexport { bootstrapCommandkitCLI } from './cli/init';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { CommandKit } from './CommandKit';\n\nexport default CommandKit;\n\nexport * from './CommandKit';\nexport * from './components';\nexport * from './config/config';\nexport * from './context/async-context';\nexport * from './context/environment';\nexport * from './app/index';\nexport * from './logger/DefaultLogger';\nexport * from './logger/ILogger';\nexport * from './logger/Logger';\nexport * from './app/router/index';\nexport type * from './types';\nexport * from './version';\nexport * from './plugins/index';\nexport * from './flags/feature-flags';\nexport {\n getCurrentDirectory,\n getSourceDirectories,\n devOnly,\n debounce,\n stopEvents,\n StopEventPropagationError,\n} from './utils/utilities';\nexport type { CommandKitHMREvent } from './utils/dev-hooks';\nexport * from './utils/constants';\nexport * from './app/events/EventWorkerContext';\n\n// cli\nexport { bootstrapCommandkitCLI } from './cli/init';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as commander2 from "commander";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/init.d.ts
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import * as commander1 from "commander";
|
|
|
7
7
|
* @param argv The arguments passed to the CLI.
|
|
8
8
|
* @param options The options passed to the CLI.
|
|
9
9
|
*/
|
|
10
|
-
declare function bootstrapCommandkitCLI(argv: string[], options?:
|
|
10
|
+
declare function bootstrapCommandkitCLI(argv: string[], options?: commander2.ParseOptions | undefined): Promise<void>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { bootstrapCommandkitCLI };
|
|
13
|
-
//# sourceMappingURL=init-
|
|
13
|
+
//# sourceMappingURL=init-CT348Okf.d.ts.map
|
|
@@ -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-CrZN2bV4.js');
|
|
3
3
|
const require_CompilerPlugin = require('./CompilerPlugin-DrnhOC1c.js');
|
|
4
4
|
const require_CompilerPluginRuntime = require('./CompilerPluginRuntime-C9wmPMQf.js');
|
|
5
5
|
const require_types_package = require('./types-package-B0Z-xrbB.js');
|
|
@@ -89,4 +89,4 @@ Object.defineProperty(exports, 'bootstrapCommandkitCLI', {
|
|
|
89
89
|
return bootstrapCommandkitCLI;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
//# sourceMappingURL=init-
|
|
92
|
+
//# sourceMappingURL=init-DRva1YJD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-
|
|
1
|
+
{"version":3,"file":"init-DRva1YJD.js","names":[],"sources":["../src/cli/init.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { generateTypesPackage } from '../utils/types-package';\nimport { loadConfigFile } from '../config/loader';\nimport {\n CompilerPlugin,\n CompilerPluginRuntime,\n isCompilerPlugin,\n} from '../plugins';\nimport { panic } from './common';\n\n/**\n * Creates a command line interface for CommandKit.\n * @param argv The arguments passed to the CLI.\n * @param options The options passed to the CLI.\n */\nexport async function bootstrapCommandkitCLI(\n argv: string[],\n options?: import('commander').ParseOptions | undefined,\n) {\n process.title = 'CommandKit CLI';\n\n // imports are lazily loaded when the cli is used, instead of loading it with the lib itself\n const { Command } = await import('commander');\n const { bootstrapDevelopmentServer } = await import('./development');\n const { bootstrapProductionServer, createProductionBuild } = await import(\n './production'\n );\n const { generateCommand, generateEvent } = await import('./generators');\n const { version } = await import('../version');\n const { showInformation } = await import('./information');\n const { setCLIEnv } = await import('./env');\n\n const program = new Command('commandkit');\n\n program\n .command('dev')\n .version(version)\n .description('Start your bot in development mode.')\n .option(\n '-c, --config [path]',\n 'Path to your commandkit config file.',\n './commandkit.js',\n )\n .action(() => {\n const options = program.opts();\n bootstrapDevelopmentServer(options.config);\n });\n\n program\n .command('info')\n .description(\n 'Show information about the system which can be used to report bugs.',\n )\n .action(async () => {\n await showInformation();\n });\n\n program\n .command('start')\n .description(\n 'Start your bot in production mode after running the build command.',\n )\n .option('-c, --config [path]', 'Path to your commandkit config file.')\n .action(() => {\n const options = program.opts();\n bootstrapProductionServer(options.config);\n });\n\n program\n .command('build')\n .description('Build your project for production usage.')\n .option('-c, --config [path]', 'Path to your commandkit config file.')\n .action(() => {\n setCLIEnv();\n const options = program.opts();\n return createProductionBuild(options.config);\n });\n\n program\n .command('create')\n .description(\n 'Create new files using built-in templates or custom plugin templates',\n )\n .argument(\n '<template>',\n 'The template to use (e.g. command, event, or custom plugin template)',\n )\n .argument('[args...]', 'Additional arguments for the template')\n .action(async (template, args) => {\n setCLIEnv();\n\n // Handle custom plugin templates\n const { plugins } = await loadConfigFile();\n const runtime = new CompilerPluginRuntime(\n plugins.filter((p) => isCompilerPlugin(p)) as CompilerPlugin[],\n );\n\n try {\n await runtime.init();\n const templateHandler = runtime.getTemplate(template);\n\n if (!templateHandler) {\n // Handle built-in templates\n if (template === 'command') {\n const [name] = args;\n if (!name) {\n panic('Command name is required');\n }\n await generateCommand(name);\n return;\n }\n\n if (template === 'event') {\n const [name] = args;\n if (!name) {\n panic('Event name is required');\n }\n await generateEvent(name);\n return;\n }\n\n const valid = Array.from(\n new Set([\n 'command',\n 'event',\n ...Array.from(runtime.getTemplates().keys()),\n ]),\n ).map((t) => `\"${t}\"`);\n\n panic(\n `Template \"${template}\" not found. Available templates: ${valid.join(', ')}`,\n );\n }\n\n await templateHandler(args);\n } catch (e: any) {\n panic(`Failed to execute template \"${template}\": ${e?.message || e}`);\n } finally {\n await runtime.destroy();\n }\n });\n\n const types = join(process.cwd(), 'node_modules', 'commandkit-types');\n\n if (!existsSync(types)) {\n await mkdir(types, { recursive: true }).catch(() => {});\n await generateTypesPackage(true).catch(() => {});\n }\n\n await program.parseAsync(argv, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,eAAsB,uBACtB,MACA,SACA;AACE,SAAQ,QAAQ;CAGhB,MAAM,EAAE,SAAS,GAAG,MAAM,OAAO;CACjC,MAAM,EAAE,4BAA4B,GAAG,2CAAM;CAC7C,MAAM,EAAE,2BAA2B,uBAAuB,GAAG,2CAAM;CAGnE,MAAM,EAAE,iBAAiB,eAAe,GAAG,2CAAM;CACjD,MAAM,EAAE,SAAS,GAAG,2CAAM;CAC1B,MAAM,EAAE,iBAAiB,GAAG,2CAAM;CAClC,MAAM,EAAE,WAAW,GAAG,2CAAM;CAE5B,MAAM,UAAU,IAAI,QAAQ;AAE5B,SACA,QAAQ,MAAM,CACd,QAAQ,QAAQ,CAChB,YAAY,sCAAsC,CAClD,OACE,uBACA,wCACA,kBACD,CACD,OAAO,MAAM;EACX,MAAM,YAAU,QAAQ,MAAM;AAC9B,6BAA2B,UAAQ,OAAO;CAC3C,EAAC;AAEF,SACA,QAAQ,OAAO,CACf,YACE,sEACD,CACD,OAAO,YAAY;AACjB,QAAM,iBAAiB;CACxB,EAAC;AAEF,SACA,QAAQ,QAAQ,CAChB,YACE,qEACD,CACD,OAAO,uBAAuB,uCAAuC,CACrE,OAAO,MAAM;EACX,MAAM,YAAU,QAAQ,MAAM;AAC9B,4BAA0B,UAAQ,OAAO;CAC1C,EAAC;AAEF,SACA,QAAQ,QAAQ,CAChB,YAAY,2CAA2C,CACvD,OAAO,uBAAuB,uCAAuC,CACrE,OAAO,MAAM;AACX,aAAW;EACX,MAAM,YAAU,QAAQ,MAAM;AAC9B,SAAO,sBAAsB,UAAQ,OAAO;CAC7C,EAAC;AAEF,SACA,QAAQ,SAAS,CACjB,YACE,uEACD,CACD,SACE,cACA,uEACD,CACD,SAAS,aAAa,wCAAwC,CAC9D,OAAO,OAAO,UAAU,SAAS;AAC/B,aAAW;EAGX,MAAM,EAAE,SAAS,GAAG,MAAM,mCAAgB;EAC1C,MAAM,UAAU,IAAI,oDAClB,QAAQ,OAAO,CAAC,MAAM,wCAAiB,EAAE,CAAC;AAG5C,MAAI;AACF,SAAM,QAAQ,MAAM;GACpB,MAAM,kBAAkB,QAAQ,YAAY,SAAS;AAErD,QAAK,iBAAiB;AAEpB,QAAI,aAAa,WAAW;KAC1B,MAAM,CAAC,KAAK,GAAG;AACf,UAAK,KACH,sBAAM,2BAA2B;AAEnC,WAAM,gBAAgB,KAAK;AAC3B;IACD;AAED,QAAI,aAAa,SAAS;KACxB,MAAM,CAAC,KAAK,GAAG;AACf,UAAK,KACH,sBAAM,yBAAyB;AAEjC,WAAM,cAAc,KAAK;AACzB;IACD;IAED,MAAM,QAAQ,MAAM,KAClB,IAAI,IAAI;KACR;KACA;KACA,GAAG,MAAM,KAAK,QAAQ,cAAc,CAAC,MAAM,CAAC;IAAC,GAE9C,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG;AAEtB,0BACG,YAAY,SAAS,oCAAoC,MAAM,KAAK,KAAK,CAAC,EAC5E;GACF;AAED,SAAM,gBAAgB,KAAK;EAC5B,SAAQ,GAAQ;AACf,yBAAO,8BAA8B,SAAS,4CAAK,EAAG,YAAW,EAAE,EAAE;EACtE,UAAS;AACR,SAAM,QAAQ,SAAS;EACxB;CACF,EAAC;CAEF,MAAM,QAAQ,oBAAK,QAAQ,KAAK,EAAE,gBAAgB,mBAAmB;AAErE,MAAK,wBAAW,MAAM,EAAE;AACtB,QAAM,4BAAM,OAAO,EAAE,WAAW,KAAM,EAAC,CAAC,MAAM,MAAM,CAAE,EAAC;AACvD,QAAM,2CAAqB,KAAK,CAAC,MAAM,MAAM,CAAE,EAAC;CAClD;AAEA,OAAM,QAAQ,WAAW,MAAM,QAAQ;AACzC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-CeO-vn8Y.js');
|
|
7
7
|
require('../container-CpuiLsZM.js');
|
|
@@ -33,5 +33,6 @@ require('../router-DHnFRADH.js');
|
|
|
33
33
|
require('../common-CoUM9Czx.js');
|
|
34
34
|
require('../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../store-B9bo6On8.js');
|
|
36
|
+
require('../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.DefaultLogger = require_CommandKit.DefaultLogger;
|
package/dist/logger/ILogger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require('../ILogger-
|
|
1
|
+
require('../ILogger-DucYb0bG.js');
|
package/dist/logger/Logger.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_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-CeO-vn8Y.js');
|
|
7
7
|
require('../container-CpuiLsZM.js');
|
|
@@ -33,6 +33,7 @@ require('../router-DHnFRADH.js');
|
|
|
33
33
|
require('../common-CoUM9Czx.js');
|
|
34
34
|
require('../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../store-B9bo6On8.js');
|
|
36
|
+
require('../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.Logger = require_CommandKit.Logger;
|
|
38
39
|
exports.createLogger = require_CommandKit.createLogger;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin } from "../CommandKit-
|
|
1
|
+
import { CompilerPlugin, PluginTransformParameters, TransformedResult, isCompilerPlugin } from "../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../ModalKit-CKtQ8eXW.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginCommon, PluginOptions, PluginType, isPlugin } from "../CommandKit-
|
|
1
|
+
import { PluginCommon, PluginOptions, PluginType, isPlugin } from "../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../ModalKit-CKtQ8eXW.js";
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKitEventDispatch, CommandKitPlugin, CommandKitPluginRuntime, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, MaybeFalsey, PluginTransformParameters, RuntimePlugin, TemplateHandler, TransformedResult, isCompilerPlugin, isRuntimePlugin } from "../CommandKit-
|
|
1
|
+
import { CommandKitEventDispatch, CommandKitPlugin, CommandKitPluginRuntime, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, MaybeFalsey, PluginTransformParameters, RuntimePlugin, TemplateHandler, TransformedResult, isCompilerPlugin, isRuntimePlugin } from "../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../ModalKit-CKtQ8eXW.js";
|
package/dist/plugins/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_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-CeO-vn8Y.js');
|
|
7
7
|
require('../container-CpuiLsZM.js');
|
|
@@ -33,6 +33,7 @@ require('../router-DHnFRADH.js');
|
|
|
33
33
|
require('../common-CoUM9Czx.js');
|
|
34
34
|
require('../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../store-B9bo6On8.js');
|
|
36
|
+
require('../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.CommandKitPluginRuntime = require_CommandKit.CommandKitPluginRuntime;
|
|
38
39
|
exports.CommonDirectiveTransformer = require_CommandKit.CommonDirectiveTransformer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../error-codes-C_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-CeO-vn8Y.js');
|
|
7
7
|
require('../../container-CpuiLsZM.js');
|
|
@@ -33,5 +33,6 @@ require('../../router-DHnFRADH.js');
|
|
|
33
33
|
require('../../common-CoUM9Czx.js');
|
|
34
34
|
require('../../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../../store-B9bo6On8.js');
|
|
36
|
+
require('../../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.CommandKitPluginRuntime = require_CommandKit.CommandKitPluginRuntime;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommonDirectiveTransformer, CommonDirectiveTransformerOptions } from "../../../CommandKit-
|
|
1
|
+
import { CommonDirectiveTransformer, CommonDirectiveTransformerOptions } from "../../../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../../../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../../../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../../../ModalKit-CKtQ8eXW.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../../error-codes-C_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../../../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../../../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../../common-CeO-vn8Y.js');
|
|
7
7
|
require('../../../container-CpuiLsZM.js');
|
|
@@ -33,5 +33,6 @@ require('../../../router-DHnFRADH.js');
|
|
|
33
33
|
require('../../../common-CoUM9Czx.js');
|
|
34
34
|
require('../../../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../../../store-B9bo6On8.js');
|
|
36
|
+
require('../../../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.CommonDirectiveTransformer = require_CommandKit.CommonDirectiveTransformer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompilerPlugin, MaybeFalsey, PluginTransformParameters, TransformedResult } from "../../../CommandKit-
|
|
1
|
+
import { CompilerPlugin, MaybeFalsey, PluginTransformParameters, TransformedResult } from "../../../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../../../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../../../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../../../ModalKit-CKtQ8eXW.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../../../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../../../error-codes-C_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../../../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../../../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../../common-CeO-vn8Y.js');
|
|
7
7
|
require('../../../container-CpuiLsZM.js');
|
|
@@ -33,5 +33,6 @@ require('../../../router-DHnFRADH.js');
|
|
|
33
33
|
require('../../../common-CoUM9Czx.js');
|
|
34
34
|
require('../../../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../../../store-B9bo6On8.js');
|
|
36
|
+
require('../../../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.MacroPlugin = require_CommandKit.MacroPlugin;
|
package/dist/plugins/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKitEventDispatch, CommandKitPlugin, MaybeFalsey, TemplateHandler } from "../CommandKit-
|
|
1
|
+
import { CommandKitEventDispatch, CommandKitPlugin, MaybeFalsey, TemplateHandler } from "../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../ModalKit-CKtQ8eXW.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-checker-
|
|
1
|
+
{"version":3,"file":"type-checker-CfABUuLM.js","names":[],"sources":["../src/cli/type-checker.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { loadTypeScript } from './common';\nimport { join, relative } from 'node:path';\nimport colors from '../utils/colors';\n\nconst TS_NOT_FOUND_ERR = `TypeScript must be installed in order to use the type checker. Please install it using \\`npm install typescript\\` or \\`yarn add typescript\\``;\n\n/**\n * Formats a TypeScript diagnostic message in a pretty, readable format\n */\nfunction formatDiagnostic(\n ts: typeof import('typescript'),\n diagnostic: import('typescript').Diagnostic,\n cwd: string,\n): string {\n const messageText = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n '\\n',\n );\n\n if (!diagnostic.file) {\n return `${colors.red('error')}: ${messageText}`;\n }\n\n const { line, character } = ts.getLineAndCharacterOfPosition(\n diagnostic.file,\n diagnostic.start!,\n );\n const fileName = relative(cwd, diagnostic.file.fileName);\n const position = `${line + 1}:${character + 1}`;\n const errorCode = diagnostic.code ? `TS${diagnostic.code}` : '';\n\n // Format the error message nicely\n return [\n `${colors.bold(colors.cyan(fileName))}:${colors.bold(colors.yellow(position))} - ${colors.red('error')} ${colors.gray(errorCode)}`,\n `${messageText}`,\n ].join('\\n');\n}\n\n/**\n * Performs a type check on the project using TypeScript.\n * @param path The project root or cwd\n */\nexport async function performTypeCheck(path: string) {\n const tsconfigPath = join(path, 'tsconfig.json');\n\n if (!existsSync(tsconfigPath)) return;\n\n const ts = await loadTypeScript(TS_NOT_FOUND_ERR);\n\n // Format host for error reporting\n const formatHost = {\n getCanonicalFileName: (path: string) => path,\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n };\n\n // Read tsconfig.json\n const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n\n if (configFile.error) {\n console.error(\n colors.red(\n `Error reading tsconfig.json: ${ts.formatDiagnostic(configFile.error, formatHost)}`,\n ),\n );\n process.exit(1);\n }\n\n // Parse the config file\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n path,\n );\n\n // Force noEmit to true as we only want type checking\n parsedConfig.options.noEmit = true;\n\n // Create a program\n const program = ts.createProgram({\n rootNames: parsedConfig.fileNames,\n options: parsedConfig.options,\n projectReferences: parsedConfig.projectReferences,\n });\n\n // Get the diagnostics\n const diagnostics = [\n ...program.getOptionsDiagnostics(),\n ...program.getGlobalDiagnostics(),\n ...program.getSyntacticDiagnostics(),\n ...program.getSemanticDiagnostics(),\n ];\n\n // Report any errors\n if (diagnostics.length > 0) {\n console.log('');\n console.error(\n colors.bold(\n colors.red('Type checking failed with the following errors:'),\n ),\n );\n console.log('');\n\n // Group diagnostics by file for better readability\n const byFile = new Map<string, import('typescript').Diagnostic[]>();\n\n for (const diagnostic of diagnostics) {\n const fileName = diagnostic.file ? diagnostic.file.fileName : 'Global';\n if (!byFile.has(fileName)) {\n byFile.set(fileName, []);\n }\n byFile.get(fileName)!.push(diagnostic);\n }\n\n // Pretty-print each diagnostic\n const totalErrors = diagnostics.length;\n let counter = 0;\n\n for (const [_, fileDiags] of byFile) {\n for (const diagnostic of fileDiags) {\n counter++;\n console.log(formatDiagnostic(ts, diagnostic, path));\n // Add separator between errors for better readability, except for the last one\n if (counter < totalErrors) {\n console.log('');\n }\n }\n }\n\n console.log('');\n console.error(\n colors.bold(\n colors.red(`Found ${totalErrors} error${totalErrors > 1 ? 's' : ''}`),\n ),\n );\n console.log('');\n\n process.exit(1);\n }\n\n console.log(colors.green('✓ Type checking completed successfully.'));\n}\n"],"mappings":";;;;;;;AAKA,MAAM,oBAAoB;;;;AAK1B,SAAS,iBACT,IACA,YACA,KACS;CACP,MAAM,cAAc,GAAG,6BACrB,WAAW,aACX,KACD;AAED,MAAK,WAAW,KACd,SAAQ,EAAE,8BAAO,IAAI,QAAQ,CAAC,IAAI,YAAY;CAGhD,MAAM,EAAE,MAAM,WAAW,GAAG,GAAG,8BAC7B,WAAW,MACX,WAAW,MACZ;CACD,MAAM,WAAW,wBAAS,KAAK,WAAW,KAAK,SAAS;CACxD,MAAM,YAAY,EAAE,OAAO,EAAE,GAAG,YAAY,EAAE;CAC9C,MAAM,YAAY,WAAW,QAAQ,IAAI,WAAW,KAAK,IAAI;AAG7D,QAAO,EACN,EAAE,8BAAO,KAAK,8BAAO,KAAK,SAAS,CAAC,CAAC,GAAG,8BAAO,KAAK,8BAAO,OAAO,SAAS,CAAC,CAAC,KAAK,8BAAO,IAAI,QAAQ,CAAC,GAAG,8BAAO,KAAK,UAAU,CAAC,IAChI,EAAE,YAAY,CAAE,EACjB,KAAK,KAAK;AACZ;;;;;AAMA,eAAsB,iBAAiB,MAAc;CACnD,MAAM,eAAe,oBAAK,MAAM,gBAAgB;AAEhD,MAAK,wBAAW,aAAa,CAAE;CAE/B,MAAM,KAAK,MAAM,8BAAe,iBAAiB;CAGjD,MAAM,aAAa;EACjB,sBAAsB,CAAC,WAAiB;EACxC,qBAAqB,GAAG,IAAI;EAC5B,YAAY,MAAM,GAAG,IAAI;CAC1B;CAGD,MAAM,aAAa,GAAG,eAAe,cAAc,GAAG,IAAI,SAAS;AAEnE,KAAI,WAAW,OAAO;AACpB,UAAQ,MACN,8BAAO,KACJ,+BAA+B,GAAG,iBAAiB,WAAW,OAAO,WAAW,CAAC,EACnF,CACF;AACD,UAAQ,KAAK,EAAE;CACjB;CAGA,MAAM,eAAe,GAAG,2BACtB,WAAW,QACX,GAAG,KACH,KACD;AAGD,cAAa,QAAQ,SAAS;CAG9B,MAAM,UAAU,GAAG,cAAc;EAC/B,WAAW,aAAa;EACxB,SAAS,aAAa;EACtB,mBAAmB,aAAa;CACjC,EAAC;CAGF,MAAM,cAAc;EACpB,GAAG,QAAQ,uBAAuB;EAClC,GAAG,QAAQ,sBAAsB;EACjC,GAAG,QAAQ,yBAAyB;EACpC,GAAG,QAAQ,wBAAwB;CAAC;AAIpC,KAAI,YAAY,SAAS,GAAG;AAC1B,UAAQ,IAAI,GAAG;AACf,UAAQ,MACN,8BAAO,KACL,8BAAO,IAAI,kDAAkD,CAC9D,CACF;AACD,UAAQ,IAAI,GAAG;EAGf,MAAM,yBAAS,IAAI;AAEnB,OAAK,MAAM,cAAc,aAAa;GACpC,MAAM,WAAW,WAAW,OAAO,WAAW,KAAK,WAAW;AAC9D,QAAK,OAAO,IAAI,SAAS,CACvB,QAAO,IAAI,UAAU,CAAE,EAAC;AAE1B,UAAO,IAAI,SAAS,CAAE,KAAK,WAAW;EACxC;EAGA,MAAM,cAAc,YAAY;EAChC,IAAI,UAAU;AAEd,OAAK,MAAM,CAAC,GAAG,UAAU,IAAI,OAC3B,MAAK,MAAM,cAAc,WAAW;AAClC;AACA,WAAQ,IAAI,iBAAiB,IAAI,YAAY,KAAK,CAAC;AAEnD,OAAI,UAAU,YACZ,SAAQ,IAAI,GAAG;EAEnB;AAGF,UAAQ,IAAI,GAAG;AACf,UAAQ,MACN,8BAAO,KACL,8BAAO,KAAK,QAAQ,YAAY,QAAQ,cAAc,IAAI,MAAM,GAAG,EAAE,CACtE,CACF;AACD,UAAQ,IAAI,GAAG;AAEf,UAAQ,KAAK,EAAE;CACjB;AAEA,SAAQ,IAAI,8BAAO,MAAM,0CAA0C,CAAC;AACtE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKitPlugin } from "./CommandKit-
|
|
1
|
+
import { CommandKitPlugin } from "./CommandKit-CEFWQpDo.js";
|
|
2
2
|
import { MaybeArray } from "./types-CJ-XvOFN.js";
|
|
3
3
|
|
|
4
4
|
//#region src/config/types.d.ts
|
|
@@ -70,4 +70,4 @@ interface CommandKitConfig {
|
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
export { CommandKitConfig };
|
|
73
|
-
//# sourceMappingURL=types
|
|
73
|
+
//# sourceMappingURL=types-DFaFI0H7.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandContext, CommandData, CommandKitOptions } from "./CommandKit-
|
|
1
|
+
import { CommandContext, CommandData, CommandKitOptions } from "./CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "./EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "./ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "./ModalKit-CKtQ8eXW.js";
|
|
@@ -13,6 +13,18 @@ declare function findAppDirectory(): string | null;
|
|
|
13
13
|
* @returns The debounced function.
|
|
14
14
|
*/
|
|
15
15
|
declare function debounce<R, F extends (...args: any[]) => R>(fn: F, ms: number): F;
|
|
16
|
+
/**
|
|
17
|
+
* Defers the execution of a function.
|
|
18
|
+
* @param fn The function to defer.
|
|
19
|
+
*/
|
|
20
|
+
declare function defer<T>(fn: () => T, timeout?: number): void;
|
|
21
|
+
/**
|
|
22
|
+
* Serializes a value to JSON.
|
|
23
|
+
* @param value The value to serialize.
|
|
24
|
+
* @param defaultValue The default value to return if the value is not serializable.
|
|
25
|
+
* @returns The serialized value.
|
|
26
|
+
*/
|
|
27
|
+
declare function JsonSerialize<R = any>(value: any, defaultValue?: R): R;
|
|
16
28
|
/**
|
|
17
29
|
* Creates a function from the given function that runs only in development mode.
|
|
18
30
|
* @param fn The function to run in development mode.
|
|
@@ -48,5 +60,5 @@ interface SimpleProxy<T extends object> {
|
|
|
48
60
|
*/
|
|
49
61
|
declare function createProxy<T extends object>(target: T): SimpleProxy<T>;
|
|
50
62
|
//#endregion
|
|
51
|
-
export { SimpleProxy, StopEventPropagationError, createProxy, debounce, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, stopEvents };
|
|
52
|
-
//# sourceMappingURL=utilities-
|
|
63
|
+
export { JsonSerialize, SimpleProxy, StopEventPropagationError, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, stopEvents };
|
|
64
|
+
//# sourceMappingURL=utilities-DQT4lzAB.d.ts.map
|
package/dist/utils/colors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as picocolors_types4 from "picocolors/types";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/colors.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: picocolors_types4.Colors;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|
|
7
7
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKitHMREvent, registerDevHooks } from "../CommandKit-
|
|
1
|
+
import { CommandKitHMREvent, registerDevHooks } from "../CommandKit-CEFWQpDo.js";
|
|
2
2
|
import "../EventInterceptor-D_oEWSnF.js";
|
|
3
3
|
import "../ButtonKit-BSI7lCI0.js";
|
|
4
4
|
import "../ModalKit-CKtQ8eXW.js";
|
package/dist/utils/dev-hooks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-Cd4Oz-r-.js');
|
|
2
2
|
require('../ActionRow-CmTHbo2t.js');
|
|
3
3
|
require('../error-codes-C_UO39jz.js');
|
|
4
|
-
const require_CommandKit = require('../CommandKit-
|
|
4
|
+
const require_CommandKit = require('../CommandKit-CrZN2bV4.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-CeO-vn8Y.js');
|
|
7
7
|
require('../container-CpuiLsZM.js');
|
|
@@ -33,5 +33,6 @@ require('../router-DHnFRADH.js');
|
|
|
33
33
|
require('../common-CoUM9Czx.js');
|
|
34
34
|
require('../CommandKitEventsChannel-BnSPcFdq.js');
|
|
35
35
|
require('../store-B9bo6On8.js');
|
|
36
|
+
require('../constants-CKVeDN4e.js');
|
|
36
37
|
|
|
37
38
|
exports.registerDevHooks = require_CommandKit.registerDevHooks;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SimpleProxy, StopEventPropagationError, createProxy, debounce, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, stopEvents } from "../utilities-
|
|
2
|
-
export { SimpleProxy, StopEventPropagationError, createProxy, debounce, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, stopEvents };
|
|
1
|
+
import { JsonSerialize, SimpleProxy, StopEventPropagationError, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, stopEvents } from "../utilities-DQT4lzAB.js";
|
|
2
|
+
export { JsonSerialize, SimpleProxy, StopEventPropagationError, createProxy, debounce, defer, devOnly, findAppDirectory, getCurrentDirectory, getSourceDirectories, stopEvents };
|