Files
SubMiner/docs/architecture/layering.md
T
sudacode c02edc90cc docs: audit and refresh user-facing and internal docs
Cross-check every config key, shortcut, default, and command against the
current source and fix the drift (mpv.socketPath, auto_start_overlay
default, AniSkip TAB key, JLPT N4 color, secondary-sub font/defaults,
secondary-sub language behavior, modular mpv plugin layout, and more).
Add plain-language intros and first-use definitions across onboarding and
integration pages so non-technical readers can follow along.

Internal docs/: fix stale module paths in architecture/domains.md, add
missing contract entry points and catalog rows, and bump verified dates.
Remove the obsolete docs/plans/ directory (its only plan shipped in
0.15.0) and reframe planning.md so plans live with the work, not in docs/.
2026-05-23 21:21:16 -07:00

1.3 KiB

Layering Rules

Status: active
Last verified: 2026-05-23
Owner: Kyle Yasuda
Read when: deciding whether a dependency direction is acceptable

Preferred Dependency Flow

  1. src/main.ts
  2. src/main/ composition and runtime adapters
  3. src/core/services/ focused services
  4. src/core/utils/ and other pure helpers

Renderer, launcher, plugin, and stats each keep their own local layering and should not become a grab bag for unrelated cross-runtime behavior.

Rules

  • Keep src/main.ts thin; wire, do not implement.
  • Prefer injecting dependencies from src/main/ instead of reaching outward from core services.
  • Keep side effects explicit and close to composition boundaries.
  • Put reusable business logic in focused services, not in top-level lifecycle files.
  • Keep renderer concerns in src/renderer/; avoid leaking DOM behavior into main-process code.
  • Treat launcher/*.ts as source of truth for the launcher. Never hand-edit dist/launcher/subminer.

Smells

  • main.ts grows because logic was not extracted
  • service reaches directly into unrelated runtime state
  • renderer code depends on main-process internals
  • docs-site page becomes the only place internal architecture is explained