Curated, product-agnostic snapshot of the post-story-04 tree: demo content deleted, auth-only reference feature, web-next shell, all gates green. Product-specific docs, ADRs 027-029, PRDs/epics/archive, editor library traces, and product naming are curated out; generic template repairs (coverage provider devDeps, root test:coverage script, live lint fixes, root-only release-please) are kept. See TEMPLATE.md for provenance, curation list, and usage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
31 lines
1.1 KiB
Markdown
31 lines
1.1 KiB
Markdown
# ADR-002: InversifyJS for Dependency Injection
|
|
|
|
## Status: Accepted
|
|
|
|
## Context
|
|
|
|
Need DI for clean architecture. Options: InversifyJS, tsyringe, manual composition root.
|
|
|
|
## Decision
|
|
|
|
InversifyJS with symbol-based resolution + targeted agent documentation.
|
|
|
|
## Rationale
|
|
|
|
- Scales to 20+ services with automatic dependency chain resolution
|
|
- Built-in singleton/transient/request scopes
|
|
- Middleware support for logging/tracing (Sentry integration)
|
|
- Matches the Clean Architecture reference implementation
|
|
- Agent readability gap (4/10 → 7/10) mitigated by resolution tables and step-by-step recipes in di/AGENTS.md
|
|
- Familiar to developers from Java/C# backgrounds
|
|
|
|
## Trade-offs
|
|
|
|
- Requires reflect-metadata + decorator config in tsconfig
|
|
- Symbol indirection harder to trace than plain functions
|
|
- Extra dependency (inversify + reflect-metadata)
|
|
|
|
## Update (2026-05-04)
|
|
|
|
The vertical-feature refactor preserved InversifyJS but moved from a single shared container in `packages/core/src/di/` to **per-feature containers** in each feature package (`packages/<feature>/src/di/container.ts`). See ADR-008.
|