@webtypen/webframez-core 0.1.6 → 0.1.8

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.
@@ -6,7 +6,6 @@ export declare class ConsoleCommand {
6
6
  static description?: string;
7
7
  rl: readline.Interface | null;
8
8
  currentProgress: ConsoleProgressBar | null;
9
- constructor();
10
9
  handle(): Promise<void>;
11
10
  handleSystem(): Promise<void>;
12
11
  finallySystem(): Promise<void>;
@@ -18,17 +18,18 @@ const readline_1 = __importDefault(require("readline"));
18
18
  const ConsoleProgressBar_1 = require("./ConsoleProgressBar");
19
19
  class ConsoleCommand {
20
20
  constructor() {
21
+ this.rl = null;
21
22
  this.currentProgress = null;
22
- this.rl = readline_1.default.createInterface({
23
- input: process.stdin,
24
- output: process.stdout,
25
- });
26
23
  }
27
24
  handle() {
28
25
  return __awaiter(this, void 0, void 0, function* () { });
29
26
  }
30
27
  handleSystem() {
31
28
  return __awaiter(this, void 0, void 0, function* () {
29
+ this.rl = readline_1.default.createInterface({
30
+ input: process.stdin,
31
+ output: process.stdout,
32
+ });
32
33
  try {
33
34
  yield this.handle();
34
35
  }
@@ -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.handle();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
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",
@@ -6,19 +6,17 @@ export class ConsoleCommand {
6
6
  static signature: string;
7
7
  static description?: string;
8
8
 
9
- rl: readline.Interface | null;
9
+ rl: readline.Interface | null = null;
10
10
  currentProgress: ConsoleProgressBar | null = null;
11
11
 
12
- constructor() {
12
+ async handle() {}
13
+
14
+ async handleSystem() {
13
15
  this.rl = readline.createInterface({
14
16
  input: process.stdin,
15
17
  output: process.stdout,
16
18
  });
17
- }
18
19
 
19
- async handle() {}
20
-
21
- async handleSystem() {
22
20
  try {
23
21
  await this.handle();
24
22
  } catch (e) {
@@ -3,59 +3,59 @@ 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
15
 
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
- }
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
- 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;
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
- const consoleCommand = new Command(command.signature);
43
- if (command.description && command.description.trim() !== "") {
44
- consoleCommand.description(command.description);
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
- program.parse();
60
- }
59
+ program.parse();
60
+ }
61
61
  }