-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
onlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week
Description
🗂️ Issue: Remove container.ts (legacy DI) and adopt module-scoped factories
Description
There is a legacy container.ts (global DI container) that conflicts with the current modular architecture. Global containers hide dependencies, complicate tests, and break tree-shaking.
What is expected
- Remove
container.tsand any global container registrations. - Introduce module-scoped factories (simple functions) to compose controllers/use-cases/repositories explicitly.
- Update imports at app bootstrap to use these factories.
- Tests updated to instantiate modules without global side effects.
What should be modified
- Delete
container.tsand its references. - For each module, add a
factory.ts(or similar) that wires repository → use-cases → controller(s). - Update routers to import controller handlers from the module factory.
Tests
- Ensure unit/integration tests create module instances via factories (no global container).
- Verify parallel test runs don’t share state.
Acceptance criteria
-
container.tsremoved from the codebase. - All modules compose via local factories.
- App boots and routes work as before.
- Tests pass without global DI.
Rollback plan
- Keep a branch/tag before removal.
- If needed, temporarily keep a minimal shim that proxies to module factories while all imports are updated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
onlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week