@webtypen/webframez-core 0.0.40 → 0.0.42

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.
@@ -40,6 +40,22 @@ class ConsoleApplication {
40
40
  }));
41
41
  program.addCommand(consoleCommand);
42
42
  }
43
+ if (options && options.kernel && options.kernel.commands && options.kernel.commands.length > 0) {
44
+ for (let command of options.kernel.commands) {
45
+ if (!command.signature) {
46
+ continue;
47
+ }
48
+ const consoleCommand = new Command(command.signature);
49
+ if (command.description && command.description.trim() !== "") {
50
+ consoleCommand.description(command.description);
51
+ }
52
+ consoleCommand.action(() => __awaiter(this, void 0, void 0, function* () {
53
+ const service = yield new command();
54
+ return yield service.handle();
55
+ }));
56
+ program.addCommand(consoleCommand);
57
+ }
58
+ }
43
59
  program.parse();
44
60
  }
45
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -3,36 +3,54 @@ import { Config } from "./Config";
3
3
  import { BuildFinishCommand } from "./Commands/BuildFinishCommand";
4
4
 
5
5
  export class ConsoleApplication {
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
- }
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
+
16
+ const program = new Command();
17
+ program.name("webframez console").description("CLI to some JavaScript string utilities").version("0.0.1");
15
18
 
16
- const program = new Command();
17
- program.name("webframez console").description("CLI to some JavaScript string utilities").version("0.0.1");
19
+ const systemCommands = [BuildFinishCommand];
20
+ for (let command of systemCommands) {
21
+ if (!command.signature) {
22
+ continue;
23
+ }
18
24
 
19
- const systemCommands = [BuildFinishCommand];
20
- for (let command of systemCommands) {
21
- if (!command.signature) {
22
- continue;
23
- }
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.handle();
32
+ });
33
+ program.addCommand(consoleCommand);
34
+ }
24
35
 
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.handle();
32
- });
33
- program.addCommand(consoleCommand);
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;
34
40
  }
35
41
 
36
- program.parse();
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
+ return await service.handle();
49
+ });
50
+ program.addCommand(consoleCommand);
51
+ }
37
52
  }
53
+
54
+ program.parse();
55
+ }
38
56
  }