@patto/cli 0.1.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/LICENSE +661 -0
- package/README.md +323 -0
- package/dist/commands/core.d.ts +3 -0
- package/dist/commands/core.js +82 -0
- package/dist/commands/core.js.map +1 -0
- package/dist/commands/generate.d.ts +2 -0
- package/dist/commands/generate.js +231 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/core/resolve.d.ts +4 -0
- package/dist/core/resolve.js +62 -0
- package/dist/core/resolve.js.map +1 -0
- package/dist/core/run.d.ts +2 -0
- package/dist/core/run.js +53 -0
- package/dist/core/run.js.map +1 -0
- package/dist/core/stdin.d.ts +2 -0
- package/dist/core/stdin.js +30 -0
- package/dist/core/stdin.js.map +1 -0
- package/dist/core/types.d.ts +44 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/output/diagnostics.d.ts +8 -0
- package/dist/output/diagnostics.js +85 -0
- package/dist/output/diagnostics.js.map +1 -0
- package/dist/scaffold/names.d.ts +14 -0
- package/dist/scaffold/names.js +75 -0
- package/dist/scaffold/names.js.map +1 -0
- package/dist/scaffold/project.d.ts +13 -0
- package/dist/scaffold/project.js +41 -0
- package/dist/scaffold/project.js.map +1 -0
- package/dist/scaffold/templates.d.ts +34 -0
- package/dist/scaffold/templates.js +204 -0
- package/dist/scaffold/templates.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { commandClassNameFromPath, commandImportPath, parseDiscordName, toPascalCase } from './names.js';
|
|
2
|
+
export function commandDefinitionTemplate(parsed, options) {
|
|
3
|
+
return `${decoratorImports('command', options.category)}import { BaseCommand } from '@/core/structures/BaseCommand';
|
|
4
|
+
|
|
5
|
+
@Command({
|
|
6
|
+
name: '${parsed.name}',
|
|
7
|
+
description: '${quote(options.description ?? `Ejecuta ${parsed.name}`)}',
|
|
8
|
+
${categoryLine(options.category)}})
|
|
9
|
+
export abstract class ${parsed.classBase}Definition extends BaseCommand {
|
|
10
|
+
// Define aqui tus @Arg cuando el comando necesite parametros.
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
14
|
+
export function commandImplementationTemplate(parsed) {
|
|
15
|
+
return `import { ${parsed.classBase}Definition } from '@/definitions/${[
|
|
16
|
+
...parsed.dirs,
|
|
17
|
+
`${parsed.fileBase}.definition`,
|
|
18
|
+
].join('/')}';
|
|
19
|
+
|
|
20
|
+
export class ${parsed.classBase}Command extends ${parsed.classBase}Definition {
|
|
21
|
+
async run(): Promise<void> {
|
|
22
|
+
await this.send('Comando ${parsed.name} ejecutado.');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
export function commandSingleFileTemplate(parsed, options) {
|
|
28
|
+
return `${decoratorImports('command', options.category)}import { BaseCommand } from '@/core/structures/BaseCommand';
|
|
29
|
+
|
|
30
|
+
@Command({
|
|
31
|
+
name: '${parsed.name}',
|
|
32
|
+
description: '${quote(options.description ?? `Ejecuta ${parsed.name}`)}',
|
|
33
|
+
${categoryLine(options.category)}})
|
|
34
|
+
export class ${parsed.classBase}Command extends BaseCommand {
|
|
35
|
+
async run(): Promise<void> {
|
|
36
|
+
await this.send('Comando ${parsed.name} ejecutado.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
export function subcommandTemplate(parsed, options) {
|
|
42
|
+
const parent = parseDiscordName(options.parent, 'comando padre');
|
|
43
|
+
const className = `${toPascalCase(parent)}${parsed.classBase}Command`;
|
|
44
|
+
return `${decoratorImports('subcommand', options.category)}import { BaseCommand } from '@/core/structures/BaseCommand';
|
|
45
|
+
|
|
46
|
+
@Subcommand({
|
|
47
|
+
parent: '${parent}',
|
|
48
|
+
name: '${parsed.name}',
|
|
49
|
+
description: '${quote(options.description ?? `Ejecuta ${parent} ${parsed.name}`)}',
|
|
50
|
+
${categoryLine(options.category)}})
|
|
51
|
+
export class ${className} extends BaseCommand {
|
|
52
|
+
async run(): Promise<void> {
|
|
53
|
+
await this.send('Subcomando ${parent} ${parsed.name} ejecutado.');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
export function subcommandGroupTemplate(parsed, options) {
|
|
59
|
+
const parent = parseDiscordName(options.parent, 'comando padre');
|
|
60
|
+
const group = parseDiscordName(options.group, 'grupo de subcomandos');
|
|
61
|
+
const className = `${toPascalCase(parent)}${toPascalCase(group)}${parsed.classBase}Command`;
|
|
62
|
+
return `${decoratorImports('subcommand-group', options.category)}import { BaseCommand } from '@/core/structures/BaseCommand';
|
|
63
|
+
|
|
64
|
+
@SubcommandGroup({
|
|
65
|
+
parent: '${parent}',
|
|
66
|
+
name: '${group}',
|
|
67
|
+
subcommand: '${parsed.name}',
|
|
68
|
+
description: '${quote(options.description ?? `Ejecuta ${parent} ${group} ${parsed.name}`)}',
|
|
69
|
+
${categoryLine(options.category)}})
|
|
70
|
+
export class ${className} extends BaseCommand {
|
|
71
|
+
async run(): Promise<void> {
|
|
72
|
+
await this.send('Subcomando ${parent} ${group} ${parsed.name} ejecutado.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
export function standaloneDefinitionTemplate(parsed, kind, options) {
|
|
78
|
+
if (kind === 'subcommand') {
|
|
79
|
+
const parent = parseDiscordName(requiredOption(options.parent, '--parent'), 'comando padre');
|
|
80
|
+
return subcommandTemplate(parsed, {
|
|
81
|
+
...options,
|
|
82
|
+
parent,
|
|
83
|
+
}).replace(`export class ${toPascalCase(parent)}${parsed.classBase}Command extends BaseCommand`, `export abstract class ${toPascalCase(parent)}${parsed.classBase}Definition extends BaseCommand`);
|
|
84
|
+
}
|
|
85
|
+
if (kind === 'subcommand-group') {
|
|
86
|
+
const parent = parseDiscordName(requiredOption(options.parent, '--parent'), 'comando padre');
|
|
87
|
+
const group = parseDiscordName(requiredOption(options.group, '--group'), 'grupo de subcomandos');
|
|
88
|
+
return subcommandGroupTemplate(parsed, {
|
|
89
|
+
...options,
|
|
90
|
+
parent,
|
|
91
|
+
group,
|
|
92
|
+
}).replace(`export class ${toPascalCase(parent)}${toPascalCase(group)}${parsed.classBase}Command extends BaseCommand`, `export abstract class ${toPascalCase(parent)}${toPascalCase(group)}${parsed.classBase}Definition extends BaseCommand`);
|
|
93
|
+
}
|
|
94
|
+
return commandDefinitionTemplate(parsed, options);
|
|
95
|
+
}
|
|
96
|
+
export function pluginTemplate(classBase) {
|
|
97
|
+
return `import { BaseCommand } from '@/core/structures/BaseCommand';
|
|
98
|
+
import { BasePlugin } from '@/core/structures/BasePlugin';
|
|
99
|
+
|
|
100
|
+
export class ${classBase}Plugin extends BasePlugin {
|
|
101
|
+
async onBeforeRegisterCommand(
|
|
102
|
+
commandClass: new (...args: any[]) => BaseCommand,
|
|
103
|
+
commandJson: Record<string, unknown>,
|
|
104
|
+
): Promise<Record<string, unknown> | false | null> {
|
|
105
|
+
return commandJson;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async onAfterRegisterCommand(
|
|
109
|
+
commandClass: new (...args: any[]) => BaseCommand,
|
|
110
|
+
registeredCommandJson: Record<string, unknown>,
|
|
111
|
+
): Promise<void> {
|
|
112
|
+
void commandClass;
|
|
113
|
+
void registeredCommandJson;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async onBeforeExecute(command: BaseCommand): Promise<boolean> {
|
|
117
|
+
void command;
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async onAfterExecute(command: BaseCommand): Promise<void> {
|
|
122
|
+
void command;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
export function pluginImportStatement(classBase, importPath) {
|
|
128
|
+
return `import { ${classBase}Plugin } from '${importPath}';`;
|
|
129
|
+
}
|
|
130
|
+
export function pluginCommandImportStatements(commands) {
|
|
131
|
+
return (commands ?? []).map((commandPath) => {
|
|
132
|
+
const className = commandClassNameFromPath(commandPath);
|
|
133
|
+
return `import { ${className} } from '${commandImportPath(commandPath)}';`;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
export function pluginRegistrationTemplate(options) {
|
|
137
|
+
const scope = pluginScopeEnum(options.scope);
|
|
138
|
+
const commandsLine = options.scope === 'specified'
|
|
139
|
+
? ` commands: [${(options.commands ?? []).map(commandClassNameFromPath).join(', ')}],\n`
|
|
140
|
+
: '';
|
|
141
|
+
return `PluginRegistry.register({
|
|
142
|
+
plugin: new ${options.classBase}Plugin(),
|
|
143
|
+
scope: PluginScope.${scope},
|
|
144
|
+
folderPath: '${quote(options.folder ?? '')}',
|
|
145
|
+
${commandsLine}});`;
|
|
146
|
+
}
|
|
147
|
+
export function pluginScopeEnum(scope) {
|
|
148
|
+
switch (scope) {
|
|
149
|
+
case 'specified':
|
|
150
|
+
return 'Specified';
|
|
151
|
+
case 'folder':
|
|
152
|
+
return 'Folder';
|
|
153
|
+
case 'deep-folder':
|
|
154
|
+
return 'DeepFolder';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export function normalizePluginScope(scope, folder) {
|
|
158
|
+
if (scope === undefined) {
|
|
159
|
+
return folder ? 'folder' : 'deep-folder';
|
|
160
|
+
}
|
|
161
|
+
if (scope === 'specified' || scope === 'folder' || scope === 'deep-folder') {
|
|
162
|
+
return scope;
|
|
163
|
+
}
|
|
164
|
+
throw new Error('El scope del plugin debe ser specified, folder o deep-folder.');
|
|
165
|
+
}
|
|
166
|
+
export function normalizeCategory(category) {
|
|
167
|
+
const value = category?.trim().toLowerCase() || 'other';
|
|
168
|
+
const map = {
|
|
169
|
+
economy: 'Economy',
|
|
170
|
+
info: 'Info',
|
|
171
|
+
moderation: 'Moderation',
|
|
172
|
+
other: 'Other',
|
|
173
|
+
settings: 'Settings',
|
|
174
|
+
utils: 'Utils',
|
|
175
|
+
};
|
|
176
|
+
const normalized = map[value];
|
|
177
|
+
if (normalized === undefined) {
|
|
178
|
+
throw new Error('La categoria debe ser info, utils, moderation, settings, economy u other.');
|
|
179
|
+
}
|
|
180
|
+
return normalized;
|
|
181
|
+
}
|
|
182
|
+
function decoratorImports(kind, category) {
|
|
183
|
+
const categoryImport = category === undefined ? '' : "import { Category } from '@/utils/CommandCategories';\n";
|
|
184
|
+
if (kind === 'subcommand') {
|
|
185
|
+
return `import { Subcommand } from '@/core/decorators/subcommand.decorator';\n${categoryImport}`;
|
|
186
|
+
}
|
|
187
|
+
if (kind === 'subcommand-group') {
|
|
188
|
+
return `import { SubcommandGroup } from '@/core/decorators/subcommand-group.decorator';\n${categoryImport}`;
|
|
189
|
+
}
|
|
190
|
+
return `import { Command } from '@/core/decorators/command.decorator';\n${categoryImport}`;
|
|
191
|
+
}
|
|
192
|
+
function categoryLine(category) {
|
|
193
|
+
return category === undefined ? '' : ` category: Category.${normalizeCategory(category)},\n`;
|
|
194
|
+
}
|
|
195
|
+
function requiredOption(value, option) {
|
|
196
|
+
if (!value) {
|
|
197
|
+
throw new Error(`Falta ${option}.`);
|
|
198
|
+
}
|
|
199
|
+
return value;
|
|
200
|
+
}
|
|
201
|
+
function quote(value) {
|
|
202
|
+
return value.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA2BzG,MAAM,UAAU,yBAAyB,CACrC,MAAkB,EAClB,OAA+B;IAE/B,OAAO,GAAG,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAA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,EAAE,KAAK,CAAC,CAAC;AAC7D,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@patto/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official CLI for Patto Bot Template",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "AGPL-3.0-only",
|
|
7
|
+
"bin": {
|
|
8
|
+
"patto": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"cac": "^6.7.14",
|
|
18
|
+
"chalk": "^5.3.0",
|
|
19
|
+
"execa": "^9.0.0",
|
|
20
|
+
"fs-extra": "^11.2.0",
|
|
21
|
+
"ora": "^8.1.0",
|
|
22
|
+
"prompts": "^2.4.2"
|
|
23
|
+
},
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@patto/cli-core-linux-arm64": "0.1.0",
|
|
26
|
+
"@patto/cli-core-linux-x64": "0.1.0",
|
|
27
|
+
"@patto/cli-core-win32-x64": "0.1.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/fs-extra": "^11.0.4",
|
|
31
|
+
"@types/node": "^24.10.0",
|
|
32
|
+
"@types/prompts": "^2.4.9",
|
|
33
|
+
"tsx": "^4.20.0",
|
|
34
|
+
"typescript": "^6.0.3"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "tsx src/index.ts",
|
|
38
|
+
"build": "tsc -p tsconfig.json",
|
|
39
|
+
"start": "node dist/index.js",
|
|
40
|
+
"test": "echo \"tests pending\""
|
|
41
|
+
}
|
|
42
|
+
}
|