shakapacker 6.5.5 → 6.5.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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +11 -7
- data/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
- data/.github/workflows/ruby.yml +3 -1
- data/.gitignore +3 -3
- data/.rspec +1 -0
- data/CHANGELOG.md +18 -2
- data/CONTRIBUTING.md +11 -1
- data/Gemfile.development_dependencies +3 -1
- data/README.md +41 -8
- data/Rakefile +4 -5
- data/gemfiles/Gemfile-rails-edge +1 -1
- data/gemfiles/Gemfile-rails.5.2.x +1 -1
- data/gemfiles/Gemfile-rails.6.0.x +1 -1
- data/gemfiles/Gemfile-rails.6.1.x +1 -1
- data/gemfiles/Gemfile-rails.7.0.x +1 -1
- data/lib/install/template.rb +21 -16
- data/lib/tasks/webpacker/compile.rake +5 -10
- data/lib/webpacker/helper.rb +20 -9
- data/lib/webpacker/version.rb +1 -1
- data/package/rules/__tests__/__utils__/webpack.js +50 -0
- data/package/rules/__tests__/babel.js +63 -0
- data/package/rules/__tests__/esbuild.js +64 -0
- data/package/rules/__tests__/index.js +0 -4
- data/package/rules/__tests__/swc.js +64 -0
- data/package/rules/babel.js +3 -14
- data/package/rules/esbuild.js +2 -13
- data/package/rules/jscommon.js +26 -0
- data/package/rules/swc.js +2 -13
- data/package/utils/helpers.js +1 -1
- data/package.json +8 -2
- data/spec/command_spec.rb +114 -0
- data/spec/compiler_spec.rb +57 -0
- data/spec/compiler_strategy_spec.rb +20 -0
- data/spec/configuration_spec.rb +281 -0
- data/{test/dev_server_runner_test.rb → spec/dev_server_runner_spec.rb} +30 -40
- data/spec/dev_server_spec.rb +45 -0
- data/spec/digest_strategy_spec.rb +33 -0
- data/{test/engine_rake_tasks_test.rb → spec/engine_rake_tasks_spec.rb} +17 -9
- data/spec/env_spec.rb +21 -0
- data/{test → spec}/fixtures/beta_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/beta_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/beta_package.json +0 -0
- data/{test → spec}/fixtures/beta_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/beta_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/git_url_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/git_url_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/git_url_package.json +0 -0
- data/{test → spec}/fixtures/git_url_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/git_url_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/github_url_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/github_url_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/github_url_package.json +0 -0
- data/{test → spec}/fixtures/github_url_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/github_url_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/relative_path_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/relative_path_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/relative_path_package.json +0 -0
- data/{test → spec}/fixtures/relative_path_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/relative_path_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/semver_caret_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/semver_caret_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/semver_caret_package.json +0 -0
- data/{test → spec}/fixtures/semver_caret_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/semver_caret_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/semver_exact_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/semver_exact_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/semver_exact_package.json +0 -0
- data/{test → spec}/fixtures/semver_exact_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/semver_exact_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/semver_tilde_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/semver_tilde_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/semver_tilde_package.json +0 -0
- data/{test → spec}/fixtures/semver_tilde_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/semver_tilde_yarn.v2.lock +0 -0
- data/{test → spec}/fixtures/without_package-lock.v1.json +0 -0
- data/{test → spec}/fixtures/without_package-lock.v2.json +0 -0
- data/{test → spec}/fixtures/without_package.json +0 -0
- data/{test → spec}/fixtures/without_yarn.v1.lock +0 -0
- data/{test → spec}/fixtures/without_yarn.v2.lock +0 -0
- data/spec/helper_spec.rb +241 -0
- data/spec/manifest_spec.rb +98 -0
- data/{test → spec}/mounted_app/Rakefile +0 -0
- data/{test → spec}/mounted_app/test/dummy/Rakefile +0 -0
- data/{test → spec}/mounted_app/test/dummy/bin/rails +0 -0
- data/{test → spec}/mounted_app/test/dummy/bin/rake +0 -0
- data/{test → spec}/mounted_app/test/dummy/config/application.rb +0 -0
- data/{test → spec}/mounted_app/test/dummy/config/environment.rb +0 -0
- data/{test → spec}/mounted_app/test/dummy/config/webpacker.yml +0 -0
- data/{test → spec}/mounted_app/test/dummy/config.ru +0 -0
- data/{test → spec}/mounted_app/test/dummy/package.json +0 -0
- data/spec/mtime_strategy_spec.rb +53 -0
- data/spec/rake_tasks_spec.rb +32 -0
- data/spec/spec_helper.rb +123 -0
- data/{test → spec}/test_app/Rakefile +0 -0
- data/{test → spec}/test_app/app/packs/entrypoints/application.js +0 -0
- data/{test → spec}/test_app/app/packs/entrypoints/generated/something.js +0 -0
- data/{test → spec}/test_app/app/packs/entrypoints/multi_entry.css +0 -0
- data/{test → spec}/test_app/app/packs/entrypoints/multi_entry.js +0 -0
- data/{test → spec}/test_app/bin/webpacker +0 -0
- data/{test → spec}/test_app/bin/webpacker-dev-server +0 -0
- data/{test → spec}/test_app/config/application.rb +0 -0
- data/{test → spec}/test_app/config/environment.rb +0 -0
- data/{test → spec}/test_app/config/initializers/inspect_autoload_paths.rb +0 -0
- data/{test → spec}/test_app/config/webpack/webpack.config.js +0 -0
- data/{test → spec}/test_app/config/webpacker.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_css_extract_ignore_order_warnings.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_defaults_fallback.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_manifest_path.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_nested_entries.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_no_precompile.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_other_location.yml +0 -0
- data/{test → spec}/test_app/config/webpacker_public_root.yml +0 -0
- data/{test → spec}/test_app/config.ru +0 -0
- data/{test → spec}/test_app/package.json +0 -0
- data/{test → spec}/test_app/public/packs/manifest.json +8 -0
- data/{test → spec}/test_app/some.config.js +0 -0
- data/{test → spec}/test_app/yarn.lock +0 -0
- data/spec/version_checker_spec.rb +950 -0
- data/{test/webpack_runner_test.rb → spec/webpack_runner_spec.rb} +12 -15
- data/spec/webpacker_spec.rb +39 -0
- data/yarn.lock +846 -844
- metadata +102 -187
- data/.github/ISSUE_TEMPLATE/feature-request.md +0 -18
- data/lib/tasks/yarn.rake +0 -44
- data/test/command_test.rb +0 -109
- data/test/compiler_strategy_test.rb +0 -27
- data/test/compiler_test.rb +0 -60
- data/test/configuration_test.rb +0 -186
- data/test/dev_server_test.rb +0 -47
- data/test/digest_strategy_test.rb +0 -33
- data/test/env_test.rb +0 -23
- data/test/helper_test.rb +0 -248
- data/test/manifest_test.rb +0 -89
- data/test/mtime_strategy_test.rb +0 -42
- data/test/rake_tasks_test.rb +0 -37
- data/test/test_helper.rb +0 -33
- data/test/version_checker_test.rb +0 -826
- data/test/webpacker_test.rb +0 -49
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: 6.5.
|
|
4
|
+
version: 6.5.6
|
|
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:
|
|
13
|
+
date: 2023-02-12 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activesupport
|
|
@@ -122,13 +122,14 @@ files:
|
|
|
122
122
|
- ".eslintignore"
|
|
123
123
|
- ".eslintrc.js"
|
|
124
124
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
125
|
-
- ".github/ISSUE_TEMPLATE/
|
|
125
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
126
126
|
- ".github/workflows/jest.yml"
|
|
127
127
|
- ".github/workflows/js-lint.yml"
|
|
128
128
|
- ".github/workflows/rubocop.yml"
|
|
129
129
|
- ".github/workflows/ruby.yml"
|
|
130
130
|
- ".gitignore"
|
|
131
131
|
- ".node-version"
|
|
132
|
+
- ".rspec"
|
|
132
133
|
- ".rubocop.yml"
|
|
133
134
|
- CHANGELOG.md
|
|
134
135
|
- CONTRIBUTING.md
|
|
@@ -179,7 +180,6 @@ files:
|
|
|
179
180
|
- lib/tasks/webpacker/verify_config.rake
|
|
180
181
|
- lib/tasks/webpacker/verify_install.rake
|
|
181
182
|
- lib/tasks/webpacker/yarn_install.rake
|
|
182
|
-
- lib/tasks/yarn.rake
|
|
183
183
|
- lib/webpacker.rb
|
|
184
184
|
- lib/webpacker/base_strategy.rb
|
|
185
185
|
- lib/webpacker/commands.rb
|
|
@@ -222,9 +222,13 @@ files:
|
|
|
222
222
|
- package/esbuild/index.js
|
|
223
223
|
- package/index.js
|
|
224
224
|
- package/inliningCss.js
|
|
225
|
+
- package/rules/__tests__/__utils__/webpack.js
|
|
226
|
+
- package/rules/__tests__/babel.js
|
|
227
|
+
- package/rules/__tests__/esbuild.js
|
|
225
228
|
- package/rules/__tests__/file.js
|
|
226
229
|
- package/rules/__tests__/index.js
|
|
227
230
|
- package/rules/__tests__/raw.js
|
|
231
|
+
- package/rules/__tests__/swc.js
|
|
228
232
|
- package/rules/babel.js
|
|
229
233
|
- package/rules/coffee.js
|
|
230
234
|
- package/rules/css.js
|
|
@@ -232,6 +236,7 @@ files:
|
|
|
232
236
|
- package/rules/esbuild.js
|
|
233
237
|
- package/rules/file.js
|
|
234
238
|
- package/rules/index.js
|
|
239
|
+
- package/rules/jscommon.js
|
|
235
240
|
- package/rules/less.js
|
|
236
241
|
- package/rules/raw.js
|
|
237
242
|
- package/rules/sass.js
|
|
@@ -241,103 +246,103 @@ files:
|
|
|
241
246
|
- package/utils/get_style_rule.js
|
|
242
247
|
- package/utils/helpers.js
|
|
243
248
|
- rakelib/release.rake
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
249
|
+
- spec/command_spec.rb
|
|
250
|
+
- spec/compiler_spec.rb
|
|
251
|
+
- spec/compiler_strategy_spec.rb
|
|
252
|
+
- spec/configuration_spec.rb
|
|
253
|
+
- spec/dev_server_runner_spec.rb
|
|
254
|
+
- spec/dev_server_spec.rb
|
|
255
|
+
- spec/digest_strategy_spec.rb
|
|
256
|
+
- spec/engine_rake_tasks_spec.rb
|
|
257
|
+
- spec/env_spec.rb
|
|
258
|
+
- spec/fixtures/beta_package-lock.v1.json
|
|
259
|
+
- spec/fixtures/beta_package-lock.v2.json
|
|
260
|
+
- spec/fixtures/beta_package.json
|
|
261
|
+
- spec/fixtures/beta_yarn.v1.lock
|
|
262
|
+
- spec/fixtures/beta_yarn.v2.lock
|
|
263
|
+
- spec/fixtures/git_url_package-lock.v1.json
|
|
264
|
+
- spec/fixtures/git_url_package-lock.v2.json
|
|
265
|
+
- spec/fixtures/git_url_package.json
|
|
266
|
+
- spec/fixtures/git_url_yarn.v1.lock
|
|
267
|
+
- spec/fixtures/git_url_yarn.v2.lock
|
|
268
|
+
- spec/fixtures/github_url_package-lock.v1.json
|
|
269
|
+
- spec/fixtures/github_url_package-lock.v2.json
|
|
270
|
+
- spec/fixtures/github_url_package.json
|
|
271
|
+
- spec/fixtures/github_url_yarn.v1.lock
|
|
272
|
+
- spec/fixtures/github_url_yarn.v2.lock
|
|
273
|
+
- spec/fixtures/relative_path_package-lock.v1.json
|
|
274
|
+
- spec/fixtures/relative_path_package-lock.v2.json
|
|
275
|
+
- spec/fixtures/relative_path_package.json
|
|
276
|
+
- spec/fixtures/relative_path_yarn.v1.lock
|
|
277
|
+
- spec/fixtures/relative_path_yarn.v2.lock
|
|
278
|
+
- spec/fixtures/semver_caret_package-lock.v1.json
|
|
279
|
+
- spec/fixtures/semver_caret_package-lock.v2.json
|
|
280
|
+
- spec/fixtures/semver_caret_package.json
|
|
281
|
+
- spec/fixtures/semver_caret_yarn.v1.lock
|
|
282
|
+
- spec/fixtures/semver_caret_yarn.v2.lock
|
|
283
|
+
- spec/fixtures/semver_exact_package-lock.v1.json
|
|
284
|
+
- spec/fixtures/semver_exact_package-lock.v2.json
|
|
285
|
+
- spec/fixtures/semver_exact_package.json
|
|
286
|
+
- spec/fixtures/semver_exact_yarn.v1.lock
|
|
287
|
+
- spec/fixtures/semver_exact_yarn.v2.lock
|
|
288
|
+
- spec/fixtures/semver_tilde_package-lock.v1.json
|
|
289
|
+
- spec/fixtures/semver_tilde_package-lock.v2.json
|
|
290
|
+
- spec/fixtures/semver_tilde_package.json
|
|
291
|
+
- spec/fixtures/semver_tilde_yarn.v1.lock
|
|
292
|
+
- spec/fixtures/semver_tilde_yarn.v2.lock
|
|
293
|
+
- spec/fixtures/without_package-lock.v1.json
|
|
294
|
+
- spec/fixtures/without_package-lock.v2.json
|
|
295
|
+
- spec/fixtures/without_package.json
|
|
296
|
+
- spec/fixtures/without_yarn.v1.lock
|
|
297
|
+
- spec/fixtures/without_yarn.v2.lock
|
|
298
|
+
- spec/helper_spec.rb
|
|
299
|
+
- spec/manifest_spec.rb
|
|
300
|
+
- spec/mounted_app/Rakefile
|
|
301
|
+
- spec/mounted_app/test/dummy/Rakefile
|
|
302
|
+
- spec/mounted_app/test/dummy/bin/rails
|
|
303
|
+
- spec/mounted_app/test/dummy/bin/rake
|
|
304
|
+
- spec/mounted_app/test/dummy/config.ru
|
|
305
|
+
- spec/mounted_app/test/dummy/config/application.rb
|
|
306
|
+
- spec/mounted_app/test/dummy/config/environment.rb
|
|
307
|
+
- spec/mounted_app/test/dummy/config/webpacker.yml
|
|
308
|
+
- spec/mounted_app/test/dummy/package.json
|
|
309
|
+
- spec/mtime_strategy_spec.rb
|
|
310
|
+
- spec/rake_tasks_spec.rb
|
|
311
|
+
- spec/spec_helper.rb
|
|
312
|
+
- spec/test_app/Rakefile
|
|
313
|
+
- spec/test_app/app/packs/entrypoints/application.js
|
|
314
|
+
- spec/test_app/app/packs/entrypoints/generated/something.js
|
|
315
|
+
- spec/test_app/app/packs/entrypoints/multi_entry.css
|
|
316
|
+
- spec/test_app/app/packs/entrypoints/multi_entry.js
|
|
317
|
+
- spec/test_app/bin/webpacker
|
|
318
|
+
- spec/test_app/bin/webpacker-dev-server
|
|
319
|
+
- spec/test_app/config.ru
|
|
320
|
+
- spec/test_app/config/application.rb
|
|
321
|
+
- spec/test_app/config/environment.rb
|
|
322
|
+
- spec/test_app/config/initializers/inspect_autoload_paths.rb
|
|
323
|
+
- spec/test_app/config/webpack/webpack.config.js
|
|
324
|
+
- spec/test_app/config/webpacker.yml
|
|
325
|
+
- spec/test_app/config/webpacker_css_extract_ignore_order_warnings.yml
|
|
326
|
+
- spec/test_app/config/webpacker_defaults_fallback.yml
|
|
327
|
+
- spec/test_app/config/webpacker_manifest_path.yml
|
|
328
|
+
- spec/test_app/config/webpacker_nested_entries.yml
|
|
329
|
+
- spec/test_app/config/webpacker_no_precompile.yml
|
|
330
|
+
- spec/test_app/config/webpacker_other_location.yml
|
|
331
|
+
- spec/test_app/config/webpacker_public_root.yml
|
|
332
|
+
- spec/test_app/package.json
|
|
333
|
+
- spec/test_app/public/packs/manifest.json
|
|
334
|
+
- spec/test_app/some.config.js
|
|
335
|
+
- spec/test_app/yarn.lock
|
|
336
|
+
- spec/version_checker_spec.rb
|
|
337
|
+
- spec/webpack_runner_spec.rb
|
|
338
|
+
- spec/webpacker_spec.rb
|
|
334
339
|
- webpacker.gemspec
|
|
335
340
|
- yarn.lock
|
|
336
341
|
homepage: https://github.com/shakacode/shakapacker
|
|
337
342
|
licenses:
|
|
338
343
|
- MIT
|
|
339
344
|
metadata:
|
|
340
|
-
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.5.
|
|
345
|
+
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.5.6
|
|
341
346
|
post_install_message:
|
|
342
347
|
rdoc_options: []
|
|
343
348
|
require_paths:
|
|
@@ -353,98 +358,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
353
358
|
- !ruby/object:Gem::Version
|
|
354
359
|
version: '0'
|
|
355
360
|
requirements: []
|
|
356
|
-
rubygems_version: 3.
|
|
361
|
+
rubygems_version: 3.4.6
|
|
357
362
|
signing_key:
|
|
358
363
|
specification_version: 4
|
|
359
364
|
summary: Use webpack to manage app-like JavaScript modules in Rails
|
|
360
|
-
test_files:
|
|
361
|
-
- test/command_test.rb
|
|
362
|
-
- test/compiler_strategy_test.rb
|
|
363
|
-
- test/compiler_test.rb
|
|
364
|
-
- test/configuration_test.rb
|
|
365
|
-
- test/dev_server_runner_test.rb
|
|
366
|
-
- test/dev_server_test.rb
|
|
367
|
-
- test/digest_strategy_test.rb
|
|
368
|
-
- test/engine_rake_tasks_test.rb
|
|
369
|
-
- test/env_test.rb
|
|
370
|
-
- test/fixtures/beta_package-lock.v1.json
|
|
371
|
-
- test/fixtures/beta_package-lock.v2.json
|
|
372
|
-
- test/fixtures/beta_package.json
|
|
373
|
-
- test/fixtures/beta_yarn.v1.lock
|
|
374
|
-
- test/fixtures/beta_yarn.v2.lock
|
|
375
|
-
- test/fixtures/git_url_package-lock.v1.json
|
|
376
|
-
- test/fixtures/git_url_package-lock.v2.json
|
|
377
|
-
- test/fixtures/git_url_package.json
|
|
378
|
-
- test/fixtures/git_url_yarn.v1.lock
|
|
379
|
-
- test/fixtures/git_url_yarn.v2.lock
|
|
380
|
-
- test/fixtures/github_url_package-lock.v1.json
|
|
381
|
-
- test/fixtures/github_url_package-lock.v2.json
|
|
382
|
-
- test/fixtures/github_url_package.json
|
|
383
|
-
- test/fixtures/github_url_yarn.v1.lock
|
|
384
|
-
- test/fixtures/github_url_yarn.v2.lock
|
|
385
|
-
- test/fixtures/relative_path_package-lock.v1.json
|
|
386
|
-
- test/fixtures/relative_path_package-lock.v2.json
|
|
387
|
-
- test/fixtures/relative_path_package.json
|
|
388
|
-
- test/fixtures/relative_path_yarn.v1.lock
|
|
389
|
-
- test/fixtures/relative_path_yarn.v2.lock
|
|
390
|
-
- test/fixtures/semver_caret_package-lock.v1.json
|
|
391
|
-
- test/fixtures/semver_caret_package-lock.v2.json
|
|
392
|
-
- test/fixtures/semver_caret_package.json
|
|
393
|
-
- test/fixtures/semver_caret_yarn.v1.lock
|
|
394
|
-
- test/fixtures/semver_caret_yarn.v2.lock
|
|
395
|
-
- test/fixtures/semver_exact_package-lock.v1.json
|
|
396
|
-
- test/fixtures/semver_exact_package-lock.v2.json
|
|
397
|
-
- test/fixtures/semver_exact_package.json
|
|
398
|
-
- test/fixtures/semver_exact_yarn.v1.lock
|
|
399
|
-
- test/fixtures/semver_exact_yarn.v2.lock
|
|
400
|
-
- test/fixtures/semver_tilde_package-lock.v1.json
|
|
401
|
-
- test/fixtures/semver_tilde_package-lock.v2.json
|
|
402
|
-
- test/fixtures/semver_tilde_package.json
|
|
403
|
-
- test/fixtures/semver_tilde_yarn.v1.lock
|
|
404
|
-
- test/fixtures/semver_tilde_yarn.v2.lock
|
|
405
|
-
- test/fixtures/without_package-lock.v1.json
|
|
406
|
-
- test/fixtures/without_package-lock.v2.json
|
|
407
|
-
- test/fixtures/without_package.json
|
|
408
|
-
- test/fixtures/without_yarn.v1.lock
|
|
409
|
-
- test/fixtures/without_yarn.v2.lock
|
|
410
|
-
- test/helper_test.rb
|
|
411
|
-
- test/manifest_test.rb
|
|
412
|
-
- test/mounted_app/Rakefile
|
|
413
|
-
- test/mounted_app/test/dummy/Rakefile
|
|
414
|
-
- test/mounted_app/test/dummy/bin/rails
|
|
415
|
-
- test/mounted_app/test/dummy/bin/rake
|
|
416
|
-
- test/mounted_app/test/dummy/config.ru
|
|
417
|
-
- test/mounted_app/test/dummy/config/application.rb
|
|
418
|
-
- test/mounted_app/test/dummy/config/environment.rb
|
|
419
|
-
- test/mounted_app/test/dummy/config/webpacker.yml
|
|
420
|
-
- test/mounted_app/test/dummy/package.json
|
|
421
|
-
- test/mtime_strategy_test.rb
|
|
422
|
-
- test/rake_tasks_test.rb
|
|
423
|
-
- test/test_app/Rakefile
|
|
424
|
-
- test/test_app/app/packs/entrypoints/application.js
|
|
425
|
-
- test/test_app/app/packs/entrypoints/generated/something.js
|
|
426
|
-
- test/test_app/app/packs/entrypoints/multi_entry.css
|
|
427
|
-
- test/test_app/app/packs/entrypoints/multi_entry.js
|
|
428
|
-
- test/test_app/bin/webpacker
|
|
429
|
-
- test/test_app/bin/webpacker-dev-server
|
|
430
|
-
- test/test_app/config.ru
|
|
431
|
-
- test/test_app/config/application.rb
|
|
432
|
-
- test/test_app/config/environment.rb
|
|
433
|
-
- test/test_app/config/initializers/inspect_autoload_paths.rb
|
|
434
|
-
- test/test_app/config/webpack/webpack.config.js
|
|
435
|
-
- test/test_app/config/webpacker.yml
|
|
436
|
-
- test/test_app/config/webpacker_css_extract_ignore_order_warnings.yml
|
|
437
|
-
- test/test_app/config/webpacker_defaults_fallback.yml
|
|
438
|
-
- test/test_app/config/webpacker_manifest_path.yml
|
|
439
|
-
- test/test_app/config/webpacker_nested_entries.yml
|
|
440
|
-
- test/test_app/config/webpacker_no_precompile.yml
|
|
441
|
-
- test/test_app/config/webpacker_other_location.yml
|
|
442
|
-
- test/test_app/config/webpacker_public_root.yml
|
|
443
|
-
- test/test_app/package.json
|
|
444
|
-
- test/test_app/public/packs/manifest.json
|
|
445
|
-
- test/test_app/some.config.js
|
|
446
|
-
- test/test_app/yarn.lock
|
|
447
|
-
- test/test_helper.rb
|
|
448
|
-
- test/version_checker_test.rb
|
|
449
|
-
- test/webpack_runner_test.rb
|
|
450
|
-
- test/webpacker_test.rb
|
|
365
|
+
test_files: []
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Create a request for new functionality
|
|
4
|
-
title: ''
|
|
5
|
-
labels: enhancement
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
A feature request describes a suggested improvement. If you have a debugging or troubleshooting question, please open a discussion on the [Discussions tab](https://github.com/shakacode/shakapacker/discussions).
|
|
11
|
-
|
|
12
|
-
Ruby version:
|
|
13
|
-
Rails version:
|
|
14
|
-
Shakapacker version:
|
|
15
|
-
|
|
16
|
-
Desired behavior:
|
|
17
|
-
|
|
18
|
-
Actual behavior:
|
data/lib/tasks/yarn.rake
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Duplicate of the yarn tasks still present in Rails until Webpacker <5 have been deprecated
|
|
4
|
-
|
|
5
|
-
namespace :yarn do
|
|
6
|
-
desc "Install all JavaScript dependencies as specified via Yarn"
|
|
7
|
-
task :install do
|
|
8
|
-
warn <<~MSG.strip
|
|
9
|
-
Shakapacker - Automatic installation of yarn packages is deprecated
|
|
10
|
-
Automatic installation of yarn packages when assets are precompiled is deprecated and will be removed in Shakapacker v7.
|
|
11
|
-
Please ensure you are installing yarn packages explicitly before the asset compilation.
|
|
12
|
-
MSG
|
|
13
|
-
|
|
14
|
-
begin
|
|
15
|
-
# Install only production deps when for not usual envs.
|
|
16
|
-
valid_node_envs = %w[test development production]
|
|
17
|
-
node_env = ENV.fetch("NODE_ENV") do
|
|
18
|
-
valid_node_envs.include?(Rails.env) ? Rails.env : "production"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
yarn_flags =
|
|
22
|
-
if `#{RbConfig.ruby} "#{Rails.root}/bin/yarn" --version`.start_with?("1")
|
|
23
|
-
"--no-progress --frozen-lockfile"
|
|
24
|
-
else
|
|
25
|
-
"--immutable"
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
system(
|
|
29
|
-
{ "NODE_ENV" => node_env },
|
|
30
|
-
"#{RbConfig.ruby} \"#{Rails.root}/bin/yarn\" install #{yarn_flags}",
|
|
31
|
-
exception: true
|
|
32
|
-
)
|
|
33
|
-
rescue Errno::ENOENT
|
|
34
|
-
$stderr.puts "bin/yarn was not found."
|
|
35
|
-
$stderr.puts "Please run `bundle exec rails app:update:bin` to create it."
|
|
36
|
-
exit 1
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
|
|
42
|
-
if Rake::Task.task_defined?("assets:precompile") && File.exist?(Rails.root.join("bin", "yarn"))
|
|
43
|
-
Rake::Task["assets:precompile"].enhance [ "yarn:install" ]
|
|
44
|
-
end
|
data/test/command_test.rb
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
require "test_helper"
|
|
2
|
-
|
|
3
|
-
class CommandTest < Minitest::Test
|
|
4
|
-
def test_compile_command_returns_success_status_when_stale
|
|
5
|
-
Webpacker.compiler.stub :stale?, true do
|
|
6
|
-
Webpacker.compiler.stub :run_webpack, true do
|
|
7
|
-
assert_equal true, Webpacker.commands.compile
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def test_compile_command_returns_success_status_when_fresh
|
|
13
|
-
Webpacker.compiler.stub :stale?, false do
|
|
14
|
-
Webpacker.compiler.stub :run_webpack, true do
|
|
15
|
-
assert_equal true, Webpacker.commands.compile
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def test_compile_command_returns_failure_status_when_stale
|
|
21
|
-
Webpacker.compiler.stub :stale?, true do
|
|
22
|
-
Webpacker.compiler.stub :run_webpack, false do
|
|
23
|
-
assert_equal false, Webpacker.commands.compile
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def test_clean_command_works_with_nested_hashes_and_without_any_compiled_files
|
|
29
|
-
File.stub :delete, true do
|
|
30
|
-
assert Webpacker.commands.clean
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
class ClearCommandVersioningTest < Minitest::Test
|
|
36
|
-
def setup
|
|
37
|
-
@now = Time.parse("2021-01-01 12:34:56 UTC")
|
|
38
|
-
# Test assets to be kept and deleted, path and mtime
|
|
39
|
-
@prev_files = {
|
|
40
|
-
# recent versions to be kept with Webpacker.commands.clean(count = 2)
|
|
41
|
-
"js/application-deadbeef.js" => @now - 4000,
|
|
42
|
-
"js/common-deadbeee.js" => @now - 4002,
|
|
43
|
-
"css/common-deadbeed.css" => @now - 4004,
|
|
44
|
-
"media/images/logo-deadbeeb.css" => @now - 4006,
|
|
45
|
-
"js/application-1eadbeef.js" => @now - 8000,
|
|
46
|
-
"js/common-1eadbeee.js" => @now - 8002,
|
|
47
|
-
"css/common-1eadbeed.css" => @now - 8004,
|
|
48
|
-
"media/images/logo-1eadbeeb.css" => @now - 8006,
|
|
49
|
-
# new files to be kept with Webpacker.commands.clean(age = 3600)
|
|
50
|
-
"js/brandnew-0001.js" => @now,
|
|
51
|
-
"js/brandnew-0002.js" => @now - 10,
|
|
52
|
-
"js/brandnew-0003.js" => @now - 20,
|
|
53
|
-
"js/brandnew-0004.js" => @now - 40,
|
|
54
|
-
}.transform_keys { |path| "#{Webpacker.config.public_output_path}/#{path}" }
|
|
55
|
-
@expired_files = {
|
|
56
|
-
# old files that are outside count = 2 or age = 3600 and to be deleted
|
|
57
|
-
"js/application-0eadbeef.js" => @now - 9000,
|
|
58
|
-
"js/common-0eadbeee.js" => @now - 9002,
|
|
59
|
-
"css/common-0eadbeed.css" => @now - 9004,
|
|
60
|
-
"js/brandnew-0005.js" => @now - 3640,
|
|
61
|
-
}.transform_keys { |path| "#{Webpacker.config.public_output_path}/#{path}" }
|
|
62
|
-
@all_files = @prev_files.merge(@expired_files)
|
|
63
|
-
@dir_glob_stub = Proc.new { |arg|
|
|
64
|
-
case arg
|
|
65
|
-
when "#{Webpacker.config.public_output_path}/**/*"
|
|
66
|
-
@all_files.keys
|
|
67
|
-
else
|
|
68
|
-
[]
|
|
69
|
-
end
|
|
70
|
-
}
|
|
71
|
-
@file_mtime_stub = Proc.new { |longpath|
|
|
72
|
-
@all_files[longpath]
|
|
73
|
-
}
|
|
74
|
-
@file_delete_mock = Minitest::Mock.new
|
|
75
|
-
@expired_files.keys.each do |longpath|
|
|
76
|
-
@file_delete_mock.expect(:delete, 1, [longpath])
|
|
77
|
-
end
|
|
78
|
-
@file_delete_stub = Proc.new { |longpath|
|
|
79
|
-
if @prev_files.has_key?(longpath)
|
|
80
|
-
flunk "#{longpath} should not be deleted"
|
|
81
|
-
else
|
|
82
|
-
@file_delete_mock.delete(longpath)
|
|
83
|
-
end
|
|
84
|
-
}
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
def time_and_files_stub(&proc)
|
|
88
|
-
Time.stub :now, @now do
|
|
89
|
-
Dir.stub :glob, @dir_glob_stub do
|
|
90
|
-
File.stub :directory?, false do
|
|
91
|
-
File.stub :file?, true do
|
|
92
|
-
File.stub :mtime, @file_mtime_stub do
|
|
93
|
-
File.stub :delete, @file_delete_stub do
|
|
94
|
-
yield proc
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
@file_delete_mock.verify
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
def test_clean_command_with_versioned_files
|
|
105
|
-
time_and_files_stub do
|
|
106
|
-
assert Webpacker.commands.clean
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require "test_helper"
|
|
2
|
-
|
|
3
|
-
class CompilerStrategyTest < Minitest::Test
|
|
4
|
-
def test_mtime_strategy_returned
|
|
5
|
-
Webpacker.config.stub :compiler_strategy, "mtime" do
|
|
6
|
-
assert_instance_of Webpacker::MtimeStrategy, Webpacker::CompilerStrategy.from_config
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def test_digest_strategy_returned
|
|
11
|
-
Webpacker.config.stub :compiler_strategy, "digest" do
|
|
12
|
-
assert_instance_of Webpacker::DigestStrategy, Webpacker::CompilerStrategy.from_config
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def test_raise_on_unknown_strategy
|
|
17
|
-
Webpacker.config.stub :compiler_strategy, "other" do
|
|
18
|
-
error = assert_raises do
|
|
19
|
-
Webpacker::CompilerStrategy.from_config
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
assert_equal \
|
|
23
|
-
"Unknown strategy 'other'. Available options are 'mtime' and 'digest'.",
|
|
24
|
-
error.message
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
data/test/compiler_test.rb
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
require "test_helper"
|
|
2
|
-
|
|
3
|
-
class CompilerTest < Minitest::Test
|
|
4
|
-
def test_custom_environment_variables
|
|
5
|
-
assert_nil Webpacker.compiler.send(:webpack_env)["FOO"]
|
|
6
|
-
Webpacker.compiler.env["FOO"] = "BAR"
|
|
7
|
-
assert Webpacker.compiler.send(:webpack_env)["FOO"] == "BAR"
|
|
8
|
-
ensure
|
|
9
|
-
Webpacker.compiler.env = {}
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def test_compile_true_when_fresh
|
|
13
|
-
mock = Minitest::Mock.new
|
|
14
|
-
mock.expect(:stale?, false)
|
|
15
|
-
Webpacker.compiler.stub(:strategy, mock) do
|
|
16
|
-
assert Webpacker.compiler.compile
|
|
17
|
-
end
|
|
18
|
-
assert_mock mock
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def test_after_compile_hook_called_on_success
|
|
22
|
-
mock = Minitest::Mock.new
|
|
23
|
-
mock.expect(:stale?, true)
|
|
24
|
-
mock.expect(:after_compile_hook, nil)
|
|
25
|
-
|
|
26
|
-
status = OpenStruct.new(success?: true)
|
|
27
|
-
|
|
28
|
-
Webpacker.compiler.stub(:strategy, mock) do
|
|
29
|
-
Open3.stub :capture3, [:sterr, :stdout, status] do
|
|
30
|
-
Webpacker.compiler.compile
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
assert_mock mock
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def test_after_compile_hook_called_on_failure
|
|
37
|
-
mock = Minitest::Mock.new
|
|
38
|
-
mock.expect(:stale?, true)
|
|
39
|
-
mock.expect(:after_compile_hook, nil)
|
|
40
|
-
|
|
41
|
-
status = OpenStruct.new(success?: false)
|
|
42
|
-
|
|
43
|
-
Webpacker.compiler.stub(:strategy, mock) do
|
|
44
|
-
Open3.stub :capture3, [:sterr, :stdout, status] do
|
|
45
|
-
Webpacker.compiler.compile
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
assert_mock mock
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def test_external_env_variables
|
|
52
|
-
assert_nil Webpacker.compiler.send(:webpack_env)["WEBPACKER_ASSET_HOST"]
|
|
53
|
-
assert_nil Webpacker.compiler.send(:webpack_env)["WEBPACKER_RELATIVE_URL_ROOT"]
|
|
54
|
-
|
|
55
|
-
ENV["WEBPACKER_ASSET_HOST"] = "foo.bar"
|
|
56
|
-
ENV["WEBPACKER_RELATIVE_URL_ROOT"] = "/baz"
|
|
57
|
-
assert_equal Webpacker.compiler.send(:webpack_env)["WEBPACKER_ASSET_HOST"], "foo.bar"
|
|
58
|
-
assert_equal Webpacker.compiler.send(:webpack_env)["WEBPACKER_RELATIVE_URL_ROOT"], "/baz"
|
|
59
|
-
end
|
|
60
|
-
end
|