@adonisjs/core 7.0.0-next.1 → 7.0.0-next.11

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 (145) hide show
  1. package/build/commands/add.js +40 -110
  2. package/build/commands/build.js +51 -107
  3. package/build/commands/configure.js +82 -177
  4. package/build/commands/eject.js +17 -60
  5. package/build/commands/env/add.js +55 -134
  6. package/build/commands/generate_key.js +22 -66
  7. package/build/commands/inspect_rcfile.js +27 -55
  8. package/build/commands/list/routes.js +246 -116
  9. package/build/commands/make/command.js +15 -57
  10. package/build/commands/make/controller.js +43 -120
  11. package/build/commands/make/event.js +16 -62
  12. package/build/commands/make/exception.js +16 -62
  13. package/build/commands/make/listener.js +36 -93
  14. package/build/commands/make/middleware.js +41 -101
  15. package/build/commands/make/preload.js +47 -113
  16. package/build/commands/make/provider.js +47 -112
  17. package/build/commands/make/service.js +16 -55
  18. package/build/commands/make/test.js +47 -132
  19. package/build/commands/make/transformer.js +17 -64
  20. package/build/commands/make/validator.js +20 -80
  21. package/build/commands/make/view.js +15 -56
  22. package/build/commands/repl.js +17 -50
  23. package/build/commands/serve.js +80 -156
  24. package/build/commands/test.js +92 -208
  25. package/build/factories/app.js +2 -9
  26. package/build/factories/bodyparser.js +2 -9
  27. package/build/factories/core/ace.js +15 -46
  28. package/build/factories/core/ignitor.js +12 -180
  29. package/build/factories/core/main.js +22 -11
  30. package/build/factories/core/test_utils.js +19 -43
  31. package/build/factories/encryption.js +2 -9
  32. package/build/factories/events.js +2 -9
  33. package/build/factories/hash.js +2 -9
  34. package/build/factories/http.js +2 -9
  35. package/build/factories/logger.js +2 -9
  36. package/build/factories/stubs.js +28 -91
  37. package/build/index.js +13 -46
  38. package/build/modules/ace/codemods.d.ts +109 -14
  39. package/build/modules/ace/codemods.js +222 -374
  40. package/build/modules/ace/main.d.ts +30 -0
  41. package/build/modules/ace/main.js +2 -11
  42. package/build/modules/app.d.ts +17 -0
  43. package/build/modules/app.js +4 -9
  44. package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
  45. package/build/modules/bodyparser/main.js +4 -9
  46. package/build/modules/config.d.ts +17 -0
  47. package/build/modules/config.js +4 -9
  48. package/build/modules/container.js +4 -9
  49. package/build/modules/dumper/dumper.d.ts +5 -0
  50. package/build/modules/dumper/main.d.ts +21 -0
  51. package/build/modules/dumper/main.js +6 -11
  52. package/build/modules/dumper/plugins/edge.js +2 -62
  53. package/build/modules/encryption.d.ts +17 -0
  54. package/build/modules/encryption.js +4 -9
  55. package/build/modules/env/editor.js +2 -9
  56. package/build/modules/env/main.d.ts +19 -0
  57. package/build/modules/env/main.js +2 -9
  58. package/build/modules/events.js +4 -9
  59. package/build/modules/hash/drivers/argon.js +2 -9
  60. package/build/modules/hash/drivers/bcrypt.d.ts +11 -0
  61. package/build/modules/hash/drivers/bcrypt.js +2 -9
  62. package/build/modules/hash/drivers/scrypt.js +2 -9
  63. package/build/modules/hash/main.d.ts +18 -0
  64. package/build/modules/hash/main.js +6 -10
  65. package/build/modules/hash/phc_formatter.js +2 -9
  66. package/build/modules/health.js +2 -9
  67. package/build/modules/http/main.js +4 -15
  68. package/build/modules/http/url_builder_client.d.ts +1 -0
  69. package/build/modules/http/url_builder_client.js +2 -0
  70. package/build/modules/logger.d.ts +30 -0
  71. package/build/modules/logger.js +4 -9
  72. package/build/modules/repl.js +4 -9
  73. package/build/modules/transformers/main.js +4 -9
  74. package/build/providers/app_provider.d.ts +9 -21
  75. package/build/providers/app_provider.js +147 -363
  76. package/build/providers/edge_provider.js +97 -104
  77. package/build/providers/hash_provider.js +29 -91
  78. package/build/providers/repl_provider.js +61 -152
  79. package/build/providers/vinejs_provider.d.ts +1 -1
  80. package/build/providers/vinejs_provider.js +20 -66
  81. package/build/services/ace.js +2 -17
  82. package/build/services/app.js +2 -21
  83. package/build/services/config.js +2 -13
  84. package/build/services/dumper.js +5 -21
  85. package/build/services/emitter.js +2 -14
  86. package/build/services/encryption.js +2 -14
  87. package/build/services/hash.js +2 -14
  88. package/build/services/logger.js +2 -14
  89. package/build/services/repl.js +2 -14
  90. package/build/services/router.js +2 -14
  91. package/build/services/server.js +2 -14
  92. package/build/services/test_utils.js +2 -17
  93. package/build/services/url_builder.js +5 -17
  94. package/build/src/exceptions.js +2 -49
  95. package/build/src/helpers/assert.js +2 -55
  96. package/build/src/helpers/http.d.ts +20 -0
  97. package/build/src/helpers/http.js +2 -0
  98. package/build/src/helpers/is.js +3 -31
  99. package/build/src/helpers/main.d.ts +1 -5
  100. package/build/src/helpers/main.js +5 -56
  101. package/build/src/helpers/string.js +2 -60
  102. package/build/src/helpers/types.js +26 -135
  103. package/build/src/helpers/verification_token.js +2 -120
  104. package/build/src/test_utils/main.js +5 -77
  105. package/build/src/types.d.ts +1 -0
  106. package/build/src/types.js +0 -8
  107. package/build/src/utils.d.ts +1 -1
  108. package/build/src/vine.js +2 -97
  109. package/build/types/ace.js +2 -9
  110. package/build/types/app.js +2 -9
  111. package/build/types/bodyparser.js +2 -9
  112. package/build/types/common.js +2 -9
  113. package/build/types/container.js +2 -9
  114. package/build/types/encryption.js +2 -9
  115. package/build/types/events.js +2 -9
  116. package/build/types/hash.js +2 -9
  117. package/build/types/health.js +2 -9
  118. package/build/types/helpers.d.ts +20 -0
  119. package/build/types/helpers.js +0 -8
  120. package/build/types/http.js +2 -9
  121. package/build/types/logger.js +2 -9
  122. package/build/types/repl.js +2 -9
  123. package/build/types/transformers.js +2 -9
  124. package/package.json +88 -30
  125. package/build/modules/ace/commands.js +0 -157
  126. package/build/modules/ace/create_kernel.js +0 -91
  127. package/build/modules/ace/kernel.js +0 -40
  128. package/build/modules/dumper/define_config.js +0 -36
  129. package/build/modules/dumper/dumper.js +0 -256
  130. package/build/modules/dumper/errors.js +0 -119
  131. package/build/modules/hash/define_config.js +0 -125
  132. package/build/modules/http/request_validator.js +0 -100
  133. package/build/src/assembler_hooks/index_entities.js +0 -106
  134. package/build/src/cli_formatters/routes_list.js +0 -381
  135. package/build/src/config_provider.js +0 -71
  136. package/build/src/debug.js +0 -25
  137. package/build/src/ignitor/ace.js +0 -102
  138. package/build/src/ignitor/http.js +0 -146
  139. package/build/src/ignitor/main.js +0 -124
  140. package/build/src/ignitor/test.js +0 -66
  141. package/build/src/test_utils/http.js +0 -82
  142. package/build/src/utils.js +0 -104
  143. package/build/stubs/main.js +0 -9
  144. package/build/toolkit/commands/index_commands.js +0 -30
  145. package/build/toolkit/main.js +0 -27
@@ -1,9 +1,2 @@
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
- export * from '@adonisjs/http-transformers/types';
1
+ export * from "@adonisjs/http-transformers/types";
2
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
3
  "description": "Core of AdonisJS",
4
- "version": "7.0.0-next.1",
4
+ "version": "7.0.0-next.11",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -54,6 +54,7 @@
54
54
  "./env/editor": "./build/modules/env/editor.js",
55
55
  "./events": "./build/modules/events.js",
56
56
  "./http": "./build/modules/http/main.js",
57
+ "./http/url_builder_client": "./build/modules/http/url_builder_client.js",
57
58
  "./logger": "./build/modules/logger.js",
58
59
  "./repl": "./build/modules/repl.js",
59
60
  "./transformers": "./build/modules/transformers/main.js",
@@ -69,7 +70,7 @@
69
70
  "clean": "del-cli build",
70
71
  "copy:templates": "copyfiles \"stubs/**/**/*.stub\" build",
71
72
  "precompile": "npm run lint",
72
- "compile": "npm run clean && tsc",
73
+ "compile": "npm run clean && tsdown && tsc --emitDeclarationOnly --declaration",
73
74
  "postcompile": "npm run copy:templates && npm run index:commands",
74
75
  "build": "npm run compile",
75
76
  "docs": "typedoc",
@@ -84,63 +85,65 @@
84
85
  "index:commands": "node --import=@poppinss/ts-exec toolkit/main.js index build/commands"
85
86
  },
86
87
  "devDependencies": {
87
- "@adonisjs/assembler": "^8.0.0-next.9",
88
- "@adonisjs/eslint-config": "^3.0.0-next.1",
88
+ "@adonisjs/assembler": "^8.0.0-next.19",
89
+ "@adonisjs/eslint-config": "^3.0.0-next.4",
89
90
  "@adonisjs/prettier-config": "^1.4.5",
90
- "@adonisjs/tsconfig": "^2.0.0-next.0",
91
+ "@adonisjs/tsconfig": "^2.0.0-next.3",
91
92
  "@japa/assert": "^4.1.1",
92
93
  "@japa/expect-type": "^2.0.3",
93
94
  "@japa/file-system": "^2.3.2",
94
95
  "@japa/runner": "^4.4.0",
95
96
  "@japa/snapshot": "^2.0.9",
96
97
  "@poppinss/ts-exec": "^1.4.1",
97
- "@release-it/conventional-changelog": "^10.0.1",
98
- "@types/node": "^24.5.2",
98
+ "@release-it/conventional-changelog": "^10.0.2",
99
+ "@types/node": "^24.10.1",
99
100
  "@types/pretty-hrtime": "^1.0.3",
100
- "@types/sinon": "^17.0.4",
101
+ "@types/sinon": "^21.0.0",
101
102
  "@types/supertest": "^6.0.3",
102
103
  "@types/test-console": "^2.0.3",
103
- "@vinejs/vine": "^3.0.1",
104
+ "@vinejs/vine": "^4.1.0",
104
105
  "argon2": "^0.44.0",
105
106
  "bcrypt": "^6.0.0",
106
107
  "c8": "^10.1.3",
107
108
  "copyfiles": "^2.4.1",
108
- "cross-env": "^10.0.0",
109
+ "cross-env": "^10.1.0",
109
110
  "del-cli": "^7.0.0",
110
111
  "edge.js": "^6.3.0",
111
- "eslint": "^9.35.0",
112
- "execa": "^9.6.0",
112
+ "eslint": "^9.39.1",
113
+ "execa": "^9.6.1",
113
114
  "get-port": "^7.1.0",
114
- "prettier": "^3.6.2",
115
- "release-it": "^19.0.5",
115
+ "pino-pretty": "^13.1.3",
116
+ "prettier": "^3.7.3",
117
+ "release-it": "^19.0.6",
116
118
  "sinon": "^21.0.0",
117
119
  "supertest": "^7.1.4",
118
120
  "test-console": "^2.0.0",
119
121
  "timekeeper": "^2.3.1",
120
- "typedoc": "^0.28.13",
121
- "typescript": "^5.9.2",
122
+ "tsdown": "^0.17.0-beta.5",
123
+ "typedoc": "^0.28.15",
124
+ "typescript": "^5.9.3",
122
125
  "youch": "^4.1.0-beta.11"
123
126
  },
124
127
  "dependencies": {
125
- "@adonisjs/ace": "^14.0.1-next.1",
126
- "@adonisjs/application": "^9.0.0-next.8",
127
- "@adonisjs/bodyparser": "^11.0.0-next.1",
128
+ "@adonisjs/ace": "^14.0.1-next.3",
129
+ "@adonisjs/application": "^9.0.0-next.10",
130
+ "@adonisjs/bodyparser": "^11.0.0-next.4",
128
131
  "@adonisjs/config": "^6.0.0-next.1",
129
132
  "@adonisjs/encryption": "^7.0.0-next.1",
130
- "@adonisjs/env": "^7.0.0-next.1",
133
+ "@adonisjs/env": "^7.0.0-next.2",
131
134
  "@adonisjs/events": "^10.1.0-next.2",
132
- "@adonisjs/fold": "^11.0.0-next.2",
135
+ "@adonisjs/fold": "^11.0.0-next.3",
133
136
  "@adonisjs/hash": "^10.0.0-next.1",
134
- "@adonisjs/health": "^3.0.0-next.0",
135
- "@adonisjs/http-server": "^8.0.0-next.7",
136
- "@adonisjs/http-transformers": "^1.4.0",
137
- "@adonisjs/logger": "^7.1.0-next.0",
137
+ "@adonisjs/health": "^3.1.0-next.0",
138
+ "@adonisjs/http-server": "^8.0.0-next.13",
139
+ "@adonisjs/http-transformers": "^1.6.0",
140
+ "@adonisjs/logger": "^7.1.0-next.2",
138
141
  "@adonisjs/repl": "^5.0.0-next.0",
139
142
  "@poppinss/colors": "^4.1.5",
140
- "@poppinss/dumper": "^0.6.4",
143
+ "@poppinss/dumper": "^0.7.0",
141
144
  "@poppinss/macroable": "^1.1.0",
142
145
  "@poppinss/utils": "^7.0.0-next.3",
143
- "@sindresorhus/is": "^7.1.0",
146
+ "@sindresorhus/is": "^7.1.1",
144
147
  "@types/he": "^1.2.3",
145
148
  "error-stack-parser-es": "^1.0.5",
146
149
  "he": "^1.2.0",
@@ -148,12 +151,13 @@
148
151
  "string-width": "^8.1.0"
149
152
  },
150
153
  "peerDependencies": {
151
- "@adonisjs/assembler": "^8.0.0-next.6",
152
- "@vinejs/vine": "^3.0.0",
154
+ "@adonisjs/assembler": "^8.0.0-next.10",
155
+ "@vinejs/vine": "^4.0.0-next.0",
153
156
  "argon2": "^0.43.0",
154
157
  "bcrypt": "^6.0.0",
155
158
  "edge.js": "^6.2.0",
156
- "youch": "^4.1.0-beta.11"
159
+ "youch": "^4.1.0-beta.11",
160
+ "pino-pretty": "^13.1.3"
157
161
  },
158
162
  "peerDependenciesMeta": {
159
163
  "argon2": {
@@ -173,6 +177,9 @@
173
177
  },
174
178
  "youch": {
175
179
  "optional": true
180
+ },
181
+ "pino-pretty": {
182
+ "optional": true
176
183
  }
177
184
  },
178
185
  "homepage": "https://github.com/adonisjs/core#readme",
@@ -216,6 +223,57 @@
216
223
  "@commitlint/config-conventional"
217
224
  ]
218
225
  },
226
+ "tsdown": {
227
+ "entry": [
228
+ "index.ts",
229
+ "commands/main.ts",
230
+ "commands/**/*.ts",
231
+ "factories/core/main.ts",
232
+ "factories/**/*.ts",
233
+ "src/types.ts",
234
+ "types/**/*.ts",
235
+ "services/**/*.ts",
236
+ "providers/**/*.ts",
237
+ "src/helpers/main.ts",
238
+ "src/helpers/**/*.ts",
239
+ "modules/ace/main.ts",
240
+ "modules/ace/codemods.ts",
241
+ "modules/bodyparser/main.ts",
242
+ "modules/bodyparser/bodyparser_middleware.ts",
243
+ "modules/hash/main.ts",
244
+ "modules/hash/phc_formatter.ts",
245
+ "modules/hash/drivers/argon.ts",
246
+ "modules/hash/drivers/bcrypt.ts",
247
+ "modules/hash/drivers/scrypt.ts",
248
+ "modules/app.ts",
249
+ "modules/config.ts",
250
+ "modules/container.ts",
251
+ "modules/encryption.ts",
252
+ "modules/env/main.ts",
253
+ "modules/dumper/main.ts",
254
+ "modules/dumper/plugins/edge.ts",
255
+ "modules/env/editor.ts",
256
+ "modules/events.ts",
257
+ "modules/http/main.ts",
258
+ "modules/http/url_builder_client.ts",
259
+ "modules/logger.ts",
260
+ "modules/repl.ts",
261
+ "modules/transformers/main.ts",
262
+ "src/exceptions.ts",
263
+ "src/test_utils/main.ts",
264
+ "modules/health.ts",
265
+ "src/vine.ts"
266
+ ],
267
+ "outDir": "./build",
268
+ "clean": true,
269
+ "format": "esm",
270
+ "minify": "dce-only",
271
+ "fixedExtension": false,
272
+ "dts": false,
273
+ "treeshake": false,
274
+ "sourcemaps": false,
275
+ "target": "esnext"
276
+ },
219
277
  "release-it": {
220
278
  "git": {
221
279
  "requireCleanWorkingDir": true,
@@ -1,157 +0,0 @@
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 as AceBaseCommand, ListCommand as AceListCommand } from '@adonisjs/ace';
10
- /**
11
- * The base command class for creating custom Ace commands in AdonisJS applications.
12
- * This class extends the base Ace command with AdonisJS-specific functionality like
13
- * dependency injection and application lifecycle management.
14
- *
15
- * @example
16
- * ```ts
17
- * export default class MakeUser extends BaseCommand {
18
- * static commandName = 'make:user'
19
- * static description = 'Create a new user'
20
- *
21
- * async run() {
22
- * this.logger.info('Creating user...')
23
- * // Command implementation
24
- * }
25
- * }
26
- * ```
27
- */
28
- export class BaseCommand extends AceBaseCommand {
29
- app;
30
- kernel;
31
- static options = {};
32
- get staysAlive() {
33
- return this.constructor.options.staysAlive;
34
- }
35
- get startApp() {
36
- return this.constructor.options.startApp;
37
- }
38
- constructor(app, kernel, parsed, ui, prompt) {
39
- super(kernel, parsed, ui, prompt);
40
- this.app = app;
41
- this.kernel = kernel;
42
- }
43
- /**
44
- * Creates the codemods module to modify source files programmatically.
45
- * This method provides access to AST-based code transformations.
46
- *
47
- * @example
48
- * ```ts
49
- * const codemods = await this.createCodemods()
50
- * await codemods.makeUsingStub(stubsRoot, 'controller.stub', {
51
- * filename: 'UserController',
52
- * entity: { name: 'User' }
53
- * })
54
- * ```
55
- */
56
- async createCodemods() {
57
- const { Codemods } = await import('./codemods.js');
58
- const codemods = new Codemods(this.app, this.logger);
59
- codemods.on('error', () => {
60
- this.exitCode = 1;
61
- });
62
- return codemods;
63
- }
64
- /**
65
- * Executes the lifecycle hooks and the run method from the command
66
- */
67
- async exec() {
68
- this.hydrate();
69
- try {
70
- /**
71
- * Executing the template methods
72
- */
73
- this.prepare && (await this.app.container.call(this, 'prepare'));
74
- this.interact && (await this.app.container.call(this, 'interact'));
75
- const result = await this.app.container.call(this, 'run');
76
- /**
77
- * Set exit code
78
- */
79
- this.result = this.result === undefined ? result : this.result;
80
- this.exitCode = this.exitCode ?? 0;
81
- }
82
- catch (error) {
83
- this.error = error;
84
- this.exitCode = this.exitCode ?? 1;
85
- }
86
- /**
87
- * Run the completed method (if exists) and check if has handled
88
- * the error
89
- */
90
- let errorHandled = this.completed
91
- ? await this.app.container.call(this, 'completed')
92
- : false;
93
- if (this.error && !errorHandled) {
94
- await this.kernel.errorHandler.render(this.error, this.kernel);
95
- }
96
- return this.result;
97
- }
98
- /**
99
- * Terminate the application gracefully. This method should be preferred over
100
- * calling `app.terminate()` directly as it only triggers termination when
101
- * the current command is the main command responsible for the process.
102
- *
103
- * @example
104
- * ```ts
105
- * export default class SomeCommand extends BaseCommand {
106
- * async run() {
107
- * // Do some work
108
- * await this.terminate()
109
- * }
110
- * }
111
- * ```
112
- */
113
- async terminate() {
114
- if (this.kernel.getMainCommand() === this) {
115
- await this.app.terminate();
116
- }
117
- }
118
- }
119
- /**
120
- * The List command is used to display a list of available commands.
121
- * This command extends the base Ace ListCommand with AdonisJS-specific functionality.
122
- */
123
- export class ListCommand extends AceListCommand {
124
- app;
125
- kernel;
126
- static options = {};
127
- get staysAlive() {
128
- return this.constructor.options.staysAlive;
129
- }
130
- get startApp() {
131
- return this.constructor.options.startApp;
132
- }
133
- constructor(app, kernel, parsed, ui, prompt) {
134
- super(kernel, parsed, ui, prompt);
135
- this.app = app;
136
- this.kernel = kernel;
137
- }
138
- /**
139
- * Creates the codemods module to modify source files programmatically.
140
- * This method provides access to AST-based code transformations.
141
- */
142
- async createCodemods() {
143
- const { Codemods } = await import('./codemods.js');
144
- return new Codemods(this.app, this.logger);
145
- }
146
- /**
147
- * Terminate the app. A command should prefer calling this method
148
- * over the "app.terminate", because this method only triggers
149
- * app termination when the current command is in the charge
150
- * of the process.
151
- */
152
- async terminate() {
153
- if (this.kernel.getMainCommand() === this) {
154
- await this.app.terminate();
155
- }
156
- }
157
- }
@@ -1,91 +0,0 @@
1
- /*
2
- * @adonisjs/ace
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 { Kernel } from "./main.js";
10
- import { FsLoader, HelpCommand } from "../../modules/ace/main.js";
11
- /**
12
- * Create and configure an Ace command kernel for AdonisJS applications.
13
- * This function abstracts the kernel setup logic and can be used in different
14
- * environments with appropriate configurations.
15
- *
16
- * - In console environment, Ace manages the lifecycle of the process
17
- * - In other environments, Ace can be pulled from the container to run commands
18
- *
19
- * @param app - The AdonisJS application service instance
20
- * @param commandName - Optional specific command name for optimized loading
21
- *
22
- * @example
23
- * ```ts
24
- * const app = new Application(new URL('../', import.meta.url))
25
- * const kernel = createAceKernel(app)
26
- *
27
- * // Run a specific command
28
- * await kernel.handle(['make:controller', 'UserController'])
29
- * ```
30
- */
31
- export function createAceKernel(app, commandName) {
32
- const kernel = new Kernel(app);
33
- kernel.info.set('binary', 'node ace');
34
- /**
35
- * Lazy import commands mentioned in the "commands" array
36
- * of rcFile
37
- */
38
- app.rcFile.commands.forEach((commandModule) => {
39
- kernel.addLoader(() => typeof commandModule === 'function' ? commandModule() : app.import(commandModule));
40
- });
41
- /**
42
- * When we know the command we are running ahead of time, then we
43
- * defer loading the application commands if the command has
44
- * already been registered by other loaders.
45
- */
46
- const fsLoader = new FsLoader(app.commandsPath());
47
- kernel.addLoader({
48
- async getMetaData() {
49
- if (!commandName || !kernel.getCommand(commandName)) {
50
- return fsLoader.getMetaData();
51
- }
52
- return [];
53
- },
54
- getCommand(command) {
55
- return fsLoader.getCommand(command);
56
- },
57
- });
58
- /**
59
- * Custom global flags
60
- */
61
- kernel.defineFlag('ansi', {
62
- type: 'boolean',
63
- showNegatedVariantInHelp: true,
64
- description: 'Force enable or disable colorful output',
65
- });
66
- kernel.defineFlag('help', {
67
- type: 'boolean',
68
- description: HelpCommand.description,
69
- });
70
- /**
71
- * Flag listener to turn colors on/off
72
- */
73
- kernel.on('ansi', (_, $kernel, parsed) => {
74
- if (parsed.flags.ansi === false) {
75
- $kernel.ui.switchMode('silent');
76
- }
77
- if (parsed.flags.ansi === true) {
78
- $kernel.ui.switchMode('normal');
79
- }
80
- });
81
- /**
82
- * Flag listener to display the help
83
- */
84
- kernel.on('help', async (command, $kernel, parsed) => {
85
- parsed.args.unshift(command.commandName);
86
- const help = new HelpCommand($kernel, parsed, kernel.ui, kernel.prompt);
87
- await help.exec();
88
- return $kernel.shortcircuit();
89
- });
90
- return kernel;
91
- }
@@ -1,40 +0,0 @@
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 { Kernel as AceKernel } from '@adonisjs/ace';
10
- import { ListCommand } from "./commands.js";
11
- /**
12
- * The Ace command kernel for AdonisJS applications. This kernel extends the base
13
- * Ace kernel with AdonisJS-specific functionality like dependency injection and
14
- * application lifecycle management.
15
- *
16
- * @example
17
- * ```ts
18
- * const app = new Application(new URL('../', import.meta.url))
19
- * const kernel = new Kernel(app)
20
- *
21
- * await kernel.handle(['make:controller', 'UserController'])
22
- * ```
23
- */
24
- export class Kernel extends AceKernel {
25
- app;
26
- /**
27
- * Create a new Ace kernel instance
28
- *
29
- * @param app - The AdonisJS application instance
30
- */
31
- constructor(app) {
32
- super(ListCommand, {
33
- create: async (command, parsedOutput, $kernel) => {
34
- return app.container.make(command, [app, $kernel, parsedOutput, $kernel.ui, $kernel.prompt]);
35
- },
36
- run: (command) => command.exec(),
37
- });
38
- this.app = app;
39
- }
40
- }
@@ -1,36 +0,0 @@
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
- /**
10
- * Define configuration for the dumper service exported by the
11
- * "@adonisjs/core/services/dumper" module. This function allows
12
- * you to customize HTML and console output formatting options.
13
- *
14
- * @param dumperConfig - Configuration object with HTML and console options
15
- * @param dumperConfig.html - HTML output formatting configuration
16
- * @param dumperConfig.console - Console output formatting configuration
17
- *
18
- * @example
19
- * ```ts
20
- * export default defineConfig({
21
- * html: {
22
- * showHidden: true,
23
- * depth: 5,
24
- * colors: true
25
- * },
26
- * console: {
27
- * showHidden: false,
28
- * depth: 3,
29
- * collapse: ['Date', 'DateTime']
30
- * }
31
- * })
32
- * ```
33
- */
34
- export function defineConfig(dumperConfig) {
35
- return dumperConfig;
36
- }