@dnax/core 0.68.0 ā 0.68.2
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/app/index.ts +29 -27
- package/lib/index.ts +2 -15
- package/package.json +2 -2
package/app/index.ts
CHANGED
|
@@ -2,6 +2,8 @@ import consola from "consola";
|
|
|
2
2
|
import { Cfg, loadCfg } from "../config";
|
|
3
3
|
import { init } from "../lib";
|
|
4
4
|
import { initScript } from "../lib/scripts";
|
|
5
|
+
import ora from "ora";
|
|
6
|
+
|
|
5
7
|
import { hookDatabase } from "../lib/database";
|
|
6
8
|
import boxen from "boxen";
|
|
7
9
|
import { loadSocket } from "../lib/socket";
|
|
@@ -41,6 +43,11 @@ async function runApp(config?: configRunApp, clb?: Function): Promise<Server> {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
if (available) {
|
|
46
|
+
console.clear();
|
|
47
|
+
console.log("\n");
|
|
48
|
+
const spinner = ora("Initializing...").start();
|
|
49
|
+
spinner.color = "green";
|
|
50
|
+
|
|
44
51
|
// Load all ressouce
|
|
45
52
|
await init();
|
|
46
53
|
const HonoApp = HonoInstance();
|
|
@@ -70,38 +77,33 @@ async function runApp(config?: configRunApp, clb?: Function): Promise<Server> {
|
|
|
70
77
|
let serverName =
|
|
71
78
|
process.env.SERVER_NAME || Cfg?.server?.name || "SERVER";
|
|
72
79
|
|
|
73
|
-
let info = "";
|
|
74
80
|
let envName = process.env?.NODE_ENV || "dev";
|
|
75
|
-
info += `${serverName}`.gray.underline.bold;
|
|
76
|
-
info += `\n`;
|
|
77
|
-
info += `\n`;
|
|
78
|
-
info += `Env: ${envName}`.green.bold + "\n";
|
|
79
|
-
info += `url: http://localhost:${PORT}\n`.gray.bold;
|
|
80
|
-
//info += `Jwt Secret: ${Cfg.server.jwt?.secret}\n`.gray;
|
|
81
|
-
info += `\n`;
|
|
82
|
-
info += "TENANTS :".gray.underline.bold;
|
|
83
|
-
info += `\n`;
|
|
84
|
-
Cfg.tenants?.map((t: any) => {
|
|
85
|
-
info += `\n${t?.name?.blue || "_"} : ${t?.id?.green}`.bold;
|
|
86
|
-
});
|
|
87
|
-
info += `\n\n`;
|
|
88
|
-
info += `š ${new Date().toLocaleString()}`.gray;
|
|
89
81
|
|
|
90
|
-
|
|
82
|
+
spinner.stop();
|
|
83
|
+
spinner.clear();
|
|
91
84
|
console.log(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
"\n---------------------------------------".gray +
|
|
86
|
+
"\n⨠Your server is up and running\n".green.bold +
|
|
87
|
+
"---------------------------------------\n".gray +
|
|
88
|
+
`š¢ Version : ${pkg.version}`.gray.bold +
|
|
89
|
+
`\n` +
|
|
90
|
+
`š Environment : ${
|
|
91
|
+
process.env.NODE_ENV || envName || "development"
|
|
92
|
+
}\n`.gray +
|
|
93
|
+
`š Started at : ${new Date().toLocaleString()}\n`.gray +
|
|
94
|
+
`\n` +
|
|
95
|
+
`š Url : http://localhost:${PORT}\n`.gray +
|
|
96
|
+
`TENANTS :`.gray.underline.bold +
|
|
97
|
+
`\n` +
|
|
98
|
+
Cfg.tenants?.map((t: any) => {
|
|
99
|
+
return `\n${t?.name?.blue || "_"} : ${t?.id?.green}`.bold;
|
|
100
|
+
}) +
|
|
101
|
+
`\n` +
|
|
102
|
+
"---------------------------------------\n".gray
|
|
103
103
|
);
|
|
104
104
|
|
|
105
|
+
if (clb) clb();
|
|
106
|
+
|
|
105
107
|
//AfterStart
|
|
106
108
|
if (config?.afterStart) {
|
|
107
109
|
for (const fn of config?.afterStart) {
|
package/lib/index.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { initCron } from "./cron";
|
|
|
6
6
|
import { loadPermissions } from "./permissions";
|
|
7
7
|
import { loadSocket } from "../lib/socket";
|
|
8
8
|
import { loadAutoRoutes } from "./routes";
|
|
9
|
-
|
|
10
9
|
import { syncAdapterFileSystem } from "./media";
|
|
11
10
|
import { runGenTypes } from "../types/gen";
|
|
12
11
|
import consola from "consola";
|
|
@@ -16,10 +15,10 @@ import ora from "ora";
|
|
|
16
15
|
async function init(cf = { app: null }) {
|
|
17
16
|
console.clear();
|
|
18
17
|
console.log("\n");
|
|
19
|
-
|
|
20
|
-
const spinner = ora("\nInitializing...").start();
|
|
18
|
+
const spinner = ora("Initializing...").start();
|
|
21
19
|
spinner.color = "green";
|
|
22
20
|
|
|
21
|
+
//console.log("š Initializing...".blue);
|
|
23
22
|
await loadSocket();
|
|
24
23
|
//consola.success("Loaded socket");
|
|
25
24
|
// load all tenants database
|
|
@@ -56,18 +55,6 @@ async function init(cf = { app: null }) {
|
|
|
56
55
|
//consola.success("Loaded auto routes");
|
|
57
56
|
|
|
58
57
|
await initCron();
|
|
59
|
-
//consola.success("Loaded cron/Tasks");
|
|
60
|
-
|
|
61
|
-
//consola.success("Loaded scripts");
|
|
62
|
-
spinner.clear();
|
|
63
|
-
spinner.stop();
|
|
64
|
-
|
|
65
|
-
/* console.log(
|
|
66
|
-
"\n-------------------------------------".gray +
|
|
67
|
-
"\n Your server is up and running\n".green.bold +
|
|
68
|
-
"-------------------------------------\n".gray
|
|
69
|
-
);
|
|
70
|
-
*/
|
|
71
58
|
}
|
|
72
59
|
|
|
73
60
|
export { init };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnax/core",
|
|
3
|
-
"version": "0.68.
|
|
3
|
+
"version": "0.68.2",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dot-object": "2.1.5",
|
|
36
36
|
"fs-extra": "^11.2.0",
|
|
37
37
|
"generate-unique-id": "^2.0.3",
|
|
38
|
-
"hono": "4.
|
|
38
|
+
"hono": "4.6.14",
|
|
39
39
|
"joi": "17.13.3",
|
|
40
40
|
"json-joy": "16.8.0",
|
|
41
41
|
"jsonwebtoken": "^9.0.2",
|