refactor(command): migrate CLI entry point to the new command architecture - #16
Merged
Conversation
…egacy layer Replace the legacy Operation-based command dispatch with the Composition Root that drives the four-phase command pipeline. - main.cpp: build RuntimeEnvironment, parser, renderers, and the three resolvers (builtin, external, project), then run the application - add NullMetadataProvider as the minimal external metadata provider (the real --scrap-metadata protocol lands in a later phase) - extract environment assembly into a pure, unit-tested RuntimeEnvironmentFactory so main.cpp stays wiring-only - guard against null command handlers in Application - harden external-command filesystem scanning with error_code overloads - delete the legacy shared/command layer and the now-orphaned domain modules (project, toolchain, template, configuration, repository, shared/presentation) - trim the build to the surviving sources and link only CLI11 - drop the Catch2 test target; keep the GoogleTest suites and add a RuntimeEnvironmentFactory test
- drop the redundant <expected> include from NullMetadataProvider (provided transitively via the interface header; matches the existing resolver convention and avoids the misc-include-cleaner false positive) - use emplace_back in RuntimeEnvironmentFactory (modernize-use-emplace)
Addresses documentation drift widened by the command-architecture migration: - switch the testing docs from Catch2/scrap_test to GoogleTest run via ctest (scrap_gtest / scrap_gtest_cli11) - update the test structure list to the surviving test/unit/command layout, dropping the removed helpers and fixtures directories - move the domain commands (new, build, run, clean, templates, config) from the implemented list to in-progress, reflecting their placeholder state after the legacy domain layers were removed
Split the Phase 1 roadmap entry so the template system is marked in-progress, matching the project status section (it is a placeholder command, not yet implemented).
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.
Summary
Wire the new command architecture into
main.cppas a Composition Root andremove the legacy Operation-based command layer along with the domain modules
that depended on it and are no longer referenced.
Changes
main.cppbecomes a Composition Root (dependency injection only): it buildsthe runtime environment, parser, renderers, and the three resolvers
(builtin, external, project), then runs the application.
NullMetadataProvideras the minimal external metadata provider; thereal
--scrap-metadataprotocol is planned for a later phase.RuntimeEnvironmentFactorysomain.cppstays wiring-only.Application.error_codeoverloads so abad
PATHentry cannot make the CLI fail.shared/commandlayer and the now-orphaned domain modules(project, toolchain, template, configuration, repository, shared/presentation).
RuntimeEnvironmentFactorytest.Testing
scrap --help(categorized listing, exit 0),scrap version/--version/-V(identical output, exit 0), andscrap nonexistent(error + guidance, exit 1).
src/command) and clang-format are clean.