react_on_rails 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +182 -56
  3. data/{LICENSE → docs/LICENSE} +0 -0
  4. data/docs/{gen-notes/reducers.md → additional_reading/generated_client_code.md} +5 -1
  5. data/docs/additional_reading/heroku_deployment.md +21 -0
  6. data/docs/{manual_configuration.md → additional_reading/manual_installation.md} +4 -63
  7. data/docs/{node_dependencies_and_npm.md → additional_reading/node_dependencies_and_npm.md} +0 -0
  8. data/docs/additional_reading/optional_configuration.md +34 -0
  9. data/docs/additional_reading/server_rendering_tips.md +16 -0
  10. data/docs/additional_reading/tips.md +10 -0
  11. data/{CODE_OF_CONDUCT.md → docs/code_of_conduct.md} +0 -0
  12. data/docs/{Contributing.md → contributing.md} +0 -0
  13. data/lib/generators/react_on_rails/base_generator.rb +35 -4
  14. data/lib/generators/react_on_rails/bootstrap_generator.rb +27 -7
  15. data/lib/generators/react_on_rails/generator_helper.rb +4 -2
  16. data/lib/generators/react_on_rails/install_generator.rb +13 -19
  17. data/lib/generators/react_on_rails/js_linters_generator.rb +19 -0
  18. data/lib/generators/react_on_rails/react_no_redux_generator.rb +7 -3
  19. data/lib/generators/react_on_rails/react_with_redux_generator.rb +6 -15
  20. data/lib/generators/react_on_rails/ruby_linters_generator.rb +33 -0
  21. data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/globals.jsx.tt +5 -0
  22. data/lib/generators/react_on_rails/templates/{redux → base}/base/client/package.json.tt +23 -10
  23. data/lib/generators/react_on_rails/templates/base/base/client/server.js +8 -2
  24. data/lib/generators/react_on_rails/templates/base/base/client/{webpack.client.base.config.js → webpack.client.base.config.js.tt} +2 -1
  25. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +1 -3
  26. data/lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake +1 -3
  27. data/lib/generators/react_on_rails/templates/{linters/lib/tasks/linters.rake → base/base/lib/tasks/linters.rake.tt} +36 -29
  28. data/lib/generators/react_on_rails/templates/{linters → js_linters}/client/.eslintignore +0 -0
  29. data/lib/generators/react_on_rails/templates/{linters → js_linters}/client/.eslintrc +0 -0
  30. data/lib/generators/react_on_rails/templates/{linters → js_linters}/client/.jscsrc +0 -0
  31. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +12 -0
  32. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx +2 -2
  33. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/{HelloWorldAppClient.jsx → HelloWorldAppClient.jsx.tt} +3 -2
  34. data/lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js +1 -5
  35. data/lib/generators/react_on_rails/templates/ruby_linters/.rubocop.yml +26 -0
  36. data/lib/generators/react_on_rails/templates/ruby_linters/.scss-lint.yml +205 -0
  37. data/lib/generators/react_on_rails/templates/{linters → ruby_linters}/lib/tasks/brakeman.rake +0 -0
  38. data/lib/generators/react_on_rails/templates/{linters → ruby_linters}/lib/tasks/ci.rake +0 -0
  39. data/lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml +20 -0
  40. data/lib/react_on_rails/version.rb +1 -1
  41. metadata +29 -24
  42. data/docs/gen-notes/react_syntax.md +0 -3
  43. data/docs/linters.md +0 -25
  44. data/lib/generators/react_on_rails/linters_generator.rb +0 -38
  45. data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/clientGlobals.jsx +0 -4
  46. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx +0 -11
  47. data/lib/generators/react_on_rails/templates/no_redux/base/client/package.json.tt +0 -75
@@ -0,0 +1,20 @@
1
+ presenter: syntastic
2
+
3
+ directories:
4
+ - app
5
+ - config
6
+ - spec
7
+
8
+ ignore_paths:
9
+ - client
10
+ - node_modules
11
+
12
+ analysis_classes:
13
+ # - argument_amount
14
+ - pedantics
15
+ - shadowing_variables
16
+ # Too many false positives for these
17
+ # - undefined_methods
18
+ # - undefined_variables
19
+ # - unused_variables
20
+ - useless_equality_checks
@@ -1,3 +1,3 @@
1
1
  module ReactOnRails
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-05 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -140,23 +140,25 @@ files:
140
140
  - ".rubocop.yml"
141
141
  - ".scss-lint.yml"
142
142
  - ".travis.yml"
143
- - CODE_OF_CONDUCT.md
144
143
  - Dockerfile_ci
145
144
  - Dockerfile_tests
146
145
  - Gemfile
147
- - LICENSE
148
146
  - README.md
149
147
  - Rakefile
150
148
  - app/assets/javascripts/react_on_rails.js
151
149
  - app/helpers/react_on_rails_helper.rb
152
150
  - docker-compose.yml
153
- - docs/Contributing.md
154
- - docs/gen-notes/react_syntax.md
155
- - docs/gen-notes/reducers.md
151
+ - docs/LICENSE
152
+ - docs/additional_reading/generated_client_code.md
153
+ - docs/additional_reading/heroku_deployment.md
154
+ - docs/additional_reading/manual_installation.md
155
+ - docs/additional_reading/node_dependencies_and_npm.md
156
+ - docs/additional_reading/optional_configuration.md
157
+ - docs/additional_reading/server_rendering_tips.md
158
+ - docs/additional_reading/tips.md
159
+ - docs/code_of_conduct.md
160
+ - docs/contributing.md
156
161
  - docs/generator_testing_script.md
157
- - docs/linters.md
158
- - docs/manual_configuration.md
159
- - docs/node_dependencies_and_npm.md
160
162
  - docs/sample_generated_js/client-generated.js
161
163
  - docs/sample_generated_js/server-generated.js
162
164
  - lib/generators/react_on_rails/base_generator.rb
@@ -164,24 +166,27 @@ files:
164
166
  - lib/generators/react_on_rails/generator_helper.rb
165
167
  - lib/generators/react_on_rails/heroku_deployment_generator.rb
166
168
  - lib/generators/react_on_rails/install_generator.rb
167
- - lib/generators/react_on_rails/linters_generator.rb
169
+ - lib/generators/react_on_rails/js_linters_generator.rb
168
170
  - lib/generators/react_on_rails/react_no_redux_generator.rb
169
171
  - lib/generators/react_on_rails/react_with_redux_generator.rb
172
+ - lib/generators/react_on_rails/ruby_linters_generator.rb
170
173
  - lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt
171
174
  - lib/generators/react_on_rails/templates/base/base/REACT_ON_RAILS.md
172
175
  - lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb
173
176
  - lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt
174
177
  - lib/generators/react_on_rails/templates/base/base/client/.babelrc
175
178
  - lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md
176
- - lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/clientGlobals.jsx
179
+ - lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/globals.jsx.tt
177
180
  - lib/generators/react_on_rails/templates/base/base/client/index.jade
178
181
  - lib/generators/react_on_rails/templates/base/base/client/npm-shrinkwrap.json
182
+ - lib/generators/react_on_rails/templates/base/base/client/package.json.tt
179
183
  - lib/generators/react_on_rails/templates/base/base/client/server.js
180
- - lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js
184
+ - lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js.tt
181
185
  - lib/generators/react_on_rails/templates/base/base/client/webpack.client.hot.config.js
182
186
  - lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js
183
187
  - lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb
184
188
  - lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake
189
+ - lib/generators/react_on_rails/templates/base/base/lib/tasks/linters.rake.tt
185
190
  - lib/generators/react_on_rails/templates/base/base/package.json
186
191
  - lib/generators/react_on_rails/templates/base/server_rendering/client/app/bundles/HelloWorld/startup/serverGlobals.jsx
187
192
  - lib/generators/react_on_rails/templates/base/server_rendering/client/webpack.server.rails.config.js
@@ -193,16 +198,12 @@ files:
193
198
  - lib/generators/react_on_rails/templates/client/README.md
194
199
  - lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks
195
200
  - lib/generators/react_on_rails/templates/heroku_deployment/Procfile
196
- - lib/generators/react_on_rails/templates/linters/client/.eslintignore
197
- - lib/generators/react_on_rails/templates/linters/client/.eslintrc
198
- - lib/generators/react_on_rails/templates/linters/client/.jscsrc
199
- - lib/generators/react_on_rails/templates/linters/lib/tasks/brakeman.rake
200
- - lib/generators/react_on_rails/templates/linters/lib/tasks/ci.rake
201
- - lib/generators/react_on_rails/templates/linters/lib/tasks/linters.rake
201
+ - lib/generators/react_on_rails/templates/js_linters/client/.eslintignore
202
+ - lib/generators/react_on_rails/templates/js_linters/client/.eslintrc
203
+ - lib/generators/react_on_rails/templates/js_linters/client/.jscsrc
202
204
  - lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx
203
205
  - lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx
204
- - lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx
205
- - lib/generators/react_on_rails/templates/no_redux/base/client/package.json.tt
206
+ - lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt
206
207
  - lib/generators/react_on_rails/templates/no_redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx
207
208
  - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx
208
209
  - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx
@@ -210,11 +211,15 @@ files:
210
211
  - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx
211
212
  - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
212
213
  - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx
213
- - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx
214
+ - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt
214
215
  - lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/store/helloWorldStore.jsx
215
216
  - lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js
216
- - lib/generators/react_on_rails/templates/redux/base/client/package.json.tt
217
217
  - lib/generators/react_on_rails/templates/redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx
218
+ - lib/generators/react_on_rails/templates/ruby_linters/.rubocop.yml
219
+ - lib/generators/react_on_rails/templates/ruby_linters/.scss-lint.yml
220
+ - lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/brakeman.rake
221
+ - lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/ci.rake
222
+ - lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml
218
223
  - lib/react_on_rails.rb
219
224
  - lib/react_on_rails/configuration.rb
220
225
  - lib/react_on_rails/engine.rb
@@ -242,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
247
  version: '0'
243
248
  requirements: []
244
249
  rubyforge_project:
245
- rubygems_version: 2.4.5
250
+ rubygems_version: 2.4.8
246
251
  signing_key:
247
252
  specification_version: 4
248
253
  summary: Rails with react server rendering with webpack.
@@ -1,3 +0,0 @@
1
- # React Syntax
2
- ## Communication Between Components
3
- See https://facebook.github.io/react/tips/communicate-between-components.html
@@ -1,25 +0,0 @@
1
- # Linters
2
- The React on Rails generator can add linters and their recommended accompanying configurations to your project (to disable this behavior, include the `--linters` option when running the generator). Those linters that are written in Ruby have been added to your Gemfile, and those that run in Node have been add to your `package.json` under `devDependencies`.
3
-
4
- To run the linters (runs both Ruby and Node linters):
5
-
6
- ```bash
7
- rake lint
8
- ```
9
-
10
- Run this command to see all the linters available
11
-
12
- ```bash
13
- rake -T lint
14
- ```
15
-
16
- **Here's the list:**
17
- ```bash
18
- rake lint # Runs all linters
19
- rake lint:eslint # eslint
20
- rake lint:js # JS Linting
21
- rake lint:jscs # jscs
22
- rake lint:rubocop[fix] # Run Rubocop lint in shell
23
- rake lint:ruby # Run ruby-lint as shell
24
- rake lint:scss # See docs for task 'scss_lint'
25
- ```
@@ -1,38 +0,0 @@
1
- require "rails/generators"
2
-
3
- module ReactOnRails
4
- module Generators
5
- class LintersGenerator < Rails::Generators::Base
6
- hide!
7
- source_root File.expand_path("../templates", __FILE__)
8
-
9
- def add_linter_gems
10
- linter_gems = <<-GEMS
11
-
12
- # require: false is necessary for the linters as we only want them loaded
13
- # when used by the linting rake tasks.
14
- group :development do
15
- gem("rubocop", require: false)
16
- gem("ruby-lint", require: false)
17
- gem("scss_lint", require: false)
18
- end
19
- GEMS
20
- append_to_file("Gemfile", linter_gems)
21
- end
22
-
23
- def copy_linter_config_files
24
- base_path = "linters/"
25
- %w(client/.eslintrc
26
- client/.eslintignore
27
- client/.jscsrc).each { |file| copy_file(base_path + file, file) }
28
- end
29
-
30
- def copy_linting_and_audting_tasks
31
- base_path = "linters/"
32
- %w(lib/tasks/brakeman.rake
33
- lib/tasks/ci.rake
34
- lib/tasks/linters.rake).each { |file| copy_file(base_path + file, file) }
35
- end
36
- end
37
- end
38
- end
@@ -1,4 +0,0 @@
1
- import HelloWorldAppClient from './HelloWorldAppClient';
2
-
3
- // This is how react_on_rails can see the HelloWorldApp in the browser.
4
- window.HelloWorldApp = HelloWorldAppClient;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import HelloWorld from '../containers/HelloWorld';
3
-
4
- const HelloWorldAppClient = props => {
5
- const reactComponent = (
6
- <HelloWorld {...props} />
7
- );
8
- return reactComponent;
9
- };
10
-
11
- export default HelloWorldAppClient;
@@ -1,75 +0,0 @@
1
- {
2
- "name": "react-webpack-rails-tutorial",
3
- "version": "1.1.0",
4
- "description": "Built using the react_on_rails generator.",
5
- "main": "server.js",
6
- "engines": {
7
- "node": "4.2.0",
8
- "npm": "3.3.6"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/shakacode/react-webpack-rails-tutorial.git"
13
- },
14
- "keywords": [
15
- "react",
16
- "tutorial",
17
- "comment",
18
- "example"
19
- ],
20
- "author": "justin808",
21
- "license": "MIT",
22
- "bugs": {
23
- "url": "https://github.com/shakacode/react-webpack-rails-tutorial/issues"
24
- },
25
- "homepage": "https://github.com/shakacode/react-webpack-rails-tutorial",
26
- "scripts": {
27
- "test": "echo \"Error: no test specified\" && exit 1",
28
- "start": "node server.js",
29
- "build:client": "NODE_ENV=production webpack --config webpack.client.rails.config.js",
30
- "build:server": "NODE_ENV=production webpack --config webpack.server.rails.config.js",
31
- "build:dev:client": "webpack -w --config webpack.client.rails.config.js",
32
- "build:dev:server": "webpack -w --config webpack.server.rails.config.js",<%- if options.linters? %>
33
- "lint": "npm run eslint && npm run jscs",
34
- "eslint": "eslint --ext .js,.jsx .",
35
- "jscs": "jscs --verbose ."<%- end %>
36
- },
37
- "dependencies": {
38
- "babel-core": "^5.8.25",
39
- "babel-loader": "^5.3.2",
40
- "body-parser": "^1.14.1",
41
- "es5-shim": "^4.1.14",
42
- "es6-promise": "^3.0.2",
43
- "expose-loader": "^0.7.0",
44
- "imports-loader": "^0.6.4",
45
- "jquery": "^2.1.4",
46
- "jquery-ujs": "^1.1.0-1",
47
- "loader-utils": "^0.2.11",
48
- "react": "^0.14.0",
49
- "react-bootstrap": "^0.27.0",
50
- "react-dom": "^0.14.0",
51
- "sleep": "^3.0.0",
52
- "webpack": "^1.12.2"
53
- },
54
- "devDependencies": {<%- if options.linters? %>
55
- "babel-eslint": "^4.1.3",
56
- <%- end %>"babel-plugin-react-transform": "^1.1.1",
57
- "bootstrap-sass": "^3.3.5",
58
- "bootstrap-sass-loader": "^1.0.9",
59
- "css-loader": "^0.19.0",<%- if options.linters? %>
60
- "eslint": "^1.6.0",
61
- "eslint-config-airbnb": "0.1.0",
62
- "eslint-plugin-react": "^3.5.1",<%- end %>
63
- "esprima-fb": "^15001.1001.0-dev-harmony-fb",
64
- "express": "^4.13.3",
65
- "file-loader": "^0.8.4",
66
- "jade": "^1.11.0",<%- if options.linters? %>
67
- "jscs": "^2.3.0",
68
- <%- end %>"node-sass": "^3.3.3",
69
- "react-transform-hmr": "^1.0.1",
70
- "sass-loader": "^3.0.0",
71
- "style-loader": "^0.12.4",
72
- "url-loader": "^0.5.6",
73
- "webpack-dev-server": "^1.12.0"
74
- }
75
- }