zumito-framework 1.0.1 → 1.0.4
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/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zumito-framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Discord.js bot framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"/dist"
|
|
8
|
+
"/dist",
|
|
9
|
+
"/plopfile.js",
|
|
10
|
+
"/baseModule",
|
|
11
|
+
"/plop-templates"
|
|
9
12
|
],
|
|
10
13
|
"bin": {
|
|
11
|
-
"generate": "./templateGenerator.
|
|
14
|
+
"generate": "./templateGenerator.mjs"
|
|
12
15
|
},
|
|
13
16
|
"scripts": {
|
|
14
17
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command, CommandParameters } from "zumito-framework";
|
|
2
|
+
|
|
3
|
+
export class Test extends Command {
|
|
4
|
+
|
|
5
|
+
name: 'test';
|
|
6
|
+
|
|
7
|
+
execute({ message, interaction, args, client }: CommandParameters): void {
|
|
8
|
+
message.channel.send({
|
|
9
|
+
content: "Test command executed",
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
package/plopfile.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default function (plop) {
|
|
2
|
+
// create your generators here
|
|
3
|
+
plop.setGenerator('command', {
|
|
4
|
+
description: 'this is a skeleton command file',
|
|
5
|
+
prompts: [{
|
|
6
|
+
type: 'input',
|
|
7
|
+
name: 'module',
|
|
8
|
+
message: 'Name of the module',
|
|
9
|
+
}, {
|
|
10
|
+
type: 'input',
|
|
11
|
+
name: 'command',
|
|
12
|
+
message: 'Name of the command',
|
|
13
|
+
}],
|
|
14
|
+
actions: [{
|
|
15
|
+
type: 'add',
|
|
16
|
+
path: 'src/{{module}}/commands/{{command}}.js',
|
|
17
|
+
templateFile: 'plop-templates/command.js.hbs',
|
|
18
|
+
}],
|
|
19
|
+
});
|
|
20
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node --experimental-modules --no-warnings
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import minimist from "minimist";
|
|
4
4
|
import { Plop, run } from "plop";
|
|
@@ -12,9 +12,15 @@ import { fileURLToPath } from "node:url";
|
|
|
12
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
13
|
|
|
14
14
|
Plop.prepare({
|
|
15
|
-
cwd:
|
|
15
|
+
cwd: process.cwd(),
|
|
16
16
|
configPath: path.join(__dirname, 'plopfile.js'),
|
|
17
17
|
preload: argv.preload || [],
|
|
18
18
|
completion: argv.completion,
|
|
19
19
|
dest: process.cwd()
|
|
20
|
-
}, env => Plop.execute(env,
|
|
20
|
+
}, env => Plop.execute(env, (env) => {
|
|
21
|
+
const options = {
|
|
22
|
+
...env,
|
|
23
|
+
dest: process.cwd() // this will make the destination path to be based on the cwd when calling the wrapper
|
|
24
|
+
}
|
|
25
|
+
return run(options, undefined, true)
|
|
26
|
+
}));
|