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>
4.0 KiB
4.0 KiB
Code Generation Summary — Unit 1: Backend Dual-Instance Hosting
Created
src/SlpModularCms.Core/Hosting/ModuleOrchestrator.cssrc/SlpModularCms.Core/Hosting/ServiceCollectionExtensions.cssrc/SlpModularCms.Core/Hosting/ApiPrefixConvention.cssrc/SlpModularCms.Api.Slave/SlpModularCms.Api.Slave.csprojsrc/SlpModularCms.Api.Slave/Program.cssrc/SlpModularCms.Api.Slave/appsettings.jsonsrc/SlpModularCms.Api.Slave/appsettings.Development.jsonsrc/SlpModularCms.Api.Slave/appsettings.local.json.examplesrc/SlpModularCms.Api.Slave/Properties/launchSettings.jsonsrc/SlpModularCms.Core.Tests/Hosting/ApiPrefixConventionTests.cs(relocated fromModules.Identity.Tests)src/SlpModularCms.Core.Tests/Hosting/ModuleOrchestratorTests.cs(relocated fromModules.Identity.Tests)
Modified
src/SlpModularCms.Core/SlpModularCms.Core.csproj— addedAsp.Versioning.MvcandMicrosoft.AspNetCore.OpenApipackage referencessrc/SlpModularCms.Api/Program.cs—usingstatements updated toSlpModularCms.Core.Hosting(no logic change)src/SlpModularCms.Modules.Identity.Tests/SlpModularCms.Modules.Identity.Tests.csproj— removedProjectReferencetoSlpModularCms.Api(no longer needed; the only tests using it were relocated toCore.Tests)SlpModularCms.sln— addedSlpModularCms.Api.Slaveproject entry, build configurations, and solution-folder nesting undersrc
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 toCore.Tests/Hosting/)src/SlpModularCms.Modules.Identity.Tests/Infrastructure/ApiPrefixConventionTests.cs(relocated toCore.Tests/Hosting/)
Notes / Deviations from Plan
- Discovered during generation that
SlpModularCms.Modules.Identity.TestsreferencedSlpModularCms.Apisolely to testModuleOrchestrator/ApiPrefixConvention— an existing layering quirk, not something this feature introduced. Since those classes now live inCore, their tests were relocated toCore.Tests/Hosting/(which already referencesCoreand already has all needed test packages: FluentAssertions, NSubstitute, xunit). This removed the odd cross-project test dependency as a side effect. ServiceCollectionExtensions.csneeded explicitusing Microsoft.Extensions.Configuration;,using Microsoft.Extensions.DependencyInjection;,using Microsoft.AspNetCore.Builder;, andusing Microsoft.AspNetCore.Http;after the move —SlpModularCms.Apiis aMicrosoft.NET.Sdk.Webproject (implicit ASP.NET Core usings), whileSlpModularCms.Coreis a plainMicrosoft.NET.Sdkproject, so these weren't implicitly available.- Left
Asp.Versioning.MvcandMicrosoft.AspNetCore.OpenApipackage references in place onSlpModularCms.Api.csprojeven though they're now also referenced transitively viaCore— 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 httpsin bothSlpModularCms.ApiandSlpModularCms.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.
- Master (
- 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.