fix(cli): unblock fresh sm new project / sm new module builds#154
Merged
antosubash merged 1 commit intomainfrom May 9, 2026
Merged
fix(cli): unblock fresh sm new project / sm new module builds#154antosubash merged 1 commit intomainfrom
antosubash merged 1 commit intomainfrom
Conversation
Closes #148, #149, #150, #151, #152. - #148 sm new module: avoid entity-name collision when the singular form equals the module name (e.g. PageBuilder, Marketplace). Add ModuleTemplates.GetEntityName which suffixes "Item" in the colliding case so the entity type doesn't shadow the module namespace. - #149 sm new module: emit explicit RootNamespace and AssemblyName in generated module/contracts/test csproj so SM0052 and SM0053 pass even though the csproj filename omits the SimpleModule. prefix. - #150 sm new project: stop depending on @simplemodule/tsconfig (not published to npm). Inline the tsconfig content in both the root and per-module generated tsconfig.json files. - #151 sm new project: add @tailwindcss/cli to template devDependencies so SimpleModule.Hosting.targets can invoke node_modules/.bin/tailwindcss. - #152 sm new project: rewrite Styles/app.css source/import paths to use node_modules/@simplemodule/* (3 ups) and src/modules/ (2 ups); fixes the off-by-one rewrite that produced ../../../../modules.
Deploying simplemodule-website with
|
| Latest commit: |
017dbd7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://754735e1.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-github-issues-ignzy.simplemodule-website.pages.dev |
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.
Summary
Fixes the five open scaffolding gaps that prevent a freshly-scaffolded SimpleModule project from building cleanly.
Closes #148, #149, #150, #151, #152.
Per-issue changes
sm new module: name-singular collision when module name equals its singular form (e.g. PageBuilder) #148 — entity name collides with module namespace. When the singular form of the module name equals the module name itself (e.g.
PageBuilder,Marketplace,Map), the generated entity class shadows theSimpleModule.<Name>namespace and fails CS0118. AddedModuleTemplates.GetEntityName(moduleName)which returnsGetSingularName(moduleName)when it differs, otherwise${moduleName}Item. Wired intoNewModuleCommand,NewProjectCommand,NewFeatureCommand, and the reference-template lookups inModuleTemplates/FeatureTemplates.GetSingularNameitself is unchanged so existing tests still pass.sm new module: assembly name doesn't match namespace prefix, fails SM0052/SM0053 analyzer out of the box #149 — assembly name doesn't match SM0052/SM0053 expectations. Generated module/contracts/test csproj filenames are
<Name>.csproj, but the analyzer expects assemblies namedSimpleModule.<Name>. Added aProjectGrouppost-process that injects explicit<RootNamespace>and<AssemblyName>properties when missing, plus baked them into the fallback templates. The csproj filename stays the same so existing structure tests keep passing.@simplemodule/tsconfig is referenced by sm-scaffolded projects but not published to npm #150 —
@simplemodule/tsconfignot on npm. Removed the@simplemodule/tsconfigdependency from the generated rootpackage.json. Replaced theextends "@simplemodule/tsconfig/base"in both the root and per-moduletsconfig.jsonwith the equivalent inlinedcompilerOptions.npm installnow succeeds against a clean scaffold.sm new project: missing @tailwindcss/cli dep, breaks SimpleModule.Hosting Tailwind build target #151 — missing
@tailwindcss/cli. Added@tailwindcss/clito the generated rootpackage.jsondevDependencies(alongside@tailwindcss/vite). The Tailwind v4 split means thetailwindcsspackage no longer ships a standalone bin, soSimpleModule.Hosting.targetswas failing with exit code 127.sm new project: Styles/app.css uses monorepo-relative paths that don't resolve for downstream consumers #152 —
Styles/app.cssmonorepo-relative paths. RewroteHostTemplates.AppCss()to do explicit per-directive substitution rather than blind prefix replacement (the old../../modules/→../../../modules/rewrite produced an off-by-one../../../../modules/). Generated app.css now usesnode_modules/@simplemodule/{theme-default,ui,client}(3 ups fromStyles/) and../../modules/**(2 ups), matching the actual scaffolded layout.Verification
dotnet testforSimpleModule.Cli.Tests: 128/128 passing, includingScaffoldedProject_DotnetBuildSucceeds(the slow end-to-end scaffold +dotnet buildagainst the live source generator).sm new project Reproagainst this branch produces apackage.jsonwithout@simplemodule/tsconfig, with@tailwindcss/cli, and aStyles/app.csswhose paths resolve fromsrc/<Name>.Host/Styles/.sm new module PageBuilderin that scaffolded project producesPageBuilderItementity (no namespace collision) and module/contracts csprojs with explicit<RootNamespace>SimpleModule.PageBuilder</RootNamespace>/<AssemblyName>SimpleModule.PageBuilder</AssemblyName>.Test plan
claude/github-issues-IGNzY.SimpleModule.Cliand confirm they no longer reproduce.Generated by Claude Code