@dnax/core 0.68.1 → 0.68.4

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
+ let 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,34 @@ 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();
84
+ console.log("\n");
91
85
  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
- })
86
+ "\n---------------------------------------".gray +
87
+ "\n✨ Your server is up and running\n".green.bold +
88
+ "---------------------------------------\n".gray +
89
+ `🟢 Version : ${pkg.version}`.gray.bold +
90
+ `\n` +
91
+ `šŸŒ Environment : ${
92
+ process.env.NODE_ENV || envName || "development"
93
+ }\n`.gray +
94
+ `šŸ•’ Started at : ${new Date().toLocaleString()}\n`.gray +
95
+ `\n` +
96
+ `šŸ”— Url : http://localhost:${PORT}\n\n`.gray +
97
+ `Tenants :`.gray.underline.bold +
98
+ `\n` +
99
+ Cfg.tenants?.map((t: any) => {
100
+ return `\n${t?.name?.blue || "_"} : ${t?.id?.green}`.bold;
101
+ }) +
102
+ `\n` +
103
+ "---------------------------------------\n".gray
103
104
  );
104
105
 
106
+ if (clb) clb();
107
+
105
108
  //AfterStart
106
109
  if (config?.afterStart) {
107
110
  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.4",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {},