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.
- 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
@@ -45,53 +45,53 @@ describe "VersionChecker" do
|
|
45
45
|
.to_stderr
|
46
46
|
end
|
47
47
|
|
48
|
-
it "raises exception on different major
|
48
|
+
it "raises an exception on different major versions" do
|
49
49
|
node_package_version = NodePackageVersionDouble.new(raw: "6.1.0", major_minor_patch: ["6", "1", "0"])
|
50
50
|
|
51
51
|
expect { check_version(node_package_version, "7.0.0") }
|
52
52
|
.to raise_error(/\*\*ERROR\*\* Shakapacker: Shakapacker gem and node package versions do not match/)
|
53
53
|
end
|
54
54
|
|
55
|
-
it "raises exception on different minor
|
55
|
+
it "raises an exception on different minor versions" do
|
56
56
|
node_package_version = NodePackageVersionDouble.new(raw: "6.1.0", major_minor_patch: ["6", "1", "0"])
|
57
57
|
|
58
58
|
expect { check_version(node_package_version, "6.2.0") }
|
59
59
|
.to raise_error(/\*\*ERROR\*\* Shakapacker: Shakapacker gem and node package versions do not match/)
|
60
60
|
end
|
61
61
|
|
62
|
-
it "raises exception on different patch
|
62
|
+
it "raises an exception on different patch versions" do
|
63
63
|
node_package_version = NodePackageVersionDouble.new(raw: "6.1.1", major_minor_patch: ["6", "1", "1"])
|
64
64
|
|
65
65
|
expect { check_version(node_package_version, "6.1.2") }
|
66
66
|
.to raise_error(/\*\*ERROR\*\* Shakapacker: Shakapacker gem and node package versions do not match/)
|
67
67
|
end
|
68
68
|
|
69
|
-
it "raises exception on semver wildcard" do
|
69
|
+
it "raises an exception on a semver wildcard" do
|
70
70
|
node_package_version = NodePackageVersionDouble.new(raw: "^6.0.0", major_minor_patch: ["6", "0", "0"], semver_wildcard: true)
|
71
71
|
|
72
72
|
expect { check_version(node_package_version, "6.0.0") }
|
73
73
|
.to raise_error(/\*\*ERROR\*\* Shakapacker: Your node package version for shakapacker contains a \^ or ~/)
|
74
74
|
end
|
75
75
|
|
76
|
-
it "doesn't raise exception on matching versions" do
|
76
|
+
it "doesn't raise an exception on matching versions" do
|
77
77
|
node_package_version = NodePackageVersionDouble.new(raw: "6.0.0", major_minor_patch: ["6", "0", "0"])
|
78
78
|
|
79
79
|
expect { check_version(node_package_version, "6.0.0") }.to_not raise_error
|
80
80
|
end
|
81
81
|
|
82
|
-
it "doesn't raise exception on matching versions
|
82
|
+
it "doesn't raise an exception on matching beta versions" do
|
83
83
|
node_package_version = NodePackageVersionDouble.new(raw: "6.0.0-beta.1", major_minor_patch: ["6", "0", "0"])
|
84
84
|
|
85
85
|
expect { check_version(node_package_version, "6.0.0.beta.1") }.to_not raise_error
|
86
86
|
end
|
87
87
|
|
88
|
-
it "doesn't raise exception on no package" do
|
88
|
+
it "doesn't raise an exception on no package" do
|
89
89
|
node_package_version = NodePackageVersionDouble.new(raw: nil, skip_processing: true)
|
90
90
|
|
91
91
|
expect { check_version(node_package_version, "6.0.0") }.to_not raise_error
|
92
92
|
end
|
93
93
|
|
94
|
-
it "doesn't raise exception on skipped
|
94
|
+
it "doesn't raise an exception on skipped paths" do
|
95
95
|
node_package_version = NodePackageVersionDouble.new(raw: "../..", skip_processing: true)
|
96
96
|
|
97
97
|
expect { check_version(node_package_version, "6.0.0") }.to_not raise_error
|
@@ -99,23 +99,24 @@ describe "VersionChecker" do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
describe "VersionChecker::NodePackageVersion" do
|
102
|
-
context "with no
|
102
|
+
context "with no lock file" do
|
103
103
|
def node_package_version(fixture_version:)
|
104
104
|
Shakapacker::VersionChecker::NodePackageVersion.new(
|
105
105
|
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
106
106
|
"file/does/not/exist",
|
107
|
+
"file/does/not/exist",
|
107
108
|
"file/does/not/exist"
|
108
109
|
)
|
109
110
|
end
|
110
111
|
|
111
|
-
context "
|
112
|
+
context "when using an exact semantic version" do
|
112
113
|
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
113
114
|
|
114
|
-
it "#raw returns raw version" do
|
115
|
+
it "#raw returns the raw version" do
|
115
116
|
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
116
117
|
end
|
117
118
|
|
118
|
-
it "#major_minor_patch returns
|
119
|
+
it "#major_minor_patch returns an array" do
|
119
120
|
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
120
121
|
end
|
121
122
|
|
@@ -128,14 +129,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
128
129
|
end
|
129
130
|
end
|
130
131
|
|
131
|
-
context "
|
132
|
+
context "when using a beta version" do
|
132
133
|
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
133
134
|
|
134
|
-
it "#raw returns raw version" do
|
135
|
+
it "#raw returns the raw version" do
|
135
136
|
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
136
137
|
end
|
137
138
|
|
138
|
-
it "#major_minor_patch returns
|
139
|
+
it "#major_minor_patch returns an array" do
|
139
140
|
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
140
141
|
end
|
141
142
|
|
@@ -148,14 +149,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
148
149
|
end
|
149
150
|
end
|
150
151
|
|
151
|
-
context "
|
152
|
+
context "when using a caret constraint" do
|
152
153
|
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
153
154
|
|
154
|
-
it "#raw returns version" do
|
155
|
+
it "#raw returns the raw version" do
|
155
156
|
expect(node_package_version_from_semver_caret.raw).to eq "^6.0.0"
|
156
157
|
end
|
157
158
|
|
158
|
-
it "#major_minor_patch returns
|
159
|
+
it "#major_minor_patch returns an array" do
|
159
160
|
expect(node_package_version_from_semver_caret.major_minor_patch).to eq ["6", "0", "0"]
|
160
161
|
end
|
161
162
|
|
@@ -168,10 +169,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
168
169
|
end
|
169
170
|
end
|
170
171
|
|
171
|
-
context "
|
172
|
+
context "when using a tilde constraint" do
|
172
173
|
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
173
174
|
|
174
|
-
it "#raw returns version" do
|
175
|
+
it "#raw returns the raw version" do
|
175
176
|
expect(node_package_version_from_semver_tilde.raw).to eq "~6.0.0"
|
176
177
|
end
|
177
178
|
|
@@ -188,10 +189,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
188
189
|
end
|
189
190
|
end
|
190
191
|
|
191
|
-
context "
|
192
|
+
context "when using a relative path" do
|
192
193
|
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
193
194
|
|
194
|
-
it "#raw returns relative path" do
|
195
|
+
it "#raw returns the relative path" do
|
195
196
|
expect(node_package_version_from_relative_path.raw).to eq "../.."
|
196
197
|
end
|
197
198
|
|
@@ -208,10 +209,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
208
209
|
end
|
209
210
|
end
|
210
211
|
|
211
|
-
context "
|
212
|
+
context "when using a git url" do
|
212
213
|
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
213
214
|
|
214
|
-
it "#raw returns git url" do
|
215
|
+
it "#raw returns the git url" do
|
215
216
|
expect(node_package_version_from_git_url.raw).to eq "git@github.com:shakacode/shakapacker.git"
|
216
217
|
end
|
217
218
|
|
@@ -228,10 +229,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
228
229
|
end
|
229
230
|
end
|
230
231
|
|
231
|
-
context "
|
232
|
-
let
|
232
|
+
context "when using a github url" do
|
233
|
+
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
233
234
|
|
234
|
-
it "#raw returns GitHub repo address" do
|
235
|
+
it "#raw returns the GitHub repo address" do
|
235
236
|
expect(node_package_version_from_github_url.raw).to eq "shakacode/shakapacker#master"
|
236
237
|
end
|
237
238
|
|
@@ -248,10 +249,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
248
249
|
end
|
249
250
|
end
|
250
251
|
|
251
|
-
context "
|
252
|
+
context "when shakapacker is not a dependency" do
|
252
253
|
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
253
254
|
|
254
|
-
it "#raw returns empty string" do
|
255
|
+
it "#raw returns an empty string" do
|
255
256
|
expect(node_package_version_from_without.raw).to eq ""
|
256
257
|
end
|
257
258
|
|
@@ -274,18 +275,19 @@ describe "VersionChecker::NodePackageVersion" do
|
|
274
275
|
Shakapacker::VersionChecker::NodePackageVersion.new(
|
275
276
|
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
276
277
|
File.expand_path("../fixtures/#{fixture_version}_yarn.v1.lock", __dir__),
|
278
|
+
"file/does/not/exist",
|
277
279
|
"file/does/not/exist"
|
278
280
|
)
|
279
281
|
end
|
280
282
|
|
281
|
-
context "
|
283
|
+
context "when using an exact semantic version" do
|
282
284
|
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
283
285
|
|
284
|
-
it "#raw returns version" do
|
286
|
+
it "#raw returns the raw version" do
|
285
287
|
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
286
288
|
end
|
287
289
|
|
288
|
-
it "#major_minor_patch returns
|
290
|
+
it "#major_minor_patch returns an array" do
|
289
291
|
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
290
292
|
end
|
291
293
|
|
@@ -298,14 +300,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
298
300
|
end
|
299
301
|
end
|
300
302
|
|
301
|
-
context "
|
303
|
+
context "when using a beta version" do
|
302
304
|
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
303
305
|
|
304
|
-
it "#raw returns version" do
|
306
|
+
it "#raw returns the raw version" do
|
305
307
|
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
306
308
|
end
|
307
309
|
|
308
|
-
it "#major_minor_patch returns
|
310
|
+
it "#major_minor_patch returns an array" do
|
309
311
|
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
310
312
|
end
|
311
313
|
|
@@ -318,14 +320,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
318
320
|
end
|
319
321
|
end
|
320
322
|
|
321
|
-
context "
|
323
|
+
context "when using a caret constraint" do
|
322
324
|
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
323
325
|
|
324
|
-
it "#raw returns version" do
|
326
|
+
it "#raw returns the raw version" do
|
325
327
|
expect(node_package_version_from_semver_caret.raw).to eq "6.5.0"
|
326
328
|
end
|
327
329
|
|
328
|
-
it "#major_minor_patch returns
|
330
|
+
it "#major_minor_patch returns an array" do
|
329
331
|
expect(node_package_version_from_semver_caret.major_minor_patch).to eq ["6", "5", "0"]
|
330
332
|
end
|
331
333
|
|
@@ -338,14 +340,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
338
340
|
end
|
339
341
|
end
|
340
342
|
|
341
|
-
context "
|
343
|
+
context "when using a tilde constraint" do
|
342
344
|
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
343
345
|
|
344
|
-
it "#raw returns version" do
|
346
|
+
it "#raw returns the raw version" do
|
345
347
|
expect(node_package_version_from_semver_tilde.raw).to eq "6.0.2"
|
346
348
|
end
|
347
349
|
|
348
|
-
it "#major_minor_patch returns
|
350
|
+
it "#major_minor_patch returns an array" do
|
349
351
|
expect(node_package_version_from_semver_tilde.major_minor_patch).to eq ["6", "0", "2"]
|
350
352
|
end
|
351
353
|
|
@@ -358,14 +360,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
358
360
|
end
|
359
361
|
end
|
360
362
|
|
361
|
-
context "
|
363
|
+
context "when using a relative path" do
|
362
364
|
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
363
365
|
|
364
|
-
it "#raw returns version" do
|
366
|
+
it "#raw returns the raw version" do
|
365
367
|
expect(node_package_version_from_relative_path.raw).to eq "6.5.0"
|
366
368
|
end
|
367
369
|
|
368
|
-
it "#major_minor_patch returns
|
370
|
+
it "#major_minor_patch returns an array" do
|
369
371
|
expect(node_package_version_from_relative_path.major_minor_patch).to eq ["6", "5", "0"]
|
370
372
|
end
|
371
373
|
|
@@ -378,14 +380,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
378
380
|
end
|
379
381
|
end
|
380
382
|
|
381
|
-
context "
|
383
|
+
context "when using a git url" do
|
382
384
|
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
383
385
|
|
384
|
-
it "#raw returns version" do
|
386
|
+
it "#raw returns the raw version" do
|
385
387
|
expect(node_package_version_from_git_url.raw).to eq "6.5.0"
|
386
388
|
end
|
387
389
|
|
388
|
-
it "#major_minor_patch returns
|
390
|
+
it "#major_minor_patch returns an array" do
|
389
391
|
expect(node_package_version_from_git_url.major_minor_patch).to eq ["6", "5", "0"]
|
390
392
|
end
|
391
393
|
|
@@ -401,11 +403,11 @@ describe "VersionChecker::NodePackageVersion" do
|
|
401
403
|
context "from GitHub url" do
|
402
404
|
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
403
405
|
|
404
|
-
it "#raw returns version" do
|
406
|
+
it "#raw returns the raw version" do
|
405
407
|
expect(node_package_version_from_github_url.raw).to eq "6.5.0"
|
406
408
|
end
|
407
409
|
|
408
|
-
it "#major_minor_patch returns
|
410
|
+
it "#major_minor_patch returns an array" do
|
409
411
|
expect(node_package_version_from_github_url.major_minor_patch).to eq ["6", "5", "0"]
|
410
412
|
end
|
411
413
|
|
@@ -418,10 +420,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
418
420
|
end
|
419
421
|
end
|
420
422
|
|
421
|
-
context "
|
423
|
+
context "when shakapacker is not a dependency" do
|
422
424
|
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
423
425
|
|
424
|
-
it "#raw returns empty string" do
|
426
|
+
it "#raw returns an empty string" do
|
425
427
|
expect(node_package_version_from_without.raw).to eq ""
|
426
428
|
end
|
427
429
|
|
@@ -444,18 +446,19 @@ describe "VersionChecker::NodePackageVersion" do
|
|
444
446
|
Shakapacker::VersionChecker::NodePackageVersion.new(
|
445
447
|
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
446
448
|
File.expand_path("../fixtures/#{fixture_version}_yarn.v2.lock", __dir__),
|
449
|
+
"file/does/not/exist",
|
447
450
|
"file/does/not/exist"
|
448
451
|
)
|
449
452
|
end
|
450
453
|
|
451
|
-
context "
|
454
|
+
context "when using an exact semantic version" do
|
452
455
|
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
453
456
|
|
454
|
-
it "#raw returns version" do
|
457
|
+
it "#raw returns the raw version" do
|
455
458
|
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
456
459
|
end
|
457
460
|
|
458
|
-
it "#major_minor_patch returns
|
461
|
+
it "#major_minor_patch returns an array" do
|
459
462
|
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
460
463
|
end
|
461
464
|
|
@@ -468,14 +471,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
468
471
|
end
|
469
472
|
end
|
470
473
|
|
471
|
-
context "
|
474
|
+
context "when using a beta version" do
|
472
475
|
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
473
476
|
|
474
|
-
it "#raw returns version" do
|
477
|
+
it "#raw returns the raw version" do
|
475
478
|
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
476
479
|
end
|
477
480
|
|
478
|
-
it "#major_minor_patch returns
|
481
|
+
it "#major_minor_patch returns an array" do
|
479
482
|
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
480
483
|
end
|
481
484
|
|
@@ -488,14 +491,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
488
491
|
end
|
489
492
|
end
|
490
493
|
|
491
|
-
context "
|
494
|
+
context "when using a caret constraint" do
|
492
495
|
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
493
496
|
|
494
|
-
it "#raw returns version" do
|
497
|
+
it "#raw returns the raw version" do
|
495
498
|
expect(node_package_version_from_semver_caret.raw).to eq "6.5.0"
|
496
499
|
end
|
497
500
|
|
498
|
-
it "#major_minor_patch returns
|
501
|
+
it "#major_minor_patch returns an array" do
|
499
502
|
expect(node_package_version_from_semver_caret.major_minor_patch).to eq ["6", "5", "0"]
|
500
503
|
end
|
501
504
|
|
@@ -508,14 +511,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
508
511
|
end
|
509
512
|
end
|
510
513
|
|
511
|
-
context "
|
514
|
+
context "when using a tilde constraint" do
|
512
515
|
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
513
516
|
|
514
|
-
it "#raw returns version" do
|
517
|
+
it "#raw returns the raw version" do
|
515
518
|
expect(node_package_version_from_semver_tilde.raw).to eq "6.0.2"
|
516
519
|
end
|
517
520
|
|
518
|
-
it "#major_minor_patch returns
|
521
|
+
it "#major_minor_patch returns an array" do
|
519
522
|
expect(node_package_version_from_semver_tilde.major_minor_patch).to eq ["6", "0", "2"]
|
520
523
|
end
|
521
524
|
|
@@ -528,14 +531,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
528
531
|
end
|
529
532
|
end
|
530
533
|
|
531
|
-
context "
|
534
|
+
context "when using a relative path" do
|
532
535
|
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
533
536
|
|
534
|
-
it "#raw returns version" do
|
537
|
+
it "#raw returns the raw version" do
|
535
538
|
expect(node_package_version_from_relative_path.raw).to eq "6.5.0"
|
536
539
|
end
|
537
540
|
|
538
|
-
it "#major_minor_patch returns
|
541
|
+
it "#major_minor_patch returns an array" do
|
539
542
|
expect(node_package_version_from_relative_path.major_minor_patch).to eq ["6", "5", "0"]
|
540
543
|
end
|
541
544
|
|
@@ -548,14 +551,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
548
551
|
end
|
549
552
|
end
|
550
553
|
|
551
|
-
context "
|
554
|
+
context "when using a git url" do
|
552
555
|
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
553
556
|
|
554
|
-
it "#raw returns version" do
|
557
|
+
it "#raw returns the raw version" do
|
555
558
|
expect(node_package_version_from_git_url.raw).to eq "6.5.0"
|
556
559
|
end
|
557
560
|
|
558
|
-
it "#major_minor_patch returns
|
561
|
+
it "#major_minor_patch returns an array" do
|
559
562
|
expect(node_package_version_from_git_url.major_minor_patch).to eq ["6", "5", "0"]
|
560
563
|
end
|
561
564
|
|
@@ -568,30 +571,30 @@ describe "VersionChecker::NodePackageVersion" do
|
|
568
571
|
end
|
569
572
|
end
|
570
573
|
|
571
|
-
context "
|
572
|
-
let
|
574
|
+
context "when using a github url" do
|
575
|
+
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
573
576
|
|
574
|
-
it "#raw
|
577
|
+
it "#raw returns the raw version" do
|
575
578
|
expect(node_package_version_from_github_url.raw).to eq "6.5.0"
|
576
579
|
end
|
577
580
|
|
578
|
-
it "#major_minor_patch
|
581
|
+
it "#major_minor_patch returns version array" do
|
579
582
|
expect(node_package_version_from_github_url.major_minor_patch).to eq ["6", "5", "0"]
|
580
583
|
end
|
581
584
|
|
582
|
-
it "#skip_processing?
|
585
|
+
it "#skip_processing? returns false" do
|
583
586
|
expect(node_package_version_from_github_url.skip_processing?).to be false
|
584
587
|
end
|
585
588
|
|
586
|
-
it "#semver_wildcard?
|
589
|
+
it "#semver_wildcard? returns false" do
|
587
590
|
expect(node_package_version_from_github_url.semver_wildcard?).to be false
|
588
591
|
end
|
589
592
|
end
|
590
593
|
|
591
|
-
context "
|
594
|
+
context "when shakapacker is not a dependency" do
|
592
595
|
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
593
596
|
|
594
|
-
it "#raw returns empty string" do
|
597
|
+
it "#raw returns an empty string" do
|
595
598
|
expect(node_package_version_from_without.raw).to eq ""
|
596
599
|
end
|
597
600
|
|
@@ -615,17 +618,18 @@ describe "VersionChecker::NodePackageVersion" do
|
|
615
618
|
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
616
619
|
"file/does/not/exist",
|
617
620
|
File.expand_path("../fixtures/#{fixture_version}_package-lock.v1.json", __dir__),
|
621
|
+
"file/does/not/exist"
|
618
622
|
)
|
619
623
|
end
|
620
624
|
|
621
|
-
context "
|
625
|
+
context "when using an exact semantic version" do
|
622
626
|
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
623
627
|
|
624
|
-
it "#raw returns version" do
|
628
|
+
it "#raw returns the raw version" do
|
625
629
|
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
626
630
|
end
|
627
631
|
|
628
|
-
it "#major_minor_patch returns
|
632
|
+
it "#major_minor_patch returns an array" do
|
629
633
|
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
630
634
|
end
|
631
635
|
|
@@ -638,14 +642,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
638
642
|
end
|
639
643
|
end
|
640
644
|
|
641
|
-
context "
|
645
|
+
context "when using a beta version" do
|
642
646
|
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
643
647
|
|
644
|
-
it "#raw returns version" do
|
648
|
+
it "#raw returns the raw version" do
|
645
649
|
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
646
650
|
end
|
647
651
|
|
648
|
-
it "#major_minor_patch returns
|
652
|
+
it "#major_minor_patch returns an array" do
|
649
653
|
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
650
654
|
end
|
651
655
|
|
@@ -658,14 +662,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
658
662
|
end
|
659
663
|
end
|
660
664
|
|
661
|
-
context "
|
665
|
+
context "when using a caret constraint" do
|
662
666
|
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
663
667
|
|
664
|
-
it "#raw returns version" do
|
668
|
+
it "#raw returns the raw version" do
|
665
669
|
expect(node_package_version_from_semver_caret.raw).to eq "6.5.0"
|
666
670
|
end
|
667
671
|
|
668
|
-
it "#major_minor_patch returns
|
672
|
+
it "#major_minor_patch returns an array" do
|
669
673
|
expect(node_package_version_from_semver_caret.major_minor_patch).to eq ["6", "5", "0"]
|
670
674
|
end
|
671
675
|
|
@@ -678,14 +682,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
678
682
|
end
|
679
683
|
end
|
680
684
|
|
681
|
-
context "
|
685
|
+
context "when using a tilde constraint" do
|
682
686
|
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
683
687
|
|
684
|
-
it "#raw returns version" do
|
688
|
+
it "#raw returns the raw version" do
|
685
689
|
expect(node_package_version_from_semver_tilde.raw).to eq "6.0.2"
|
686
690
|
end
|
687
691
|
|
688
|
-
it "#major_minor_patch returns
|
692
|
+
it "#major_minor_patch returns an array" do
|
689
693
|
expect(node_package_version_from_semver_tilde.major_minor_patch).to eq ["6", "0", "2"]
|
690
694
|
end
|
691
695
|
|
@@ -698,10 +702,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
698
702
|
end
|
699
703
|
end
|
700
704
|
|
701
|
-
context "
|
705
|
+
context "when using a relative path" do
|
702
706
|
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
703
707
|
|
704
|
-
it "#raw returns relative path" do
|
708
|
+
it "#raw returns the relative path" do
|
705
709
|
expect(node_package_version_from_relative_path.raw).to eq "file:../.."
|
706
710
|
end
|
707
711
|
|
@@ -718,10 +722,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
718
722
|
end
|
719
723
|
end
|
720
724
|
|
721
|
-
context "
|
725
|
+
context "when using a git url" do
|
722
726
|
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
723
727
|
|
724
|
-
it "#raw returns git url" do
|
728
|
+
it "#raw returns the git url" do
|
725
729
|
expect(node_package_version_from_git_url.raw).to eq "git+ssh://git@github.com/shakacode/shakapacker.git#31854a58be49f736f3486a946b72d7e4f334e2b2"
|
726
730
|
end
|
727
731
|
|
@@ -738,10 +742,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
738
742
|
end
|
739
743
|
end
|
740
744
|
|
741
|
-
context "
|
742
|
-
let
|
745
|
+
context "when using a github url" do
|
746
|
+
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
743
747
|
|
744
|
-
it "#raw returns GitHub address" do
|
748
|
+
it "#raw returns the GitHub repo address" do
|
745
749
|
expect(node_package_version_from_github_url.raw).to eq "github:shakacode/shakapacker#31854a58be49f736f3486a946b72d7e4f334e2b2"
|
746
750
|
end
|
747
751
|
|
@@ -758,10 +762,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
758
762
|
end
|
759
763
|
end
|
760
764
|
|
761
|
-
context "
|
765
|
+
context "when shakapacker is not a dependency" do
|
762
766
|
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
763
767
|
|
764
|
-
it "#raw returns empty string" do
|
768
|
+
it "#raw returns an empty string" do
|
765
769
|
expect(node_package_version_from_without.raw).to eq ""
|
766
770
|
end
|
767
771
|
|
@@ -785,17 +789,18 @@ describe "VersionChecker::NodePackageVersion" do
|
|
785
789
|
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
786
790
|
"file/does/not/exist",
|
787
791
|
File.expand_path("../fixtures/#{fixture_version}_package-lock.v2.json", __dir__),
|
792
|
+
"file/does/not/exist"
|
788
793
|
)
|
789
794
|
end
|
790
795
|
|
791
|
-
context "
|
796
|
+
context "when using an exact semantic version" do
|
792
797
|
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
793
798
|
|
794
|
-
it "#raw returns version" do
|
799
|
+
it "#raw returns the raw version" do
|
795
800
|
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
796
801
|
end
|
797
802
|
|
798
|
-
it "#major_minor_patch returns
|
803
|
+
it "#major_minor_patch returns an array" do
|
799
804
|
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
800
805
|
end
|
801
806
|
|
@@ -808,14 +813,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
808
813
|
end
|
809
814
|
end
|
810
815
|
|
811
|
-
context "
|
816
|
+
context "when using a beta version" do
|
812
817
|
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
813
818
|
|
814
|
-
it "#raw returns version" do
|
819
|
+
it "#raw returns the raw version" do
|
815
820
|
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
816
821
|
end
|
817
822
|
|
818
|
-
it "#major_minor_patch returns
|
823
|
+
it "#major_minor_patch returns an array" do
|
819
824
|
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
820
825
|
end
|
821
826
|
|
@@ -828,14 +833,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
828
833
|
end
|
829
834
|
end
|
830
835
|
|
831
|
-
context "
|
836
|
+
context "when using a caret constraint" do
|
832
837
|
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
833
838
|
|
834
|
-
it "#raw returns version" do
|
839
|
+
it "#raw returns the raw version" do
|
835
840
|
expect(node_package_version(fixture_version: "semver_caret").raw).to eq "6.5.0"
|
836
841
|
end
|
837
842
|
|
838
|
-
it "#major_minor_patch returns
|
843
|
+
it "#major_minor_patch returns an array" do
|
839
844
|
expect(node_package_version(fixture_version: "semver_caret").major_minor_patch).to eq ["6", "5", "0"]
|
840
845
|
end
|
841
846
|
|
@@ -848,14 +853,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
848
853
|
end
|
849
854
|
end
|
850
855
|
|
851
|
-
context "
|
856
|
+
context "when using a tilde constraint" do
|
852
857
|
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
853
858
|
|
854
|
-
it "#raw returns version" do
|
859
|
+
it "#raw returns the raw version" do
|
855
860
|
expect(node_package_version_from_semver_tilde.raw).to eq "6.0.2"
|
856
861
|
end
|
857
862
|
|
858
|
-
it "#major_minor_patch returns
|
863
|
+
it "#major_minor_patch returns an array" do
|
859
864
|
expect(node_package_version_from_semver_tilde.major_minor_patch).to eq ["6", "0", "2"]
|
860
865
|
end
|
861
866
|
|
@@ -868,10 +873,10 @@ describe "VersionChecker::NodePackageVersion" do
|
|
868
873
|
end
|
869
874
|
end
|
870
875
|
|
871
|
-
context "
|
876
|
+
context "when using a relative path" do
|
872
877
|
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
873
878
|
|
874
|
-
it "#raw returns relative path" do
|
879
|
+
it "#raw returns the relative path" do
|
875
880
|
expect(node_package_version_from_relative_path.raw).to eq "../.."
|
876
881
|
end
|
877
882
|
|
@@ -888,14 +893,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
888
893
|
end
|
889
894
|
end
|
890
895
|
|
891
|
-
context "
|
896
|
+
context "when using a git url" do
|
892
897
|
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
893
898
|
|
894
|
-
it "#raw returns version" do
|
899
|
+
it "#raw returns the raw version" do
|
895
900
|
expect(node_package_version_from_git_url.raw).to eq "6.5.0"
|
896
901
|
end
|
897
902
|
|
898
|
-
it "#major_minor_patch returns
|
903
|
+
it "#major_minor_patch returns an array" do
|
899
904
|
expect(node_package_version_from_git_url.major_minor_patch).to eq ["6", "5", "0"]
|
900
905
|
end
|
901
906
|
|
@@ -908,14 +913,14 @@ describe "VersionChecker::NodePackageVersion" do
|
|
908
913
|
end
|
909
914
|
end
|
910
915
|
|
911
|
-
context "
|
912
|
-
let
|
916
|
+
context "when using a github url" do
|
917
|
+
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
913
918
|
|
914
|
-
it "#raw returns version" do
|
919
|
+
it "#raw returns the raw version" do
|
915
920
|
expect(node_package_version_from_github_url.raw).to eq "6.5.0"
|
916
921
|
end
|
917
922
|
|
918
|
-
it "#major_minor_patch returns
|
923
|
+
it "#major_minor_patch returns an array" do
|
919
924
|
expect(node_package_version_from_github_url.major_minor_patch).to eq ["6", "5", "0"]
|
920
925
|
end
|
921
926
|
|
@@ -928,10 +933,352 @@ describe "VersionChecker::NodePackageVersion" do
|
|
928
933
|
end
|
929
934
|
end
|
930
935
|
|
931
|
-
context "
|
936
|
+
context "when shakapacker is not a dependency" do
|
937
|
+
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
938
|
+
|
939
|
+
it "#raw returns an empty string" do
|
940
|
+
expect(node_package_version_from_without.raw).to eq ""
|
941
|
+
end
|
942
|
+
|
943
|
+
it "#major_minor_patch returns nil" do
|
944
|
+
expect(node_package_version_from_without.major_minor_patch).to be nil
|
945
|
+
end
|
946
|
+
|
947
|
+
it "#skip_processing? returns true" do
|
948
|
+
expect(node_package_version_from_without.skip_processing?).to be true
|
949
|
+
end
|
950
|
+
|
951
|
+
it "#semver_wildcard? returns false" do
|
952
|
+
expect(node_package_version_from_without.semver_wildcard?).to be false
|
953
|
+
end
|
954
|
+
end
|
955
|
+
end
|
956
|
+
|
957
|
+
context "with pnpm-lock.yaml v7" do
|
958
|
+
def node_package_version(fixture_version:)
|
959
|
+
Shakapacker::VersionChecker::NodePackageVersion.new(
|
960
|
+
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
961
|
+
"file/does/not/exist",
|
962
|
+
"file/does/not/exist",
|
963
|
+
File.expand_path("../fixtures/#{fixture_version}_pnpm-lock.v7.yaml", __dir__)
|
964
|
+
)
|
965
|
+
end
|
966
|
+
|
967
|
+
context "when using an exact semantic version" do
|
968
|
+
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
969
|
+
|
970
|
+
it "#raw returns version" do
|
971
|
+
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
972
|
+
end
|
973
|
+
|
974
|
+
it "#major_minor_patch returns an array" do
|
975
|
+
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
976
|
+
end
|
977
|
+
|
978
|
+
it "#skip_processing? returns false" do
|
979
|
+
expect(node_package_version_from_semver_exact.skip_processing?).to be false
|
980
|
+
end
|
981
|
+
|
982
|
+
it "#semver_wildcard? returns false" do
|
983
|
+
expect(node_package_version_from_semver_exact.semver_wildcard?).to be false
|
984
|
+
end
|
985
|
+
end
|
986
|
+
|
987
|
+
context "when using a beta version" do
|
988
|
+
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
989
|
+
|
990
|
+
it "#raw returns the raw version" do
|
991
|
+
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
992
|
+
end
|
993
|
+
|
994
|
+
it "#major_minor_patch returns an array" do
|
995
|
+
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
996
|
+
end
|
997
|
+
|
998
|
+
it "#skip_processing? returns false" do
|
999
|
+
expect(node_package_version_from_beta.skip_processing?).to be false
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
it "#semver_wildcard? returns false" do
|
1003
|
+
expect(node_package_version_from_beta.semver_wildcard?).to be false
|
1004
|
+
end
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
context "when using a caret constraint" do
|
1008
|
+
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
1009
|
+
|
1010
|
+
it "#raw returns the raw version" do
|
1011
|
+
expect(node_package_version_from_semver_caret.raw).to eq "6.6.0"
|
1012
|
+
end
|
1013
|
+
|
1014
|
+
it "#major_minor_patch returns an array" do
|
1015
|
+
expect(node_package_version_from_semver_caret.major_minor_patch).to eq ["6", "6", "0"]
|
1016
|
+
end
|
1017
|
+
|
1018
|
+
it "#skip_processing? returns false" do
|
1019
|
+
expect(node_package_version_from_semver_caret.skip_processing?).to be false
|
1020
|
+
end
|
1021
|
+
|
1022
|
+
it "#semver_wildcard? returns false" do
|
1023
|
+
expect(node_package_version_from_semver_caret.semver_wildcard?).to be false
|
1024
|
+
end
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
context "when using a tilde constraint" do
|
1028
|
+
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
1029
|
+
|
1030
|
+
it "#raw returns the raw version" do
|
1031
|
+
expect(node_package_version_from_semver_tilde.raw).to eq "6.0.2"
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
it "#major_minor_patch returns an array" do
|
1035
|
+
expect(node_package_version_from_semver_tilde.major_minor_patch).to eq ["6", "0", "2"]
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
it "#skip_processing? returns false" do
|
1039
|
+
expect(node_package_version_from_semver_tilde.skip_processing?).to be false
|
1040
|
+
end
|
1041
|
+
|
1042
|
+
it "#semver_wildcard? returns false" do
|
1043
|
+
expect(node_package_version_from_semver_tilde.semver_wildcard?).to be false
|
1044
|
+
end
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
context "when using a relative path" do
|
1048
|
+
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
1049
|
+
|
1050
|
+
it "#raw returns the raw version" do
|
1051
|
+
expect(node_package_version_from_relative_path.raw).to eq "../.."
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
it "#major_minor_patch returns nil" do
|
1055
|
+
expect(node_package_version_from_relative_path.major_minor_patch).to be nil
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
it "#skip_processing? returns true" do
|
1059
|
+
expect(node_package_version_from_relative_path.skip_processing?).to be true
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
it "#semver_wildcard? returns false" do
|
1063
|
+
expect(node_package_version_from_relative_path.semver_wildcard?).to be false
|
1064
|
+
end
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
context "when using a git url" do
|
1068
|
+
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
1069
|
+
|
1070
|
+
it "#raw returns the raw version" do
|
1071
|
+
expect(node_package_version_from_git_url.raw).to eq "7.0.2"
|
1072
|
+
end
|
1073
|
+
|
1074
|
+
it "#major_minor_patch returns an array" do
|
1075
|
+
expect(node_package_version_from_git_url.major_minor_patch).to eq ["7", "0", "2"]
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
it "#skip_processing? returns false" do
|
1079
|
+
expect(node_package_version_from_git_url.skip_processing?).to be false
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
it "#semver_wildcard? returns false" do
|
1083
|
+
expect(node_package_version_from_git_url.semver_wildcard?).to be false
|
1084
|
+
end
|
1085
|
+
end
|
1086
|
+
|
1087
|
+
context "when using a github url" do
|
1088
|
+
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
1089
|
+
|
1090
|
+
it "#raw returns the raw version" do
|
1091
|
+
expect(node_package_version_from_github_url.raw).to eq "7.0.2"
|
1092
|
+
end
|
1093
|
+
|
1094
|
+
it "#major_minor_patch returns version array" do
|
1095
|
+
expect(node_package_version_from_github_url.major_minor_patch).to eq ["7", "0", "2"]
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
it "#skip_processing? returns false" do
|
1099
|
+
expect(node_package_version_from_github_url.skip_processing?).to be false
|
1100
|
+
end
|
1101
|
+
|
1102
|
+
it "#semver_wildcard? returns false" do
|
1103
|
+
expect(node_package_version_from_github_url.semver_wildcard?).to be false
|
1104
|
+
end
|
1105
|
+
end
|
1106
|
+
|
1107
|
+
context "when shakapacker is not a dependency" do
|
1108
|
+
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
1109
|
+
|
1110
|
+
it "#raw returns an empty string" do
|
1111
|
+
expect(node_package_version_from_without.raw).to eq ""
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
it "#major_minor_patch returns nil" do
|
1115
|
+
expect(node_package_version_from_without.major_minor_patch).to be nil
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
it "#skip_processing? returns true" do
|
1119
|
+
expect(node_package_version_from_without.skip_processing?).to be true
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
it "#semver_wildcard? returns false" do
|
1123
|
+
expect(node_package_version_from_without.semver_wildcard?).to be false
|
1124
|
+
end
|
1125
|
+
end
|
1126
|
+
end
|
1127
|
+
|
1128
|
+
context "with pnpm-lock.yaml v8" do
|
1129
|
+
def node_package_version(fixture_version:)
|
1130
|
+
Shakapacker::VersionChecker::NodePackageVersion.new(
|
1131
|
+
File.expand_path("../fixtures/#{fixture_version}_package.json", __dir__),
|
1132
|
+
"file/does/not/exist",
|
1133
|
+
"file/does/not/exist",
|
1134
|
+
File.expand_path("../fixtures/#{fixture_version}_pnpm-lock.v8.yaml", __dir__)
|
1135
|
+
)
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
context "when using an exact semantic version" do
|
1139
|
+
let(:node_package_version_from_semver_exact) { node_package_version(fixture_version: "semver_exact") }
|
1140
|
+
|
1141
|
+
it "#raw returns the raw version" do
|
1142
|
+
expect(node_package_version_from_semver_exact.raw).to eq "6.0.0"
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
it "#major_minor_patch returns an array" do
|
1146
|
+
expect(node_package_version_from_semver_exact.major_minor_patch).to eq ["6", "0", "0"]
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
it "#skip_processing? returns false" do
|
1150
|
+
expect(node_package_version_from_semver_exact.skip_processing?).to be false
|
1151
|
+
end
|
1152
|
+
|
1153
|
+
it "#semver_wildcard? returns false" do
|
1154
|
+
expect(node_package_version_from_semver_exact.semver_wildcard?).to be false
|
1155
|
+
end
|
1156
|
+
end
|
1157
|
+
|
1158
|
+
context "when using a beta version" do
|
1159
|
+
let(:node_package_version_from_beta) { node_package_version(fixture_version: "beta") }
|
1160
|
+
|
1161
|
+
it "#raw returns the raw version" do
|
1162
|
+
expect(node_package_version_from_beta.raw).to eq "6.1.0-beta.0"
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
it "#major_minor_patch returns an array" do
|
1166
|
+
expect(node_package_version_from_beta.major_minor_patch).to eq ["6", "1", "0"]
|
1167
|
+
end
|
1168
|
+
|
1169
|
+
it "#skip_processing? returns false" do
|
1170
|
+
expect(node_package_version_from_beta.skip_processing?).to be false
|
1171
|
+
end
|
1172
|
+
|
1173
|
+
it "#semver_wildcard? returns false" do
|
1174
|
+
expect(node_package_version_from_beta.semver_wildcard?).to be false
|
1175
|
+
end
|
1176
|
+
end
|
1177
|
+
|
1178
|
+
context "when using a caret constraint" do
|
1179
|
+
let(:node_package_version_from_semver_caret) { node_package_version(fixture_version: "semver_caret") }
|
1180
|
+
|
1181
|
+
it "#raw returns the raw version" do
|
1182
|
+
expect(node_package_version_from_semver_caret.raw).to eq "6.0.0"
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
it "#major_minor_patch returns an array" do
|
1186
|
+
expect(node_package_version_from_semver_caret.major_minor_patch).to eq ["6", "0", "0"]
|
1187
|
+
end
|
1188
|
+
|
1189
|
+
it "#skip_processing? returns false" do
|
1190
|
+
expect(node_package_version_from_semver_caret.skip_processing?).to be false
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
it "#semver_wildcard? returns false" do
|
1194
|
+
expect(node_package_version_from_semver_caret.semver_wildcard?).to be false
|
1195
|
+
end
|
1196
|
+
end
|
1197
|
+
|
1198
|
+
context "when using a tilde constraint" do
|
1199
|
+
let(:node_package_version_from_semver_tilde) { node_package_version(fixture_version: "semver_tilde") }
|
1200
|
+
|
1201
|
+
it "#raw returns the raw version" do
|
1202
|
+
expect(node_package_version_from_semver_tilde.raw).to eq "6.0.0"
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
it "#major_minor_patch returns an array" do
|
1206
|
+
expect(node_package_version_from_semver_tilde.major_minor_patch).to eq ["6", "0", "0"]
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
it "#skip_processing? returns false" do
|
1210
|
+
expect(node_package_version_from_semver_tilde.skip_processing?).to be false
|
1211
|
+
end
|
1212
|
+
|
1213
|
+
it "#semver_wildcard? returns false" do
|
1214
|
+
expect(node_package_version_from_semver_tilde.semver_wildcard?).to be false
|
1215
|
+
end
|
1216
|
+
end
|
1217
|
+
|
1218
|
+
context "when using a relative path" do
|
1219
|
+
let(:node_package_version_from_relative_path) { node_package_version(fixture_version: "relative_path") }
|
1220
|
+
|
1221
|
+
it "#raw returns the raw version" do
|
1222
|
+
expect(node_package_version_from_relative_path.raw).to eq "../.."
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
it "#major_minor_patch returns nil" do
|
1226
|
+
expect(node_package_version_from_relative_path.major_minor_patch).to be nil
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
it "#skip_processing? returns true" do
|
1230
|
+
expect(node_package_version_from_relative_path.skip_processing?).to be true
|
1231
|
+
end
|
1232
|
+
|
1233
|
+
it "#semver_wildcard? returns false" do
|
1234
|
+
expect(node_package_version_from_relative_path.semver_wildcard?).to be false
|
1235
|
+
end
|
1236
|
+
end
|
1237
|
+
|
1238
|
+
context "when using a git url" do
|
1239
|
+
let(:node_package_version_from_git_url) { node_package_version(fixture_version: "git_url") }
|
1240
|
+
|
1241
|
+
it "#raw returns the raw version" do
|
1242
|
+
expect(node_package_version_from_git_url.raw).to eq "7.0.2"
|
1243
|
+
end
|
1244
|
+
|
1245
|
+
it "#major_minor_patch returns an array" do
|
1246
|
+
expect(node_package_version_from_git_url.major_minor_patch).to eq ["7", "0", "2"]
|
1247
|
+
end
|
1248
|
+
|
1249
|
+
it "#skip_processing? returns false" do
|
1250
|
+
expect(node_package_version_from_git_url.skip_processing?).to be false
|
1251
|
+
end
|
1252
|
+
|
1253
|
+
it "#semver_wildcard? returns false" do
|
1254
|
+
expect(node_package_version_from_git_url.semver_wildcard?).to be false
|
1255
|
+
end
|
1256
|
+
end
|
1257
|
+
|
1258
|
+
context "when using a github url" do
|
1259
|
+
let(:node_package_version_from_github_url) { node_package_version(fixture_version: "github_url") }
|
1260
|
+
|
1261
|
+
it "#raw returns the raw version" do
|
1262
|
+
expect(node_package_version_from_github_url.raw).to eq "7.0.2"
|
1263
|
+
end
|
1264
|
+
|
1265
|
+
it "#major_minor_patch returns an array" do
|
1266
|
+
expect(node_package_version_from_github_url.major_minor_patch).to eq ["7", "0", "2"]
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
it "#skip_processing? returns false" do
|
1270
|
+
expect(node_package_version_from_github_url.skip_processing?).to be false
|
1271
|
+
end
|
1272
|
+
|
1273
|
+
it "#semver_wildcard? returns false" do
|
1274
|
+
expect(node_package_version_from_github_url.semver_wildcard?).to be false
|
1275
|
+
end
|
1276
|
+
end
|
1277
|
+
|
1278
|
+
context "when shakapacker is not a dependency" do
|
932
1279
|
let(:node_package_version_from_without) { node_package_version(fixture_version: "without") }
|
933
1280
|
|
934
|
-
it "#raw returns empty string" do
|
1281
|
+
it "#raw returns an empty string" do
|
935
1282
|
expect(node_package_version_from_without.raw).to eq ""
|
936
1283
|
end
|
937
1284
|
|