@h3ravel/console 10.0.0 → 11.0.1
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.
- package/README.md +13 -1
- package/dist/Commands/Command.cjs +104 -0
- package/dist/Commands/Command.js +7 -0
- package/dist/Commands/MakeCommand.cjs +433 -0
- package/dist/Commands/MakeCommand.js +9 -0
- package/dist/Commands/MigrateCommand.cjs +202 -0
- package/dist/Commands/MigrateCommand.js +8 -0
- package/dist/Commands/ServeCommand.cjs +159 -0
- package/dist/Commands/ServeCommand.js +8 -0
- package/dist/Contracts/ICommand.cjs +18 -0
- package/dist/Contracts/ICommand.js +1 -0
- package/dist/IO/app.cjs +934 -0
- package/dist/IO/app.js +17 -0
- package/dist/IO/providers.cjs +909 -0
- package/dist/IO/providers.js +16 -0
- package/dist/Kernel.cjs +892 -0
- package/dist/Kernel.js +14 -0
- package/dist/Musket.cjs +837 -0
- package/dist/Musket.js +13 -0
- package/dist/Providers/ConsoleServiceProvider.cjs +904 -0
- package/dist/Providers/ConsoleServiceProvider.js +15 -0
- package/dist/Signature.cjs +172 -0
- package/dist/Signature.js +7 -0
- package/dist/Utils.cjs +218 -0
- package/dist/Utils.js +9 -0
- package/dist/chunk-3FVPHQCH.js +151 -0
- package/dist/chunk-FOSDCKCR.js +106 -0
- package/dist/chunk-IGEFNODG.js +22 -0
- package/dist/chunk-KMIFCLXG.js +16 -0
- package/dist/chunk-NADN2PHB.js +0 -0
- package/dist/chunk-O45AB4MX.js +83 -0
- package/dist/chunk-PMV4TMFS.js +151 -0
- package/dist/chunk-POF4JGTX.js +186 -0
- package/dist/chunk-SHUYVCID.js +6 -0
- package/dist/chunk-SP4JKAUC.js +63 -0
- package/dist/chunk-TN5SV7LF.js +133 -0
- package/dist/chunk-UCOXL3OM.js +0 -0
- package/dist/chunk-URLTFJET.js +68 -0
- package/dist/chunk-XSL373TG.js +36 -0
- package/dist/index.cjs +892 -6
- package/dist/index.d.cts +306 -2
- package/dist/index.d.ts +306 -2
- package/dist/index.js +43 -15
- package/dist/run.cjs +1 -0
- package/dist/run.js +1 -0
- package/package.json +23 -6
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Musket
|
|
3
|
+
} from "./chunk-TN5SV7LF.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,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
providers_default
|
|
3
|
+
} from "./chunk-KMIFCLXG.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
|
+
};
|