From e2a7482095200814243a6a3a86945f7aaba75794 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 27 Sep 2025 17:46:06 -1000 Subject: [PATCH 1/2] 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 --- bin/setup | 3 +++ conductor-setup.sh | 30 ++++++++++++++++++++++++++++++ conductor.json | 8 ++++++++ package.json | 2 +- 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 conductor-setup.sh create mode 100644 conductor.json diff --git a/bin/setup b/bin/setup index 8dfadbb51..7f7b30f52 100755 --- a/bin/setup +++ b/bin/setup @@ -27,6 +27,9 @@ FileUtils.chdir APP_ROOT do puts "\n== Preparing database ==" system! "bin/rails db:prepare" + puts "\n== Generating React on Rails locales ==" + system! "bin/rails react_on_rails:locale" + puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" diff --git a/conductor-setup.sh b/conductor-setup.sh new file mode 100755 index 000000000..840663137 --- /dev/null +++ b/conductor-setup.sh @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +echo "🚀 Setting up React on Rails workspace..." + +# Note: This project requires Ruby 3.3.4. +# Please ensure you have the correct Ruby version active before running this script. + +# Copy environment files if they exist in the root +if [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then + cp "$CONDUCTOR_ROOT_PATH/.env" .env + echo "✅ Copied .env file from root" +elif [ -f "$CONDUCTOR_ROOT_PATH/.env.example" ]; then + cp "$CONDUCTOR_ROOT_PATH/.env.example" .env + echo "✅ Copied .env.example to .env" +fi + +if [ -f "$CONDUCTOR_ROOT_PATH/config/database.yml" ]; then + cp "$CONDUCTOR_ROOT_PATH/config/database.yml" config/database.yml + echo "✅ Copied database.yml from root" +elif [ -f "config/database.yml.example" ]; then + cp config/database.yml.example config/database.yml + echo "✅ Copied database.yml.example to database.yml" +fi + +# Run the standard Rails setup script +echo "🔧 Running Rails setup script..." +bin/setup --skip-server + +echo "✨ Setup complete! You can now run the development server." \ No newline at end of file diff --git a/conductor.json b/conductor.json new file mode 100644 index 000000000..6a4277afe --- /dev/null +++ b/conductor.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "setup": "./conductor-setup.sh", + "run": "bin/dev", + "archive": "" + }, + "runScriptMode": "nonconcurrent" +} \ No newline at end of file diff --git a/package.json b/package.json index 24d478bc6..273415f4a 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.1.0", "description": "Code from the React Webpack tutorial.", "engines": { - "node": "22", + "node": ">=22", "yarn": "1.22" }, "repository": { From 0efc75fcecce56673fc55fc634aa840bda3d11b9 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 27 Sep 2025 17:55:48 -1000 Subject: [PATCH 2/2] Add trailing newlines to conductor.json and conductor-setup.sh --- conductor-setup.sh | 2 +- conductor.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conductor-setup.sh b/conductor-setup.sh index 840663137..78d7adc41 100755 --- a/conductor-setup.sh +++ b/conductor-setup.sh @@ -27,4 +27,4 @@ fi echo "🔧 Running Rails setup script..." bin/setup --skip-server -echo "✨ Setup complete! You can now run the development server." \ No newline at end of file +echo "✨ Setup complete! You can now run the development server." diff --git a/conductor.json b/conductor.json index 6a4277afe..f883f6ac4 100644 --- a/conductor.json +++ b/conductor.json @@ -5,4 +5,4 @@ "archive": "" }, "runScriptMode": "nonconcurrent" -} \ No newline at end of file +}