webpacker 3.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintignore +1 -0
  3. data/.travis.yml +10 -0
  4. data/CHANGELOG.md +110 -0
  5. data/Gemfile.lock +69 -67
  6. data/MIT-LICENSE +1 -1
  7. data/README.md +86 -30
  8. data/docs/assets.md +4 -4
  9. data/docs/cloud9.md +310 -0
  10. data/docs/css.md +32 -3
  11. data/docs/deployment.md +42 -4
  12. data/docs/docker.md +49 -0
  13. data/docs/env.md +5 -5
  14. data/docs/folder-structure.md +2 -2
  15. data/docs/testing.md +14 -34
  16. data/docs/troubleshooting.md +40 -4
  17. data/docs/typescript.md +2 -2
  18. data/docs/webpack-dev-server.md +21 -4
  19. data/docs/webpack.md +103 -25
  20. data/gemfiles/Gemfile-rails-edge +13 -0
  21. data/gemfiles/Gemfile-rails.4.2.x +10 -0
  22. data/gemfiles/Gemfile-rails.5.0.x +10 -0
  23. data/gemfiles/Gemfile-rails.5.1.x +10 -0
  24. data/lib/install/angular.rb +5 -5
  25. data/lib/install/config/webpacker.yml +7 -0
  26. data/lib/install/elm.rb +7 -7
  27. data/lib/install/examples/vue/hello_vue.js +30 -4
  28. data/lib/install/react.rb +5 -5
  29. data/lib/install/template.rb +19 -9
  30. data/lib/install/vue.rb +4 -4
  31. data/lib/tasks/installers.rake +2 -2
  32. data/lib/tasks/webpacker.rake +7 -6
  33. data/lib/tasks/webpacker/check_binstubs.rake +3 -3
  34. data/lib/tasks/webpacker/compile.rake +15 -8
  35. data/lib/tasks/webpacker/install.rake +4 -4
  36. data/lib/tasks/webpacker/verify_install.rake +1 -1
  37. data/lib/webpacker/compiler.rb +6 -6
  38. data/lib/webpacker/dev_server.rb +2 -2
  39. data/lib/webpacker/dev_server_proxy.rb +2 -1
  40. data/lib/webpacker/dev_server_runner.rb +4 -4
  41. data/lib/webpacker/helper.rb +3 -3
  42. data/lib/webpacker/manifest.rb +2 -2
  43. data/lib/webpacker/railtie.rb +41 -2
  44. data/lib/webpacker/runner.rb +1 -1
  45. data/lib/webpacker/version.rb +1 -1
  46. data/package.json +29 -21
  47. data/package/asset_host.js +4 -5
  48. data/package/config.js +7 -1
  49. data/package/config_types/__tests__/config_list.js +123 -0
  50. data/package/config_types/__tests__/config_object.js +43 -0
  51. data/package/config_types/config_list.js +83 -0
  52. data/package/config_types/config_object.js +55 -0
  53. data/package/config_types/index.js +7 -0
  54. data/package/environment.js +64 -40
  55. data/package/environments/development.js +31 -34
  56. data/package/environments/production.js +14 -11
  57. data/package/index.js +7 -2
  58. data/package/{loaders → rules}/babel.js +6 -4
  59. data/package/{loaders → rules}/coffee.js +3 -1
  60. data/package/rules/css.js +39 -0
  61. data/package/rules/elm.js +23 -0
  62. data/package/rules/erb.js +11 -0
  63. data/package/{loaders → rules}/file.js +1 -1
  64. data/package/rules/index.js +23 -0
  65. data/package/rules/sass.js +15 -0
  66. data/package/{loaders → rules}/typescript.js +3 -1
  67. data/package/rules/url.js +13 -0
  68. data/package/rules/vue.js +13 -0
  69. data/package/utils/__tests__/deep_assign.js +11 -0
  70. data/package/utils/__tests__/deep_merge.js +10 -0
  71. data/package/utils/__tests__/objectify.js +9 -0
  72. data/package/utils/deep_assign.js +22 -0
  73. data/package/utils/deep_merge.js +23 -0
  74. data/package/utils/helpers.js +32 -0
  75. data/package/utils/objectify.js +4 -0
  76. data/test/command_test.rb +1 -1
  77. data/test/compiler_test.rb +5 -1
  78. data/test/configuration_test.rb +1 -1
  79. data/test/dev_server_test.rb +1 -1
  80. data/test/helper_test.rb +15 -10
  81. data/test/manifest_test.rb +1 -1
  82. data/test/rake_tasks_test.rb +29 -0
  83. data/test/test_app/Rakefile +3 -0
  84. data/test/test_app/config/application.rb +11 -0
  85. data/test/test_app/config/environment.rb +4 -0
  86. data/test/{webpacker_test_helper.rb → test_helper.rb} +3 -14
  87. data/webpacker.gemspec +1 -1
  88. data/yarn.lock +1552 -829
  89. metadata +43 -16
  90. data/package/loaders/elm.js +0 -19
  91. data/package/loaders/erb.js +0 -9
  92. data/package/loaders/style.js +0 -31
  93. data/package/loaders/vue.js +0 -12
  94. data/test/test_app/config/secrets.yml +0 -5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-10-04 00:00:00.000000000 Z
12
+ date: 2017-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -89,8 +89,10 @@ files:
89
89
  - README.md
90
90
  - Rakefile
91
91
  - docs/assets.md
92
+ - docs/cloud9.md
92
93
  - docs/css.md
93
94
  - docs/deployment.md
95
+ - docs/docker.md
94
96
  - docs/env.md
95
97
  - docs/es6.md
96
98
  - docs/folder-structure.md
@@ -104,6 +106,10 @@ files:
104
106
  - docs/yarn.md
105
107
  - exe/webpack
106
108
  - exe/webpack-dev-server
109
+ - gemfiles/Gemfile-rails-edge
110
+ - gemfiles/Gemfile-rails.4.2.x
111
+ - gemfiles/Gemfile-rails.5.0.x
112
+ - gemfiles/Gemfile-rails.5.1.x
107
113
  - lib/install/angular.rb
108
114
  - lib/install/config/.babelrc
109
115
  - lib/install/config/.postcssrc.yml
@@ -156,28 +162,46 @@ files:
156
162
  - package.json
157
163
  - package/asset_host.js
158
164
  - package/config.js
165
+ - package/config_types/__tests__/config_list.js
166
+ - package/config_types/__tests__/config_object.js
167
+ - package/config_types/config_list.js
168
+ - package/config_types/config_object.js
169
+ - package/config_types/index.js
159
170
  - package/environment.js
160
171
  - package/environments/development.js
161
172
  - package/environments/production.js
162
173
  - package/environments/test.js
163
174
  - package/index.js
164
- - package/loaders/babel.js
165
- - package/loaders/coffee.js
166
- - package/loaders/elm.js
167
- - package/loaders/erb.js
168
- - package/loaders/file.js
169
- - package/loaders/style.js
170
- - package/loaders/typescript.js
171
- - package/loaders/vue.js
175
+ - package/rules/babel.js
176
+ - package/rules/coffee.js
177
+ - package/rules/css.js
178
+ - package/rules/elm.js
179
+ - package/rules/erb.js
180
+ - package/rules/file.js
181
+ - package/rules/index.js
182
+ - package/rules/sass.js
183
+ - package/rules/typescript.js
184
+ - package/rules/url.js
185
+ - package/rules/vue.js
186
+ - package/utils/__tests__/deep_assign.js
187
+ - package/utils/__tests__/deep_merge.js
188
+ - package/utils/__tests__/objectify.js
189
+ - package/utils/deep_assign.js
190
+ - package/utils/deep_merge.js
191
+ - package/utils/helpers.js
192
+ - package/utils/objectify.js
172
193
  - test/command_test.rb
173
194
  - test/compiler_test.rb
174
195
  - test/configuration_test.rb
175
196
  - test/dev_server_test.rb
176
197
  - test/helper_test.rb
177
198
  - test/manifest_test.rb
178
- - test/test_app/config/secrets.yml
199
+ - test/rake_tasks_test.rb
200
+ - test/test_app/Rakefile
201
+ - test/test_app/config/application.rb
202
+ - test/test_app/config/environment.rb
179
203
  - test/test_app/public/packs/manifest.json
180
- - test/webpacker_test_helper.rb
204
+ - test/test_helper.rb
181
205
  - webpacker.gemspec
182
206
  - yarn.lock
183
207
  homepage: https://github.com/rails/webpacker
@@ -200,10 +224,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
224
  version: '0'
201
225
  requirements: []
202
226
  rubyforge_project:
203
- rubygems_version: 2.5.1
227
+ rubygems_version: 2.6.11
204
228
  signing_key:
205
229
  specification_version: 4
206
- summary: Use Webpack to manage app-like JavaScript modules in Rails
230
+ summary: Use webpack to manage app-like JavaScript modules in Rails
207
231
  test_files:
208
232
  - test/command_test.rb
209
233
  - test/compiler_test.rb
@@ -211,6 +235,9 @@ test_files:
211
235
  - test/dev_server_test.rb
212
236
  - test/helper_test.rb
213
237
  - test/manifest_test.rb
214
- - test/test_app/config/secrets.yml
238
+ - test/rake_tasks_test.rb
239
+ - test/test_app/Rakefile
240
+ - test/test_app/config/application.rb
241
+ - test/test_app/config/environment.rb
215
242
  - test/test_app/public/packs/manifest.json
216
- - test/webpacker_test_helper.rb
243
+ - test/test_helper.rb
@@ -1,19 +0,0 @@
1
- const { resolve } = require('path')
2
-
3
- const elmSource = resolve(process.cwd())
4
- const elmMake = `${elmSource}/node_modules/.bin/elm-make`
5
- const elmDefaultOptions = `cwd=${elmSource}&pathToMake=${elmMake}`
6
-
7
- const loaderOptions = () => {
8
- if (process.env.NODE_ENV === 'production') {
9
- return `elm-webpack-loader?${elmDefaultOptions}`
10
- }
11
-
12
- return `elm-hot-loader!elm-webpack-loader?${elmDefaultOptions}&verbose=true&warn=true&debug=true`
13
- }
14
-
15
- module.exports = {
16
- test: /\.elm(\.erb)?$/,
17
- exclude: [/elm-stuff/, /node_modules/],
18
- loader: loaderOptions()
19
- }
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- test: /\.erb$/,
3
- enforce: 'pre',
4
- exclude: /node_modules/,
5
- loader: 'rails-erb-loader',
6
- options: {
7
- runner: 'bin/rails runner'
8
- }
9
- }
@@ -1,31 +0,0 @@
1
- const ExtractTextPlugin = require('extract-text-webpack-plugin')
2
- const path = require('path')
3
- const { dev_server: devServer } = require('../config')
4
-
5
- const postcssConfigPath = path.resolve(process.cwd(), '.postcssrc.yml')
6
- const isProduction = process.env.NODE_ENV === 'production'
7
- const extractCSS = !(devServer && devServer.hmr)
8
-
9
- const extractOptions = {
10
- fallback: 'style-loader',
11
- use: [
12
- { loader: 'css-loader', options: { minimize: isProduction } },
13
- { loader: 'postcss-loader', options: { sourceMap: true, config: { path: postcssConfigPath } } },
14
- 'resolve-url-loader',
15
- { loader: 'sass-loader', options: { sourceMap: true } }
16
- ]
17
- }
18
-
19
- // For production extract styles to a separate bundle
20
- const extractCSSLoader = {
21
- test: /\.(scss|sass|css)$/i,
22
- use: ExtractTextPlugin.extract(extractOptions)
23
- }
24
-
25
- // For hot-reloading use regular loaders
26
- const inlineCSSLoader = {
27
- test: /\.(scss|sass|css)$/i,
28
- use: ['style-loader'].concat(extractOptions.use)
29
- }
30
-
31
- module.exports = isProduction || extractCSS ? extractCSSLoader : inlineCSSLoader
@@ -1,12 +0,0 @@
1
- const { dev_server: devServer } = require('../config')
2
-
3
- const isProduction = process.env.NODE_ENV === 'production'
4
- const extractCSS = !(devServer && devServer.hmr)
5
-
6
- module.exports = {
7
- test: /\.vue(\.erb)?$/,
8
- loader: 'vue-loader',
9
- options: {
10
- extractCSS: isProduction || extractCSS
11
- }
12
- }
@@ -1,5 +0,0 @@
1
- development:
2
- secret_key_base: 'abcdef'
3
-
4
- test:
5
- secret_key_base: 'abcdef'