Files
SubMiner/backlog/tasks/task-103 - Extract-Jellyfin-runtime-wiring-from-main.ts-composition-root.md
2026-02-21 23:31:09 -08:00

1.9 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
id title status assignee created_date updated_date labels dependencies priority
TASK-103 Extract Jellyfin runtime wiring from main.ts composition root To Do
2026-02-22 07:13 2026-02-22 07:13
refactor
maintainability
jellyfin
TASK-102
TASK-94
TASK-97
medium

Description

src/main.ts remains oversized (3014 LOC) and still carries a dense Jellyfin wiring block (roughly main.ts:1145-1565) despite composition-root refactors.

Goal: finish extraction of Jellyfin-specific dependency construction and command/setup orchestration into dedicated runtime composer modules so main.ts remains thin and legible.

Action Steps

  1. Extract Jellyfin config/client-info/auth/list/play/setup dependency builders from src/main.ts into focused files under src/main/runtime/composers/.
  2. Create one Jellyfin composition entrypoint that returns fully wired handlers used by main.ts.
  3. Remove duplicated inline adapter lambdas from main.ts; keep only high-level invocation points.
  4. Add/expand composer seam tests for extracted Jellyfin module boundaries.
  5. Re-run fan-in and compile checks to ensure extraction does not regress runtime wiring.

Acceptance Criteria

  • #1 src/main.ts no longer contains the full Jellyfin deps-building block.
  • #2 New Jellyfin composer modules have focused tests covering handler wiring.
  • #3 bun run check:main-fanin stays green after extraction.
  • #4 bun run build and bun run test:core:src pass.

Definition of Done

  • #1 src/main.ts LOC reduced materially from current baseline.
  • #2 Jellyfin runtime wiring is centralized in named composer module(s) with clear ownership docs.
  • #3 No behavior regressions in Jellyfin command/setup flows.