@h3ravel/console 11.0.5 → 11.0.7

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.
Files changed (62) hide show
  1. package/bin/chunk-6Z5DP356.js +1 -0
  2. package/bin/lexer-DQCqS3nf-XQPNMZG6.js +4 -0
  3. package/bin/run.cjs +6 -6
  4. package/bin/run.js +6 -6
  5. package/dist/Commands/MigrateCommand.cjs +0 -2
  6. package/dist/Commands/MigrateCommand.js +1 -1
  7. package/dist/Commands/ServeCommand.cjs +1 -1
  8. package/dist/Commands/ServeCommand.js +1 -1
  9. package/dist/IO/app.cjs +24 -13
  10. package/dist/IO/app.js +7 -7
  11. package/dist/IO/providers.cjs +24 -5
  12. package/dist/IO/providers.js +6 -6
  13. package/dist/Kernel.cjs +1 -3
  14. package/dist/Kernel.js +4 -4
  15. package/dist/Musket.cjs +1 -3
  16. package/dist/Musket.js +3 -3
  17. package/dist/Providers/ConsoleServiceProvider.cjs +11 -3
  18. package/dist/Providers/ConsoleServiceProvider.js +5 -5
  19. package/dist/chunk-23QH5R54.js +27 -0
  20. package/dist/chunk-3ASEWMRX.js +37 -0
  21. package/dist/chunk-3RX6CLNR.js +32 -0
  22. package/dist/chunk-6OIH6FS4.js +32 -0
  23. package/dist/chunk-7EWRZPTX.js +63 -0
  24. package/dist/chunk-7PUQ5ZIN.js +6 -0
  25. package/dist/chunk-A5AONVOH.js +6 -0
  26. package/dist/chunk-ADIVRUAJ.js +27 -0
  27. package/dist/chunk-CCEWV2BR.js +39 -0
  28. package/dist/chunk-DXQTBFGG.js +31 -0
  29. package/dist/chunk-E4SSLXFT.js +63 -0
  30. package/dist/chunk-EIOQKTRM.js +104 -0
  31. package/dist/chunk-G4OE26TZ.js +33 -0
  32. package/dist/chunk-K3GOQSS3.js +6 -0
  33. package/dist/chunk-KCJKQP37.js +133 -0
  34. package/dist/chunk-KZA3MC77.js +151 -0
  35. package/dist/chunk-LLL3V7LB.js +6 -0
  36. package/dist/chunk-LQ6DL2HS.js +68 -0
  37. package/dist/chunk-MPXPSSLJ.js +133 -0
  38. package/dist/chunk-NFRXMBRP.js +24 -0
  39. package/dist/chunk-NVPKTRMT.js +7 -0
  40. package/dist/chunk-ORPRWIQ2.js +33 -0
  41. package/dist/chunk-PBNCVQZC.js +6 -0
  42. package/dist/chunk-PYSJMSNM.js +27 -0
  43. package/dist/chunk-Q3OMG6YH.js +186 -0
  44. package/dist/chunk-QCNBVSFO.js +68 -0
  45. package/dist/chunk-QMEO4OUR.js +151 -0
  46. package/dist/chunk-QSQNELZQ.js +83 -0
  47. package/dist/chunk-T6OOKENF.js +6 -0
  48. package/dist/chunk-TBDROT3I.js +6356 -0
  49. package/dist/chunk-TH2RWMWA.js +133 -0
  50. package/dist/chunk-UWCTG2LX.js +24 -0
  51. package/dist/chunk-WO2BXMBQ.js +6 -0
  52. package/dist/chunk-XAWZUZVP.js +32 -0
  53. package/dist/chunk-XD2Q7LWE.js +24 -0
  54. package/dist/chunk-XUYTJO6X.js +104 -0
  55. package/dist/chunk-YRUCICBV.js +24 -0
  56. package/dist/chunk-Z5XE72Q5.js +68 -0
  57. package/dist/index.cjs +25 -13
  58. package/dist/index.js +8 -8
  59. package/dist/lexer-DQCqS3nf-6W2BHF4T.js +68 -0
  60. package/dist/run.cjs +27 -13
  61. package/dist/run.js +8 -8
  62. package/package.json +7 -2
@@ -34,6 +34,7 @@ __export(ConsoleServiceProvider_exports, {
34
34
  ConsoleServiceProvider: () => ConsoleServiceProvider
35
35
  });
36
36
  module.exports = __toCommonJS(ConsoleServiceProvider_exports);
37
+ var import_node_events = require("events");
37
38
 
38
39
  // src/Utils.ts
39
40
  var import_promises = require("fs/promises");
@@ -429,7 +430,6 @@ var MakeCommand = class extends Command {
429
430
  };
430
431
 
431
432
  // src/Commands/MigrateCommand.ts
432
- var import_arquebus = require("@h3ravel/arquebus");
433
433
  var MigrateCommand = class extends Command {
434
434
  static {
435
435
  __name(this, "MigrateCommand");
@@ -513,7 +513,6 @@ var MigrateCommand = class extends Command {
513
513
  */
514
514
  async migrateStatus() {
515
515
  const path3 = app_path();
516
- console.log(import_arquebus.arquebus.connection());
517
516
  this.kernel.output.success(`Show the status of each migration.`);
518
517
  }
519
518
  /**
@@ -556,7 +555,7 @@ var ServeCommand = class extends Command {
556
555
  env: Object.assign({}, process.env, {
557
556
  NODE_ENV: "development"
558
557
  }),
559
- detached: true
558
+ detached: false
560
559
  });
561
560
  const cleanup = /* @__PURE__ */ __name(() => {
562
561
  console.log(111111);
@@ -895,7 +894,16 @@ var ConsoleServiceProvider = class extends import_core.ServiceProvider {
895
894
  }
896
895
  static priority = 992;
897
896
  register() {
897
+ }
898
+ boot() {
898
899
  Kernel.init(this.app);
900
+ new import_node_events.EventEmitter().once("SIGINT", () => process.exit(0));
901
+ process.on("SIGINT", () => {
902
+ process.exit(0);
903
+ });
904
+ process.on("SIGTERM", () => {
905
+ process.exit(0);
906
+ });
899
907
  }
900
908
  };
901
909
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ConsoleServiceProvider
3
- } from "../chunk-U6TOLKGJ.js";
4
- import "../chunk-M4ZRDJJ2.js";
5
- import "../chunk-XCOSZXAE.js";
6
- import "../chunk-FOSDCKCR.js";
7
- import "../chunk-2O2AYFAG.js";
3
+ } from "../chunk-6OIH6FS4.js";
4
+ import "../chunk-QCNBVSFO.js";
5
+ import "../chunk-KCJKQP37.js";
6
+ import "../chunk-EIOQKTRM.js";
7
+ import "../chunk-7EWRZPTX.js";
8
8
  import "../chunk-3FVPHQCH.js";
9
9
  import "../chunk-PMV4TMFS.js";
10
10
  import "../chunk-POF4JGTX.js";
@@ -0,0 +1,27 @@
1
+ import {
2
+ ConsoleServiceProvider
3
+ } from "./chunk-XAWZUZVP.js";
4
+
5
+ // src/IO/providers.ts
6
+ import { HttpServiceProvider } from "@h3ravel/http";
7
+ import { RouteServiceProvider, AssetsServiceProvider } from "@h3ravel/router";
8
+ import { DatabaseServiceProvider } from "@h3ravel/database";
9
+ import { CacheServiceProvider } from "@h3ravel/cache";
10
+ import { QueueServiceProvider } from "@h3ravel/queue";
11
+ import { MailServiceProvider } from "@h3ravel/mail";
12
+ import { ConfigServiceProvider } from "@h3ravel/config";
13
+ var providers_default = [
14
+ HttpServiceProvider,
15
+ ConfigServiceProvider,
16
+ RouteServiceProvider,
17
+ AssetsServiceProvider,
18
+ DatabaseServiceProvider,
19
+ CacheServiceProvider,
20
+ QueueServiceProvider,
21
+ MailServiceProvider,
22
+ ConsoleServiceProvider
23
+ ];
24
+
25
+ export {
26
+ providers_default
27
+ };
@@ -0,0 +1,37 @@
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, Kernel } from "@h3ravel/core";
10
+ import { Request, Response } from "@h3ravel/http";
11
+ import { HttpContext } from "@h3ravel/shared";
12
+ var app_default = class {
13
+ static {
14
+ __name(this, "default");
15
+ }
16
+ async bootstrap() {
17
+ const app = new Application(process.cwd());
18
+ app.registerProviders(providers_default);
19
+ await app.registerConfiguredProviders();
20
+ await app.boot();
21
+ const h3App = app.make("http.app");
22
+ const serve = app.make("http.serve");
23
+ const kernel = new Kernel((event) => HttpContext.init({
24
+ app,
25
+ request: new Request(event, app),
26
+ response: new Response(event, app)
27
+ }));
28
+ h3App.use((event) => kernel.handle(event, async () => void 0));
29
+ serve(h3App, {
30
+ port: 3001
31
+ });
32
+ }
33
+ };
34
+
35
+ export {
36
+ app_default
37
+ };
@@ -0,0 +1,32 @@
1
+ import {
2
+ Kernel
3
+ } from "./chunk-LQ6DL2HS.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-SHUYVCID.js";
7
+
8
+ // src/Providers/ConsoleServiceProvider.ts
9
+ import { EventEmitter } from "events";
10
+ import { ServiceProvider } from "@h3ravel/core";
11
+ var ConsoleServiceProvider = class extends ServiceProvider {
12
+ static {
13
+ __name(this, "ConsoleServiceProvider");
14
+ }
15
+ static priority = 992;
16
+ register() {
17
+ }
18
+ boot() {
19
+ Kernel.init(this.app);
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
+ ConsoleServiceProvider
32
+ };
@@ -0,0 +1,32 @@
1
+ import {
2
+ Kernel
3
+ } from "./chunk-QCNBVSFO.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-SHUYVCID.js";
7
+
8
+ // src/Providers/ConsoleServiceProvider.ts
9
+ import { EventEmitter } from "events";
10
+ import { ServiceProvider } from "@h3ravel/core";
11
+ var ConsoleServiceProvider = class extends ServiceProvider {
12
+ static {
13
+ __name(this, "ConsoleServiceProvider");
14
+ }
15
+ static priority = 992;
16
+ register() {
17
+ }
18
+ boot() {
19
+ Kernel.init(this.app);
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
+ ConsoleServiceProvider
32
+ };
@@ -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: false
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,6 @@
1
+ import {
2
+ app_default
3
+ } from "./chunk-NFRXMBRP.js";
4
+
5
+ // src/run.ts
6
+ new app_default().bootstrap();
@@ -0,0 +1,6 @@
1
+ import {
2
+ app_default
3
+ } from "./chunk-DXQTBFGG.js";
4
+
5
+ // src/run.ts
6
+ new app_default().bootstrap();
@@ -0,0 +1,27 @@
1
+ import {
2
+ ConsoleServiceProvider
3
+ } from "./chunk-6OIH6FS4.js";
4
+
5
+ // src/IO/providers.ts
6
+ import { HttpServiceProvider } from "@h3ravel/http";
7
+ import { RouteServiceProvider, AssetsServiceProvider } from "@h3ravel/router";
8
+ import { DatabaseServiceProvider } from "@h3ravel/database";
9
+ import { CacheServiceProvider } from "@h3ravel/cache";
10
+ import { QueueServiceProvider } from "@h3ravel/queue";
11
+ import { MailServiceProvider } from "@h3ravel/mail";
12
+ import { ConfigServiceProvider } from "@h3ravel/config";
13
+ var providers_default = [
14
+ HttpServiceProvider,
15
+ ConfigServiceProvider,
16
+ RouteServiceProvider,
17
+ AssetsServiceProvider,
18
+ DatabaseServiceProvider,
19
+ CacheServiceProvider,
20
+ QueueServiceProvider,
21
+ MailServiceProvider,
22
+ ConsoleServiceProvider
23
+ ];
24
+
25
+ export {
26
+ providers_default
27
+ };
@@ -0,0 +1,39 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __commonJS = (cb, mod) => function __require2() {
15
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
33
+
34
+ export {
35
+ __name,
36
+ __require,
37
+ __commonJS,
38
+ __toESM
39
+ };
@@ -0,0 +1,31 @@
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 { EventEmitter } from "events";
10
+ var app_default = class {
11
+ static {
12
+ __name(this, "default");
13
+ }
14
+ async bootstrap() {
15
+ dd("app");
16
+ app.registerProviders(providers_default);
17
+ await app.registerConfiguredProviders();
18
+ await app.boot();
19
+ new EventEmitter().once("SIGINT", () => process.exit(0));
20
+ process.on("SIGINT", () => {
21
+ process.exit(0);
22
+ });
23
+ process.on("SIGTERM", () => {
24
+ process.exit(0);
25
+ });
26
+ }
27
+ };
28
+
29
+ export {
30
+ app_default
31
+ };
@@ -0,0 +1,63 @@
1
+ import {
2
+ Command
3
+ } from "./chunk-QSQNELZQ.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-CCEWV2BR.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: false
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,104 @@
1
+ import {
2
+ Command
3
+ } from "./chunk-O45AB4MX.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-SHUYVCID.js";
7
+
8
+ // src/Commands/MigrateCommand.ts
9
+ var MigrateCommand = class extends Command {
10
+ static {
11
+ __name(this, "MigrateCommand");
12
+ }
13
+ /**
14
+ * The name and signature of the console command.
15
+ *
16
+ * @var string
17
+ */
18
+ signature = `migrate:
19
+ {fresh : Drop all tables and re-run all migrations.}
20
+ {install : Create the migration repository.}
21
+ {refresh : Reset and re-run all migrations.}
22
+ {reset : Rollback all database migrations.}
23
+ {rollback : Rollback the last database migration.}
24
+ {status : Show the status of each migration.}
25
+ {publish : Publish any migration files from installed packages.}
26
+ {^--s|seed : Seed the database}
27
+ `;
28
+ /**
29
+ * The console command description.
30
+ *
31
+ * @var string
32
+ */
33
+ description = "Run all pending migrations.";
34
+ /**
35
+ * Execute the console command.
36
+ */
37
+ async handle() {
38
+ const command = this.dictionary.name ?? this.dictionary.baseCommand;
39
+ const methods = {
40
+ migrate: "migrateRun",
41
+ fresh: "migrateFresh",
42
+ install: "migrateInstall",
43
+ refresh: "migrateRefresh",
44
+ reset: "migrateReset",
45
+ rollback: "migrateRollback",
46
+ status: "migrateStatus",
47
+ publish: "migratePublish"
48
+ };
49
+ await this?.[methods[command]]();
50
+ }
51
+ /**
52
+ * Run all pending migrations.
53
+ */
54
+ async migrateRun() {
55
+ this.kernel.output.success(`Running migrations are not yet supported.`);
56
+ }
57
+ /**
58
+ * Drop all tables and re-run all migrations.
59
+ */
60
+ async migrateFresh() {
61
+ this.kernel.output.success(`Drop all tables and re-run all migrations.`);
62
+ }
63
+ /**
64
+ * Create the migration repository.
65
+ */
66
+ async migrateInstall() {
67
+ this.kernel.output.success(`Create the migration repository.`);
68
+ }
69
+ /**
70
+ * Reset and re-run all migrations.
71
+ */
72
+ async migrateRefresh() {
73
+ this.kernel.output.success(`Resetting and re-running migrations is not yet supported.`);
74
+ }
75
+ /**
76
+ * Rollback all database migrations.
77
+ */
78
+ async migrateReset() {
79
+ this.kernel.output.success(`Rolling back all migration is not yet supported.`);
80
+ }
81
+ /**
82
+ * Rollback the last database migration.
83
+ */
84
+ async migrateRollback() {
85
+ this.kernel.output.success(`Rolling back the last migration is not yet supported.`);
86
+ }
87
+ /**
88
+ * Show the status of each migration.
89
+ */
90
+ async migrateStatus() {
91
+ const path = app_path();
92
+ this.kernel.output.success(`Show the status of each migration.`);
93
+ }
94
+ /**
95
+ * Publish any migration files from installed packages.
96
+ */
97
+ async migratePublish() {
98
+ this.kernel.output.success(`Publish any migration files from installed packages.`);
99
+ }
100
+ };
101
+
102
+ export {
103
+ MigrateCommand
104
+ };
@@ -0,0 +1,33 @@
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
+ dd("app");
20
+ await app.boot();
21
+ new EventEmitter().once("SIGINT", () => process.exit(0));
22
+ process.on("SIGINT", () => {
23
+ process.exit(0);
24
+ });
25
+ process.on("SIGTERM", () => {
26
+ process.exit(0);
27
+ });
28
+ }
29
+ };
30
+
31
+ export {
32
+ app_default
33
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ app_default
3
+ } from "./chunk-YRUCICBV.js";
4
+
5
+ // src/run.ts
6
+ new app_default().bootstrap();