File tree Expand file tree Collapse file tree 3 files changed +23
-32
lines changed
lib/generators/react_on_rails Expand file tree Collapse file tree 3 files changed +23
-32
lines changed Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- react_on_rails (14.0.0 )
4+ react_on_rails (14.0.2 )
55 addressable
66 connection_pool
77 execjs (~> 2.5 )
119119 tins (~> 1.6 )
120120 crass (1.0.6 )
121121 date (3.3.4 )
122+ debug (1.9.2 )
123+ irb (~> 1.10 )
124+ reline (>= 0.3.8 )
122125 diff-lcs (1.5.1 )
123126 docile (1.4.0 )
124127 drb (2.2.1 )
@@ -397,6 +400,7 @@ DEPENDENCIES
397400 capybara
398401 capybara-screenshot
399402 coveralls
403+ debug
400404 equivalent-xml
401405 gem-release
402406 generator_spec
Original file line number Diff line number Diff line change @@ -88,28 +88,28 @@ def add_yarn_dependencies
8888
8989 puts "Adding React dependencies"
9090 package_json . manager . add ( [
91- "react" ,
92- "react-dom" ,
93- "@babel/preset-react" ,
94- "prop-types" ,
95- "babel-plugin-transform-react-remove-prop-types" ,
96- "babel-plugin-macros"
97- ] )
91+ "react" ,
92+ "react-dom" ,
93+ "@babel/preset-react" ,
94+ "prop-types" ,
95+ "babel-plugin-transform-react-remove-prop-types" ,
96+ "babel-plugin-macros"
97+ ] )
9898
9999 puts "Adding CSS handlers"
100100
101- package_json . manager . add ( [
102- " css-loader" ,
103- " css-minimizer-webpack-plugin" ,
104- " mini-css-extract-plugin" ,
105- " style-loader"
106- ] )
101+ package_json . manager . add ( %w [
102+ css-loader
103+ css-minimizer-webpack-plugin
104+ mini-css-extract-plugin
105+ style-loader
106+ ] )
107107
108108 puts "Adding dev dependencies"
109109 package_json . manager . add ( [
110- "@pmmmwh/react-refresh-webpack-plugin" ,
111- "react-refresh"
112- ] , type : :dev )
110+ "@pmmmwh/react-refresh-webpack-plugin" ,
111+ "react-refresh"
112+ ] , type : :dev )
113113 end
114114
115115 def append_to_spec_rails_helper
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3+ require "package_json"
34require "rainbow"
45
56module GeneratorHelper
6- def require_package_json_gem
7- require "bundler/inline"
8-
9- gemfile { gem "package_json" , github : "G-Rath/package_json" }
10-
11- puts "using package_json v#{ PackageJson ::VERSION } "
12- end
13-
147 def package_json
15- if @package_json . nil?
16- require_package_json_gem
17-
18- @package_json = PackageJson . read ( @app_path )
19- end
20-
21- @package_json
8+ @package_json ||= PackageJson . read ( Rails . root . to_s )
229 end
2310
2411 # Takes a relative path from the destination root, such as `.gitignore` or `app/assets/javascripts/application.js`
You can’t perform that action at this time.
0 commit comments