@towerjs/foundation
v0.1.1
Published
Core runtime, application lifecycle, dependency injection, and runtime detection for Tower
Readme
@towerjs/foundation
Core runtime for Tower applications. Manages the application lifecycle, dependency injection, configuration discovery, and runtime environment detection.
Installation
pnpm add @towerjs/foundationUsage
import { createTower } from '@towerjs/foundation'
const app = await createTower()createTower() discovers tower.config.ts from the working directory and initializes all registered modules.
API
createTower(config?)
Discovers tower.config.ts from the working directory, initializes all registered modules, and returns the TowerApp with each module attached.
createTowerApp(config, getModuleFactory?)
Creates a TowerApp from an explicit config and module factory registry. Used by the meta-package and CLI.
detectRuntime()
Detects the deployment environment (Vercel, AWS Lambda, Netlify, Cloudflare) and returns a TowerRuntime: { name: 'node-server' | 'vercel-serverless' | 'edge', isServerless: boolean }.
ServiceContainer
Lightweight DI container for registering and resolving services across modules.
Included in
- @towerjs/tower — meta-package
