@adonisjs/core 6.19.0 → 7.0.0-next.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 (177) hide show
  1. package/build/commands/add.d.ts +36 -5
  2. package/build/commands/add.js +24 -60
  3. package/build/commands/build.d.ts +23 -3
  4. package/build/commands/build.js +22 -36
  5. package/build/commands/commands.json +1 -1
  6. package/build/commands/configure.d.ts +35 -12
  7. package/build/commands/configure.js +39 -12
  8. package/build/commands/eject.d.ts +28 -3
  9. package/build/commands/eject.js +24 -5
  10. package/build/commands/env/add.d.ts +41 -4
  11. package/build/commands/env/add.js +32 -5
  12. package/build/commands/generate_key.d.ts +20 -1
  13. package/build/commands/generate_key.js +14 -1
  14. package/build/commands/inspect_rcfile.d.ts +20 -2
  15. package/build/commands/inspect_rcfile.js +20 -2
  16. package/build/commands/list/routes.d.ts +33 -11
  17. package/build/commands/list/routes.js +28 -5
  18. package/build/commands/make/command.d.ts +26 -3
  19. package/build/commands/make/command.js +25 -5
  20. package/build/commands/make/controller.d.ts +35 -2
  21. package/build/commands/make/controller.js +20 -2
  22. package/build/commands/make/event.d.ts +30 -4
  23. package/build/commands/make/event.js +27 -4
  24. package/build/commands/make/exception.d.ts +30 -4
  25. package/build/commands/make/exception.js +27 -4
  26. package/build/commands/make/listener.d.ts +38 -5
  27. package/build/commands/make/listener.js +32 -5
  28. package/build/commands/make/middleware.d.ts +25 -2
  29. package/build/commands/make/middleware.js +21 -4
  30. package/build/commands/make/preload.d.ts +31 -4
  31. package/build/commands/make/preload.js +28 -8
  32. package/build/commands/make/provider.d.ts +32 -3
  33. package/build/commands/make/provider.js +29 -7
  34. package/build/commands/make/service.d.ts +21 -2
  35. package/build/commands/make/service.js +18 -2
  36. package/build/commands/make/test.d.ts +27 -4
  37. package/build/commands/make/test.js +36 -8
  38. package/build/commands/make/transformer.d.ts +43 -0
  39. package/build/commands/make/transformer.js +65 -0
  40. package/build/commands/make/validator.d.ts +36 -5
  41. package/build/commands/make/validator.js +30 -5
  42. package/build/commands/make/view.d.ts +26 -3
  43. package/build/commands/make/view.js +24 -4
  44. package/build/commands/repl.d.ts +24 -4
  45. package/build/commands/repl.js +23 -3
  46. package/build/commands/serve.d.ts +38 -4
  47. package/build/commands/serve.js +34 -43
  48. package/build/commands/test.d.ts +68 -7
  49. package/build/commands/test.js +39 -37
  50. package/build/factories/core/ace.d.ts +31 -4
  51. package/build/factories/core/ace.js +20 -4
  52. package/build/factories/core/ignitor.d.ts +80 -9
  53. package/build/factories/core/ignitor.js +84 -13
  54. package/build/factories/core/main.d.ts +3 -3
  55. package/build/factories/core/main.js +3 -3
  56. package/build/factories/core/test_utils.d.ts +32 -4
  57. package/build/factories/core/test_utils.js +21 -4
  58. package/build/factories/stubs.d.ts +54 -5
  59. package/build/factories/stubs.js +55 -6
  60. package/build/index.d.ts +5 -4
  61. package/build/index.js +13 -9
  62. package/build/modules/ace/codemods.d.ts +71 -11
  63. package/build/modules/ace/codemods.js +90 -22
  64. package/build/modules/ace/commands.d.ts +48 -13
  65. package/build/modules/ace/commands.js +45 -10
  66. package/build/modules/ace/create_kernel.d.ts +19 -8
  67. package/build/modules/ace/create_kernel.js +19 -8
  68. package/build/modules/ace/kernel.d.ts +18 -4
  69. package/build/modules/ace/kernel.js +17 -3
  70. package/build/modules/ace/main.d.ts +3 -3
  71. package/build/modules/ace/main.js +3 -3
  72. package/build/modules/dumper/define_config.d.ts +25 -4
  73. package/build/modules/dumper/define_config.js +23 -2
  74. package/build/modules/dumper/dumper.d.ts +82 -12
  75. package/build/modules/dumper/dumper.js +82 -12
  76. package/build/modules/dumper/errors.d.ts +31 -10
  77. package/build/modules/dumper/errors.js +28 -7
  78. package/build/modules/dumper/main.d.ts +3 -3
  79. package/build/modules/dumper/main.js +3 -3
  80. package/build/modules/dumper/plugins/edge.d.ts +1 -1
  81. package/build/modules/hash/define_config.d.ts +53 -8
  82. package/build/modules/hash/define_config.js +51 -6
  83. package/build/modules/hash/main.d.ts +1 -1
  84. package/build/modules/hash/main.js +1 -1
  85. package/build/modules/http/main.d.ts +1 -1
  86. package/build/modules/http/main.js +1 -1
  87. package/build/modules/http/request_validator.d.ts +36 -9
  88. package/build/modules/http/request_validator.js +32 -5
  89. package/build/modules/transformers/main.d.ts +1 -0
  90. package/build/modules/transformers/main.js +9 -0
  91. package/build/providers/app_provider.d.ts +173 -1
  92. package/build/providers/app_provider.js +204 -8
  93. package/build/providers/edge_provider.d.ts +31 -2
  94. package/build/providers/edge_provider.js +31 -2
  95. package/build/providers/hash_provider.d.ts +38 -1
  96. package/build/providers/hash_provider.js +40 -3
  97. package/build/providers/repl_provider.d.ts +40 -1
  98. package/build/providers/repl_provider.js +52 -2
  99. package/build/providers/vinejs_provider.d.ts +32 -5
  100. package/build/providers/vinejs_provider.js +31 -4
  101. package/build/services/ace.d.ts +1 -1
  102. package/build/services/ace.js +1 -1
  103. package/build/services/app.d.ts +1 -1
  104. package/build/services/config.d.ts +1 -1
  105. package/build/services/config.js +1 -1
  106. package/build/services/dumper.js +1 -1
  107. package/build/services/emitter.d.ts +1 -1
  108. package/build/services/emitter.js +1 -1
  109. package/build/services/encryption.d.ts +1 -1
  110. package/build/services/encryption.js +1 -1
  111. package/build/services/hash.d.ts +1 -1
  112. package/build/services/hash.js +1 -1
  113. package/build/services/logger.d.ts +1 -1
  114. package/build/services/logger.js +1 -1
  115. package/build/services/repl.d.ts +1 -1
  116. package/build/services/repl.js +1 -1
  117. package/build/services/router.d.ts +1 -1
  118. package/build/services/router.js +1 -1
  119. package/build/services/server.d.ts +1 -1
  120. package/build/services/server.js +1 -1
  121. package/build/services/test_utils.d.ts +1 -1
  122. package/build/services/test_utils.js +1 -1
  123. package/build/services/url_builder.d.ts +4 -0
  124. package/build/services/url_builder.js +21 -0
  125. package/build/src/assembler_hooks/index_entities.d.ts +37 -0
  126. package/build/src/assembler_hooks/index_entities.js +106 -0
  127. package/build/src/cli_formatters/routes_list.d.ts +24 -12
  128. package/build/src/cli_formatters/routes_list.js +43 -46
  129. package/build/src/config_provider.d.ts +48 -3
  130. package/build/src/config_provider.js +47 -2
  131. package/build/src/debug.d.ts +15 -0
  132. package/build/src/debug.js +15 -0
  133. package/build/src/exceptions.d.ts +41 -1
  134. package/build/src/exceptions.js +41 -1
  135. package/build/src/helpers/assert.d.ts +47 -1
  136. package/build/src/helpers/assert.js +47 -1
  137. package/build/src/helpers/is.d.ts +21 -0
  138. package/build/src/helpers/is.js +21 -0
  139. package/build/src/helpers/main.d.ts +48 -5
  140. package/build/src/helpers/main.js +48 -5
  141. package/build/src/helpers/string.d.ts +89 -9
  142. package/build/src/helpers/string.js +21 -2
  143. package/build/src/helpers/types.d.ts +97 -2
  144. package/build/src/helpers/types.js +96 -2
  145. package/build/src/helpers/verification_token.d.ts +22 -1
  146. package/build/src/helpers/verification_token.js +24 -2
  147. package/build/src/ignitor/ace.d.ts +23 -3
  148. package/build/src/ignitor/ace.js +21 -1
  149. package/build/src/ignitor/http.d.ts +16 -3
  150. package/build/src/ignitor/http.js +16 -3
  151. package/build/src/ignitor/main.d.ts +29 -6
  152. package/build/src/ignitor/main.js +30 -7
  153. package/build/src/ignitor/test.d.ts +26 -3
  154. package/build/src/ignitor/test.js +24 -1
  155. package/build/src/test_utils/http.d.ts +19 -3
  156. package/build/src/test_utils/http.js +24 -3
  157. package/build/src/test_utils/main.d.ts +22 -4
  158. package/build/src/test_utils/main.js +21 -3
  159. package/build/src/types.d.ts +283 -26
  160. package/build/src/utils.d.ts +60 -0
  161. package/build/src/utils.js +104 -0
  162. package/build/src/vine.d.ts +24 -1
  163. package/build/src/vine.js +27 -1
  164. package/build/stubs/main.js +1 -2
  165. package/build/stubs/make/transformer/main.stub +18 -0
  166. package/build/toolkit/main.js +1 -1
  167. package/build/types/common.d.ts +1 -0
  168. package/build/types/common.js +9 -0
  169. package/build/types/helpers.d.ts +2 -1
  170. package/build/types/http.d.ts +1 -0
  171. package/build/types/transformers.d.ts +1 -0
  172. package/build/types/transformers.js +9 -0
  173. package/package.json +55 -52
  174. package/build/src/helpers/parse_binding_reference.d.ts +0 -45
  175. package/build/src/helpers/parse_binding_reference.js +0 -83
  176. package/build/src/internal_helpers.d.ts +0 -15
  177. package/build/src/internal_helpers.js +0 -63
@@ -1,12 +1,31 @@
1
- import { BaseCommand } from '../../modules/ace/main.js';
2
- import { CommandOptions } from '../../types/ace.js';
1
+ import { BaseCommand } from '../../modules/ace/main.ts';
2
+ import { type CommandOptions } from '../../types/ace.ts';
3
3
  /**
4
4
  * Make a new service class
5
+ *
6
+ * @example
7
+ * ```
8
+ * ace make:service UserService
9
+ * ace make:service AuthService
10
+ * ace make:service User/ProfileService
11
+ * ```
5
12
  */
6
13
  export default class MakeService extends BaseCommand {
14
+ /**
15
+ * The command name
16
+ */
7
17
  static commandName: string;
18
+ /**
19
+ * The command description
20
+ */
8
21
  static description: string;
22
+ /**
23
+ * Command options configuration
24
+ */
9
25
  static options: CommandOptions;
26
+ /**
27
+ * Name of the service
28
+ */
10
29
  name: string;
11
30
  /**
12
31
  * The stub to use for generating the service class
@@ -12,14 +12,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
- import { stubsRoot } from '../../stubs/main.js';
16
- import { args, BaseCommand } from '../../modules/ace/main.js';
15
+ import { stubsRoot } from "../../stubs/main.js";
16
+ import { args, BaseCommand } from "../../modules/ace/main.js";
17
17
  /**
18
18
  * Make a new service class
19
+ *
20
+ * @example
21
+ * ```
22
+ * ace make:service UserService
23
+ * ace make:service AuthService
24
+ * ace make:service User/ProfileService
25
+ * ```
19
26
  */
20
27
  export default class MakeService extends BaseCommand {
28
+ /**
29
+ * The command name
30
+ */
21
31
  static commandName = 'make:service';
32
+ /**
33
+ * The command description
34
+ */
22
35
  static description = 'Create a new service class';
36
+ /**
37
+ * Command options configuration
38
+ */
23
39
  static options = {
24
40
  allowUnknownFlags: true,
25
41
  };
@@ -1,19 +1,42 @@
1
- import { BaseCommand } from '../../modules/ace/main.js';
1
+ import { BaseCommand } from '../../modules/ace/main.ts';
2
2
  /**
3
- * Make a new test file
3
+ * Command to create a new Japa test file.
4
+ * Supports multiple test suites and automatically detects or prompts for
5
+ * the appropriate suite and directory based on application configuration.
6
+ *
7
+ * @example
8
+ * ```
9
+ * ace make:test UserController
10
+ * ace make:test UserModel --suite=unit
11
+ * ace make:test AuthService --suite=integration
12
+ * ```
4
13
  */
5
14
  export default class MakeTest extends BaseCommand {
6
15
  #private;
16
+ /**
17
+ * The command name
18
+ */
7
19
  static commandName: string;
20
+ /**
21
+ * The command description
22
+ */
8
23
  static description: string;
24
+ /**
25
+ * Name of the test file to create
26
+ */
9
27
  name: string;
28
+ /**
29
+ * Test suite name where the test file should be created
30
+ */
10
31
  suite?: string;
11
32
  /**
12
- * The stub to use for generating the test file
33
+ * The stub template file to use for generating the test file
13
34
  */
14
35
  protected stubPath: string;
15
36
  /**
16
- * Executed by ace
37
+ * Execute the command to create a new test file.
38
+ * Validates the suite exists, prompts for missing information,
39
+ * and generates the test file in the appropriate location.
17
40
  */
18
41
  run(): Promise<void>;
19
42
  }
@@ -12,20 +12,39 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
- import { stubsRoot } from '../../stubs/main.js';
16
- import { args, flags, BaseCommand } from '../../modules/ace/main.js';
15
+ import { stubsRoot } from "../../stubs/main.js";
16
+ import { args, flags, BaseCommand } from "../../modules/ace/main.js";
17
17
  /**
18
- * Make a new test file
18
+ * Command to create a new Japa test file.
19
+ * Supports multiple test suites and automatically detects or prompts for
20
+ * the appropriate suite and directory based on application configuration.
21
+ *
22
+ * @example
23
+ * ```
24
+ * ace make:test UserController
25
+ * ace make:test UserModel --suite=unit
26
+ * ace make:test AuthService --suite=integration
27
+ * ```
19
28
  */
20
29
  export default class MakeTest extends BaseCommand {
30
+ /**
31
+ * The command name
32
+ */
21
33
  static commandName = 'make:test';
34
+ /**
35
+ * The command description
36
+ */
22
37
  static description = 'Create a new Japa test file';
23
38
  /**
24
- * The stub to use for generating the test file
39
+ * The stub template file to use for generating the test file
25
40
  */
26
41
  stubPath = 'make/test/main.stub';
27
42
  /**
28
- * Returns the suite name for creating the test file
43
+ * Determine the test suite name for creating the test file.
44
+ * Uses the provided suite flag, or automatically selects if only one suite exists,
45
+ * or prompts the user to choose from available suites.
46
+ *
47
+ * @returns The name of the selected test suite
29
48
  */
30
49
  async #getSuite() {
31
50
  if (this.suite) {
@@ -51,7 +70,11 @@ export default class MakeTest extends BaseCommand {
51
70
  });
52
71
  }
53
72
  /**
54
- * Returns the directory path for the selected suite.
73
+ * Determine the directory path for the test file within the selected suite.
74
+ * Automatically selects if only one directory exists, otherwise prompts the user.
75
+ *
76
+ * @param directories - Array of available directories for the suite
77
+ * @returns The selected directory path
55
78
  */
56
79
  async #getSuiteDirectory(directories) {
57
80
  if (directories.length === 1) {
@@ -64,7 +87,10 @@ export default class MakeTest extends BaseCommand {
64
87
  });
65
88
  }
66
89
  /**
67
- * Find suite info from the rcFile file
90
+ * Find suite configuration from the RC file by name.
91
+ *
92
+ * @param suiteName - The name of the suite to find
93
+ * @returns The suite configuration or undefined if not found
68
94
  */
69
95
  #findSuite(suiteName) {
70
96
  return this.app.rcFile.tests.suites.find((suite) => {
@@ -72,7 +98,9 @@ export default class MakeTest extends BaseCommand {
72
98
  });
73
99
  }
74
100
  /**
75
- * Executed by ace
101
+ * Execute the command to create a new test file.
102
+ * Validates the suite exists, prompts for missing information,
103
+ * and generates the test file in the appropriate location.
76
104
  */
77
105
  async run() {
78
106
  const suite = this.#findSuite(await this.#getSuite());
@@ -0,0 +1,43 @@
1
+ import { BaseCommand } from '../../modules/ace/main.ts';
2
+ import { type CommandOptions } from '../../types/ace.ts';
3
+ /**
4
+ * Command to create a new transformer class.
5
+ * Transformers are used to serialize data objects (like models) into specific
6
+ * formats for API responses, allowing you to control which fields are exposed
7
+ * and how data is structured for clients.
8
+ *
9
+ * @example
10
+ * ```
11
+ * ace make:transformer User
12
+ * ace make:transformer Post
13
+ * ace make:transformer ProductTransformer
14
+ * ```
15
+ */
16
+ export default class MakeTransformer extends BaseCommand {
17
+ /**
18
+ * The command name
19
+ */
20
+ static commandName: string;
21
+ /**
22
+ * The command description
23
+ */
24
+ static description: string;
25
+ /**
26
+ * Command options configuration.
27
+ * Allows unknown flags to be passed through.
28
+ */
29
+ static options: CommandOptions;
30
+ /**
31
+ * Name of the entity for which to generate the transformer
32
+ */
33
+ name: string;
34
+ /**
35
+ * The stub template file to use for generating the transformer class
36
+ */
37
+ protected stubPath: string;
38
+ /**
39
+ * Execute the command to create a new transformer class.
40
+ * Generates the transformer file with proper data serialization structure.
41
+ */
42
+ run(): Promise<void>;
43
+ }
@@ -0,0 +1,65 @@
1
+ /*
2
+ * @adonisjs/core
3
+ *
4
+ * (c) AdonisJS
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ */
9
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
10
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
12
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
14
+ };
15
+ import { stubsRoot } from "../../stubs/main.js";
16
+ import { args, BaseCommand } from "../../modules/ace/main.js";
17
+ /**
18
+ * Command to create a new transformer class.
19
+ * Transformers are used to serialize data objects (like models) into specific
20
+ * formats for API responses, allowing you to control which fields are exposed
21
+ * and how data is structured for clients.
22
+ *
23
+ * @example
24
+ * ```
25
+ * ace make:transformer User
26
+ * ace make:transformer Post
27
+ * ace make:transformer ProductTransformer
28
+ * ```
29
+ */
30
+ export default class MakeTransformer extends BaseCommand {
31
+ /**
32
+ * The command name
33
+ */
34
+ static commandName = 'make:transformer';
35
+ /**
36
+ * The command description
37
+ */
38
+ static description = 'Create a new transformer class';
39
+ /**
40
+ * Command options configuration.
41
+ * Allows unknown flags to be passed through.
42
+ */
43
+ static options = {
44
+ allowUnknownFlags: true,
45
+ };
46
+ /**
47
+ * The stub template file to use for generating the transformer class
48
+ */
49
+ stubPath = 'make/transformer/main.stub';
50
+ /**
51
+ * Execute the command to create a new transformer class.
52
+ * Generates the transformer file with proper data serialization structure.
53
+ */
54
+ async run() {
55
+ const codemods = await this.createCodemods();
56
+ await codemods.makeUsingStub(stubsRoot, this.stubPath, {
57
+ flags: this.parsed.flags,
58
+ entity: this.app.generators.createEntity(this.name),
59
+ model: this.app.generators.createEntity(this.name),
60
+ });
61
+ }
62
+ }
63
+ __decorate([
64
+ args.string({ description: 'Entity name for which to generate the transformer' })
65
+ ], MakeTransformer.prototype, "name", void 0);
@@ -1,21 +1,52 @@
1
- import { BaseCommand } from '../../modules/ace/main.js';
2
- import { CommandOptions } from '../../types/ace.js';
1
+ import { BaseCommand } from '../../modules/ace/main.ts';
2
+ import { type CommandOptions } from '../../types/ace.ts';
3
3
  /**
4
- * Make a new VineJS validator
4
+ * Command to create a new VineJS validator file.
5
+ * Validators define reusable validation schemas for request validation,
6
+ * and can be generated as simple validators or resource-based validators
7
+ * with create and update schemas.
8
+ *
9
+ * @example
10
+ * ```
11
+ * ace make:validator UserValidator
12
+ * ace make:validator PostValidator --resource
13
+ * ace make:validator ContactValidator
14
+ * ```
5
15
  */
6
16
  export default class MakeValidator extends BaseCommand {
17
+ /**
18
+ * The command name
19
+ */
7
20
  static commandName: string;
21
+ /**
22
+ * The command description
23
+ */
8
24
  static description: string;
25
+ /**
26
+ * Command options configuration.
27
+ * Allows unknown flags to be passed through.
28
+ */
9
29
  static options: CommandOptions;
30
+ /**
31
+ * Name of the validator file to create
32
+ */
10
33
  name: string;
34
+ /**
35
+ * Generate a resource validator with create and update schemas
36
+ */
11
37
  resource: boolean;
12
38
  /**
13
- * The stub to use for generating the validator
39
+ * The stub template file to use for generating the validator
14
40
  */
15
41
  protected stubPath: string;
16
42
  /**
17
- * Preparing the command state
43
+ * Prepare the command by selecting the appropriate stub based on options.
44
+ * Uses a resource stub when generating validators for CRUD operations.
18
45
  */
19
46
  prepare(): Promise<void>;
47
+ /**
48
+ * Execute the command to create a new VineJS validator file.
49
+ * Generates the validator with the appropriate stub template.
50
+ */
20
51
  run(): Promise<void>;
21
52
  }
@@ -12,23 +12,44 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
- import { stubsRoot } from '../../stubs/main.js';
16
- import { args, flags, BaseCommand } from '../../modules/ace/main.js';
15
+ import { stubsRoot } from "../../stubs/main.js";
16
+ import { args, flags, BaseCommand } from "../../modules/ace/main.js";
17
17
  /**
18
- * Make a new VineJS validator
18
+ * Command to create a new VineJS validator file.
19
+ * Validators define reusable validation schemas for request validation,
20
+ * and can be generated as simple validators or resource-based validators
21
+ * with create and update schemas.
22
+ *
23
+ * @example
24
+ * ```
25
+ * ace make:validator UserValidator
26
+ * ace make:validator PostValidator --resource
27
+ * ace make:validator ContactValidator
28
+ * ```
19
29
  */
20
30
  export default class MakeValidator extends BaseCommand {
31
+ /**
32
+ * The command name
33
+ */
21
34
  static commandName = 'make:validator';
35
+ /**
36
+ * The command description
37
+ */
22
38
  static description = 'Create a new file to define VineJS validators';
39
+ /**
40
+ * Command options configuration.
41
+ * Allows unknown flags to be passed through.
42
+ */
23
43
  static options = {
24
44
  allowUnknownFlags: true,
25
45
  };
26
46
  /**
27
- * The stub to use for generating the validator
47
+ * The stub template file to use for generating the validator
28
48
  */
29
49
  stubPath = 'make/validator/main.stub';
30
50
  /**
31
- * Preparing the command state
51
+ * Prepare the command by selecting the appropriate stub based on options.
52
+ * Uses a resource stub when generating validators for CRUD operations.
32
53
  */
33
54
  async prepare() {
34
55
  /**
@@ -38,6 +59,10 @@ export default class MakeValidator extends BaseCommand {
38
59
  this.stubPath = 'make/validator/resource.stub';
39
60
  }
40
61
  }
62
+ /**
63
+ * Execute the command to create a new VineJS validator file.
64
+ * Generates the validator with the appropriate stub template.
65
+ */
41
66
  async run() {
42
67
  const codemods = await this.createCodemods();
43
68
  await codemods.makeUsingStub(stubsRoot, this.stubPath, {
@@ -1,14 +1,37 @@
1
- import { BaseCommand } from '../../modules/ace/main.js';
1
+ import { BaseCommand } from '../../modules/ace/main.ts';
2
2
  /**
3
- * Make a new EdgeJS template file
3
+ * Command to create a new Edge.js template file.
4
+ * Edge templates are used for rendering HTML views in your web application,
5
+ * supporting layouts, partials, components, and template inheritance.
6
+ *
7
+ * @example
8
+ * ```
9
+ * ace make:view home
10
+ * ace make:view users/profile
11
+ * ace make:view components/navbar
12
+ * ace make:view layouts/app
13
+ * ```
4
14
  */
5
15
  export default class MakeView extends BaseCommand {
16
+ /**
17
+ * The command name
18
+ */
6
19
  static commandName: string;
20
+ /**
21
+ * The command description
22
+ */
7
23
  static description: string;
24
+ /**
25
+ * Name of the template file to create
26
+ */
8
27
  name: string;
9
28
  /**
10
- * The stub to use for generating the template
29
+ * The stub template file to use for generating the Edge template
11
30
  */
12
31
  protected stubPath: string;
32
+ /**
33
+ * Execute the command to create a new Edge.js template file.
34
+ * Generates the template file in the views directory.
35
+ */
13
36
  run(): Promise<void>;
14
37
  }
@@ -12,18 +12,38 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
- import { stubsRoot } from '../../stubs/main.js';
16
- import { args, BaseCommand } from '../../modules/ace/main.js';
15
+ import { stubsRoot } from "../../stubs/main.js";
16
+ import { args, BaseCommand } from "../../modules/ace/main.js";
17
17
  /**
18
- * Make a new EdgeJS template file
18
+ * Command to create a new Edge.js template file.
19
+ * Edge templates are used for rendering HTML views in your web application,
20
+ * supporting layouts, partials, components, and template inheritance.
21
+ *
22
+ * @example
23
+ * ```
24
+ * ace make:view home
25
+ * ace make:view users/profile
26
+ * ace make:view components/navbar
27
+ * ace make:view layouts/app
28
+ * ```
19
29
  */
20
30
  export default class MakeView extends BaseCommand {
31
+ /**
32
+ * The command name
33
+ */
21
34
  static commandName = 'make:view';
35
+ /**
36
+ * The command description
37
+ */
22
38
  static description = 'Create a new Edge.js template file';
23
39
  /**
24
- * The stub to use for generating the template
40
+ * The stub template file to use for generating the Edge template
25
41
  */
26
42
  stubPath = 'make/view/main.stub';
43
+ /**
44
+ * Execute the command to create a new Edge.js template file.
45
+ * Generates the template file in the views directory.
46
+ */
27
47
  async run() {
28
48
  const codemods = await this.createCodemods();
29
49
  await codemods.makeUsingStub(stubsRoot, this.stubPath, {
@@ -1,14 +1,34 @@
1
- import { BaseCommand } from '../modules/ace/main.js';
2
- import { CommandOptions } from '../types/ace.js';
1
+ import { BaseCommand } from '../modules/ace/main.ts';
2
+ import { type CommandOptions } from '../types/ace.ts';
3
3
  /**
4
- * The ReplCommand class is used to start the Repl server
4
+ * Command to start an interactive REPL (Read-Eval-Print Loop) session for AdonisJS.
5
+ * The REPL provides a command-line interface where you can execute JavaScript code
6
+ * in the context of your AdonisJS application, allowing you to interact with models,
7
+ * services, and other application components in real-time.
8
+ *
9
+ * @example
10
+ * ```
11
+ * ace repl
12
+ * ```
5
13
  */
6
14
  export default class ReplCommand extends BaseCommand {
15
+ /**
16
+ * The command name
17
+ */
7
18
  static commandName: string;
19
+ /**
20
+ * The command description
21
+ */
8
22
  static description: string;
23
+ /**
24
+ * Command options configuration.
25
+ * Requires the application to be started and keeps the process alive.
26
+ */
9
27
  static options: CommandOptions;
10
28
  /**
11
- * Starts the REPL server process
29
+ * Execute the command to start the REPL server.
30
+ * Creates a REPL instance from the container and sets up an exit handler
31
+ * that properly terminates the application when the REPL session ends.
12
32
  */
13
33
  run(): Promise<void>;
14
34
  }
@@ -6,19 +6,39 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
- import { BaseCommand } from '../modules/ace/main.js';
9
+ import { BaseCommand } from "../modules/ace/main.js";
10
10
  /**
11
- * The ReplCommand class is used to start the Repl server
11
+ * Command to start an interactive REPL (Read-Eval-Print Loop) session for AdonisJS.
12
+ * The REPL provides a command-line interface where you can execute JavaScript code
13
+ * in the context of your AdonisJS application, allowing you to interact with models,
14
+ * services, and other application components in real-time.
15
+ *
16
+ * @example
17
+ * ```
18
+ * ace repl
19
+ * ```
12
20
  */
13
21
  export default class ReplCommand extends BaseCommand {
22
+ /**
23
+ * The command name
24
+ */
14
25
  static commandName = 'repl';
26
+ /**
27
+ * The command description
28
+ */
15
29
  static description = 'Start a new REPL session';
30
+ /**
31
+ * Command options configuration.
32
+ * Requires the application to be started and keeps the process alive.
33
+ */
16
34
  static options = {
17
35
  startApp: true,
18
36
  staysAlive: true,
19
37
  };
20
38
  /**
21
- * Starts the REPL server process
39
+ * Execute the command to start the REPL server.
40
+ * Creates a REPL instance from the container and sets up an exit handler
41
+ * that properly terminates the application when the REPL session ends.
22
42
  */
23
43
  async run() {
24
44
  const repl = await this.app.container.make('repl');
@@ -1,24 +1,58 @@
1
1
  import type { DevServer } from '@adonisjs/assembler';
2
- import type { CommandOptions } from '../types/ace.js';
3
- import { BaseCommand } from '../modules/ace/main.js';
2
+ import type { CommandOptions } from '../types/ace.ts';
3
+ import { BaseCommand } from '../modules/ace/main.ts';
4
4
  /**
5
5
  * Serve command is used to run the AdonisJS HTTP server during development. The
6
6
  * command under the hood runs the "bin/server.ts" file and watches for file
7
7
  * system changes
8
+ *
9
+ * @example
10
+ * ```
11
+ * ace serve
12
+ * ace serve --watch
13
+ * ace serve --hmr
14
+ * ace serve --poll
15
+ * ace serve --no-clear
16
+ * ```
8
17
  */
9
18
  export default class Serve extends BaseCommand {
10
19
  #private;
20
+ /**
21
+ * The command name
22
+ */
11
23
  static commandName: string;
24
+ /**
25
+ * The command description
26
+ */
12
27
  static description: string;
28
+ /**
29
+ * Help text for the command
30
+ */
13
31
  static help: string[];
32
+ /**
33
+ * Command options configuration
34
+ */
14
35
  static options: CommandOptions;
36
+ /**
37
+ * The development server instance
38
+ */
15
39
  devServer: DevServer;
40
+ /**
41
+ * Start the server with HMR support
42
+ */
16
43
  hmr?: boolean;
44
+ /**
45
+ * Watch filesystem and restart the HTTP server on file change
46
+ */
17
47
  watch?: boolean;
48
+ /**
49
+ * Use polling to detect filesystem changes
50
+ */
18
51
  poll?: boolean;
52
+ /**
53
+ * Clear the terminal for new logs after file change
54
+ */
19
55
  clear?: boolean;
20
- assets?: boolean;
21
- assetsArgs?: string[];
22
56
  /**
23
57
  * Runs the HTTP server
24
58
  */