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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/jest.yml +5 -2
  3. data/.github/workflows/js-lint.yml +4 -1
  4. data/.github/workflows/rubocop.yml +1 -1
  5. data/.github/workflows/ruby.yml +12 -12
  6. data/.node-version +1 -1
  7. data/.rubocop.yml +106 -0
  8. data/CHANGELOG.md +23 -12
  9. data/Gemfile.lock +89 -88
  10. data/README.md +81 -22
  11. data/config/webpacker.yml +1 -1
  12. data/docs/deployment.md +128 -0
  13. data/docs/developing_webpacker.md +29 -0
  14. data/docs/troubleshooting.md +53 -23
  15. data/docs/v6_upgrade.md +75 -0
  16. data/gemfiles/Gemfile-rails-edge +1 -1
  17. data/gemfiles/Gemfile-rails.6.1.x +12 -0
  18. data/lib/install/config/webpacker.yml +3 -7
  19. data/lib/install/packs/entrypoints/application.js +3 -4
  20. data/lib/install/template.rb +14 -7
  21. data/lib/tasks/webpacker/binstubs.rake +2 -2
  22. data/lib/tasks/webpacker/check_node.rake +3 -0
  23. data/lib/tasks/webpacker/check_yarn.rake +4 -1
  24. data/lib/tasks/webpacker/clobber.rake +1 -1
  25. data/lib/tasks/webpacker/install.rake +2 -2
  26. data/lib/tasks/webpacker/verify_config.rake +14 -0
  27. data/lib/tasks/webpacker/verify_install.rake +1 -11
  28. data/lib/webpacker.rb +1 -1
  29. data/lib/webpacker/configuration.rb +19 -8
  30. data/lib/webpacker/dev_server.rb +6 -0
  31. data/lib/webpacker/dev_server_runner.rb +5 -2
  32. data/lib/webpacker/env.rb +5 -1
  33. data/lib/webpacker/helper.rb +13 -7
  34. data/lib/webpacker/instance.rb +4 -0
  35. data/lib/webpacker/manifest.rb +1 -2
  36. data/lib/webpacker/railtie.rb +1 -2
  37. data/lib/webpacker/runner.rb +1 -1
  38. data/lib/webpacker/version.rb +1 -1
  39. data/package.json +25 -29
  40. data/package/__tests__/development.js +2 -2
  41. data/package/__tests__/env.js +8 -4
  42. data/package/babel/preset.js +0 -1
  43. data/package/env.js +7 -1
  44. data/package/environments/__tests__/base.js +3 -3
  45. data/package/environments/base.js +12 -12
  46. data/package/environments/development.js +7 -9
  47. data/package/environments/production.js +1 -1
  48. data/package/index.js +2 -0
  49. data/package/inliningCss.js +7 -0
  50. data/package/rules/file.js +1 -1
  51. data/package/rules/sass.js +1 -2
  52. data/package/utils/get_style_rule.js +4 -2
  53. data/test/configuration_test.rb +1 -1
  54. data/test/dev_server_runner_test.rb +4 -1
  55. data/test/helper_test.rb +35 -30
  56. data/test/manifest_test.rb +10 -2
  57. data/test/mounted_app/test/dummy/config/webpacker.yml +2 -2
  58. data/test/test_app/config/webpacker.yml +2 -4
  59. data/test/test_app/config/webpacker_other_location.yml +79 -0
  60. data/test/test_app/public/packs/manifest.json +12 -5
  61. data/test/webpacker_test.rb +17 -0
  62. data/yarn.lock +1567 -1039
  63. metadata +13 -6
  64. 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.1
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-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -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,10 +135,14 @@ 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
143
146
  - lib/install/bin/webpack
144
147
  - lib/install/bin/webpack-dev-server
145
148
  - lib/install/binstubs.rb
@@ -160,6 +163,7 @@ files:
160
163
  - lib/tasks/webpacker/compile.rake
161
164
  - lib/tasks/webpacker/info.rake
162
165
  - lib/tasks/webpacker/install.rake
166
+ - lib/tasks/webpacker/verify_config.rake
163
167
  - lib/tasks/webpacker/verify_install.rake
164
168
  - lib/tasks/webpacker/yarn_install.rake
165
169
  - lib/webpacker.rb
@@ -197,6 +201,7 @@ files:
197
201
  - package/environments/production.js
198
202
  - package/environments/test.js
199
203
  - package/index.js
204
+ - package/inliningCss.js
200
205
  - package/rules/babel.js
201
206
  - package/rules/coffee.js
202
207
  - package/rules/css.js
@@ -239,6 +244,7 @@ files:
239
244
  - test/test_app/config/environment.rb
240
245
  - test/test_app/config/webpack/development.js
241
246
  - test/test_app/config/webpacker.yml
247
+ - test/test_app/config/webpacker_other_location.yml
242
248
  - test/test_app/config/webpacker_public_root.yml
243
249
  - test/test_app/package.json
244
250
  - test/test_app/public/packs/manifest.json
@@ -253,8 +259,8 @@ homepage: https://github.com/rails/webpacker
253
259
  licenses:
254
260
  - MIT
255
261
  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
262
+ source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.rc.1
263
+ changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.rc.1/CHANGELOG.md
258
264
  post_install_message:
259
265
  rdoc_options: []
260
266
  require_paths:
@@ -270,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
276
  - !ruby/object:Gem::Version
271
277
  version: 1.3.1
272
278
  requirements: []
273
- rubygems_version: 3.0.3
279
+ rubygems_version: 3.1.4
274
280
  signing_key:
275
281
  specification_version: 4
276
282
  summary: Use webpack to manage app-like JavaScript modules in Rails
@@ -305,6 +311,7 @@ test_files:
305
311
  - test/test_app/config/environment.rb
306
312
  - test/test_app/config/webpack/development.js
307
313
  - test/test_app/config/webpacker.yml
314
+ - test/test_app/config/webpacker_other_location.yml
308
315
  - test/test_app/config/webpacker_public_root.yml
309
316
  - test/test_app/package.json
310
317
  - 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
- ```