Skip to content

fix: refactor generate-project resolution to use a cohesive options obje - #483

Merged
cdsap merged 1 commit into
mainfrom
issue/482-hermes-refactor-generate-project-resolution-a1
Sep 21, 2026
Merged

cdsap merged 1 commit into
mainfrom
issue/482-hermes-refactor-generate-project-resolution-a1

Conversation

@cdsap

@cdsap cdsap commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

Problem

GenerateProjectRequest.resolve in cli/src/main/kotlin/io/github/cdsap/projectgenerator/cli/GenerateProjectRequest.kt accepts 14 positional parameters, mixing CLI input, version resolution, validation, and output-path policy. Main.kt must mirror this long parameter list, making additions prone to ordering mistakes and increasing coupling at the CLI boundary.

Why this matters

The current signature is difficult to read and test, and a new CLI option requires coordinated edits with little compiler protection against mis wiring.

Proposed change

Introduce a GenerateProjectOptions value object containing the raw resolved CLI inputs, change GenerateProjectRequest.resolve to accept that object, and update Main.kt and focused tests to construct it. Keep version precedence, validation, default naming, output paths, and generated-project behavior unchanged.

Notes

This treats the CLI command as an application-boundary input and keeps domain configuration resolution behind one explicit command object, improving testability without introducing a new framework or changing the core generator.

Fixes #482

Changes

  • cli/src/main/kotlin/io/github/cdsap/projectgenerator/cli/GenerateProjectRequest.kt
  • cli/src/main/kotlin/io/github/cdsap/projectgenerator/cli/Main.kt
  • cli/src/test/kotlin/io/github/cdsap/projectgenerator/cli/GenerateProjectsCliTest.kt

Verification

  • ./gradlew :project-generator:unitTest
  • ./gradlew :cli:test
  • ./gradlew ktlintCheck

@cdsap
cdsap merged commit 1d35f1b into main Sep 21, 2026
14 checks passed
@cdsap
cdsap deleted the issue/482-hermes-refactor-generate-project-resolution-a1 branch September 21, 2026 20:30
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.

Refactor generate-project resolution to use a cohesive options object

1 participant