fix(cli): resolve scaffold build/runtime bugs (#218, #219, #221, #225, #228)#231
Merged
Conversation
…#228) - #218: generated event records now derive from DomainEvent (IEvent gained EventId/OccurredAt, so implementing IEvent directly no longer compiles). - #219: pin @simplemodule/* npm deps to the latest *published* npm version via a new NpmVersionResolver instead of assuming the NuGet framework version exists on npm (which made npm install fail with notarget). - #221: SimpleModule.Hosting.targets no longer relies on an undefined $(RepoRoot) or monorepo-only paths. Falls back to the nearest package.json directory and exposes overridable SimpleModuleThemeCss/ModulesDir/RoutesOutput properties with consumer-scaffold defaults; the monorepo overrides them in Directory.Build.props. The integrated Tailwind/Vite build now runs in consumers. - #225: ship wwwroot/favicon.svg in the scaffold (index.html + Program.cs reference it). - #228: module RCL AssemblyName now equals the directory basename (bare name) so the Vite pages bundle serves at /_content/{name}/ and resolves; the contracts AssemblyName is made bare in lockstep so the source generator's "module + .Contracts" pairing still discovers contract implementations.
Deploying simplemodule-website with
|
| Latest commit: |
2842df7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bf79fc24.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-cli-bug-fixes-2okyg.simplemodule-website.pages.dev |
This was referenced Jun 3, 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.
Fixes the five open CLI-labeled bugs that break a freshly scaffolded project.
Issues addressed
IEventdirectly, which no longer compiles (IEventgainedEventId/OccurredAt)DomainEvent@simplemodule/*npm deps to the framework (NuGet) version, but npm lags →npm installfails withnotargetNpmVersionResolverresolves the latest published npm version (dist-tags.latest); threaded throughProjectTemplates/ScaffoldProject, falling back to the framework version offlineSimpleModule.Hosting.targetsuses an undefined$(RepoRoot)+ monorepo-only paths → integrated Tailwind/Vite build never runs in a consumer$(RepoRoot)now falls back to the nearestpackage.jsondirectory; theme/modules/routes paths become overridable properties with consumer-scaffold defaults; the monorepo overrides them inDirectory.Build.props(scoped via apackages/existence check so the override doesn't leak into copied consumer props)index.html+Program.csreference/favicon.svg, but the scaffold ships none → 404wwwroot/favicon.svgAssemblyName=SimpleModule.Xwhile dir basename =X, so the Vite pages bundle 404sAssemblyNameis now the bare directory basename; contractsAssemblyNamemade bare in lockstepNote on #228
The issue suggested simply making the module
AssemblyNamebare. That alone is insufficient: the source generator pairs a module with its contracts assembly viamoduleAssembly.Name + ".Contracts"(ContractFinder). A bare module assembly (Items) looking forItems.Contractswhile contracts is stillSimpleModule.Items.Contractsbreaks implementation discovery →SM0025. Both assembly names must go bare together; the C# namespaces staySimpleModule.X(.Contracts).Verification
dotnet buildof the CLI — succeedsdotnet buildagainst published NuGet packages (previously red due to sm new project/module: generated event records implement IEvent directly and don't compile (should derive from DomainEvent) #218/sm new module: AssemblyName (SimpleModule.<Name>) != dir basename (<Name>), so the Vite pages bundle 404s #228, now green)dotnet buildof the monorepo template host — succeeds; the integrated Vite + Tailwind build runs (exercises the Hosting.targets uses undefined $(RepoRoot) + monorepo-relative paths → consumer frontend build never runs; app.js 302s to login #221 targets)DomainEventderivation, and npm/framework version independencehttps://claude.ai/code/session_01R31rFjscfpDZwxGTE6C69f
Generated by Claude Code