commandkit 1.0.0-dev.20250605135449 → 1.0.0-dev.20250605142146
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 +3 -1
- package/analytics.d.ts +2 -1
- package/dist/{CommandKit-CrZN2bV4.js → CommandKit-DKSB7WUZ.js} +30 -9
- package/dist/{CommandKit-CrZN2bV4.js.map → CommandKit-DKSB7WUZ.js.map} +1 -1
- package/dist/CommandKit.js +9 -9
- package/dist/{CommandKitEventsChannel-BnSPcFdq.js → CommandKitEventsChannel-B6LKgxmv.js} +1 -1
- package/dist/{CommandKitEventsChannel-BnSPcFdq.js.map → CommandKitEventsChannel-B6LKgxmv.js.map} +1 -1
- package/dist/{CommandsRouter-B91EHi6O.js → CommandsRouter-BHaPno8o.js} +1 -1
- package/dist/{CommandsRouter-B91EHi6O.js.map → CommandsRouter-BHaPno8o.js.map} +1 -1
- package/dist/{EventsRouter-C_J0M3uO.js → EventsRouter-CqnrlbjN.js} +1 -1
- package/dist/{EventsRouter-C_J0M3uO.js.map → EventsRouter-CqnrlbjN.js.map} +1 -1
- package/dist/analytics/analytics-engine.js +9 -9
- package/dist/analytics/constants.d.ts +8 -1
- package/dist/analytics/constants.js +2 -1
- package/dist/analytics/utils.js +9 -9
- package/dist/app/commands/AppCommandRunner.js +9 -9
- package/dist/app/commands/Context.js +9 -9
- package/dist/app/handlers/AppCommandHandler.js +9 -9
- package/dist/app/handlers/AppEventsHandler.js +9 -9
- package/dist/app/index.js +9 -9
- package/dist/app/register/CommandRegistrar.js +9 -9
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/EventsRouter.js +1 -1
- package/dist/app/router/index.js +3 -3
- package/dist/{app-process-WKSL23sj.js → app-process-YbSHvqf-.js} +2 -2
- package/dist/{app-process-WKSL23sj.js.map → app-process-YbSHvqf-.js.map} +1 -1
- package/dist/{build-BXBmyQOl.js → build-DIRQN8GJ.js} +4 -4
- package/dist/{build-BXBmyQOl.js.map → build-DIRQN8GJ.js.map} +1 -1
- package/dist/cli/app-process.d.ts +2 -2
- package/dist/cli/app-process.js +3 -3
- package/dist/cli/build.js +11 -11
- package/dist/cli/common.d.ts +2 -2
- package/dist/cli/common.js +2 -2
- package/dist/cli/development.js +12 -12
- package/dist/cli/generators.js +2 -2
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +10 -10
- package/dist/cli/production.d.ts +2 -2
- package/dist/cli/production.js +12 -12
- package/dist/cli/type-checker.js +3 -3
- package/dist/{common-CoUM9Czx.js → common-CW8v7gAn.js} +2 -2
- package/dist/{common-CoUM9Czx.js.map → common-CW8v7gAn.js.map} +1 -1
- package/dist/components/index.js +9 -9
- package/dist/components/v1/button/Button.js +9 -9
- package/dist/components/v1/button/ButtonKit.js +9 -9
- package/dist/components/v1/modal/Modal.js +9 -9
- package/dist/components/v1/modal/ModalKit.js +9 -9
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +9 -9
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +9 -9
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +9 -9
- package/dist/components/v1/select-menu/SelectMenu.js +9 -9
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +9 -9
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +9 -9
- package/dist/config/config.js +9 -9
- package/dist/config/default.js +9 -9
- package/dist/config/loader.js +9 -9
- package/dist/{constants-CKVeDN4e.js → constants-Do7znYzW.js} +13 -1
- package/dist/constants-Do7znYzW.js.map +1 -0
- package/dist/context/async-context.js +9 -9
- package/dist/context/environment.js +9 -9
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{feature-flags-hv18wT96.js → feature-flags-DpEniib-.js} +2 -2
- package/dist/{feature-flags-hv18wT96.js.map → feature-flags-DpEniib-.js.map} +1 -1
- package/dist/flags/feature-flags.js +10 -10
- package/dist/flags/store.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/{init-DRva1YJD.js → init-BYIeA5Nh.js} +4 -4
- package/dist/{init-DRva1YJD.js.map → init-BYIeA5Nh.js.map} +1 -1
- package/dist/{init-CT348Okf.d.ts → init-CEa28dgv.d.ts} +3 -3
- package/dist/logger/DefaultLogger.js +9 -9
- package/dist/logger/Logger.js +9 -9
- package/dist/plugins/index.js +9 -9
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +9 -9
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +9 -9
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +9 -9
- package/dist/{store-B9bo6On8.js → store-Ci6ib2C9.js} +1 -1
- package/dist/{store-B9bo6On8.js.map → store-Ci6ib2C9.js.map} +1 -1
- package/dist/{type-checker-CfABUuLM.js → type-checker-CXVdS7qc.js} +2 -2
- package/dist/{type-checker-CfABUuLM.js.map → type-checker-CXVdS7qc.js.map} +1 -1
- package/dist/{types-package-B0Z-xrbB.js → types-package-CTSNSM93.js} +1 -1
- package/dist/{types-package-B0Z-xrbB.js.map → types-package-CTSNSM93.js.map} +1 -1
- package/dist/utils/colors.d.ts +2 -2
- package/dist/utils/dev-hooks.js +9 -9
- package/dist/utils/types-package.js +1 -1
- package/dist/utils/utilities.js +9 -9
- package/dist/{version-qguTa2LR.js → version-jzaJoR_o.js} +2 -2
- package/dist/{version-qguTa2LR.js.map → version-jzaJoR_o.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/constants-CKVeDN4e.js.map +0 -1
- /package/dist/{router-DHnFRADH.js → router-Dn35v30f.js} +0 -0
package/analytics.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const { getCommandKit } = require('./dist/
|
|
1
|
+
const { getCommandKit } = require('./dist/context/async-context.js');
|
|
2
2
|
const { AnalyticsEngine } = require('./dist/analytics/analytics-engine.js');
|
|
3
3
|
const { noAnalytics } = require('./dist/analytics/utils.js');
|
|
4
|
+
const { AnalyticsEvents } = require('./dist/analytics/constants.js');
|
|
4
5
|
|
|
5
6
|
function useAnalytics() {
|
|
6
7
|
const commandkit = getCommandKit(true);
|
|
@@ -12,6 +13,7 @@ function track(event) {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
module.exports = {
|
|
16
|
+
AnalyticsEvents,
|
|
15
17
|
AnalyticsEngine,
|
|
16
18
|
useAnalytics,
|
|
17
19
|
noAnalytics,
|
package/analytics.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { AnalyticsEngine } from './dist/
|
|
1
|
+
import type { AnalyticsEngine } from './dist/analytics/analytics-engine';
|
|
2
2
|
|
|
3
3
|
export * from './dist/analytics/analytics-engine';
|
|
4
4
|
export * from './dist/analytics/analytics-provider';
|
|
5
5
|
export { noAnalytics } from './dist/analytics/utils';
|
|
6
|
+
export { AnalyticsEvents } from './dist/analytics/constants';
|
|
6
7
|
|
|
7
8
|
export function useAnalytics(): AnalyticsEngine;
|
|
8
9
|
export function track(event: AnalyticsEvent): Promise<void>;
|
|
@@ -11,13 +11,13 @@ const require_EventWorkerContext = require('./EventWorkerContext-BAKiTqJz.js');
|
|
|
11
11
|
const require_resolve_file_url = require('./resolve-file-url-ifwdwqmq.js');
|
|
12
12
|
const require_MessageCommandParser = require('./MessageCommandParser-D02-wpZN.js');
|
|
13
13
|
const require_signals = require('./signals-scJdEbly.js');
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
14
|
+
const require_constants$1 = require('./constants-Do7znYzW.js');
|
|
15
|
+
const require_types_package = require('./types-package-CTSNSM93.js');
|
|
16
|
+
const require_CommandsRouter = require('./CommandsRouter-BHaPno8o.js');
|
|
17
|
+
const require_EventsRouter = require('./EventsRouter-CqnrlbjN.js');
|
|
18
|
+
const require_common = require('./common-CW8v7gAn.js');
|
|
19
|
+
const require_CommandKitEventsChannel = require('./CommandKitEventsChannel-B6LKgxmv.js');
|
|
20
|
+
const require_store = require('./store-Ci6ib2C9.js');
|
|
21
21
|
const node_events = require_chunk.__toESM(require("node:events"));
|
|
22
22
|
const discord_js = require_chunk.__toESM(require("discord.js"));
|
|
23
23
|
const node_async_hooks = require_chunk.__toESM(require("node:async_hooks"));
|
|
@@ -2165,18 +2165,39 @@ var AppCommandRunner = class {
|
|
|
2165
2165
|
const targetData = prepared.command.data;
|
|
2166
2166
|
const fn = targetData[executionMode];
|
|
2167
2167
|
if (!fn) Logger.warn(`Command ${prepared.command.command.name} has no handler for ${executionMode}`);
|
|
2168
|
+
const analytics = commandkit$1.analytics;
|
|
2168
2169
|
if (fn) try {
|
|
2169
2170
|
const _executeCommand = makeContextAwareFunction(env, async () => {
|
|
2170
|
-
env.registerDeferredFunction((env$1) => {
|
|
2171
|
+
env.registerDeferredFunction(async (env$1) => {
|
|
2172
|
+
var _prepared$command2;
|
|
2171
2173
|
env$1.markEnd();
|
|
2172
2174
|
const error = env$1.getExecutionError();
|
|
2173
2175
|
const marker = env$1.getMarker();
|
|
2174
2176
|
const time = `${env$1.getExecutionTime().toFixed(2)}ms`;
|
|
2175
2177
|
if (error) {
|
|
2178
|
+
var _prepared$command;
|
|
2176
2179
|
Logger.error(`[${marker} - ${time}] Error executing command: ${error.stack || error}`);
|
|
2180
|
+
await analytics.track({
|
|
2181
|
+
name: require_constants$1.AnalyticsEvents.COMMAND_EXECUTION,
|
|
2182
|
+
id: ((_prepared$command = prepared.command) === null || _prepared$command === void 0 || (_prepared$command = _prepared$command.data) === null || _prepared$command === void 0 || (_prepared$command = _prepared$command.command) === null || _prepared$command === void 0 ? void 0 : _prepared$command.name) ?? prepared.command.command.name,
|
|
2183
|
+
data: {
|
|
2184
|
+
error: true,
|
|
2185
|
+
executionTime: env$1.getExecutionTime().toFixed(2),
|
|
2186
|
+
type: executionMode
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2177
2189
|
return;
|
|
2178
2190
|
}
|
|
2179
2191
|
Logger.info(`[${marker} - ${time}] Command executed successfully`);
|
|
2192
|
+
await analytics.track({
|
|
2193
|
+
name: require_constants$1.AnalyticsEvents.COMMAND_EXECUTION,
|
|
2194
|
+
id: ((_prepared$command2 = prepared.command) === null || _prepared$command2 === void 0 || (_prepared$command2 = _prepared$command2.data) === null || _prepared$command2 === void 0 || (_prepared$command2 = _prepared$command2.command) === null || _prepared$command2 === void 0 ? void 0 : _prepared$command2.name) ?? prepared.command.command.name,
|
|
2195
|
+
data: {
|
|
2196
|
+
error: false,
|
|
2197
|
+
executionTime: env$1.getExecutionTime().toFixed(2),
|
|
2198
|
+
type: executionMode
|
|
2199
|
+
}
|
|
2200
|
+
});
|
|
2180
2201
|
});
|
|
2181
2202
|
return fn(ctx.clone());
|
|
2182
2203
|
}, this.#finalizer.bind(this));
|
|
@@ -3486,4 +3507,4 @@ Object.defineProperty(exports, 'useEnvironment', {
|
|
|
3486
3507
|
return useEnvironment;
|
|
3487
3508
|
}
|
|
3488
3509
|
});
|
|
3489
|
-
//# sourceMappingURL=CommandKit-
|
|
3510
|
+
//# sourceMappingURL=CommandKit-DKSB7WUZ.js.map
|