shakapacker 7.0.3 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/dummy.yml +3 -1
- data/.github/workflows/generator.yml +3 -1
- data/.github/workflows/jest.yml +4 -2
- data/.github/workflows/js-lint.yml +4 -2
- data/.github/workflows/rubocop.yml +3 -1
- data/.github/workflows/ruby-backward-compatibility.yml +3 -1
- data/.github/workflows/ruby.yml +4 -2
- data/CHANGELOG.md +7 -0
- data/README.md +29 -20
- data/docs/troubleshooting.md +4 -8
- data/docs/using_esbuild_loader.md +2 -4
- data/lib/install/template.rb +2 -2
- data/lib/shakapacker/deprecation_helper.rb +1 -1
- data/lib/shakapacker/dev_server_runner.rb +2 -1
- data/lib/shakapacker/version.rb +1 -1
- data/lib/shakapacker/version_checker.rb +35 -2
- data/lib/shakapacker/webpack_runner.rb +4 -3
- data/package/__tests__/index.js +24 -0
- data/package/index.d.ts +1 -1
- data/package/index.js +8 -2
- data/package.json +1 -1
- data/spec/backward_compatibility_specs/compiler_strategy_spec.rb +5 -3
- data/spec/backward_compatibility_specs/configuration_spec.rb +12 -4
- data/spec/backward_compatibility_specs/dev_server_runner_spec.rb +17 -16
- data/spec/backward_compatibility_specs/dev_server_spec.rb +1 -1
- data/spec/backward_compatibility_specs/digest_strategy_spec.rb +2 -0
- data/spec/backward_compatibility_specs/engine_rake_tasks_spec.rb +2 -1
- data/spec/backward_compatibility_specs/helper_spec.rb +20 -20
- data/spec/backward_compatibility_specs/instance_spec.rb +3 -3
- data/spec/backward_compatibility_specs/manifest_spec.rb +12 -12
- data/spec/backward_compatibility_specs/mtime_strategy_spec.rb +3 -3
- data/spec/backward_compatibility_specs/rake_tasks_spec.rb +9 -5
- data/spec/backward_compatibility_specs/webpack_runner_spec.rb +14 -18
- data/spec/dummy/config/webpack/commonWebpackConfig.js +1 -1
- data/spec/fixtures/beta_pnpm-lock.v7.yaml +116 -0
- data/spec/fixtures/beta_pnpm-lock.v8.yaml +2537 -0
- data/spec/fixtures/git_url_pnpm-lock.v7.yaml +126 -0
- data/spec/fixtures/git_url_pnpm-lock.v8.yaml +3728 -0
- data/spec/fixtures/github_url_pnpm-lock.v7.yaml +126 -0
- data/spec/fixtures/github_url_pnpm-lock.v8.yaml +3728 -0
- data/spec/fixtures/relative_path_pnpm-lock.v7.yaml +18 -0
- data/spec/fixtures/relative_path_pnpm-lock.v8.yaml +22 -0
- data/spec/fixtures/semver_caret_pnpm-lock.v7.yaml +117 -0
- data/spec/fixtures/semver_caret_pnpm-lock.v8.yaml +2558 -0
- data/spec/fixtures/semver_exact_pnpm-lock.v7.yaml +117 -0
- data/spec/fixtures/semver_exact_pnpm-lock.v8.yaml +2558 -0
- data/spec/fixtures/semver_tilde_pnpm-lock.v7.yaml +116 -0
- data/spec/fixtures/semver_tilde_pnpm-lock.v8.yaml +2558 -0
- data/spec/fixtures/without_pnpm-lock.v7.yaml +23 -0
- data/spec/fixtures/without_pnpm-lock.v8.yaml +27 -0
- data/spec/generator_specs/generator_spec.rb +7 -3
- data/spec/shakapacker/compiler_strategy_spec.rb +5 -3
- data/spec/shakapacker/configuration_spec.rb +12 -2
- data/spec/shakapacker/dev_server_runner_spec.rb +22 -16
- data/spec/shakapacker/dev_server_spec.rb +1 -1
- data/spec/shakapacker/digest_strategy_spec.rb +2 -0
- data/spec/shakapacker/engine_rake_tasks_spec.rb +2 -1
- data/spec/shakapacker/helper_spec.rb +20 -20
- data/spec/shakapacker/instance_spec.rb +2 -2
- data/spec/shakapacker/manifest_spec.rb +12 -12
- data/spec/shakapacker/mtime_strategy_spec.rb +3 -3
- data/spec/shakapacker/rake_tasks_spec.rb +5 -2
- data/spec/shakapacker/shakapacker_spec.rb +4 -4
- data/spec/shakapacker/version_checker_spec.rb +468 -121
- data/spec/shakapacker/webpack_runner_spec.rb +14 -18
- metadata +19 -3
@@ -12,44 +12,40 @@ describe "WebpackRunner" do
|
|
12
12
|
ENV["RAILS_ENV"] = @original_rails_env
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
let(:test_app_path) { File.expand_path("./test_app", __dir__) }
|
16
|
+
|
17
|
+
it "supports running via node_modules" do
|
16
18
|
cmd = ["#{test_app_path}/node_modules/.bin/webpack", "--config", "#{test_app_path}/config/webpack/webpack.config.js"]
|
17
19
|
|
18
20
|
verify_command(cmd, use_node_modules: true)
|
19
21
|
end
|
20
22
|
|
21
|
-
it "
|
23
|
+
it "supports running via yarn" do
|
22
24
|
cmd = ["yarn", "webpack", "--config", "#{test_app_path}/config/webpack/webpack.config.js"]
|
23
25
|
|
24
26
|
verify_command(cmd, use_node_modules: false)
|
25
27
|
end
|
26
28
|
|
27
|
-
it "
|
29
|
+
it "passes on arguments" do
|
28
30
|
cmd = ["#{test_app_path}/node_modules/.bin/webpack", "--config", "#{test_app_path}/config/webpack/webpack.config.js", "--watch"]
|
29
31
|
|
30
32
|
verify_command(cmd, argv: ["--watch"])
|
31
33
|
end
|
32
34
|
|
33
35
|
private
|
34
|
-
def test_app_path
|
35
|
-
File.expand_path("./test_app", __dir__)
|
36
|
-
end
|
37
36
|
|
38
37
|
def verify_command(cmd, use_node_modules: true, argv: [])
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
klass = Shakapacker::WebpackRunner
|
43
|
-
instance = klass.new(argv)
|
38
|
+
Dir.chdir(test_app_path) do
|
39
|
+
klass = Shakapacker::WebpackRunner
|
40
|
+
instance = klass.new(argv)
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
allow(klass).to receive(:new).and_return(instance)
|
43
|
+
allow(instance).to receive(:node_modules_bin_exist?).and_return(use_node_modules)
|
44
|
+
allow(Kernel).to receive(:exec)
|
48
45
|
|
49
|
-
|
46
|
+
klass.run(argv)
|
50
47
|
|
51
|
-
|
52
|
-
|
53
|
-
Dir.chdir(cwd)
|
48
|
+
expect(Kernel).to have_received(:exec).with(Shakapacker::Compiler.env, *cmd)
|
49
|
+
end
|
54
50
|
end
|
55
51
|
end
|
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.0
|
4
|
+
version: 7.1.0
|
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: 2023-
|
13
|
+
date: 2023-10-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -425,41 +425,57 @@ files:
|
|
425
425
|
- spec/fixtures/beta_package-lock.v1.json
|
426
426
|
- spec/fixtures/beta_package-lock.v2.json
|
427
427
|
- spec/fixtures/beta_package.json
|
428
|
+
- spec/fixtures/beta_pnpm-lock.v7.yaml
|
429
|
+
- spec/fixtures/beta_pnpm-lock.v8.yaml
|
428
430
|
- spec/fixtures/beta_yarn.v1.lock
|
429
431
|
- spec/fixtures/beta_yarn.v2.lock
|
430
432
|
- spec/fixtures/git_url_package-lock.v1.json
|
431
433
|
- spec/fixtures/git_url_package-lock.v2.json
|
432
434
|
- spec/fixtures/git_url_package.json
|
435
|
+
- spec/fixtures/git_url_pnpm-lock.v7.yaml
|
436
|
+
- spec/fixtures/git_url_pnpm-lock.v8.yaml
|
433
437
|
- spec/fixtures/git_url_yarn.v1.lock
|
434
438
|
- spec/fixtures/git_url_yarn.v2.lock
|
435
439
|
- spec/fixtures/github_url_package-lock.v1.json
|
436
440
|
- spec/fixtures/github_url_package-lock.v2.json
|
437
441
|
- spec/fixtures/github_url_package.json
|
442
|
+
- spec/fixtures/github_url_pnpm-lock.v7.yaml
|
443
|
+
- spec/fixtures/github_url_pnpm-lock.v8.yaml
|
438
444
|
- spec/fixtures/github_url_yarn.v1.lock
|
439
445
|
- spec/fixtures/github_url_yarn.v2.lock
|
440
446
|
- spec/fixtures/relative_path_package-lock.v1.json
|
441
447
|
- spec/fixtures/relative_path_package-lock.v2.json
|
442
448
|
- spec/fixtures/relative_path_package.json
|
449
|
+
- spec/fixtures/relative_path_pnpm-lock.v7.yaml
|
450
|
+
- spec/fixtures/relative_path_pnpm-lock.v8.yaml
|
443
451
|
- spec/fixtures/relative_path_yarn.v1.lock
|
444
452
|
- spec/fixtures/relative_path_yarn.v2.lock
|
445
453
|
- spec/fixtures/semver_caret_package-lock.v1.json
|
446
454
|
- spec/fixtures/semver_caret_package-lock.v2.json
|
447
455
|
- spec/fixtures/semver_caret_package.json
|
456
|
+
- spec/fixtures/semver_caret_pnpm-lock.v7.yaml
|
457
|
+
- spec/fixtures/semver_caret_pnpm-lock.v8.yaml
|
448
458
|
- spec/fixtures/semver_caret_yarn.v1.lock
|
449
459
|
- spec/fixtures/semver_caret_yarn.v2.lock
|
450
460
|
- spec/fixtures/semver_exact_package-lock.v1.json
|
451
461
|
- spec/fixtures/semver_exact_package-lock.v2.json
|
452
462
|
- spec/fixtures/semver_exact_package.json
|
463
|
+
- spec/fixtures/semver_exact_pnpm-lock.v7.yaml
|
464
|
+
- spec/fixtures/semver_exact_pnpm-lock.v8.yaml
|
453
465
|
- spec/fixtures/semver_exact_yarn.v1.lock
|
454
466
|
- spec/fixtures/semver_exact_yarn.v2.lock
|
455
467
|
- spec/fixtures/semver_tilde_package-lock.v1.json
|
456
468
|
- spec/fixtures/semver_tilde_package-lock.v2.json
|
457
469
|
- spec/fixtures/semver_tilde_package.json
|
470
|
+
- spec/fixtures/semver_tilde_pnpm-lock.v7.yaml
|
471
|
+
- spec/fixtures/semver_tilde_pnpm-lock.v8.yaml
|
458
472
|
- spec/fixtures/semver_tilde_yarn.v1.lock
|
459
473
|
- spec/fixtures/semver_tilde_yarn.v2.lock
|
460
474
|
- spec/fixtures/without_package-lock.v1.json
|
461
475
|
- spec/fixtures/without_package-lock.v2.json
|
462
476
|
- spec/fixtures/without_package.json
|
477
|
+
- spec/fixtures/without_pnpm-lock.v7.yaml
|
478
|
+
- spec/fixtures/without_pnpm-lock.v8.yaml
|
463
479
|
- spec/fixtures/without_yarn.v1.lock
|
464
480
|
- spec/fixtures/without_yarn.v2.lock
|
465
481
|
- spec/generator_specs/e2e_template/files/app/controllers/home_controller.rb
|
@@ -529,7 +545,7 @@ homepage: https://github.com/shakacode/shakapacker
|
|
529
545
|
licenses:
|
530
546
|
- MIT
|
531
547
|
metadata:
|
532
|
-
source_code_uri: https://github.com/shakacode/shakapacker/tree/v7.0
|
548
|
+
source_code_uri: https://github.com/shakacode/shakapacker/tree/v7.1.0
|
533
549
|
post_install_message:
|
534
550
|
rdoc_options: []
|
535
551
|
require_paths:
|