Summary
sm new project (CLI v0.0.36) scaffolds src/<Project>.Host/Styles/app.css with paths that assume the project lives inside the SimpleModule monorepo:
@import "tailwindcss";
@import "../../../packages/SimpleModule.Theme.Default/theme.css";
@source "../../../packages/SimpleModule.UI/";
@source "../../../packages/SimpleModule.Client/";
@source "../../../../modules/**/Views/**/*.tsx";
@source "../../../../modules/**/Pages/**/*.tsx";
For a downstream consumer (someone running sm new project Foo outside the SimpleModule git checkout), these paths don't exist. The equivalents are in node_modules/@simplemodule/theme-default/, node_modules/@simplemodule/ui/, and node_modules/@simplemodule/client/ — i.e. consumed via the published npm packages.
Tailwind then errors with:
EXEC : error : Can't resolve '../../../packages/SimpleModule.Theme.Default/theme.css' in '.../Styles'
The @source glob for modules is also off by one level — it's ../../../../modules/** (four ups) but the host lives at src/<Project>.Host/Styles/, so the modules directory at src/modules/ is only three ups (../../modules/**).
Repro
sm new project Repro # outside the SimpleModule monorepo
cd Repro
# (after #150 + #151 worked around)
dotnet build
# → Tailwind can't resolve packages/SimpleModule.Theme.Default/theme.css
Expected
The default Styles/app.css resolves on a clean install. Either:
- Detect "inside monorepo" vs "outside" at scaffold time (the CLI already does this — see
SolutionContext.Discover() in NewProjectCommand.cs) and emit different paths accordingly.
- Always use npm-package paths in the scaffold, since the monorepo also has the npm packages installed under
node_modules/@simplemodule/* (via npm workspaces).
Option 2 is simpler and works for both audiences.
Suggested replacement
@import "tailwindcss";
@import "../../../node_modules/@simplemodule/theme-default/theme.css";
@source "../../../node_modules/@simplemodule/ui/";
@source "../../../node_modules/@simplemodule/client/";
@source "../../modules/**/Views/**/*.tsx";
@source "../../modules/**/Pages/**/*.tsx";
(I verified this builds clean against the published 0.0.36 npm packages.)
Environment
sm --version: 0.0.36
dotnet --version: 10.0.201
- Project scaffolded outside the SimpleModule monorepo
Related
#149, #150, #151 — all gaps that surface on a clean sm new project outside the monorepo.
Summary
sm new project(CLI v0.0.36) scaffoldssrc/<Project>.Host/Styles/app.csswith paths that assume the project lives inside the SimpleModule monorepo:For a downstream consumer (someone running
sm new project Foooutside the SimpleModule git checkout), these paths don't exist. The equivalents are innode_modules/@simplemodule/theme-default/,node_modules/@simplemodule/ui/, andnode_modules/@simplemodule/client/— i.e. consumed via the published npm packages.Tailwind then errors with:
The
@sourceglob for modules is also off by one level — it's../../../../modules/**(four ups) but the host lives atsrc/<Project>.Host/Styles/, so the modules directory atsrc/modules/is only three ups (../../modules/**).Repro
Expected
The default
Styles/app.cssresolves on a clean install. Either:SolutionContext.Discover()inNewProjectCommand.cs) and emit different paths accordingly.node_modules/@simplemodule/*(via npm workspaces).Option 2 is simpler and works for both audiences.
Suggested replacement
(I verified this builds clean against the published 0.0.36 npm packages.)
Environment
sm --version: 0.0.36dotnet --version: 10.0.201Related
#149, #150, #151 — all gaps that surface on a clean
sm new projectoutside the monorepo.