Files
SluijsensandClaude Sonnet 5 274946dbff Adds SlpModularCms.Api.Slave for local master/slave dev testing (Unit 1)
Relocates ModuleOrchestrator, ServiceCollectionExtensions, and
ApiPrefixConvention from SlpModularCms.Api into SlpModularCms.Core.Hosting
so a new Master-less SlpModularCms.Api.Slave host project (ports 5285/7222)
can share the same bootstrap code without duplicating it. This lets a
developer run a master instance and a slave instance side by side locally
to test the master/slave connection, without touching the existing
master/slave protocol itself.

Relocates the two orchestrator/convention test files from
Modules.Identity.Tests to Core.Tests, dropping an incidental
ProjectReference to SlpModularCms.Api that existed only for those tests.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 02:07:35 +02:00

4.0 KiB

Code Generation Summary — Unit 1: Backend Dual-Instance Hosting

Created

  • src/SlpModularCms.Core/Hosting/ModuleOrchestrator.cs
  • src/SlpModularCms.Core/Hosting/ServiceCollectionExtensions.cs
  • src/SlpModularCms.Core/Hosting/ApiPrefixConvention.cs
  • src/SlpModularCms.Api.Slave/SlpModularCms.Api.Slave.csproj
  • src/SlpModularCms.Api.Slave/Program.cs
  • src/SlpModularCms.Api.Slave/appsettings.json
  • src/SlpModularCms.Api.Slave/appsettings.Development.json
  • src/SlpModularCms.Api.Slave/appsettings.local.json.example
  • src/SlpModularCms.Api.Slave/Properties/launchSettings.json
  • src/SlpModularCms.Core.Tests/Hosting/ApiPrefixConventionTests.cs (relocated from Modules.Identity.Tests)
  • src/SlpModularCms.Core.Tests/Hosting/ModuleOrchestratorTests.cs (relocated from Modules.Identity.Tests)

Modified

  • src/SlpModularCms.Core/SlpModularCms.Core.csproj — added Asp.Versioning.Mvc and Microsoft.AspNetCore.OpenApi package references
  • src/SlpModularCms.Api/Program.csusing statements updated to SlpModularCms.Core.Hosting (no logic change)
  • src/SlpModularCms.Modules.Identity.Tests/SlpModularCms.Modules.Identity.Tests.csproj — removed ProjectReference to SlpModularCms.Api (no longer needed; the only tests using it were relocated to Core.Tests)
  • SlpModularCms.sln — added SlpModularCms.Api.Slave project entry, build configurations, and solution-folder nesting under src

Deleted

  • src/SlpModularCms.Api/Infrastructure/ModuleOrchestrator.cs (moved to Core)
  • src/SlpModularCms.Api/Extensions/ServiceCollectionExtensions.cs (moved to Core)
  • src/SlpModularCms.Api/Infrastructure/ApiPrefixConvention.cs (moved to Core)
  • src/SlpModularCms.Modules.Identity.Tests/Infrastructure/ModuleOrchestratorTests.cs (relocated to Core.Tests/Hosting/)
  • src/SlpModularCms.Modules.Identity.Tests/Infrastructure/ApiPrefixConventionTests.cs (relocated to Core.Tests/Hosting/)

Notes / Deviations from Plan

  • Discovered during generation that SlpModularCms.Modules.Identity.Tests referenced SlpModularCms.Api solely to test ModuleOrchestrator/ApiPrefixConvention — an existing layering quirk, not something this feature introduced. Since those classes now live in Core, their tests were relocated to Core.Tests/Hosting/ (which already references Core and already has all needed test packages: FluentAssertions, NSubstitute, xunit). This removed the odd cross-project test dependency as a side effect.
  • ServiceCollectionExtensions.cs needed explicit using Microsoft.Extensions.Configuration;, using Microsoft.Extensions.DependencyInjection;, using Microsoft.AspNetCore.Builder;, and using Microsoft.AspNetCore.Http; after the move — SlpModularCms.Api is a Microsoft.NET.Sdk.Web project (implicit ASP.NET Core usings), while SlpModularCms.Core is a plain Microsoft.NET.Sdk project, so these weren't implicitly available.
  • Left Asp.Versioning.Mvc and Microsoft.AspNetCore.OpenApi package references in place on SlpModularCms.Api.csproj even though they're now also referenced transitively via Core — removing them was optional per the plan and the build succeeds either way; left as-is to minimize unrelated diff.

Verification Performed

  • dotnet build SlpModularCms.sln — succeeds, no errors.
  • dotnet test SlpModularCms.sln — all 4 existing test projects pass unchanged: Core.Tests (54), Modules.Availability.Tests (60), Modules.Identity.Tests (37), Modules.Master.Tests (42).
  • Manually ran dotnet run --launch-profile https in both SlpModularCms.Api and SlpModularCms.Api.Slave:
    • Master (SlpModularCms.Api): discovers and loads all 3 modules — Availability, Identity, Master.
    • Slave (SlpModularCms.Api.Slave): discovers and loads exactly 2 modules — Availability, Identity. Master is correctly excluded.
  • Full end-to-end run (requiring a real local SQL Server/localdb instance and manual "Add CMS Instance" registration) is deferred to Build and Test / Unit 2, per the plan.