@adonisjs/core 7.0.1 → 7.1.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 (161) hide show
  1. package/build/ace-DBm6EcQ-.js +37 -0
  2. package/build/app-BCcG_oDd.js +7 -0
  3. package/build/app-CAuSGb2P.js +15 -0
  4. package/build/bodyparser_middleware-H5FArWkI.js +9 -0
  5. package/build/{chunk-iKc69rpz.js → chunk-Do49iUES.js} +3 -0
  6. package/build/commands/add.d.ts +1 -0
  7. package/build/commands/add.js +64 -10
  8. package/build/commands/build.js +41 -3
  9. package/build/commands/commands.json +1 -1
  10. package/build/commands/configure.js +70 -4
  11. package/build/commands/eject.js +30 -4
  12. package/build/commands/env/add.js +62 -4
  13. package/build/commands/generate_key.js +23 -3
  14. package/build/commands/inspect_rcfile.js +26 -2
  15. package/build/commands/list/routes.d.ts +5 -0
  16. package/build/commands/list/routes.js +242 -3
  17. package/build/commands/make/command.js +33 -4
  18. package/build/commands/make/controller.js +46 -4
  19. package/build/commands/make/event.js +36 -4
  20. package/build/commands/make/exception.js +36 -4
  21. package/build/commands/make/listener.js +44 -4
  22. package/build/commands/make/middleware.js +53 -5
  23. package/build/commands/make/preload.js +55 -5
  24. package/build/commands/make/provider.js +54 -5
  25. package/build/commands/make/service.js +29 -4
  26. package/build/commands/make/test.js +63 -4
  27. package/build/commands/make/transformer.js +37 -4
  28. package/build/commands/make/validator.js +44 -4
  29. package/build/commands/make/view.js +33 -4
  30. package/build/commands/repl.js +31 -2
  31. package/build/commands/serve.js +54 -4
  32. package/build/commands/test.js +69 -4
  33. package/build/config-Coti2q6R.js +7 -0
  34. package/build/config_provider-Do9af1ze.js +35 -0
  35. package/build/container-CGfEwWof.js +7 -0
  36. package/build/{core-IpCOCkUL.js → core-aRg0soJX.js} +52 -3
  37. package/build/create_kernel-BV3swyCg.js +4 -0
  38. package/build/{create_kernel-B7ILNhuP.js → create_kernel-D38-0Zbt.js} +41 -1
  39. package/build/debug-DWofTfIX.js +20 -0
  40. package/build/{decorate-DmrZA614.js → decorate-B9Uz0anB.js} +2 -0
  41. package/build/{define_config-0oHaj43l.js → define_config--5euEdi8.js} +54 -3
  42. package/build/dumper-3R77st8F.js +353 -0
  43. package/build/edge-BG5ZYp6Z.js +57 -0
  44. package/build/{errors-CrCO-k44.js → errors-BScZTzBu.js} +9 -1
  45. package/build/events-DlKX1ZdL.js +7 -0
  46. package/build/exceptions-B2MzIlHY.js +2 -0
  47. package/build/factories/app.js +1 -0
  48. package/build/factories/bodyparser.js +1 -0
  49. package/build/factories/core/ace.js +16 -22
  50. package/build/factories/core/ignitor.js +13 -73
  51. package/build/factories/core/main.js +25 -17
  52. package/build/factories/core/test_utils.js +22 -19
  53. package/build/factories/encryption.js +1 -0
  54. package/build/factories/events.js +1 -0
  55. package/build/factories/hash.js +1 -0
  56. package/build/factories/http.js +1 -0
  57. package/build/factories/logger.js +1 -0
  58. package/build/factories/stubs.js +75 -7
  59. package/build/ignitor-Kym3gR-I.js +169 -0
  60. package/build/index.js +11 -8
  61. package/build/logger-DIdZPHCe.js +43 -0
  62. package/build/main-B50zECAi.js +121 -0
  63. package/build/main-CRnMnrH7.js +184 -0
  64. package/build/{main-kn40V-hF.js → main-CfTiGsiS.js} +2 -0
  65. package/build/main-Ck0GqLx4.js +117 -0
  66. package/build/main-CoZI4Ezs.js +2 -0
  67. package/build/main-D1MSq4Uu.js +435 -0
  68. package/build/{main--nXd7T-C.js → main-bRYXIHgD.js} +75 -3
  69. package/build/main-zxNP7iRl.js +7 -0
  70. package/build/modules/ace/codemods.js +301 -2
  71. package/build/modules/ace/commands.d.ts +5 -0
  72. package/build/modules/ace/main.js +2 -1
  73. package/build/modules/app.js +3 -5
  74. package/build/modules/bodyparser/bodyparser_middleware.js +2 -2
  75. package/build/modules/bodyparser/main.js +3 -5
  76. package/build/modules/config.js +3 -5
  77. package/build/modules/container.js +3 -5
  78. package/build/modules/dumper/main.js +29 -2
  79. package/build/modules/dumper/plugins/edge.js +2 -46
  80. package/build/modules/encryption/drivers/aes_256_cbc.js +1 -0
  81. package/build/modules/encryption/drivers/aes_256_gcm.js +1 -0
  82. package/build/modules/encryption/drivers/aes_siv.js +1 -0
  83. package/build/modules/encryption/drivers/chacha20_poly1305.js +1 -0
  84. package/build/modules/encryption/drivers/legacy.js +46 -1
  85. package/build/modules/encryption/main.js +7 -5
  86. package/build/modules/env/editor.js +1 -0
  87. package/build/modules/env/main.js +1 -0
  88. package/build/modules/events.js +3 -5
  89. package/build/modules/hash/drivers/argon.js +1 -0
  90. package/build/modules/hash/drivers/bcrypt.js +1 -0
  91. package/build/modules/hash/drivers/scrypt.js +1 -0
  92. package/build/modules/hash/main.js +4 -4
  93. package/build/modules/hash/phc_formatter.js +1 -0
  94. package/build/modules/health.js +1 -0
  95. package/build/modules/http/helpers.js +1 -0
  96. package/build/modules/http/main.js +2 -2
  97. package/build/modules/http/url_builder_client.js +1 -0
  98. package/build/modules/logger.js +3 -13
  99. package/build/modules/repl.js +3 -5
  100. package/build/modules/transformers/main.js +1 -0
  101. package/build/providers/app_provider.js +214 -15
  102. package/build/providers/edge_provider.js +90 -3
  103. package/build/providers/hash_provider.js +59 -4
  104. package/build/providers/repl_provider.js +64 -2
  105. package/build/providers/vinejs_provider.js +44 -3
  106. package/build/repl-C02Re0Yd.js +7 -0
  107. package/build/services/ace.js +11 -1
  108. package/build/services/app.js +2 -4
  109. package/build/services/config.js +7 -1
  110. package/build/services/dumper.js +13 -1
  111. package/build/services/emitter.js +8 -1
  112. package/build/services/encryption.js +8 -1
  113. package/build/services/hash.js +8 -1
  114. package/build/services/logger.js +8 -1
  115. package/build/services/repl.js +8 -1
  116. package/build/services/router.js +8 -1
  117. package/build/services/server.js +8 -1
  118. package/build/services/test_utils.js +11 -1
  119. package/build/services/url_builder.js +8 -1
  120. package/build/src/cli_formatters/routes_list.d.ts +7 -0
  121. package/build/src/exceptions.js +2 -1
  122. package/build/src/helpers/assert.js +1 -0
  123. package/build/src/helpers/http.js +1 -0
  124. package/build/src/helpers/is.js +24 -0
  125. package/build/src/helpers/main.js +2 -1
  126. package/build/src/helpers/string.js +2 -27
  127. package/build/src/helpers/types.js +18 -0
  128. package/build/src/helpers/verification_token.js +2 -45
  129. package/build/src/test_utils/main.js +9 -7
  130. package/build/src/types.js +1 -0
  131. package/build/src/vine.js +2 -32
  132. package/build/string-8_8He-HH.js +46 -0
  133. package/build/test_utils-DbJS_uEu.js +32 -0
  134. package/build/toolkit/main.js +13 -1
  135. package/build/types/ace.js +1 -0
  136. package/build/types/app.js +1 -0
  137. package/build/types/bodyparser.js +1 -0
  138. package/build/types/common.js +1 -0
  139. package/build/types/container.js +1 -0
  140. package/build/types/encryption.js +1 -0
  141. package/build/types/events.js +1 -0
  142. package/build/types/hash.js +1 -0
  143. package/build/types/health.js +1 -0
  144. package/build/types/helpers.js +1 -0
  145. package/build/types/http.js +1 -0
  146. package/build/types/logger.js +1 -0
  147. package/build/types/repl.js +1 -0
  148. package/build/types/transformers.js +1 -0
  149. package/build/utils-CKwka7OL.js +105 -0
  150. package/build/verification_token-WCrZtUgZ.js +108 -0
  151. package/build/vine-DkIupA3Z.js +97 -0
  152. package/package.json +12 -12
  153. package/build/config_provider-FIAUgvae.js +0 -13
  154. package/build/create_kernel-BD0Iqi8e.js +0 -3
  155. package/build/debug-CGQmxzGt.js +0 -3
  156. package/build/dumper-BBgqFX5a.js +0 -147
  157. package/build/main-Cxz0TyIw.js +0 -173
  158. package/build/main-DN2qEEg5.js +0 -41
  159. package/build/main-DkNgvceD.js +0 -52
  160. package/build/main-MBAMnmJb.js +0 -81
  161. package/build/utils-rRkbAPnP.js +0 -42
@@ -1,11 +1,43 @@
1
- import { t as stubsRoot } from "../../main-kn40V-hF.js";
2
- import { f as BaseCommand, l as flags, o as args } from "../../main-MBAMnmJb.js";
3
- import { t as __decorate } from "../../decorate-DmrZA614.js";
1
+ import "../../chunk-Do49iUES.js";
2
+ import { t as stubsRoot } from "../../main-CfTiGsiS.js";
3
+ import { f as BaseCommand, l as flags, o as args } from "../../main-CRnMnrH7.js";
4
+ import { t as __decorate } from "../../decorate-B9Uz0anB.js";
5
+ //#region commands/make/transformer.ts
6
+ /**
7
+ * Command to create a new transformer class.
8
+ * Transformers are used to serialize data objects (like models) into specific
9
+ * formats for API responses, allowing you to control which fields are exposed
10
+ * and how data is structured for clients.
11
+ *
12
+ * @example
13
+ * ```
14
+ * ace make:transformer User
15
+ * ace make:transformer Post
16
+ * ace make:transformer ProductTransformer
17
+ * ```
18
+ */
4
19
  var MakeTransformer = class extends BaseCommand {
20
+ /**
21
+ * The command name
22
+ */
5
23
  static commandName = "make:transformer";
6
- static description = "Create a new transformer class";
24
+ /**
25
+ * The command description
26
+ */
27
+ static description = "Create a new transformer class in app/transformers for serializing data in API responses";
28
+ /**
29
+ * Command options configuration.
30
+ * Allows unknown flags to be passed through.
31
+ */
7
32
  static options = { allowUnknownFlags: true };
33
+ /**
34
+ * The stub template file to use for generating the transformer class
35
+ */
8
36
  stubPath = "make/transformer/main.stub";
37
+ /**
38
+ * Execute the command to create a new transformer class.
39
+ * Generates the transformer file with proper data serialization structure.
40
+ */
9
41
  async run() {
10
42
  await (await this.createCodemods()).makeUsingStub(stubsRoot, this.stubPath, {
11
43
  flags: this.parsed.flags,
@@ -16,4 +48,5 @@ var MakeTransformer = class extends BaseCommand {
16
48
  };
17
49
  __decorate([args.string({ description: "Entity name for which to generate the transformer" })], MakeTransformer.prototype, "name", void 0);
18
50
  __decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakeTransformer.prototype, "contentsFrom", void 0);
51
+ //#endregion
19
52
  export { MakeTransformer as default };
@@ -1,14 +1,53 @@
1
- import { t as stubsRoot } from "../../main-kn40V-hF.js";
2
- import { f as BaseCommand, l as flags, o as args } from "../../main-MBAMnmJb.js";
3
- import { t as __decorate } from "../../decorate-DmrZA614.js";
1
+ import "../../chunk-Do49iUES.js";
2
+ import { t as stubsRoot } from "../../main-CfTiGsiS.js";
3
+ import { f as BaseCommand, l as flags, o as args } from "../../main-CRnMnrH7.js";
4
+ import { t as __decorate } from "../../decorate-B9Uz0anB.js";
5
+ //#region commands/make/validator.ts
6
+ /**
7
+ * Command to create a new VineJS validator file.
8
+ * Validators define reusable validation schemas for request validation,
9
+ * and can be generated as simple validators or resource-based validators
10
+ * with create and update schemas.
11
+ *
12
+ * @example
13
+ * ```
14
+ * ace make:validator UserValidator
15
+ * ace make:validator PostValidator --resource
16
+ * ace make:validator ContactValidator
17
+ * ```
18
+ */
4
19
  var MakeValidator = class extends BaseCommand {
20
+ /**
21
+ * The command name
22
+ */
5
23
  static commandName = "make:validator";
6
- static description = "Create a new file to define VineJS validators";
24
+ /**
25
+ * The command description
26
+ */
27
+ static description = "Create a new VineJS validator file in app/validators. Use --resource to generate both create and update validation schemas";
28
+ /**
29
+ * Command options configuration.
30
+ * Allows unknown flags to be passed through.
31
+ */
7
32
  static options = { allowUnknownFlags: true };
33
+ /**
34
+ * The stub template file to use for generating the validator
35
+ */
8
36
  stubPath = "make/validator/main.stub";
37
+ /**
38
+ * Prepare the command by selecting the appropriate stub based on options.
39
+ * Uses a resource stub when generating validators for CRUD operations.
40
+ */
9
41
  async prepare() {
42
+ /**
43
+ * Use resource stub
44
+ */
10
45
  if (this.resource) this.stubPath = "make/validator/resource.stub";
11
46
  }
47
+ /**
48
+ * Execute the command to create a new VineJS validator file.
49
+ * Generates the validator with the appropriate stub template.
50
+ */
12
51
  async run() {
13
52
  await (await this.createCodemods()).makeUsingStub(stubsRoot, this.stubPath, {
14
53
  flags: this.parsed.flags,
@@ -19,4 +58,5 @@ var MakeValidator = class extends BaseCommand {
19
58
  __decorate([args.string({ description: "Name of the validator file" })], MakeValidator.prototype, "name", void 0);
20
59
  __decorate([flags.boolean({ description: "Create a file with pre-defined validators for create and update actions" })], MakeValidator.prototype, "resource", void 0);
21
60
  __decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakeValidator.prototype, "contentsFrom", void 0);
61
+ //#endregion
22
62
  export { MakeValidator as default };
@@ -1,10 +1,38 @@
1
- import { t as stubsRoot } from "../../main-kn40V-hF.js";
2
- import { f as BaseCommand, l as flags, o as args } from "../../main-MBAMnmJb.js";
3
- import { t as __decorate } from "../../decorate-DmrZA614.js";
1
+ import "../../chunk-Do49iUES.js";
2
+ import { t as stubsRoot } from "../../main-CfTiGsiS.js";
3
+ import { f as BaseCommand, l as flags, o as args } from "../../main-CRnMnrH7.js";
4
+ import { t as __decorate } from "../../decorate-B9Uz0anB.js";
5
+ //#region commands/make/view.ts
6
+ /**
7
+ * Command to create a new Edge.js template file.
8
+ * Edge templates are used for rendering HTML views in your web application,
9
+ * supporting layouts, partials, components, and template inheritance.
10
+ *
11
+ * @example
12
+ * ```
13
+ * ace make:view home
14
+ * ace make:view users/profile
15
+ * ace make:view components/navbar
16
+ * ace make:view layouts/app
17
+ * ```
18
+ */
4
19
  var MakeView = class extends BaseCommand {
20
+ /**
21
+ * The command name
22
+ */
5
23
  static commandName = "make:view";
6
- static description = "Create a new Edge.js template file";
24
+ /**
25
+ * The command description
26
+ */
27
+ static description = "Create a new Edge.js template file in resources/views";
28
+ /**
29
+ * The stub template file to use for generating the Edge template
30
+ */
7
31
  stubPath = "make/view/main.stub";
32
+ /**
33
+ * Execute the command to create a new Edge.js template file.
34
+ * Generates the template file in the views directory.
35
+ */
8
36
  async run() {
9
37
  await (await this.createCodemods()).makeUsingStub(stubsRoot, this.stubPath, {
10
38
  flags: this.parsed.flags,
@@ -14,4 +42,5 @@ var MakeView = class extends BaseCommand {
14
42
  };
15
43
  __decorate([args.string({ description: "Name of the template" })], MakeView.prototype, "name", void 0);
16
44
  __decorate([flags.string({ description: "Use the contents of the given file as the generated output" })], MakeView.prototype, "contentsFrom", void 0);
45
+ //#endregion
17
46
  export { MakeView as default };
@@ -1,11 +1,39 @@
1
- import { f as BaseCommand } from "../main-MBAMnmJb.js";
1
+ import "../chunk-Do49iUES.js";
2
+ import { f as BaseCommand } from "../main-CRnMnrH7.js";
3
+ //#region commands/repl.ts
4
+ /**
5
+ * Command to start an interactive REPL (Read-Eval-Print Loop) session for AdonisJS.
6
+ * The REPL provides a command-line interface where you can execute JavaScript code
7
+ * in the context of your AdonisJS application, allowing you to interact with models,
8
+ * services, and other application components in real-time.
9
+ *
10
+ * @example
11
+ * ```
12
+ * ace repl
13
+ * ```
14
+ */
2
15
  var ReplCommand = class extends BaseCommand {
16
+ /**
17
+ * The command name
18
+ */
3
19
  static commandName = "repl";
4
- static description = "Start a new REPL session";
20
+ /**
21
+ * The command description
22
+ */
23
+ static description = "Start an interactive REPL session with the application booted and IoC container available";
24
+ /**
25
+ * Command options configuration.
26
+ * Requires the application to be started and keeps the process alive.
27
+ */
5
28
  static options = {
6
29
  startApp: true,
7
30
  staysAlive: true
8
31
  };
32
+ /**
33
+ * Execute the command to start the REPL server.
34
+ * Creates a REPL instance from the container and sets up an exit handler
35
+ * that properly terminates the application when the REPL session ends.
36
+ */
9
37
  async run() {
10
38
  const repl = await this.app.container.make("repl");
11
39
  repl.start();
@@ -14,4 +42,5 @@ var ReplCommand = class extends BaseCommand {
14
42
  });
15
43
  }
16
44
  };
45
+ //#endregion
17
46
  export { ReplCommand as default };
@@ -1,9 +1,34 @@
1
- import { t as importAssembler } from "../utils-rRkbAPnP.js";
2
- import { f as BaseCommand, l as flags } from "../main-MBAMnmJb.js";
3
- import { t as __decorate } from "../decorate-DmrZA614.js";
1
+ import "../chunk-Do49iUES.js";
2
+ import { t as importAssembler } from "../utils-CKwka7OL.js";
3
+ import { f as BaseCommand, l as flags } from "../main-CRnMnrH7.js";
4
+ import { t as __decorate } from "../decorate-B9Uz0anB.js";
5
+ //#region commands/serve.ts
6
+ /**
7
+ * Serve command is used to run the AdonisJS HTTP server during development. The
8
+ * command under the hood runs the "bin/server.ts" file and watches for file
9
+ * system changes
10
+ *
11
+ * @example
12
+ * ```
13
+ * ace serve
14
+ * ace serve --watch
15
+ * ace serve --hmr
16
+ * ace serve --poll
17
+ * ace serve --no-clear
18
+ * ```
19
+ */
4
20
  var Serve = class extends BaseCommand {
21
+ /**
22
+ * The command name
23
+ */
5
24
  static commandName = "serve";
6
- static description = "Start the development HTTP server along with the file watcher to perform restarts on file change";
25
+ /**
26
+ * The command description
27
+ */
28
+ static description = "Start the development HTTP server. Use --watch for auto-restart on file change or --hmr for hot module replacement";
29
+ /**
30
+ * Help text for the command
31
+ */
7
32
  static help = [
8
33
  "Start the development server with file watcher using the following command.",
9
34
  "```",
@@ -21,7 +46,15 @@ var Serve = class extends BaseCommand {
21
46
  "{{ binaryName }} serve --assets-args=\"--debug --base=/public\"",
22
47
  "```"
23
48
  ];
49
+ /**
50
+ * Command options configuration
51
+ */
24
52
  static options = { staysAlive: true };
53
+ /**
54
+ * Log a development dependency is missing
55
+ *
56
+ * @param dependency - The name of the missing dependency
57
+ */
25
58
  #logMissingDevelopmentDependency(dependency) {
26
59
  this.logger.error([
27
60
  `Cannot find package "${dependency}"`,
@@ -31,6 +64,9 @@ var Serve = class extends BaseCommand {
31
64
  "If you are running your application in production, then use \"node bin/server.js\" command to start the HTTP server"
32
65
  ].join("\n"));
33
66
  }
67
+ /**
68
+ * Runs the HTTP server
69
+ */
34
70
  async run() {
35
71
  const assembler = await importAssembler(this.app);
36
72
  if (!assembler) {
@@ -51,15 +87,28 @@ var Serve = class extends BaseCommand {
51
87
  metaFiles: this.app.rcFile.metaFiles,
52
88
  hooks: this.app.rcFile.hooks
53
89
  });
90
+ /**
91
+ * Share command logger with assembler, so that CLI flags like --no-ansi has
92
+ * similar impact for assembler logs as well.
93
+ */
54
94
  this.devServer.ui.logger = this.logger;
95
+ /**
96
+ * Exit command when the dev server is closed
97
+ */
55
98
  this.devServer.onClose((exitCode) => {
56
99
  this.exitCode = exitCode;
57
100
  this.terminate();
58
101
  });
102
+ /**
103
+ * Exit command when the dev server crashes
104
+ */
59
105
  this.devServer.onError(() => {
60
106
  this.exitCode = 1;
61
107
  this.terminate();
62
108
  });
109
+ /**
110
+ * Start the development server
111
+ */
63
112
  if (this.watch) await this.devServer.startAndWatch({ poll: this.poll || false });
64
113
  else await this.devServer.start();
65
114
  }
@@ -78,4 +127,5 @@ __decorate([flags.boolean({
78
127
  showNegatedVariantInHelp: true,
79
128
  default: true
80
129
  })], Serve.prototype, "clear", void 0);
130
+ //#endregion
81
131
  export { Serve as default };
@@ -1,13 +1,47 @@
1
- import { t as importAssembler } from "../utils-rRkbAPnP.js";
2
- import { f as BaseCommand, l as flags, o as args } from "../main-MBAMnmJb.js";
3
- import { t as __decorate } from "../decorate-DmrZA614.js";
1
+ import "../chunk-Do49iUES.js";
2
+ import { t as importAssembler } from "../utils-CKwka7OL.js";
3
+ import { f as BaseCommand, l as flags, o as args } from "../main-CRnMnrH7.js";
4
+ import { t as __decorate } from "../decorate-B9Uz0anB.js";
5
+ //#region commands/test.ts
6
+ /**
7
+ * Command to run application tests using the Japa test runner.
8
+ * Supports filtering tests by suites, files, tags, groups, and individual tests.
9
+ * Can run in watch mode to automatically re-run tests when files change.
10
+ *
11
+ * @example
12
+ * ```
13
+ * ace test
14
+ * ace test unit integration
15
+ * ace test --watch
16
+ * ace test --files=user.spec.ts
17
+ * ace test --tags=slow --groups="User tests"
18
+ * ace test --reporters=spec,dot
19
+ * ace test --timeout=5000 --retries=2
20
+ * ```
21
+ */
4
22
  var Test = class extends BaseCommand {
23
+ /**
24
+ * The command name
25
+ */
5
26
  static commandName = "test";
6
- static description = "Run tests along with the file watcher to re-run tests on file change";
27
+ /**
28
+ * The command description
29
+ */
30
+ static description = "Run tests using Japa test runner. Supports filtering by suite, file, tag, and group. Use --watch for re-runs on file change";
31
+ /**
32
+ * Command options configuration.
33
+ * Allows unknown flags to be passed to Japa and keeps the process alive.
34
+ */
7
35
  static options = {
8
36
  allowUnknownFlags: true,
9
37
  staysAlive: true
10
38
  };
39
+ /**
40
+ * Log an error message when a required development dependency is missing.
41
+ * Provides helpful instructions for resolving the issue.
42
+ *
43
+ * @param dependency - The name of the missing dependency package
44
+ */
11
45
  #logMissingDevelopmentDependency(dependency) {
12
46
  this.logger.error([
13
47
  `Cannot find package "${dependency}"`,
@@ -17,14 +51,31 @@ var Test = class extends BaseCommand {
17
51
  "If you are run tests inside a CI, make sure the NODE_ENV is set to \"development\""
18
52
  ].join("\n"));
19
53
  }
54
+ /**
55
+ * Collect unknown flags and format them to pass to the Japa test runner.
56
+ * Handles boolean flags, arrays, and single values appropriately.
57
+ *
58
+ * @returns Array of formatted command-line arguments for Japa
59
+ */
20
60
  #getPassthroughFlags() {
21
61
  return this.parsed.unknownFlags.map((flag) => {
22
62
  const value = this.parsed.flags[flag];
63
+ /**
64
+ * Not mentioning value when value is "true"
65
+ */
23
66
  if (value === true) return [`--${flag}`];
67
+ /**
68
+ * Repeating flag multiple times when value is an array
69
+ */
24
70
  if (Array.isArray(value)) return value.map((v) => [`--${flag}`, v]);
25
71
  return [`--${flag}`, value];
26
72
  }).flat(2);
27
73
  }
74
+ /**
75
+ * Execute the test command. Sets up the test runner with all configured options
76
+ * and filters, then runs tests either once or in watch mode. Handles missing
77
+ * dependencies and properly configures the test environment.
78
+ */
28
79
  async run() {
29
80
  process.env.NODE_ENV = "test";
30
81
  const assembler = await importAssembler(this.app);
@@ -58,15 +109,28 @@ var Test = class extends BaseCommand {
58
109
  hooks: this.app.rcFile.hooks,
59
110
  metaFiles: this.app.rcFile.metaFiles
60
111
  });
112
+ /**
113
+ * Share command logger with assembler, so that CLI flags like --no-ansi has
114
+ * similar impact for assembler logs as well.
115
+ */
61
116
  this.testsRunner.ui.logger = this.logger;
117
+ /**
118
+ * Exit command when the test runner is closed
119
+ */
62
120
  this.testsRunner.onClose((exitCode) => {
63
121
  this.exitCode = exitCode;
64
122
  this.terminate();
65
123
  });
124
+ /**
125
+ * Exit command when the dev server crashes
126
+ */
66
127
  this.testsRunner.onError(() => {
67
128
  this.exitCode = 1;
68
129
  this.terminate();
69
130
  });
131
+ /**
132
+ * Start the test runner in watch mode
133
+ */
70
134
  if (this.watch) await this.testsRunner.runAndWatch({ poll: this.poll || false });
71
135
  else await this.testsRunner.run();
72
136
  }
@@ -90,4 +154,5 @@ __decorate([flags.boolean({
90
154
  showNegatedVariantInHelp: true,
91
155
  default: true
92
156
  })], Test.prototype, "clear", void 0);
157
+ //#endregion
93
158
  export { Test as default };
@@ -0,0 +1,7 @@
1
+ import { n as __reExport, t as __exportAll } from "./chunk-Do49iUES.js";
2
+ //#region modules/config.ts
3
+ var config_exports = /* @__PURE__ */ __exportAll({});
4
+ import * as import__adonisjs_config from "@adonisjs/config";
5
+ __reExport(config_exports, import__adonisjs_config);
6
+ //#endregion
7
+ export { config_exports as t };
@@ -0,0 +1,35 @@
1
+ //#region src/config_provider.ts
2
+ /**
3
+ * Helper utilities to create and resolve config providers. Config providers
4
+ * are used to defer configuration resolution until the application is booted,
5
+ * allowing access to environment variables and other application services.
6
+ *
7
+ * @example
8
+ * // Creating a database config provider
9
+ * const databaseConfig = configProvider.create(async (app) => ({
10
+ * connection: app.env.get('DB_CONNECTION', 'sqlite'),
11
+ * host: app.env.get('DB_HOST', 'localhost'),
12
+ * port: app.env.get('DB_PORT', 5432)
13
+ * }))
14
+ *
15
+ * @example
16
+ * // Resolving a config provider
17
+ * const config = await configProvider.resolve(app, databaseConfig)
18
+ * if (config) {
19
+ * console.log(`Database connection: ${config.connection}`)
20
+ * }
21
+ */
22
+ const configProvider = {
23
+ create(resolver) {
24
+ return {
25
+ type: "provider",
26
+ resolver
27
+ };
28
+ },
29
+ async resolve(app, provider) {
30
+ if (provider && typeof provider === "object" && "type" in provider) return provider.resolver(app);
31
+ return null;
32
+ }
33
+ };
34
+ //#endregion
35
+ export { configProvider as t };
@@ -0,0 +1,7 @@
1
+ import { n as __reExport, t as __exportAll } from "./chunk-Do49iUES.js";
2
+ //#region modules/container.ts
3
+ var container_exports = /* @__PURE__ */ __exportAll({});
4
+ import * as import__adonisjs_fold from "@adonisjs/fold";
5
+ __reExport(container_exports, import__adonisjs_fold);
6
+ //#endregion
7
+ export { container_exports as t };
@@ -1,10 +1,49 @@
1
- import stringHelpers from "./src/helpers/string.js";
2
- import { r as outputTransformerDataObjects } from "./utils-rRkbAPnP.js";
1
+ import { t as stringHelpers } from "./string-8_8He-HH.js";
2
+ import { r as outputTransformerDataObjects } from "./utils-CKwka7OL.js";
3
3
  import { errors } from "@adonisjs/ace";
4
4
  import { errors as errors$1 } from "@adonisjs/env";
5
5
  import { errors as errors$2 } from "@adonisjs/application";
6
6
  import { errors as errors$3 } from "@boringnode/encryption";
7
7
  import { errors as errors$4 } from "@adonisjs/http-server";
8
+ //#region src/assembler_hooks/index_entities.ts
9
+ /**
10
+ * Configures the IndexGenerator to create barrel files for "controllers", "events",
11
+ * and "listeners". This function is used as an assembler hook to automatically generate
12
+ * index files that export all modules from specified directories.
13
+ *
14
+ * @param {IndexEntitiesConfig} entities - Configuration object for entities indexing
15
+ *
16
+ * @example
17
+ * // Basic usage with default configuration
18
+ * indexEntities({})
19
+ *
20
+ * @example
21
+ * // Custom configuration for specific entities
22
+ * indexEntities({
23
+ * events: {
24
+ * enabled: true,
25
+ * source: 'app/custom-events',
26
+ * importAlias: '#custom-events'
27
+ * },
28
+ * transformers: {
29
+ * enabled: true,
30
+ * withSharedProps: true,
31
+ * inertiaMiddlewareImportPath: '#middleware/inertia_middleware'
32
+ * },
33
+ * controllers: {
34
+ * enabled: false
35
+ * }
36
+ * })
37
+ *
38
+ * @example
39
+ * // Using custom glob patterns
40
+ * indexEntities({
41
+ * listeners: {
42
+ * source: 'app/handlers',
43
+ * glob: '**\/*_handler.ts'
44
+ * }
45
+ * })
46
+ */
8
47
  function indexEntities(entities = {}) {
9
48
  const events = Object.assign({
10
49
  enabled: true,
@@ -37,7 +76,7 @@ function indexEntities(entities = {}) {
37
76
  output: ".adonisjs/client/data.d.ts"
38
77
  }, entities.transformers);
39
78
  const manifest = {
40
- enabled: entities.manifest?.enabled === false ? false : transformers.enabled,
79
+ enabled: entities.manifest?.enabled ?? transformers.enabled,
41
80
  source: "config",
42
81
  output: ".adonisjs/client/manifest.d.ts",
43
82
  exclude: entities.manifest?.exclude ?? [
@@ -123,6 +162,11 @@ function indexEntities(entities = {}) {
123
162
  });
124
163
  } };
125
164
  }
165
+ //#endregion
166
+ //#region index.ts
167
+ /**
168
+ * Aggregated errors from all modules.
169
+ */
126
170
  const errors$5 = {
127
171
  ...errors$3,
128
172
  ...errors$4,
@@ -130,6 +174,10 @@ const errors$5 = {
130
174
  ...errors,
131
175
  ...errors$1
132
176
  };
177
+ /**
178
+ * Pretty prints an error with colorful output using
179
+ * Youch terminal
180
+ */
133
181
  async function prettyPrintError(error) {
134
182
  if (error && typeof error === "object" && error.code === "E_DUMP_DIE_EXCEPTION") {
135
183
  console.error(error);
@@ -143,4 +191,5 @@ async function prettyPrintError(error) {
143
191
  console.error(error);
144
192
  }
145
193
  }
194
+ //#endregion
146
195
  export { prettyPrintError as n, indexEntities as r, errors$5 as t };
@@ -0,0 +1,4 @@
1
+ import "./chunk-Do49iUES.js";
2
+ import "./main-CRnMnrH7.js";
3
+ import { t as createAceKernel } from "./create_kernel-D38-0Zbt.js";
4
+ export { createAceKernel };
@@ -1,10 +1,40 @@
1
- import { d as Kernel, n as HelpCommand, t as FsLoader } from "./main-MBAMnmJb.js";
1
+ import { d as Kernel, n as HelpCommand, t as FsLoader } from "./main-CRnMnrH7.js";
2
+ //#region modules/ace/create_kernel.ts
3
+ /**
4
+ * Create and configure an Ace command kernel for AdonisJS applications.
5
+ * This function abstracts the kernel setup logic and can be used in different
6
+ * environments with appropriate configurations.
7
+ *
8
+ * - In console environment, Ace manages the lifecycle of the process
9
+ * - In other environments, Ace can be pulled from the container to run commands
10
+ *
11
+ * @param app - The AdonisJS application service instance
12
+ * @param commandName - Optional specific command name for optimized loading
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const app = new Application(new URL('../', import.meta.url))
17
+ * const kernel = createAceKernel(app)
18
+ *
19
+ * // Run a specific command
20
+ * await kernel.handle(['make:controller', 'UserController'])
21
+ * ```
22
+ */
2
23
  function createAceKernel(app, commandName) {
3
24
  const kernel = new Kernel(app);
4
25
  kernel.info.set("binary", "node ace");
26
+ /**
27
+ * Lazy import commands mentioned in the "commands" array
28
+ * of rcFile
29
+ */
5
30
  app.rcFile.commands.forEach((commandModule) => {
6
31
  kernel.addLoader(() => typeof commandModule === "function" ? commandModule() : app.import(commandModule));
7
32
  });
33
+ /**
34
+ * When we know the command we are running ahead of time, then we
35
+ * defer loading the application commands if the command has
36
+ * already been registered by other loaders.
37
+ */
8
38
  const fsLoader = new FsLoader(app.commandsPath());
9
39
  kernel.addLoader({
10
40
  async getMetaData() {
@@ -15,6 +45,9 @@ function createAceKernel(app, commandName) {
15
45
  return fsLoader.getCommand(command);
16
46
  }
17
47
  });
48
+ /**
49
+ * Custom global flags
50
+ */
18
51
  kernel.defineFlag("ansi", {
19
52
  type: "boolean",
20
53
  showNegatedVariantInHelp: true,
@@ -24,10 +57,16 @@ function createAceKernel(app, commandName) {
24
57
  type: "boolean",
25
58
  description: HelpCommand.description
26
59
  });
60
+ /**
61
+ * Flag listener to turn colors on/off
62
+ */
27
63
  kernel.on("ansi", (_, $kernel, parsed) => {
28
64
  if (parsed.flags.ansi === false) $kernel.ui.switchMode("silent");
29
65
  if (parsed.flags.ansi === true) $kernel.ui.switchMode("normal");
30
66
  });
67
+ /**
68
+ * Flag listener to display the help
69
+ */
31
70
  kernel.on("help", async (command, $kernel, parsed) => {
32
71
  parsed.args.unshift(command.commandName);
33
72
  await new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt).exec();
@@ -35,4 +74,5 @@ function createAceKernel(app, commandName) {
35
74
  });
36
75
  return kernel;
37
76
  }
77
+ //#endregion
38
78
  export { createAceKernel as t };
@@ -0,0 +1,20 @@
1
+ import { debuglog } from "node:util";
2
+ //#region src/debug.ts
3
+ /**
4
+ * Debug utility for AdonisJS core. This uses Node.js built-in debuglog
5
+ * utility to provide debugging information when the NODE_DEBUG environment
6
+ * variable includes 'adonisjs:core'.
7
+ *
8
+ * @example
9
+ * // Enable debugging by setting environment variable
10
+ * // NODE_DEBUG=adonisjs:core node app.js
11
+ *
12
+ * @example
13
+ * // Usage in code
14
+ * import debug from '@adonisjs/core/debug'
15
+ * debug('Application started')
16
+ * debug('Processing request: %s', req.url)
17
+ */
18
+ var debug_default = debuglog("adonisjs:core");
19
+ //#endregion
20
+ export { debug_default as t };