Overview
The current create-rnstack scaffold includes development-only reference screens and demo code by default:
- Component gallery (
src/app/gallery/*)
- Data demo screen (
src/app/data-demo.tsx)
- Example API hook (
use-example-posts)
These resources are useful while developing and validating the rnstack template, especially for testing UI components and API integration patterns.
However, most generated applications should start with production-focused code only. Currently, users need to manually remove demo files and clean up references after scaffolding.
This issue changes the behavior so demo/reference content becomes opt-in.
Problem
Demo content ships by default
A fresh scaffold currently contains:
src/app/
├── gallery/
│ └── ~35 component example screens
├── data-demo.tsx
packages/api-client/
└── hooks/
└── use-example-posts.ts
Additional wiring exists:
- Settings → Developer links to gallery screens
- Home screen references demo content
- API package exports demo hooks
Impact
1. Generated applications contain unnecessary code
Most production applications do not need:
- 35 gallery routes
- Example API screens
- Placeholder data hooks
- Developer-only navigation entries
Users immediately delete these files after generation.
2. Manual cleanup is error-prone
Removing the files manually requires updating multiple locations:
- Route definitions
- Navigation links
- Exports
- Imports
- Screens
Missing one reference can leave:
- Broken imports
- Dead routes
- Unused dependencies
Why opt-in instead of cleanup command
A cleanup script would introduce another maintenance problem.
Generated projects would contain:
demo code
+
script to remove demo code
The generated application still ships unnecessary files and tooling.
The goal of rnstack should be:
Generated code should be code users keep.
Users who want the gallery should explicitly enable it during initialization.
Proposed Behavior
Default behavior
Demo content should be excluded by default.
Example:
generates:
src/app/
├── normal application routes
└── no gallery/data-demo
Interactive Prompt
During interactive setup:
Include component gallery + demo screens? (y/N)
Default:
Selecting:
keeps the existing gallery and demo content.
CLI Flag
Add:
Example:
create-rnstack my-app --no-demo
Behavior:
- Removes demo content
- Removes related wiring
- Works with non-interactive mode
Example:
create-rnstack my-app -y --no-demo
should generate a clean production project.
Conditional Removal
When demo content is disabled, the CLI should remove:
Component Gallery
Data Demo Screen
Example API Hook
Remove:
packages/api-client/src/hooks/use-example-posts.ts
and remove its export from:
packages/api-client/src/index.ts
Cleanup Requirements
The scaffold process must also remove all references to deleted files.
Remove:
Navigation references
Example:
Settings
└── Developer
└── Component Gallery
should not exist when demo mode is disabled.
Home screen references
Remove:
- Demo cards
- Example links
- Imports
- Navigation actions
The generated home screen must build successfully without dangling references.
Implementation Approach
Implement this as a conditional strip set.
Similar to:
introduce:
Example:
const DEMO_STRIP_PATHS = [
"src/app/gallery",
"src/app/data-demo.tsx",
"packages/api-client/src/hooks/use-example-posts.ts",
];
Apply based on:
Acceptance Criteria
Default Generation
Opt-in Mode
When user selects:
Include component gallery + demo screens? Yes
or runs:
create-rnstack app --include-demo
the generated project includes:
- Component gallery
- Data demo screen
- Example API hook
CLI Behavior
Cleanup Validation
Generated projects without demos must not contain:
Environment
Affected versions:
create-rnstack@0.1.1
template: sanjaysah101/rnstack#v0.1.1
Out of Scope
- Removing development tools from the rnstack repository itself
- Creating a separate demo package
- Building a demo marketplace/gallery system
The goal is only to make generated applications production-ready by default.
Overview
The current
create-rnstackscaffold includes development-only reference screens and demo code by default:src/app/gallery/*)src/app/data-demo.tsx)use-example-posts)These resources are useful while developing and validating the rnstack template, especially for testing UI components and API integration patterns.
However, most generated applications should start with production-focused code only. Currently, users need to manually remove demo files and clean up references after scaffolding.
This issue changes the behavior so demo/reference content becomes opt-in.
Problem
Demo content ships by default
A fresh scaffold currently contains:
Additional wiring exists:
Impact
1. Generated applications contain unnecessary code
Most production applications do not need:
Users immediately delete these files after generation.
2. Manual cleanup is error-prone
Removing the files manually requires updating multiple locations:
Missing one reference can leave:
Why opt-in instead of cleanup command
A cleanup script would introduce another maintenance problem.
Generated projects would contain:
The generated application still ships unnecessary files and tooling.
The goal of rnstack should be:
Users who want the gallery should explicitly enable it during initialization.
Proposed Behavior
Default behavior
Demo content should be excluded by default.
Example:
generates:
Interactive Prompt
During interactive setup:
Default:
Selecting:
keeps the existing gallery and demo content.
CLI Flag
Add:
Example:
Behavior:
Example:
should generate a clean production project.
Conditional Removal
When demo content is disabled, the CLI should remove:
Component Gallery
Data Demo Screen
Example API Hook
Remove:
and remove its export from:
Cleanup Requirements
The scaffold process must also remove all references to deleted files.
Remove:
Navigation references
Example:
should not exist when demo mode is disabled.
Home screen references
Remove:
The generated home screen must build successfully without dangling references.
Implementation Approach
Implement this as a conditional strip set.
Similar to:
STRIP_PATHSintroduce:
DEMO_STRIP_PATHSExample:
Apply based on:
Acceptance Criteria
Default Generation
Opt-in Mode
When user selects:
or runs:
the generated project includes:
CLI Behavior
No--no-demoflag is supported--no-demoworks with-yCleanup Validation
Generated projects without demos must not contain:
Environment
Affected versions:
Out of Scope
The goal is only to make generated applications production-ready by default.