Skip to content

refactor(config): split ProtostarConfig into UserConfig and TemplateBlueprint - #158

Merged
JacksonFergusonDev merged 8 commits into
mainfrom
refactor-config
Aug 14, 2026
Merged

refactor(config): split ProtostarConfig into UserConfig and TemplateBlueprint#158
JacksonFergusonDev merged 8 commits into
mainfrom
refactor-config

Conversation

@JacksonFergusonDev

Copy link
Copy Markdown
Owner

Description

This PR resolves the "God Object" anti-pattern in ProtostarConfig by separating global user configuration from template-specific scaffolding state.

Architecture Changes

  • Split Configuration: Renamed ProtostarConfig to UserConfig to represent global, persistent settings (e.g., ide, author_name, and tooling toggles).
  • Extracted TemplateBlueprint: Encapsulates ephemeral, target-specific state (e.g., active_presets, files, dev_dependencies, and template variables).

Engine Updates

  • Orchestrator & CLI Refactored: Updated cli.py, orchestrator.py, and wizard.py to independently ingest and handle both UserConfig and TemplateBlueprint configurations across the scaffolding lifecycle.
  • Dynamic Variable Resolution: Intercepts missing template variables during blueprint loading to seamlessly trigger the interactive TUI wizard when necessary.
  • Preset Isolation: Decoupled the PresetModule interface in base.py from attempting to read a global presets mapping that shouldn't exist, preventing attribute leakage.

Testing & Validation

  • Fully updated tests/ (specifically test_config.py, test_cli.py, test_orchestrator.py, and test_presets.py).
  • Improved isolated file I/O mocking inside with an autouse fixture.
  • just test-unit completely passes, along with mypy and ruff static analysis checks.

@JacksonFergusonDev
JacksonFergusonDev merged commit 0a1b122 into main Aug 14, 2026
10 checks passed
@JacksonFergusonDev
JacksonFergusonDev deleted the refactor-config branch August 14, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant