react_on_rails 7.0.2 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d18338f5306c4f3a2efc3d272f49e9f28b3b99d
4
- data.tar.gz: e8943470e132ea1ef8931561ebe805344af958bc
3
+ metadata.gz: ef998054ca4a6183ff2b3a1f03c5548e571e7530
4
+ data.tar.gz: 890fa047afd848ebbdb7be691db95530473737e7
5
5
  SHA512:
6
- metadata.gz: 3913eb855b52bc544b124f70f8a56210e4f7053489558c0ba8e58a8af1256f94646a1c3d5448c7ef5678eaeec51d41cef32b56c149b7d9472b08cf15d0368f8c
7
- data.tar.gz: a511adf13044d1cdd51c1ec2099a3ad6f8289b163bfce606c4ef57bc8d8898b024d4ca3e2f244be1ba55ffc45ff9a93394c05e036d620eb1fe5324b2e90c5766
6
+ metadata.gz: 10cc9f43c76f46a802b8de23f881dda04538153e6e9f27c212955472241736bf5c07ec7c6dae69413713f235b2c280011515ec82586b425b4db243274c238dfd
7
+ data.tar.gz: f12eeebc7f8525e46481d244013f05e55d574ea922a8de9b1d297b7efcd79f48fea153c75d42db0c4d89763c058f9d288e6f53d3829020b84831042c4295cded
data/.eslintignore CHANGED
@@ -7,7 +7,6 @@ node_package/tests/node_modules
7
7
  node_package/webpack.config.js
8
8
  **/node_modules/**
9
9
  **/assets/webpack/**
10
- **/public/webpack/**
11
10
  **/generated/**
12
11
  **/app/assets/javascripts/application.js
13
12
  **/coverage/**
data/.gitignore CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  /spec/examples.txt
14
14
  /spec/dummy/client/node_modules
15
- /spec/dummy/public/webpack/
15
+ /spec/dummy/app/assets/webpack/
16
16
  /spec/dummy/coverage/
17
17
  /spec/react_on_rails/dummy-for-generators/
18
18
 
@@ -31,8 +31,7 @@ The following `config/react_on_rails.rb` settings **must** match your setup:
31
31
  ```ruby
32
32
  # Directory where your generated assets go. All generated assets must go to the same directory.
33
33
  # Configure this in your webpack config files. This relative to your Rails root directory.
34
- # We recommend having different generated assets dirs per Rails env.
35
- config.generated_assets_dir = File.join(%w[public webpack], Rails.env)
34
+ config.generated_assets_dir = File.join(%w(app assets webpack))
36
35
 
37
36
  # Define the files we need to check for webpack compilation when running tests.
38
37
  config.webpack_generated_files = %w( webpack-bundle.js )
@@ -27,7 +27,7 @@ module ReactOnRails
27
27
  node_modules
28
28
 
29
29
  # Generated js bundles
30
- /public/webpack/*
30
+ /app/assets/webpack/*
31
31
  DATA
32
32
 
33
33
  if dest_file_exists?(".gitignore")
@@ -37,6 +37,26 @@ module ReactOnRails
37
37
  end
38
38
  end
39
39
 
40
+ def update_application_js
41
+ data = <<-DATA.strip_heredoc
42
+ //= require webpack-bundle
43
+
44
+ DATA
45
+
46
+ app_js_path = "app/assets/javascripts/application.js"
47
+ found_app_js = dest_file_exists?(app_js_path) || dest_file_exists?("#{app_js_path}.coffee")
48
+ if found_app_js
49
+ prepend_to_file(found_app_js, data)
50
+ else
51
+ create_file(app_js_path, data)
52
+ end
53
+ end
54
+
55
+ def strip_application_js_of_double_blank_lines
56
+ application_js = File.join(destination_root, "app/assets/javascripts/application.js")
57
+ gsub_file(application_js, /^\n^\n/, "\n")
58
+ end
59
+
40
60
  def create_react_directories
41
61
  dirs = %w(components containers startup)
42
62
  dirs.each { |name| empty_directory("client/app/bundles/HelloWorld/#{name}") }
@@ -45,8 +65,6 @@ module ReactOnRails
45
65
  def copy_base_files
46
66
  base_path = "base/base/"
47
67
  base_files = %w(app/controllers/hello_world_controller.rb
48
- config/webpack/paths.yml
49
- config/webpack/development.server.yml
50
68
  client/.babelrc
51
69
  client/webpack.config.js
52
70
  client/REACT_ON_RAILS_CLIENT_README.md)
@@ -55,15 +73,14 @@ module ReactOnRails
55
73
 
56
74
  def template_base_files
57
75
  base_path = "base/base/"
58
- %w(app/views/layouts/hello_world.html.erb
59
- config/initializers/react_on_rails.rb
76
+ %w(config/initializers/react_on_rails.rb
60
77
  Procfile.dev
61
78
  package.json
62
79
  client/package.json).each { |file| template("#{base_path}#{file}.tt", file) }
63
80
  end
64
81
 
65
82
  def add_base_gems_to_gemfile
66
- append_to_file("Gemfile", "\ngem 'mini_racer', platforms: :ruby\ngem 'webpacker_lite'\n")
83
+ append_to_file("Gemfile", "\ngem 'mini_racer', platforms: :ruby\n")
67
84
  end
68
85
 
69
86
  ASSETS_RB_APPEND = <<-DATA.strip_heredoc
@@ -76,7 +93,7 @@ module ReactOnRails
76
93
  # Rails.application.config.assets.precompile += %w( server-bundle.js )
77
94
 
78
95
  # Add folder with webpack generated assets to assets.paths
79
- Rails.application.config.assets.paths << Rails.root.join("public", "webpack", Rails.env)
96
+ Rails.application.config.assets.paths << Rails.root.join("app", "assets", "webpack")
80
97
  DATA
81
98
 
82
99
  def append_to_assets_initializer
@@ -121,10 +138,6 @@ Rails.application.config.assets.paths << Rails.root.join("public", "webpack", Ra
121
138
 
122
139
  What to do next:
123
140
 
124
- - Include your webpack assets to your application layout.
125
-
126
- <%= javascript_pack_tag 'main' %>
127
-
128
141
  - Ensure your bundle and yarn installs of dependencies are up to date.
129
142
 
130
143
  bundle && yarn
@@ -45,6 +45,15 @@ module ReactOnRails
45
45
  File.open(package_json, "w+") { |f| f.puts new_contents }
46
46
  end
47
47
 
48
+ def change_webpack_client_base_config_to_include_fallback
49
+ sentinel = /^\s\s},\n\s\splugins: \[\n/
50
+ config = File.join(destination_root, "client", "webpack.config.js")
51
+ old_contents = File.read(config)
52
+ new_contents = "const path = require('path');\n" +
53
+ old_contents.gsub(sentinel, FALLBACK_OPTION_FOR_NODE_MODULES)
54
+ File.open(config, "w+") { |f| f.puts new_contents }
55
+ end
56
+
48
57
  def add_test_related_gems_to_gemfile
49
58
  gem("rspec-rails", group: :test)
50
59
  gem("capybara", group: :test)
@@ -1,6 +1,4 @@
1
1
  class HelloWorldController < ApplicationController
2
- layout "hello_world"
3
-
4
2
  def index
5
3
  @hello_world_props = { name: "Stranger" }
6
4
  end
@@ -8,9 +8,9 @@
8
8
  "npm": "4.1.1"
9
9
  },
10
10
  "scripts": {
11
- "build:test": "NODE_ENV=test webpack --config webpack.config.js",
11
+ "build:test": "webpack --config webpack.config.js",
12
12
  "build:production": "NODE_ENV=production webpack --config webpack.config.js",
13
- "build:development": "NODE_ENV=development webpack -w --config webpack.config.js"
13
+ "build:development": "webpack -w --config webpack.config.js"
14
14
  },
15
15
  "cacheDirectories": ["node_modules", "client/node_modules"],
16
16
  "dependencies": {
@@ -25,7 +25,6 @@
25
25
  "es5-shim": "^4.5.9",
26
26
  "expose-loader": "^0.7.3",
27
27
  "imports-loader": "^0.7.1",
28
- "js-yaml": "^3.8.2",
29
28
  "react": "^15.5.4",
30
29
  "react-dom": "^15.5.4",
31
30
  "react-on-rails": "<%= VersionSyntaxConverter.new.rubygem_to_npm %>",
@@ -33,8 +32,7 @@
33
32
  "react-redux": "^5.0.4",
34
33
  "redux": "^3.6.0",
35
34
  <%- end -%>
36
- "webpack": "^2.3.3",
37
- "webpack-manifest-plugin": "^1.1.0"
35
+ "webpack": "^2.3.3"
38
36
  },
39
37
  "devDependencies": {
40
38
  }
@@ -3,19 +3,11 @@
3
3
  "only-multiline"} ] */
4
4
 
5
5
  const webpack = require('webpack');
6
- const { resolve } = require('path');
7
- const ManifestPlugin = require('webpack-manifest-plugin');
8
- const webpackConfigLoader = require('react-on-rails/webpackConfigLoader');
6
+ const pathLib = require('path');
9
7
 
10
- const configPath = resolve('..', 'config', 'webpack');
11
- const { env, paths, publicPath } = webpackConfigLoader(configPath);
12
-
13
- const devBuild = env !== 'production';
8
+ const devBuild = process.env.NODE_ENV !== 'production';
14
9
 
15
10
  const config = {
16
-
17
- context: resolve(__dirname),
18
-
19
11
  entry: [
20
12
  'es5-shim/es5-shim',
21
13
  'es5-shim/es5-sham',
@@ -25,19 +17,15 @@ const config = {
25
17
 
26
18
  output: {
27
19
  filename: 'webpack-bundle.js',
28
- path: resolve('..', paths.output, paths.assets),
20
+ path: pathLib.resolve(__dirname, '../app/assets/webpack'),
29
21
  },
30
22
 
31
23
  resolve: {
32
24
  extensions: ['.js', '.jsx'],
33
25
  },
34
-
35
-
36
26
  plugins: [
37
- new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(env))),
38
- new ManifestPlugin({ fileName: paths.manifest, publicPath, writeToFileEmit: true }),
27
+ new webpack.EnvironmentPlugin({ NODE_ENV: 'development' }),
39
28
  ],
40
-
41
29
  module: {
42
30
  rules: [
43
31
  {
@@ -4,7 +4,7 @@ ReactOnRails.configure do |config|
4
4
 
5
5
  # Directory where your generated assets go. All generated assets must go to the same directory.
6
6
  # Configure this in your webpack config files. This relative to your Rails root directory.
7
- config.generated_assets_dir = File.join(%w[public webpack], Rails.env)
7
+ config.generated_assets_dir = File.join(%w(app assets webpack))
8
8
 
9
9
  # Define the files we need to check for webpack compilation when running tests.
10
10
  config.webpack_generated_files = %w( webpack-bundle.js )
@@ -4,7 +4,7 @@ module ReactOnRails
4
4
  setup_config_values
5
5
  end
6
6
 
7
- DEFAULT_GENERATED_ASSETS_DIR = File.join(%w[public webpack], Rails.env).freeze
7
+ DEFAULT_GENERATED_ASSETS_DIR = File.join(%w(app assets webpack)).freeze
8
8
 
9
9
  def self.setup_config_values
10
10
  ensure_webpack_generated_files_exists
@@ -1,3 +1,3 @@
1
1
  module ReactOnRails
2
- VERSION = "7.0.2".freeze
2
+ VERSION = "7.0.3".freeze
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
@@ -37,8 +37,7 @@
37
37
  "release-it": "^2.7.1",
38
38
  "tap-spec": "^4.1.1",
39
39
  "tape": "^4.6.3",
40
- "webpack": "^2.3.3",
41
- "webpack-manifest-plugin": "^1.1.0"
40
+ "webpack": "^2.3.3"
42
41
  },
43
42
  "peerDependencies": {
44
43
  "babel-runtime": ">= 6",
@@ -46,8 +45,7 @@
46
45
  "react-dom": ">= 0.14"
47
46
  },
48
47
  "files": [
49
- "node_package/lib",
50
- "webpackConfigLoader.js"
48
+ "node_package/lib"
51
49
  ],
52
50
  "scripts": {
53
51
  "test": "babel-tape-runner -r node_package/tests/helpers/test_helper.js node_package/tests/*.js | tap-spec",
@@ -49,7 +49,7 @@ module ReactOnRails
49
49
  end
50
50
 
51
51
  def webpack_bundles_dir
52
- File.join(dir, "public", "webpack", "test")
52
+ File.join(dir, "app", "assets", "javascripts", "webpack")
53
53
  end
54
54
 
55
55
  def webpack_bundles
@@ -131,7 +131,7 @@ module ReactOnRails
131
131
  def build_webpack_bundles_shell_commands
132
132
  webpack_command = File.join("$(yarn bin)", "webpack")
133
133
  shell_commands = []
134
- shell_commands << "NODE_ENV=test #{webpack_command} --config webpack.config.js"
134
+ shell_commands << "#{webpack_command} --config webpack.config.js"
135
135
  end
136
136
 
137
137
  # Assumes we are inside a rails app's folder and necessary gems have been installed
@@ -11,7 +11,6 @@ include ReactOnRails::TaskHelpers
11
11
 
12
12
  namespace :run_rspec do
13
13
  spec_dummy_dir = File.join("spec", "dummy")
14
- spec_dummy_client_dir = File.join("spec", "dummy", "client")
15
14
 
16
15
  desc "Run RSpec for top level only"
17
16
  task :gem do
@@ -21,14 +20,12 @@ namespace :run_rspec do
21
20
  desc "Runs dummy rspec with turbolinks"
22
21
  task dummy: ["dummy_apps:dummy_app"] do
23
22
  clean_gen_assets(spec_dummy_dir)
24
- gen_assets(spec_dummy_client_dir)
25
23
  run_tests_in(spec_dummy_dir)
26
24
  end
27
25
 
28
26
  desc "Runs dummy rspec without turbolinks"
29
27
  task dummy_no_turbolinks: ["dummy_apps:dummy_app"] do
30
28
  clean_gen_assets(spec_dummy_dir)
31
- gen_assets(spec_dummy_client_dir)
32
29
  run_tests_in(spec_dummy_dir,
33
30
  env_vars: "DISABLE_TURBOLINKS=TRUE",
34
31
  command_name: "dummy_no_turbolinks")
@@ -38,7 +35,6 @@ namespace :run_rspec do
38
35
  desc "Runs dummy respec with turbolinks 2"
39
36
  task dummy_turbolinks_2: ["dummy_apps:dummy_app_with_turbolinks_2"] do
40
37
  clean_gen_assets(spec_dummy_dir)
41
- gen_assets(spec_dummy_client_dir)
42
38
  run_tests_in(spec_dummy_dir, env_vars:
43
39
  "ENABLE_TURBOLINKS_2=TRUE BUNDLE_GEMFILE=#{dummy_app_dir}/Gemfile")
44
40
  end
@@ -119,8 +115,3 @@ def clean_gen_assets(dir)
119
115
  path = calc_path(dir)
120
116
  sh_in_dir(path.realpath, "yarn run build:clean")
121
117
  end
122
-
123
- def gen_assets(dir)
124
- path = calc_path(dir)
125
- sh_in_dir(path.realpath, "yarn run build:test")
126
- end
data/yarn.lock CHANGED
@@ -1847,16 +1847,6 @@ form-data@~2.1.1:
1847
1847
  combined-stream "^1.0.5"
1848
1848
  mime-types "^2.1.12"
1849
1849
 
1850
- fs-extra@^0.30.0:
1851
- version "0.30.0"
1852
- resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0"
1853
- dependencies:
1854
- graceful-fs "^4.1.2"
1855
- jsonfile "^2.1.0"
1856
- klaw "^1.0.0"
1857
- path-is-absolute "^1.0.0"
1858
- rimraf "^2.2.8"
1859
-
1860
1850
  fs-readdir-recursive@^1.0.0:
1861
1851
  version "1.0.0"
1862
1852
  resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560"
@@ -1992,7 +1982,7 @@ globby@^5.0.0:
1992
1982
  pify "^2.0.0"
1993
1983
  pinkie-promise "^2.0.0"
1994
1984
 
1995
- graceful-fs@4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
1985
+ graceful-fs@4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4:
1996
1986
  version "4.1.11"
1997
1987
  resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
1998
1988
 
@@ -2431,12 +2421,6 @@ json5@^0.5.0:
2431
2421
  version "0.5.0"
2432
2422
  resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.0.tgz#9b20715b026cbe3778fd769edccd822d8332a5b2"
2433
2423
 
2434
- jsonfile@^2.1.0:
2435
- version "2.4.0"
2436
- resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
2437
- optionalDependencies:
2438
- graceful-fs "^4.1.6"
2439
-
2440
2424
  jsonify@~0.0.0:
2441
2425
  version "0.0.0"
2442
2426
  resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
@@ -2466,12 +2450,6 @@ kind-of@^3.0.2:
2466
2450
  dependencies:
2467
2451
  is-buffer "^1.0.2"
2468
2452
 
2469
- klaw@^1.0.0:
2470
- version "1.3.1"
2471
- resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
2472
- optionalDependencies:
2473
- graceful-fs "^4.1.9"
2474
-
2475
2453
  lazy-cache@^1.0.3:
2476
2454
  version "1.0.4"
2477
2455
  resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
@@ -2524,7 +2502,7 @@ lodash.pickby@^4.6.0:
2524
2502
  version "4.6.0"
2525
2503
  resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
2526
2504
 
2527
- lodash@4.17.4, "lodash@>=3.5 <5", lodash@^4.14.0, lodash@^4.3.0:
2505
+ lodash@4.17.4, lodash@^4.14.0, lodash@^4.3.0:
2528
2506
  version "4.17.4"
2529
2507
  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
2530
2508
 
@@ -2743,11 +2721,11 @@ oauth-sign@~0.8.1:
2743
2721
  version "0.8.2"
2744
2722
  resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
2745
2723
 
2746
- object-assign@^4.0.0, object-assign@^4.0.1:
2724
+ object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0:
2747
2725
  version "4.1.0"
2748
2726
  resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0"
2749
2727
 
2750
- object-assign@^4.1.0, object-assign@^4.1.1:
2728
+ object-assign@^4.1.1:
2751
2729
  version "4.1.1"
2752
2730
  resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
2753
2731
 
@@ -3059,9 +3037,6 @@ react-dom@^15.5.4:
3059
3037
  object-assign "^4.1.0"
3060
3038
  prop-types "~15.5.7"
3061
3039
 
3062
- "react-on-rails@file:./":
3063
- version "6.10.0"
3064
-
3065
3040
  react-proxy@^1.1.7:
3066
3041
  version "1.1.8"
3067
3042
  resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-1.1.8.tgz#9dbfd9d927528c3aa9f444e4558c37830ab8c26a"
@@ -3815,13 +3790,6 @@ webidl-conversions@^4.0.0:
3815
3790
  version "4.0.1"
3816
3791
  resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0"
3817
3792
 
3818
- webpack-manifest-plugin@^1.1.0:
3819
- version "1.1.0"
3820
- resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-1.1.0.tgz#6b6c718aade8a2537995784b46bd2e9836057caa"
3821
- dependencies:
3822
- fs-extra "^0.30.0"
3823
- lodash ">=3.5 <5"
3824
-
3825
3793
  webpack-sources@^0.2.3:
3826
3794
  version "0.2.3"
3827
3795
  resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.2
4
+ version: 7.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
@@ -370,11 +370,9 @@ files:
370
370
  - lib/generators/react_on_rails/node_generator.rb
371
371
  - lib/generators/react_on_rails/react_no_redux_generator.rb
372
372
  - lib/generators/react_on_rails/react_with_redux_generator.rb
373
- - lib/generators/react_on_rails/templates/.eslintrc
374
373
  - lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt
375
374
  - lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb
376
375
  - lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt
377
- - lib/generators/react_on_rails/templates/base/base/app/views/layouts/hello_world.html.erb.tt
378
376
  - lib/generators/react_on_rails/templates/base/base/client/.babelrc
379
377
  - lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md
380
378
  - lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/HelloWorld.jsx
@@ -382,8 +380,6 @@ files:
382
380
  - lib/generators/react_on_rails/templates/base/base/client/package.json.tt
383
381
  - lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
384
382
  - lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt
385
- - lib/generators/react_on_rails/templates/base/base/config/webpack/development.server.yml
386
- - lib/generators/react_on_rails/templates/base/base/config/webpack/paths.yml
387
383
  - lib/generators/react_on_rails/templates/base/base/package.json.tt
388
384
  - lib/generators/react_on_rails/templates/dev_tests/.rspec
389
385
  - lib/generators/react_on_rails/templates/dev_tests/spec/features/hello_world_spec.rb
@@ -440,7 +436,6 @@ files:
440
436
  - script/release
441
437
  - script/setup
442
438
  - script/test
443
- - webpackConfigLoader.js
444
439
  - yarn.lock
445
440
  homepage: https://github.com/shakacode/react_on_rails
446
441
  licenses:
@@ -1,23 +0,0 @@
1
- ---
2
- extends: eslint-config-shakacode
3
-
4
- plugins:
5
- - react
6
-
7
- globals:
8
- __DEBUG_SERVER_ERRORS__: true
9
- __SERVER_ERRORS__: true
10
-
11
- env:
12
- browser: true
13
- node: true
14
- mocha: true
15
-
16
- rules:
17
- no-console: 0
18
-
19
- # https://github.com/benmosher/eslint-plugin-import/issues/340
20
- import/no-extraneous-dependencies: 0
21
-
22
- # because template cannot find react-on-rails
23
- import/no-unresolved: 0
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>ReactOnRailsWithWebpacker</title>
5
- <%%= csrf_meta_tags %>
6
-
7
- <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
- <%%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
- <%%= javascript_pack_tag 'main' %>
10
- </head>
11
-
12
- <body>
13
- <%%= yield %>
14
- </body>
15
- </html>
@@ -1,9 +0,0 @@
1
- default: &default
2
- enabled: false
3
- host: localhost
4
- port: 3500
5
-
6
- development:
7
- <<: *default
8
- # set to true of you want hot loading as default
9
- enabled: false
@@ -1,18 +0,0 @@
1
- default: &default
2
- output: public
3
- assets: webpack
4
- manifest: manifest.json
5
- node_modules: client/node_modules
6
- source: client/app
7
-
8
- development:
9
- <<: *default
10
- assets: webpack/development
11
-
12
- test:
13
- <<: *default
14
- assets: webpack/test
15
-
16
- production:
17
- <<: *default
18
- assets: webpack/production
@@ -1,28 +0,0 @@
1
- const { join } = require('path');
2
- const { env } = require('process');
3
- const { safeLoad } = require('js-yaml');
4
- const { readFileSync } = require('fs');
5
-
6
- const configLoader = (configPath) => {
7
- const paths = safeLoad(readFileSync(join(configPath, 'paths.yml'), 'utf8'))[env.NODE_ENV];
8
-
9
- const devServerConfig = join(configPath, 'development.server.yml');
10
- const devServer = safeLoad(readFileSync(devServerConfig, 'utf8')).development;
11
-
12
- if (env.REACT_ON_RAILS_ENV === 'HOT') {
13
- devServer.enabled = true;
14
- }
15
- const productionBuild = env.NODE_ENV === 'production';
16
-
17
- const publicPath = !productionBuild && devServer.enabled ?
18
- `http://${devServer.host}:${devServer.port}/` : `/${paths.assets}/`;
19
-
20
- return {
21
- devServer,
22
- env,
23
- paths,
24
- publicPath,
25
- };
26
- };
27
-
28
- module.exports = configLoader;