diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 3846462ea7..339a6d2385 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -30,6 +30,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -39,6 +40,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -65,29 +74,29 @@ jobs: strategy: fail-fast: false matrix: - include: - # Always run: Latest versions (fast feedback on PRs) - - ruby-version: '3.4' - dependency-level: 'latest' - # Master and workflow_dispatch: Minimum supported versions (full coverage) - - ruby-version: '3.2' - dependency-level: 'minimum' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} env: SKIP_YARN_COREPACK_CHECK: 0 BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Setup Node uses: actions/setup-node@v4 @@ -113,7 +122,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Install Node modules with Yarn for renderer package @@ -121,7 +130,7 @@ jobs: yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} sudo yarn global add yalc - name: yalc publish for react-on-rails - run: yalc publish + run: yarn yalc publish - name: Install Ruby Gems for package run: | bundle lock --add-platform 'x86_64-linux' @@ -150,5 +159,5 @@ jobs: - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec diff --git a/.github/workflows/gem-tests.yml b/.github/workflows/gem-tests.yml index 62773d5bf2..886f2a43c2 100644 --- a/.github/workflows/gem-tests.yml +++ b/.github/workflows/gem-tests.yml @@ -34,6 +34,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -43,6 +44,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -61,7 +70,7 @@ jobs: script/ci-changes-detector "$BASE_REF" shell: bash - rspec-package-tests: + basic-gem-tests: needs: detect-changes # Run on master OR when Ruby tests needed on PR if: | @@ -69,28 +78,26 @@ jobs: strategy: fail-fast: false matrix: - include: - # Always run: Latest versions (fast feedback on PRs) - - ruby-version: '3.4' - dependency-level: 'latest' - # Master and full-ci label: Minimum supported versions (full coverage) - - ruby-version: '3.2' - dependency-level: 'minimum' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} env: BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Print system information run: | @@ -108,7 +115,7 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Ruby Gems for package run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3 - name: Git Stuff @@ -125,10 +132,10 @@ jobs: - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: log/test.log diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 03231da3ca..9d43eaf0e8 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -32,6 +32,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -41,6 +42,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"latest\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"latest\",\"minimum\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -64,24 +73,28 @@ jobs: if: | github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' strategy: + fail-fast: false matrix: - ruby-version: ['3.4'] - node-version: ['22'] - dependency-level: ['latest'] - include: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}} - node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}} - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 # libyaml-dev is needed for psych v5 # this gem depends on sdoc which depends on rdoc which depends on psych @@ -90,10 +103,10 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: ${{ matrix.node-version != '22' && 'yarn' || '' }} + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -121,7 +134,7 @@ jobs: uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Ruby Gems for dummy app run: | cd spec/dummy @@ -139,7 +152,7 @@ jobs: uses: actions/cache/save@v4 with: path: spec/dummy/public/webpack - key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} dummy-app-integration-tests: needs: [detect-changes, build-dummy-app-webpack-test-bundles] @@ -147,37 +160,36 @@ jobs: if: | github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.run_dummy_tests == 'true' strategy: + fail-fast: false matrix: - ruby-version: ['3.4'] - node-version: ['22'] - dependency-level: ['latest'] - include: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '3.2'}} - node-version: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && '20'}} - dependency-level: ${{ (github.ref == 'refs/heads/master' || inputs.force_run == true || needs.detect-changes.outputs.has_full_ci_label == 'true') && 'minimum'}} - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label) - - ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }} - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} - dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }} + dependency-level: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: + - name: Translate matrix for Ruby and Node versions + id: translate-matrix + run: | + if [ "${{ matrix.dependency-level }}" == "latest" ]; then + echo "ruby-version=3.4" >> "$GITHUB_OUTPUT" + echo "node-version=22" >> "$GITHUB_OUTPUT" + else + echo "ruby-version=3.2" >> "$GITHUB_OUTPUT" + echo "node-version=20" >> "$GITHUB_OUTPUT" + fi - uses: actions/checkout@v4 with: persist-credentials: false - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ steps.translate-matrix.outputs.ruby-version }} bundler: 2.5.9 - name: Setup Node uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ steps.translate-matrix.outputs.node-version }} # Disable cache for Node 22 due to V8 bug in 22.21.0 # https://github.com/nodejs/node/issues/56010 - cache: ${{ matrix.node-version != '22' && 'yarn' || '' }} + cache: yarn cache-dependency-path: '**/yarn.lock' - name: Print system information run: | @@ -195,19 +207,19 @@ jobs: uses: actions/cache@v4 with: path: vendor/bundle - key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Save dummy app ruby gems to cache uses: actions/cache@v4 with: path: spec/dummy/vendor/bundle - key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - id: get-sha run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT" - name: Save test Webpack bundles to cache (for build number checksum used by RSpec job) uses: actions/cache@v4 with: path: spec/dummy/public/webpack - key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} - name: Install Node modules with Yarn run: | yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }} @@ -260,26 +272,26 @@ jobs: - run: cd spec/dummy && bundle info shakapacker - name: Set packer version environment variable run: | - echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV + echo "CI_DEPENDENCY_LEVEL=ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV - name: Main CI run: bundle exec rake run_rspec:all_dummy - name: Store test results uses: actions/upload-artifact@v4 with: - name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: ~/rspec - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/tmp/capybara - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/log/test.log - name: Store artifacts uses: actions/upload-artifact@v4 with: - name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }} + name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ steps.translate-matrix.outputs.ruby-version }}-${{ matrix.dependency-level }} path: spec/dummy/yarn-error.log diff --git a/.github/workflows/package-js-tests.yml b/.github/workflows/package-js-tests.yml index 24bb2d0830..c091e9588b 100644 --- a/.github/workflows/package-js-tests.yml +++ b/.github/workflows/package-js-tests.yml @@ -36,6 +36,7 @@ jobs: run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }} run_generators: ${{ steps.detect.outputs.run_generators }} has_full_ci_label: ${{ steps.check-label.outputs.result }} + matrix_array: ${{ steps.determine-matrix.outputs.result }} steps: - uses: actions/checkout@v4 with: @@ -45,6 +46,14 @@ jobs: - name: Check for full-ci label id: check-label uses: ./.github/actions/check-full-ci-label + - name: Determine matrix strategy + id: determine-matrix + run: | + if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ] || [ "${{ github.ref }}" = "refs/heads/master" ]; then + echo "result=[\"22\"]" >> "$GITHUB_OUTPUT" + else + echo "result=[\"22\",\"20\"]" >> "$GITHUB_OUTPUT" + fi - name: Detect relevant changes id: detect run: | @@ -69,15 +78,9 @@ jobs: if: | (github.ref == 'refs/heads/master' || needs.detect-changes.outputs.run_js_tests == 'true') strategy: + fail-fast: false matrix: - include: - # Always run: Latest Node version (fast feedback on PRs) - - node-version: '22' - # Master and full-ci label: Minimum supported Node version (full coverage) - - node-version: '20' - exclude: - # Skip minimum dependency matrix on regular PRs (run only on master or with full-ci label) - - node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }} + node-version: ${{ fromJson(needs.detect-changes.outputs.matrix_array) }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 diff --git a/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt b/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt index 8015f38971..e063171d21 100644 --- a/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt +++ b/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt @@ -26,8 +26,10 @@ ReactOnRails.configure do |config| # - Requires adding ReactOnRails::TestHelper to spec/rails_helper.rb # - See: https://github.com/shakacode/react_on_rails/blob/master/docs/guides/testing-configuration.md # - # config.build_test_command = "RAILS_ENV=test bin/shakapacker" + config.build_test_command = "RAILS_ENV=test bin/shakapacker" + config.auto_load_bundle = true + config.components_subdirectory = "ror_components" ################################################################################ # Advanced Configuration ################################################################################ diff --git a/rakelib/shakapacker_examples.rake b/rakelib/shakapacker_examples.rake index 165bbfc0d2..f43ef45260 100644 --- a/rakelib/shakapacker_examples.rake +++ b/rakelib/shakapacker_examples.rake @@ -36,8 +36,13 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength sh_in_dir(example_type.dir, "echo \"gem 'shakapacker', '>= 8.2.0'\" >> #{example_type.gemfile}") bundle_install_in(example_type.dir) sh_in_dir(example_type.dir, "rake shakapacker:install") - sh_in_dir(example_type.dir, example_type.generator_shell_commands) + # TODO: Remove REACT_ON_RAILS_SKIP_VALIDATION after generators start using next release + generator_commands = example_type.generator_shell_commands.map do |cmd| + "REACT_ON_RAILS_SKIP_VALIDATION=true #{cmd}" + end + sh_in_dir(example_type.dir, generator_commands) sh_in_dir(example_type.dir, "npm install") + sh_in_dir(example_type.dir, "bundle exec rake react_on_rails:generate_packs") end end