Skip to content

fix(create): exclude demo files in lib, hooks, data, and components when demo / examples are disabled#430

Closed
WaryaWayne wants to merge 1 commit intoTanStack:mainfrom
WaryaWayne:main
Closed

fix(create): exclude demo files in lib, hooks, data, and components when demo / examples are disabled#430
WaryaWayne wants to merge 1 commit intoTanStack:mainfrom
WaryaWayne:main

Conversation

@WaryaWayne
Copy link
Copy Markdown
Contributor

@WaryaWayne WaryaWayne commented Apr 14, 2026

Previously only demo route files were filtered out when the user chose no demo files. Demo files in components/, lib/, hooks/, and data/ directories would still be created. Rename isDemoRoutePath to isDemoFilePath to reflect the broader scope and extend pattern matching to cover all non-route demo file paths.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced filtering of example and demo files during app creation to ensure comprehensive removal across all project locations, including libraries, hooks, data, and components.

…hen demo is disabled

Previously only demo route files were filtered out when the user chose
no demo files. Demo files in components/, lib/, hooks/, and data/
directories would still be created. Rename isDemoRoutePath to
isDemoFilePath to reflect the broader scope and extend pattern matching
to cover all non-route demo file paths.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

A helper function for identifying demo-related files was renamed from isDemoRoutePath to isDemoFilePath and expanded to recognize demo patterns across multiple directories including /lib/, /hooks/, /data/, and /components/, in addition to /routes/. All call sites were updated accordingly.

Changes

Cohort / File(s) Summary
Demo Path Detection Helper
packages/create/src/create-app.ts
Renamed isDemoRoutePath to isDemoFilePath with expanded pattern matching to include demo-related files across /lib/, /hooks/, /data/, and /components/ directories using both demo- and demo. prefixes. Updated all call sites in stripExamplesFromOptions to filter demo files from route paths, addon bundle listings, and deletion sets.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A helper hops with broader sight,
Finding demos left and right,
In hooks and lib and data too,
Filtering examples, old and new!
With paths expanded, clean and bright,
The demo files are stripped outright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and specifically describes the main change: expanding demo file exclusion beyond routes to include lib, hooks, data, and components directories.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@WaryaWayne WaryaWayne closed this Apr 14, 2026
@WaryaWayne
Copy link
Copy Markdown
Contributor Author

unfinished. little clean up left.

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.

1 participant