fix(create): generate minimal scaffolding when declining demo/example pages#429
fix(create): generate minimal scaffolding when declining demo/example pages#429wyMinLwin wants to merge 2 commits intoTanStack:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/create/tests/template-context.test.ts (1)
316-376: Add framework-level fixture assertions for minimal scaffold output.This suite validates context plumbing and
ignoreFile()control flow, but it does not yet verify the user-facing contract (e.g., actual omission of React/SolidHeader,Footer,ThemeToggle, and/aboutfrom generated scaffolds). Adding one fixture-style generation test per framework would reduce regression risk.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/create/tests/template-context.test.ts` around lines 316 - 376, The tests exercise includeExamples and ignoreFile() logic but lack higher-level fixture assertions that verify generated scaffolds actually omit user-facing pieces (e.g., React/Solid Header, Footer, ThemeToggle, and /about); add one integration-style test per framework that uses createMemoryEnvironment() and createTemplateFile() to generate a minimal scaffold with includeExamples: false and then assert output.files does not contain the framework-specific files/components (e.g., verify '/about', 'Header', 'Footer', 'ThemeToggle' module paths are absent) to catch regressions in template plumbing and ignoreFile() usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/create/src/frameworks/solid/project/base/src/routes/__root.tsx.ejs`:
- Around line 47-59: The HeadContent component is currently rendered inside
<body> causing hydration and meta tag issues; move the <HeadContent /> render
into the <head> block (near HydrationScript) so head-related tags are injected
in the document head; update the template around HydrationScript and ensure any
layout integrations loop (the integrations.filter(i => i.type === 'layout')
insertion) remains in the body/Suspense area while HeadContent is relocated to
the head section.
---
Nitpick comments:
In `@packages/create/tests/template-context.test.ts`:
- Around line 316-376: The tests exercise includeExamples and ignoreFile() logic
but lack higher-level fixture assertions that verify generated scaffolds
actually omit user-facing pieces (e.g., React/Solid Header, Footer, ThemeToggle,
and /about); add one integration-style test per framework that uses
createMemoryEnvironment() and createTemplateFile() to generate a minimal
scaffold with includeExamples: false and then assert output.files does not
contain the framework-specific files/components (e.g., verify '/about',
'Header', 'Footer', 'ThemeToggle' module paths are absent) to catch regressions
in template plumbing and ignoreFile() usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 817d9635-338b-4052-9251-82078c2483c4
📒 Files selected for processing (14)
packages/create/src/frameworks/react/project/base/src/components/Footer.tsx.ejspackages/create/src/frameworks/react/project/base/src/components/Header.tsx.ejspackages/create/src/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejspackages/create/src/frameworks/react/project/base/src/routes/__root.tsx.ejspackages/create/src/frameworks/react/project/base/src/routes/about.tsx.ejspackages/create/src/frameworks/react/project/base/src/routes/index.tsx.ejspackages/create/src/frameworks/react/project/base/src/styles.css.ejspackages/create/src/frameworks/solid/project/base/src/components/Header.tsx.ejspackages/create/src/frameworks/solid/project/base/src/routes/__root.tsx.ejspackages/create/src/frameworks/solid/project/base/src/routes/about.tsx.ejspackages/create/src/frameworks/solid/project/base/src/routes/index.tsx.ejspackages/create/src/frameworks/solid/project/base/src/styles.css.ejspackages/create/src/template-file.tspackages/create/tests/template-context.test.ts
For #422
Pass includeExamples to the EJS template context and conditionally render minimal output (no Header, Footer, ThemeToggle, theme system, or styled pages) for both React and Solid frameworks when the user selects "No" for demo/example pages.
Summary by CodeRabbit
New Features
Tests