Skip to content
Source
Sign inSign up
TanStack/cli

fix(create): strip all demo/example files when users opt out #434

Mergedtannerlinsleymerged 5 commits intomain fromrefs/pull/434/headmerged by tannerlinsley

Showing 19 changed files with 40 additions and 8 deletions (loading 16).

x
0 of 19 viewed, 19 left
12 additions and 0 deletions.changeset/fix-demo-file-leaks.mdAdded
View file
@@ -0,0 +1,12 @@
+---
+'@tanstack/create': patch
+---
+​
+Fix demo/example files leaking into projects when users opt out of demo pages.
+​
+- Strip add-on demo support files in `src/lib/`, `src/hooks/`, `src/data/`, `src/components/`, `src/store/`, and any `demo.*` / `demo-*` / `example.*` / `example-*` files.
+- Strip example image assets under `public/`.
+- Generate a minimal base starter (no Header, Footer, ThemeToggle, about page, or styled index page) when declining demo/example pages.
+- Render Better Auth header-user component as `null` when its demo route is excluded, instead of linking to a non-existent route.
+​
+Closes #422, #409.
22 additions and 8 deletionspackages/create/src/create-app.tsModified
View file
@@ -17,14 +17,23 @@
​
import type { Environment, FileBundleHandler, Options } from './types.js'
​
-function isDemoRoutePath(path?: string) {
+function isDemoFilePath(path?: string) {
if (!path) return false
const normalized = path.replace(/\\/g, '/')
- return (
+​