diff --git a/Gemfile b/Gemfile index 02b670654..c99955e9a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,4 @@ source "http://rubygems.org" gemspec -gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" - # This is an optional dev-dependency, required whenever sprockets is required diff --git a/Gemfile.lock b/Gemfile.lock index 3d1c4aff3..e109d23ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,3 @@ -GIT - remote: https://github.com/G-Rath/package_json.git - revision: 72e742afb7ea8c19369fa9a4ce0d74ce098e2678 - branch: add-bun-support - specs: - package_json (0.1.0) - PATH remote: . specs: @@ -118,6 +111,7 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) + package_json (0.1.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -184,7 +178,7 @@ DEPENDENCIES guard-minitest jbuilder listen (~> 3.0.0) - package_json! + package_json pry-byebug react-rails! selenium-webdriver diff --git a/Rakefile b/Rakefile index 12b65ac18..de4274c86 100644 --- a/Rakefile +++ b/Rakefile @@ -8,13 +8,7 @@ end Bundler::GemHelper.install_tasks -def require_package_json_gem - require "bundler/inline" - - gemfile { gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" } - - puts "using package_json v#{PackageJson::VERSION}" -end +require "package_json" def copy_react_asset(webpack_file, destination_file) full_webpack_path = File.expand_path("../react-builds/build/#{webpack_file}", __FILE__) @@ -28,15 +22,11 @@ namespace :react do desc "Install the JavaScript dependencies" task :install do - require_package_json_gem - PackageJson.read("react-builds").manager.install end desc "Build the JS bundles with Webpack" task :build do - require_package_json_gem - PackageJson.read("react-builds").manager.run("build") end @@ -56,15 +46,11 @@ namespace :ujs do desc "Install the JavaScript dependencies" task :install do - require_package_json_gem - PackageJson.read.manager.install end desc "Build the JS bundles with Webpack" task :build do - require_package_json_gem - PackageJson.read.manager.run("build") end @@ -96,8 +82,6 @@ task default: :test task :test_setup do Dir.chdir("./test/dummy") do - require_package_json_gem - PackageJson.read.manager.install end end diff --git a/gemfiles/base.gemfile b/gemfiles/base.gemfile index e7513b5d3..dbd7ec2d2 100644 --- a/gemfiles/base.gemfile +++ b/gemfiles/base.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org" -gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" gem "rails", "~> 7.0.x" gemspec path: "../" diff --git a/gemfiles/base.gemfile.lock b/gemfiles/base.gemfile.lock index 0582ca901..4576466d3 100644 --- a/gemfiles/base.gemfile.lock +++ b/gemfiles/base.gemfile.lock @@ -1,10 +1,3 @@ -GIT - remote: https://github.com/G-Rath/package_json.git - revision: 72e742afb7ea8c19369fa9a4ce0d74ce098e2678 - branch: add-bun-support - specs: - package_json (0.1.0) - PATH remote: .. specs: @@ -269,7 +262,6 @@ DEPENDENCIES guard-minitest jbuilder listen (~> 3.0.0) - package_json! pry-byebug rails (~> 7.0.x) react-rails! diff --git a/gemfiles/shakapacker.gemfile b/gemfiles/shakapacker.gemfile index 382d4b684..c699a83c4 100644 --- a/gemfiles/shakapacker.gemfile +++ b/gemfiles/shakapacker.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org" -gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" gem "rails", "~> 7.0.x" gem "shakapacker", github: "G-Rath/shakapacker", branch: "use-package_json" diff --git a/gemfiles/shakapacker.gemfile.lock b/gemfiles/shakapacker.gemfile.lock index 901b06217..0ac7a06bb 100644 --- a/gemfiles/shakapacker.gemfile.lock +++ b/gemfiles/shakapacker.gemfile.lock @@ -1,17 +1,11 @@ -GIT - remote: https://github.com/G-Rath/package_json.git - revision: 72e742afb7ea8c19369fa9a4ce0d74ce098e2678 - branch: add-bun-support - specs: - package_json (0.1.0) - GIT remote: https://github.com/G-Rath/shakapacker.git - revision: 8e9db60edd13429bdae9783d7f37bac70470870c + revision: 992f156694499f62f35ddd32bb6d53597a78c453 branch: use-package_json specs: shakapacker (7.0.3) activesupport (>= 5.2) + package_json rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) @@ -194,6 +188,7 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) + package_json (0.1.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -283,7 +278,6 @@ DEPENDENCIES guard-minitest jbuilder listen (~> 3.0.0) - package_json! pry-byebug rails (~> 7.0.x) react-rails! diff --git a/gemfiles/sprockets_3.gemfile b/gemfiles/sprockets_3.gemfile index 52aaf1e71..ca312487d 100644 --- a/gemfiles/sprockets_3.gemfile +++ b/gemfiles/sprockets_3.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org" -gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" gem "rails", "~> 7.0.x" gem "sprockets", "~> 3.5" gem "sprockets-rails" diff --git a/gemfiles/sprockets_3.gemfile.lock b/gemfiles/sprockets_3.gemfile.lock index a27762ff5..43b205972 100644 --- a/gemfiles/sprockets_3.gemfile.lock +++ b/gemfiles/sprockets_3.gemfile.lock @@ -1,10 +1,3 @@ -GIT - remote: https://github.com/G-Rath/package_json.git - revision: 72e742afb7ea8c19369fa9a4ce0d74ce098e2678 - branch: add-bun-support - specs: - package_json (0.1.0) - PATH remote: .. specs: @@ -284,7 +277,6 @@ DEPENDENCIES jbuilder listen (~> 3.0.0) mini_racer - package_json! pry-byebug rails (~> 7.0.x) react-rails! diff --git a/gemfiles/sprockets_4.gemfile b/gemfiles/sprockets_4.gemfile index e6650a0cc..245032a24 100644 --- a/gemfiles/sprockets_4.gemfile +++ b/gemfiles/sprockets_4.gemfile @@ -2,7 +2,6 @@ source "http://rubygems.org" -gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" gem "rails", "~> 7.0.x" gem "sprockets", "~> 4.0.x" gem "sprockets-rails" diff --git a/gemfiles/sprockets_4.gemfile.lock b/gemfiles/sprockets_4.gemfile.lock index 48ffbf448..e11eedf66 100644 --- a/gemfiles/sprockets_4.gemfile.lock +++ b/gemfiles/sprockets_4.gemfile.lock @@ -1,10 +1,3 @@ -GIT - remote: https://github.com/G-Rath/package_json.git - revision: 72e742afb7ea8c19369fa9a4ce0d74ce098e2678 - branch: add-bun-support - specs: - package_json (0.1.0) - PATH remote: .. specs: @@ -284,7 +277,6 @@ DEPENDENCIES jbuilder listen (~> 3.0.0) mini_racer - package_json! pry-byebug rails (~> 7.0.x) react-rails! diff --git a/lib/generators/react/install_generator.rb b/lib/generators/react/install_generator.rb index f5b202b4f..5c48e5e7d 100644 --- a/lib/generators/react/install_generator.rb +++ b/lib/generators/react/install_generator.rb @@ -103,11 +103,10 @@ def setup_react_sprockets ReactRailsUJS.useContext(componentRequireContext); JS - # TODO: replace with standard "require" call once gem is published def require_package_json_gem require "bundler/inline" - gemfile { gem "package_json", github: "G-Rath/package_json", branch: "add-bun-support" } + gemfile(true) { gem "package_json" } puts "using package_json v#{PackageJson::VERSION}" end diff --git a/react-rails.gemspec b/react-rails.gemspec index fc5755456..39f06120e 100644 --- a/react-rails.gemspec +++ b/react-rails.gemspec @@ -28,6 +28,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'selenium-webdriver' s.add_development_dependency 'test-unit', '~> 2.5' s.add_development_dependency 'pry-byebug' + s.add_development_dependency 'package_json' s.add_dependency 'connection_pool'