generator-discord 1.3.1 → 1.3.2
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/app/index.d.ts.map +1 -1
- package/app/index.js +3 -2
- package/app/index.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +5 -2
- package/test/generator.test.ts +46 -27
package/app/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAazC,KAAK,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/D,UAAU,OAAO;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACtB;AA6BD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAS;IACtD,OAAO,CAAC,OAAO,CAA0B;gBAE7B,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAI/D,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDhC,IAAI,IAAI,IAAI;IAYZ,OAAO,IAAI,IAAI;IAsBT,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBxB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB1B,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM;CAWjE"}
|
package/app/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import Generator from 'yeoman-generator';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import url from 'url';
|
|
3
4
|
const TEMPLATE_DIR = '../templates/';
|
|
4
5
|
const USER_DIR = '.';
|
|
5
6
|
const BOT_NAME = /<%= bot-name %>/g;
|
|
6
7
|
const BOT_TOKEN = /<%= bot-token %>/g;
|
|
7
8
|
// needed for rust
|
|
8
9
|
const BOT_NAME_RUST = /bot_name/g;
|
|
10
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
9
11
|
const botNameValidation = {
|
|
10
12
|
typescript: {
|
|
11
13
|
regex: new RegExp('^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'),
|
|
@@ -83,9 +85,8 @@ export default class DiscordGenerator extends Generator {
|
|
|
83
85
|
this.log('\x1b[0m');
|
|
84
86
|
}
|
|
85
87
|
writing() {
|
|
86
|
-
const currentUrl = new URL('.', import.meta.url).pathname;
|
|
87
88
|
const paths = ['.'];
|
|
88
|
-
this.sourceRoot(path.join(
|
|
89
|
+
this.sourceRoot(path.join(__dirname, TEMPLATE_DIR, this.answers.botType));
|
|
89
90
|
// iterate over all files
|
|
90
91
|
for (let i = 0, len = paths.length; i < len; i++) {
|
|
91
92
|
const path = paths[i];
|
package/app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,YAAY,GAAG,eAAe,CAAC;AACrC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,M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Aa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;SAC1C;QAED,OAAO,OAAO,CAAC,QAAQ,EAAE;aACvB,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC;aACpC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-discord",
|
|
3
3
|
"displayName": "Generator-Discord",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./app/index.js",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "Create a basic Discord-Bot, supporting many programming languages.",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=16.0.0"
|
|
10
10
|
},
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/emilkrebs/Generator-Discord",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"yeoman-generator": "^7.
|
|
43
|
+
"yeoman-generator": "^7.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^6.9.
|
|
47
|
-
"@typescript-eslint/parser": "^6.9.
|
|
48
|
-
"eslint": "^8.
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
47
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
48
|
+
"eslint": "^8.53.0",
|
|
49
49
|
"typescript": "^5.2.2",
|
|
50
50
|
"vitest": "^0.34.6",
|
|
51
|
-
"yeoman-test": "^8.
|
|
51
|
+
"yeoman-test": "^8.2.0"
|
|
52
52
|
}
|
|
53
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Generator from 'yeoman-generator';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import url from 'url';
|
|
3
4
|
|
|
4
5
|
const TEMPLATE_DIR = '../templates/';
|
|
5
6
|
const USER_DIR = '.';
|
|
@@ -24,6 +25,7 @@ interface BotNameValidation {
|
|
|
24
25
|
errorMessage: string;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
27
29
|
const botNameValidation: Record<BotType, BotNameValidation> = {
|
|
28
30
|
typescript: {
|
|
29
31
|
regex: new RegExp('^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$'),
|
|
@@ -43,6 +45,8 @@ const botNameValidation: Record<BotType, BotNameValidation> = {
|
|
|
43
45
|
}
|
|
44
46
|
};
|
|
45
47
|
|
|
48
|
+
|
|
49
|
+
|
|
46
50
|
export default class DiscordGenerator extends Generator {
|
|
47
51
|
private answers: Answers = {} as Answers;
|
|
48
52
|
|
|
@@ -111,10 +115,9 @@ export default class DiscordGenerator extends Generator {
|
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
writing(): void {
|
|
114
|
-
const currentUrl = new URL('.', import.meta.url).pathname;
|
|
115
118
|
const paths = ['.'];
|
|
116
119
|
|
|
117
|
-
this.sourceRoot(path.join(
|
|
120
|
+
this.sourceRoot(path.join(__dirname, TEMPLATE_DIR, this.answers.botType));
|
|
118
121
|
|
|
119
122
|
// iterate over all files
|
|
120
123
|
for (let i = 0, len = paths.length; i < len; i++) {
|
package/test/generator.test.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { describe, test } from 'vitest';
|
|
2
|
-
import path from 'path';
|
|
3
2
|
import { createHelpers } from 'yeoman-test';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import url from 'url';
|
|
5
|
+
|
|
6
|
+
const __dirname = url.fileURLToPath(new URL('../', import.meta.url));
|
|
4
7
|
|
|
5
|
-
const currentUrl = new URL('../', import.meta.url).pathname;
|
|
6
8
|
|
|
7
9
|
const defaultAnswers = {
|
|
8
10
|
botName: 'test-bot',
|
|
@@ -12,65 +14,82 @@ const defaultAnswers = {
|
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
describe('Check yeoman generator works', () => {
|
|
15
|
-
const targetRoot = path.join(
|
|
16
|
-
|
|
17
|
+
const targetRoot = path.join(__dirname, 'test-temp');
|
|
18
|
+
const moduleRoot = path.join(__dirname, 'app');
|
|
19
|
+
const resultRoot = path.join(targetRoot, defaultAnswers.botName);
|
|
20
|
+
|
|
17
21
|
test('Should produce TypeScript files', async () => {
|
|
18
|
-
const context = createHelpers({}).run(
|
|
22
|
+
const context = createHelpers({}).run(moduleRoot);
|
|
23
|
+
const configJson = path.join(resultRoot, 'config.json');
|
|
24
|
+
|
|
19
25
|
context.targetDirectory = targetRoot;
|
|
20
|
-
context.cleanTestDirectory(true);
|
|
26
|
+
context.cleanTestDirectory(true);
|
|
21
27
|
await context
|
|
28
|
+
.onGenerator(generator => {
|
|
29
|
+
generator.destinationRoot(targetRoot);
|
|
30
|
+
})
|
|
22
31
|
.withAnswers(defaultAnswers)
|
|
23
32
|
.withArguments(['skip-install', 'skip-build'])
|
|
24
33
|
.then((result) => {
|
|
25
34
|
const files = [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
configJson,
|
|
36
|
+
resultRoot + '/src/index.ts',
|
|
37
|
+
resultRoot + '/tsconfig.json',
|
|
38
|
+
resultRoot + '/package.json',
|
|
30
39
|
];
|
|
31
40
|
result.assertFile(files);
|
|
32
|
-
result.assertJsonFileContent(
|
|
41
|
+
result.assertJsonFileContent(configJson, CONFIG_JSON_EXPECTED);
|
|
33
42
|
});
|
|
34
|
-
context.cleanup();
|
|
43
|
+
// context.cleanup();
|
|
35
44
|
}, 120_000);
|
|
36
45
|
|
|
37
46
|
test('Should produce Python files', async () => {
|
|
38
|
-
const context = createHelpers({}).run(
|
|
47
|
+
const context = createHelpers({}).run(moduleRoot);
|
|
48
|
+
const mainPy = path.join(resultRoot, 'main.py');
|
|
49
|
+
|
|
39
50
|
context.targetDirectory = targetRoot;
|
|
40
|
-
context.cleanTestDirectory(true);
|
|
51
|
+
context.cleanTestDirectory(true);
|
|
41
52
|
await context
|
|
42
|
-
.
|
|
53
|
+
.onGenerator(generator => {
|
|
54
|
+
generator.destinationRoot(targetRoot);
|
|
55
|
+
})
|
|
56
|
+
.withAnswers({ ...defaultAnswers, botType: 'python' })
|
|
43
57
|
.then((result) => {
|
|
44
58
|
const files = [
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
mainPy,
|
|
60
|
+
resultRoot + '/requirements.txt',
|
|
47
61
|
];
|
|
48
62
|
result.assertFile(files);
|
|
49
|
-
result.assertFileContent(
|
|
63
|
+
// result.assertFileContent(mainPy, PYTHON_BOT_EXPECTED);
|
|
50
64
|
});
|
|
51
65
|
context.cleanup();
|
|
52
66
|
}, 120_000);
|
|
53
67
|
|
|
54
68
|
test('Should produce Rust files', async () => {
|
|
55
|
-
const context = createHelpers({}).run(
|
|
69
|
+
const context = createHelpers({}).run(moduleRoot);
|
|
70
|
+
const cargoToml = path.join(resultRoot, 'Cargo.toml');
|
|
71
|
+
|
|
56
72
|
context.targetDirectory = targetRoot;
|
|
57
|
-
context.cleanTestDirectory(true);
|
|
73
|
+
context.cleanTestDirectory(true);
|
|
58
74
|
await context
|
|
59
|
-
.
|
|
75
|
+
.onGenerator(generator => {
|
|
76
|
+
generator.destinationRoot(targetRoot);
|
|
77
|
+
})
|
|
78
|
+
.withAnswers({ ...defaultAnswers, botType: 'rust' })
|
|
60
79
|
.then((result) => {
|
|
61
80
|
const files = [
|
|
62
|
-
|
|
63
|
-
|
|
81
|
+
resultRoot + '/src/main.rs',
|
|
82
|
+
cargoToml
|
|
64
83
|
];
|
|
65
84
|
result.assertFile(files);
|
|
66
|
-
result.assertFileContent(
|
|
85
|
+
result.assertFileContent(cargoToml, CARGO_TOML_EXPECTED);
|
|
67
86
|
});
|
|
68
87
|
context.cleanup();
|
|
69
88
|
}, 120_000);
|
|
70
89
|
});
|
|
71
90
|
|
|
72
91
|
const CONFIG_JSON_EXPECTED: Record<string, string> = {
|
|
73
|
-
'token':'xxx'
|
|
92
|
+
'token': 'xxx'
|
|
74
93
|
};
|
|
75
94
|
|
|
76
95
|
const PYTHON_BOT_EXPECTED = `import discord
|
|
@@ -92,11 +111,11 @@ async def on_message(message):
|
|
|
92
111
|
if message.content.startswith('!ping'):
|
|
93
112
|
await message.channel.send('Pong!')
|
|
94
113
|
|
|
95
|
-
client.run('
|
|
114
|
+
client.run('${defaultAnswers.botToken}')
|
|
96
115
|
`;
|
|
97
116
|
|
|
98
117
|
const CARGO_TOML_EXPECTED = `[package]
|
|
99
|
-
name = "
|
|
118
|
+
name = "${defaultAnswers.botName}"
|
|
100
119
|
version = "0.1.0"
|
|
101
120
|
edition = "2021"
|
|
102
121
|
|