Skip to content

refactor(command): migrate CLI entry point to the new command architecture - #16

Merged
skipbit merged 4 commits into
mainfrom
feature/main-migration
Jul 16, 2026
Merged

refactor(command): migrate CLI entry point to the new command architecture#16
skipbit merged 4 commits into
mainfrom
feature/main-migration

Conversation

@skipbit

@skipbit skipbit commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Wire the new command architecture into main.cpp as a Composition Root and
remove the legacy Operation-based command layer along with the domain modules
that depended on it and are no longer referenced.

Changes

  • main.cpp becomes a Composition Root (dependency injection only): it builds
    the runtime environment, parser, renderers, and the three resolvers
    (builtin, external, project), then runs the application.
  • Add NullMetadataProvider as the minimal external metadata provider; the
    real --scrap-metadata protocol is planned for 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 so a
    bad PATH entry cannot make the CLI fail.
  • Remove 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.
  • Align the README build/test and status docs with the new layout.

Testing

  • Release build (GCC 13) and the full test suite pass (93/93 via ctest).
  • Verified scrap --help (categorized listing, exit 0), scrap version /
    --version / -V (identical output, exit 0), and scrap nonexistent
    (error + guidance, exit 1).
  • clang-tidy (src/command) and clang-format are clean.

skipbit added 4 commits July 16, 2026 13:10
…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).
@skipbit
skipbit merged commit e5c175f into main Jul 16, 2026
6 checks passed
@skipbit
skipbit deleted the feature/main-migration branch July 16, 2026 05:24
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