shakapacker 7.0.3 → 7.1.0

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dummy.yml +3 -1
  3. data/.github/workflows/generator.yml +3 -1
  4. data/.github/workflows/jest.yml +4 -2
  5. data/.github/workflows/js-lint.yml +4 -2
  6. data/.github/workflows/rubocop.yml +3 -1
  7. data/.github/workflows/ruby-backward-compatibility.yml +3 -1
  8. data/.github/workflows/ruby.yml +4 -2
  9. data/CHANGELOG.md +7 -0
  10. data/README.md +29 -20
  11. data/docs/troubleshooting.md +4 -8
  12. data/docs/using_esbuild_loader.md +2 -4
  13. data/lib/install/template.rb +2 -2
  14. data/lib/shakapacker/deprecation_helper.rb +1 -1
  15. data/lib/shakapacker/dev_server_runner.rb +2 -1
  16. data/lib/shakapacker/version.rb +1 -1
  17. data/lib/shakapacker/version_checker.rb +35 -2
  18. data/lib/shakapacker/webpack_runner.rb +4 -3
  19. data/package/__tests__/index.js +24 -0
  20. data/package/index.d.ts +1 -1
  21. data/package/index.js +8 -2
  22. data/package.json +1 -1
  23. data/spec/backward_compatibility_specs/compiler_strategy_spec.rb +5 -3
  24. data/spec/backward_compatibility_specs/configuration_spec.rb +12 -4
  25. data/spec/backward_compatibility_specs/dev_server_runner_spec.rb +17 -16
  26. data/spec/backward_compatibility_specs/dev_server_spec.rb +1 -1
  27. data/spec/backward_compatibility_specs/digest_strategy_spec.rb +2 -0
  28. data/spec/backward_compatibility_specs/engine_rake_tasks_spec.rb +2 -1
  29. data/spec/backward_compatibility_specs/helper_spec.rb +20 -20
  30. data/spec/backward_compatibility_specs/instance_spec.rb +3 -3
  31. data/spec/backward_compatibility_specs/manifest_spec.rb +12 -12
  32. data/spec/backward_compatibility_specs/mtime_strategy_spec.rb +3 -3
  33. data/spec/backward_compatibility_specs/rake_tasks_spec.rb +9 -5
  34. data/spec/backward_compatibility_specs/webpack_runner_spec.rb +14 -18
  35. data/spec/dummy/config/webpack/commonWebpackConfig.js +1 -1
  36. data/spec/fixtures/beta_pnpm-lock.v7.yaml +116 -0
  37. data/spec/fixtures/beta_pnpm-lock.v8.yaml +2537 -0
  38. data/spec/fixtures/git_url_pnpm-lock.v7.yaml +126 -0
  39. data/spec/fixtures/git_url_pnpm-lock.v8.yaml +3728 -0
  40. data/spec/fixtures/github_url_pnpm-lock.v7.yaml +126 -0
  41. data/spec/fixtures/github_url_pnpm-lock.v8.yaml +3728 -0
  42. data/spec/fixtures/relative_path_pnpm-lock.v7.yaml +18 -0
  43. data/spec/fixtures/relative_path_pnpm-lock.v8.yaml +22 -0
  44. data/spec/fixtures/semver_caret_pnpm-lock.v7.yaml +117 -0
  45. data/spec/fixtures/semver_caret_pnpm-lock.v8.yaml +2558 -0
  46. data/spec/fixtures/semver_exact_pnpm-lock.v7.yaml +117 -0
  47. data/spec/fixtures/semver_exact_pnpm-lock.v8.yaml +2558 -0
  48. data/spec/fixtures/semver_tilde_pnpm-lock.v7.yaml +116 -0
  49. data/spec/fixtures/semver_tilde_pnpm-lock.v8.yaml +2558 -0
  50. data/spec/fixtures/without_pnpm-lock.v7.yaml +23 -0
  51. data/spec/fixtures/without_pnpm-lock.v8.yaml +27 -0
  52. data/spec/generator_specs/generator_spec.rb +7 -3
  53. data/spec/shakapacker/compiler_strategy_spec.rb +5 -3
  54. data/spec/shakapacker/configuration_spec.rb +12 -2
  55. data/spec/shakapacker/dev_server_runner_spec.rb +22 -16
  56. data/spec/shakapacker/dev_server_spec.rb +1 -1
  57. data/spec/shakapacker/digest_strategy_spec.rb +2 -0
  58. data/spec/shakapacker/engine_rake_tasks_spec.rb +2 -1
  59. data/spec/shakapacker/helper_spec.rb +20 -20
  60. data/spec/shakapacker/instance_spec.rb +2 -2
  61. data/spec/shakapacker/manifest_spec.rb +12 -12
  62. data/spec/shakapacker/mtime_strategy_spec.rb +3 -3
  63. data/spec/shakapacker/rake_tasks_spec.rb +5 -2
  64. data/spec/shakapacker/shakapacker_spec.rb +4 -4
  65. data/spec/shakapacker/version_checker_spec.rb +468 -121
  66. data/spec/shakapacker/webpack_runner_spec.rb +14 -18
  67. metadata +19 -3
@@ -18,22 +18,25 @@ describe "RakeTasks" do
18
18
 
19
19
  it "`shakapacker:check_binstubs` doesn't get 'webpack binstub not found' error" do
20
20
  output = Dir.chdir(TEST_APP_PATH) { `rake shakapacker:check_binstubs 2>&1` }
21
+
21
22
  expect(output).to_not include "webpack binstub not found."
22
23
  end
23
24
 
24
25
  it "`shakapacker:check_node` doesn't get 'shakapacker requires Node.js' error" do
25
26
  output = Dir.chdir(TEST_APP_PATH) { `rake shakapacker:check_node 2>&1` }
27
+
26
28
  expect(output).to_not include "Shakapacker requires Node.js"
27
29
  end
28
30
 
29
- it "`shakapacker:check_yarn` doesn't get error related to yarn" do
31
+ it "`shakapacker:check_yarn` doesn't get errors related to yarn" do
30
32
  output = Dir.chdir(TEST_APP_PATH) { `rake shakapacker:check_yarn 2>&1` }
33
+
31
34
  expect(output).to_not include "Yarn not installed"
32
35
  expect(output).to_not include "Shakapacker requires Yarn"
33
36
  end
34
37
 
35
38
  describe "`shakapacker:check_binstubs`" do
36
- def with_temporary_file(file_name, &block)
39
+ def with_temporary_file(file_name)
37
40
  FileUtils.touch(file_name, verbose: false)
38
41
  yield if block_given?
39
42
  ensure
@@ -12,11 +12,11 @@ describe "Shakapacker" do
12
12
  allow(dev_server).to receive(:running?).and_return(true)
13
13
  end
14
14
 
15
- it "returns nil with disabled dev_server" do
15
+ it "returns nil when the dev server is disabled" do
16
16
  expect(Shakapacker.inlining_css?).to be nil
17
17
  end
18
18
 
19
- it "returns true with enabled hmr" do
19
+ it "returns true when hmr is enabled" do
20
20
  allow(dev_server).to receive(:hmr?).and_return(true)
21
21
  allow(dev_server).to receive(:inline_css?).and_return(true)
22
22
 
@@ -25,7 +25,7 @@ describe "Shakapacker" do
25
25
  expect(Shakapacker.inlining_css?).to be true
26
26
  end
27
27
 
28
- it "returns false with enabled hmr and explicitly setting inline_css to false" do
28
+ it "returns false when hmr is enabled and inline_css is explicitly set to false" do
29
29
  allow(dev_server).to receive(:hmr?).and_return(true)
30
30
  allow(dev_server).to receive(:inline_css?).and_return(false)
31
31
 
@@ -35,7 +35,7 @@ describe "Shakapacker" do
35
35
  end
36
36
  end
37
37
 
38
- it "has app_autoload_paths cleanup" do
38
+ it "automatically cleans up app_autoload_paths" do
39
39
  expect($test_app_autoload_paths_in_initializer).to eq []
40
40
  end
41
41
  end