@adonisjs/assembler 8.0.0-next.16 → 8.0.0-next.17

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.
@@ -297,7 +297,7 @@ var RoutesScanner = class {
297
297
  */
298
298
  #processRouteWithoutController(route) {
299
299
  if (!route.name) {
300
- debug_default(`skipping route "%s" as it does not have a name`, route.name);
300
+ debug_default(`skipping route "%s" as it does not have a name`, route.pattern);
301
301
  return;
302
302
  }
303
303
  const scannedRoute = {
@@ -316,7 +316,7 @@ var RoutesScanner = class {
316
316
  * Scans a route that is using a controller reference
317
317
  */
318
318
  async #processRouteWithController(route, vfs) {
319
- if (!route.handler.importExpression) {
319
+ if (!route.handler || !route.handler.importExpression) {
320
320
  return this.#processRouteWithoutController(route);
321
321
  }
322
322
  const controller = await this.#inspectControllerSpecifier(
package/build/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-YFDLKKOA.js";
5
5
  import {
6
6
  RoutesScanner
7
- } from "./chunk-WG7JQZUU.js";
7
+ } from "./chunk-RSWZKA6F.js";
8
8
  import "./chunk-TIKQQRMX.js";
9
9
  import {
10
10
  VirtualFileSystem,
@@ -931,9 +931,14 @@ var DevServer = class _DevServer {
931
931
  if (!this.#routesScanner) {
932
932
  return;
933
933
  }
934
- const invalidated = await this.#routesScanner.invalidate(filePath);
935
- if (invalidated) {
936
- await this.#hooks.runner("routesScanned").run(this, this.#routesScanner);
934
+ try {
935
+ const invalidated = await this.#routesScanner.invalidate(filePath);
936
+ if (invalidated) {
937
+ await this.#hooks.runner("routesScanned").run(this, this.#routesScanner);
938
+ }
939
+ } catch (error) {
940
+ this.ui.logger.error("Unable to rescan routes because of the following error");
941
+ this.ui.logger.fatal(error);
937
942
  }
938
943
  }
939
944
  /**
@@ -953,27 +958,32 @@ var DevServer = class _DevServer {
953
958
  * })
954
959
  */
955
960
  #processRoutes = throttle(async (routesFileLocation) => {
956
- const scanRoutes = this.#hooks.has("routesScanning") || this.#hooks.has("routesScanned");
957
- const shareRoutes = this.#hooks.has("routesCommitted");
958
- if (!scanRoutes && !shareRoutes) {
961
+ try {
962
+ const scanRoutes = this.#hooks.has("routesScanning") || this.#hooks.has("routesScanned");
963
+ const shareRoutes = this.#hooks.has("routesCommitted");
964
+ if (!scanRoutes && !shareRoutes) {
965
+ unlink(routesFileLocation).catch(() => {
966
+ });
967
+ return;
968
+ }
969
+ const routesJSON = await readFile(routesFileLocation, "utf-8");
970
+ const routesList = JSON.parse(routesJSON);
959
971
  unlink(routesFileLocation).catch(() => {
960
972
  });
961
- return;
962
- }
963
- const routesJSON = await readFile(routesFileLocation, "utf-8");
964
- const routesList = JSON.parse(routesJSON);
965
- unlink(routesFileLocation).catch(() => {
966
- });
967
- if (shareRoutes) {
968
- await this.#hooks.runner("routesCommitted").run(this, routesList);
969
- }
970
- if (scanRoutes) {
971
- this.#routesScanner = new RoutesScanner(this.cwdPath, []);
972
- await this.#hooks.runner("routesScanning").run(this, this.#routesScanner);
973
- for (const domain of Object.keys(routesList)) {
974
- await this.#routesScanner.scan(routesList[domain]);
973
+ if (shareRoutes) {
974
+ await this.#hooks.runner("routesCommitted").run(this, routesList);
975
975
  }
976
- await this.#hooks.runner("routesScanned").run(this, this.#routesScanner);
976
+ if (scanRoutes) {
977
+ this.#routesScanner = new RoutesScanner(this.cwdPath, []);
978
+ await this.#hooks.runner("routesScanning").run(this, this.#routesScanner);
979
+ for (const domain of Object.keys(routesList)) {
980
+ await this.#routesScanner.scan(routesList[domain]);
981
+ }
982
+ await this.#hooks.runner("routesScanned").run(this, this.#routesScanner);
983
+ }
984
+ } catch (error) {
985
+ this.ui.logger.error("Unable to process and scan routes because of the following error");
986
+ this.ui.logger.fatal(error);
977
987
  }
978
988
  }, "processRoutes");
979
989
  /**
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RoutesScanner
3
- } from "../../../chunk-WG7JQZUU.js";
3
+ } from "../../../chunk-RSWZKA6F.js";
4
4
  import "../../../chunk-TIKQQRMX.js";
5
5
  import "../../../chunk-HRE5L24F.js";
6
6
  export {
@@ -174,7 +174,7 @@ export type RoutesListItem = {
174
174
  domain: string;
175
175
  /** HTTP methods accepted by this route */
176
176
  methods: string[];
177
- handler: Function | {
177
+ handler?: {
178
178
  method: string;
179
179
  importExpression: string | null;
180
180
  };
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": "8.0.0-next.16",
4
+ "version": "8.0.0-next.17",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },