webpacker 4.0.7 → 5.4.4

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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +8 -8
  3. data/.github/workflows/jest.yml +38 -0
  4. data/.github/workflows/js-lint.yml +39 -0
  5. data/.github/workflows/rubocop.yml +39 -0
  6. data/.github/workflows/ruby.yml +46 -0
  7. data/.node-version +1 -1
  8. data/.rubocop.yml +118 -14
  9. data/CHANGELOG.md +301 -138
  10. data/CONTRIBUTING.md +1 -1
  11. data/Gemfile +1 -0
  12. data/Gemfile.lock +123 -92
  13. data/README.md +86 -211
  14. data/docs/css.md +72 -6
  15. data/docs/deployment.md +40 -11
  16. data/docs/docker.md +33 -14
  17. data/docs/engines.md +53 -3
  18. data/docs/env.md +0 -2
  19. data/docs/es6.md +19 -1
  20. data/docs/integrations.md +220 -0
  21. data/docs/target.md +22 -0
  22. data/docs/testing.md +2 -3
  23. data/docs/troubleshooting.md +39 -9
  24. data/docs/typescript.md +93 -26
  25. data/docs/webpack-dev-server.md +2 -2
  26. data/docs/webpack.md +18 -3
  27. data/gemfiles/Gemfile-rails-edge +1 -1
  28. data/gemfiles/{Gemfile-rails.4.2.x → Gemfile-rails.6.0.x} +1 -1
  29. data/lib/install/bin/webpack +0 -1
  30. data/lib/install/bin/webpack-dev-server +0 -1
  31. data/lib/install/coffee.rb +1 -1
  32. data/lib/install/config/babel.config.js +23 -13
  33. data/lib/install/config/webpacker.yml +3 -6
  34. data/lib/install/elm.rb +1 -1
  35. data/lib/install/erb.rb +2 -2
  36. data/lib/install/examples/angular/hello_angular/polyfills.ts +2 -2
  37. data/lib/install/examples/react/babel.config.js +28 -14
  38. data/lib/install/examples/react/tsconfig.json +2 -1
  39. data/lib/install/examples/svelte/app.svelte +11 -0
  40. data/lib/install/examples/svelte/hello_svelte.js +20 -0
  41. data/lib/install/examples/typescript/tsconfig.json +2 -1
  42. data/lib/install/loaders/elm.js +9 -6
  43. data/lib/install/loaders/svelte.js +9 -0
  44. data/lib/install/svelte.rb +29 -0
  45. data/lib/install/template.rb +14 -6
  46. data/lib/install/typescript.rb +6 -13
  47. data/lib/install/vue.rb +1 -1
  48. data/lib/tasks/installers.rake +1 -0
  49. data/lib/tasks/webpacker/check_node.rake +15 -8
  50. data/lib/tasks/webpacker/check_yarn.rake +16 -10
  51. data/lib/tasks/webpacker/clean.rake +25 -0
  52. data/lib/tasks/webpacker/clobber.rake +8 -4
  53. data/lib/tasks/webpacker/compile.rake +2 -10
  54. data/lib/tasks/webpacker/yarn_install.rake +11 -1
  55. data/lib/tasks/webpacker.rake +2 -0
  56. data/lib/webpacker/commands.rb +53 -1
  57. data/lib/webpacker/compiler.rb +21 -10
  58. data/lib/webpacker/configuration.rb +36 -13
  59. data/lib/webpacker/dev_server.rb +1 -1
  60. data/lib/webpacker/dev_server_proxy.rb +5 -9
  61. data/lib/webpacker/dev_server_runner.rb +6 -6
  62. data/lib/webpacker/env.rb +6 -2
  63. data/lib/webpacker/helper.rb +70 -25
  64. data/lib/webpacker/manifest.rb +4 -4
  65. data/lib/webpacker/railtie.rb +6 -43
  66. data/lib/webpacker/runner.rb +1 -0
  67. data/lib/webpacker/version.rb +1 -1
  68. data/lib/webpacker/webpack_runner.rb +2 -2
  69. data/lib/webpacker.rb +9 -1
  70. data/package/__tests__/config.js +12 -24
  71. data/package/__tests__/dev_server.js +2 -0
  72. data/package/__tests__/development.js +14 -1
  73. data/package/config.js +6 -11
  74. data/package/configPath.js +3 -0
  75. data/package/config_types/config_list.js +3 -3
  76. data/package/config_types/config_object.js +1 -1
  77. data/package/dev_server.js +1 -1
  78. data/package/env.js +1 -2
  79. data/package/environments/__tests__/base.js +29 -2
  80. data/package/environments/base.js +18 -8
  81. data/package/environments/development.js +39 -37
  82. data/package/environments/production.js +12 -2
  83. data/package/rules/babel.js +12 -5
  84. data/package/rules/file.js +3 -2
  85. data/package/rules/node_modules.js +3 -5
  86. data/package/rules/sass.js +11 -2
  87. data/package/utils/__tests__/get_style_rule.js +9 -0
  88. data/package/utils/deep_merge.js +5 -5
  89. data/package/utils/get_style_rule.js +7 -12
  90. data/package/utils/helpers.js +10 -10
  91. data/package.json +43 -43
  92. data/test/command_test.rb +6 -0
  93. data/test/compiler_test.rb +10 -6
  94. data/test/configuration_test.rb +40 -30
  95. data/test/dev_server_runner_test.rb +1 -1
  96. data/test/dev_server_test.rb +22 -0
  97. data/test/helper_test.rb +58 -9
  98. data/test/manifest_test.rb +37 -6
  99. data/test/rake_tasks_test.rb +17 -0
  100. data/test/test_app/app/javascript/packs/multi_entry.css +4 -0
  101. data/test/test_app/app/javascript/packs/multi_entry.js +4 -0
  102. data/test/test_app/bin/webpack +0 -1
  103. data/test/test_app/bin/webpack-dev-server +0 -1
  104. data/test/test_app/config/application.rb +0 -1
  105. data/test/test_app/config/webpacker.yml +8 -1
  106. data/test/test_app/public/packs/manifest.json +4 -0
  107. data/test/webpack_runner_test.rb +1 -1
  108. data/webpacker.gemspec +6 -4
  109. data/yarn.lock +4350 -4099
  110. metadata +63 -23
  111. data/.travis.yml +0 -53
  112. data/gemfiles/Gemfile-rails.5.0.x +0 -9
  113. data/gemfiles/Gemfile-rails.5.1.x +0 -9
  114. data/lib/install/loaders/typescript.js +0 -11
data/CONTRIBUTING.md CHANGED
@@ -9,7 +9,7 @@ yarn
9
9
  ```
10
10
 
11
11
  ## Making sure your changes pass all tests
12
- There are a number of automated checks which run on Travis CI when a pull request is created.
12
+ There are a number of automated checks which run on Github Actions when a pull request is created.
13
13
  You can run those checks on your own locally to make sure that your changes would not break the CI build.
14
14
 
15
15
  ### 1. Check the code for JavaScript style violations
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gemspec
5
5
  gem "rails"
6
6
  gem "rake", ">= 11.1"
7
7
  gem "rack-proxy", require: false
8
+ gem "semantic_range", require: false
8
9
 
9
10
  group :test do
10
11
  gem "minitest", "~> 5.0"
data/Gemfile.lock CHANGED
@@ -1,139 +1,168 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webpacker (4.0.7)
5
- activesupport (>= 4.2)
4
+ webpacker (5.4.4)
5
+ activesupport (>= 5.2)
6
6
  rack-proxy (>= 0.6.1)
7
- railties (>= 4.2)
7
+ railties (>= 5.2)
8
+ semantic_range (>= 2.3.0)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
- actioncable (5.2.3)
13
- actionpack (= 5.2.3)
13
+ actioncable (6.1.3.2)
14
+ actionpack (= 6.1.3.2)
15
+ activesupport (= 6.1.3.2)
14
16
  nio4r (~> 2.0)
15
17
  websocket-driver (>= 0.6.1)
16
- actionmailer (5.2.3)
17
- actionpack (= 5.2.3)
18
- actionview (= 5.2.3)
19
- activejob (= 5.2.3)
18
+ actionmailbox (6.1.3.2)
19
+ actionpack (= 6.1.3.2)
20
+ activejob (= 6.1.3.2)
21
+ activerecord (= 6.1.3.2)
22
+ activestorage (= 6.1.3.2)
23
+ activesupport (= 6.1.3.2)
24
+ mail (>= 2.7.1)
25
+ actionmailer (6.1.3.2)
26
+ actionpack (= 6.1.3.2)
27
+ actionview (= 6.1.3.2)
28
+ activejob (= 6.1.3.2)
29
+ activesupport (= 6.1.3.2)
20
30
  mail (~> 2.5, >= 2.5.4)
21
31
  rails-dom-testing (~> 2.0)
22
- actionpack (5.2.3)
23
- actionview (= 5.2.3)
24
- activesupport (= 5.2.3)
25
- rack (~> 2.0)
32
+ actionpack (6.1.3.2)
33
+ actionview (= 6.1.3.2)
34
+ activesupport (= 6.1.3.2)
35
+ rack (~> 2.0, >= 2.0.9)
26
36
  rack-test (>= 0.6.3)
27
37
  rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.2.3)
30
- activesupport (= 5.2.3)
38
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
39
+ actiontext (6.1.3.2)
40
+ actionpack (= 6.1.3.2)
41
+ activerecord (= 6.1.3.2)
42
+ activestorage (= 6.1.3.2)
43
+ activesupport (= 6.1.3.2)
44
+ nokogiri (>= 1.8.5)
45
+ actionview (6.1.3.2)
46
+ activesupport (= 6.1.3.2)
31
47
  builder (~> 3.1)
32
48
  erubi (~> 1.4)
33
49
  rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.2.3)
36
- activesupport (= 5.2.3)
50
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
51
+ activejob (6.1.3.2)
52
+ activesupport (= 6.1.3.2)
37
53
  globalid (>= 0.3.6)
38
- activemodel (5.2.3)
39
- activesupport (= 5.2.3)
40
- activerecord (5.2.3)
41
- activemodel (= 5.2.3)
42
- activesupport (= 5.2.3)
43
- arel (>= 9.0)
44
- activestorage (5.2.3)
45
- actionpack (= 5.2.3)
46
- activerecord (= 5.2.3)
47
- marcel (~> 0.3.1)
48
- activesupport (5.2.3)
54
+ activemodel (6.1.3.2)
55
+ activesupport (= 6.1.3.2)
56
+ activerecord (6.1.3.2)
57
+ activemodel (= 6.1.3.2)
58
+ activesupport (= 6.1.3.2)
59
+ activestorage (6.1.3.2)
60
+ actionpack (= 6.1.3.2)
61
+ activejob (= 6.1.3.2)
62
+ activerecord (= 6.1.3.2)
63
+ activesupport (= 6.1.3.2)
64
+ marcel (~> 1.0.0)
65
+ mini_mime (~> 1.0.2)
66
+ activesupport (6.1.3.2)
49
67
  concurrent-ruby (~> 1.0, >= 1.0.2)
50
- i18n (>= 0.7, < 2)
51
- minitest (~> 5.1)
52
- tzinfo (~> 1.1)
53
- arel (9.0.0)
54
- ast (2.4.0)
55
- builder (3.2.3)
56
- byebug (11.0.1)
57
- concurrent-ruby (1.1.5)
58
- crass (1.0.4)
59
- erubi (1.8.0)
68
+ i18n (>= 1.6, < 2)
69
+ minitest (>= 5.1)
70
+ tzinfo (~> 2.0)
71
+ zeitwerk (~> 2.3)
72
+ ast (2.4.2)
73
+ builder (3.2.4)
74
+ byebug (11.1.3)
75
+ concurrent-ruby (1.1.8)
76
+ crass (1.0.6)
77
+ erubi (1.10.0)
60
78
  globalid (0.4.2)
61
79
  activesupport (>= 4.2.0)
62
- i18n (1.6.0)
80
+ i18n (1.8.10)
63
81
  concurrent-ruby (~> 1.0)
64
- jaro_winkler (1.5.2)
65
- loofah (2.2.3)
82
+ loofah (2.9.1)
66
83
  crass (~> 1.0.2)
67
84
  nokogiri (>= 1.5.9)
68
85
  mail (2.7.1)
69
86
  mini_mime (>= 0.1.1)
70
- marcel (0.3.3)
71
- mimemagic (~> 0.3.2)
72
- method_source (0.9.2)
73
- mimemagic (0.3.3)
74
- mini_mime (1.0.1)
75
- mini_portile2 (2.4.0)
76
- minitest (5.11.3)
77
- nio4r (2.3.1)
78
- nokogiri (1.10.3)
79
- mini_portile2 (~> 2.4.0)
80
- parallel (1.17.0)
81
- parser (2.6.3.0)
82
- ast (~> 2.4.0)
83
- rack (2.0.7)
87
+ marcel (1.0.1)
88
+ method_source (1.0.0)
89
+ mini_mime (1.0.3)
90
+ mini_portile2 (2.5.1)
91
+ minitest (5.14.4)
92
+ nio4r (2.5.7)
93
+ nokogiri (1.11.4)
94
+ mini_portile2 (~> 2.5.0)
95
+ racc (~> 1.4)
96
+ parallel (1.20.1)
97
+ parser (3.0.1.1)
98
+ ast (~> 2.4.1)
99
+ racc (1.5.2)
100
+ rack (2.2.3)
84
101
  rack-proxy (0.6.5)
85
102
  rack
86
103
  rack-test (1.1.0)
87
104
  rack (>= 1.0, < 3)
88
- rails (5.2.3)
89
- actioncable (= 5.2.3)
90
- actionmailer (= 5.2.3)
91
- actionpack (= 5.2.3)
92
- actionview (= 5.2.3)
93
- activejob (= 5.2.3)
94
- activemodel (= 5.2.3)
95
- activerecord (= 5.2.3)
96
- activestorage (= 5.2.3)
97
- activesupport (= 5.2.3)
98
- bundler (>= 1.3.0)
99
- railties (= 5.2.3)
105
+ rails (6.1.3.2)
106
+ actioncable (= 6.1.3.2)
107
+ actionmailbox (= 6.1.3.2)
108
+ actionmailer (= 6.1.3.2)
109
+ actionpack (= 6.1.3.2)
110
+ actiontext (= 6.1.3.2)
111
+ actionview (= 6.1.3.2)
112
+ activejob (= 6.1.3.2)
113
+ activemodel (= 6.1.3.2)
114
+ activerecord (= 6.1.3.2)
115
+ activestorage (= 6.1.3.2)
116
+ activesupport (= 6.1.3.2)
117
+ bundler (>= 1.15.0)
118
+ railties (= 6.1.3.2)
100
119
  sprockets-rails (>= 2.0.0)
101
120
  rails-dom-testing (2.0.3)
102
121
  activesupport (>= 4.2.0)
103
122
  nokogiri (>= 1.6)
104
- rails-html-sanitizer (1.0.4)
105
- loofah (~> 2.2, >= 2.2.2)
106
- railties (5.2.3)
107
- actionpack (= 5.2.3)
108
- activesupport (= 5.2.3)
123
+ rails-html-sanitizer (1.3.0)
124
+ loofah (~> 2.3)
125
+ railties (6.1.3.2)
126
+ actionpack (= 6.1.3.2)
127
+ activesupport (= 6.1.3.2)
109
128
  method_source
110
129
  rake (>= 0.8.7)
111
- thor (>= 0.19.0, < 2.0)
130
+ thor (~> 1.0)
112
131
  rainbow (3.0.0)
113
- rake (12.3.2)
114
- rubocop (0.68.1)
115
- jaro_winkler (~> 1.5.1)
132
+ rake (13.0.3)
133
+ regexp_parser (2.1.1)
134
+ rexml (3.2.5)
135
+ rubocop (0.93.1)
116
136
  parallel (~> 1.10)
117
- parser (>= 2.5, != 2.5.1.1)
137
+ parser (>= 2.7.1.5)
118
138
  rainbow (>= 2.2.2, < 4.0)
139
+ regexp_parser (>= 1.8)
140
+ rexml
141
+ rubocop-ast (>= 0.6.0)
119
142
  ruby-progressbar (~> 1.7)
120
- unicode-display_width (>= 1.4.0, < 1.6)
121
- ruby-progressbar (1.10.1)
122
- sprockets (3.7.2)
143
+ unicode-display_width (>= 1.4.0, < 2.0)
144
+ rubocop-ast (1.5.0)
145
+ parser (>= 3.0.1.1)
146
+ rubocop-performance (1.10.2)
147
+ rubocop (>= 0.90.0, < 2.0)
148
+ rubocop-ast (>= 0.4.0)
149
+ ruby-progressbar (1.11.0)
150
+ semantic_range (3.0.0)
151
+ sprockets (4.0.2)
123
152
  concurrent-ruby (~> 1.0)
124
153
  rack (> 1, < 3)
125
- sprockets-rails (3.2.1)
154
+ sprockets-rails (3.2.2)
126
155
  actionpack (>= 4.0)
127
156
  activesupport (>= 4.0)
128
157
  sprockets (>= 3.0.0)
129
- thor (0.20.3)
130
- thread_safe (0.3.6)
131
- tzinfo (1.2.5)
132
- thread_safe (~> 0.1)
133
- unicode-display_width (1.5.0)
134
- websocket-driver (0.7.0)
158
+ thor (1.1.0)
159
+ tzinfo (2.0.4)
160
+ concurrent-ruby (~> 1.0)
161
+ unicode-display_width (1.7.0)
162
+ websocket-driver (0.7.3)
135
163
  websocket-extensions (>= 0.1.0)
136
- websocket-extensions (0.1.3)
164
+ websocket-extensions (0.1.5)
165
+ zeitwerk (2.4.2)
137
166
 
138
167
  PLATFORMS
139
168
  ruby
@@ -145,8 +174,10 @@ DEPENDENCIES
145
174
  rack-proxy
146
175
  rails
147
176
  rake (>= 11.1)
148
- rubocop (< 0.69)
177
+ rubocop (= 0.93.1)
178
+ rubocop-performance
179
+ semantic_range
149
180
  webpacker!
150
181
 
151
182
  BUNDLED WITH
152
- 1.17.3
183
+ 2.2.3