mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
refactor(config): modularize config definition ownership by domain
Split config defaults, option metadata, runtime-option registry, and template sections into domain modules while preserving the composed public API in definitions.ts. This keeps ConfigService behavior stable and makes future config extensions easier to add with focused regression coverage.
This commit is contained in:
@@ -62,6 +62,7 @@ electron . --background # tray/background mode, minimal de
|
||||
|
||||
```bash
|
||||
bun run test:config # Source-level config schema/validation tests
|
||||
bun run test:launcher # Launcher regression tests (config discovery + command routing)
|
||||
bun run test:core # Source-level core regression tests (default lane)
|
||||
bun run test:subtitle # Subtitle pipeline tests (build + run)
|
||||
bun run test:fast # Source-level config + core lane (no build prerequisite)
|
||||
@@ -115,7 +116,10 @@ Run `make help` for a full list of targets. Key ones:
|
||||
|
||||
## Contributor Notes
|
||||
|
||||
- To add or change a config option, update `src/config/definitions.ts` first. Defaults, runtime-option metadata, and generated `config.example.jsonc` are derived from this centralized source.
|
||||
- To add/change a config default, edit the matching domain file in `src/config/definitions/defaults-*.ts`.
|
||||
- To add/change config option metadata, edit the matching domain file in `src/config/definitions/options-*.ts`.
|
||||
- To add/change generated config template blocks/comments, update `src/config/definitions/template-sections.ts`.
|
||||
- Keep `src/config/definitions.ts` as the composed public API (`DEFAULT_CONFIG`, registries, template export) that wires domain modules together.
|
||||
- Overlay window/visibility state is owned by `src/core/services/overlay-manager.ts`.
|
||||
- Main process composition is split across `src/main/` modules plus focused runtime composers under `src/main/runtime/composers/*` (for example AniList tracking and MPV runtime assembly clusters).
|
||||
- Runtime composer contracts should use shared helpers in `src/main/runtime/composers/contracts.ts` (`ComposerInputs`, `ComposerOutputs`, and `BuiltMainDeps`) so required deps remain compile-time enforced.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Agent Session: opencode-task78-config-domain-20260221T235604Z-p9x2
|
||||
|
||||
- alias: `opencode-task78-config-domain`
|
||||
- mission: `Execute TASK-78 modularize config definitions and validation by domain end-to-end without commit`
|
||||
- status: `done`
|
||||
- last_update_utc: `2026-02-22T00:06:30Z`
|
||||
|
||||
## Intent
|
||||
|
||||
- Pull TASK-78 from Backlog MCP; use writing-plans then executing-plans workflow.
|
||||
- Preserve `ConfigService` public API compatibility.
|
||||
- Split config definitions/validation into domain modules; add focused domain tests.
|
||||
|
||||
## Planned Files
|
||||
|
||||
- `src/config/definitions.ts`
|
||||
- `src/config/service.ts`
|
||||
- `src/config/**`
|
||||
- `docs/configuration.md`
|
||||
- `docs/development.md` (if test workflow/docs update needed)
|
||||
|
||||
## Assumptions
|
||||
|
||||
- Backlog initialized; TASK-78 exists and ready.
|
||||
- Existing config tests are baseline for behavior parity.
|
||||
|
||||
## Log
|
||||
|
||||
- `2026-02-21T23:56:04Z` started; loaded backlog overview + TASK-78 context; beginning planning workflow.
|
||||
- `2026-02-21T23:58:00Z` wrote execution plan at `docs/plans/2026-02-21-task78-config-domain-modularization-plan.md` using writing-plans skill.
|
||||
- `2026-02-22T00:03:00Z` implemented domain modularization: `src/config/definitions.ts` now composes domain modules under `src/config/definitions/*`.
|
||||
- `2026-02-22T00:04:00Z` parallel subagents completed docs + domain-registry tests (`src/config/definitions/domain-registry.test.ts`, `docs/development.md`).
|
||||
- `2026-02-22T00:05:00Z` verification: `bun test src/config/definitions/domain-registry.test.ts`, `bun run test:config:src`, `bun run test:core:src` passed.
|
||||
- `2026-02-22T00:05:00Z` blocker outside scope: `make generate-config` fails due pre-existing `src/main/state.test.ts` missing exports from `src/main/state`.
|
||||
- `2026-02-22T00:05:00Z` backlog TASK-78 set to Done with AC/DoD checked and final summary.
|
||||
- `2026-02-22T00:06:30Z` wired domain registry test into package config lanes (`test:config:src`, `test:config:dist`); reran `bun run test:config:src` (52 pass).
|
||||
Reference in New Issue
Block a user