Collapse Program to a thin entry point; extract residual helpers into services (#392)#404
Draft
ChrisonSimtian wants to merge 1 commit into
Draft
Collapse Program to a thin entry point; extract residual helpers into services (#392)#404ChrisonSimtian wants to merge 1 commit into
ChrisonSimtian wants to merge 1 commit into
Conversation
… services Final step of the #392 CLI refactor. With every command now its own type, this removes the last of the god-class: - Extract the residual shared helpers off Program into focused, injectable types: ConfigurationReader (IConfigurationReader), BuildScaffolder (IBuildScaffolder), PackageManager (IPackageManager), and a static CakeConverter. PrintInfo becomes ToolBanner; the build-script-name convention becomes CliConventions. - Rewire every command to take these via the constructor instead of calling Program.X(...). CakeConvertCommand depends on SetupCommand directly (registered as a concrete singleton and re-exposed as IFalloutCommand). - Delete the transitional scaffolding: the Program.* residual partials, the Program.Setup shim, the static prompt delegators, and DelegateCommand. Program is now just Main + the DI composition root + root-directory resolution, and is no longer partial. - Migrate the tests that reached into Program internals to the new types (UpdateSolutionFileContent → BuildScaffolder; cake helpers → CakeConverter; package-type constants → PackageManager) and add ConfigurationReaderTests. Tests: 45 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capstone of the #392 stack — removes the last of the
Programgod-class now that every command is its ownIFalloutCommand. Stacked on #403; rebase ontomainonce the chain lands (draft until then).What changed
Programinto injectable services:ConfigurationReader(build-script# CONFIGURATIONparsing),BuildScaffolder(scripts/config/solution/templates),PackageManager(package add/replace), staticCakeConverter, plusToolBanner(wasPrintInfo) andCliConventions.Program.X(...).Program.*residual partials, theProgram.Setupshim, the static prompt delegators, andDelegateCommand.Programis now justMain+ the DI composition root + root-directory resolution — no longerpartial.ConfigurationReaderTests.Programdrops from a 14-method partial across ~10 files to a ~90-line entry point.Verification
dotnet build src/Fallout.Cliclean ·Fallout.Cli.Tests45 pass ·fallout :boguslists all 15 commands.Note
add-package,setup, and the navigation commands still aren't unit-tested at the command level (they call MSBuild/NuGet/env-var access inline) — fuller coverage needs more seams, out of scope here.Part of #392.
🤖 Generated with Claude Code