CodeVetter · Repo Unpack · Behavior traces
adonisjs/core
The principal flows were followed across entrypoints, providers, adapters, and output code. HTTP startup establishes lifecycle and dependency ordering before listening. Request validation moves from a provider-installed request macro to context-derived data and a compiled VineJS validator. Controller generation moves from Ace dispatch through command lifecycle and stub generation to a destination file. Additional traces cover generated route persistence, codegen ordering, package setup, shutdown, and test startup.
- HTTP startup: Ignitor.httpServer() → HttpServerProcess.start() → Ignitor.createApp('web') → app.init() → app.boot() → app.start(callback) → container.make('server') → server.boot().
- HTTP listen/readiness: start callback → createHTTPServer(server.handle.bind(server)) → server.setNodeServer → #listen → app.notify → logger.info → emitter.emit('http:server_ready') → #monitorAppAndServer.
- HTTP shutdown: app.terminating callback → #close → nodeHttpServer.close; a post-start server error instead sets process.exitCode=1, logs fatal, and calls app.terminate.
- Ace dispatch: AceProcess.handle(argv) → createApp('console') → app.init → createAceKernel(app, commandName) → bindValue('ace') → loading hook optionally boots/starts the app → configure callback → kernel.handle → conditional termination.
- Controller scaffolding: BaseCommand.exec hydrates and invokes prepare/run through the container; MakeController.prepare selects main/actions/resource/API stub; run creates Codemods, sets force, builds entity state, and calls makeUsingStub.
- Scaffold persistence: makeUsingStub → app.stubs.create → stubs.build → optional readFile/replaceWith → stub.generate → relative destination normalization → skipped/succeeded CLI action. The controller stub sets its output path through exports({to: ...}).
- Request validation: VineJSServiceProvider.boot installs HttpRequest.validateUsing → new RequestValidator(request.ctx) → #processValidatorOptions → options.data or #requestData → validator.validate. tryValidateUsing follows the equivalent path with validator.tryValidate.
- Development route persistence: AppServiceProvider.ready checks !inProduction and router.commited → emitRoutes → emitRouteTypes → mkdir/writeFile routes.d.ts → writeFile routes.json → app.notify; failures are caught and logged.
- Standalone generation: Codegen.run → importAssembler → new CodeGen with RC hooks → codegen.run callback after index output → #warmUpApp → setEnvironment('web')/setMode('warmup') → boot/warmUp → router.commit → emitRouteTypes → JSON route return.
- Package setup: Add.run resolves shorthand npm names → createCodemods → installPackages → sequential kernel.exec('configure') → built-in setup or app.import(package) → packageExports.configure(command) → aggregate success/failure reporting.
- Application test startup: TestRunnerProcess.run → createApp('test') → init → boot → start(configure callback) → user test callback; the method does not itself terminate the application.