diff --git a/bin/setup b/bin/setup index 8dfadbb5..7f7b30f5 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 00000000..78d7adc4 --- /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." diff --git a/conductor.json b/conductor.json new file mode 100644 index 00000000..f883f6ac --- /dev/null +++ b/conductor.json @@ -0,0 +1,8 @@ +{ + "scripts": { + "setup": "./conductor-setup.sh", + "run": "bin/dev", + "archive": "" + }, + "runScriptMode": "nonconcurrent" +} diff --git a/package.json b/package.json index 24d478bc..273415f4 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": {