Skip to content

Commit e008aaf

Browse files
justin808claude
andcommitted
docs: enhance help messages and documentation for demo management commands
Improved user experience with detailed command descriptions and examples: Command Help Messages: - bin/new-demo: Added description explaining basic demo creation - bin/scaffold-demo: Added description for advanced demo scaffolding - bin/update-all-demos: Added description for bulk version updates - All commands now show clear usage, examples, and available options Documentation Updates: - README.md: Reorganized demo management section with detailed examples for all three commands - CONTRIBUTING.md: Updated with Ruby script recommendations and help flag usage - CONTRIBUTING_SETUP.md: Added links to main README for detailed examples - .gitignore: Added pr_description.md and commit_message.txt Users can now run --help on any command to see: - What the command does - Usage syntax - Example invocations - All available options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a019604 commit e008aaf

File tree

7 files changed

+101
-22
lines changed

7 files changed

+101
-22
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ vendor/bundle/
5151

5252
# Ignore master key for decrypting credentials and more
5353
/demos/*/config/master.key
54-
/demos/*/config/credentials.yml.enc
54+
/demos/*/config/credentials.yml.encpr_description.md
55+
commit_message.txt

CONTRIBUTING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,22 @@ bin/dev
4646

4747
### Creating a New Demo
4848

49+
Use the Ruby scripts for creating demos (fully tested and recommended):
50+
4951
```bash
50-
./scripts/new-demo.sh react_on_rails-demo-v16-your-feature
52+
# Create a basic demo
53+
bin/new-demo react_on_rails-demo-v16-your-feature
54+
55+
# Create an advanced demo with scaffolding and integrations
56+
bin/scaffold-demo react_on_rails-demo-v16-your-feature
5157

52-
# Or use the scaffold script with options:
53-
./scripts/scaffold-demo.sh react_on_rails-demo-v16-your-feature --typescript --tailwind
58+
# Show available options
59+
bin/new-demo --help
60+
bin/scaffold-demo --help
5461
```
5562

63+
See the [README](./README.md#create-a-new-demo) for detailed usage examples.
64+
5665
### Testing
5766

5867
Run tests for all demos:

README.md

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,78 @@ See [Development Setup](./docs/CONTRIBUTING_SETUP.md) for details.
8080

8181
### Create a New Demo
8282

83-
Scripts are available in both Ruby (recommended) and Bash:
83+
Three commands are available for managing demos:
8484

85-
```bash
86-
# Simple demo creation (Ruby)
87-
bin/new-demo react_on_rails-demo-v16-your-feature
85+
#### 1. `bin/new-demo` - Create Basic Demo
8886

89-
# Or use bash script
90-
./scripts/new-demo.sh react_on_rails-demo-v16-your-feature
87+
Creates a new React on Rails demo with PostgreSQL, Shakapacker, and React on Rails pre-configured.
9188

92-
# Scaffold with advanced options (Ruby)
93-
bin/scaffold-demo react_on_rails-demo-v16-your-feature --typescript --tailwind
89+
```bash
90+
# Basic usage (uses .demo-versions defaults)
91+
bin/new-demo react_on_rails-demo-v16-your-feature
9492

95-
# Or bash version
96-
./scripts/scaffold-demo.sh react_on_rails-demo-v16-your-feature --typescript --tailwind
93+
# With custom versions
94+
bin/new-demo my-demo \
95+
--shakapacker-version '~> 8.0' \
96+
--react-on-rails-version '~> 16.1'
9797

98-
# Specify custom gem versions
99-
bin/new-demo my-demo --shakapacker-version '~> 8.0' --react-on-rails-version '~> 16.0'
98+
# With custom Rails/generator arguments
99+
bin/new-demo my-demo \
100+
--rails-args="--skip-test,--api" \
101+
--react-on-rails-args="--redux,--node"
100102

101103
# Preview commands without execution
102104
bin/new-demo my-demo --dry-run
105+
106+
# Show help
107+
bin/new-demo --help
108+
```
109+
110+
#### 2. `bin/scaffold-demo` - Create Advanced Demo
111+
112+
Creates an advanced demo with scaffolding, example components, and optional integrations.
113+
114+
```bash
115+
# Basic scaffolding
116+
bin/scaffold-demo react_on_rails-demo-v16-advanced
117+
118+
# With TypeScript and Tailwind
119+
bin/scaffold-demo my-demo --typescript --tailwind
120+
121+
# With Material-UI
122+
bin/scaffold-demo my-demo --mui
123+
124+
# Skip database setup
125+
bin/scaffold-demo my-demo --skip-db
126+
127+
# Show help
128+
bin/scaffold-demo --help
129+
```
130+
131+
#### 3. `bin/update-all-demos` - Bulk Update Versions
132+
133+
Updates React on Rails and/or Shakapacker versions across all existing demos.
134+
135+
```bash
136+
# Update React on Rails across all demos
137+
bin/update-all-demos --react-on-rails-version '~> 16.1'
138+
139+
# Update both gems
140+
bin/update-all-demos \
141+
--react-on-rails-version '~> 16.1' \
142+
--shakapacker-version '~> 8.1'
143+
144+
# Preview without making changes
145+
bin/update-all-demos --react-on-rails-version '~> 16.1' --dry-run
146+
147+
# Update specific demos only
148+
bin/update-all-demos --demos "demo-v16-*" --react-on-rails-version '~> 16.1'
149+
150+
# Show help
151+
bin/update-all-demos --help
103152
```
104153

105-
**Ruby scripts** (in `bin/`) are fully tested and recommended for use.
106-
**Bash scripts** (in `scripts/`) are kept for compatibility.
154+
**Note:** Ruby scripts (in `bin/`) are fully tested and recommended. Bash scripts (in `scripts/`) are kept for compatibility.
107155

108156
Default versions are configured in `.demo-versions`. Override with command-line flags.
109157

bin/new-demo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ options = {
1616
parser = OptionParser.new do |opts|
1717
opts.banner = 'Usage: bin/new-demo DEMO_NAME [options]'
1818
opts.separator ''
19+
opts.separator 'Description:'
20+
opts.separator ' Creates a new basic React on Rails demo application with PostgreSQL,'
21+
opts.separator ' Shakapacker, and React on Rails pre-configured. Uses version defaults'
22+
opts.separator ' from .demo-versions unless overridden.'
23+
opts.separator ''
1924
opts.separator 'Example: bin/new-demo react_on_rails-demo-v16-typescript-setup'
2025
opts.separator ''
2126
opts.separator 'Options:'

bin/scaffold-demo

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ options = {
2222
parser = OptionParser.new do |opts|
2323
opts.banner = 'Usage: bin/scaffold-demo DEMO_NAME [options]'
2424
opts.separator ''
25+
opts.separator 'Description:'
26+
opts.separator ' Creates an advanced React on Rails demo with additional scaffolding,'
27+
opts.separator ' example components, and optional integrations (TypeScript, Tailwind,'
28+
opts.separator ' Bootstrap, Material-UI). Includes HelloWorld component and route setup.'
29+
opts.separator ''
2530
opts.separator 'Example: bin/scaffold-demo react_on_rails-demo-v16-ssr-hmr'
2631
opts.separator ''
2732
opts.separator 'Options:'

bin/update-all-demos

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ options = {
1616
parser = OptionParser.new do |opts|
1717
opts.banner = 'Usage: bin/update-all-demos [options]'
1818
opts.separator ''
19-
opts.separator 'Update React on Rails and/or Shakapacker versions across all demos.'
19+
opts.separator 'Description:'
20+
opts.separator ' Bulk updates React on Rails and/or Shakapacker versions across all'
21+
opts.separator ' existing demos in the demos/ directory. Updates Gemfiles, runs bundle'
22+
opts.separator ' install, optionally runs tests, and updates demo READMEs with new versions.'
23+
opts.separator ''
24+
opts.separator 'Example: bin/update-all-demos --react-on-rails-version "~> 16.1"'
2025
opts.separator ''
2126
opts.separator 'Options:'
2227

docs/CONTRIBUTING_SETUP.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,19 @@ bundle exec rubocop lib/demo_scripts/
127127
### Adding a New Demo
128128

129129
```bash
130-
# Use the Ruby script
130+
# Create a basic demo
131131
bin/new-demo react_on_rails-demo-v16-my-feature
132132

133-
# Or with options
134-
bin/scaffold-demo react_on_rails-demo-v16-my-feature --typescript --tailwind
133+
# Create an advanced demo with scaffolding
134+
bin/scaffold-demo react_on_rails-demo-v16-my-feature
135+
136+
# See all available options
137+
bin/new-demo --help
138+
bin/scaffold-demo --help
135139
```
136140

141+
For detailed examples and all available commands, see the [main README](../README.md#create-a-new-demo).
142+
137143
## Troubleshooting
138144

139145
### Lefthook not working

0 commit comments

Comments
 (0)