shakapacker 7.3.0.beta.1 → 8.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintignore +1 -1
  3. data/.eslintrc.js +29 -8
  4. data/.github/PULL_REQUEST_TEMPLATE.md +10 -3
  5. data/.github/workflows/dummy.yml +6 -1
  6. data/.github/workflows/generator.yml +14 -18
  7. data/.github/workflows/node.yml +56 -0
  8. data/.github/workflows/ruby.yml +29 -17
  9. data/.node-version +1 -1
  10. data/.rubocop.yml +1 -0
  11. data/CHANGELOG.md +56 -5
  12. data/README.md +101 -48
  13. data/Rakefile +1 -7
  14. data/docs/customizing_babel_config.md +2 -2
  15. data/docs/deployment.md +13 -6
  16. data/docs/react.md +7 -13
  17. data/docs/troubleshooting.md +4 -4
  18. data/docs/using_esbuild_loader.md +1 -1
  19. data/docs/using_swc_loader.md +1 -1
  20. data/docs/v6_upgrade.md +1 -1
  21. data/docs/v8_upgrade.md +148 -0
  22. data/gemfiles/Gemfile-rails.7.1.x +12 -0
  23. data/jest.config.js +4 -0
  24. data/lib/install/config/shakapacker.yml +2 -2
  25. data/lib/install/template.rb +36 -30
  26. data/lib/shakapacker/base_strategy.rb +2 -1
  27. data/lib/shakapacker/compiler.rb +6 -21
  28. data/lib/shakapacker/configuration.rb +2 -46
  29. data/lib/shakapacker/deprecation_helper.rb +0 -78
  30. data/lib/shakapacker/dev_server.rb +1 -16
  31. data/lib/shakapacker/dev_server_runner.rb +2 -21
  32. data/lib/shakapacker/env.rb +1 -1
  33. data/lib/shakapacker/helper.rb +3 -3
  34. data/lib/shakapacker/instance.rb +1 -3
  35. data/lib/shakapacker/manifest.rb +1 -1
  36. data/lib/shakapacker/railtie.rb +7 -0
  37. data/lib/shakapacker/runner.rb +4 -18
  38. data/lib/shakapacker/utils/manager.rb +58 -0
  39. data/lib/shakapacker/utils/misc.rb +0 -12
  40. data/lib/shakapacker/version.rb +1 -1
  41. data/lib/shakapacker/version_checker.rb +9 -30
  42. data/lib/shakapacker/webpack_runner.rb +2 -21
  43. data/lib/shakapacker.rb +0 -2
  44. data/lib/tasks/shakapacker/check_binstubs.rake +12 -26
  45. data/lib/tasks/shakapacker/check_manager.rake +3 -8
  46. data/lib/tasks/shakapacker/info.rake +6 -15
  47. data/package/babel/preset.js +15 -15
  48. data/package/config.js +15 -19
  49. data/package/dev_server.js +4 -4
  50. data/package/env.js +19 -17
  51. data/package/environments/base.js +41 -24
  52. data/package/environments/development.js +6 -6
  53. data/package/environments/production.js +16 -16
  54. data/package/environments/test.js +1 -1
  55. data/package/esbuild/index.js +6 -6
  56. data/package/index.d.ts +0 -2
  57. data/package/index.js +17 -46
  58. data/package/rules/babel.js +6 -8
  59. data/package/rules/coffee.js +2 -2
  60. data/package/rules/css.js +1 -1
  61. data/package/rules/erb.js +4 -4
  62. data/package/rules/esbuild.js +5 -7
  63. data/package/rules/file.js +14 -7
  64. data/package/rules/index.js +11 -11
  65. data/package/rules/jscommon.js +8 -5
  66. data/package/rules/less.js +10 -9
  67. data/package/rules/raw.js +1 -1
  68. data/package/rules/sass.js +4 -4
  69. data/package/rules/stylus.js +12 -7
  70. data/package/rules/swc.js +5 -7
  71. data/package/swc/index.js +10 -10
  72. data/package/utils/configPath.js +3 -18
  73. data/package/utils/defaultConfigPath.js +1 -1
  74. data/package/utils/{get_style_rule.js → getStyleRule.js} +6 -6
  75. data/package/utils/helpers.js +2 -43
  76. data/package/utils/inliningCss.js +4 -3
  77. data/package/utils/snakeToCamelCase.js +5 -0
  78. data/package/webpackDevServerConfig.js +28 -25
  79. data/package.json +12 -18
  80. data/prettier.config.js +4 -0
  81. data/shakapacker.gemspec +1 -1
  82. data/spec/dummy/app/javascript/packs/application.js +1 -1
  83. data/spec/dummy/config/application.rb +3 -0
  84. data/spec/dummy/config/initializers/react_on_rails.rb +2 -2
  85. data/spec/dummy/config/shakapacker.yml +3 -4
  86. data/spec/dummy/config/webpack/commonWebpackConfig.js +0 -1
  87. data/spec/dummy/config/webpack/webpack.config.js +1 -1
  88. data/spec/dummy/package.json +2 -1
  89. data/spec/dummy/yarn.lock +2 -3
  90. data/spec/fixtures/github_url_package-lock.v1.json +1 -1
  91. data/spec/fixtures/github_url_package-lock.v2.json +2 -2
  92. data/spec/fixtures/github_url_package.json +1 -1
  93. data/spec/fixtures/github_url_pnpm-lock.v7.yaml +1 -1
  94. data/spec/fixtures/github_url_pnpm-lock.v8.yaml +1 -1
  95. data/spec/fixtures/github_url_yarn.v1.lock +1 -1
  96. data/spec/fixtures/github_url_yarn.v2.lock +2 -2
  97. data/spec/generator_specs/e2e_template/template.rb +15 -28
  98. data/spec/generator_specs/generator_spec.rb +6 -136
  99. data/spec/mounted_app/test/dummy/config/webpacker.yml +0 -1
  100. data/spec/shakapacker/compiler_spec.rb +1 -3
  101. data/spec/shakapacker/configuration_spec.rb +4 -56
  102. data/spec/shakapacker/dev_server_runner_spec.rb +19 -102
  103. data/spec/shakapacker/dev_server_spec.rb +1 -16
  104. data/spec/shakapacker/engine_rake_tasks_spec.rb +1 -16
  105. data/spec/shakapacker/helper_spec.rb +3 -3
  106. data/spec/shakapacker/instance_spec.rb +1 -3
  107. data/spec/shakapacker/rake_tasks_spec.rb +2 -14
  108. data/spec/shakapacker/shakapacker_spec.rb +0 -1
  109. data/spec/shakapacker/test_app/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -1
  110. data/spec/shakapacker/test_app/config/shakapacker_manifest_path.yml +0 -1
  111. data/spec/shakapacker/test_app/config/shakapacker_nested_entries.yml +0 -1
  112. data/spec/shakapacker/test_app/config/shakapacker_other_location.yml +0 -1
  113. data/spec/shakapacker/test_app/package.json +2 -1
  114. data/spec/shakapacker/utils_manager_spec.rb +125 -0
  115. data/spec/shakapacker/version_checker_spec.rb +5 -5
  116. data/spec/shakapacker/webpack_runner_spec.rb +19 -28
  117. data/spec/support/package_json_helpers.rb +7 -4
  118. data/test/helpers.js +67 -0
  119. data/test/package/config.test.js +50 -0
  120. data/test/package/dev_server.test.js +44 -0
  121. data/test/package/development.test.js +43 -0
  122. data/test/package/env.test.js +57 -0
  123. data/test/package/environments/base.test.js +105 -0
  124. data/test/package/environments/development.test.js +50 -0
  125. data/test/package/environments/production.test.js +106 -0
  126. data/test/package/index.test.js +45 -0
  127. data/test/package/production.test.js +32 -0
  128. data/test/package/rules/babel.test.js +58 -0
  129. data/test/package/rules/esbuild.test.js +59 -0
  130. data/test/package/rules/file.test.js +81 -0
  131. data/test/package/rules/index.test.js +7 -0
  132. data/test/package/rules/raw.test.js +12 -0
  133. data/test/package/rules/swc.test.js +59 -0
  134. data/test/package/staging.test.js +31 -0
  135. data/test/package/test.test.js +28 -0
  136. data/yarn.lock +1278 -421
  137. metadata +50 -100
  138. data/.github/workflows/jest.yml +0 -33
  139. data/.github/workflows/js-lint.yml +0 -33
  140. data/.github/workflows/rubocop.yml +0 -28
  141. data/.github/workflows/ruby-backward-compatibility.yml +0 -51
  142. data/lib/install/package.json +0 -15
  143. data/lib/tasks/shakapacker/check_yarn.rake +0 -34
  144. data/lib/tasks/shakapacker/yarn_install.rake +0 -24
  145. data/lib/tasks/webpacker/binstubs.rake +0 -9
  146. data/lib/tasks/webpacker/check_binstubs.rake +0 -9
  147. data/lib/tasks/webpacker/check_node.rake +0 -9
  148. data/lib/tasks/webpacker/check_yarn.rake +0 -9
  149. data/lib/tasks/webpacker/clean.rake +0 -9
  150. data/lib/tasks/webpacker/clobber.rake +0 -11
  151. data/lib/tasks/webpacker/compile.rake +0 -9
  152. data/lib/tasks/webpacker/info.rake +0 -9
  153. data/lib/tasks/webpacker/install.rake +0 -9
  154. data/lib/tasks/webpacker/verify_config.rake +0 -9
  155. data/lib/tasks/webpacker/verify_install.rake +0 -9
  156. data/lib/tasks/webpacker/yarn_install.rake +0 -9
  157. data/lib/tasks/webpacker.rake +0 -20
  158. data/lib/webpacker/dev_server_runner.rb +0 -9
  159. data/lib/webpacker/webpack_runner.rb +0 -9
  160. data/lib/webpacker.rb +0 -4
  161. data/package/__tests__/config-bc.js +0 -27
  162. data/package/__tests__/config.js +0 -46
  163. data/package/__tests__/dev_server-bc.js +0 -46
  164. data/package/__tests__/dev_server.js +0 -46
  165. data/package/__tests__/development-bc.js +0 -66
  166. data/package/__tests__/development.js +0 -66
  167. data/package/__tests__/env-bc.js +0 -59
  168. data/package/__tests__/env.js +0 -59
  169. data/package/__tests__/index-bc.js +0 -22
  170. data/package/__tests__/index.js +0 -46
  171. data/package/__tests__/production-bc.js +0 -51
  172. data/package/__tests__/production.js +0 -51
  173. data/package/__tests__/staging-bc.js +0 -53
  174. data/package/__tests__/staging.js +0 -53
  175. data/package/__tests__/test-bc.js +0 -43
  176. data/package/__tests__/test.js +0 -43
  177. data/package/environments/__tests__/base-bc.js +0 -107
  178. data/package/environments/__tests__/base.js +0 -107
  179. data/package/environments/__tests__/development.js +0 -53
  180. data/package/environments/__tests__/production.js +0 -92
  181. data/package/rules/__tests__/__utils__/webpack.js +0 -50
  182. data/package/rules/__tests__/babel.js +0 -63
  183. data/package/rules/__tests__/esbuild.js +0 -64
  184. data/package/rules/__tests__/file.js +0 -79
  185. data/package/rules/__tests__/index.js +0 -7
  186. data/package/rules/__tests__/raw.js +0 -18
  187. data/package/rules/__tests__/swc.js +0 -63
  188. data/package/utils/snakeToCamelCase +0 -7
  189. data/spec/backward_compatibility_specs/command_spec.rb +0 -116
  190. data/spec/backward_compatibility_specs/compiler_spec.rb +0 -59
  191. data/spec/backward_compatibility_specs/compiler_strategy_spec.rb +0 -24
  192. data/spec/backward_compatibility_specs/configuration_spec.rb +0 -294
  193. data/spec/backward_compatibility_specs/dev_server_runner_spec.rb +0 -206
  194. data/spec/backward_compatibility_specs/dev_server_spec.rb +0 -47
  195. data/spec/backward_compatibility_specs/digest_strategy_spec.rb +0 -38
  196. data/spec/backward_compatibility_specs/engine_rake_tasks_spec.rb +0 -67
  197. data/spec/backward_compatibility_specs/env_spec.rb +0 -23
  198. data/spec/backward_compatibility_specs/helper_spec.rb +0 -243
  199. data/spec/backward_compatibility_specs/instance_spec.rb +0 -31
  200. data/spec/backward_compatibility_specs/manifest_spec.rb +0 -100
  201. data/spec/backward_compatibility_specs/mtime_strategy_spec.rb +0 -55
  202. data/spec/backward_compatibility_specs/rake_tasks_spec.rb +0 -41
  203. data/spec/backward_compatibility_specs/spec_helper_initializer.rb +0 -24
  204. data/spec/backward_compatibility_specs/webpack_runner_spec.rb +0 -86
  205. data/spec/backward_compatibility_specs/webpacker_spec.rb +0 -41
  206. data/spec/backward_compatibility_specs/webpacker_test_app/.gitignore +0 -2
  207. data/spec/backward_compatibility_specs/webpacker_test_app/Rakefile +0 -3
  208. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/application.js +0 -10
  209. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/generated/something.js +0 -2
  210. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.css +0 -4
  211. data/spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.js +0 -4
  212. data/spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker +0 -13
  213. data/spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker-dev-server +0 -13
  214. data/spec/backward_compatibility_specs/webpacker_test_app/config/application.rb +0 -11
  215. data/spec/backward_compatibility_specs/webpacker_test_app/config/environment.rb +0 -4
  216. data/spec/backward_compatibility_specs/webpacker_test_app/config/initializers/inspect_autoload_paths.rb +0 -1
  217. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpack/webpack.config.js +0 -0
  218. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker.yml +0 -83
  219. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_css_extract_ignore_order_warnings.yml +0 -84
  220. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_defaults_fallback.yml +0 -11
  221. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_manifest_path.yml +0 -80
  222. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_nested_entries.yml +0 -83
  223. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_no_precompile.yml +0 -7
  224. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_other_location.yml +0 -85
  225. data/spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_public_root.yml +0 -18
  226. data/spec/backward_compatibility_specs/webpacker_test_app/config.ru +0 -5
  227. data/spec/backward_compatibility_specs/webpacker_test_app/package.json +0 -13
  228. data/spec/backward_compatibility_specs/webpacker_test_app/public/packs/manifest.json +0 -58
  229. data/spec/backward_compatibility_specs/webpacker_test_app/some.config.js +0 -0
  230. data/spec/backward_compatibility_specs/webpacker_test_app/tmp/shakapacker/last-compilation-digest-production +0 -1
  231. data/spec/backward_compatibility_specs/webpacker_test_app/yarn.lock +0 -11
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shakapacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.0.beta.1
4
+ version: 8.0.0.pre.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-01-20 00:00:00.000000000 Z
13
+ date: 2024-05-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -141,10 +141,7 @@ files:
141
141
  - ".github/PULL_REQUEST_TEMPLATE.md"
142
142
  - ".github/workflows/dummy.yml"
143
143
  - ".github/workflows/generator.yml"
144
- - ".github/workflows/jest.yml"
145
- - ".github/workflows/js-lint.yml"
146
- - ".github/workflows/rubocop.yml"
147
- - ".github/workflows/ruby-backward-compatibility.yml"
144
+ - ".github/workflows/node.yml"
148
145
  - ".github/workflows/ruby.yml"
149
146
  - ".gitignore"
150
147
  - ".node-version"
@@ -170,10 +167,13 @@ files:
170
167
  - docs/using_swc_loader.md
171
168
  - docs/v6_upgrade.md
172
169
  - docs/v7_upgrade.md
170
+ - docs/v8_upgrade.md
173
171
  - gemfiles/Gemfile-rails-edge
174
172
  - gemfiles/Gemfile-rails.6.0.x
175
173
  - gemfiles/Gemfile-rails.6.1.x
176
174
  - gemfiles/Gemfile-rails.7.0.x
175
+ - gemfiles/Gemfile-rails.7.1.x
176
+ - jest.config.js
177
177
  - lib/install/application.js
178
178
  - lib/install/bin/shakapacker
179
179
  - lib/install/bin/shakapacker-dev-server
@@ -181,7 +181,6 @@ files:
181
181
  - lib/install/binstubs.rb
182
182
  - lib/install/config/shakapacker.yml
183
183
  - lib/install/config/webpack/webpack.config.js
184
- - lib/install/package.json
185
184
  - lib/install/template.rb
186
185
  - lib/shakapacker.rb
187
186
  - lib/shakapacker/base_strategy.rb
@@ -201,6 +200,7 @@ files:
201
200
  - lib/shakapacker/mtime_strategy.rb
202
201
  - lib/shakapacker/railtie.rb
203
202
  - lib/shakapacker/runner.rb
203
+ - lib/shakapacker/utils/manager.rb
204
204
  - lib/shakapacker/utils/misc.rb
205
205
  - lib/shakapacker/utils/version_syntax_converter.rb
206
206
  - lib/shakapacker/version.rb
@@ -211,7 +211,6 @@ files:
211
211
  - lib/tasks/shakapacker/check_binstubs.rake
212
212
  - lib/tasks/shakapacker/check_manager.rake
213
213
  - lib/tasks/shakapacker/check_node.rake
214
- - lib/tasks/shakapacker/check_yarn.rake
215
214
  - lib/tasks/shakapacker/clean.rake
216
215
  - lib/tasks/shakapacker/clobber.rake
217
216
  - lib/tasks/shakapacker/compile.rake
@@ -219,48 +218,11 @@ files:
219
218
  - lib/tasks/shakapacker/install.rake
220
219
  - lib/tasks/shakapacker/verify_config.rake
221
220
  - lib/tasks/shakapacker/verify_install.rake
222
- - lib/tasks/shakapacker/yarn_install.rake
223
- - lib/tasks/webpacker.rake
224
- - lib/tasks/webpacker/binstubs.rake
225
- - lib/tasks/webpacker/check_binstubs.rake
226
- - lib/tasks/webpacker/check_node.rake
227
- - lib/tasks/webpacker/check_yarn.rake
228
- - lib/tasks/webpacker/clean.rake
229
- - lib/tasks/webpacker/clobber.rake
230
- - lib/tasks/webpacker/compile.rake
231
- - lib/tasks/webpacker/info.rake
232
- - lib/tasks/webpacker/install.rake
233
- - lib/tasks/webpacker/verify_config.rake
234
- - lib/tasks/webpacker/verify_install.rake
235
- - lib/tasks/webpacker/yarn_install.rake
236
- - lib/webpacker.rb
237
- - lib/webpacker/dev_server_runner.rb
238
- - lib/webpacker/webpack_runner.rb
239
221
  - package.json
240
- - package/__tests__/config-bc.js
241
- - package/__tests__/config.js
242
- - package/__tests__/dev_server-bc.js
243
- - package/__tests__/dev_server.js
244
- - package/__tests__/development-bc.js
245
- - package/__tests__/development.js
246
- - package/__tests__/env-bc.js
247
- - package/__tests__/env.js
248
- - package/__tests__/index-bc.js
249
- - package/__tests__/index.js
250
- - package/__tests__/production-bc.js
251
- - package/__tests__/production.js
252
- - package/__tests__/staging-bc.js
253
- - package/__tests__/staging.js
254
- - package/__tests__/test-bc.js
255
- - package/__tests__/test.js
256
222
  - package/babel/preset.js
257
223
  - package/config.js
258
224
  - package/dev_server.js
259
225
  - package/env.js
260
- - package/environments/__tests__/base-bc.js
261
- - package/environments/__tests__/base.js
262
- - package/environments/__tests__/development.js
263
- - package/environments/__tests__/production.js
264
226
  - package/environments/base.js
265
227
  - package/environments/development.js
266
228
  - package/environments/production.js
@@ -268,13 +230,6 @@ files:
268
230
  - package/esbuild/index.js
269
231
  - package/index.d.ts
270
232
  - package/index.js
271
- - package/rules/__tests__/__utils__/webpack.js
272
- - package/rules/__tests__/babel.js
273
- - package/rules/__tests__/esbuild.js
274
- - package/rules/__tests__/file.js
275
- - package/rules/__tests__/index.js
276
- - package/rules/__tests__/raw.js
277
- - package/rules/__tests__/swc.js
278
233
  - package/rules/babel.js
279
234
  - package/rules/coffee.js
280
235
  - package/rules/css.js
@@ -291,56 +246,14 @@ files:
291
246
  - package/swc/index.js
292
247
  - package/utils/configPath.js
293
248
  - package/utils/defaultConfigPath.js
294
- - package/utils/get_style_rule.js
249
+ - package/utils/getStyleRule.js
295
250
  - package/utils/helpers.js
296
251
  - package/utils/inliningCss.js
297
- - package/utils/snakeToCamelCase
252
+ - package/utils/snakeToCamelCase.js
298
253
  - package/webpackDevServerConfig.js
254
+ - prettier.config.js
299
255
  - rakelib/release.rake
300
256
  - shakapacker.gemspec
301
- - spec/backward_compatibility_specs/command_spec.rb
302
- - spec/backward_compatibility_specs/compiler_spec.rb
303
- - spec/backward_compatibility_specs/compiler_strategy_spec.rb
304
- - spec/backward_compatibility_specs/configuration_spec.rb
305
- - spec/backward_compatibility_specs/dev_server_runner_spec.rb
306
- - spec/backward_compatibility_specs/dev_server_spec.rb
307
- - spec/backward_compatibility_specs/digest_strategy_spec.rb
308
- - spec/backward_compatibility_specs/engine_rake_tasks_spec.rb
309
- - spec/backward_compatibility_specs/env_spec.rb
310
- - spec/backward_compatibility_specs/helper_spec.rb
311
- - spec/backward_compatibility_specs/instance_spec.rb
312
- - spec/backward_compatibility_specs/manifest_spec.rb
313
- - spec/backward_compatibility_specs/mtime_strategy_spec.rb
314
- - spec/backward_compatibility_specs/rake_tasks_spec.rb
315
- - spec/backward_compatibility_specs/spec_helper_initializer.rb
316
- - spec/backward_compatibility_specs/webpack_runner_spec.rb
317
- - spec/backward_compatibility_specs/webpacker_spec.rb
318
- - spec/backward_compatibility_specs/webpacker_test_app/.gitignore
319
- - spec/backward_compatibility_specs/webpacker_test_app/Rakefile
320
- - spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/application.js
321
- - spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/generated/something.js
322
- - spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.css
323
- - spec/backward_compatibility_specs/webpacker_test_app/app/packs/entrypoints/multi_entry.js
324
- - spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker
325
- - spec/backward_compatibility_specs/webpacker_test_app/bin/webpacker-dev-server
326
- - spec/backward_compatibility_specs/webpacker_test_app/config.ru
327
- - spec/backward_compatibility_specs/webpacker_test_app/config/application.rb
328
- - spec/backward_compatibility_specs/webpacker_test_app/config/environment.rb
329
- - spec/backward_compatibility_specs/webpacker_test_app/config/initializers/inspect_autoload_paths.rb
330
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpack/webpack.config.js
331
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker.yml
332
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_css_extract_ignore_order_warnings.yml
333
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_defaults_fallback.yml
334
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_manifest_path.yml
335
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_nested_entries.yml
336
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_no_precompile.yml
337
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_other_location.yml
338
- - spec/backward_compatibility_specs/webpacker_test_app/config/webpacker_public_root.yml
339
- - spec/backward_compatibility_specs/webpacker_test_app/package.json
340
- - spec/backward_compatibility_specs/webpacker_test_app/public/packs/manifest.json
341
- - spec/backward_compatibility_specs/webpacker_test_app/some.config.js
342
- - spec/backward_compatibility_specs/webpacker_test_app/tmp/shakapacker/last-compilation-digest-production
343
- - spec/backward_compatibility_specs/webpacker_test_app/yarn.lock
344
257
  - spec/dummy/.browserslistrc
345
258
  - spec/dummy/.gitignore
346
259
  - spec/dummy/.prettierrc.yaml
@@ -557,16 +470,35 @@ files:
557
470
  - spec/shakapacker/test_app/public/packs/manifest.json
558
471
  - spec/shakapacker/test_app/some.config.js
559
472
  - spec/shakapacker/test_app/yarn.lock
473
+ - spec/shakapacker/utils_manager_spec.rb
560
474
  - spec/shakapacker/version_checker_spec.rb
561
475
  - spec/shakapacker/webpack_runner_spec.rb
562
476
  - spec/spec_helper.rb
563
477
  - spec/support/package_json_helpers.rb
478
+ - test/helpers.js
479
+ - test/package/config.test.js
480
+ - test/package/dev_server.test.js
481
+ - test/package/development.test.js
482
+ - test/package/env.test.js
483
+ - test/package/environments/base.test.js
484
+ - test/package/environments/development.test.js
485
+ - test/package/environments/production.test.js
486
+ - test/package/index.test.js
487
+ - test/package/production.test.js
488
+ - test/package/rules/babel.test.js
489
+ - test/package/rules/esbuild.test.js
490
+ - test/package/rules/file.test.js
491
+ - test/package/rules/index.test.js
492
+ - test/package/rules/raw.test.js
493
+ - test/package/rules/swc.test.js
494
+ - test/package/staging.test.js
495
+ - test/package/test.test.js
564
496
  - yarn.lock
565
497
  homepage: https://github.com/shakacode/shakapacker
566
498
  licenses:
567
499
  - MIT
568
500
  metadata:
569
- source_code_uri: https://github.com/shakacode/shakapacker/tree/v7.3.0.beta.1
501
+ source_code_uri: https://github.com/shakacode/shakapacker/tree/v8.0.0-rc.1
570
502
  post_install_message:
571
503
  rdoc_options: []
572
504
  require_paths:
@@ -575,7 +507,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
575
507
  requirements:
576
508
  - - ">="
577
509
  - !ruby/object:Gem::Version
578
- version: 2.6.0
510
+ version: 2.7.0
579
511
  required_rubygems_version: !ruby/object:Gem::Requirement
580
512
  requirements:
581
513
  - - ">"
@@ -586,4 +518,22 @@ rubygems_version: 3.4.12
586
518
  signing_key:
587
519
  specification_version: 4
588
520
  summary: Use webpack to manage app-like JavaScript modules in Rails
589
- test_files: []
521
+ test_files:
522
+ - test/helpers.js
523
+ - test/package/config.test.js
524
+ - test/package/dev_server.test.js
525
+ - test/package/development.test.js
526
+ - test/package/env.test.js
527
+ - test/package/environments/base.test.js
528
+ - test/package/environments/development.test.js
529
+ - test/package/environments/production.test.js
530
+ - test/package/index.test.js
531
+ - test/package/production.test.js
532
+ - test/package/rules/babel.test.js
533
+ - test/package/rules/esbuild.test.js
534
+ - test/package/rules/file.test.js
535
+ - test/package/rules/index.test.js
536
+ - test/package/rules/raw.test.js
537
+ - test/package/rules/swc.test.js
538
+ - test/package/staging.test.js
539
+ - test/package/test.test.js
@@ -1,33 +0,0 @@
1
- name: Jest specs
2
-
3
- on:
4
- push:
5
- branches:
6
- - 'master'
7
- pull_request:
8
-
9
- jobs:
10
- jest:
11
- name: Jest specs
12
- strategy:
13
- matrix:
14
- os: [ubuntu-latest]
15
- node: [14.x, 16.x, 18.x]
16
-
17
- runs-on: ${{ matrix.os }}
18
-
19
- steps:
20
- - uses: actions/checkout@v4
21
- with:
22
- persist-credentials: false
23
- - name: Use Node.js ${{ matrix.node }}
24
- uses: actions/setup-node@v3
25
- with:
26
- node-version: ${{ matrix.node }}
27
- cache: yarn
28
-
29
- - name: Install dependencies
30
- run: yarn --frozen-lockfile --non-interactive --prefer-offline
31
-
32
- - name: Jest Specs
33
- run: yarn test
@@ -1,33 +0,0 @@
1
- name: JS lint
2
-
3
- on:
4
- push:
5
- branches:
6
- - 'master'
7
- pull_request:
8
-
9
- jobs:
10
- lint:
11
- name: JS Lint
12
- strategy:
13
- matrix:
14
- os: [ubuntu-latest]
15
- node: [14.x, 16.x, 18.x]
16
-
17
- runs-on: ${{ matrix.os }}
18
-
19
- steps:
20
- - uses: actions/checkout@v4
21
- with:
22
- persist-credentials: false
23
- - name: Use Node.js ${{ matrix.node }}
24
- uses: actions/setup-node@v3
25
- with:
26
- node-version: ${{ matrix.node }}
27
- cache: yarn
28
-
29
- - name: Install dependencies
30
- run: yarn --frozen-lockfile --non-interactive --prefer-offline
31
-
32
- - name: Lint
33
- run: yarn lint
@@ -1,28 +0,0 @@
1
- name: Rubocop
2
-
3
- on:
4
- push:
5
- branches:
6
- - 'master'
7
- pull_request:
8
-
9
- jobs:
10
- rubocop:
11
- name: Rubocop
12
- runs-on: ${{ matrix.os }}
13
- strategy:
14
- matrix:
15
- os: [ubuntu-latest]
16
- ruby: ['2.7', '3.0']
17
-
18
- steps:
19
- - uses: actions/checkout@v4
20
- with:
21
- persist-credentials: false
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: ${{ matrix.ruby }}
25
- bundler-cache: true
26
-
27
- - name: Ruby rubocop
28
- run: bundle exec rubocop
@@ -1,51 +0,0 @@
1
- name: Ruby specs - Backward compatibility
2
-
3
- on:
4
- push:
5
- branches:
6
- - 'master'
7
- pull_request:
8
-
9
- jobs:
10
- test:
11
- name: Ruby specs - Backward compatibility
12
- runs-on: ${{ matrix.os }}
13
- strategy:
14
- matrix:
15
- os: [ubuntu-latest]
16
- ruby: ['2.6', '2.7', '3.0']
17
- gemfile:
18
- - gemfiles/Gemfile-rails.6.0.x
19
- - gemfiles/Gemfile-rails.6.1.x
20
- - gemfiles/Gemfile-rails.7.0.x
21
- # Uncomment the following line only to ensure compatibility with the
22
- # upcoming Rails versions, maybe before a release.
23
- #- gemfiles/Gemfile-rails-edge
24
- exclude:
25
- - ruby: 2.6
26
- os: ubuntu-latest
27
- gemfile: gemfiles/Gemfile-rails.7.0.x
28
- - ruby: 2.6
29
- os: ubuntu-latest
30
- gemfile: gemfiles/Gemfile-rails-edge
31
-
32
- env:
33
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
34
-
35
- steps:
36
- - uses: actions/checkout@v4
37
- with:
38
- persist-credentials: false
39
- - uses: ruby/setup-ruby@v1
40
- with:
41
- ruby-version: ${{ matrix.ruby }}
42
- bundler-cache: true
43
-
44
- - name: Ruby specs - Backward compatibility
45
- run: bundle exec rake run_spec:gem_bc
46
- env:
47
- SHAKAPACKER_USE_PACKAGE_JSON_GEM: "false"
48
- - name: Ruby specs - Backward compatibility
49
- run: bundle exec rake run_spec:gem_bc
50
- env:
51
- SHAKAPACKER_USE_PACKAGE_JSON_GEM: "true"
@@ -1,15 +0,0 @@
1
- {
2
- "name": "app",
3
- "private": true,
4
- "dependencies": {
5
- },
6
- "version": "0.1.0",
7
- "babel": {
8
- "presets": [
9
- "./node_modules/shakapacker/package/babel/preset.js"
10
- ]
11
- },
12
- "browserslist": [
13
- "defaults"
14
- ]
15
- }
@@ -1,34 +0,0 @@
1
- namespace :shakapacker do
2
- desc "Verifies if Yarn is installed"
3
- task :check_yarn do
4
- require "semantic_range"
5
-
6
- begin
7
- which_command = Gem.win_platform? ? "where" : "which"
8
- raise Errno::ENOENT if `#{which_command} yarn`.strip.empty?
9
-
10
- yarn_version = `yarn --version`.strip
11
- raise Errno::ENOENT if yarn_version.blank?
12
-
13
- pkg_path = Pathname.new("#{__dir__}/../../../package.json").realpath
14
- yarn_range = JSON.parse(pkg_path.read)["engines"]["yarn"]
15
- is_valid = SemanticRange.satisfies?(yarn_version, yarn_range) rescue false
16
- is_unsupported = SemanticRange.satisfies?(yarn_version, ">=4.0.0") rescue false
17
-
18
- unless is_valid
19
- $stderr.puts "Shakapacker requires Yarn \"#{yarn_range}\" and you are using #{yarn_version}"
20
- if is_unsupported
21
- $stderr.puts "This version of Shakapacker does not support Yarn #{yarn_version}. Please downgrade to a supported version of Yarn https://yarnpkg.com/lang/en/docs/install/"
22
- else
23
- $stderr.puts "Please upgrade Yarn https://yarnpkg.com/lang/en/docs/install/"
24
- end
25
- $stderr.puts "Exiting!"
26
- exit!
27
- end
28
- rescue Errno::ENOENT
29
- $stderr.puts "Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/"
30
- $stderr.puts "Exiting!"
31
- exit!
32
- end
33
- end
34
- end
@@ -1,24 +0,0 @@
1
- namespace :shakapacker do
2
- desc "Support for older Rails versions. Install all JavaScript dependencies as specified via Yarn"
3
- task :yarn_install do
4
- warn <<~MSG.strip
5
- Shakapacker - Automatic installation of yarn packages is deprecated
6
- Automatic installation of yarn packages when assets are precompiled is deprecated and will be removed in Shakapacker v7.
7
- Please ensure you are installing yarn packages explicitly before the asset compilation.
8
- MSG
9
-
10
- valid_node_envs = %w[test development production]
11
- node_env = ENV.fetch("NODE_ENV") do
12
- valid_node_envs.include?(Rails.env) ? Rails.env : "production"
13
- end
14
- Dir.chdir(Rails.root) do
15
- yarn_flags =
16
- if `yarn --version`.start_with?("1")
17
- "--no-progress --frozen-lockfile"
18
- else
19
- "--immutable"
20
- end
21
- system({ "NODE_ENV" => node_env }, "yarn install #{yarn_flags}")
22
- end
23
- end
24
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Installs Shakapacker binstubs in this application"
3
- task :binstubs do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:binstubs"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Verifies that bin/shakapacker is present"
3
- task :check_binstubs do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:check_binstubs"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Verifies if Node.js is installed"
3
- task :check_node do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:check_node"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Verifies if Yarn is installed"
3
- task :check_yarn do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:check_manager"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Remove old compiled bundles"
3
- task :clean, [:keep, :age] do |task, args|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:clean"].invoke(args.keep, args.age)
8
- end
9
- end
@@ -1,11 +0,0 @@
1
- require "shakapacker/configuration"
2
-
3
- namespace :webpacker do
4
- desc "DEPRECATED - Remove the webpack compiled output directory"
5
- task :clobber do |task|
6
- Shakapacker.puts_rake_deprecation_message(task.name)
7
-
8
- prefix = task.name.split(/#|webpacker:/).first
9
- Rake::Task["#{prefix}shakapacker:clobber"].invoke
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Compile JavaScript packs using webpack for production with digests"
3
- task :compile do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:compile"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Provide information on Shakapacker's environment"
3
- task :info do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:info"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Install Shakapacker in this application"
3
- task :install do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:install"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Verifies if the Shakapacker config is present"
3
- task :verify_config do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:verify_config"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Verifies if Shakapacker is installed"
3
- task :verify_install do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:verify_install"].invoke
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- namespace :webpacker do
2
- desc "DEPRECATED - Support for older Rails versions. Install all JavaScript dependencies as specified via Yarn"
3
- task :yarn_install do |task|
4
- Shakapacker.puts_rake_deprecation_message(task.name)
5
-
6
- prefix = task.name.split(/#|webpacker:/).first
7
- Rake::Task["#{prefix}shakapacker:yarn_install"].invoke
8
- end
9
- end
@@ -1,20 +0,0 @@
1
- tasks = {
2
- "webpacker:info" => "DEPRECATED - Provides information on Shakapacker's environment",
3
- "webpacker:install" => "DEPRECATED - Installs and setup webpack with Yarn",
4
- "webpacker:compile" => "DEPRECATED - Compiles webpack bundles based on environment",
5
- "webpacker:clean" => "DEPRECATED - Remove old compiled bundles",
6
- "webpacker:clobber" => "DEPRECATED - Removes the webpack compiled output directory",
7
- "webpacker:check_node" => "DEPRECATED - Verifies if Node.js is installed",
8
- "webpacker:check_yarn" => "DEPRECATED - Verifies if Yarn is installed",
9
- "webpacker:check_binstubs" => "DEPRECATED - Verifies that bin/shakapacker is present",
10
- "webpacker:binstubs" => "DEPRECATED - Installs Shakapacker binstubs in this application",
11
- "webpacker:verify_install" => "DEPRECATED - Verifies if Shakapacker is installed",
12
- }.freeze
13
-
14
- desc "DEPRECATED - Lists all available tasks in Webpacker"
15
- task :webpacker do |task|
16
- puts "DEPRECATED - Available Webpacker tasks are:"
17
- tasks.each { |task, message| puts task.ljust(30) + message }
18
-
19
- Shakapacker.puts_rake_deprecation_message(task.name)
20
- end
@@ -1,9 +0,0 @@
1
- # This file exists for backward compatibility
2
- require "shakapacker/dev_server_runner"
3
-
4
- Shakapacker.puts_deprecation_message(
5
- Shakapacker.short_deprecation_message(
6
- "bin/webpacker-dev-server",
7
- "bin/shakapacker-dev-server"
8
- )
9
- )
@@ -1,9 +0,0 @@
1
- # This file exists for backward compatibility
2
- require "shakapacker/webpack_runner"
3
-
4
- Shakapacker.puts_deprecation_message(
5
- Shakapacker.short_deprecation_message(
6
- "bin/webpacker",
7
- "bin/shakapacker"
8
- )
9
- )
data/lib/webpacker.rb DELETED
@@ -1,4 +0,0 @@
1
- # This file exists for backward compatibility
2
- require "shakapacker"
3
-
4
- Shakapacker.puts_deprecation_message(Shakapacker::DEPRECATION_MESSAGE)