react_on_rails 1.2.2 → 2.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. metadata +5 -126
  3. data/.babelrc +0 -3
  4. data/.coveralls.yml +0 -1
  5. data/.dockerignore +0 -2
  6. data/.eslintignore +0 -5
  7. data/.eslintrc +0 -48
  8. data/.gitignore +0 -26
  9. data/.jscsrc +0 -26
  10. data/.rspec +0 -2
  11. data/.rubocop.yml +0 -70
  12. data/.scss-lint.yml +0 -205
  13. data/.travis.yml +0 -41
  14. data/CHANGELOG.md +0 -42
  15. data/Dockerfile_tests +0 -12
  16. data/Gemfile +0 -38
  17. data/README.md +0 -363
  18. data/Rakefile +0 -5
  19. data/app/assets/javascripts/react_on_rails.js +0 -241
  20. data/app/helpers/react_on_rails_helper.rb +0 -224
  21. data/docker-compose.yml +0 -11
  22. data/docs/LICENSE +0 -21
  23. data/docs/additional_reading/heroku_deployment.md +0 -23
  24. data/docs/additional_reading/manual_installation.md +0 -142
  25. data/docs/additional_reading/node_dependencies_and_npm.md +0 -29
  26. data/docs/additional_reading/optional_configuration.md +0 -34
  27. data/docs/additional_reading/react-and-redux.md +0 -36
  28. data/docs/additional_reading/react_router.md +0 -45
  29. data/docs/additional_reading/server_rendering_tips.md +0 -16
  30. data/docs/additional_reading/tips.md +0 -10
  31. data/docs/additional_reading/webpack.md +0 -46
  32. data/docs/code_of_conduct.md +0 -13
  33. data/docs/coding-style/linters.md +0 -64
  34. data/docs/coding-style/style.md +0 -42
  35. data/docs/contributing.md +0 -62
  36. data/docs/generator_testing.md +0 -20
  37. data/docs/install_and_releasing.md +0 -24
  38. data/docs/sample_generated_js/README.md +0 -4
  39. data/docs/sample_generated_js/client-generated.js +0 -12
  40. data/docs/sample_generated_js/server-generated.js +0 -25
  41. data/lib/generators/USAGE +0 -99
  42. data/lib/generators/react_on_rails/base_generator.rb +0 -198
  43. data/lib/generators/react_on_rails/bootstrap_generator.rb +0 -91
  44. data/lib/generators/react_on_rails/dev_tests_generator.rb +0 -30
  45. data/lib/generators/react_on_rails/generator_errors.rb +0 -15
  46. data/lib/generators/react_on_rails/generator_helper.rb +0 -58
  47. data/lib/generators/react_on_rails/heroku_deployment_generator.rb +0 -30
  48. data/lib/generators/react_on_rails/install_generator.rb +0 -111
  49. data/lib/generators/react_on_rails/js_linters_generator.rb +0 -19
  50. data/lib/generators/react_on_rails/react_no_redux_generator.rb +0 -41
  51. data/lib/generators/react_on_rails/react_with_redux_generator.rb +0 -52
  52. data/lib/generators/react_on_rails/ruby_linters_generator.rb +0 -33
  53. data/lib/generators/react_on_rails/templates/base/base/Procfile.dev.tt +0 -4
  54. data/lib/generators/react_on_rails/templates/base/base/REACT_ON_RAILS.md +0 -16
  55. data/lib/generators/react_on_rails/templates/base/base/app/controllers/hello_world_controller.rb +0 -5
  56. data/lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt +0 -5
  57. data/lib/generators/react_on_rails/templates/base/base/client/.babelrc +0 -3
  58. data/lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md +0 -3
  59. data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/startup/globals.jsx.tt +0 -5
  60. data/lib/generators/react_on_rails/templates/base/base/client/index.jade +0 -15
  61. data/lib/generators/react_on_rails/templates/base/base/client/npm-shrinkwrap.json +0 -2907
  62. data/lib/generators/react_on_rails/templates/base/base/client/package.json.tt +0 -98
  63. data/lib/generators/react_on_rails/templates/base/base/client/server.js +0 -64
  64. data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.base.config.js.tt +0 -67
  65. data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.hot.config.js.tt +0 -67
  66. data/lib/generators/react_on_rails/templates/base/base/client/webpack.client.rails.config.js +0 -41
  67. data/lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb +0 -28
  68. data/lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt +0 -26
  69. data/lib/generators/react_on_rails/templates/base/base/lib/tasks/linters.rake.tt +0 -88
  70. data/lib/generators/react_on_rails/templates/base/base/package.json +0 -31
  71. data/lib/generators/react_on_rails/templates/base/server_rendering/client/app/bundles/HelloWorld/startup/serverGlobals.jsx +0 -3
  72. data/lib/generators/react_on_rails/templates/base/server_rendering/client/webpack.server.rails.config.js +0 -40
  73. data/lib/generators/react_on_rails/templates/bootstrap/app/assets/stylesheets/_bootstrap-custom.scss +0 -63
  74. data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_post-bootstrap.scss +0 -10
  75. data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_pre-bootstrap.scss +0 -8
  76. data/lib/generators/react_on_rails/templates/bootstrap/client/assets/stylesheets/_react-on-rails-sass-helper.scss +0 -19
  77. data/lib/generators/react_on_rails/templates/bootstrap/client/bootstrap-sass.config.js +0 -89
  78. data/lib/generators/react_on_rails/templates/dev_tests/.rspec +0 -2
  79. data/lib/generators/react_on_rails/templates/dev_tests/spec/features/hello_world_spec.rb +0 -25
  80. data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +0 -57
  81. data/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb +0 -21
  82. data/lib/generators/react_on_rails/templates/dev_tests/spec/spec_helper.rb +0 -95
  83. data/lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks +0 -2
  84. data/lib/generators/react_on_rails/templates/heroku_deployment/Procfile +0 -1
  85. data/lib/generators/react_on_rails/templates/heroku_deployment/config/puma.rb +0 -15
  86. data/lib/generators/react_on_rails/templates/js_linters/client/.eslintignore +0 -1
  87. data/lib/generators/react_on_rails/templates/js_linters/client/.eslintrc +0 -48
  88. data/lib/generators/react_on_rails/templates/js_linters/client/.jscsrc +0 -18
  89. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -39
  90. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -33
  91. data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +0 -12
  92. data/lib/generators/react_on_rails/templates/no_redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx +0 -11
  93. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx +0 -8
  94. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx +0 -48
  95. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/constants/helloWorldConstants.jsx +0 -8
  96. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -43
  97. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx +0 -21
  98. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx +0 -14
  99. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldAppClient.jsx.tt +0 -21
  100. data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/store/helloWorldStore.jsx +0 -35
  101. data/lib/generators/react_on_rails/templates/redux/base/client/app/lib/middlewares/loggerMiddleware.js +0 -20
  102. data/lib/generators/react_on_rails/templates/redux/server_rendering/client/app/bundles/HelloWorld/startup/HelloWorldAppServer.jsx +0 -21
  103. data/lib/generators/react_on_rails/templates/ruby_linters/.rubocop.yml +0 -26
  104. data/lib/generators/react_on_rails/templates/ruby_linters/.scss-lint.yml +0 -205
  105. data/lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/brakeman.rake +0 -17
  106. data/lib/generators/react_on_rails/templates/ruby_linters/lib/tasks/ci.rake +0 -33
  107. data/lib/generators/react_on_rails/templates/ruby_linters/ruby-lint.yml +0 -20
  108. data/lib/react_on_rails.rb +0 -6
  109. data/lib/react_on_rails/configuration.rb +0 -53
  110. data/lib/react_on_rails/engine.rb +0 -7
  111. data/lib/react_on_rails/prerender_error.rb +0 -31
  112. data/lib/react_on_rails/server_rendering_pool.rb +0 -111
  113. data/lib/react_on_rails/version.rb +0 -3
  114. data/rakelib/docker.rake +0 -33
  115. data/rakelib/dummy_apps.rake +0 -29
  116. data/rakelib/example_type.rb +0 -160
  117. data/rakelib/examples.rake +0 -103
  118. data/rakelib/examples_config.yml +0 -19
  119. data/rakelib/lint.rake +0 -37
  120. data/rakelib/run_rspec.rake +0 -65
  121. data/rakelib/task_helpers.rb +0 -44
  122. data/react_on_rails.gemspec +0 -31
  123. data/ruby-lint.yml +0 -24
@@ -1,98 +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": "5.0.0",
8
- "npm": "3.5.0"
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"<% unless options.skip_js_linters? -%>,
33
- "lint": "npm run eslint && npm run jscs",
34
- "eslint": "eslint --ext .js,.jsx .",
35
- "jscs": "jscs --verbose ."
36
- <%- end -%>
37
- },
38
- "dependencies": {
39
- "babel-core": "^5.8.25",
40
- "babel-loader": "^5.3.2",
41
- "body-parser": "^1.14.1",
42
- "es5-shim": "^4.3.1",
43
- "es6-promise": "^3.0.2",
44
- "expose-loader": "^0.7.1",
45
- <%- if options.redux? -%>
46
- "immutable": "^3.7.5",
47
- <%- end -%>
48
- "imports-loader": "^0.6.5",
49
- "jquery": "^2.1.4",
50
- "jquery-ujs": "^1.1.0-1",
51
- "loader-utils": "^0.2.11",
52
- <%- if options.redux? -%>
53
- "mirror-creator": "0.0.1",
54
- <%- end -%>
55
- "lodash": "^3.10.1",
56
- "react": "^0.14.0",
57
- <%- unless options.skip_bootstrap? -%>
58
- "react-bootstrap": "^0.28.1",
59
- <%- end -%>
60
- "react-dom": "^0.14.3",
61
- <%- if options.redux? -%>
62
- "react-redux": "^4.0.0",
63
- "redux": "^3.0.4",
64
- "redux-promise": "^0.5.0",
65
- "redux-thunk": "^1.0.0",
66
- <%- end -%>
67
- "webpack": "^1.12.8"
68
- },
69
- "devDependencies": {
70
- <%- unless options.skip_js_linters? -%>
71
- "babel-eslint": "^4.1.5",
72
- <%- end -%>
73
- "babel-plugin-react-transform": "^1.1.1",
74
- <%- unless options.skip_bootstrap? -%>
75
- "bootstrap-sass": "^3.3.5",
76
- "bootstrap-sass-loader": "^1.0.9",
77
- <%- end -%>
78
- "css-loader": "^0.23.0",
79
- <%- unless options.skip_js_linters? -%>
80
- "eslint": "^1.10.1",
81
- "eslint-config-airbnb": "1.0.0",
82
- "eslint-plugin-react": "^3.10.0",
83
- <%- end -%>
84
- "esprima-fb": "^15001.1001.0-dev-harmony-fb",
85
- "express": "^4.13.3",
86
- "file-loader": "^0.8.4",
87
- "jade": "^1.11.0",
88
- <%- unless options.skip_js_linters? -%>
89
- "jscs": "^2.6.0",
90
- <%- end -%>
91
- "node-sass": "^3.4.2",
92
- "react-transform-hmr": "^1.0.1",
93
- "sass-loader": "^3.1.1",
94
- "style-loader": "^0.13.0",
95
- "url-loader": "^0.5.6",
96
- "webpack-dev-server": "^1.12.1"
97
- }
98
- }
@@ -1,64 +0,0 @@
1
- // This file is used by the webpack HMR dev server to load your component without using Rails
2
- // It should simply match routes to basic HTML or jade files that render your component
3
- /* eslint-disable no-console, func-names, no-var */
4
- var webpack = require('webpack');
5
- var WebpackDevServer = require('webpack-dev-server');
6
- var jade = require('jade');
7
- var config = require('./webpack.client.hot.config');
8
-
9
- var server = new WebpackDevServer(webpack(config), {
10
- publicPath: config.output.publicPath,
11
- hot: true,
12
- historyApiFallback: true,
13
- stats: {
14
- colors: true,
15
- hash: false,
16
- version: false,
17
- chunks: false,
18
- children: false,
19
- },
20
- });
21
-
22
- // The following code is commented out because the HelloWorld example
23
- // does not use any asynchronous functionality. It is meant to serve
24
- // as an example of how one might implement an API in express for their
25
- // webpack dev server
26
- // Note, it would be necessary to run `npm i --save body-parser sleep` for
27
- // the following to work:
28
- // var bodyParser = require('body-parser');
29
- // var sleep = require('sleep');
30
- // See tutorial for example of using AJAX:
31
- // https://github.com/shakacode/react-webpack-rails-tutorial
32
-
33
- // server.app.use(bodyParser.json(null));
34
- // server.app.use(bodyParser.urlencoded({extended: true}));
35
- // server.app.get('/hello_world.json', function(req, res) {
36
- // res.setHeader('Content-Type', 'application/json');
37
- // res.send(JSON.stringify(name));
38
- // });
39
-
40
- // server.app.post('/hello_world.json', function(req, res) {
41
- // console.log('Processing name: %j', req.body.name);
42
- // console.log('(shhhh...napping 1 seconds)');
43
- // sleep.sleep(1);
44
- // console.log('Just got done with nap!');
45
- // name = req.body.name;
46
- // res.setHeader('Content-Type', 'application/json');
47
- // res.send(JSON.stringify(req.body.name));
48
- // });
49
-
50
- var initialName = 'Stranger';
51
-
52
- server.app.use('/', function(req, res) {
53
- var locals = {
54
- props: JSON.stringify(initialName),
55
- };
56
- var layout = process.cwd() + '/index.jade';
57
- var html = jade.compileFile(layout, { pretty: true })(locals);
58
- res.send(html);
59
- });
60
-
61
- server.listen(4000, 'localhost', function(err) {
62
- if (err) console.log(err);
63
- console.log('Listening at localhost:4000...');
64
- });
@@ -1,67 +0,0 @@
1
- <%- client_globals_name = options.server_rendering? ? "clientGlobals" : "globals" -%>
2
- // Common client-side webpack configuration used by webpack.hot.config and webpack.rails.config.
3
-
4
- const webpack = require('webpack');
5
- const path = require('path');
6
-
7
- const devBuild = process.env.NODE_ENV !== 'production';
8
- const nodeEnv = devBuild ? 'development' : 'production';
9
-
10
- module.exports = {
11
-
12
- // the project dir
13
- context: __dirname,
14
- entry: {
15
-
16
- // See use of 'vendor' in the CommonsChunkPlugin inclusion below.
17
- vendor: [
18
- 'babel-core/polyfill',
19
- 'jquery',
20
- 'react',
21
- 'react-dom',
22
- ],
23
-
24
- // This will contain the app entry points defined by webpack.hot.config and webpack.rails.config
25
- app: [
26
- './app/bundles/HelloWorld/startup/<%= client_globals_name %>',
27
- ],
28
- },
29
- resolve: {
30
- extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'],
31
- alias: {
32
- lib: path.join(process.cwd(), 'app', 'lib'),
33
- },
34
- },
35
- plugins: [
36
-
37
- new webpack.DefinePlugin({
38
- 'process.env': {
39
- NODE_ENV: JSON.stringify(nodeEnv),
40
- },
41
- }),
42
-
43
- // https://webpack.github.io/docs/list-of-plugins.html#2-explicit-vendor-chunk
44
- new webpack.optimize.CommonsChunkPlugin({
45
-
46
- // This name 'vendor' ties into the entry definition
47
- name: 'vendor',
48
-
49
- // We don't want the default vendor.js name
50
- filename: 'vendor-bundle.js',
51
-
52
- // Passing Infinity just creates the commons chunk, but moves no modules into it.
53
- // In other words, we only put what's in the vendor entry definition in vendor-bundle.js
54
- minChunks: Infinity,
55
- }),
56
- ],
57
- module: {
58
- loaders: [
59
-
60
- // React is necessary for the client rendering:
61
- {test: require.resolve('react'), loader: 'expose?React'},
62
- {test: require.resolve('react-dom'), loader: 'expose?ReactDOM'},
63
- {test: require.resolve('jquery'), loader: 'expose?jQuery'},
64
- {test: require.resolve('jquery'), loader: 'expose?$'},
65
- ],
66
- },
67
- };
@@ -1,67 +0,0 @@
1
- // This config file setups up the Webpack Dev Server: https://webpack.github.io/docs/webpack-dev-server.html
2
- // Run like this:
3
- // cd client && node server.js
4
-
5
- const webpack = require('webpack');
6
- const path = require('path');
7
- const config = require('./webpack.client.base.config');
8
-
9
- config.entry.app.push(
10
-
11
- // Webpack dev server
12
- 'webpack-dev-server/client?http://localhost:4000',
13
- 'webpack/hot/dev-server'<%- unless options.skip_bootstrap? -%>,
14
-
15
- // See: https://github.com/shakacode/bootstrap-sass-loader
16
- // We're using the bootstrap-sass loader.
17
- 'bootstrap-sass!./bootstrap-sass.config.js'
18
- <%- end -%>
19
-
20
- );
21
-
22
- config.output = {
23
-
24
- // this file is served directly by webpack
25
- filename: '[name]-bundle.js',
26
- path: __dirname,
27
- };
28
- config.plugins.unshift(new webpack.HotModuleReplacementPlugin());
29
- config.devtool = 'eval-source-map';
30
-
31
- // All the styling loaders only apply to hot-reload, not rails
32
- config.module.loaders.push(
33
- {
34
- test: /\.jsx?$/,
35
- loader: 'babel',
36
- exclude: /node_modules/,
37
- query: {
38
- plugins: ['react-transform'],
39
- extra: {
40
- 'react-transform': {
41
- transforms: [
42
- {
43
- transform: 'react-transform-hmr',
44
- imports: ['react'],
45
- locals: ['module'],
46
- },
47
- ],
48
- },
49
- },
50
- },
51
- },
52
- {test: /\.css$/, loader: 'style-loader!css-loader'},
53
- {
54
- test: /\.scss$/,
55
- loader: 'style!css!sass?outputStyle=expanded&imagePath=/assets/images&includePaths[]=' +
56
- path.resolve(__dirname, './assets/stylesheets'),
57
- },
58
-
59
- // The url-loader uses DataUrls. The file-loader emits files.
60
- {test: /\.woff$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff'},
61
- {test: /\.woff2$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff'},
62
- {test: /\.ttf$/, loader: 'file-loader'},
63
- {test: /\.eot$/, loader: 'file-loader'},
64
- {test: /\.svg$/, loader: 'file-loader'}
65
- );
66
-
67
- module.exports = config;
@@ -1,41 +0,0 @@
1
- // Run like this:
2
- // cd client && npm run build:dev
3
- // Note that Foreman (Procfile.dev) has also been configured to take care of this.
4
-
5
- // NOTE: All style sheets handled by the asset pipeline in rails
6
-
7
- const webpack = require('webpack');
8
- const config = require('./webpack.client.base.config');
9
- const devBuild = process.env.NODE_ENV !== 'production';
10
-
11
- config.output = {
12
- filename: '[name]-bundle.js',
13
- path: '../app/assets/javascripts/generated',
14
- };
15
-
16
- // You can add entry points specific to rails here
17
- config.entry.vendor.unshift(
18
- 'es5-shim/es5-shim',
19
- 'es5-shim/es5-sham'
20
- );
21
-
22
- // jquery-ujs MUST GO AFTER jquery, so must use 'push'
23
- config.entry.app.push('jquery-ujs');
24
-
25
- // See webpack.common.config for adding modules common to both the webpack dev server and rails
26
- config.module.loaders.push(
27
- {test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/},
28
- {test: require.resolve('react'), loader: 'imports?shim=es5-shim/es5-shim&sham=es5-shim/es5-sham'}
29
- );
30
-
31
- module.exports = config;
32
-
33
- if (devBuild) {
34
- console.log('Webpack dev build for Rails'); // eslint-disable-line no-console
35
- module.exports.devtool = 'eval-source-map';
36
- } else {
37
- config.plugins.push(
38
- new webpack.optimize.DedupePlugin()
39
- );
40
- console.log('Webpack production build for Rails'); // eslint-disable-line no-console
41
- }
@@ -1,28 +0,0 @@
1
- # Shown below are the defaults for configuration
2
- ReactOnRails.configure do |config|
3
- # Client bundles are configured in application.js
4
-
5
- # Server rendering:
6
- # Server bundle is a single file for all server rendering of components.
7
- config.server_bundle_js_file = "app/assets/javascripts/generated/server-bundle.js"
8
- # increase if you're on JRuby
9
- config.server_renderer_pool_size = 1
10
- # seconds
11
- config.server_renderer_timeout = 20
12
- # If set to true, this forces Rails to reload the server bundle if it is modified
13
- config.development_mode = Rails.env.development?
14
- # For server rendering. This can be set to false so that server side messages are discarded.
15
- # Default is true. Be cautious about turning this off.
16
- config.replay_console = true
17
- # Default is true. Logs server rendering messags to Rails.logger.info
18
- config.logging_on_server = true
19
-
20
- # The following options can be overriden by passing to the helper method:
21
-
22
- # Default is false
23
- config.prerender = false
24
- # Default is false, meaning that you expose ReactComponents directly
25
- config.generator_function = false
26
- # Default is true for development, off otherwise
27
- config.trace = Rails.env.development?
28
- end
@@ -1,26 +0,0 @@
1
- # lib/tasks/assets.rake
2
- # The webpack task must run before assets:environment task.
3
- # Otherwise Sprockets cannot find the files that webpack produces.
4
- # This is the secret sauce for how a Heroku deployment knows to create the webpack generated JavaScript files.
5
- Rake::Task["assets:precompile"]
6
- .clear_prerequisites
7
- .enhance(["assets:compile_environment"])
8
-
9
- namespace :assets do
10
- # In this task, set prerequisites for the assets:precompile task
11
- task compile_environment: :webpack do
12
- Rake::Task["assets:environment"].invoke
13
- end
14
-
15
- desc "Compile assets with webpack"
16
- task :webpack do
17
- sh "cd client && npm run build:client"
18
- <%- if options[:server_rendering] -%>
19
- sh "cd client && npm run build:server"
20
- <%- end -%>
21
- end
22
-
23
- task :clobber do
24
- rm_r Dir.glob(Rails.root.join("app/assets/javascripts/generated/*"))
25
- end
26
- end
@@ -1,88 +0,0 @@
1
- if %w(development test).include? Rails.env
2
- namespace :lint do
3
- <%- if options.ruby_linters? -%>
4
- # This fails: https://github.com/bbatsov/rubocop/issues/1840
5
- # RuboCop::RakeTask.new
6
- # require "rubocop/rake_task"
7
- desc "Run Rubocop lint in shell. Specify option fix to auto-correct (and don't have uncommitted files!)."
8
- task :rubocop, [:fix] => [] do |_t, args|
9
- def to_bool(str)
10
- return true if str =~ (/^(true|t|yes|y|1)$/i)
11
- return false if str.blank? || str =~ (/^(false|f|no|n|0)$/i)
12
- fail ArgumentError, "invalid value for Boolean: \"#{str}\""
13
- end
14
-
15
- fix = (args.fix == "fix") || to_bool(args.fix)
16
- cmd = "rubocop -S -D#{fix ? ' -a' : ''} ."
17
- puts "Running Rubocop Linters via `#{cmd}`#{fix ? ' auto-correct is turned on!' : ''}"
18
- sh cmd
19
- end
20
-
21
- desc "Run ruby-lint as shell"
22
- task :ruby do
23
- cmd = "ruby-lint app config spec lib"
24
- puts "Running ruby-lint Linters via `#{cmd}`"
25
- sh cmd
26
- end
27
-
28
- desc "See docs for task 'scss_lint'"
29
- task :scss do
30
- begin
31
- require 'scss_lint/rake_task'
32
- SCSSLint::RakeTask.new do |t|
33
- t.files = ["app/assets/stylesheets/", "client/assets/stylesheets/"]
34
- end
35
- Rake::Task[:scss_lint].invoke
36
- rescue LoadError
37
- puts "** add gem 'scss_lint' to your Gemfile for scss linting."
38
- end
39
- end
40
-
41
- # desc "haml_lint"
42
- # task :haml_lint do
43
- # require 'haml_lint/rake_task'
44
-
45
- # HamlLint::RakeTask.new do |t|
46
- # t.files = ["app/views"]
47
- # end
48
- # end
49
-
50
- # desc "See docs for task 'slim_lint'"
51
- # task slim: :slim_lint
52
- # SlimLint::RakeTask.new do |t|
53
- # t.files = ["app/views"]
54
- # end
55
-
56
- <%- end -%>
57
- <%- unless options.skip_js_linters? -%>
58
- desc "eslint"
59
- task :eslint do
60
- cmd = "cd client && npm run eslint . -- --ext .jsx,.js"
61
- puts "Running eslint via `#{cmd}`"
62
- sh cmd
63
- end
64
-
65
- desc "jscs"
66
- task :jscs do
67
- cmd = "cd client && npm run jscs ."
68
- puts "Running jscs via `#{cmd}`"
69
- sh cmd
70
- end
71
-
72
- desc "JS Linting"
73
- task js: [:eslint, :jscs] do
74
- puts "Completed running all JavaScript Linters"
75
- end
76
- <%- end -%>
77
-
78
- <%- enabled_linters = [] -%>
79
- <%- enabled_linters << %i(rubocop ruby scss) if options.ruby_linters? -%>
80
- <%- enabled_linters << %i(js) unless options.skip_js_linters? -%>
81
- task lint: <%= enabled_linters.flatten %> do
82
- puts "Completed all linting"
83
- end
84
- end
85
-
86
- desc "Runs all linters. Run `rake -D lint` to see all available lint options"
87
- task lint: ["lint:lint"]
88
- end