@adonisjs/core 7.0.0-next.10 → 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 (128) 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 -150
  24. package/build/commands/test.js +92 -202
  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.js +222 -477
  39. package/build/modules/ace/main.js +2 -41
  40. package/build/modules/app.js +4 -26
  41. package/build/modules/bodyparser/bodyparser_middleware.js +2 -14
  42. package/build/modules/bodyparser/main.js +4 -9
  43. package/build/modules/config.js +4 -26
  44. package/build/modules/container.js +4 -9
  45. package/build/modules/dumper/main.js +6 -32
  46. package/build/modules/dumper/plugins/edge.js +2 -62
  47. package/build/modules/encryption.js +4 -26
  48. package/build/modules/env/editor.js +2 -9
  49. package/build/modules/env/main.js +2 -28
  50. package/build/modules/events.js +4 -9
  51. package/build/modules/hash/drivers/argon.js +2 -9
  52. package/build/modules/hash/drivers/bcrypt.js +2 -20
  53. package/build/modules/hash/drivers/scrypt.js +2 -9
  54. package/build/modules/hash/main.js +6 -28
  55. package/build/modules/hash/phc_formatter.js +2 -9
  56. package/build/modules/health.js +2 -9
  57. package/build/modules/http/main.js +4 -15
  58. package/build/modules/http/url_builder_client.js +2 -9
  59. package/build/modules/logger.d.ts +30 -0
  60. package/build/modules/logger.js +4 -9
  61. package/build/modules/repl.js +4 -9
  62. package/build/modules/transformers/main.js +4 -9
  63. package/build/providers/app_provider.js +147 -359
  64. package/build/providers/edge_provider.js +97 -165
  65. package/build/providers/hash_provider.js +29 -91
  66. package/build/providers/repl_provider.js +61 -152
  67. package/build/providers/vinejs_provider.d.ts +1 -1
  68. package/build/providers/vinejs_provider.js +20 -66
  69. package/build/services/ace.js +2 -17
  70. package/build/services/app.js +2 -21
  71. package/build/services/config.js +2 -13
  72. package/build/services/dumper.js +5 -21
  73. package/build/services/emitter.js +2 -14
  74. package/build/services/encryption.js +2 -14
  75. package/build/services/hash.js +2 -14
  76. package/build/services/logger.js +2 -14
  77. package/build/services/repl.js +2 -14
  78. package/build/services/router.js +2 -14
  79. package/build/services/server.js +2 -14
  80. package/build/services/test_utils.js +2 -17
  81. package/build/services/url_builder.js +5 -17
  82. package/build/src/exceptions.js +2 -49
  83. package/build/src/helpers/assert.js +2 -55
  84. package/build/src/helpers/http.js +2 -28
  85. package/build/src/helpers/is.js +3 -31
  86. package/build/src/helpers/main.js +5 -52
  87. package/build/src/helpers/string.js +2 -78
  88. package/build/src/helpers/types.js +26 -135
  89. package/build/src/helpers/verification_token.js +2 -120
  90. package/build/src/test_utils/main.js +5 -77
  91. package/build/src/types.js +0 -8
  92. package/build/src/vine.js +2 -105
  93. package/build/types/ace.js +2 -9
  94. package/build/types/app.js +2 -9
  95. package/build/types/bodyparser.js +2 -9
  96. package/build/types/common.js +2 -9
  97. package/build/types/container.js +2 -9
  98. package/build/types/encryption.js +2 -9
  99. package/build/types/events.js +2 -9
  100. package/build/types/hash.js +2 -9
  101. package/build/types/health.js +2 -9
  102. package/build/types/helpers.js +0 -8
  103. package/build/types/http.js +2 -9
  104. package/build/types/logger.js +2 -9
  105. package/build/types/repl.js +2 -9
  106. package/build/types/transformers.js +2 -9
  107. package/package.json +76 -19
  108. package/build/modules/ace/commands.js +0 -157
  109. package/build/modules/ace/create_kernel.js +0 -91
  110. package/build/modules/ace/kernel.js +0 -40
  111. package/build/modules/dumper/define_config.js +0 -36
  112. package/build/modules/dumper/dumper.js +0 -266
  113. package/build/modules/dumper/errors.js +0 -119
  114. package/build/modules/hash/define_config.js +0 -125
  115. package/build/modules/http/request_validator.js +0 -100
  116. package/build/src/assembler_hooks/index_entities.js +0 -112
  117. package/build/src/cli_formatters/routes_list.js +0 -397
  118. package/build/src/config_provider.js +0 -71
  119. package/build/src/debug.js +0 -25
  120. package/build/src/ignitor/ace.js +0 -102
  121. package/build/src/ignitor/http.js +0 -159
  122. package/build/src/ignitor/main.js +0 -124
  123. package/build/src/ignitor/test.js +0 -66
  124. package/build/src/test_utils/http.js +0 -82
  125. package/build/src/utils.js +0 -114
  126. package/build/stubs/main.js +0 -9
  127. package/build/toolkit/commands/index_commands.js +0 -30
  128. package/build/toolkit/main.js +0 -27
@@ -1,359 +1,147 @@
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 { dirname } from 'node:path';
10
- import { mkdir, writeFile } from 'node:fs/promises';
11
- import { Config } from "../modules/config.js";
12
- import { Logger } from "../modules/logger.js";
13
- import { Application } from "../modules/app.js";
14
- import { Dumper } from "../modules/dumper/dumper.js";
15
- import { HttpContext } from "../modules/http/main.js";
16
- import { Encryption } from "../modules/encryption.js";
17
- import { Router, Server } from "../modules/http/main.js";
18
- import { BaseEvent, Emitter } from "../modules/events.js";
19
- import { serialize } from "../modules/transformers/main.js";
20
- import BodyParserMiddleware from "../modules/bodyparser/bodyparser_middleware.js";
21
- /**
22
- * The Application Service provider registers all the baseline
23
- * features required to run the framework.
24
- *
25
- * This provider handles the registration of core services including:
26
- * - Application instance
27
- * - Logger and logger manager
28
- * - Configuration
29
- * - Event emitter
30
- * - Encryption service
31
- * - HTTP server and router
32
- * - Body parser middleware
33
- * - Dumper for debugging
34
- * - Test utilities and ACE kernel
35
- *
36
- * @example
37
- * const provider = new AppServiceProvider(app)
38
- * provider.register()
39
- * await provider.boot()
40
- * await provider.ready()
41
- */
42
- export default class AppServiceProvider {
43
- app;
44
- /**
45
- * Application service provider constructor
46
- *
47
- * @param app - The application service instance
48
- */
49
- constructor(app) {
50
- this.app = app;
51
- }
52
- /**
53
- * Registers test utils with the container
54
- *
55
- * Creates a singleton binding for 'testUtils' that lazily imports
56
- * and instantiates the TestUtils class when first accessed.
57
- *
58
- * @example
59
- * const testUtils = await app.container.make('testUtils')
60
- * testUtils.createHttpContext()
61
- */
62
- registerTestUtils() {
63
- this.app.container.singleton('testUtils', async () => {
64
- const { TestUtils } = await import('../src/test_utils/main.js');
65
- return new TestUtils(this.app);
66
- });
67
- }
68
- /**
69
- * Registers ace with the container
70
- *
71
- * Creates a singleton binding for 'ace' that lazily creates
72
- * the ACE kernel for command-line interface functionality.
73
- *
74
- * @example
75
- * const ace = await app.container.make('ace')
76
- * await ace.exec('make:controller', ['UserController'])
77
- */
78
- registerAce() {
79
- this.app.container.singleton('ace', async () => {
80
- const { createAceKernel } = await import('../modules/ace/create_kernel.js');
81
- return createAceKernel(this.app);
82
- });
83
- }
84
- /**
85
- * Registers the application to the container
86
- *
87
- * Binds the application instance as both a class binding and an alias.
88
- * This allows access to the app instance throughout the container.
89
- *
90
- * @example
91
- * const app = await container.make('app')
92
- * const appPath = app.makePath('tmp')
93
- */
94
- registerApp() {
95
- this.app.container.singleton(Application, () => this.app);
96
- this.app.container.alias('app', Application);
97
- }
98
- /**
99
- * Registers the logger class to resolve the default logger
100
- *
101
- * Creates a singleton binding for the Logger class that resolves
102
- * the default logger instance from the logger manager.
103
- *
104
- * @example
105
- * const logger = await container.make(Logger)
106
- * logger.info('Application started')
107
- */
108
- registerLogger() {
109
- this.app.container.singleton(Logger, async (resolver) => {
110
- const loggerManager = await resolver.make('logger');
111
- return loggerManager.use();
112
- });
113
- }
114
- /**
115
- * Registers the logger manager to the container
116
- *
117
- * Creates a singleton binding for 'logger' that instantiates
118
- * the LoggerManager with configuration from config/logger.ts
119
- *
120
- * @example
121
- * const loggerManager = await container.make('logger')
122
- * const fileLogger = loggerManager.use('file')
123
- */
124
- registerLoggerManager() {
125
- this.app.container.singleton('logger', async () => {
126
- const { LoggerManager } = await import('../modules/logger.js');
127
- const config = this.app.config.get('logger');
128
- return new LoggerManager(config);
129
- });
130
- }
131
- /**
132
- * Registers the config to the container
133
- *
134
- * Binds the application's config instance as both a class binding
135
- * and an alias, allowing access to configuration values.
136
- *
137
- * @example
138
- * const config = await container.make('config')
139
- * const appKey = config.get('app.appKey')
140
- */
141
- registerConfig() {
142
- this.app.container.singleton(Config, () => this.app.config);
143
- this.app.container.alias('config', Config);
144
- }
145
- /**
146
- * Registers emitter service to the container
147
- *
148
- * Creates a singleton binding for the event emitter that handles
149
- * application-wide event dispatching and listening.
150
- *
151
- * @example
152
- * const emitter = await container.make('emitter')
153
- * emitter.emit('user:created', { userId: 123 })
154
- */
155
- registerEmitter() {
156
- this.app.container.singleton(Emitter, async () => {
157
- return new Emitter(this.app);
158
- });
159
- this.app.container.alias('emitter', Emitter);
160
- }
161
- /**
162
- * Register the encryption service to the container
163
- *
164
- * Creates a singleton binding for the encryption service using
165
- * the app key from configuration for encryption/decryption operations.
166
- *
167
- * @example
168
- * const encryption = await container.make('encryption')
169
- * const encrypted = encryption.encrypt('sensitive data')
170
- */
171
- registerEncryption() {
172
- this.app.container.singleton(Encryption, () => {
173
- const appKey = this.app.config.get('app.appKey');
174
- return new Encryption({ secret: appKey });
175
- });
176
- this.app.container.alias('encryption', Encryption);
177
- }
178
- /**
179
- * Registers the HTTP server with the container as a singleton
180
- *
181
- * Creates a singleton binding for the HTTP server that handles
182
- * incoming requests, with dependencies on encryption, emitter,
183
- * logger, and HTTP configuration.
184
- *
185
- * @example
186
- * const server = await container.make('server')
187
- * server.start()
188
- */
189
- registerServer() {
190
- this.app.container.singleton(Server, async (resolver) => {
191
- const encryption = await resolver.make('encryption');
192
- const emitter = await resolver.make('emitter');
193
- const logger = await resolver.make('logger');
194
- const config = this.app.config.get('app.http');
195
- return new Server(this.app, encryption, emitter, logger, config);
196
- });
197
- this.app.container.alias('server', Server);
198
- }
199
- /**
200
- * Registers router with the container as a singleton
201
- *
202
- * Creates a singleton binding for the router by getting it from
203
- * the HTTP server instance. The router handles URL routing.
204
- *
205
- * @example
206
- * const router = await container.make('router')
207
- * router.get('/', ({ response }) => response.send('Hello'))
208
- */
209
- registerRouter() {
210
- this.app.container.singleton(Router, async (resolver) => {
211
- const server = await resolver.make('server');
212
- return server.getRouter();
213
- });
214
- this.app.container.alias('router', Router);
215
- }
216
- /**
217
- * Self construct bodyparser middleware class, since it needs
218
- * config that cannot be resolved by the container
219
- *
220
- * Binds the BodyParserMiddleware with bodyparser configuration
221
- * and experimental flags for parsing request bodies.
222
- *
223
- * @example
224
- * const middleware = await container.make(BodyParserMiddleware)
225
- * await middleware.handle(ctx, next)
226
- */
227
- registerBodyParserMiddleware() {
228
- this.app.container.singleton(BodyParserMiddleware, () => {
229
- const config = this.app.config.get('bodyparser');
230
- return new BodyParserMiddleware(config, this.app.experimentalFlags);
231
- });
232
- }
233
- /**
234
- * Registeres singleton instance of the "Dumper" module configured
235
- * via the "config/app.ts" file.
236
- *
237
- * The dumper is used for debugging and variable inspection with
238
- * configurable HTML and console output formats.
239
- *
240
- * @example
241
- * const dumper = await container.make('dumper')
242
- * dumper.dump({ user: { name: 'John' } })
243
- */
244
- registerDumper() {
245
- this.app.container.singleton(Dumper, async () => {
246
- const config = this.app.config.get('app.dumper', {});
247
- const dumper = new Dumper(this.app);
248
- if (config.html) {
249
- dumper.configureHtmlOutput(config.html);
250
- }
251
- if (config.console) {
252
- dumper.configureAnsiOutput(config.console);
253
- }
254
- return dumper;
255
- });
256
- this.app.container.alias('dumper', Dumper);
257
- }
258
- /**
259
- * Generates TypeScript type definitions and JSON representation of routes
260
- *
261
- * Creates route type definitions for better IDE support and a JSON file
262
- * containing all registered routes. This is used in development mode for
263
- * tooling integration and type-safety.
264
- *
265
- * @param router - The router instance containing registered routes
266
- *
267
- * @example
268
- * const router = await container.make('router')
269
- * await this.emitRoutes(router)
270
- * // Generates .adonisjs/server/routes.d.ts and routes.json
271
- */
272
- async emitRoutes(router) {
273
- try {
274
- const { routes, imports, types } = router.generateTypes(2);
275
- const routesTypesPath = this.app.generatedServerPath('routes.d.ts');
276
- const routesJsonPath = this.app.generatedServerPath('routes.json');
277
- await mkdir(dirname(routesTypesPath), { recursive: true });
278
- await Promise.all([
279
- writeFile(routesTypesPath, [
280
- `import '@adonisjs/core/types/http'`,
281
- ...imports,
282
- '',
283
- ...types,
284
- '',
285
- 'export type ScannedRoutes = {',
286
- routes,
287
- '}',
288
- `declare module '@adonisjs/core/types/http' {`,
289
- ' export interface RoutesList extends ScannedRoutes {}',
290
- '}',
291
- ].join('\n')),
292
- writeFile(routesJsonPath, JSON.stringify(router.toJSON())),
293
- ]);
294
- this.app.notify({ isAdonisJS: true, routesFileLocation: routesJsonPath });
295
- }
296
- catch (error) {
297
- console.error("Unable to generate routes types file due to the following error. This won't impact the dev-server");
298
- console.error(error);
299
- }
300
- }
301
- /**
302
- * Registers bindings
303
- *
304
- * Called during the application bootstrap phase to register
305
- * all core service bindings with the IoC container.
306
- *
307
- * @example
308
- * const provider = new AppServiceProvider(app)
309
- * provider.register() // Registers all core services
310
- */
311
- register() {
312
- this.registerApp();
313
- this.registerAce();
314
- this.registerDumper();
315
- this.registerLoggerManager();
316
- this.registerLogger();
317
- this.registerConfig();
318
- this.registerEmitter();
319
- this.registerEncryption();
320
- this.registerTestUtils();
321
- this.registerServer();
322
- this.registerRouter();
323
- this.registerBodyParserMiddleware();
324
- }
325
- /**
326
- * Boot the service provider
327
- *
328
- * Called after all providers have been registered. Sets up
329
- * event emitter for BaseEvent and adds transform macro to HttpContext.
330
- *
331
- * @example
332
- * await provider.boot()
333
- * // Now HttpContext has transform method available
334
- */
335
- async boot() {
336
- BaseEvent.useEmitter(await this.app.container.make('emitter'));
337
- HttpContext.instanceProperty('serialize', function (value, container) {
338
- return serialize(value, container ?? this.containerResolver);
339
- });
340
- }
341
- /**
342
- * Called when the application is ready
343
- *
344
- * In non-production environments, generates route types and
345
- * JSON files for development tooling when router is committed.
346
- *
347
- * @example
348
- * await provider.ready()
349
- * // Route types and JSON generated in development
350
- */
351
- async ready() {
352
- if (!this.app.inProduction) {
353
- const router = await this.app.container.make('router');
354
- if (router.commited) {
355
- await this.emitRoutes(router);
356
- }
357
- }
358
- }
359
- }
1
+ import "../chunk-MjwdjG2f.js";
2
+ import { t as app_exports } from "../app-BK0PN3li.js";
3
+ import { t as config_exports } from "../config-B2S2xfmN.js";
4
+ import { t as encryption_exports } from "../encryption-D2HGu0bU.js";
5
+ import { t as events_exports } from "../events-B8hK42QT.js";
6
+ import { t as logger_exports } from "../logger-Dha-0hp1.js";
7
+ import { t as Dumper } from "../dumper-C_sMcyFb.js";
8
+ import { t as main_exports } from "../main-CFmDHDls.js";
9
+ import { t as main_exports$1 } from "../main-D5xz2ZN1.js";
10
+ import { t as bodyparser_middleware_default } from "../bodyparser_middleware-DTW0epKM.js";
11
+ import { dirname } from "node:path";
12
+ import { mkdir, writeFile } from "node:fs/promises";
13
+ var AppServiceProvider = class {
14
+ constructor(app) {
15
+ this.app = app;
16
+ }
17
+ registerTestUtils() {
18
+ this.app.container.singleton("testUtils", async () => {
19
+ const { TestUtils } = await import("../src/test_utils/main.js");
20
+ return new TestUtils(this.app);
21
+ });
22
+ }
23
+ registerAce() {
24
+ this.app.container.singleton("ace", async () => {
25
+ const { createAceKernel } = await import("../create_kernel-B4MzSE2_.js");
26
+ return createAceKernel(this.app);
27
+ });
28
+ }
29
+ registerApp() {
30
+ this.app.container.singleton(app_exports.Application, () => this.app);
31
+ this.app.container.alias("app", app_exports.Application);
32
+ }
33
+ registerLogger() {
34
+ this.app.container.singleton(logger_exports.Logger, async (resolver) => {
35
+ return (await resolver.make("logger")).use();
36
+ });
37
+ }
38
+ registerLoggerManager() {
39
+ this.app.container.singleton("logger", async () => {
40
+ const { LoggerManager } = await import("../modules/logger.js");
41
+ return new LoggerManager(this.app.config.get("logger"));
42
+ });
43
+ }
44
+ registerConfig() {
45
+ this.app.container.singleton(config_exports.Config, () => this.app.config);
46
+ this.app.container.alias("config", config_exports.Config);
47
+ }
48
+ registerEmitter() {
49
+ this.app.container.singleton(events_exports.Emitter, async () => {
50
+ return new events_exports.Emitter(this.app);
51
+ });
52
+ this.app.container.alias("emitter", events_exports.Emitter);
53
+ }
54
+ registerEncryption() {
55
+ this.app.container.singleton(encryption_exports.Encryption, () => {
56
+ const appKey = this.app.config.get("app.appKey");
57
+ return new encryption_exports.Encryption({ secret: appKey });
58
+ });
59
+ this.app.container.alias("encryption", encryption_exports.Encryption);
60
+ }
61
+ registerServer() {
62
+ this.app.container.singleton(main_exports.Server, async (resolver) => {
63
+ const encryption = await resolver.make("encryption");
64
+ const emitter = await resolver.make("emitter");
65
+ const logger = await resolver.make("logger");
66
+ const config = this.app.config.get("app.http");
67
+ return new main_exports.Server(this.app, encryption, emitter, logger, config);
68
+ });
69
+ this.app.container.alias("server", main_exports.Server);
70
+ }
71
+ registerRouter() {
72
+ this.app.container.singleton(main_exports.Router, async (resolver) => {
73
+ return (await resolver.make("server")).getRouter();
74
+ });
75
+ this.app.container.alias("router", main_exports.Router);
76
+ }
77
+ registerBodyParserMiddleware() {
78
+ this.app.container.singleton(bodyparser_middleware_default, () => {
79
+ return new bodyparser_middleware_default(this.app.config.get("bodyparser"), this.app.experimentalFlags);
80
+ });
81
+ }
82
+ registerDumper() {
83
+ this.app.container.singleton(Dumper, async () => {
84
+ const config = this.app.config.get("app.dumper", {});
85
+ const dumper = new Dumper(this.app);
86
+ if (config.html) dumper.configureHtmlOutput(config.html);
87
+ if (config.console) dumper.configureAnsiOutput(config.console);
88
+ return dumper;
89
+ });
90
+ this.app.container.alias("dumper", Dumper);
91
+ }
92
+ async emitRoutes(router) {
93
+ try {
94
+ const { routes, imports, types } = router.generateTypes(2);
95
+ const routesTypesPath = this.app.generatedServerPath("routes.d.ts");
96
+ const routesJsonPath = this.app.generatedServerPath("routes.json");
97
+ await mkdir(dirname(routesTypesPath), { recursive: true });
98
+ await Promise.all([writeFile(routesTypesPath, [
99
+ `import '@adonisjs/core/types/http'`,
100
+ ...imports,
101
+ "",
102
+ ...types,
103
+ "",
104
+ "export type ScannedRoutes = {",
105
+ routes,
106
+ "}",
107
+ `declare module '@adonisjs/core/types/http' {`,
108
+ " export interface RoutesList extends ScannedRoutes {}",
109
+ "}"
110
+ ].join("\n")), writeFile(routesJsonPath, JSON.stringify(router.toJSON()))]);
111
+ this.app.notify({
112
+ isAdonisJS: true,
113
+ routesFileLocation: routesJsonPath
114
+ });
115
+ } catch (error) {
116
+ console.error("Unable to generate routes types file due to the following error. This won't impact the dev-server");
117
+ console.error(error);
118
+ }
119
+ }
120
+ register() {
121
+ this.registerApp();
122
+ this.registerAce();
123
+ this.registerDumper();
124
+ this.registerLoggerManager();
125
+ this.registerLogger();
126
+ this.registerConfig();
127
+ this.registerEmitter();
128
+ this.registerEncryption();
129
+ this.registerTestUtils();
130
+ this.registerServer();
131
+ this.registerRouter();
132
+ this.registerBodyParserMiddleware();
133
+ }
134
+ async boot() {
135
+ events_exports.BaseEvent.useEmitter(await this.app.container.make("emitter"));
136
+ main_exports.HttpContext.instanceProperty("serialize", function(value, container) {
137
+ return (0, main_exports$1.serialize)(value, container ?? this.containerResolver);
138
+ });
139
+ }
140
+ async ready() {
141
+ if (!this.app.inProduction) {
142
+ const router = await this.app.container.make("router");
143
+ if (router.commited) await this.emitRoutes(router);
144
+ }
145
+ }
146
+ };
147
+ export { AppServiceProvider as default };