dependabot-npm_and_yarn 0.112.3 → 0.112.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9e491e063f1931c600351217233cbebab381310b4f67a656ffb98066e715d65
4
- data.tar.gz: 7aa0d8ce2889ef4ac2e5146a250ba8e0b92ce352911f882a7bf2aab0dd2126c3
3
+ metadata.gz: 1541f937bcd8a69e491b218bc5ad4bd8ed3fcd1e942b751594d4459010d1745c
4
+ data.tar.gz: cb7163c127617a4799e0eab97fd3db30168aa4393fca8bc6d87ddfe68cd06c4a
5
5
  SHA512:
6
- metadata.gz: e2ccd6ed91917fc9cf1b2a2c5d31e9dc4a6ba631773712775a47cfb5d350b4ad317be2c0966ccb375387db0cbffef9031c9155e9cdbe5cdb597cd1120f8b8feb
7
- data.tar.gz: 29a793318150a188960be72be45c7c96228f10524c6ab32c48199f769209c47c992f3d57bc572e0636b7c84912b0f921778bf4e35d5737dc82f13b9cec22aa18
6
+ metadata.gz: ab7abf69f410be40daac4eceaf7424960e3b12aac0f6660e11f0fb170f0f9845a6997506e1877ec2e235be15f5c94ed7300f4e580703148106ab52c32122eea1
7
+ data.tar.gz: 50be852418ded3014b1119257c3745db509adeea1b02da8bea77e40b4d6743feb8cf9c7559d00cd76abbbd858e300355071fd4dffcf1018d4a81ef78124937cb
@@ -382,6 +382,7 @@ module Dependabot
382
382
  # git dependencies, otherwise npm will (unhelpfully) update them
383
383
  updated_content = lock_git_deps(updated_content)
384
384
  updated_content = replace_ssh_sources(updated_content)
385
+ updated_content = lock_deps_with_latest_reqs(updated_content)
385
386
 
386
387
  updated_content = sanitized_package_json_content(updated_content)
387
388
  File.write(file.name, updated_content)
@@ -442,6 +443,24 @@ module Dependabot
442
443
  @git_dependencies_to_lock
443
444
  end
444
445
 
446
+ # When a package.json version requirement is set to `latest`, npm will
447
+ # always try to update these dependencies when doing an `npm install`,
448
+ # regardless of lockfile version. Prevent any unrelated updates by
449
+ # changing the version requirement to `*` while updating the lockfile.
450
+ def lock_deps_with_latest_reqs(content)
451
+ json = JSON.parse(content)
452
+
453
+ NpmAndYarn::FileParser::DEPENDENCY_TYPES.each do |type|
454
+ json.fetch(type, {}).each do |nm, requirement|
455
+ next unless requirement == "latest"
456
+
457
+ json[type][nm] = "*"
458
+ end
459
+ end
460
+
461
+ json.to_json
462
+ end
463
+
445
464
  def replace_ssh_sources(content)
446
465
  updated_content = content
447
466
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-npm_and_yarn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.112.3
4
+ version: 0.112.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.112.3
19
+ version: 0.112.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.112.3
26
+ version: 0.112.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement