@adonisjs/core 7.4.0 → 7.5.1

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 (55) hide show
  1. package/build/{ace-DZFqbA8w.js → ace-B6apQo2x.js} +2 -2
  2. package/build/commands/add.js +2 -2
  3. package/build/commands/build.js +2 -2
  4. package/build/commands/codegen.d.ts +35 -0
  5. package/build/commands/codegen.js +111 -0
  6. package/build/commands/configure.js +1 -1
  7. package/build/commands/eject.js +1 -1
  8. package/build/commands/env/add.js +1 -1
  9. package/build/commands/generate_key.js +1 -1
  10. package/build/commands/list/routes.js +1 -1
  11. package/build/commands/make/command.js +1 -1
  12. package/build/commands/make/controller.js +1 -1
  13. package/build/commands/make/event.js +1 -1
  14. package/build/commands/make/exception.js +1 -1
  15. package/build/commands/make/listener.js +1 -1
  16. package/build/commands/make/middleware.js +1 -1
  17. package/build/commands/make/preload.js +1 -1
  18. package/build/commands/make/provider.js +1 -1
  19. package/build/commands/make/service.js +1 -1
  20. package/build/commands/make/test.js +1 -1
  21. package/build/commands/make/transformer.js +1 -1
  22. package/build/commands/make/validator.js +1 -1
  23. package/build/commands/make/view.js +1 -1
  24. package/build/commands/serve.js +2 -2
  25. package/build/commands/test.js +2 -2
  26. package/build/{config-BB5flRG9.js → config-8KhKvjYy.js} +2 -1
  27. package/build/core-CPmWMNBG.js +23 -0
  28. package/build/{decorate-BKn10QQi.js → decorate-COk3IovQ.js} +1 -1
  29. package/build/factories/core/ace.js +1 -1
  30. package/build/factories/core/ignitor.js +1 -1
  31. package/build/factories/core/main.js +3 -3
  32. package/build/factories/core/test_utils.js +1 -1
  33. package/build/factories/stubs.js +1 -1
  34. package/build/{ignitor-CSR3YT32.js → ignitor-B4zotvea.js} +1 -1
  35. package/build/index.d.ts +1 -6
  36. package/build/index.js +3 -2
  37. package/build/{core-D_q7qxZy.js → index_entities-C517sTpx.js} +2 -40
  38. package/build/{main-B2M1tZ4I.js → main-B2rXbPKm.js} +18 -1
  39. package/build/modules/ace/codemods.d.ts +1 -1
  40. package/build/modules/ace/codemods.js +1 -1
  41. package/build/modules/config.d.ts +6 -3
  42. package/build/modules/config.js +3 -2
  43. package/build/providers/app_provider.js +10 -19
  44. package/build/src/assembler_hooks/index_entities.d.ts +4 -31
  45. package/build/src/assembler_hooks/index_entities.js +2 -0
  46. package/build/src/ignitor/main.d.ts +5 -0
  47. package/build/src/ignitor/main.js +2 -0
  48. package/build/src/utils.d.ts +22 -0
  49. package/build/{test_utils-C6nT3iIR.js → test_utils-DeLxr1gf.js} +3 -3
  50. package/build/toolkit/main.js +1 -1
  51. package/build/{utils-Dm42v0Nc.js → utils-CeWrQT0f.js} +41 -1
  52. package/package.json +8 -4
  53. package/build/commands/commands.json +0 -1
  54. package/build/commands/main.d.ts +0 -4
  55. package/build/commands/main.js +0 -36
@@ -1,5 +1,5 @@
1
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
2
- import { t as IgnitorFactory } from "./ignitor-CSR3YT32.js";
1
+ import { t as Ignitor } from "./main-B2rXbPKm.js";
2
+ import { t as IgnitorFactory } from "./ignitor-B4zotvea.js";
3
3
  import { t as createAceKernel } from "./create_kernel-Bx7xtr5F.js";
4
4
  //#region factories/core/ace.ts
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { n as prettyPrintError } from "../core-D_q7qxZy.js";
1
+ import { n as prettyPrintError } from "../main-B2rXbPKm.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
- import { t as __decorate } from "../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  //#region commands/add.ts
5
5
  /**
6
6
  * The install command is used to `npm install` and `node ace configure` one or more packages
@@ -1,6 +1,6 @@
1
- import { n as importTypeScript, t as importAssembler } from "../utils-Dm42v0Nc.js";
1
+ import { n as importAssembler, r as importTypeScript } from "../utils-CeWrQT0f.js";
2
2
  import { p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
- import { t as __decorate } from "../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  //#region commands/build.ts
5
5
  /**
6
6
  * Create the production build by compiling TypeScript source and the
@@ -0,0 +1,35 @@
1
+ import { BaseCommand } from '../modules/ace/main.ts';
2
+ /**
3
+ * Regenerate the contents of the ".adonisjs" directory without starting the
4
+ * HTTP server.
5
+ *
6
+ * These files are otherwise generated as a side-effect of running the
7
+ * dev-server, the test runner or creating a build. This command performs the
8
+ * same work on its own, so the generated types can be refreshed
9
+ * deterministically. For example, inside a CI pipeline before typechecking or
10
+ * deploying the application.
11
+ *
12
+ * @example
13
+ * ```
14
+ * ace codegen
15
+ * ```
16
+ */
17
+ export default class Codegen extends BaseCommand {
18
+ #private;
19
+ /**
20
+ * The command name
21
+ */
22
+ static commandName: string;
23
+ /**
24
+ * The command description
25
+ */
26
+ static description: string;
27
+ /**
28
+ * Help text for the command
29
+ */
30
+ static help: string[];
31
+ /**
32
+ * Generate the codegen files
33
+ */
34
+ run(): Promise<void>;
35
+ }
@@ -0,0 +1,111 @@
1
+ import { n as importAssembler, t as emitRouteTypes } from "../utils-CeWrQT0f.js";
2
+ import { p as BaseCommand } from "../main-DvUje0hm.js";
3
+ //#region commands/codegen.ts
4
+ /**
5
+ * Regenerate the contents of the ".adonisjs" directory without starting the
6
+ * HTTP server.
7
+ *
8
+ * These files are otherwise generated as a side-effect of running the
9
+ * dev-server, the test runner or creating a build. This command performs the
10
+ * same work on its own, so the generated types can be refreshed
11
+ * deterministically. For example, inside a CI pipeline before typechecking or
12
+ * deploying the application.
13
+ *
14
+ * @example
15
+ * ```
16
+ * ace codegen
17
+ * ```
18
+ */
19
+ var Codegen = class extends BaseCommand {
20
+ /**
21
+ * The command name
22
+ */
23
+ static commandName = "codegen";
24
+ /**
25
+ * The command description
26
+ */
27
+ static description = "Generate TypeScript type definitions and index files for the application";
28
+ /**
29
+ * Help text for the command
30
+ */
31
+ static help = [
32
+ "Regenerate the codegen files without starting the HTTP server.",
33
+ "```",
34
+ "{{ binaryName }} codegen",
35
+ "```",
36
+ "",
37
+ "Use it inside a CI pipeline to keep the generated types up-to-date before",
38
+ "typechecking or building the application, without committing them to git.",
39
+ "```",
40
+ "npm ci && {{ binaryName }} codegen && npm run typecheck",
41
+ "```"
42
+ ];
43
+ /**
44
+ * Log a development dependency is missing
45
+ *
46
+ * @param dependency - The name of the missing dependency
47
+ */
48
+ #logMissingDevelopmentDependency(dependency) {
49
+ this.logger.error([
50
+ `Cannot find package "${dependency}"`,
51
+ "",
52
+ `The "${dependency}" package is a development dependency and therefore you should use the codegen command with development dependencies installed.`,
53
+ "",
54
+ "If you are using the codegen command inside a CI or with a deployment platform, make sure it runs after installing the development dependencies."
55
+ ].join("\n"));
56
+ }
57
+ /**
58
+ * Warm up the application and return the state the codegen needs from it.
59
+ *
60
+ * The app is assembled the way the web environment assembles it, since the
61
+ * generated files describe the app that serves requests. However, it is
62
+ * created in the "warmup" mode, so it never becomes ready and none of the
63
+ * long running side-effects registered by the providers kick in.
64
+ */
65
+ async #warmUpApp() {
66
+ this.app.setEnvironment("web");
67
+ this.app.setMode("warmup");
68
+ await this.app.boot();
69
+ await this.app.warmUp();
70
+ /**
71
+ * Commit the router, so the routes can be turned into their types and
72
+ * handed over to the assembler
73
+ */
74
+ const router = await this.app.container.make("router");
75
+ router.commit();
76
+ await emitRouteTypes(this.app, router);
77
+ /**
78
+ * The routes are round tripped through JSON, because that is how the
79
+ * dev-server hands them over to the assembler. The round trip drops the
80
+ * handler of the routes registered using a closure and strips the
81
+ * properties that cannot be serialized, so the assembler is given the exact
82
+ * same shape by both the paths
83
+ */
84
+ return { routes: JSON.parse(JSON.stringify(router.toJSON())) };
85
+ }
86
+ /**
87
+ * Generate the codegen files
88
+ */
89
+ async run() {
90
+ const assembler = await importAssembler(this.app);
91
+ if (!assembler) {
92
+ this.#logMissingDevelopmentDependency("@adonisjs/assembler");
93
+ this.exitCode = 1;
94
+ return;
95
+ }
96
+ const codegen = new assembler.CodeGen(this.app.appRoot, { hooks: this.app.rcFile.hooks });
97
+ /**
98
+ * Share command logger with assembler, so that CLI flags like --no-ansi has
99
+ * similar impact for assembler logs as well.
100
+ */
101
+ codegen.ui.logger = this.logger;
102
+ /**
103
+ * The app is booted from within the callback, because its preload files
104
+ * import the index files the codegen writes before invoking it
105
+ */
106
+ await codegen.run(() => this.#warmUpApp());
107
+ this.logger.success("Codegen files generated");
108
+ }
109
+ };
110
+ //#endregion
111
+ export { Codegen as default };
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
- import { t as __decorate } from "../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  import { RuntimeException } from "@poppinss/utils/exception";
5
5
  //#region commands/configure.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { t as stringHelpers } from "../string-DUpLZV_t.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
- import { t as __decorate } from "../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  //#region commands/eject.ts
5
5
  /**
6
6
  * Command to eject scaffolding stubs from packages to your application root.
@@ -1,6 +1,6 @@
1
1
  import { t as stringHelpers } from "../../string-DUpLZV_t.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/env/add.ts
5
5
  const ALLOWED_TYPES = [
6
6
  "string",
@@ -1,5 +1,5 @@
1
1
  import { p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
2
- import { t as __decorate } from "../decorate-BKn10QQi.js";
2
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
3
3
  import string from "@poppinss/utils/string";
4
4
  import { EnvEditor } from "@adonisjs/env/editor";
5
5
  //#region commands/generate_key.ts
@@ -1,5 +1,5 @@
1
1
  import { o as args, p as BaseCommand, s as cliHelpers, u as flags } from "../../main-DvUje0hm.js";
2
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
2
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
3
3
  import stringWidth from "string-width";
4
4
  import { middlewareInfo, routeInfo } from "@adonisjs/http-server/helpers";
5
5
  //#region src/cli_formatters/routes_list.ts
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/command.ts
5
5
  /**
6
6
  * Command to create a new Ace command class.
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  import string from "@poppinss/utils/string";
5
5
  //#region commands/make/controller.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/event.ts
5
5
  /**
6
6
  * Command to create a new event class.
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/exception.ts
5
5
  /**
6
6
  * Command to create a new custom exception class.
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/listener.ts
5
5
  /**
6
6
  * Command to create a new event listener class.
@@ -1,7 +1,7 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { t as stringHelpers } from "../../string-DUpLZV_t.js";
3
3
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
4
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
4
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
5
5
  import string from "@poppinss/utils/string";
6
6
  import { basename, extname, relative } from "node:path";
7
7
  //#region commands/make/middleware.ts
@@ -1,7 +1,7 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { t as stringHelpers } from "../../string-DUpLZV_t.js";
3
3
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
4
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
4
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
5
5
  import { extname, relative } from "node:path";
6
6
  //#region commands/make/preload.ts
7
7
  const ALLOWED_ENVIRONMENTS = [
@@ -1,7 +1,7 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { t as stringHelpers } from "../../string-DUpLZV_t.js";
3
3
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
4
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
4
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
5
5
  import { extname, relative } from "node:path";
6
6
  //#region commands/make/provider.ts
7
7
  const ALLOWED_ENVIRONMENTS = [
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/service.ts
5
5
  /**
6
6
  * Make a new service class
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/test.ts
5
5
  /**
6
6
  * Command to create a new Japa test file.
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/transformer.ts
5
5
  /**
6
6
  * Command to create a new transformer class.
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/validator.ts
5
5
  /**
6
6
  * Command to create a new VineJS validator file.
@@ -1,6 +1,6 @@
1
1
  import { t as stubsRoot } from "../../main-DbL06a4f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../../main-DvUje0hm.js";
3
- import { t as __decorate } from "../../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../../decorate-COk3IovQ.js";
4
4
  //#region commands/make/view.ts
5
5
  /**
6
6
  * Command to create a new Edge.js template file.
@@ -1,6 +1,6 @@
1
- import { t as importAssembler } from "../utils-Dm42v0Nc.js";
1
+ import { n as importAssembler } from "../utils-CeWrQT0f.js";
2
2
  import { p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
- import { t as __decorate } from "../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  //#region commands/serve.ts
5
5
  /**
6
6
  * Serve command is used to run the AdonisJS HTTP server during development. The
@@ -1,6 +1,6 @@
1
- import { t as importAssembler } from "../utils-Dm42v0Nc.js";
1
+ import { n as importAssembler } from "../utils-CeWrQT0f.js";
2
2
  import { o as args, p as BaseCommand, u as flags } from "../main-DvUje0hm.js";
3
- import { t as __decorate } from "../decorate-BKn10QQi.js";
3
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
4
4
  //#region commands/test.ts
5
5
  /**
6
6
  * Command to run application tests using the Japa test runner.
@@ -1,6 +1,7 @@
1
1
  import { n as __reExport, t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
+ import { t as configProvider } from "./config_provider-t1UIlTp8.js";
2
3
  //#region modules/config.ts
3
- var config_exports = /* @__PURE__ */ __exportAll({});
4
+ var config_exports = /* @__PURE__ */ __exportAll({ configProvider: () => configProvider });
4
5
  import * as import__adonisjs_config from "@adonisjs/config";
5
6
  __reExport(config_exports, import__adonisjs_config);
6
7
  //#endregion
@@ -0,0 +1,23 @@
1
+ import "./main-DbL06a4f.js";
2
+ import "./container-DLqyMqk-.js";
3
+ import "./main-B2rXbPKm.js";
4
+ import "./config_provider-t1UIlTp8.js";
5
+ import "./index_entities-C517sTpx.js";
6
+ import { errors } from "@adonisjs/ace";
7
+ import { errors as errors$1 } from "@adonisjs/env";
8
+ import { errors as errors$2 } from "@adonisjs/application";
9
+ import { errors as errors$3 } from "@boringnode/encryption";
10
+ import { errors as errors$4 } from "@adonisjs/http-server";
11
+ //#region index.ts
12
+ /**
13
+ * Aggregated errors from all modules.
14
+ */
15
+ const errors$5 = {
16
+ ...errors$3,
17
+ ...errors$4,
18
+ ...errors$2,
19
+ ...errors,
20
+ ...errors$1
21
+ };
22
+ //#endregion
23
+ export { errors$5 as t };
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.143.0/helpers/esm/decorate.js
1
+ //#region \0@oxc-project+runtime@0.146.0/helpers/esm/decorate.js
2
2
  function __decorate(decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,2 +1,2 @@
1
- import { t as AceFactory } from "../../ace-DZFqbA8w.js";
1
+ import { t as AceFactory } from "../../ace-B6apQo2x.js";
2
2
  export { AceFactory };
@@ -1,2 +1,2 @@
1
- import { t as IgnitorFactory } from "../../ignitor-CSR3YT32.js";
1
+ import { t as IgnitorFactory } from "../../ignitor-B4zotvea.js";
2
2
  export { IgnitorFactory };
@@ -1,4 +1,4 @@
1
- import { t as IgnitorFactory } from "../../ignitor-CSR3YT32.js";
2
- import { t as AceFactory } from "../../ace-DZFqbA8w.js";
3
- import { t as TestUtilsFactory } from "../../test_utils-C6nT3iIR.js";
1
+ import { t as IgnitorFactory } from "../../ignitor-B4zotvea.js";
2
+ import { t as AceFactory } from "../../ace-B6apQo2x.js";
3
+ import { t as TestUtilsFactory } from "../../test_utils-DeLxr1gf.js";
4
4
  export { AceFactory, IgnitorFactory, TestUtilsFactory };
@@ -1,2 +1,2 @@
1
- import { t as TestUtilsFactory } from "../../test_utils-C6nT3iIR.js";
1
+ import { t as TestUtilsFactory } from "../../test_utils-DeLxr1gf.js";
2
2
  export { TestUtilsFactory };
@@ -1,5 +1,5 @@
1
1
  import { t as stubsRoot } from "../main-DbL06a4f.js";
2
- import "../core-D_q7qxZy.js";
2
+ import "../core-CPmWMNBG.js";
3
3
  import { AppFactory } from "@adonisjs/application/factories";
4
4
  //#region factories/stubs.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
1
+ import { t as Ignitor } from "./main-B2rXbPKm.js";
2
2
  import { t as logger_exports } from "./logger-DaDoVXHv.js";
3
3
  import { t as main_exports } from "./main-BOydGWpm.js";
4
4
  import { n as drivers, t as defineConfig } from "./define_config-DzONx0uA.js";
package/build/index.d.ts CHANGED
@@ -5,15 +5,10 @@ import { errors as encryptionErrors } from '@boringnode/encryption';
5
5
  import { errors as httpServerErrors } from '@adonisjs/http-server';
6
6
  export { stubsRoot } from './stubs/main.ts';
7
7
  export { inject } from './modules/container.ts';
8
- export { Ignitor } from './src/ignitor/main.ts';
8
+ export { Ignitor, prettyPrintError } from './src/ignitor/main.ts';
9
9
  export { configProvider } from './src/config_provider.ts';
10
10
  export { indexEntities } from './src/assembler_hooks/index_entities.ts';
11
11
  /**
12
12
  * Aggregated errors from all modules.
13
13
  */
14
14
  export declare const errors: typeof encryptionErrors & typeof httpServerErrors & typeof appErrors & typeof aceErrors & typeof envErrors;
15
- /**
16
- * Pretty prints an error with colorful output using
17
- * Youch terminal
18
- */
19
- export declare function prettyPrintError(error: any): Promise<void>;
package/build/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { t as stubsRoot } from "./main-DbL06a4f.js";
2
2
  import { t as container_exports } from "./container-DLqyMqk-.js";
3
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
3
+ import { n as prettyPrintError, t as Ignitor } from "./main-B2rXbPKm.js";
4
4
  import { t as configProvider } from "./config_provider-t1UIlTp8.js";
5
- import { n as prettyPrintError, r as indexEntities, t as errors } from "./core-D_q7qxZy.js";
5
+ import { t as indexEntities } from "./index_entities-C517sTpx.js";
6
+ import { t as errors } from "./core-CPmWMNBG.js";
6
7
  var inject = container_exports.inject;
7
8
  export { Ignitor, configProvider, errors, indexEntities, inject, prettyPrintError, stubsRoot };
@@ -1,14 +1,5 @@
1
- import "./main-DbL06a4f.js";
2
- import "./container-DLqyMqk-.js";
3
- import "./main-B2M1tZ4I.js";
4
- import "./config_provider-t1UIlTp8.js";
5
1
  import { t as stringHelpers } from "./string-DUpLZV_t.js";
6
- import { r as outputTransformerDataObjects } from "./utils-Dm42v0Nc.js";
7
- import { errors } from "@adonisjs/ace";
8
- import { errors as errors$1 } from "@adonisjs/env";
9
- import { errors as errors$2 } from "@adonisjs/application";
10
- import { errors as errors$3 } from "@boringnode/encryption";
11
- import { errors as errors$4 } from "@adonisjs/http-server";
2
+ import { i as outputTransformerDataObjects } from "./utils-CeWrQT0f.js";
12
3
  //#region src/assembler_hooks/index_entities.ts
13
4
  /**
14
5
  * Configures the IndexGenerator to create barrel files for "controllers", "events",
@@ -168,33 +159,4 @@ function indexEntities(entities = {}) {
168
159
  } };
169
160
  }
170
161
  //#endregion
171
- //#region index.ts
172
- /**
173
- * Aggregated errors from all modules.
174
- */
175
- const errors$5 = {
176
- ...errors$3,
177
- ...errors$4,
178
- ...errors$2,
179
- ...errors,
180
- ...errors$1
181
- };
182
- /**
183
- * Pretty prints an error with colorful output using
184
- * Youch terminal
185
- */
186
- async function prettyPrintError(error) {
187
- if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
188
- console.error(error);
189
- return;
190
- }
191
- try {
192
- const { Youch } = await import("youch");
193
- const youch = new Youch();
194
- console.error(await youch.toANSI(error));
195
- } catch {
196
- console.error(error);
197
- }
198
- }
199
- //#endregion
200
- export { prettyPrintError as n, indexEntities as r, errors$5 as t };
162
+ export { indexEntities as t };
@@ -431,5 +431,22 @@ var Ignitor = class {
431
431
  await this.#app?.terminate();
432
432
  }
433
433
  };
434
+ /**
435
+ * Pretty prints an error with colorful output using
436
+ * Youch terminal
437
+ */
438
+ async function prettyPrintError(error) {
439
+ if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
440
+ console.error(error);
441
+ return;
442
+ }
443
+ try {
444
+ const { Youch } = await import("youch");
445
+ const youch = new Youch();
446
+ console.error(await youch.toANSI(error));
447
+ } catch {
448
+ console.error(error);
449
+ }
450
+ }
434
451
  //#endregion
435
- export { Ignitor as t };
452
+ export { prettyPrintError as n, Ignitor as t };
@@ -291,7 +291,7 @@ export declare class Codemods extends EventEmitter {
291
291
  installPackages(packages: {
292
292
  name: string;
293
293
  isDevDependency: boolean;
294
- }[], packageManager?: SupportedPackageManager | 'pnpm@6' | 'deno' | 'nub' | 'aube'): Promise<boolean>;
294
+ }[], packageManager?: SupportedPackageManager | 'pnpm@6' | 'pnpm-rush' | 'deno'): Promise<boolean>;
295
295
  /**
296
296
  * List the packages that should be installed manually.
297
297
  * This method displays installation commands for different package managers
@@ -1,8 +1,8 @@
1
1
  import { t as debug_default } from "../../debug-DrrWgeSu.js";
2
2
  import { t as stringHelpers } from "../../string-DUpLZV_t.js";
3
- import { EnvEditor } from "@adonisjs/env/editor";
4
3
  import { isAbsolute } from "node:path";
5
4
  import { readFile } from "node:fs/promises";
5
+ import { EnvEditor } from "@adonisjs/env/editor";
6
6
  import { EventEmitter } from "node:events";
7
7
  //#region modules/ace/codemods.ts
8
8
  /**
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Configuration module re-exports all functionality from @adonisjs/config.
3
- * This includes the Config class and related types for managing application
4
- * configuration files and environment-specific settings.
2
+ * Configuration module re-exports @adonisjs/config and the config provider
3
+ * helper used to defer configuration resolution until application boot.
5
4
  *
6
5
  * @example
7
6
  * // Import the Config class
@@ -14,5 +13,9 @@
14
13
  * @example
15
14
  * // Import configuration types
16
15
  * import type { ConfigProvider } from '@adonisjs/core/config'
16
+ *
17
+ * // Create a lazy configuration provider
18
+ * import { configProvider } from '@adonisjs/core/config'
17
19
  */
18
20
  export * from '@adonisjs/config';
21
+ export { configProvider } from '../src/config_provider.ts';
@@ -1,3 +1,4 @@
1
- import "../config-BB5flRG9.js";
1
+ import { t as configProvider } from "../config_provider-t1UIlTp8.js";
2
+ import "../config-8KhKvjYy.js";
2
3
  export * from "@adonisjs/config";
3
- export {};
4
+ export { configProvider };
@@ -1,6 +1,7 @@
1
1
  import { t as app_exports } from "../app-BOjDPLf-.js";
2
2
  import { t as configProvider } from "../config_provider-t1UIlTp8.js";
3
- import { t as config_exports } from "../config-BB5flRG9.js";
3
+ import { t as emitRouteTypes } from "../utils-CeWrQT0f.js";
4
+ import { t as config_exports } from "../config-8KhKvjYy.js";
4
5
  import { t as events_exports } from "../events-BVzXwbEH.js";
5
6
  import { t as logger_exports } from "../logger-DaDoVXHv.js";
6
7
  import { t as Dumper } from "../dumper-BhtAWrcS.js";
@@ -8,8 +9,7 @@ import { r as RuntimeException } from "../exceptions-I3WraG06.js";
8
9
  import { t as main_exports } from "../main-BOydGWpm.js";
9
10
  import { n as Encryption } from "../main-DsUS7ncp.js";
10
11
  import { t as bodyparser_middleware_default } from "../bodyparser_middleware-DnG3kauC.js";
11
- import { dirname } from "node:path";
12
- import { mkdir, writeFile } from "node:fs/promises";
12
+ import { writeFile } from "node:fs/promises";
13
13
  //#region providers/app_provider.ts
14
14
  /**
15
15
  * The Application Service provider registers all the baseline
@@ -266,23 +266,14 @@ var AppServiceProvider = class {
266
266
  */
267
267
  async emitRoutes(router) {
268
268
  try {
269
- const { routes, imports, types } = router.generateTypes(2);
270
- const routesTypesPath = this.app.generatedServerPath("routes.d.ts");
269
+ await emitRouteTypes(this.app, router);
270
+ /**
271
+ * The JSON file is how the routes are handed over to the assembler
272
+ * dev-server, which reads it and then removes it. The codegen command
273
+ * has no such need, since it passes the routes in memory
274
+ */
271
275
  const routesJsonPath = this.app.generatedServerPath("routes.json");
272
- await mkdir(dirname(routesTypesPath), { recursive: true });
273
- await Promise.all([writeFile(routesTypesPath, [
274
- `import '@adonisjs/core/types/http'`,
275
- ...imports,
276
- "",
277
- ...types,
278
- "",
279
- "export type ScannedRoutes = {",
280
- routes,
281
- "}",
282
- `declare module '@adonisjs/core/types/http' {`,
283
- " export interface RoutesList extends ScannedRoutes {}",
284
- "}"
285
- ].join("\n")), writeFile(routesJsonPath, JSON.stringify(router.toJSON()))]);
276
+ await writeFile(routesJsonPath, JSON.stringify(router.toJSON()));
286
277
  this.app.notify({
287
278
  isAdonisJS: true,
288
279
  routesFileLocation: routesJsonPath
@@ -1,3 +1,4 @@
1
+ import { type CommonHooks } from '@adonisjs/assembler/types';
1
2
  import { type IndexEntitiesConfig } from '../types.ts';
2
3
  /**
3
4
  * Configures the IndexGenerator to create barrel files for "controllers", "events",
@@ -37,34 +38,6 @@ import { type IndexEntitiesConfig } from '../types.ts';
37
38
  * }
38
39
  * })
39
40
  */
40
- export declare function indexEntities(entities?: IndexEntitiesConfig): {
41
- run(_: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, __: import("@poppinss/hooks").default<{
42
- init: [[parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, hooks: import("@poppinss/hooks").default</*elided*/ any>, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator], [parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, hooks: import("@poppinss/hooks").default</*elided*/ any>, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator]];
43
- fileChanged: [[relativePath: string, absolutePath: string, info: {
44
- source: "hot-hook" | "watcher";
45
- hotReloaded: boolean;
46
- fullReload: boolean;
47
- }, parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner], [relativePath: string, absolutePath: string, info: {
48
- source: "hot-hook" | "watcher";
49
- hotReloaded: boolean;
50
- fullReload: boolean;
51
- }, parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner]];
52
- fileAdded: [[relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner], [relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner]];
53
- fileRemoved: [[relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner], [relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner]];
54
- devServerStarting: [[server: import("@adonisjs/assembler").DevServer], [server: import("@adonisjs/assembler").DevServer]];
55
- devServerStarted: [[server: import("@adonisjs/assembler").DevServer, info: {
56
- port: number;
57
- host: string;
58
- }, uiInstructions: import("@poppinss/cliui").Instructions], [server: import("@adonisjs/assembler").DevServer, info: {
59
- port: number;
60
- host: string;
61
- }, uiInstructions: import("@poppinss/cliui").Instructions]];
62
- buildStarting: [[server: import("@adonisjs/assembler").Bundler], [server: import("@adonisjs/assembler").Bundler]];
63
- buildFinished: [[server: import("@adonisjs/assembler").Bundler, uiInstructions: import("@poppinss/cliui").Instructions], [server: import("@adonisjs/assembler").Bundler, uiInstructions: import("@poppinss/cliui").Instructions]];
64
- testsStarting: [[server: import("@adonisjs/assembler").TestRunner], [server: import("@adonisjs/assembler").TestRunner]];
65
- testsFinished: [[server: import("@adonisjs/assembler").TestRunner], [server: import("@adonisjs/assembler").TestRunner]];
66
- routesCommitted: [[parent: import("@adonisjs/assembler").DevServer, routes: Record<string, import("@adonisjs/assembler/types").RoutesListItem[]>], [parent: import("@adonisjs/assembler").DevServer, routes: Record<string, import("@adonisjs/assembler/types").RoutesListItem[]>]];
67
- routesScanning: [[parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner], [parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner]];
68
- routesScanned: [[parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner], [parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner]];
69
- }>, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator): void;
70
- };
41
+ export declare function indexEntities(entities?: IndexEntitiesConfig): Extract<CommonHooks['init'][number], {
42
+ run: any;
43
+ }>;
@@ -0,0 +1,2 @@
1
+ import { t as indexEntities } from "../../index_entities-C517sTpx.js";
2
+ export { indexEntities };
@@ -65,3 +65,8 @@ export declare class Ignitor {
65
65
  */
66
66
  terminate(): Promise<void>;
67
67
  }
68
+ /**
69
+ * Pretty prints an error with colorful output using
70
+ * Youch terminal
71
+ */
72
+ export declare function prettyPrintError(error: any): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { n as prettyPrintError, t as Ignitor } from "../../main-B2rXbPKm.js";
2
+ export { Ignitor, prettyPrintError };
@@ -1,7 +1,29 @@
1
1
  import type typescript from 'typescript';
2
2
  import type * as Assembler from '@adonisjs/assembler';
3
3
  import { type RecursiveFileTree } from '@adonisjs/assembler/types';
4
+ import { type Router } from '../modules/http/main.ts';
4
5
  import { type ApplicationService } from './types.ts';
6
+ /**
7
+ * Writes the TypeScript type definitions for the registered routes.
8
+ *
9
+ * The generated file is consumed by the TypeScript compiler to type-check the
10
+ * route names and their params. It is emitted by the app provider when the app
11
+ * boots in development and by the codegen command, hence it lives here to keep
12
+ * both of them in sync.
13
+ *
14
+ * The routes must be committed before calling this method, otherwise the
15
+ * generated file will be missing them.
16
+ *
17
+ * @param app - The application service instance
18
+ * @param router - The router instance holding the committed routes
19
+ *
20
+ * @example
21
+ * const router = await app.container.make('router')
22
+ * router.commit()
23
+ * await emitRouteTypes(app, router)
24
+ * // Writes .adonisjs/server/routes.d.ts
25
+ */
26
+ export declare function emitRouteTypes(app: ApplicationService, router: Router): Promise<void>;
5
27
  /**
6
28
  * Imports the AdonisJS assembler package optionally. This function attempts
7
29
  * to import the assembler and returns undefined if it's not available,
@@ -1,6 +1,6 @@
1
- import { t as Ignitor } from "./main-B2M1tZ4I.js";
2
- import "./core-D_q7qxZy.js";
3
- import { t as IgnitorFactory } from "./ignitor-CSR3YT32.js";
1
+ import { t as Ignitor } from "./main-B2rXbPKm.js";
2
+ import "./core-CPmWMNBG.js";
3
+ import { t as IgnitorFactory } from "./ignitor-B4zotvea.js";
4
4
  import { t as TestUtils } from "./main-j-xf1jGN.js";
5
5
  //#region factories/core/test_utils.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as __decorate } from "../decorate-BKn10QQi.js";
2
+ import { t as __decorate } from "../decorate-COk3IovQ.js";
3
3
  import { BaseCommand, HelpCommand, IndexGenerator, Kernel, ListLoader, args } from "@adonisjs/ace";
4
4
  import { join } from "node:path";
5
5
  //#region toolkit/commands/index_commands.ts
@@ -1,5 +1,45 @@
1
+ import { dirname } from "node:path";
2
+ import { mkdir, writeFile } from "node:fs/promises";
1
3
  //#region src/utils.ts
2
4
  /**
5
+ * Writes the TypeScript type definitions for the registered routes.
6
+ *
7
+ * The generated file is consumed by the TypeScript compiler to type-check the
8
+ * route names and their params. It is emitted by the app provider when the app
9
+ * boots in development and by the codegen command, hence it lives here to keep
10
+ * both of them in sync.
11
+ *
12
+ * The routes must be committed before calling this method, otherwise the
13
+ * generated file will be missing them.
14
+ *
15
+ * @param app - The application service instance
16
+ * @param router - The router instance holding the committed routes
17
+ *
18
+ * @example
19
+ * const router = await app.container.make('router')
20
+ * router.commit()
21
+ * await emitRouteTypes(app, router)
22
+ * // Writes .adonisjs/server/routes.d.ts
23
+ */
24
+ async function emitRouteTypes(app, router) {
25
+ const { routes, imports, types } = router.generateTypes(2);
26
+ const routesTypesPath = app.generatedServerPath("routes.d.ts");
27
+ await mkdir(dirname(routesTypesPath), { recursive: true });
28
+ await writeFile(routesTypesPath, [
29
+ `import '@adonisjs/core/types/http'`,
30
+ ...imports,
31
+ "",
32
+ ...types,
33
+ "",
34
+ "export type ScannedRoutes = {",
35
+ routes,
36
+ "}",
37
+ `declare module '@adonisjs/core/types/http' {`,
38
+ " export interface RoutesList extends ScannedRoutes {}",
39
+ "}"
40
+ ].join("\n"));
41
+ }
42
+ /**
3
43
  * Imports the AdonisJS assembler package optionally. This function attempts
4
44
  * to import the assembler and returns undefined if it's not available,
5
45
  * making it safe to use in environments where the assembler might not be installed.
@@ -103,4 +143,4 @@ async function outputTransformerDataObjects(transformersList, buffer, withShared
103
143
  buffer.dedent().write("}");
104
144
  }
105
145
  //#endregion
106
- export { importTypeScript as n, outputTransformerDataObjects as r, importAssembler as t };
146
+ export { outputTransformerDataObjects as i, importAssembler as n, importTypeScript as r, emitRouteTypes as t };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
3
  "description": "Core of AdonisJS",
4
- "version": "7.4.0",
4
+ "version": "7.5.1",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -27,6 +27,8 @@
27
27
  "./providers/*": "./build/providers/*.js",
28
28
  "./helpers": "./build/src/helpers/main.js",
29
29
  "./helpers/*": "./build/src/helpers/*.js",
30
+ "./ignitor": "./build/src/ignitor/main.js",
31
+ "./generators": "./build/src/assembler_hooks/index_entities.js",
30
32
  "./ace": "./build/modules/ace/main.js",
31
33
  "./ace/codemods": "./build/modules/ace/codemods.js",
32
34
  "./bodyparser": "./build/modules/bodyparser/main.js",
@@ -82,7 +84,7 @@
82
84
  "index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
83
85
  },
84
86
  "devDependencies": {
85
- "@adonisjs/assembler": "^8.4.0",
87
+ "@adonisjs/assembler": "^8.5.0",
86
88
  "@adonisjs/encryption": "^6.0.2",
87
89
  "@adonisjs/eslint-config": "^3.1.0",
88
90
  "@adonisjs/prettier-config": "^1.5.0",
@@ -112,7 +114,7 @@
112
114
  "get-port": "^7.2.0",
113
115
  "pino-pretty": "^13.1.3",
114
116
  "prettier": "^3.9.6",
115
- "release-it": "^21.0.1",
117
+ "release-it": "^21.0.2",
116
118
  "sinon": "^22.1.0",
117
119
  "supertest": "^7.2.2",
118
120
  "test-console": "^2.0.0",
@@ -124,7 +126,7 @@
124
126
  },
125
127
  "dependencies": {
126
128
  "@adonisjs/ace": "^14.1.0",
127
- "@adonisjs/application": "^9.0.1",
129
+ "@adonisjs/application": "^9.1.0",
128
130
  "@adonisjs/bodyparser": "^11.0.4",
129
131
  "@adonisjs/config": "^6.1.0",
130
132
  "@adonisjs/env": "^7.0.0",
@@ -235,6 +237,8 @@
235
237
  "providers/**/*.ts",
236
238
  "src/helpers/main.ts",
237
239
  "src/helpers/**/*.ts",
240
+ "src/ignitor/main.ts",
241
+ "src/assembler_hooks/index_entities.ts",
238
242
  "modules/ace/main.ts",
239
243
  "modules/ace/codemods.ts",
240
244
  "modules/bodyparser/main.ts",
@@ -1 +0,0 @@
1
- {"commands":[{"commandName":"add","description":"Install and configure one or more AdonisJS packages. Runs npm install followed by the package configure hook","help":["Use this command instead of manually running npm install + configure separately.","Accepts shorthand names: \"vinejs\" for @vinejs/vine, \"edge\" for edge.js.","```","{{ binaryName }} add @adonisjs/lucid","{{ binaryName }} add @adonisjs/auth @adonisjs/session","```"],"namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager you want to use"},{"name":"dev","flagName":"dev","required":false,"type":"boolean","description":"Should we install the package as a dev dependency","alias":"D"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files"}],"args":[{"name":"names","argumentName":"names","required":true,"description":"Package names to install and configure","type":"spread"}],"options":{"allowUnknownFlags":true},"filePath":"add.js"},{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":["Create the production build using the following command.","```","{{ binaryName }} build","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} build --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Define the package manager to copy the appropriate lock file"},{"name":"tsconfig","flagName":"tsconfig","required":false,"type":"string","description":"Define the tsconfig path"}],"args":[],"options":{},"filePath":"build.js"},{"commandName":"configure","description":"Run the configure hook of an already-installed package. Use \"add\" command instead to both install and configure in one step","help":"","namespace":null,"aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Display logs in verbose mode","alias":"v"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"configure.js"},{"commandName":"eject","description":"Copy scaffolding stubs from a package to your application for customization. Stubs are templates used by make:* commands","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js"},{"commandName":"env:add","description":"Add a new environment variable to .env, .env.example, and its validation rule to start/env.ts","help":"","namespace":"env","aliases":[],"flags":[{"name":"type","flagName":"type","required":false,"type":"string","description":"Type of the variable"},{"name":"enumValues","flagName":"enum-values","required":false,"type":"array","description":"Allowed values for the enum type in a comma-separated list","default":[""]}],"args":[{"name":"name","argumentName":"name","required":false,"description":"Variable name. Will be converted to screaming snake case","type":"string"},{"name":"value","argumentName":"value","required":false,"description":"Variable value","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"env/add.js"},{"commandName":"generate:key","description":"Generate a cryptographically secure APP_KEY and write it to the .env file. Use --show to print without writing","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js"},{"commandName":"inspect:rcfile","description":"Display the resolved adonisrc.ts configuration as JSON, including providers, preloads, commands, and meta files","help":"","namespace":"inspect","aliases":[],"flags":[],"args":[],"options":{},"filePath":"inspect_rcfile.js"},{"commandName":"list:routes","description":"List all registered routes with their HTTP methods, URL patterns, handlers, and middleware","help":"","namespace":"list","aliases":[],"flags":[{"name":"middleware","flagName":"middleware","required":false,"type":"array","description":"View routes that includes all the mentioned middleware names. Use * to see routes that are using one or more middleware"},{"name":"ignoreMiddleware","flagName":"ignore-middleware","required":false,"type":"array","description":"View routes that does not include all the mentioned middleware names. Use * to see routes that are using zero middleware"},{"name":"json","flagName":"json","required":false,"type":"boolean","description":"Get routes list as a JSON string"},{"name":"table","flagName":"table","required":false,"type":"boolean","description":"View list of routes as a table"},{"name":"jsonl","flagName":"jsonl","required":false,"type":"boolean","description":"Get routes as JSONL, one JSON object per line (optimized for AI agents)"}],"args":[{"name":"match","argumentName":"match","required":false,"description":"Find routes matching the given keyword. Route name, pattern and controller name will be searched against the keyword","type":"string"}],"options":{"startApp":true},"filePath":"list/routes.js"},{"commandName":"make:command","description":"Create a new Ace CLI command class in commands/","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{},"filePath":"make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class in app/controllers. Use --resource for CRUD methods or --api for API-only CRUD (no create/edit)","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Generate controller in singular form","alias":"s"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate resourceful controller with methods to perform CRUD actions on a resource","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate resourceful controller without the \"edit\" and the \"create\" methods","alias":"a"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"},{"name":"actions","argumentName":"actions","required":false,"description":"Create controller with custom method names","type":"spread"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js"},{"commandName":"make:event","description":"Create a new event class in app/events. Events are dispatched via emitter and handled by listeners","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js"},{"commandName":"make:exception","description":"Create a new custom exception class in app/exceptions with handle and report methods","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the exception","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/exception.js"},{"commandName":"make:listener","description":"Create a new event listener class in app/listeners. Use --event to also generate the event class and bind them together","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class in app/middleware and register it in start/kernel.ts under the chosen stack (server, router, or named)","help":"","namespace":"make","aliases":[],"flags":[{"name":"stack","flagName":"stack","required":false,"type":"string","description":"The stack in which to register the middleware","alias":"s"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js"},{"commandName":"make:preload","description":"Create a new preload file in start/ and optionally register it in adonisrc.ts. Preload files run during app boot","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the preload file inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the preload file's environment. Accepted values are \"web,console,test,repl\"","alias":"e"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the preload file","type":"string"}],"options":{},"filePath":"make/preload.js"},{"commandName":"make:provider","description":"Create a new service provider in providers/ and optionally register it in adonisrc.ts. Providers register IoC container bindings","help":"","namespace":"make","aliases":[],"flags":[{"name":"register","flagName":"register","required":false,"type":"boolean","description":"Auto register the provider inside the .adonisrc.ts file","showNegatedVariantInHelp":true,"alias":"r"},{"name":"environments","flagName":"environments","required":false,"type":"array","description":"Define the provider environment. Accepted values are \"web,console,test,repl\"","alias":"e"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{},"filePath":"make/provider.js"},{"commandName":"make:service","description":"Create a new service class in app/services. Services encapsulate reusable business logic outside of controllers","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the service","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/service.js"},{"commandName":"make:test","description":"Create a new Japa test file in tests/. Use --suite to specify the test suite (unit, functional, etc.)","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file","alias":"s"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{},"filePath":"make/test.js"},{"commandName":"make:transformer","description":"Create a new transformer class in app/transformers for serializing data in API responses","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Entity name for which to generate the transformer","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/transformer.js"},{"commandName":"make:validator","description":"Create a new VineJS validator file in app/validators. Use --resource to generate both create and update validation schemas","help":"","namespace":"make","aliases":[],"flags":[{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Create a file with pre-defined validators for create and update actions"},{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the validator file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/validator.js"},{"commandName":"make:view","description":"Create a new Edge.js template file in resources/views","help":"","namespace":"make","aliases":[],"flags":[{"name":"contentsFrom","flagName":"contents-from","required":false,"type":"string","description":"Use the contents of the given file as the generated output"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Forcefully overwrite existing files","alias":"f"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the template","type":"string"}],"options":{},"filePath":"make/view.js"},{"commandName":"repl","description":"Start an interactive REPL session with the application booted and IoC container available","help":"","namespace":null,"aliases":[],"flags":[],"args":[],"options":{"startApp":true,"staysAlive":true},"filePath":"repl.js"},{"commandName":"serve","description":"Start the development HTTP server. Use --watch for auto-restart on file change or --hmr for hot module replacement","help":["Start the development server with file watcher using the following command.","```","{{ binaryName }} serve --watch","```","","You can also start the server with HMR support using the following command.","```","{{ binaryName }} serve --hmr","```","","The assets bundler dev server runs automatically after detecting vite config or webpack config files","You may pass vite CLI args using the --assets-args command line flag.","```","{{ binaryName }} serve --assets-args=\"--debug --base=/public\"","```"],"namespace":null,"aliases":[],"flags":[{"name":"hmr","flagName":"hmr","required":false,"type":"boolean","description":"Start the server with HMR support"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change","alias":"w"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes","alias":"p"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js"},{"commandName":"test","description":"Run tests using Japa test runner. Supports filtering by suite, file, tag, and group. Use --watch for re-runs on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"files","flagName":"files","required":false,"type":"array","description":"Filter tests by the filename"},{"name":"tags","flagName":"tags","required":false,"type":"array","description":"Filter tests by tags"},{"name":"groups","flagName":"groups","required":false,"type":"array","description":"Filter tests by parent group title"},{"name":"tests","flagName":"tests","required":false,"type":"array","description":"Filter tests by test title"},{"name":"reporters","flagName":"reporters","required":false,"type":"array","description":"Activate one or more test reporters"},{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and re-run tests on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"timeout","flagName":"timeout","required":false,"type":"number","description":"Define default timeout for all tests"},{"name":"retries","flagName":"retries","required":false,"type":"number","description":"Define default retries for all tests"},{"name":"failed","flagName":"failed","required":false,"type":"boolean","description":"Execute tests failed during the last run"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true}],"args":[{"name":"suites","argumentName":"suites","required":false,"description":"Mention suite names to run tests for selected suites","type":"spread"}],"options":{"allowUnknownFlags":true,"staysAlive":true},"filePath":"test.js"}],"version":1}
@@ -1,4 +0,0 @@
1
- import { CommandMetaData, Command } from '@adonisjs/ace/types';
2
-
3
- export function getMetaData(): Promise<CommandMetaData[]>
4
- export function getCommand(metaData: CommandMetaData): Promise<Command | null>
@@ -1,36 +0,0 @@
1
- import { readFile } from 'node:fs/promises'
2
-
3
- /**
4
- * In-memory cache of commands after they have been loaded
5
- */
6
- let commandsMetaData
7
-
8
- /**
9
- * Reads the commands from the "./commands.json" file. Since, the commands.json
10
- * file is generated automatically, we do not have to validate its contents
11
- */
12
- export async function getMetaData() {
13
- if (commandsMetaData) {
14
- return commandsMetaData
15
- }
16
-
17
- const commandsIndex = await readFile(new URL('./commands.json', import.meta.url), 'utf-8')
18
- commandsMetaData = JSON.parse(commandsIndex).commands
19
-
20
- return commandsMetaData
21
- }
22
-
23
- /**
24
- * Imports the command by lookingup its path from the commands
25
- * metadata
26
- */
27
- export async function getCommand(metaData) {
28
- const commands = await getMetaData()
29
- const command = commands.find(({ commandName }) => metaData.commandName === commandName)
30
- if (!command) {
31
- return null
32
- }
33
-
34
- const { default: commandConstructor } = await import(new URL(command.filePath, import.meta.url).href)
35
- return commandConstructor
36
- }