Context

A DI container exists to invert construction and manage lifetimes. Bun's module system already constructs and caches module-level values exactly once, in dependency order.

Decision

Cross-module dependencies are plain import statements. A singleton service is a module-level value; a configurable one is a factory export. No tokens, no @Injectable, no resolver, no scopes.

Consequences

Nothing new to learn; "go to definition" works; types are honest. No build-time graph resolver to write or maintain. Cost: no automatic request-scoped instances and no container-level test overrides — you construct per-request state and inject fakes by hand (usually a feature, not a loss).

Patties design specifications · a design exploration · All decisions