@nitronjs/framework 0.2.4 → 0.2.5

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/cli/njs.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const COLORS = {
4
4
  reset: "\x1b[0m",
@@ -54,7 +54,6 @@ export default async function migrateFresh(options = {}) {
54
54
 
55
55
  }
56
56
  catch (error) {
57
- Output.newline();
58
57
  Output.error(`Fresh migration error: ${error.message}`);
59
58
  await DB.close();
60
59
  return false;
@@ -90,7 +90,6 @@ const dropTablesSuccess = (count) => {
90
90
  log(` ${LINE}`);
91
91
  log(` ${C.green}${I.success}${C.reset} ${C.dim}Dropped ${count} table(s)${C.reset}`);
92
92
  log();
93
- log();
94
93
  };
95
94
 
96
95
  // Rollback
package/lib/HMR/Server.js CHANGED
@@ -52,11 +52,12 @@ class HMRServer {
52
52
 
53
53
  this.#io = new SocketServer(httpServer, {
54
54
  path: "/__nitron_hmr",
55
- transports: ["websocket", "polling"],
55
+ transports: ["websocket"],
56
56
  cors: { origin: "*" },
57
57
  pingTimeout: 60000,
58
58
  pingInterval: 25000,
59
- serveClient: false
59
+ serveClient: false,
60
+ allowEIO3: true
60
61
  });
61
62
 
62
63
  this.#io.on("connection", (socket) => {
@@ -21,8 +21,11 @@
21
21
  try {
22
22
  socket = io({
23
23
  path: "/__nitron_hmr",
24
- transports: ["websocket", "polling"],
25
- reconnection: true
24
+ transports: ["websocket"],
25
+ reconnection: true,
26
+ reconnectionAttempts: 5,
27
+ reconnectionDelay: 1000,
28
+ timeout: 5000
26
29
  });
27
30
  }
28
31
  catch (e) {
@@ -38,6 +41,10 @@
38
41
  window.__nitron_hmr_connected__ = false;
39
42
  });
40
43
 
44
+ socket.on("connect_error", function() {
45
+ window.__nitron_hmr_connected__ = false;
46
+ });
47
+
41
48
  socket.on("hmr:update", function() {
42
49
  refetchPage();
43
50
  });
@@ -198,5 +205,5 @@
198
205
  else {
199
206
  connect();
200
207
  }
201
-
208
+
202
209
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitronjs/framework",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "NitronJS is a modern and extensible Node.js MVC framework built on Fastify. It focuses on clean architecture, modular structure, and developer productivity, offering built-in routing, middleware, configuration management, CLI tooling, and native React integration for scalable full-stack applications.",
5
5
  "bin": {
6
6
  "njs": "./cli/njs.js"