webpacker 6.0.0.beta.6 → 6.0.0.rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/jest.yml +7 -15
  3. data/.github/workflows/js-lint.yml +7 -15
  4. data/.github/workflows/rubocop.yml +1 -1
  5. data/.github/workflows/ruby.yml +15 -40
  6. data/.node-version +1 -1
  7. data/.rubocop.yml +107 -1
  8. data/CHANGELOG.md +36 -13
  9. data/CONTRIBUTING.md +19 -0
  10. data/Gemfile.lock +105 -104
  11. data/README.md +183 -170
  12. data/config/webpacker.yml +1 -1
  13. data/docs/deployment.md +128 -0
  14. data/docs/developing_webpacker.md +29 -0
  15. data/docs/troubleshooting.md +57 -23
  16. data/docs/v6_upgrade.md +113 -0
  17. data/gemfiles/Gemfile-rails-edge +1 -1
  18. data/gemfiles/Gemfile-rails.6.1.x +12 -0
  19. data/lib/install/{packs/entrypoints/application.js → application.js} +3 -8
  20. data/lib/install/bin/webpack +4 -7
  21. data/lib/install/bin/yarn +18 -0
  22. data/lib/install/config/webpacker.yml +19 -20
  23. data/lib/install/package.json +15 -0
  24. data/lib/install/template.rb +48 -19
  25. data/lib/tasks/webpacker/binstubs.rake +2 -2
  26. data/lib/tasks/webpacker/check_node.rake +3 -0
  27. data/lib/tasks/webpacker/check_yarn.rake +4 -1
  28. data/lib/tasks/webpacker/clobber.rake +1 -1
  29. data/lib/tasks/webpacker/install.rake +2 -2
  30. data/lib/tasks/webpacker/verify_config.rake +14 -0
  31. data/lib/tasks/webpacker/verify_install.rake +1 -11
  32. data/lib/tasks/yarn.rake +38 -0
  33. data/lib/webpacker/commands.rb +19 -15
  34. data/lib/webpacker/configuration.rb +19 -8
  35. data/lib/webpacker/dev_server.rb +6 -0
  36. data/lib/webpacker/dev_server_runner.rb +6 -3
  37. data/lib/webpacker/env.rb +5 -1
  38. data/lib/webpacker/helper.rb +14 -8
  39. data/lib/webpacker/instance.rb +4 -0
  40. data/lib/webpacker/manifest.rb +1 -2
  41. data/lib/webpacker/railtie.rb +8 -2
  42. data/lib/webpacker/runner.rb +1 -1
  43. data/lib/webpacker/version.rb +1 -1
  44. data/lib/webpacker/webpack_runner.rb +27 -7
  45. data/lib/webpacker.rb +1 -1
  46. data/package/__tests__/development.js +4 -11
  47. data/package/__tests__/env.js +8 -4
  48. data/package/babel/preset.js +0 -1
  49. data/package/config.js +3 -3
  50. data/package/env.js +6 -3
  51. data/package/environments/__tests__/base.js +3 -3
  52. data/package/environments/base.js +13 -13
  53. data/package/environments/development.js +36 -36
  54. data/package/environments/production.js +1 -1
  55. data/package/index.js +2 -0
  56. data/package/inliningCss.js +7 -0
  57. data/package/rules/file.js +1 -1
  58. data/package/rules/sass.js +1 -2
  59. data/package/utils/get_style_rule.js +4 -2
  60. data/package.json +25 -29
  61. data/test/command_test.rb +76 -0
  62. data/test/configuration_test.rb +1 -1
  63. data/test/dev_server_runner_test.rb +5 -2
  64. data/test/helper_test.rb +48 -34
  65. data/test/manifest_test.rb +10 -2
  66. data/test/mounted_app/test/dummy/config/webpacker.yml +2 -2
  67. data/test/test_app/config/initializers/inspect_autoload_paths.rb +1 -0
  68. data/test/test_app/config/webpacker.yml +2 -4
  69. data/test/test_app/config/webpacker_other_location.yml +79 -0
  70. data/test/test_app/public/packs/manifest.json +12 -5
  71. data/test/webpacker_test.rb +21 -0
  72. data/webpacker.gemspec +2 -2
  73. data/yarn.lock +2357 -3262
  74. metadata +24 -12
  75. data/6_0_upgrade.md +0 -62
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: 6.0.0.beta.6
4
+ version: 6.0.0.rc.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-27 00:00:00.000000000 Z
12
+ date: 2021-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -85,16 +85,16 @@ dependencies:
85
85
  name: rubocop
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 0.93.1
90
+ version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 0.93.1
97
+ version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rubocop-performance
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,6 @@ files:
126
126
  - ".gitignore"
127
127
  - ".node-version"
128
128
  - ".rubocop.yml"
129
- - 6_0_upgrade.md
130
129
  - CHANGELOG.md
131
130
  - CONTRIBUTING.md
132
131
  - Gemfile
@@ -136,19 +135,25 @@ files:
136
135
  - Rakefile
137
136
  - config/README.md
138
137
  - config/webpacker.yml
138
+ - docs/deployment.md
139
+ - docs/developing_webpacker.md
139
140
  - docs/troubleshooting.md
141
+ - docs/v6_upgrade.md
140
142
  - gemfiles/Gemfile-rails-edge
141
143
  - gemfiles/Gemfile-rails.5.2.x
142
144
  - gemfiles/Gemfile-rails.6.0.x
145
+ - gemfiles/Gemfile-rails.6.1.x
146
+ - lib/install/application.js
143
147
  - lib/install/bin/webpack
144
148
  - lib/install/bin/webpack-dev-server
149
+ - lib/install/bin/yarn
145
150
  - lib/install/binstubs.rb
146
151
  - lib/install/config/webpack/base.js
147
152
  - lib/install/config/webpack/development.js
148
153
  - lib/install/config/webpack/production.js
149
154
  - lib/install/config/webpack/test.js
150
155
  - lib/install/config/webpacker.yml
151
- - lib/install/packs/entrypoints/application.js
156
+ - lib/install/package.json
152
157
  - lib/install/template.rb
153
158
  - lib/tasks/webpacker.rake
154
159
  - lib/tasks/webpacker/binstubs.rake
@@ -160,8 +165,10 @@ files:
160
165
  - lib/tasks/webpacker/compile.rake
161
166
  - lib/tasks/webpacker/info.rake
162
167
  - lib/tasks/webpacker/install.rake
168
+ - lib/tasks/webpacker/verify_config.rake
163
169
  - lib/tasks/webpacker/verify_install.rake
164
170
  - lib/tasks/webpacker/yarn_install.rake
171
+ - lib/tasks/yarn.rake
165
172
  - lib/webpacker.rb
166
173
  - lib/webpacker/commands.rb
167
174
  - lib/webpacker/compiler.rb
@@ -197,6 +204,7 @@ files:
197
204
  - package/environments/production.js
198
205
  - package/environments/test.js
199
206
  - package/index.js
207
+ - package/inliningCss.js
200
208
  - package/rules/babel.js
201
209
  - package/rules/coffee.js
202
210
  - package/rules/css.js
@@ -237,8 +245,10 @@ files:
237
245
  - test/test_app/config.ru
238
246
  - test/test_app/config/application.rb
239
247
  - test/test_app/config/environment.rb
248
+ - test/test_app/config/initializers/inspect_autoload_paths.rb
240
249
  - test/test_app/config/webpack/development.js
241
250
  - test/test_app/config/webpacker.yml
251
+ - test/test_app/config/webpacker_other_location.yml
242
252
  - test/test_app/config/webpacker_public_root.yml
243
253
  - test/test_app/package.json
244
254
  - test/test_app/public/packs/manifest.json
@@ -253,8 +263,8 @@ homepage: https://github.com/rails/webpacker
253
263
  licenses:
254
264
  - MIT
255
265
  metadata:
256
- source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.beta.6
257
- changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.beta.6/CHANGELOG.md
266
+ source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.rc.6
267
+ changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.rc.6/CHANGELOG.md
258
268
  post_install_message:
259
269
  rdoc_options: []
260
270
  require_paths:
@@ -263,14 +273,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
263
273
  requirements:
264
274
  - - ">="
265
275
  - !ruby/object:Gem::Version
266
- version: 2.4.0
276
+ version: 2.7.0
267
277
  required_rubygems_version: !ruby/object:Gem::Requirement
268
278
  requirements:
269
279
  - - ">"
270
280
  - !ruby/object:Gem::Version
271
281
  version: 1.3.1
272
282
  requirements: []
273
- rubygems_version: 3.0.3
283
+ rubygems_version: 3.2.22
274
284
  signing_key:
275
285
  specification_version: 4
276
286
  summary: Use webpack to manage app-like JavaScript modules in Rails
@@ -303,8 +313,10 @@ test_files:
303
313
  - test/test_app/config.ru
304
314
  - test/test_app/config/application.rb
305
315
  - test/test_app/config/environment.rb
316
+ - test/test_app/config/initializers/inspect_autoload_paths.rb
306
317
  - test/test_app/config/webpack/development.js
307
318
  - test/test_app/config/webpacker.yml
319
+ - test/test_app/config/webpacker_other_location.yml
308
320
  - test/test_app/config/webpacker_public_root.yml
309
321
  - test/test_app/package.json
310
322
  - test/test_app/public/packs/manifest.json
data/6_0_upgrade.md DELETED
@@ -1,62 +0,0 @@
1
- # To webpacker v6 from v5
2
-
3
- This guide aims to help you migrating to webpacker 6. If you are using
4
- vanilla webpacker install then hopefully, the upgrade should be really
5
- straightforward.
6
-
7
- ## Preparation
8
-
9
- 1. If your `source_path` is `app/javascript`, rename it to `app/packs`
10
- 2. If your `source_entry_path` is `packs`, rename it to `entrypoints`
11
- 3. Rename `config/webpack` to `config/webpack_old`
12
- 4. Rename `config/webpacker.yml` to `config/webpacker_old.yml`
13
- 5. Uninstall the current version of `webpack-dev-server`: `yarn remove webpack-dev-server`
14
- 6. Upgrade webpacker
15
-
16
- ```ruby
17
- # Gemfile
18
- gem 'webpacker', '~> 6.0.0.pre.2'
19
- ```
20
-
21
- ```bash
22
- bundle install
23
- ```
24
-
25
- ```bash
26
- yarn add @rails/webpacker@next
27
- ```
28
-
29
- ```bash
30
- bundle exec rails webpacker:install
31
- ```
32
-
33
- - Change `javascript_packs_with_chunks_tag` and `stylesheet_packs_with_chunks_tag` to `javascript_pack_tag` and
34
- `stylesheet_pack_tag`.
35
-
36
- 7. If you are using any integrations like `css`, `React` or `TypeScript`. Please see https://github.com/rails/webpacker#integrations section on how they work in v6.0.
37
-
38
- 8. Copy over any custom webpack config from `config/webpack_old`
39
-
40
- - Common code previously called 'environment' changed to 'base'
41
- - import `environment` changed name to `webpackConfig`.
42
-
43
- ```js
44
- // config/webpack/base.js
45
- const { webpackConfig, merge } = require('@rails/webpacker')
46
- const customConfig = require('./custom')
47
-
48
- module.exports = merge(webpackConfig, customConfig)
49
- ```
50
-
51
- 9. Copy over custom browserlist config from `.browserlistrc` if it exists into the `"browserlist"` key in `package.json` and remove `.browserslistrc`.
52
-
53
- 10. `extensions` was removed from the webpacker.yml file. Move custom extensions to
54
- your configuration by by merging an object like this. For more details, see docs for
55
- [Webpack Configuration](https://github.com/rails/webpacker/blob/master/README.md#webpack-configuration)
56
- ```js
57
- {
58
- resolve: {
59
- extensions: ['.ts', '.tsx']
60
- }
61
- }
62
- ```