From 5029433b66eb782244ff5d18509d1ed3e9df1f9a Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Fri, 15 Sep 2023 15:42:06 +0330 Subject: [PATCH 1/2] Add react_on_rails binstubs for running the app --- bin/dev | 30 ++++++++++++++++++++++++++++++ bin/dev-static | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100755 bin/dev create mode 100755 bin/dev-static diff --git a/bin/dev b/bin/dev new file mode 100755 index 000000000..bc3f590eb --- /dev/null +++ b/bin/dev @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +def installed?(process) + IO.popen "#{process} -v" +rescue Errno::ENOENT + false +end + +def run(process) + system "#{process} start -f Procfile.dev" +rescue Errno::ENOENT + warn <<~MSG + ERROR: + Please ensure `Procfile.dev` exists in your project! + MSG + exit! +end + +if installed? "overmind" + run "overmind" +elsif installed? "foreman" + run "foreman" +else + warn <<~MSG + NOTICE: + For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them. + MSG + exit! +end diff --git a/bin/dev-static b/bin/dev-static new file mode 100755 index 000000000..d0d255c69 --- /dev/null +++ b/bin/dev-static @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +def installed?(process) + IO.popen "#{process} -v" +rescue Errno::ENOENT + false +end + +def run(process) + system "#{process} start -f Procfile.dev-static" +rescue Errno::ENOENT + warn <<~MSG + ERROR: + Please ensure `Procfile.dev-static` exists in your project! + MSG + exit! +end + +if installed? "overmind" + run "overmind" +elsif installed? "foreman" + run "foreman" +else + warn <<~MSG + NOTICE: + For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them. + MSG + exit! +end From 9f851f71a5430d7b6af7093e07578eeb46e43aef Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Fri, 15 Sep 2023 15:43:29 +0330 Subject: [PATCH 2/2] Upgrade Shakapacker to 7.0.3 --- Gemfile | 2 +- Gemfile.lock | 6 +++--- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index f783373f3..6b9f91c79 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ ruby "3.1.2" gem "cpl", "~> 0.3.3" gem "react_on_rails", "13.2.0" -gem "shakapacker", "7.0.2" +gem "shakapacker", "7.0.3" # Bundle edge Rails instead: gem "rails", github: "rails/rails" gem "listen" diff --git a/Gemfile.lock b/Gemfile.lock index 467181b20..e5dd32791 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -212,7 +212,7 @@ GEM nio4r (~> 2.0) racc (1.7.1) rack (2.2.8) - rack-proxy (0.7.6) + rack-proxy (0.7.7) rack rack-test (2.1.0) rack (>= 1.3) @@ -336,7 +336,7 @@ GEM websocket (~> 1.0) semantic_range (3.0.0) sexp_processor (4.17.0) - shakapacker (7.0.2) + shakapacker (7.0.3) activesupport (>= 5.2) rack-proxy (>= 0.6.1) railties (>= 5.2) @@ -438,7 +438,7 @@ DEPENDENCIES scss_lint sdoc selenium-webdriver (~> 4) - shakapacker (= 7.0.2) + shakapacker (= 7.0.3) spring spring-commands-rspec stimulus-rails (~> 1.2) diff --git a/package.json b/package.json index 00aa1c79b..e26b815ae 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "sass-loader": "^13.3.2", "sass-resources-loader": "^2.2.5", "stimulus": "^3.0.1", - "shakapacker": "7.0.2", + "shakapacker": "7.0.3", "style-loader": "^3.3.1", "terser-webpack-plugin": "5", "turbolinks": "^5.2.0", diff --git a/yarn.lock b/yarn.lock index 458483b0c..78f2966d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8541,10 +8541,10 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -shakapacker@7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-7.0.2.tgz#cd7cb5075fdbf4d06e60d894f9076c8e56643a98" - integrity sha512-TF2GFb0E28fvQpn2L6RdvAHJRZmFMTvpJg93102tCbFywHq3tmTqwD/ijvlD+eMuZ8d1i3AMTnhO+45ayN3dYg== +shakapacker@7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/shakapacker/-/shakapacker-7.0.3.tgz#e67fca4e74c3ef380e1acf53a1d51ab4784ca01c" + integrity sha512-2kwNP8kadkmGOqb7Bp/iNzF3bV31zni8b35Uzst2DZHjnFcnDbW96MERXHc7lS3p3AmKJVbUBmHAFCPsLT9tcw== dependencies: glob "^7.2.0" js-yaml "^4.1.0"