Skip to content

fix(cli): resolve scaffold build/runtime bugs (#218, #219, #221, #225, #228)#231

Merged
antosubash merged 1 commit into
mainfrom
claude/cli-bug-fixes-2OKyG
Jun 3, 2026
Merged

fix(cli): resolve scaffold build/runtime bugs (#218, #219, #221, #225, #228)#231
antosubash merged 1 commit into
mainfrom
claude/cli-bug-fixes-2OKyG

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Fixes the five open CLI-labeled bugs that break a freshly scaffolded project.

Issues addressed

# Problem Fix
#218 Generated event records implement IEvent directly, which no longer compiles (IEvent gained EventId/OccurredAt) Event template now derives from DomainEvent
#219 Scaffold pins @simplemodule/* npm deps to the framework (NuGet) version, but npm lags → npm install fails with notarget New NpmVersionResolver resolves the latest published npm version (dist-tags.latest); threaded through ProjectTemplates/ScaffoldProject, falling back to the framework version offline
#221 SimpleModule.Hosting.targets uses an undefined $(RepoRoot) + monorepo-only paths → integrated Tailwind/Vite build never runs in a consumer $(RepoRoot) now falls back to the nearest package.json directory; theme/modules/routes paths become overridable properties with consumer-scaffold defaults; the monorepo overrides them in Directory.Build.props (scoped via a packages/ existence check so the override doesn't leak into copied consumer props)
#225 index.html + Program.cs reference /favicon.svg, but the scaffold ships none → 404 Embed and write wwwroot/favicon.svg
#228 Module RCL AssemblyName = SimpleModule.X while dir basename = X, so the Vite pages bundle 404s Module AssemblyName is now the bare directory basename; contracts AssemblyName made bare in lockstep

Note on #228

The issue suggested simply making the module AssemblyName bare. That alone is insufficient: the source generator pairs a module with its contracts assembly via moduleAssembly.Name + ".Contracts" (ContractFinder). A bare module assembly (Items) looking for Items.Contracts while contracts is still SimpleModule.Items.Contracts breaks implementation discovery → SM0025. Both assembly names must go bare together; the C# namespaces stay SimpleModule.X(.Contracts).

Verification

https://claude.ai/code/session_01R31rFjscfpDZwxGTE6C69f


Generated by Claude Code

…#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.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

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

View logs

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.

2 participants