@dnax/core 0.68.1 → 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 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
- if (clb) clb();
82
+ spinner.stop();
83
+ spinner.clear();
91
84
  console.log(
92
- boxen(info, {
93
- borderStyle: "double",
94
- title: `@dnax/server ${pkg.version}`,
95
- padding: 1.5,
96
- dimBorder: true,
97
-
98
- titleAlignment: "center",
99
- //float: "center",
100
- //margin: 1,
101
- borderColor: "gray",
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
@@ -55,20 +55,6 @@ async function init(cf = { app: null }) {
55
55
  //consola.success("Loaded auto routes");
56
56
 
57
57
  await initCron();
58
- //consola.success("Loaded cron/Tasks");
59
-
60
- //consola.success("Loaded scripts");
61
- //spinner.clear();
62
- spinner.stop();
63
- spinner.clear();
64
- console.log(
65
- "\n---------------------------------------".gray +
66
- "\n✨ Your server is up and running\n".green.bold +
67
- "---------------------------------------\n".gray +
68
- `šŸŒ Environment : ${process.env.NODE_ENV || "development"}\n`.gray +
69
- `šŸ•’ Started at : ${new Date().toLocaleString()}\n`.gray +
70
- "---------------------------------------\n".gray
71
- );
72
58
  }
73
59
 
74
60
  export { init };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.68.1",
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.8.9",
38
+ "hono": "4.6.14",
39
39
  "joi": "17.13.3",
40
40
  "json-joy": "16.8.0",
41
41
  "jsonwebtoken": "^9.0.2",