@adonisjs/core 7.0.0-next.10 → 7.0.0-next.12

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 (181) hide show
  1. package/build/ace-DDzvaSs_.js +16 -0
  2. package/build/app-B6oge7b3.js +5 -0
  3. package/build/app-BK0PN3li.js +5 -0
  4. package/build/bodyparser_middleware-DTW0epKM.js +3 -0
  5. package/build/chunk-MjwdjG2f.js +32 -0
  6. package/build/commands/add.js +40 -110
  7. package/build/commands/build.js +51 -107
  8. package/build/commands/configure.js +82 -177
  9. package/build/commands/eject.js +17 -60
  10. package/build/commands/env/add.js +55 -134
  11. package/build/commands/generate_key.js +22 -66
  12. package/build/commands/inspect_rcfile.js +27 -55
  13. package/build/commands/list/routes.js +246 -116
  14. package/build/commands/make/command.js +15 -57
  15. package/build/commands/make/controller.js +43 -120
  16. package/build/commands/make/event.js +16 -62
  17. package/build/commands/make/exception.js +16 -62
  18. package/build/commands/make/listener.js +36 -93
  19. package/build/commands/make/middleware.js +41 -101
  20. package/build/commands/make/preload.js +47 -113
  21. package/build/commands/make/provider.js +47 -112
  22. package/build/commands/make/service.js +16 -55
  23. package/build/commands/make/test.js +47 -132
  24. package/build/commands/make/transformer.js +17 -64
  25. package/build/commands/make/validator.js +20 -80
  26. package/build/commands/make/view.js +15 -56
  27. package/build/commands/repl.js +17 -50
  28. package/build/commands/serve.js +80 -150
  29. package/build/commands/test.js +92 -202
  30. package/build/config-B2S2xfmN.js +5 -0
  31. package/build/config_provider-CY-xuo2R.js +13 -0
  32. package/build/container-ClFvcykQ.js +5 -0
  33. package/build/core-CNNCwlhc.js +95 -0
  34. package/build/create_kernel-B7zWS8Zz.js +38 -0
  35. package/build/create_kernel-CsTq0pWc.js +3 -0
  36. package/build/debug-DURPi9xn.js +3 -0
  37. package/build/decorate-DM0Sx1ye.js +7 -0
  38. package/build/dumper-C_sMcyFb.js +147 -0
  39. package/build/edge-LQdCc1L3.js +47 -0
  40. package/build/encryption-D2HGu0bU.js +5 -0
  41. package/build/events-B8hK42QT.js +5 -0
  42. package/build/factories/app.js +2 -9
  43. package/build/factories/bodyparser.js +2 -9
  44. package/build/factories/core/ace.js +15 -46
  45. package/build/factories/core/ignitor.js +12 -180
  46. package/build/factories/core/main.js +22 -11
  47. package/build/factories/core/test_utils.js +19 -43
  48. package/build/factories/encryption.js +2 -9
  49. package/build/factories/events.js +2 -9
  50. package/build/factories/hash.js +2 -9
  51. package/build/factories/http.js +2 -9
  52. package/build/factories/logger.js +2 -9
  53. package/build/factories/stubs.js +28 -91
  54. package/build/ignitor-Dil-rtCo.js +63 -0
  55. package/build/index.js +13 -46
  56. package/build/logger-Dha-0hp1.js +13 -0
  57. package/build/main-2-nm3TiB.js +72 -0
  58. package/build/main-BTUXw6He.js +171 -0
  59. package/build/main-BWftwyAK.js +81 -0
  60. package/build/main-BrJQ1VAM.js +52 -0
  61. package/build/main-CFmDHDls.js +35 -0
  62. package/build/main-D5xz2ZN1.js +5 -0
  63. package/build/main-kn40V-hF.js +2 -0
  64. package/build/main-q9TMzWUj.js +5 -0
  65. package/build/modules/ace/codemods.js +222 -477
  66. package/build/modules/ace/main.js +2 -41
  67. package/build/modules/app.js +4 -26
  68. package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
  69. package/build/modules/bodyparser/main.js +4 -9
  70. package/build/modules/config.js +4 -26
  71. package/build/modules/container.js +4 -9
  72. package/build/modules/dumper/main.js +6 -32
  73. package/build/modules/dumper/plugins/edge.js +2 -62
  74. package/build/modules/encryption.js +4 -26
  75. package/build/modules/env/editor.js +2 -9
  76. package/build/modules/env/main.js +2 -28
  77. package/build/modules/events.js +4 -9
  78. package/build/modules/hash/drivers/argon.js +2 -9
  79. package/build/modules/hash/drivers/bcrypt.js +2 -20
  80. package/build/modules/hash/drivers/scrypt.js +2 -9
  81. package/build/modules/hash/main.js +6 -28
  82. package/build/modules/hash/phc_formatter.js +2 -9
  83. package/build/modules/health.js +2 -9
  84. package/build/modules/http/main.js +4 -15
  85. package/build/modules/http/url_builder_client.js +2 -9
  86. package/build/modules/logger.d.ts +30 -0
  87. package/build/modules/logger.js +4 -9
  88. package/build/modules/repl.js +4 -9
  89. package/build/modules/transformers/main.js +4 -9
  90. package/build/providers/app_provider.js +147 -359
  91. package/build/providers/edge_provider.js +97 -165
  92. package/build/providers/hash_provider.js +29 -91
  93. package/build/providers/repl_provider.js +61 -152
  94. package/build/providers/vinejs_provider.d.ts +1 -1
  95. package/build/providers/vinejs_provider.js +20 -66
  96. package/build/repl-CumYg2V_.js +5 -0
  97. package/build/services/ace.js +2 -17
  98. package/build/services/app.js +2 -21
  99. package/build/services/config.js +2 -13
  100. package/build/services/dumper.js +5 -21
  101. package/build/services/emitter.js +2 -14
  102. package/build/services/encryption.js +2 -14
  103. package/build/services/hash.js +2 -14
  104. package/build/services/logger.js +2 -14
  105. package/build/services/repl.js +2 -14
  106. package/build/services/router.js +2 -14
  107. package/build/services/server.js +2 -14
  108. package/build/services/test_utils.js +2 -17
  109. package/build/services/url_builder.js +5 -17
  110. package/build/src/exceptions.js +2 -49
  111. package/build/src/helpers/assert.js +2 -55
  112. package/build/src/helpers/http.js +2 -28
  113. package/build/src/helpers/is.js +3 -31
  114. package/build/src/helpers/main.js +5 -52
  115. package/build/src/helpers/string.js +2 -78
  116. package/build/src/helpers/types.js +26 -135
  117. package/build/src/helpers/verification_token.js +2 -120
  118. package/build/src/test_utils/main.js +5 -77
  119. package/build/src/types.js +0 -8
  120. package/build/src/vine.js +2 -105
  121. package/build/string-CJ7ewUFq.js +28 -0
  122. package/build/test_utils-c_TEaEHW.js +10 -0
  123. package/build/toolkit/main.js +19 -21
  124. package/build/types/ace.js +2 -9
  125. package/build/types/app.js +2 -9
  126. package/build/types/bodyparser.js +2 -9
  127. package/build/types/common.js +2 -9
  128. package/build/types/container.js +2 -9
  129. package/build/types/encryption.js +2 -9
  130. package/build/types/events.js +2 -9
  131. package/build/types/hash.js +2 -9
  132. package/build/types/health.js +2 -9
  133. package/build/types/helpers.js +0 -8
  134. package/build/types/http.js +2 -9
  135. package/build/types/logger.js +2 -9
  136. package/build/types/repl.js +2 -9
  137. package/build/types/transformers.js +2 -9
  138. package/build/utils-CNQ4tlGM.js +41 -0
  139. package/build/verification_token-DXsW81rl.js +46 -0
  140. package/build/vine-Bt4ymkM0.js +32 -0
  141. package/package.json +81 -31
  142. package/build/modules/ace/commands.js +0 -157
  143. package/build/modules/ace/create_kernel.js +0 -91
  144. package/build/modules/ace/kernel.js +0 -40
  145. package/build/modules/dumper/define_config.js +0 -36
  146. package/build/modules/dumper/dumper.js +0 -266
  147. package/build/modules/dumper/errors.js +0 -119
  148. package/build/modules/hash/define_config.js +0 -125
  149. package/build/modules/http/request_validator.js +0 -100
  150. package/build/src/assembler_hooks/index_entities.js +0 -112
  151. package/build/src/cli_formatters/routes_list.js +0 -397
  152. package/build/src/config_provider.js +0 -71
  153. package/build/src/debug.js +0 -25
  154. package/build/src/ignitor/ace.js +0 -102
  155. package/build/src/ignitor/http.js +0 -159
  156. package/build/src/ignitor/main.js +0 -124
  157. package/build/src/ignitor/test.js +0 -66
  158. package/build/src/test_utils/http.js +0 -82
  159. package/build/src/utils.js +0 -114
  160. package/build/stubs/main.js +0 -9
  161. package/build/toolkit/commands/index_commands.js +0 -30
  162. /package/build/{stubs/make → make}/command/main.stub +0 -0
  163. /package/build/{stubs/make → make}/controller/actions.stub +0 -0
  164. /package/build/{stubs/make → make}/controller/api.stub +0 -0
  165. /package/build/{stubs/make → make}/controller/main.stub +0 -0
  166. /package/build/{stubs/make → make}/controller/resource.stub +0 -0
  167. /package/build/{stubs/make → make}/event/main.stub +0 -0
  168. /package/build/{stubs/make → make}/exception/main.stub +0 -0
  169. /package/build/{stubs/make → make}/health/controller.stub +0 -0
  170. /package/build/{stubs/make → make}/health/main.stub +0 -0
  171. /package/build/{stubs/make → make}/listener/for_event.stub +0 -0
  172. /package/build/{stubs/make → make}/listener/main.stub +0 -0
  173. /package/build/{stubs/make → make}/middleware/main.stub +0 -0
  174. /package/build/{stubs/make → make}/preload/main.stub +0 -0
  175. /package/build/{stubs/make → make}/provider/main.stub +0 -0
  176. /package/build/{stubs/make → make}/service/main.stub +0 -0
  177. /package/build/{stubs/make → make}/test/main.stub +0 -0
  178. /package/build/{stubs/make → make}/transformer/main.stub +0 -0
  179. /package/build/{stubs/make → make}/validator/main.stub +0 -0
  180. /package/build/{stubs/make → make}/validator/resource.stub +0 -0
  181. /package/build/{stubs/make → make}/view/main.stub +0 -0
@@ -1,61 +1,18 @@
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;
1
+ import { t as string_default } from "../string-CJ7ewUFq.js";
2
+ import { f as BaseCommand, l as flags, o as args } from "../main-BWftwyAK.js";
3
+ import { t as __decorate } from "../decorate-DM0Sx1ye.js";
4
+ var Eject = class extends BaseCommand {
5
+ static commandName = "eject";
6
+ static description = "Eject scaffolding stubs to your application root";
7
+ async run() {
8
+ (await (await this.app.stubs.create()).copy(this.stubPath, { pkg: this.pkg })).forEach((stubPath) => {
9
+ this.logger.success(`eject ${string_default.toUnixSlash(this.app.relativePath(stubPath))}`);
10
+ });
11
+ }
14
12
  };
15
- import { args, BaseCommand, flags } from "../modules/ace/main.js";
16
- import stringHelpers from "../src/helpers/string.js";
17
- /**
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
- * ```
28
- */
29
- export default class Eject extends BaseCommand {
30
- /**
31
- * The command name
32
- */
33
- static commandName = 'eject';
34
- /**
35
- * The command description
36
- */
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
- */
43
- async run() {
44
- const stubs = await this.app.stubs.create();
45
- const copied = await stubs.copy(this.stubPath, {
46
- pkg: this.pkg,
47
- });
48
- copied.forEach((stubPath) => {
49
- this.logger.success(`eject ${stringHelpers.toUnixSlash(this.app.relativePath(stubPath))}`);
50
- });
51
- }
52
- }
53
- __decorate([
54
- args.string({ description: 'Path to the stubs directory or a single stub file' })
55
- ], Eject.prototype, "stubPath", void 0);
56
- __decorate([
57
- flags.string({
58
- description: 'Mention package name for searching stubs',
59
- default: '@adonisjs/core',
60
- })
61
- ], Eject.prototype, "pkg", void 0);
13
+ __decorate([args.string({ description: "Path to the stubs directory or a single stub file" })], Eject.prototype, "stubPath", void 0);
14
+ __decorate([flags.string({
15
+ description: "Mention package name for searching stubs",
16
+ default: "@adonisjs/core"
17
+ })], Eject.prototype, "pkg", void 0);
18
+ export { Eject as default };
@@ -1,135 +1,56 @@
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;
1
+ import { t as string_default } from "../../string-CJ7ewUFq.js";
2
+ import { f as BaseCommand, l as flags, o as args } from "../../main-BWftwyAK.js";
3
+ import { t as __decorate } from "../../decorate-DM0Sx1ye.js";
4
+ const ALLOWED_TYPES = [
5
+ "string",
6
+ "boolean",
7
+ "number",
8
+ "enum"
9
+ ];
10
+ var EnvAdd = class extends BaseCommand {
11
+ static commandName = "env:add";
12
+ static description = "Add a new environment variable";
13
+ static options = { allowUnknownFlags: true };
14
+ #isTypeFlagValid() {
15
+ return ALLOWED_TYPES.includes(this.type);
16
+ }
17
+ async run() {
18
+ if (!this.name) this.name = await this.prompt.ask("Enter the variable name", {
19
+ validate: (value) => !!value,
20
+ format: (value) => string_default.snakeCase(value).toUpperCase()
21
+ });
22
+ if (!this.value) this.value = await this.prompt.ask("Enter the variable value");
23
+ if (!this.type) this.type = await this.prompt.choice("Select the variable type", ALLOWED_TYPES);
24
+ if (this.type === "enum" && !this.enumValues) this.enumValues = await this.prompt.ask("Enter the enum values separated by a comma", { result: (value) => value.split(",").map((one) => one.trim()) });
25
+ if (!this.#isTypeFlagValid()) {
26
+ this.logger.error(`Invalid type "${this.type}". Must be one of ${ALLOWED_TYPES.join(", ")}`);
27
+ return;
28
+ }
29
+ const codemods = await this.createCodemods();
30
+ const transformedName = string_default.snakeCase(this.name).toUpperCase();
31
+ await codemods.defineEnvVariables({ [transformedName]: this.value }, { omitFromExample: [transformedName] });
32
+ const validation = {
33
+ string: "Env.schema.string()",
34
+ number: "Env.schema.number()",
35
+ boolean: "Env.schema.boolean()",
36
+ enum: `Env.schema.enum(['${this.enumValues.join("','")}'] as const)`
37
+ }[this.type];
38
+ await codemods.defineEnvValidations({ variables: { [transformedName]: validation } });
39
+ this.logger.success("Environment variable added successfully");
40
+ }
14
41
  };
15
- import stringHelpers from "../../src/helpers/string.js";
16
- import { args, BaseCommand, flags } from "../../modules/ace/main.js";
17
- const ALLOWED_TYPES = ['string', 'boolean', 'number', 'enum'];
18
- /**
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
- * ```
32
- */
33
- export default class EnvAdd extends BaseCommand {
34
- /**
35
- * The command name
36
- */
37
- static commandName = 'env:add';
38
- /**
39
- * The command description
40
- */
41
- static description = 'Add a new environment variable';
42
- /**
43
- * Command options configuration.
44
- * Allows unknown flags to be passed through.
45
- */
46
- static options = {
47
- allowUnknownFlags: true,
48
- };
49
- /**
50
- * Validate that the provided type is one of the allowed types.
51
- *
52
- * @returns True if the type is valid, false otherwise
53
- */
54
- #isTypeFlagValid() {
55
- return ALLOWED_TYPES.includes(this.type);
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
- */
61
- async run() {
62
- /**
63
- * Prompt for missing name
64
- */
65
- if (!this.name) {
66
- this.name = await this.prompt.ask('Enter the variable name', {
67
- validate: (value) => !!value,
68
- format: (value) => stringHelpers.snakeCase(value).toUpperCase(),
69
- });
70
- }
71
- /**
72
- * Prompt for missing value
73
- */
74
- if (!this.value) {
75
- this.value = await this.prompt.ask('Enter the variable value');
76
- }
77
- /**
78
- * Prompt for missing type
79
- */
80
- if (!this.type) {
81
- this.type = await this.prompt.choice('Select the variable type', ALLOWED_TYPES);
82
- }
83
- /**
84
- * Prompt for missing enum values if the selected env type is `enum`
85
- */
86
- if (this.type === 'enum' && !this.enumValues) {
87
- this.enumValues = await this.prompt.ask('Enter the enum values separated by a comma', {
88
- result: (value) => value.split(',').map((one) => one.trim()),
89
- });
90
- }
91
- /**
92
- * Validate inputs
93
- */
94
- if (!this.#isTypeFlagValid()) {
95
- this.logger.error(`Invalid type "${this.type}". Must be one of ${ALLOWED_TYPES.join(', ')}`);
96
- return;
97
- }
98
- /**
99
- * Add the environment variable to the `.env` and `.env.example` files
100
- */
101
- const codemods = await this.createCodemods();
102
- const transformedName = stringHelpers.snakeCase(this.name).toUpperCase();
103
- await codemods.defineEnvVariables({ [transformedName]: this.value }, { omitFromExample: [transformedName] });
104
- /**
105
- * Add the environment variable to the `start/env.ts` file
106
- */
107
- const validation = {
108
- string: 'Env.schema.string()',
109
- number: 'Env.schema.number()',
110
- boolean: 'Env.schema.boolean()',
111
- enum: `Env.schema.enum(['${this.enumValues.join("','")}'] as const)`,
112
- }[this.type];
113
- await codemods.defineEnvValidations({ variables: { [transformedName]: validation } });
114
- this.logger.success('Environment variable added successfully');
115
- }
116
- }
117
- __decorate([
118
- args.string({
119
- description: 'Variable name. Will be converted to screaming snake case',
120
- required: false,
121
- })
122
- ], EnvAdd.prototype, "name", void 0);
123
- __decorate([
124
- args.string({ description: 'Variable value', required: false })
125
- ], EnvAdd.prototype, "value", void 0);
126
- __decorate([
127
- flags.string({ description: 'Type of the variable' })
128
- ], EnvAdd.prototype, "type", void 0);
129
- __decorate([
130
- flags.array({
131
- description: 'Allowed values for the enum type in a comma-separated list',
132
- default: [''],
133
- required: false,
134
- })
135
- ], EnvAdd.prototype, "enumValues", void 0);
42
+ __decorate([args.string({
43
+ description: "Variable name. Will be converted to screaming snake case",
44
+ required: false
45
+ })], EnvAdd.prototype, "name", void 0);
46
+ __decorate([args.string({
47
+ description: "Variable value",
48
+ required: false
49
+ })], EnvAdd.prototype, "value", void 0);
50
+ __decorate([flags.string({ description: "Type of the variable" })], EnvAdd.prototype, "type", void 0);
51
+ __decorate([flags.array({
52
+ description: "Allowed values for the enum type in a comma-separated list",
53
+ default: [""],
54
+ required: false
55
+ })], EnvAdd.prototype, "enumValues", void 0);
56
+ export { EnvAdd as default };
@@ -1,67 +1,23 @@
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;
1
+ import { f as BaseCommand, l as flags } from "../main-BWftwyAK.js";
2
+ import { t as __decorate } from "../decorate-DM0Sx1ye.js";
3
+ import string from "@poppinss/utils/string";
4
+ import { EnvEditor } from "@adonisjs/env/editor";
5
+ var GenerateKey = class extends BaseCommand {
6
+ static commandName = "generate:key";
7
+ static description = "Generate a cryptographically secure random application key";
8
+ async run() {
9
+ let writeToFile = process.env.NODE_ENV !== "production";
10
+ if (this.force) writeToFile = true;
11
+ if (this.show) writeToFile = false;
12
+ const secureKey = string.random(32);
13
+ if (writeToFile) {
14
+ const editor = await EnvEditor.create(this.app.appRoot);
15
+ editor.add("APP_KEY", secureKey, true);
16
+ await editor.save();
17
+ this.logger.action("add APP_KEY to .env").succeeded();
18
+ } else this.logger.log(`APP_KEY = ${secureKey}`);
19
+ }
14
20
  };
15
- import string from '@poppinss/utils/string';
16
- import { EnvEditor } from '@adonisjs/env/editor';
17
- import { BaseCommand, flags } from "../modules/ace/main.js";
18
- /**
19
- * The generate key command is used to generate the app key
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
- * ```
28
- */
29
- export default class GenerateKey extends BaseCommand {
30
- /**
31
- * The command name
32
- */
33
- static commandName = 'generate:key';
34
- /**
35
- * The command description
36
- */
37
- static description = 'Generate a cryptographically secure random application key';
38
- async run() {
39
- let writeToFile = process.env.NODE_ENV !== 'production';
40
- if (this.force) {
41
- writeToFile = true;
42
- }
43
- if (this.show) {
44
- writeToFile = false;
45
- }
46
- const secureKey = string.random(32);
47
- if (writeToFile) {
48
- const editor = await EnvEditor.create(this.app.appRoot);
49
- editor.add('APP_KEY', secureKey, true);
50
- await editor.save();
51
- this.logger.action('add APP_KEY to .env').succeeded();
52
- }
53
- else {
54
- this.logger.log(`APP_KEY = ${secureKey}`);
55
- }
56
- }
57
- }
58
- __decorate([
59
- flags.boolean({
60
- description: 'Display the key on the terminal, instead of writing it to .env file',
61
- })
62
- ], GenerateKey.prototype, "show", void 0);
63
- __decorate([
64
- flags.boolean({
65
- description: 'Force update .env file in production environment',
66
- })
67
- ], GenerateKey.prototype, "force", void 0);
21
+ __decorate([flags.boolean({ description: "Display the key on the terminal, instead of writing it to .env file" })], GenerateKey.prototype, "show", void 0);
22
+ __decorate([flags.boolean({ description: "Force update .env file in production environment" })], GenerateKey.prototype, "force", void 0);
23
+ export { GenerateKey as default };
@@ -1,55 +1,27 @@
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
- import { BaseCommand } from "../modules/ace/main.js";
10
- /**
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
- * ```
19
- */
20
- export default class InspectRCFile extends BaseCommand {
21
- /**
22
- * The command name
23
- */
24
- static commandName = 'inspect:rcfile';
25
- /**
26
- * The command description
27
- */
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
- */
34
- async run() {
35
- const { raw, providers, preloads, commands, ...rest } = this.app.rcFile;
36
- this.logger.log(JSON.stringify({
37
- ...rest,
38
- providers: providers.map((provider) => {
39
- return {
40
- ...provider,
41
- file: provider.file.toString(),
42
- };
43
- }),
44
- preloads: preloads.map((preload) => {
45
- return {
46
- ...preload,
47
- file: preload.file.toString(),
48
- };
49
- }),
50
- commands: commands.map((command) => {
51
- return command.toString();
52
- }),
53
- }, null, 2));
54
- }
55
- }
1
+ import { f as BaseCommand } from "../main-BWftwyAK.js";
2
+ var InspectRCFile = class extends BaseCommand {
3
+ static commandName = "inspect:rcfile";
4
+ static description = "Inspect the RC file with its default values";
5
+ async run() {
6
+ const { raw, providers, preloads, commands, ...rest } = this.app.rcFile;
7
+ this.logger.log(JSON.stringify({
8
+ ...rest,
9
+ providers: providers.map((provider) => {
10
+ return {
11
+ ...provider,
12
+ file: provider.file.toString()
13
+ };
14
+ }),
15
+ preloads: preloads.map((preload) => {
16
+ return {
17
+ ...preload,
18
+ file: preload.file.toString()
19
+ };
20
+ }),
21
+ commands: commands.map((command) => {
22
+ return command.toString();
23
+ })
24
+ }, null, 2));
25
+ }
26
+ };
27
+ export { InspectRCFile as default };