@h3ravel/console 11.0.3 → 11.0.5

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.
@@ -136,7 +136,7 @@ var ServeCommand = class extends Command {
136
136
  detached: true
137
137
  });
138
138
  const cleanup = /* @__PURE__ */ __name(() => {
139
- console.log(111);
139
+ console.log(111111);
140
140
  if (child.pid) {
141
141
  process.kill(child.pid, "SIGTERM");
142
142
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ServeCommand
3
- } from "../chunk-SP4JKAUC.js";
3
+ } from "../chunk-2O2AYFAG.js";
4
4
  import "../chunk-O45AB4MX.js";
5
5
  import "../chunk-SHUYVCID.js";
6
6
  export {
package/dist/IO/app.cjs CHANGED
@@ -37,6 +37,10 @@ module.exports = __toCommonJS(app_exports);
37
37
  var import_core2 = require("@h3ravel/core");
38
38
  var import_node_events = require("events");
39
39
 
40
+ // src/IO/providers.ts
41
+ var import_config = require("@h3ravel/config");
42
+ var import_database = require("@h3ravel/database");
43
+
40
44
  // src/Utils.ts
41
45
  var import_promises = require("fs/promises");
42
46
  var import_chalk = __toESM(require("chalk"), 1);
@@ -561,7 +565,7 @@ var ServeCommand = class extends Command {
561
565
  detached: true
562
566
  });
563
567
  const cleanup = /* @__PURE__ */ __name(() => {
564
- console.log(111);
568
+ console.log(111111);
565
569
  if (child.pid) {
566
570
  process.kill(child.pid, "SIGTERM");
567
571
  }
@@ -889,10 +893,6 @@ var Kernel = class _Kernel {
889
893
  }
890
894
  };
891
895
 
892
- // src/IO/providers.ts
893
- var import_config = require("@h3ravel/config");
894
- var import_database = require("@h3ravel/database");
895
-
896
896
  // src/Providers/ConsoleServiceProvider.ts
897
897
  var import_core = require("@h3ravel/core");
898
898
  var ConsoleServiceProvider = class extends import_core.ServiceProvider {
@@ -906,7 +906,9 @@ var ConsoleServiceProvider = class extends import_core.ServiceProvider {
906
906
  };
907
907
 
908
908
  // src/IO/providers.ts
909
+ var import_http = require("@h3ravel/http");
909
910
  var providers_default = [
911
+ import_http.HttpServiceProvider,
910
912
  import_config.ConfigServiceProvider,
911
913
  import_database.DatabaseServiceProvider,
912
914
  ConsoleServiceProvider
@@ -922,7 +924,6 @@ var app_default = class {
922
924
  app.registerProviders(providers_default);
923
925
  await app.registerConfiguredProviders();
924
926
  await app.boot();
925
- new Kernel(app);
926
927
  new import_node_events.EventEmitter().once("SIGINT", () => process.exit(0));
927
928
  process.on("SIGINT", () => {
928
929
  process.exit(0);
package/dist/IO/app.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  app_default
3
- } from "../chunk-XSL373TG.js";
4
- import "../chunk-KMIFCLXG.js";
5
- import "../chunk-IGEFNODG.js";
6
- import "../chunk-URLTFJET.js";
7
- import "../chunk-TN5SV7LF.js";
3
+ } from "../chunk-MAQAT3PU.js";
4
+ import "../chunk-P7M5PEDY.js";
5
+ import "../chunk-U6TOLKGJ.js";
6
+ import "../chunk-M4ZRDJJ2.js";
7
+ import "../chunk-XCOSZXAE.js";
8
8
  import "../chunk-FOSDCKCR.js";
9
- import "../chunk-SP4JKAUC.js";
9
+ import "../chunk-2O2AYFAG.js";
10
10
  import "../chunk-3FVPHQCH.js";
11
11
  import "../chunk-PMV4TMFS.js";
12
12
  import "../chunk-POF4JGTX.js";
@@ -561,7 +561,7 @@ var ServeCommand = class extends Command {
561
561
  detached: true
562
562
  });
563
563
  const cleanup = /* @__PURE__ */ __name(() => {
564
- console.log(111);
564
+ console.log(111111);
565
565
  if (child.pid) {
566
566
  process.kill(child.pid, "SIGTERM");
567
567
  }
@@ -902,7 +902,9 @@ var ConsoleServiceProvider = class extends import_core.ServiceProvider {
902
902
  };
903
903
 
904
904
  // src/IO/providers.ts
905
+ var import_http = require("@h3ravel/http");
905
906
  var providers_default = [
907
+ import_http.HttpServiceProvider,
906
908
  import_config.ConfigServiceProvider,
907
909
  import_database.DatabaseServiceProvider,
908
910
  ConsoleServiceProvider
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  providers_default
3
- } from "../chunk-KMIFCLXG.js";
4
- import "../chunk-IGEFNODG.js";
5
- import "../chunk-URLTFJET.js";
6
- import "../chunk-TN5SV7LF.js";
3
+ } from "../chunk-P7M5PEDY.js";
4
+ import "../chunk-U6TOLKGJ.js";
5
+ import "../chunk-M4ZRDJJ2.js";
6
+ import "../chunk-XCOSZXAE.js";
7
7
  import "../chunk-FOSDCKCR.js";
8
- import "../chunk-SP4JKAUC.js";
8
+ import "../chunk-2O2AYFAG.js";
9
9
  import "../chunk-3FVPHQCH.js";
10
10
  import "../chunk-PMV4TMFS.js";
11
11
  import "../chunk-POF4JGTX.js";
package/dist/Kernel.cjs CHANGED
@@ -559,7 +559,7 @@ var ServeCommand = class extends Command {
559
559
  detached: true
560
560
  });
561
561
  const cleanup = /* @__PURE__ */ __name(() => {
562
- console.log(111);
562
+ console.log(111111);
563
563
  if (child.pid) {
564
564
  process.kill(child.pid, "SIGTERM");
565
565
  }
package/dist/Kernel.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Kernel
3
- } from "./chunk-URLTFJET.js";
4
- import "./chunk-TN5SV7LF.js";
3
+ } from "./chunk-M4ZRDJJ2.js";
4
+ import "./chunk-XCOSZXAE.js";
5
5
  import "./chunk-FOSDCKCR.js";
6
- import "./chunk-SP4JKAUC.js";
6
+ import "./chunk-2O2AYFAG.js";
7
7
  import "./chunk-3FVPHQCH.js";
8
8
  import "./chunk-PMV4TMFS.js";
9
9
  import "./chunk-POF4JGTX.js";
package/dist/Musket.cjs CHANGED
@@ -559,7 +559,7 @@ var ServeCommand = class extends Command {
559
559
  detached: true
560
560
  });
561
561
  const cleanup = /* @__PURE__ */ __name(() => {
562
- console.log(111);
562
+ console.log(111111);
563
563
  if (child.pid) {
564
564
  process.kill(child.pid, "SIGTERM");
565
565
  }
package/dist/Musket.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Musket
3
- } from "./chunk-TN5SV7LF.js";
3
+ } from "./chunk-XCOSZXAE.js";
4
4
  import "./chunk-FOSDCKCR.js";
5
- import "./chunk-SP4JKAUC.js";
5
+ import "./chunk-2O2AYFAG.js";
6
6
  import "./chunk-3FVPHQCH.js";
7
7
  import "./chunk-PMV4TMFS.js";
8
8
  import "./chunk-POF4JGTX.js";
@@ -559,7 +559,7 @@ var ServeCommand = class extends Command {
559
559
  detached: true
560
560
  });
561
561
  const cleanup = /* @__PURE__ */ __name(() => {
562
- console.log(111);
562
+ console.log(111111);
563
563
  if (child.pid) {
564
564
  process.kill(child.pid, "SIGTERM");
565
565
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ConsoleServiceProvider
3
- } from "../chunk-IGEFNODG.js";
4
- import "../chunk-URLTFJET.js";
5
- import "../chunk-TN5SV7LF.js";
3
+ } from "../chunk-U6TOLKGJ.js";
4
+ import "../chunk-M4ZRDJJ2.js";
5
+ import "../chunk-XCOSZXAE.js";
6
6
  import "../chunk-FOSDCKCR.js";
7
- import "../chunk-SP4JKAUC.js";
7
+ import "../chunk-2O2AYFAG.js";
8
8
  import "../chunk-3FVPHQCH.js";
9
9
  import "../chunk-PMV4TMFS.js";
10
10
  import "../chunk-POF4JGTX.js";
@@ -0,0 +1,63 @@
1
+ import {
2
+ Command
3
+ } from "./chunk-O45AB4MX.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-SHUYVCID.js";
7
+
8
+ // src/Commands/ServeCommand.ts
9
+ import { spawn } from "child_process";
10
+ var ServeCommand = class extends Command {
11
+ static {
12
+ __name(this, "ServeCommand");
13
+ }
14
+ /**
15
+ * The name and signature of the console command.
16
+ *
17
+ * @var string
18
+ */
19
+ signature = "serve";
20
+ /**
21
+ * The console command description.
22
+ *
23
+ * @var string
24
+ */
25
+ description = "Start the Developement Server";
26
+ async handle() {
27
+ try {
28
+ await this.serve();
29
+ } catch (e) {
30
+ this.kernel.output.error(e);
31
+ }
32
+ }
33
+ async serve() {
34
+ const child = spawn("tsup-node", {
35
+ stdio: "inherit",
36
+ shell: true,
37
+ env: Object.assign({}, process.env, {
38
+ NODE_ENV: "development"
39
+ }),
40
+ detached: true
41
+ });
42
+ const cleanup = /* @__PURE__ */ __name(() => {
43
+ console.log(111111);
44
+ if (child.pid) {
45
+ process.kill(child.pid, "SIGTERM");
46
+ }
47
+ }, "cleanup");
48
+ process.on("SIGINT", () => child.kill("SIGINT"));
49
+ process.on("SIGTERM", () => child.kill("SIGTERM"));
50
+ process.on("SIGINT", () => {
51
+ cleanup();
52
+ process.exit(0);
53
+ });
54
+ process.on("SIGTERM", () => {
55
+ cleanup();
56
+ process.exit(0);
57
+ });
58
+ }
59
+ };
60
+
61
+ export {
62
+ ServeCommand
63
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ ConsoleServiceProvider
3
+ } from "./chunk-U6TOLKGJ.js";
4
+
5
+ // src/IO/providers.ts
6
+ import { DatabaseServiceProvider } from "@h3ravel/database";
7
+ var providers_default = [
8
+ DatabaseServiceProvider,
9
+ ConsoleServiceProvider
10
+ ];
11
+
12
+ export {
13
+ providers_default
14
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ app_default
3
+ } from "./chunk-MAQAT3PU.js";
4
+
5
+ // src/run.ts
6
+ new app_default().bootstrap();
@@ -0,0 +1,36 @@
1
+ import {
2
+ providers_default
3
+ } from "./chunk-E5XIGIEX.js";
4
+ import {
5
+ Kernel
6
+ } from "./chunk-URLTFJET.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-SHUYVCID.js";
10
+
11
+ // src/IO/app.ts
12
+ import { Application } from "@h3ravel/core";
13
+ import { EventEmitter } from "events";
14
+ var app_default = class {
15
+ static {
16
+ __name(this, "default");
17
+ }
18
+ async bootstrap() {
19
+ const app = new Application(process.cwd());
20
+ app.registerProviders(providers_default);
21
+ await app.registerConfiguredProviders();
22
+ await app.boot();
23
+ new Kernel(app);
24
+ new EventEmitter().once("SIGINT", () => process.exit(0));
25
+ process.on("SIGINT", () => {
26
+ process.exit(0);
27
+ });
28
+ process.on("SIGTERM", () => {
29
+ process.exit(0);
30
+ });
31
+ }
32
+ };
33
+
34
+ export {
35
+ app_default
36
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ ConsoleServiceProvider
3
+ } from "./chunk-IGEFNODG.js";
4
+
5
+ // src/IO/providers.ts
6
+ import { DatabaseServiceProvider } from "@h3ravel/database";
7
+ var providers_default = [
8
+ DatabaseServiceProvider,
9
+ ConsoleServiceProvider
10
+ ];
11
+
12
+ export {
13
+ providers_default
14
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ app_default
3
+ } from "./chunk-TJZCDDEV.js";
4
+
5
+ // src/run.ts
6
+ import { EventEmitter } from "events";
7
+ new app_default().bootstrap();
8
+ new EventEmitter().once("SIGINT", () => process.exit(0));
@@ -0,0 +1,16 @@
1
+ import {
2
+ ConsoleServiceProvider
3
+ } from "./chunk-U6TOLKGJ.js";
4
+
5
+ // src/IO/providers.ts
6
+ import { ConfigServiceProvider } from "@h3ravel/config";
7
+ import { DatabaseServiceProvider } from "@h3ravel/database";
8
+ var providers_default = [
9
+ ConfigServiceProvider,
10
+ DatabaseServiceProvider,
11
+ ConsoleServiceProvider
12
+ ];
13
+
14
+ export {
15
+ providers_default
16
+ };
@@ -0,0 +1,8 @@
1
+ import {
2
+ app_default
3
+ } from "./chunk-JXL4VJHZ.js";
4
+
5
+ // src/run.ts
6
+ import { EventEmitter } from "events";
7
+ new app_default().bootstrap();
8
+ new EventEmitter().once("SIGINT", () => process.exit(0));
@@ -0,0 +1,36 @@
1
+ import {
2
+ providers_default
3
+ } from "./chunk-P7M5PEDY.js";
4
+ import {
5
+ Kernel
6
+ } from "./chunk-M4ZRDJJ2.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-SHUYVCID.js";
10
+
11
+ // src/IO/app.ts
12
+ import { Application } from "@h3ravel/core";
13
+ import { EventEmitter } from "events";
14
+ var app_default = class {
15
+ static {
16
+ __name(this, "default");
17
+ }
18
+ async bootstrap() {
19
+ const app = new Application(process.cwd());
20
+ app.registerProviders(providers_default);
21
+ await app.registerConfiguredProviders();
22
+ await app.boot();
23
+ new Kernel(app);
24
+ new EventEmitter().once("SIGINT", () => process.exit(0));
25
+ process.on("SIGINT", () => {
26
+ process.exit(0);
27
+ });
28
+ process.on("SIGTERM", () => {
29
+ process.exit(0);
30
+ });
31
+ }
32
+ };
33
+
34
+ export {
35
+ app_default
36
+ };
@@ -0,0 +1,68 @@
1
+ import {
2
+ Musket
3
+ } from "./chunk-XCOSZXAE.js";
4
+ import {
5
+ Utils
6
+ } from "./chunk-POF4JGTX.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-SHUYVCID.js";
10
+
11
+ // src/Kernel.ts
12
+ import { mkdir } from "fs/promises";
13
+ import path from "path";
14
+ var Kernel = class _Kernel {
15
+ static {
16
+ __name(this, "Kernel");
17
+ }
18
+ app;
19
+ cwd;
20
+ output = Utils.output();
21
+ basePath = "";
22
+ modulePath;
23
+ consolePath;
24
+ modulePackage;
25
+ consolePackage;
26
+ constructor(app, basePath) {
27
+ this.app = app;
28
+ }
29
+ static init(app) {
30
+ const instance = new _Kernel(app);
31
+ Promise.all([
32
+ instance.loadRequirements()
33
+ ]).then(([e]) => e.run());
34
+ }
35
+ async run() {
36
+ await Musket.parse(this);
37
+ process.exit(0);
38
+ }
39
+ async ensureDirectoryExists(dir) {
40
+ await mkdir(dir, {
41
+ recursive: true
42
+ });
43
+ }
44
+ async loadRequirements() {
45
+ this.cwd = path.join(process.cwd(), this.basePath);
46
+ this.modulePath = Utils.findModulePkg("@h3ravel/core", this.cwd) ?? "";
47
+ this.consolePath = Utils.findModulePkg("@h3ravel/console", this.cwd) ?? "";
48
+ try {
49
+ this.modulePackage = await import(path.join(this.modulePath, "package.json"));
50
+ } catch {
51
+ this.modulePackage = {
52
+ version: "N/A"
53
+ };
54
+ }
55
+ try {
56
+ this.consolePackage = await import(path.join(this.consolePath, "package.json"));
57
+ } catch {
58
+ this.consolePackage = {
59
+ version: "N/A"
60
+ };
61
+ }
62
+ return this;
63
+ }
64
+ };
65
+
66
+ export {
67
+ Kernel
68
+ };
@@ -0,0 +1,32 @@
1
+ import {
2
+ providers_default
3
+ } from "./chunk-P7M5PEDY.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-SHUYVCID.js";
7
+
8
+ // src/IO/app.ts
9
+ import { Application } from "@h3ravel/core";
10
+ import { EventEmitter } from "events";
11
+ var app_default = class {
12
+ static {
13
+ __name(this, "default");
14
+ }
15
+ async bootstrap() {
16
+ const app = new Application(process.cwd());
17
+ app.registerProviders(providers_default);
18
+ await app.registerConfiguredProviders();
19
+ await app.boot();
20
+ new EventEmitter().once("SIGINT", () => process.exit(0));
21
+ process.on("SIGINT", () => {
22
+ process.exit(0);
23
+ });
24
+ process.on("SIGTERM", () => {
25
+ process.exit(0);
26
+ });
27
+ }
28
+ };
29
+
30
+ export {
31
+ app_default
32
+ };
@@ -0,0 +1,18 @@
1
+ import {
2
+ ConsoleServiceProvider
3
+ } from "./chunk-U6TOLKGJ.js";
4
+
5
+ // src/IO/providers.ts
6
+ import { ConfigServiceProvider } from "@h3ravel/config";
7
+ import { DatabaseServiceProvider } from "@h3ravel/database";
8
+ import { HttpServiceProvider } from "@h3ravel/http";
9
+ var providers_default = [
10
+ HttpServiceProvider,
11
+ ConfigServiceProvider,
12
+ DatabaseServiceProvider,
13
+ ConsoleServiceProvider
14
+ ];
15
+
16
+ export {
17
+ providers_default
18
+ };
@@ -0,0 +1,36 @@
1
+ import {
2
+ providers_default
3
+ } from "./chunk-3VCNSA6P.js";
4
+ import {
5
+ Kernel
6
+ } from "./chunk-M4ZRDJJ2.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-SHUYVCID.js";
10
+
11
+ // src/IO/app.ts
12
+ import { Application } from "@h3ravel/core";
13
+ import { EventEmitter } from "events";
14
+ var app_default = class {
15
+ static {
16
+ __name(this, "default");
17
+ }
18
+ async bootstrap() {
19
+ const app = new Application(process.cwd());
20
+ app.registerProviders(providers_default);
21
+ await app.registerConfiguredProviders();
22
+ await app.boot();
23
+ new Kernel(app);
24
+ new EventEmitter().once("SIGINT", () => process.exit(0));
25
+ process.on("SIGINT", () => {
26
+ process.exit(0);
27
+ });
28
+ process.on("SIGTERM", () => {
29
+ process.exit(0);
30
+ });
31
+ }
32
+ };
33
+
34
+ export {
35
+ app_default
36
+ };
@@ -0,0 +1,36 @@
1
+ import {
2
+ providers_default
3
+ } from "./chunk-GXRCTWKL.js";
4
+ import {
5
+ Kernel
6
+ } from "./chunk-M4ZRDJJ2.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-SHUYVCID.js";
10
+
11
+ // src/IO/app.ts
12
+ import { Application } from "@h3ravel/core";
13
+ import { EventEmitter } from "events";
14
+ var app_default = class {
15
+ static {
16
+ __name(this, "default");
17
+ }
18
+ async bootstrap() {
19
+ const app = new Application(process.cwd());
20
+ app.registerProviders(providers_default);
21
+ await app.registerConfiguredProviders();
22
+ await app.boot();
23
+ new Kernel(app);
24
+ new EventEmitter().once("SIGINT", () => process.exit(0));
25
+ process.on("SIGINT", () => {
26
+ process.exit(0);
27
+ });
28
+ process.on("SIGTERM", () => {
29
+ process.exit(0);
30
+ });
31
+ }
32
+ };
33
+
34
+ export {
35
+ app_default
36
+ };
@@ -0,0 +1,22 @@
1
+ import {
2
+ Kernel
3
+ } from "./chunk-M4ZRDJJ2.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-SHUYVCID.js";
7
+
8
+ // src/Providers/ConsoleServiceProvider.ts
9
+ import { ServiceProvider } from "@h3ravel/core";
10
+ var ConsoleServiceProvider = class extends ServiceProvider {
11
+ static {
12
+ __name(this, "ConsoleServiceProvider");
13
+ }
14
+ static priority = 992;
15
+ register() {
16
+ Kernel.init(this.app);
17
+ }
18
+ };
19
+
20
+ export {
21
+ ConsoleServiceProvider
22
+ };