Skip to content

Commit 9e1ffb7

Browse files
authored
Add Conductor configuration for workspace setup (#659)
* Add Conductor configuration for workspace setup - Add conductor.json with setup and run scripts - Create conductor-setup.sh to copy env files and run Rails setup - Enhance bin/setup to generate React on Rails locales - Use nonconcurrent mode for dev server to prevent port conflicts - Update package.json to accept Node >=22 * Add trailing newlines to conductor.json and conductor-setup.sh
1 parent ebd0cbc commit 9e1ffb7

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

bin/setup

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ FileUtils.chdir APP_ROOT do
2727
puts "\n== Preparing database =="
2828
system! "bin/rails db:prepare"
2929

30+
puts "\n== Generating React on Rails locales =="
31+
system! "bin/rails react_on_rails:locale"
32+
3033
puts "\n== Removing old logs and tempfiles =="
3134
system! "bin/rails log:clear tmp:clear"
3235

conductor-setup.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "🚀 Setting up React on Rails workspace..."
5+
6+
# Note: This project requires Ruby 3.3.4.
7+
# Please ensure you have the correct Ruby version active before running this script.
8+
9+
# Copy environment files if they exist in the root
10+
if [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then
11+
cp "$CONDUCTOR_ROOT_PATH/.env" .env
12+
echo "✅ Copied .env file from root"
13+
elif [ -f "$CONDUCTOR_ROOT_PATH/.env.example" ]; then
14+
cp "$CONDUCTOR_ROOT_PATH/.env.example" .env
15+
echo "✅ Copied .env.example to .env"
16+
fi
17+
18+
if [ -f "$CONDUCTOR_ROOT_PATH/config/database.yml" ]; then
19+
cp "$CONDUCTOR_ROOT_PATH/config/database.yml" config/database.yml
20+
echo "✅ Copied database.yml from root"
21+
elif [ -f "config/database.yml.example" ]; then
22+
cp config/database.yml.example config/database.yml
23+
echo "✅ Copied database.yml.example to database.yml"
24+
fi
25+
26+
# Run the standard Rails setup script
27+
echo "🔧 Running Rails setup script..."
28+
bin/setup --skip-server
29+
30+
echo "✨ Setup complete! You can now run the development server."

conductor.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"scripts": {
3+
"setup": "./conductor-setup.sh",
4+
"run": "bin/dev",
5+
"archive": ""
6+
},
7+
"runScriptMode": "nonconcurrent"
8+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.1.0",
44
"description": "Code from the React Webpack tutorial.",
55
"engines": {
6-
"node": "22",
6+
"node": ">=22",
77
"yarn": "1.22"
88
},
99
"repository": {

0 commit comments

Comments
 (0)