react_on_rails 2.0.0.beta.3 → 2.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Rakefile +3 -6
- data/docs/contributing.md +12 -3
- data/docs/releasing.md +15 -0
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx +4 -4
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/version_checker.rb +6 -7
- data/package.json +1 -1
- data/rakelib/dummy_apps.rake +2 -0
- data/rakelib/examples.rake +1 -1
- data/rakelib/node_package.rake +9 -2
- data/rakelib/run_rspec.rake +1 -1
- data/script/bootstrap +33 -0
- data/script/release +3 -0
- data/script/setup +23 -0
- data/script/test +38 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a3532d98dcdbf8b585e955a5c605d9c884ac6df
|
4
|
+
data.tar.gz: f7b3342e9599a2ba77087bb44b4004ac38eac4df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6524e9358002a3124ffbf24620de5b7c4234ce78bf2a2851f8b32093c0d75f8189602b0a972ba94e0f4df7808fe1e29922fe680283e4ce655b7a8c9f3c2a466
|
7
|
+
data.tar.gz: 35510b925a6828dac60290ad1cb6ca803e2726f412d032d06c4338bc18fa0373b8a5261c15519c8b648a3197609e86ef76da045fedd4beede3f42bd3f5792603
|
data/.travis.yml
CHANGED
@@ -30,12 +30,12 @@ install:
|
|
30
30
|
- npm install
|
31
31
|
- rake dummy_apps
|
32
32
|
- rake examples
|
33
|
+
- rake node_package
|
33
34
|
- docker-compose up lint
|
34
35
|
|
35
36
|
before_script:
|
36
37
|
- "export DISPLAY=:99"
|
37
38
|
- Xvfb :99 -ac -screen scn 1600x1200x16 &
|
38
|
-
- npm run symlink_node_package
|
39
39
|
|
40
40
|
script:
|
41
41
|
- rake
|
data/Rakefile
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
# Rake will automatically load any *.rake files inside of the "rakelib" folder
|
2
2
|
# See rakelib/
|
3
|
+
require "coveralls/rake/task"
|
4
|
+
Coveralls::RakeTask.new
|
3
5
|
|
4
6
|
desc "Run all tests and linting"
|
5
|
-
task default: ["run_rspec", "docker:lint"]
|
6
|
-
|
7
|
-
desc "Has all examples and dummy apps use local node_package folder for react-on-rails node dependency"
|
8
|
-
task :symlink_node_package do
|
9
|
-
sh_in_dir(gem_root, "npm run symlink_node_package")
|
10
|
-
end
|
7
|
+
task default: ["run_rspec", "docker:lint", "coveralls:push"]
|
data/docs/contributing.md
CHANGED
@@ -90,9 +90,18 @@ From now on, the example and dummy apps will use your local node_package folder
|
|
90
90
|
```sh
|
91
91
|
cd <top level>
|
92
92
|
npm i
|
93
|
-
npm
|
94
|
-
|
95
|
-
|
93
|
+
npm build
|
94
|
+
```
|
95
|
+
|
96
|
+
Or run this which builds the npm package, then the webpack files for spec/dummy, and runs tests in
|
97
|
+
spec/dummy.
|
98
|
+
|
99
|
+
|
100
|
+
```sh
|
101
|
+
# Optionally change default selenium_firefox driver
|
102
|
+
export DRIVER=poltergeist
|
103
|
+
cd <top level>
|
104
|
+
npm dummy:spec
|
96
105
|
```
|
97
106
|
|
98
107
|
### Run NPM JS tests
|
data/docs/releasing.md
CHANGED
@@ -27,3 +27,18 @@ gem release
|
|
27
27
|
Be sure to keep the version number the same as the ruby gem!
|
28
28
|
|
29
29
|
Use the npm package `release-it`
|
30
|
+
|
31
|
+
### Commands Used for Pushing Beta
|
32
|
+
|
33
|
+
Note the npm beta version has a dash and the gem version has a dot.
|
34
|
+
|
35
|
+
```
|
36
|
+
gem bump -v 2.0.0.beta.3
|
37
|
+
gem tag
|
38
|
+
cd spec/dummy && bundle
|
39
|
+
ga Gemfile.lock
|
40
|
+
gc -m "Update Gemfile.lock for spec/dummy"
|
41
|
+
...
|
42
|
+
gem release
|
43
|
+
release-it 2.0.0-beta.3
|
44
|
+
```
|
@@ -10,10 +10,10 @@ export default function helloWorldReducer($$state = $$initialState, action) {
|
|
10
10
|
const { type, name } = action;
|
11
11
|
|
12
12
|
switch (type) {
|
13
|
-
|
14
|
-
|
13
|
+
case actionTypes.HELLO_WORLD_NAME_UPDATE:
|
14
|
+
return $$state.set('name', name);
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
default:
|
17
|
+
return $$state;
|
18
18
|
}
|
19
19
|
}
|
@@ -13,10 +13,8 @@ module ReactOnRails
|
|
13
13
|
# For compatibility, the gem and the node package versions should always match, unless the user
|
14
14
|
# really knows what they're doing. So we will give a warning if they do not.
|
15
15
|
def self.warn_if_gem_and_node_package_versions_differ
|
16
|
-
return unless
|
17
|
-
|
18
|
-
node_package_version_is_standard_version_number? &&
|
19
|
-
gem_version != node_package_version
|
16
|
+
return unless node_package_version_is_standard_version_number? &&
|
17
|
+
gem_version != node_package_version
|
20
18
|
msg = "**WARNING** ReactOnRails: ReactOnRails gem and node package versions do not match\n" \
|
21
19
|
" gem: #{gem_version}\n" \
|
22
20
|
" node package: #{node_package_version}\n" \
|
@@ -33,14 +31,15 @@ module ReactOnRails
|
|
33
31
|
|
34
32
|
# Warning: we replace all hyphens with periods for normalization purposes
|
35
33
|
def self.node_package_version
|
36
|
-
|
37
|
-
contents = File.read(
|
34
|
+
return unless client_package_json.present? && File.exist?(client_package_json)
|
35
|
+
contents = File.read(client_package_json)
|
38
36
|
raw_version = contents.match(/"react-on-rails": "(.*)",/)[1]
|
39
37
|
raw_version.tr("-", ".")
|
40
38
|
end
|
41
39
|
|
42
40
|
def self.client_package_json
|
43
|
-
|
41
|
+
return unless Rails.root.present?
|
42
|
+
Rails.root.join("client", "package.json")
|
44
43
|
end
|
45
44
|
|
46
45
|
# Basically this means "not a relative path" as we don't want warn the user
|
data/package.json
CHANGED
data/rakelib/dummy_apps.rake
CHANGED
@@ -6,6 +6,8 @@ namespace :dummy_apps do
|
|
6
6
|
dummy_app_dir = File.join(gem_root, "spec/dummy")
|
7
7
|
bundle_install_in(dummy_app_dir)
|
8
8
|
dummy_app_client_dir = File.join(dummy_app_dir, "client")
|
9
|
+
|
10
|
+
# Note, we do not put in "npm build" as npm install does that!
|
9
11
|
sh_in_dir(dummy_app_client_dir, ["npm install",
|
10
12
|
"$(npm bin)/webpack --config webpack.server.js",
|
11
13
|
"$(npm bin)/webpack --config webpack.client.js"])
|
data/rakelib/examples.rake
CHANGED
@@ -72,7 +72,7 @@ namespace :examples do
|
|
72
72
|
# PREPARE
|
73
73
|
desc "Prepares #{example_type.name_pretty} (generates example, `npm install`s, and generates webpack bundles)"
|
74
74
|
multitask example_type.prepare_task_name_short => example_type.prepared_files do
|
75
|
-
Rake::Task[
|
75
|
+
Rake::Task["node_package"].invoke
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
data/rakelib/node_package.rake
CHANGED
@@ -5,7 +5,14 @@ namespace :node_package do
|
|
5
5
|
task :build do
|
6
6
|
sh 'npm run build'
|
7
7
|
end
|
8
|
+
|
9
|
+
desc "Has all examples and dummy apps use local node_package folder for react-on-rails node dependency"
|
10
|
+
task :symlink do
|
11
|
+
sh_in_dir(gem_root, "npm run symlink-node-package")
|
12
|
+
end
|
8
13
|
end
|
9
14
|
|
10
|
-
desc "Prepares
|
11
|
-
task node_package:
|
15
|
+
desc "Prepares node_package by building and symlinking any example/dummy apps present"
|
16
|
+
task node_package: "node_package:build" do
|
17
|
+
Rake::Task["node_package:symlink"].invoke
|
18
|
+
end
|
data/rakelib/run_rspec.rake
CHANGED
@@ -37,7 +37,7 @@ namespace :run_rspec do
|
|
37
37
|
Coveralls::RakeTask.new
|
38
38
|
|
39
39
|
desc "run all tests"
|
40
|
-
task run_rspec: [:gem, :dummy, :examples, :empty, :js_tests
|
40
|
+
task run_rspec: [:gem, :dummy, :examples, :empty, :js_tests] do
|
41
41
|
puts "Completed all RSpec tests"
|
42
42
|
end
|
43
43
|
end
|
data/script/bootstrap
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# script/bootstrap: Resolve all dependencies that the application requires to
|
4
|
+
# run.
|
5
|
+
|
6
|
+
set -e
|
7
|
+
|
8
|
+
cd "$(dirname "$0")/.."
|
9
|
+
|
10
|
+
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
|
11
|
+
brew update
|
12
|
+
|
13
|
+
brew bundle check 2>&1 >/dev/null || {
|
14
|
+
echo "==> Installing Homebrew dependencies…"
|
15
|
+
brew bundle
|
16
|
+
}
|
17
|
+
fi
|
18
|
+
|
19
|
+
if [ -f ".ruby-version" ] && [ -z "$(rbenv version-name 2>/dev/null)" ]; then
|
20
|
+
echo "==> Installing Ruby…"
|
21
|
+
rbenv install --skip-existing
|
22
|
+
which bundle 2>&1 >/dev/null || {
|
23
|
+
gem install bundler
|
24
|
+
rbenv rehash
|
25
|
+
}
|
26
|
+
fi
|
27
|
+
|
28
|
+
if [ -f "Gemfile" ]; then
|
29
|
+
echo "==> Installing gem dependencies…"
|
30
|
+
bundle check --path vendor/gems 2>&1 >/dev/null || {
|
31
|
+
bundle install --path vendor/gems --quiet --without production
|
32
|
+
}
|
33
|
+
fi
|
data/script/release
ADDED
data/script/setup
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# script/setup: Set up application for the first time after cloning, or set it
|
4
|
+
# back to the initial first unused state.
|
5
|
+
|
6
|
+
set -e
|
7
|
+
|
8
|
+
cd "$(dirname "$0")/.."
|
9
|
+
|
10
|
+
script/bootstrap
|
11
|
+
|
12
|
+
echo "===> Setting up DB..."
|
13
|
+
# reset database to a fresh state.
|
14
|
+
bin/rake db:create db:reset
|
15
|
+
|
16
|
+
if [ -z "$RAILS_ENV" ] && [ -z "$RACK_ENV" ]; then
|
17
|
+
# Only things for a development environment will run inside here
|
18
|
+
# Do things that need to be done to the application to set up for the first
|
19
|
+
# time. Or things needed to be run to to reset the application back to first
|
20
|
+
# use experience. These things are scoped to the application's domain.
|
21
|
+
fi
|
22
|
+
|
23
|
+
echo "==> App is now ready to go!"
|
data/script/test
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
# script/test: Run test suite for application. Optionally pass in a path to an
|
4
|
+
# individual test file to run a single test.
|
5
|
+
|
6
|
+
|
7
|
+
set -e
|
8
|
+
|
9
|
+
cd "$(dirname "$0")/.."
|
10
|
+
|
11
|
+
[ -z "$DEBUG" ] || set -x
|
12
|
+
|
13
|
+
export RACK_ROOT=$(cd "$(dirname $0)"/.. && pwd)
|
14
|
+
|
15
|
+
if [ "$RAILS_ENV" = "test" ] || [ "$RACK_ENV" = "test" ]; then
|
16
|
+
# if executed and the environment is already set to `test`, then we want a
|
17
|
+
# clean from scratch application. This almost always means a ci environment,
|
18
|
+
# since we set the environment to `test` directly in `script/cibuild`.
|
19
|
+
script/setup
|
20
|
+
else
|
21
|
+
# if the environment isn't set to `test`, set it to `test` and update the
|
22
|
+
# application to ensure all dependencies are met as well as any other things
|
23
|
+
# that need to be up to date, like db migrations. The environement not having
|
24
|
+
# already been set to `test` almost always means this is being called on it's
|
25
|
+
# own from a `development` environment.
|
26
|
+
export RAILS_ENV="test" RACK_ENV="test"
|
27
|
+
|
28
|
+
script/update
|
29
|
+
fi
|
30
|
+
|
31
|
+
echo "===> Running tests..."
|
32
|
+
|
33
|
+
if [ -n "$1" ]; then
|
34
|
+
# pass arguments to test call. This is useful for calling a single test.
|
35
|
+
bin/rake test "$1"
|
36
|
+
else
|
37
|
+
bin/rake test
|
38
|
+
fi
|
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: 2.0.0.
|
4
|
+
version: 2.0.0.rc.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-01-
|
11
|
+
date: 2016-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -247,6 +247,10 @@ files:
|
|
247
247
|
- rakelib/task_helpers.rb
|
248
248
|
- react_on_rails.gemspec
|
249
249
|
- ruby-lint.yml
|
250
|
+
- script/bootstrap
|
251
|
+
- script/release
|
252
|
+
- script/setup
|
253
|
+
- script/test
|
250
254
|
homepage: https://github.com/shakacode/react_on_rails
|
251
255
|
licenses:
|
252
256
|
- MIT
|