Deployment
Build TypeScript before productionhile start. In development, hile start --dev imports src/**/*.boot.ts; in production it imports dist/**/*.boot.js.
Runtime And Lifecycle Notes
defineService(key, fn)registers a service factory and does not execute it.loadService(service)executes the factory on first call and returns the cached value afterwards.- The
shutdowncallback registers teardown functions; they run in LIFO order. - The container tracks dependencies when service factories call
loadService(). container.shutdown()triggers registered teardowns.@hile/bootstraploads env files first, setsNODE_ENV, imports auto-load packages, scans boot files, and installs exit hooks.@hile/logger.createLogger()returns{ logger, teardown }.@hile/ioredis.createRedis()waits forconnect.@hile/typeorm.createDataSource()initializes a TypeORMDataSource.
Runtime And Lifecycle Notes
HttpNextwraps an internalHttpinstance.- It serves
publicPath, then.next/static, then Hile controllers, then Next.js as the fallback handler. - Development mode is determined by
process.env.NODE_ENV === 'development'. - Controller directory is
{cwd}/src/{controllerDirectory}in development and{cwd}/dist/{controllerDirectory}in production. specialControllersload additional controller roots with their own prefixes.
Production Checklist
- Register every server/client close function with
shutdown. - Load controllers before
listen()in new code. - Size Redis lock TTLs for the actual job duration.
- Monitor queue DLQs and idempotency release failures.
- Keep DB constraints or provider idempotency keys for irreversible side effects.