@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,37 @@
1
- import { BaseCommand } from '../modules/ace/main.js';
1
+ import { BaseCommand } from '../modules/ace/main.ts';
2
2
  /**
3
- * The eject command is used to eject templates to the user
4
- * application codebase for customizing them
3
+ * Command to eject scaffolding stubs from packages to your application root.
4
+ * This allows you to customize templates used by make commands and other
5
+ * code generation features by copying them to your local application.
6
+ *
7
+ * @example
8
+ * ```
9
+ * ace eject make/controller
10
+ * ace eject make/controller --pkg=@adonisjs/lucid
11
+ * ace eject stubs/
12
+ * ```
5
13
  */
6
14
  export default class Eject 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
+ * Path to the stubs directory or a single stub file to eject
25
+ */
9
26
  stubPath: string;
27
+ /**
28
+ * Package name to search for stubs. Defaults to @adonisjs/core
29
+ */
10
30
  pkg: string;
31
+ /**
32
+ * Execute the command to eject stubs from the specified package.
33
+ * Copies the stubs to the application root and logs success messages
34
+ * for each ejected file.
35
+ */
11
36
  run(): Promise<void>;
12
37
  }
@@ -12,22 +12,41 @@ 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 { slash } from '@poppinss/utils';
16
- import { args, BaseCommand, flags } from '../modules/ace/main.js';
15
+ import { args, BaseCommand, flags } from "../modules/ace/main.js";
16
+ import stringHelpers from "../src/helpers/string.js";
17
17
  /**
18
- * The eject command is used to eject templates to the user
19
- * application codebase for customizing them
18
+ * Command to eject scaffolding stubs from packages to your application root.
19
+ * This allows you to customize templates used by make commands and other
20
+ * code generation features by copying them to your local application.
21
+ *
22
+ * @example
23
+ * ```
24
+ * ace eject make/controller
25
+ * ace eject make/controller --pkg=@adonisjs/lucid
26
+ * ace eject stubs/
27
+ * ```
20
28
  */
21
29
  export default class Eject extends BaseCommand {
30
+ /**
31
+ * The command name
32
+ */
22
33
  static commandName = 'eject';
34
+ /**
35
+ * The command description
36
+ */
23
37
  static description = 'Eject scaffolding stubs to your application root';
38
+ /**
39
+ * Execute the command to eject stubs from the specified package.
40
+ * Copies the stubs to the application root and logs success messages
41
+ * for each ejected file.
42
+ */
24
43
  async run() {
25
44
  const stubs = await this.app.stubs.create();
26
45
  const copied = await stubs.copy(this.stubPath, {
27
46
  pkg: this.pkg,
28
47
  });
29
48
  copied.forEach((stubPath) => {
30
- this.logger.success(`eject ${slash(this.app.relativePath(stubPath))}`);
49
+ this.logger.success(`eject ${stringHelpers.toUnixSlash(this.app.relativePath(stubPath))}`);
31
50
  });
32
51
  }
33
52
  }
@@ -1,20 +1,57 @@
1
- import { CommandOptions } from '../../types/ace.js';
2
- import { BaseCommand } from '../../modules/ace/main.js';
1
+ import { type CommandOptions } from '../../types/ace.ts';
2
+ import { BaseCommand } from '../../modules/ace/main.ts';
3
3
  declare const ALLOWED_TYPES: readonly ["string", "boolean", "number", "enum"];
4
4
  type AllowedTypes = (typeof ALLOWED_TYPES)[number];
5
5
  /**
6
- * The env:add command is used to add a new environment variable to the
7
- * `.env`, `.env.example` and `start/env.ts` files.
6
+ * Command to add a new environment variable to the application.
7
+ * Updates .env, .env.example, and start/env.ts files with the new variable,
8
+ * including appropriate validation schema based on the variable type.
9
+ *
10
+ * @example
11
+ * ```
12
+ * ace env:add
13
+ * ace env:add DATABASE_URL postgres://localhost:5432/mydb
14
+ * ace env:add API_KEY secret --type=string
15
+ * ace env:add PORT 3333 --type=number
16
+ * ace env:add DEBUG true --type=boolean
17
+ * ace env:add LOG_LEVEL info --type=enum --enum-values=debug,info,warn,error
18
+ * ```
8
19
  */
9
20
  export default class EnvAdd extends BaseCommand {
10
21
  #private;
22
+ /**
23
+ * The command name
24
+ */
11
25
  static commandName: string;
26
+ /**
27
+ * The command description
28
+ */
12
29
  static description: string;
30
+ /**
31
+ * Command options configuration.
32
+ * Allows unknown flags to be passed through.
33
+ */
13
34
  static options: CommandOptions;
35
+ /**
36
+ * Environment variable name (will be converted to SCREAMING_SNAKE_CASE)
37
+ */
14
38
  name: string;
39
+ /**
40
+ * Environment variable value
41
+ */
15
42
  value: string;
43
+ /**
44
+ * Data type of the environment variable (string, boolean, number, enum)
45
+ */
16
46
  type: AllowedTypes;
47
+ /**
48
+ * Allowed values for enum type variables
49
+ */
17
50
  enumValues: string[];
51
+ /**
52
+ * Execute the command to add a new environment variable.
53
+ * Prompts for missing values, validates inputs, and updates all relevant files.
54
+ */
18
55
  run(): Promise<void>;
19
56
  }
20
57
  export {};
@@ -12,25 +12,52 @@ 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 stringHelpers from '../../src/helpers/string.js';
16
- import { args, BaseCommand, flags } from '../../modules/ace/main.js';
15
+ import stringHelpers from "../../src/helpers/string.js";
16
+ import { args, BaseCommand, flags } from "../../modules/ace/main.js";
17
17
  const ALLOWED_TYPES = ['string', 'boolean', 'number', 'enum'];
18
18
  /**
19
- * The env:add command is used to add a new environment variable to the
20
- * `.env`, `.env.example` and `start/env.ts` files.
19
+ * Command to add a new environment variable to the application.
20
+ * Updates .env, .env.example, and start/env.ts files with the new variable,
21
+ * including appropriate validation schema based on the variable type.
22
+ *
23
+ * @example
24
+ * ```
25
+ * ace env:add
26
+ * ace env:add DATABASE_URL postgres://localhost:5432/mydb
27
+ * ace env:add API_KEY secret --type=string
28
+ * ace env:add PORT 3333 --type=number
29
+ * ace env:add DEBUG true --type=boolean
30
+ * ace env:add LOG_LEVEL info --type=enum --enum-values=debug,info,warn,error
31
+ * ```
21
32
  */
22
33
  export default class EnvAdd extends BaseCommand {
34
+ /**
35
+ * The command name
36
+ */
23
37
  static commandName = 'env:add';
38
+ /**
39
+ * The command description
40
+ */
24
41
  static description = 'Add a new environment variable';
42
+ /**
43
+ * Command options configuration.
44
+ * Allows unknown flags to be passed through.
45
+ */
25
46
  static options = {
26
47
  allowUnknownFlags: true,
27
48
  };
28
49
  /**
29
- * Validate the type flag passed by the user
50
+ * Validate that the provided type is one of the allowed types.
51
+ *
52
+ * @returns True if the type is valid, false otherwise
30
53
  */
31
54
  #isTypeFlagValid() {
32
55
  return ALLOWED_TYPES.includes(this.type);
33
56
  }
57
+ /**
58
+ * Execute the command to add a new environment variable.
59
+ * Prompts for missing values, validates inputs, and updates all relevant files.
60
+ */
34
61
  async run() {
35
62
  /**
36
63
  * Prompt for missing name
@@ -1,12 +1,31 @@
1
- import { BaseCommand } from '../modules/ace/main.js';
1
+ import { BaseCommand } from '../modules/ace/main.ts';
2
2
  /**
3
3
  * The generate key command is used to generate the app key
4
4
  * and write it inside the .env file.
5
+ *
6
+ * @example
7
+ * ```
8
+ * ace generate:key
9
+ * ace generate:key --show
10
+ * ace generate:key --force
11
+ * ```
5
12
  */
6
13
  export default class GenerateKey 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
+ * Display the key on the terminal, instead of writing it to .env file
24
+ */
9
25
  show: boolean;
26
+ /**
27
+ * Force update .env file in production environment
28
+ */
10
29
  force: boolean;
11
30
  run(): Promise<void>;
12
31
  }
@@ -14,13 +14,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
14
14
  };
15
15
  import string from '@poppinss/utils/string';
16
16
  import { EnvEditor } from '@adonisjs/env/editor';
17
- import { BaseCommand, flags } from '../modules/ace/main.js';
17
+ import { BaseCommand, flags } from "../modules/ace/main.js";
18
18
  /**
19
19
  * The generate key command is used to generate the app key
20
20
  * and write it inside the .env file.
21
+ *
22
+ * @example
23
+ * ```
24
+ * ace generate:key
25
+ * ace generate:key --show
26
+ * ace generate:key --force
27
+ * ```
21
28
  */
22
29
  export default class GenerateKey extends BaseCommand {
30
+ /**
31
+ * The command name
32
+ */
23
33
  static commandName = 'generate:key';
34
+ /**
35
+ * The command description
36
+ */
24
37
  static description = 'Generate a cryptographically secure random application key';
25
38
  async run() {
26
39
  let writeToFile = process.env.NODE_ENV !== 'production';
@@ -1,9 +1,27 @@
1
- import { BaseCommand } from '../modules/ace/main.js';
1
+ import { BaseCommand } from '../modules/ace/main.ts';
2
2
  /**
3
- * Prints the RcFile file contents to the terminal
3
+ * Command to inspect and display the AdonisJS RC file contents with default values.
4
+ * The RC file contains configuration for providers, preloads, commands, and other
5
+ * application settings. This command formats and displays the contents in a readable JSON format.
6
+ *
7
+ * @example
8
+ * ```
9
+ * ace inspect:rcfile
10
+ * ```
4
11
  */
5
12
  export default class InspectRCFile extends BaseCommand {
13
+ /**
14
+ * The command name
15
+ */
6
16
  static commandName: string;
17
+ /**
18
+ * The command description
19
+ */
7
20
  static description: string;
21
+ /**
22
+ * Execute the command to display RC file contents.
23
+ * Transforms provider, preload, and command entries to display their file paths
24
+ * as strings and formats the output as readable JSON.
25
+ */
8
26
  run(): Promise<void>;
9
27
  }
@@ -6,13 +6,31 @@
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
- * Prints the RcFile file contents to the terminal
11
+ * Command to inspect and display the AdonisJS RC file contents with default values.
12
+ * The RC file contains configuration for providers, preloads, commands, and other
13
+ * application settings. This command formats and displays the contents in a readable JSON format.
14
+ *
15
+ * @example
16
+ * ```
17
+ * ace inspect:rcfile
18
+ * ```
12
19
  */
13
20
  export default class InspectRCFile extends BaseCommand {
21
+ /**
22
+ * The command name
23
+ */
14
24
  static commandName = 'inspect:rcfile';
25
+ /**
26
+ * The command description
27
+ */
15
28
  static description = 'Inspect the RC file with its default values';
29
+ /**
30
+ * Execute the command to display RC file contents.
31
+ * Transforms provider, preload, and command entries to display their file paths
32
+ * as strings and formats the output as readable JSON.
33
+ */
16
34
  async run() {
17
35
  const { raw, providers, preloads, commands, ...rest } = this.app.rcFile;
18
36
  this.logger.log(JSON.stringify({
@@ -1,36 +1,58 @@
1
- import type { CommandOptions } from '../../types/ace.js';
2
- import { BaseCommand } from '../../modules/ace/main.js';
1
+ import type { CommandOptions } from '../../types/ace.ts';
2
+ import { BaseCommand } from '../../modules/ace/main.ts';
3
3
  /**
4
- * The list routes command is used to view the list of registered routes
4
+ * Command to display a list of all registered routes in the application.
5
+ * Supports filtering by keywords, middleware, and output formatting options.
6
+ * Routes can be displayed as a formatted list, table, or JSON.
7
+ *
8
+ * @example
9
+ * ```
10
+ * ace list:routes
11
+ * ace list:routes user
12
+ * ace list:routes --middleware=auth
13
+ * ace list:routes --ignore-middleware=guest
14
+ * ace list:routes --json
15
+ * ace list:routes --table
16
+ * ```
5
17
  */
6
18
  export default class ListRoutes extends BaseCommand {
19
+ /**
20
+ * The command name
21
+ */
7
22
  static commandName: string;
23
+ /**
24
+ * The command description
25
+ */
8
26
  static description: string;
9
27
  /**
10
- * Making sure to start the application so that the routes are
11
- * imported
28
+ * Command options configuration.
29
+ * Requires the application to be started so routes are loaded.
12
30
  */
13
31
  static options: CommandOptions;
14
32
  /**
15
- * The match filter is used to find route by name, pattern and controller name that
16
- * includes the match keyword
33
+ * Keyword to match against route names, patterns, and controller names
17
34
  */
18
35
  match: string;
19
36
  /**
20
- * The middleware flag searches for the routes using all the mentioned middleware
37
+ * Filter routes that include all specified middleware names
21
38
  */
22
39
  middleware: string[];
23
40
  /**
24
- * The ignoreMiddleware flag searches for the routes not using all the mentioned middleware
41
+ * Filter routes that do not include all specified middleware names
25
42
  */
26
43
  ignoreMiddleware: string[];
27
44
  /**
28
- * The json flag is used to view list of routes as a JSON string.
45
+ * Output routes as JSON format
29
46
  */
30
47
  json: boolean;
31
48
  /**
32
- * The table flag is used to view list of routes as a classic CLI table
49
+ * Output routes as a CLI table format
33
50
  */
34
51
  table: boolean;
52
+ /**
53
+ * Execute the command to list application routes.
54
+ * Creates a formatter with the specified filters and outputs routes
55
+ * in the requested format (JSON, table, or formatted list).
56
+ */
35
57
  run(): Promise<void>;
36
58
  }
@@ -12,21 +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 { args, BaseCommand, flags } from '../../modules/ace/main.js';
16
- import { RoutesListFormatter } from '../../src/cli_formatters/routes_list.js';
15
+ import { args, BaseCommand, flags } from "../../modules/ace/main.js";
16
+ import { RoutesListFormatter } from "../../src/cli_formatters/routes_list.js";
17
17
  /**
18
- * The list routes command is used to view the list of registered routes
18
+ * Command to display a list of all registered routes in the application.
19
+ * Supports filtering by keywords, middleware, and output formatting options.
20
+ * Routes can be displayed as a formatted list, table, or JSON.
21
+ *
22
+ * @example
23
+ * ```
24
+ * ace list:routes
25
+ * ace list:routes user
26
+ * ace list:routes --middleware=auth
27
+ * ace list:routes --ignore-middleware=guest
28
+ * ace list:routes --json
29
+ * ace list:routes --table
30
+ * ```
19
31
  */
20
32
  export default class ListRoutes extends BaseCommand {
33
+ /**
34
+ * The command name
35
+ */
21
36
  static commandName = 'list:routes';
37
+ /**
38
+ * The command description
39
+ */
22
40
  static description = 'List application routes. This command will boot the application in the console environment';
23
41
  /**
24
- * Making sure to start the application so that the routes are
25
- * imported
42
+ * Command options configuration.
43
+ * Requires the application to be started so routes are loaded.
26
44
  */
27
45
  static options = {
28
46
  startApp: true,
29
47
  };
48
+ /**
49
+ * Execute the command to list application routes.
50
+ * Creates a formatter with the specified filters and outputs routes
51
+ * in the requested format (JSON, table, or formatted list).
52
+ */
30
53
  async run() {
31
54
  const router = await this.app.container.make('router');
32
55
  const formatter = new RoutesListFormatter(router, this.ui, {}, {
@@ -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 ace command
3
+ * Command to create a new Ace command class.
4
+ * Ace commands are CLI commands that can be executed via the `ace` binary,
5
+ * allowing you to create custom functionality for your application's command line interface.
6
+ *
7
+ * @example
8
+ * ```
9
+ * ace make:command SendEmails
10
+ * ace make:command ProcessPayments
11
+ * ace make:command GenerateReports
12
+ * ace make:command CleanupFiles
13
+ * ```
4
14
  */
5
15
  export default class MakeCommand 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 command class to create
26
+ */
8
27
  name: string;
9
28
  /**
10
- * The stub to use for generating the command class
29
+ * The stub template file to use for generating the command class
11
30
  */
12
31
  protected stubPath: string;
32
+ /**
33
+ * Execute the command to create a new Ace command class.
34
+ * Generates the command file with proper CLI command structure.
35
+ */
13
36
  run(): Promise<void>;
14
37
  }
@@ -12,19 +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 } from '../../modules/ace/main.js';
17
- import { BaseCommand } from '../../modules/ace/main.js';
15
+ import { stubsRoot } from "../../stubs/main.js";
16
+ import { args } from "../../modules/ace/main.js";
17
+ import { BaseCommand } from "../../modules/ace/main.js";
18
18
  /**
19
- * Make a new ace command
19
+ * Command to create a new Ace command class.
20
+ * Ace commands are CLI commands that can be executed via the `ace` binary,
21
+ * allowing you to create custom functionality for your application's command line interface.
22
+ *
23
+ * @example
24
+ * ```
25
+ * ace make:command SendEmails
26
+ * ace make:command ProcessPayments
27
+ * ace make:command GenerateReports
28
+ * ace make:command CleanupFiles
29
+ * ```
20
30
  */
21
31
  export default class MakeCommand extends BaseCommand {
32
+ /**
33
+ * The command name
34
+ */
22
35
  static commandName = 'make:command';
36
+ /**
37
+ * The command description
38
+ */
23
39
  static description = 'Create a new ace command class';
24
40
  /**
25
- * The stub to use for generating the command class
41
+ * The stub template file to use for generating the command class
26
42
  */
27
43
  stubPath = 'make/command/main.stub';
44
+ /**
45
+ * Execute the command to create a new Ace command class.
46
+ * Generates the command file with proper CLI command structure.
47
+ */
28
48
  async run() {
29
49
  const codemods = await this.createCodemods();
30
50
  await codemods.makeUsingStub(stubsRoot, this.stubPath, {
@@ -1,16 +1,49 @@
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
  * The make controller command to create an HTTP controller
5
+ *
6
+ * @example
7
+ * ```
8
+ * ace make:controller User
9
+ * ace make:controller User store update
10
+ * ace make:controller User --resource
11
+ * ace make:controller User --api
12
+ * ace make:controller User --singular
13
+ * ```
5
14
  */
6
15
  export default class MakeController extends BaseCommand {
16
+ /**
17
+ * The command name
18
+ */
7
19
  static commandName: string;
20
+ /**
21
+ * The command description
22
+ */
8
23
  static description: string;
24
+ /**
25
+ * Command options configuration
26
+ */
9
27
  static options: CommandOptions;
28
+ /**
29
+ * The name of the controller
30
+ */
10
31
  name: string;
32
+ /**
33
+ * Create controller with custom method names
34
+ */
11
35
  actions?: string[];
36
+ /**
37
+ * Generate controller in singular form
38
+ */
12
39
  singular: boolean;
40
+ /**
41
+ * Generate resourceful controller with methods to perform CRUD actions on a resource
42
+ */
13
43
  resource: boolean;
44
+ /**
45
+ * Generate resourceful controller without the "edit" and the "create" methods
46
+ */
14
47
  api: boolean;
15
48
  /**
16
49
  * The stub to use for generating the controller
@@ -13,14 +13,32 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
15
  import string from '@poppinss/utils/string';
16
- import { stubsRoot } from '../../stubs/main.js';
17
- import { args, flags, BaseCommand } from '../../modules/ace/main.js';
16
+ import { stubsRoot } from "../../stubs/main.js";
17
+ import { args, flags, BaseCommand } from "../../modules/ace/main.js";
18
18
  /**
19
19
  * The make controller command to create an HTTP controller
20
+ *
21
+ * @example
22
+ * ```
23
+ * ace make:controller User
24
+ * ace make:controller User store update
25
+ * ace make:controller User --resource
26
+ * ace make:controller User --api
27
+ * ace make:controller User --singular
28
+ * ```
20
29
  */
21
30
  export default class MakeController extends BaseCommand {
31
+ /**
32
+ * The command name
33
+ */
22
34
  static commandName = 'make:controller';
35
+ /**
36
+ * The command description
37
+ */
23
38
  static description = 'Create a new HTTP controller class';
39
+ /**
40
+ * Command options configuration
41
+ */
24
42
  static options = {
25
43
  allowUnknownFlags: true,
26
44
  };