1.7 KiB
1.7 KiB
TASK METADATA
- Target Files:
infra/setup.ts,infra/setup/cli.ts,infra/setup/compose.ts,infra/setup/env.ts - Core Objective: Phase 4 (Infrastructure Scripts Refactoring): Decompose
the monolithic 1,021-line
infra/setup.tsinstaller into modular sub-modules underinfra/setup/separating CLI interactive prompts, Docker compose generation, and environment file management. - Dependencies:
tasks/new/2026-0825.01.jul.story.arch.monolith-decomposition-roadmap-1845.md - Additional Important Notes: Must verify with
deno check infra/setup.tsand ensure dry-run generation produces identical compose and env files.
2. Architectural Considerations & Risks
- Risks:
- Generating corrupted
docker-compose.ymlor.envfiles if template strings or formatting helpers are incorrectly moved.
- Generating corrupted
- Alternatives:
- Keeping setup.ts as a single monolithic script; rejected due to maintenance difficulty and cognitive overload.
3. Proposed Implementation
- Extract Modular Setup Sub-modules (
infra/setup/):infra/setup/cli.ts: Extract interactive command-line prompts, flags parsing, and user confirmation dialogs.infra/setup/compose.ts: Extract Docker compose YAML string generation and network/volume configuration.infra/setup/env.ts: Extract.envfile generation, cryptographic secret generation (keys, salts, PRF secrets), and domain configuration.
- Refactor
infra/setup.ts:- Keep
infra/setup.tsas the clean CLI runner that orchestrates the extracted modules.
- Keep
- Quality Gates & Validation:
- Run
deno check infra/setup.ts. - Run
deno fmt infra/and verify generated configs against dummy test parameters.
- Run