reciple 10.1.1 → 10.2.0
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/_virtual/{_@oxc-project_runtime@0.122.0/helpers → _@oxc-project_runtime@0.135.0/helpers/esm}/decorate.mjs +1 -1
- package/dist/classes/cli/CLI.mjs +2 -1
- package/dist/classes/cli/ConfigReader.mjs +2 -0
- package/dist/classes/client/ModuleLoader.mjs +5 -4
- package/dist/classes/managers/ModuleManager.mjs +10 -9
- package/dist/classes/modules/PostconditionModule.mjs +2 -2
- package/dist/classes/modules/PreconditionModule.mjs +2 -2
- package/dist/classes/modules/commands/ContextMenuCommandModule.mjs +2 -2
- package/dist/classes/modules/commands/MessageCommandModule.mjs +2 -2
- package/dist/classes/modules/commands/SlashCommandModule.mjs +2 -2
- package/dist/classes/modules/events/EventModule.mjs +1 -1
- package/dist/classes/templates/ModuleTemplateBuilder.mjs +14 -15
- package/dist/classes/templates/TemplateBuilder.mjs +4 -0
- package/dist/classes/validation/BaseModuleValidator.d.mts +9 -10
- package/dist/classes/validation/CommandModuleValidator.d.mts +19 -21
- package/dist/classes/validation/EventModuleValidator.d.mts +8 -9
- package/dist/classes/validation/PostconditionModule.d.mts +7 -8
- package/dist/classes/validation/PreconditionModule.d.mts +6 -7
- package/dist/helpers/types.d.mts +1 -1
- package/dist/package.mjs +9 -9
- package/package.json +13 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.135.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
package/dist/classes/cli/CLI.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import { colors } from "@prtty/prtty";
|
|
|
11
11
|
|
|
12
12
|
//#region src/classes/cli/CLI.ts
|
|
13
13
|
var CLI = class {
|
|
14
|
+
options;
|
|
14
15
|
build;
|
|
15
16
|
version;
|
|
16
17
|
command;
|
|
@@ -94,7 +95,7 @@ var CLI = class {
|
|
|
94
95
|
(function(_CLI) {
|
|
95
96
|
_CLI.root = path.join(path.dirname(fileURLToPath(import.meta.url)), "../../../");
|
|
96
97
|
_CLI.bin = path.join(CLI.root, "dist/bin/reciple.mjs");
|
|
97
|
-
_CLI.version = "10.
|
|
98
|
+
_CLI.version = "10.2.0";
|
|
98
99
|
function stringifyFlags(flags, command, ignored = []) {
|
|
99
100
|
let arr = [];
|
|
100
101
|
for (const [key, value] of Object.entries(flags)) {
|
|
@@ -9,6 +9,7 @@ import { createJiti } from "jiti";
|
|
|
9
9
|
|
|
10
10
|
//#region src/classes/cli/ConfigReader.ts
|
|
11
11
|
var ConfigReader = class ConfigReader {
|
|
12
|
+
filepath;
|
|
12
13
|
_client = null;
|
|
13
14
|
_config = null;
|
|
14
15
|
_build = null;
|
|
@@ -115,6 +116,7 @@ var ConfigReader = class ConfigReader {
|
|
|
115
116
|
platform: "node",
|
|
116
117
|
format: "esm",
|
|
117
118
|
unbundle: true,
|
|
119
|
+
workspace: void 0,
|
|
118
120
|
deps: {
|
|
119
121
|
neverBundle: ["reciple", /^@reciple\//],
|
|
120
122
|
skipNodeModulesBundle: true
|
|
@@ -23,6 +23,7 @@ import { EventEmitter } from "node:events";
|
|
|
23
23
|
|
|
24
24
|
//#region src/classes/client/ModuleLoader.ts
|
|
25
25
|
var ModuleLoader = class ModuleLoader extends EventEmitter {
|
|
26
|
+
client;
|
|
26
27
|
logger;
|
|
27
28
|
constructor(client) {
|
|
28
29
|
super();
|
|
@@ -99,7 +100,7 @@ var ModuleLoader = class ModuleLoader extends EventEmitter {
|
|
|
99
100
|
const data = recursiveDefaults(await import(`file://${path.resolve(options?.cwd ?? process.cwd(), filepath)}`));
|
|
100
101
|
if (BaseModule.isModule(data)) return data;
|
|
101
102
|
if (data && "moduleType" in data) switch (data?.moduleType) {
|
|
102
|
-
case
|
|
103
|
+
case 2:
|
|
103
104
|
CommandModuleValidator.isValid(data);
|
|
104
105
|
switch (data.type) {
|
|
105
106
|
case CommandType.Message: return MessageCommandModule.from(data);
|
|
@@ -107,13 +108,13 @@ var ModuleLoader = class ModuleLoader extends EventEmitter {
|
|
|
107
108
|
case CommandType.ContextMenu: return ContextMenuCommandModule.from(data);
|
|
108
109
|
default: throw new RecipleError(`Unknown command type from module: ${colors.cyan(filepath)}`);
|
|
109
110
|
}
|
|
110
|
-
case
|
|
111
|
+
case 3:
|
|
111
112
|
EventModuleValidator.isValid(data);
|
|
112
113
|
return EventModule.from(data);
|
|
113
|
-
case
|
|
114
|
+
case 4:
|
|
114
115
|
PreconditionModuleValidator.isValid(data);
|
|
115
116
|
return PreconditionModule.from(data);
|
|
116
|
-
case
|
|
117
|
+
case 5:
|
|
117
118
|
PostconditionModuleValidator.isValid(data);
|
|
118
119
|
return PostconditionModule.from(data);
|
|
119
120
|
default:
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BaseModule } from "../modules/BaseModule.mjs";
|
|
2
2
|
import { ModuleType } from "../../helpers/constants.mjs";
|
|
3
|
-
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { BaseManager, RecipleError } from "@reciple/core";
|
|
5
5
|
import { mix } from "ts-mixer";
|
|
6
6
|
import { EventEmitter } from "node:events";
|
|
7
7
|
|
|
8
8
|
//#region src/classes/managers/ModuleManager.ts
|
|
9
9
|
let ModuleManager = class ModuleManager {
|
|
10
|
+
client;
|
|
10
11
|
holds = BaseModule;
|
|
11
12
|
constructor(client) {
|
|
12
13
|
this.client = client;
|
|
@@ -61,16 +62,16 @@ let ModuleManager = class ModuleManager {
|
|
|
61
62
|
this.cache.set(module.id, module);
|
|
62
63
|
if (!("moduleType" in module)) return;
|
|
63
64
|
switch (module.moduleType) {
|
|
64
|
-
case
|
|
65
|
+
case 2:
|
|
65
66
|
this.client.commands?.add(module);
|
|
66
67
|
break;
|
|
67
|
-
case
|
|
68
|
+
case 3:
|
|
68
69
|
this.client.eventListeners.register(module);
|
|
69
70
|
break;
|
|
70
|
-
case
|
|
71
|
+
case 4:
|
|
71
72
|
this.client.preconditions?.cache.set(module.id, module);
|
|
72
73
|
break;
|
|
73
|
-
case
|
|
74
|
+
case 5:
|
|
74
75
|
this.client.postconditions?.cache.set(module.id, module);
|
|
75
76
|
break;
|
|
76
77
|
default: break;
|
|
@@ -80,16 +81,16 @@ let ModuleManager = class ModuleManager {
|
|
|
80
81
|
this.cache.delete(module.id);
|
|
81
82
|
if (!("moduleType" in module)) return;
|
|
82
83
|
switch (module.moduleType) {
|
|
83
|
-
case
|
|
84
|
+
case 2:
|
|
84
85
|
this.client.commands?.cache.delete(module.id);
|
|
85
86
|
break;
|
|
86
|
-
case
|
|
87
|
+
case 3:
|
|
87
88
|
this.client.eventListeners.unregister(module);
|
|
88
89
|
break;
|
|
89
|
-
case
|
|
90
|
+
case 4:
|
|
90
91
|
this.client.preconditions?.cache.delete(module.id);
|
|
91
92
|
break;
|
|
92
|
-
case
|
|
93
|
+
case 5:
|
|
93
94
|
this.client.postconditions?.cache.delete(module.id);
|
|
94
95
|
break;
|
|
95
96
|
default: break;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BaseModule } from "./BaseModule.mjs";
|
|
2
2
|
import { ModuleType } from "../../helpers/constants.mjs";
|
|
3
|
-
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { CommandPostcondition } from "@reciple/core";
|
|
5
5
|
import { hasMixin, mix } from "ts-mixer";
|
|
6
6
|
|
|
7
7
|
//#region src/classes/modules/PostconditionModule.ts
|
|
8
8
|
var _PostconditionModule;
|
|
9
9
|
let PostconditionModule = _PostconditionModule = class PostconditionModule {
|
|
10
|
-
moduleType =
|
|
10
|
+
moduleType = 5;
|
|
11
11
|
static from(data) {
|
|
12
12
|
if (hasMixin(data, _PostconditionModule)) return data;
|
|
13
13
|
const ModuleInstance = class extends _PostconditionModule {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BaseModule } from "./BaseModule.mjs";
|
|
2
2
|
import { ModuleType } from "../../helpers/constants.mjs";
|
|
3
|
-
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { CommandPrecondition } from "@reciple/core";
|
|
5
5
|
import { hasMixin, mix } from "ts-mixer";
|
|
6
6
|
|
|
7
7
|
//#region src/classes/modules/PreconditionModule.ts
|
|
8
8
|
var _PreconditionModule;
|
|
9
9
|
let PreconditionModule = _PreconditionModule = class PreconditionModule {
|
|
10
|
-
moduleType =
|
|
10
|
+
moduleType = 4;
|
|
11
11
|
static from(data) {
|
|
12
12
|
if (hasMixin(data, _PreconditionModule)) return data;
|
|
13
13
|
const ModuleInstance = class extends _PreconditionModule {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModule } from "../BaseModule.mjs";
|
|
2
2
|
import { ModuleType } from "../../../helpers/constants.mjs";
|
|
3
|
-
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { ContextMenuCommand } from "@reciple/core";
|
|
5
5
|
import { DiscordSnowflake } from "@sapphire/snowflake";
|
|
6
6
|
import { hasMixin, mix } from "ts-mixer";
|
|
@@ -8,7 +8,7 @@ import { hasMixin, mix } from "ts-mixer";
|
|
|
8
8
|
//#region src/classes/modules/commands/ContextMenuCommandModule.ts
|
|
9
9
|
var _ContextMenuCommandModule;
|
|
10
10
|
let ContextMenuCommandModule = _ContextMenuCommandModule = class ContextMenuCommandModule {
|
|
11
|
-
moduleType =
|
|
11
|
+
moduleType = 2;
|
|
12
12
|
id = DiscordSnowflake.generate().toString();
|
|
13
13
|
static from(data) {
|
|
14
14
|
if (hasMixin(data, _ContextMenuCommandModule)) return data;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModule } from "../BaseModule.mjs";
|
|
2
2
|
import { ModuleType } from "../../../helpers/constants.mjs";
|
|
3
|
-
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { MessageCommand, MessageCommandBuilder } from "@reciple/core";
|
|
5
5
|
import { DiscordSnowflake } from "@sapphire/snowflake";
|
|
6
6
|
import { hasMixin, mix } from "ts-mixer";
|
|
@@ -8,7 +8,7 @@ import { hasMixin, mix } from "ts-mixer";
|
|
|
8
8
|
//#region src/classes/modules/commands/MessageCommandModule.ts
|
|
9
9
|
var _MessageCommandModule;
|
|
10
10
|
let MessageCommandModule = _MessageCommandModule = class MessageCommandModule {
|
|
11
|
-
moduleType =
|
|
11
|
+
moduleType = 2;
|
|
12
12
|
id = DiscordSnowflake.generate().toString();
|
|
13
13
|
static from(data) {
|
|
14
14
|
if (hasMixin(data, _MessageCommandModule)) return data;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseModule } from "../BaseModule.mjs";
|
|
2
2
|
import { ModuleType } from "../../../helpers/constants.mjs";
|
|
3
|
-
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.mjs";
|
|
4
4
|
import { SlashCommand } from "@reciple/core";
|
|
5
5
|
import { DiscordSnowflake } from "@sapphire/snowflake";
|
|
6
6
|
import { hasMixin, mix } from "ts-mixer";
|
|
@@ -8,7 +8,7 @@ import { hasMixin, mix } from "ts-mixer";
|
|
|
8
8
|
//#region src/classes/modules/commands/SlashCommandModule.ts
|
|
9
9
|
var _SlashCommandModule;
|
|
10
10
|
let SlashCommandModule = _SlashCommandModule = class SlashCommandModule {
|
|
11
|
-
moduleType =
|
|
11
|
+
moduleType = 2;
|
|
12
12
|
id = DiscordSnowflake.generate().toString();
|
|
13
13
|
static from(data) {
|
|
14
14
|
if (hasMixin(data, _SlashCommandModule)) return data;
|
|
@@ -5,7 +5,7 @@ import { EventEmitter } from "node:events";
|
|
|
5
5
|
|
|
6
6
|
//#region src/classes/modules/events/EventModule.ts
|
|
7
7
|
var EventModule = class EventModule extends BaseModule {
|
|
8
|
-
moduleType =
|
|
8
|
+
moduleType = 3;
|
|
9
9
|
once = false;
|
|
10
10
|
static from(data) {
|
|
11
11
|
if (hasMixin(data, EventModule)) return data;
|
|
@@ -205,7 +205,7 @@ var ModuleTemplateBuilder = class ModuleTemplateBuilder {
|
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
207
|
(function(_ModuleTemplateBuilder) {
|
|
208
|
-
|
|
208
|
+
_ModuleTemplateBuilder.Placeholder = /* @__PURE__ */ function(Placeholder) {
|
|
209
209
|
Placeholder["ModuleName"] = "$MODULE_NAME$";
|
|
210
210
|
Placeholder["CommandName"] = "$COMMAND_NAME$";
|
|
211
211
|
Placeholder["CommandDescription"] = "$COMMAND_DESCRIPTION$";
|
|
@@ -215,34 +215,33 @@ var ModuleTemplateBuilder = class ModuleTemplateBuilder {
|
|
|
215
215
|
Placeholder["EventOnce"] = "$EVENT_ONCE$";
|
|
216
216
|
return Placeholder;
|
|
217
217
|
}({});
|
|
218
|
-
_ModuleTemplateBuilder.Placeholder = Placeholder;
|
|
219
218
|
_ModuleTemplateBuilder.PlaceholderDefaultValues = {
|
|
220
|
-
[
|
|
221
|
-
[
|
|
222
|
-
[
|
|
223
|
-
[
|
|
224
|
-
[
|
|
225
|
-
[
|
|
226
|
-
[
|
|
219
|
+
["$MODULE_NAME$"]: "MyModule",
|
|
220
|
+
["$COMMAND_NAME$"]: "my-command",
|
|
221
|
+
["$COMMAND_DESCRIPTION$"]: "My command",
|
|
222
|
+
["$COMMAND_CONTEXT_MENU_TYPE$"]: `${ApplicationCommandType.Message}`,
|
|
223
|
+
["$EVENT_EMITTER$"]: "null",
|
|
224
|
+
["$EVENT_NAME$"]: "my-event",
|
|
225
|
+
["$EVENT_ONCE$"]: "false"
|
|
227
226
|
};
|
|
228
227
|
_ModuleTemplateBuilder.SourceDirectory = {
|
|
229
228
|
js: path.join(CLI.root, "./assets/modules/javascript"),
|
|
230
229
|
ts: path.join(CLI.root, "./assets/modules/typescript")
|
|
231
230
|
};
|
|
232
231
|
const ModuleTypeClassName = _ModuleTemplateBuilder.ModuleTypeClassName = {
|
|
233
|
-
[
|
|
234
|
-
[
|
|
232
|
+
[1]: [BaseModule.name],
|
|
233
|
+
[2]: [
|
|
235
234
|
MessageCommandModule.name,
|
|
236
235
|
SlashCommandModule.name,
|
|
237
236
|
ContextMenuCommandModule.name
|
|
238
237
|
],
|
|
239
|
-
[
|
|
238
|
+
[3]: [
|
|
240
239
|
ClientEventModule.name,
|
|
241
240
|
EventModule.name,
|
|
242
241
|
RESTEventModule.name
|
|
243
242
|
],
|
|
244
|
-
[
|
|
245
|
-
[
|
|
243
|
+
[5]: [PostconditionModule.name],
|
|
244
|
+
[4]: [PreconditionModule.name]
|
|
246
245
|
};
|
|
247
246
|
async function resolveModuleTemplates(source) {
|
|
248
247
|
const src = ModuleTemplateBuilder.SourceDirectory[source];
|
|
@@ -263,7 +262,7 @@ var ModuleTemplateBuilder = class ModuleTemplateBuilder {
|
|
|
263
262
|
}
|
|
264
263
|
_ModuleTemplateBuilder.resolveModuleTemplates = resolveModuleTemplates;
|
|
265
264
|
function getModuleTemplateContentType(content) {
|
|
266
|
-
const createExtendStatement = (name) => `export class
|
|
265
|
+
const createExtendStatement = (name) => `export class \$MODULE_NAME\$ extends ${name}`;
|
|
267
266
|
for (const type of Object.keys(ModuleTypeClassName).map(Number)) {
|
|
268
267
|
const statements = ModuleTypeClassName[type].map(createExtendStatement);
|
|
269
268
|
for (const statement of statements) if (content.includes(statement)) return type;
|
|
@@ -224,6 +224,10 @@ var TemplateBuilder = class TemplateBuilder {
|
|
|
224
224
|
private: true,
|
|
225
225
|
type: "module",
|
|
226
226
|
scripts: {
|
|
227
|
+
...this.typescript ? {
|
|
228
|
+
check: "tsc --noEmit",
|
|
229
|
+
"check:watch": "tsc --noEmit --watch"
|
|
230
|
+
} : {},
|
|
227
231
|
build: `reciple build`,
|
|
228
232
|
start: "reciple start",
|
|
229
233
|
dev: "nodemon"
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { ModuleType } from "../../helpers/constants.mjs";
|
|
2
2
|
import { AnyModuleData } from "../../helpers/types.mjs";
|
|
3
3
|
import { Validator } from "@reciple/core";
|
|
4
|
-
import * as _$_sapphire_shapeshift0 from "@sapphire/shapeshift";
|
|
5
4
|
|
|
6
5
|
//#region src/classes/validation/BaseModuleValidator.d.ts
|
|
7
6
|
declare class BaseModuleValidator extends Validator {
|
|
8
|
-
static id:
|
|
9
|
-
static moduleType:
|
|
10
|
-
static onEnable:
|
|
11
|
-
static onReady:
|
|
12
|
-
static onDisable:
|
|
13
|
-
static object:
|
|
7
|
+
static id: import("@sapphire/shapeshift").StringValidator<string>;
|
|
8
|
+
static moduleType: import("@sapphire/shapeshift").NativeEnumValidator<typeof ModuleType>;
|
|
9
|
+
static onEnable: import("@sapphire/shapeshift").UnionValidator<Function | undefined>;
|
|
10
|
+
static onReady: import("@sapphire/shapeshift").UnionValidator<Function | undefined>;
|
|
11
|
+
static onDisable: import("@sapphire/shapeshift").UnionValidator<Function | undefined>;
|
|
12
|
+
static object: import("@sapphire/shapeshift").ObjectValidator<{
|
|
14
13
|
id: string | undefined;
|
|
15
14
|
moduleType: ModuleType | undefined;
|
|
16
15
|
onEnable: Function | undefined;
|
|
17
16
|
onReady: Function | undefined;
|
|
18
17
|
onDisable: Function | undefined;
|
|
19
|
-
},
|
|
18
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
20
19
|
id: string | undefined;
|
|
21
20
|
moduleType: ModuleType | undefined;
|
|
22
21
|
onEnable: Function | undefined;
|
|
23
22
|
onReady: Function | undefined;
|
|
24
23
|
onDisable: Function | undefined;
|
|
25
24
|
}>>;
|
|
26
|
-
static resolvable:
|
|
25
|
+
static resolvable: import("@sapphire/shapeshift").UnionValidator<import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
27
26
|
id: string | undefined;
|
|
28
27
|
moduleType: ModuleType | undefined;
|
|
29
28
|
onEnable: Function | undefined;
|
|
30
29
|
onReady: Function | undefined;
|
|
31
30
|
onDisable: Function | undefined;
|
|
32
|
-
}> |
|
|
31
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
33
32
|
toJSON: Function;
|
|
34
33
|
}>>;
|
|
35
34
|
static isValidId(id: unknown): asserts id is string;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ModuleType } from "../../helpers/constants.mjs";
|
|
2
2
|
import { AnyCommandModuleData } from "../../helpers/types.mjs";
|
|
3
|
-
import * as _$_reciple_core0 from "@reciple/core";
|
|
4
3
|
import { Validator } from "@reciple/core";
|
|
5
|
-
import * as _$_sapphire_shapeshift0 from "@sapphire/shapeshift";
|
|
6
4
|
|
|
7
5
|
//#region src/classes/validation/CommandModuleValidator.d.ts
|
|
8
6
|
declare class CommandModuleValidator extends Validator {
|
|
9
|
-
static object:
|
|
7
|
+
static object: import("@sapphire/shapeshift").ObjectValidator<{
|
|
10
8
|
id: string | undefined;
|
|
11
9
|
moduleType: ModuleType | undefined;
|
|
12
10
|
onEnable: Function | undefined;
|
|
@@ -14,24 +12,24 @@ declare class CommandModuleValidator extends Validator {
|
|
|
14
12
|
onDisable: Function | undefined;
|
|
15
13
|
} & {
|
|
16
14
|
id: string;
|
|
17
|
-
type:
|
|
18
|
-
data:
|
|
15
|
+
type: import("@reciple/core").CommandType;
|
|
16
|
+
data: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
19
17
|
name: any;
|
|
20
18
|
description: any;
|
|
21
19
|
aliases: any;
|
|
22
20
|
options: any;
|
|
23
21
|
flags: any;
|
|
24
|
-
}> |
|
|
22
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
25
23
|
type: any;
|
|
26
24
|
name: any;
|
|
27
25
|
}>;
|
|
28
26
|
cooldown: number | undefined;
|
|
29
|
-
preconditions:
|
|
27
|
+
preconditions: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
30
28
|
id: any;
|
|
31
29
|
scope: any;
|
|
32
30
|
execute: any;
|
|
33
31
|
}>[] | undefined;
|
|
34
|
-
postconditions:
|
|
32
|
+
postconditions: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
35
33
|
id: any;
|
|
36
34
|
scope: any;
|
|
37
35
|
execute: any;
|
|
@@ -39,7 +37,7 @@ declare class CommandModuleValidator extends Validator {
|
|
|
39
37
|
disabledPreconditions: string[] | undefined;
|
|
40
38
|
disabledPostconditions: string[] | undefined;
|
|
41
39
|
execute: Function;
|
|
42
|
-
},
|
|
40
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
43
41
|
id: string | undefined;
|
|
44
42
|
moduleType: ModuleType | undefined;
|
|
45
43
|
onEnable: Function | undefined;
|
|
@@ -47,24 +45,24 @@ declare class CommandModuleValidator extends Validator {
|
|
|
47
45
|
onDisable: Function | undefined;
|
|
48
46
|
} & {
|
|
49
47
|
id: string;
|
|
50
|
-
type:
|
|
51
|
-
data:
|
|
48
|
+
type: import("@reciple/core").CommandType;
|
|
49
|
+
data: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
52
50
|
name: any;
|
|
53
51
|
description: any;
|
|
54
52
|
aliases: any;
|
|
55
53
|
options: any;
|
|
56
54
|
flags: any;
|
|
57
|
-
}> |
|
|
55
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
58
56
|
type: any;
|
|
59
57
|
name: any;
|
|
60
58
|
}>;
|
|
61
59
|
cooldown: number | undefined;
|
|
62
|
-
preconditions:
|
|
60
|
+
preconditions: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
63
61
|
id: any;
|
|
64
62
|
scope: any;
|
|
65
63
|
execute: any;
|
|
66
64
|
}>[] | undefined;
|
|
67
|
-
postconditions:
|
|
65
|
+
postconditions: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
68
66
|
id: any;
|
|
69
67
|
scope: any;
|
|
70
68
|
execute: any;
|
|
@@ -73,7 +71,7 @@ declare class CommandModuleValidator extends Validator {
|
|
|
73
71
|
disabledPostconditions: string[] | undefined;
|
|
74
72
|
execute: Function;
|
|
75
73
|
}>>;
|
|
76
|
-
static resolvable:
|
|
74
|
+
static resolvable: import("@sapphire/shapeshift").UnionValidator<import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
77
75
|
id: string | undefined;
|
|
78
76
|
moduleType: ModuleType | undefined;
|
|
79
77
|
onEnable: Function | undefined;
|
|
@@ -81,24 +79,24 @@ declare class CommandModuleValidator extends Validator {
|
|
|
81
79
|
onDisable: Function | undefined;
|
|
82
80
|
} & {
|
|
83
81
|
id: string;
|
|
84
|
-
type:
|
|
85
|
-
data:
|
|
82
|
+
type: import("@reciple/core").CommandType;
|
|
83
|
+
data: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
86
84
|
name: any;
|
|
87
85
|
description: any;
|
|
88
86
|
aliases: any;
|
|
89
87
|
options: any;
|
|
90
88
|
flags: any;
|
|
91
|
-
}> |
|
|
89
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
92
90
|
type: any;
|
|
93
91
|
name: any;
|
|
94
92
|
}>;
|
|
95
93
|
cooldown: number | undefined;
|
|
96
|
-
preconditions:
|
|
94
|
+
preconditions: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
97
95
|
id: any;
|
|
98
96
|
scope: any;
|
|
99
97
|
execute: any;
|
|
100
98
|
}>[] | undefined;
|
|
101
|
-
postconditions:
|
|
99
|
+
postconditions: import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
102
100
|
id: any;
|
|
103
101
|
scope: any;
|
|
104
102
|
execute: any;
|
|
@@ -106,7 +104,7 @@ declare class CommandModuleValidator extends Validator {
|
|
|
106
104
|
disabledPreconditions: string[] | undefined;
|
|
107
105
|
disabledPostconditions: string[] | undefined;
|
|
108
106
|
execute: Function;
|
|
109
|
-
}> |
|
|
107
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
110
108
|
toJSON: Function;
|
|
111
109
|
}>>;
|
|
112
110
|
static isValid(value: unknown): asserts value is AnyCommandModuleData;
|
|
@@ -2,19 +2,18 @@ import { ModuleType } from "../../helpers/constants.mjs";
|
|
|
2
2
|
import { EventModule } from "../modules/events/EventModule.mjs";
|
|
3
3
|
import { Validator } from "@reciple/core";
|
|
4
4
|
import { EventEmitter } from "node:events";
|
|
5
|
-
import * as _$_sapphire_shapeshift0 from "@sapphire/shapeshift";
|
|
6
5
|
|
|
7
6
|
//#region src/classes/validation/EventModuleValidator.d.ts
|
|
8
7
|
declare class EventModuleValidator extends Validator {
|
|
9
|
-
static emitter:
|
|
8
|
+
static emitter: import("@sapphire/shapeshift").InstanceValidator<EventEmitter<{
|
|
10
9
|
[x: string]: any[];
|
|
11
10
|
[x: number]: any[];
|
|
12
11
|
[x: symbol]: any[];
|
|
13
12
|
}>>;
|
|
14
|
-
static event:
|
|
15
|
-
static once:
|
|
16
|
-
static onEvent:
|
|
17
|
-
static object:
|
|
13
|
+
static event: import("@sapphire/shapeshift").StringValidator<string>;
|
|
14
|
+
static once: import("@sapphire/shapeshift").UnionValidator<boolean | undefined>;
|
|
15
|
+
static onEvent: import("@sapphire/shapeshift").InstanceValidator<Function>;
|
|
16
|
+
static object: import("@sapphire/shapeshift").ObjectValidator<{
|
|
18
17
|
id: string | undefined;
|
|
19
18
|
moduleType: ModuleType | undefined;
|
|
20
19
|
onEnable: Function | undefined;
|
|
@@ -29,7 +28,7 @@ declare class EventModuleValidator extends Validator {
|
|
|
29
28
|
event: string;
|
|
30
29
|
once: boolean | undefined;
|
|
31
30
|
onEvent: Function;
|
|
32
|
-
},
|
|
31
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
33
32
|
id: string | undefined;
|
|
34
33
|
moduleType: ModuleType | undefined;
|
|
35
34
|
onEnable: Function | undefined;
|
|
@@ -45,9 +44,9 @@ declare class EventModuleValidator extends Validator {
|
|
|
45
44
|
once: boolean | undefined;
|
|
46
45
|
onEvent: Function;
|
|
47
46
|
}>>;
|
|
48
|
-
static resolvable:
|
|
47
|
+
static resolvable: import("@sapphire/shapeshift").UnionValidator<import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
49
48
|
toJSON: Function;
|
|
50
|
-
}> |
|
|
49
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
51
50
|
id: string | undefined;
|
|
52
51
|
moduleType: ModuleType | undefined;
|
|
53
52
|
onEnable: Function | undefined;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { PostconditionModule } from "../modules/PostconditionModule.mjs";
|
|
2
2
|
import { CommandPostconditionReason, CommandType, Validator } from "@reciple/core";
|
|
3
|
-
import * as _$_sapphire_shapeshift0 from "@sapphire/shapeshift";
|
|
4
3
|
|
|
5
4
|
//#region src/classes/validation/PostconditionModule.d.ts
|
|
6
5
|
declare class PostconditionModuleValidator extends Validator {
|
|
7
|
-
static scope:
|
|
8
|
-
static accepts:
|
|
9
|
-
static execute:
|
|
10
|
-
static object:
|
|
6
|
+
static scope: import("@sapphire/shapeshift").UnionValidator<CommandType[] | undefined>;
|
|
7
|
+
static accepts: import("@sapphire/shapeshift").UnionValidator<CommandPostconditionReason[] | undefined>;
|
|
8
|
+
static execute: import("@sapphire/shapeshift").InstanceValidator<Function>;
|
|
9
|
+
static object: import("@sapphire/shapeshift").ObjectValidator<{
|
|
11
10
|
scope: CommandType[] | undefined;
|
|
12
11
|
execute: Function;
|
|
13
|
-
},
|
|
12
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
14
13
|
scope: CommandType[] | undefined;
|
|
15
14
|
execute: Function;
|
|
16
15
|
}>>;
|
|
17
|
-
static resolvable:
|
|
16
|
+
static resolvable: import("@sapphire/shapeshift").UnionValidator<import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
18
17
|
toJSON: Function;
|
|
19
|
-
}> |
|
|
18
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
20
19
|
scope: CommandType[] | undefined;
|
|
21
20
|
execute: Function;
|
|
22
21
|
}>>;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { PreconditionModule } from "../modules/PreconditionModule.mjs";
|
|
2
2
|
import { CommandType, Validator } from "@reciple/core";
|
|
3
|
-
import * as _$_sapphire_shapeshift0 from "@sapphire/shapeshift";
|
|
4
3
|
|
|
5
4
|
//#region src/classes/validation/PreconditionModule.d.ts
|
|
6
5
|
declare class PreconditionModuleValidator extends Validator {
|
|
7
|
-
static scope:
|
|
8
|
-
static execute:
|
|
9
|
-
static object:
|
|
6
|
+
static scope: import("@sapphire/shapeshift").UnionValidator<CommandType[] | undefined>;
|
|
7
|
+
static execute: import("@sapphire/shapeshift").InstanceValidator<Function>;
|
|
8
|
+
static object: import("@sapphire/shapeshift").ObjectValidator<{
|
|
10
9
|
scope: CommandType[] | undefined;
|
|
11
10
|
execute: Function;
|
|
12
|
-
},
|
|
11
|
+
}, import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
13
12
|
scope: CommandType[] | undefined;
|
|
14
13
|
execute: Function;
|
|
15
14
|
}>>;
|
|
16
|
-
static resolvable:
|
|
15
|
+
static resolvable: import("@sapphire/shapeshift").UnionValidator<import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
17
16
|
toJSON: Function;
|
|
18
|
-
}> |
|
|
17
|
+
}> | import("@sapphire/shapeshift").UndefinedToOptional<{
|
|
19
18
|
scope: CommandType[] | undefined;
|
|
20
19
|
execute: Function;
|
|
21
20
|
}>>;
|
package/dist/helpers/types.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ type AnyModule = BaseModule | AnyCommandModule | PreconditionModule | Postcondit
|
|
|
15
15
|
type AnyModuleData = BaseModule.Data | AnyCommandModuleData | PreconditionModule.Data | PostconditionModule.Data | EventModule.Data;
|
|
16
16
|
type AnyCommandModule<T extends CommandType = CommandType> = T extends CommandType.Message ? MessageCommandModule : T extends CommandType.Slash ? SlashCommandModule : T extends CommandType.ContextMenu ? ContextMenuCommandModule : MessageCommandModule | SlashCommandModule | ContextMenuCommandModule;
|
|
17
17
|
type AnyCommandModuleData<T extends CommandType = CommandType> = T extends CommandType.Message ? MessageCommandModule.Data : T extends CommandType.Slash ? SlashCommandModule.Data : T extends CommandType.ContextMenu ? ContextMenuCommandModule.Data : MessageCommandModule.Data | SlashCommandModule.Data | ContextMenuCommandModule.Data;
|
|
18
|
-
type BuildConfig = Omit<UserConfig, 'watch' | 'css' | 'cwd' | 'env' | 'envFile' | 'envPrefix' | 'exe' | 'exports' | 'ignoreWatch' | 'skipNodeModulesBundle' | 'platform' | 'format' | 'unbundle' | 'bundle' | 'skipNodeModulesBundle' | 'noExternal' | 'cjsDefault' | 'workspace' | 'customLogger' | 'logLevel' | 'deps'>;
|
|
18
|
+
type BuildConfig = Omit<UserConfig, 'watch' | 'css' | 'cwd' | 'env' | 'envFile' | 'envPrefix' | 'exe' | 'exports' | 'ignoreWatch' | 'skipNodeModulesBundle' | 'platform' | 'format' | 'unbundle' | 'bundle' | 'skipNodeModulesBundle' | 'noExternal' | 'cjsDefault' | 'workspace' | 'customLogger' | 'logLevel' | 'deps' | 'workspace'>;
|
|
19
19
|
type ShardingConfig = Omit<ShardingManagerOptions, 'shardArgs' | 'token' | 'execArgv'>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { AnyCommandBuilderMethods, AnyCommandModule, AnyCommandModuleData, AnyModule, AnyModuleData, BuildConfig, ShardingConfig };
|
package/dist/package.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "reciple",
|
|
4
|
-
version: "10.
|
|
4
|
+
version: "10.2.0",
|
|
5
5
|
license: "LGPL-3.0-only",
|
|
6
6
|
description: "The CLI for reciple",
|
|
7
7
|
module: "./dist/index.mjs",
|
|
@@ -36,20 +36,20 @@ var package_default = {
|
|
|
36
36
|
"directory": "packages/reciple"
|
|
37
37
|
},
|
|
38
38
|
dependencies: {
|
|
39
|
-
"@clack/prompts": "^1.
|
|
40
|
-
"@dotenvx/dotenvx": "^1.
|
|
39
|
+
"@clack/prompts": "^1.5.1",
|
|
40
|
+
"@dotenvx/dotenvx": "^1.73.1",
|
|
41
41
|
"@prtty/print": "catalog:",
|
|
42
42
|
"@prtty/prtty": "catalog:",
|
|
43
43
|
"@reciple/utils": "workspace:^",
|
|
44
44
|
"@sapphire/shapeshift": "^4.0.0",
|
|
45
45
|
"@sapphire/snowflake": "^3.5.5",
|
|
46
|
-
"commander": "^
|
|
46
|
+
"commander": "^15.0.0",
|
|
47
47
|
"github-slugger": "^2.0.0",
|
|
48
|
-
"jiti": "^2.
|
|
48
|
+
"jiti": "^2.7.0",
|
|
49
49
|
"micromatch": "^4.0.8",
|
|
50
|
-
"nypm": "^0.6.
|
|
51
|
-
"pkg-types": "
|
|
52
|
-
"tinyglobby": "^0.2.
|
|
50
|
+
"nypm": "^0.6.7",
|
|
51
|
+
"pkg-types": "catalog:",
|
|
52
|
+
"tinyglobby": "^0.2.17",
|
|
53
53
|
"ts-mixer": "^6.0.4",
|
|
54
54
|
"tsdown": "catalog:"
|
|
55
55
|
},
|
|
@@ -58,7 +58,7 @@ var package_default = {
|
|
|
58
58
|
"@types/micromatch": "^4.0.10",
|
|
59
59
|
"@types/node": "catalog:",
|
|
60
60
|
"nodemon": "^3.1.14",
|
|
61
|
-
"rolldown": "^1.
|
|
61
|
+
"rolldown": "^1.1.1",
|
|
62
62
|
"typescript": "catalog:"
|
|
63
63
|
},
|
|
64
64
|
peerDependencies: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"license": "LGPL-3.0-only",
|
|
5
5
|
"description": "The CLI for reciple",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -35,34 +35,34 @@
|
|
|
35
35
|
"directory": "packages/reciple"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@clack/prompts": "^1.
|
|
39
|
-
"@dotenvx/dotenvx": "^1.
|
|
38
|
+
"@clack/prompts": "^1.5.1",
|
|
39
|
+
"@dotenvx/dotenvx": "^1.73.1",
|
|
40
40
|
"@prtty/print": "^1.1.3",
|
|
41
41
|
"@prtty/prtty": "^1.1.2",
|
|
42
42
|
"@reciple/utils": "^10.0.4",
|
|
43
43
|
"@sapphire/shapeshift": "^4.0.0",
|
|
44
44
|
"@sapphire/snowflake": "^3.5.5",
|
|
45
|
-
"commander": "^
|
|
45
|
+
"commander": "^15.0.0",
|
|
46
46
|
"github-slugger": "^2.0.0",
|
|
47
|
-
"jiti": "^2.
|
|
47
|
+
"jiti": "^2.7.0",
|
|
48
48
|
"micromatch": "^4.0.8",
|
|
49
|
-
"nypm": "^0.6.
|
|
50
|
-
"pkg-types": "^2.3.
|
|
51
|
-
"tinyglobby": "^0.2.
|
|
49
|
+
"nypm": "^0.6.7",
|
|
50
|
+
"pkg-types": "^2.3.1",
|
|
51
|
+
"tinyglobby": "^0.2.17",
|
|
52
52
|
"ts-mixer": "^6.0.4",
|
|
53
|
-
"tsdown": "^0.
|
|
53
|
+
"tsdown": "^0.22.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@reciple/jsx": "^10.0.10",
|
|
57
57
|
"@types/micromatch": "^4.0.10",
|
|
58
|
-
"@types/node": "^25.
|
|
58
|
+
"@types/node": "^25.9.3",
|
|
59
59
|
"nodemon": "^3.1.14",
|
|
60
|
-
"rolldown": "^1.
|
|
61
|
-
"typescript": "^6.0.
|
|
60
|
+
"rolldown": "^1.1.1",
|
|
61
|
+
"typescript": "^6.0.3"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@reciple/core": "^10.1.0",
|
|
65
|
-
"discord.js": "^14.26.
|
|
65
|
+
"discord.js": "^14.26.4"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@reciple/core": {
|