@adonisjs/assembler 6.1.3-24 → 6.1.3-25

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.
Files changed (2) hide show
  1. package/build/index.js +8 -1
  2. package/package.json +3 -1
package/build/index.js CHANGED
@@ -410,6 +410,7 @@ var AssetsDevServer = class {
410
410
  };
411
411
 
412
412
  // src/dev_server.ts
413
+ import prettyHrtime from "pretty-hrtime";
413
414
  var ui3 = cliui3();
414
415
  var DevServer = class {
415
416
  #cwd;
@@ -458,6 +459,7 @@ var DevServer = class {
458
459
  * Starts the HTTP server
459
460
  */
460
461
  #startHTTPServer(port, mode) {
462
+ let initialTime = process.hrtime();
461
463
  this.#httpServer = runNode(this.#cwd, {
462
464
  script: this.#scriptFile,
463
465
  env: { PORT: port, ...this.#options.env },
@@ -466,11 +468,12 @@ var DevServer = class {
466
468
  });
467
469
  this.#httpServer.on("message", (message) => {
468
470
  if (this.#isAdonisJSReadyMessage(message)) {
471
+ const readyAt = process.hrtime(initialTime);
469
472
  ui3.sticker().useColors(this.#colors).useRenderer(this.#logger.getRenderer()).add(`Server address: ${this.#colors.cyan(`http://${message.host}:${message.port}`)}`).add(
470
473
  `File system watcher: ${this.#colors.cyan(
471
474
  `${this.#isWatching ? "enabled" : "disabled"}`
472
475
  )}`
473
- ).render();
476
+ ).add(`Ready in: ${this.#colors.cyan(prettyHrtime(readyAt))}`).render();
474
477
  }
475
478
  });
476
479
  this.#httpServer.then((result) => {
@@ -478,12 +481,16 @@ var DevServer = class {
478
481
  this.#onClose?.(result.exitCode);
479
482
  this.#watcher?.close();
480
483
  this.#assetsServer?.stop();
484
+ } else {
485
+ this.#logger.info("Underlying HTTP server closed. Still watching for changes");
481
486
  }
482
487
  }).catch((error) => {
483
488
  if (mode === "nonblocking") {
484
489
  this.#onError?.(error);
485
490
  this.#watcher?.close();
486
491
  this.#assetsServer?.stop();
492
+ } else {
493
+ this.#logger.info("Underlying HTTP server died. Still watching for changes");
487
494
  }
488
495
  });
489
496
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/assembler",
3
3
  "description": "Provides utilities to run AdonisJS development server and build project for production",
4
- "version": "6.1.3-24",
4
+ "version": "6.1.3-25",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },
@@ -44,6 +44,7 @@
44
44
  "@swc/core": "1.3.82",
45
45
  "@types/node": "^20.4.5",
46
46
  "@types/picomatch": "^2.3.0",
47
+ "@types/pretty-hrtime": "^1.0.1",
47
48
  "c8": "^8.0.1",
48
49
  "cross-env": "^7.0.3",
49
50
  "dedent": "^1.5.1",
@@ -68,6 +69,7 @@
68
69
  "get-port": "^7.0.0",
69
70
  "junk": "^4.0.1",
70
71
  "picomatch": "^2.3.1",
72
+ "pretty-hrtime": "^1.0.3",
71
73
  "slash": "^5.1.0",
72
74
  "ts-morph": "^20.0.0"
73
75
  },