react_on_rails 2.3.0 → 3.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -12
- data/CHANGELOG.md +28 -3
- data/README.md +56 -5
- data/app/helpers/react_on_rails_helper.rb +110 -31
- data/docs/additional_reading/rspec_configuration.md +10 -6
- data/docs/additional_reading/turbolinks.md +3 -0
- data/lib/generators/USAGE +4 -4
- data/lib/generators/react_on_rails/install_generator.rb +1 -1
- data/lib/react_on_rails.rb +6 -7
- data/lib/react_on_rails/configuration.rb +10 -4
- data/lib/react_on_rails/test_helper.rb +67 -0
- data/lib/react_on_rails/test_helper/ensure_assets_compiled.rb +73 -0
- data/lib/react_on_rails/test_helper/webpack_assets_compiler.rb +33 -0
- data/lib/react_on_rails/test_helper/webpack_assets_status_checker.rb +76 -0
- data/lib/react_on_rails/test_helper/webpack_process_checker.rb +50 -0
- data/lib/react_on_rails/utils.rb +10 -0
- data/lib/react_on_rails/version.rb +1 -1
- data/npm-shrinkwrap.json +695 -1
- data/package.json +3 -4
- data/react_on_rails.gemspec +1 -0
- metadata +23 -5
- data/lib/react_on_rails/ensure_assets_compiled.rb +0 -31
data/package.json
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-on-rails",
|
3
|
-
"version": "
|
3
|
+
"version": "3.0.0-beta.1",
|
4
4
|
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
|
5
5
|
"main": "node_package/lib/ReactOnRails.js",
|
6
6
|
"directories": {
|
7
7
|
"doc": "docs"
|
8
8
|
},
|
9
|
-
"dependencies": {
|
10
|
-
"babel-types": "^6.4.5"
|
11
|
-
},
|
12
9
|
"devDependencies": {
|
13
10
|
"babel": "^6.3.26",
|
14
11
|
"babel-cli": "^6.4.5",
|
@@ -21,6 +18,7 @@
|
|
21
18
|
"babel-preset-stage-0": "^6.3.13",
|
22
19
|
"babel-runtime": "^6.3.19",
|
23
20
|
"babel-tape-runner": "^2.0.0",
|
21
|
+
"babel-types": "^6.4.5",
|
24
22
|
"babelify": "^7.2.0",
|
25
23
|
"blue-tape": "^0.1.11",
|
26
24
|
"eslint": "^1.10.3",
|
@@ -33,6 +31,7 @@
|
|
33
31
|
"react": "^0.14.7",
|
34
32
|
"react-dom": "^0.14.7",
|
35
33
|
"react-transform-hmr": "^1.0.1",
|
34
|
+
"redux": "^3.3.1",
|
36
35
|
"tap-spec": "^4.1.1",
|
37
36
|
"tape": "^4.4.0",
|
38
37
|
"webpack": "^1.12.12"
|
data/react_on_rails.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency "execjs", "~> 2.5"
|
24
24
|
s.add_dependency "rainbow", "~> 2.1"
|
25
25
|
s.add_dependency "rails", ">= 3.2"
|
26
|
+
s.add_dependency "foreman"
|
26
27
|
|
27
28
|
s.add_development_dependency "bundler", "~> 1.10"
|
28
29
|
s.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Gordon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: foreman
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -381,10 +395,14 @@ files:
|
|
381
395
|
- lib/react_on_rails.rb
|
382
396
|
- lib/react_on_rails/configuration.rb
|
383
397
|
- lib/react_on_rails/engine.rb
|
384
|
-
- lib/react_on_rails/ensure_assets_compiled.rb
|
385
398
|
- lib/react_on_rails/git_utils.rb
|
386
399
|
- lib/react_on_rails/prerender_error.rb
|
387
400
|
- lib/react_on_rails/server_rendering_pool.rb
|
401
|
+
- lib/react_on_rails/test_helper.rb
|
402
|
+
- lib/react_on_rails/test_helper/ensure_assets_compiled.rb
|
403
|
+
- lib/react_on_rails/test_helper/webpack_assets_compiler.rb
|
404
|
+
- lib/react_on_rails/test_helper/webpack_assets_status_checker.rb
|
405
|
+
- lib/react_on_rails/test_helper/webpack_process_checker.rb
|
388
406
|
- lib/react_on_rails/utils.rb
|
389
407
|
- lib/react_on_rails/version.rb
|
390
408
|
- lib/react_on_rails/version_checker.rb
|
@@ -422,9 +440,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
422
440
|
version: '0'
|
423
441
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
424
442
|
requirements:
|
425
|
-
- - "
|
443
|
+
- - ">"
|
426
444
|
- !ruby/object:Gem::Version
|
427
|
-
version:
|
445
|
+
version: 1.3.1
|
428
446
|
requirements: []
|
429
447
|
rubyforge_project:
|
430
448
|
rubygems_version: 2.5.1
|
@@ -1,31 +0,0 @@
|
|
1
|
-
module ReactOnRails
|
2
|
-
module EnsureAssetsCompiled
|
3
|
-
def self.check_built_assets
|
4
|
-
return if @checks_complete
|
5
|
-
puts "Checking for existing webpack bundles before running tests."
|
6
|
-
build_assets_for_type("client")
|
7
|
-
build_assets_for_type("server") if ReactOnRails.configuration.server_bundle_js_file.present?
|
8
|
-
@checks_complete = true
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.build_assets_for_type(type)
|
12
|
-
unless running_webpack_watch?(type)
|
13
|
-
puts "Building Webpack #{type}-rendering assets..."
|
14
|
-
build_output = `cd client && npm run build:#{type}`
|
15
|
-
if build_output =~ /error/i
|
16
|
-
fail "Error in building assets!\n#{build_output}"
|
17
|
-
end
|
18
|
-
|
19
|
-
puts "Webpack #{type}-rendering assets built."
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.running_webpack_watch?(type)
|
24
|
-
running = `pgrep -fl '\\-w \\-\\-config webpack\\.#{type}\\.rails\\.build\\.config\\.js'`
|
25
|
-
if running.present?
|
26
|
-
puts "Webpack is running for #{type}-rendering assets, skipping rebuild => #{running.ai}"
|
27
|
-
return true
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|