@webtypen/webframez-core 0.1.7 → 0.1.9
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.
|
@@ -51,7 +51,7 @@ class ConsoleApplication {
|
|
|
51
51
|
}
|
|
52
52
|
consoleCommand.action(() => __awaiter(this, void 0, void 0, function* () {
|
|
53
53
|
const service = yield new command();
|
|
54
|
-
const result = yield service.
|
|
54
|
+
const result = yield service.handleSystem();
|
|
55
55
|
if (options && options.onEnd) {
|
|
56
56
|
yield options.onEnd(command.signature);
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -3,59 +3,59 @@ import { Config } from "./Config";
|
|
|
3
3
|
import { BuildFinishCommand } from "./Commands/BuildFinishCommand";
|
|
4
4
|
|
|
5
5
|
export class ConsoleApplication {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Init the routes and start the http-server
|
|
8
|
+
*/
|
|
9
|
+
boot(options?: any) {
|
|
10
|
+
if (options && options.config) {
|
|
11
|
+
for (let key in options.config) {
|
|
12
|
+
Config.register(key, options.config[key]);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const consoleCommand = new Command(command.signature);
|
|
26
|
-
if (command.description && command.description.trim() !== "") {
|
|
27
|
-
consoleCommand.description(command.description);
|
|
28
|
-
}
|
|
29
|
-
consoleCommand.action(async () => {
|
|
30
|
-
const service = await new command();
|
|
31
|
-
return await service.handleSystem();
|
|
32
|
-
});
|
|
33
|
-
program.addCommand(consoleCommand);
|
|
34
|
-
}
|
|
16
|
+
const program = new Command();
|
|
17
|
+
program.name("webframez console").description("CLI to some JavaScript string utilities").version("0.0.1");
|
|
18
|
+
|
|
19
|
+
const systemCommands = [BuildFinishCommand];
|
|
20
|
+
for (let command of systemCommands) {
|
|
21
|
+
if (!command.signature) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
35
24
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
const consoleCommand = new Command(command.signature);
|
|
26
|
+
if (command.description && command.description.trim() !== "") {
|
|
27
|
+
consoleCommand.description(command.description);
|
|
28
|
+
}
|
|
29
|
+
consoleCommand.action(async () => {
|
|
30
|
+
const service = await new command();
|
|
31
|
+
return await service.handleSystem();
|
|
32
|
+
});
|
|
33
|
+
program.addCommand(consoleCommand);
|
|
40
34
|
}
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
if (options && options.kernel && options.kernel.commands && options.kernel.commands.length > 0) {
|
|
37
|
+
for (let command of options.kernel.commands) {
|
|
38
|
+
if (!command.signature) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const consoleCommand = new Command(command.signature);
|
|
43
|
+
if (command.description && command.description.trim() !== "") {
|
|
44
|
+
consoleCommand.description(command.description);
|
|
45
|
+
}
|
|
46
|
+
consoleCommand.action(async () => {
|
|
47
|
+
const service = await new command();
|
|
48
|
+
const result = await service.handleSystem();
|
|
49
|
+
|
|
50
|
+
if (options && options.onEnd) {
|
|
51
|
+
await options.onEnd(command.signature);
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
});
|
|
55
|
+
program.addCommand(consoleCommand);
|
|
56
|
+
}
|
|
45
57
|
}
|
|
46
|
-
consoleCommand.action(async () => {
|
|
47
|
-
const service = await new command();
|
|
48
|
-
const result = await service.handle();
|
|
49
|
-
|
|
50
|
-
if (options && options.onEnd) {
|
|
51
|
-
await options.onEnd(command.signature);
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
});
|
|
55
|
-
program.addCommand(consoleCommand);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
program.parse();
|
|
60
|
+
}
|
|
61
61
|
}
|