dependabot-npm_and_yarn 0.393.0 → 0.394.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1481759eec408f64e482e4e1bceaafa4aa734e83b2460268619b621f839e1c5d
4
- data.tar.gz: b24446bf888aaf2aa608de5c691a52a6b2b6baf7c55e44e6f25cf34f9bc3e235
3
+ metadata.gz: 3d36a6e6eb18ebce010518361fb49966de62ff78dd9da7a13f14c59aaedf5e7a
4
+ data.tar.gz: 7ed614ce2517bd8a198deb502ab46635a5019a810224ec0bbaed0066fc9e51c9
5
5
  SHA512:
6
- metadata.gz: 72c68a5ce7135a4b460124b84bfdfd0fa4c4a8d936e6f2047c1f83ae12563d8f86d3ac713e34abf8c800e637453d191262f414dad8c2b9bb00525e8131b257cd
7
- data.tar.gz: 567ca2b4fa3395a62554d4ab8a06e9e37377e681e3d4f91b16b52bce7fafbf58c5723c2be443246fa89e691cbddb466fe05d89564af384a2605da685a0d83ce8
6
+ metadata.gz: 58cf8b10de32b220cd9d72785b267d4f2d1a4d629d24cbe5c718c42b88354b1e42d75ecce54ed339394427ff9be8a99c3302db44aabd21f09df21a73c1b7158a
7
+ data.tar.gz: f4a98484a049955ae19f3db664bb7a760e345a14c7db2452f179dedbd242e1925afe6efdc2b1bc51607442e571d06f245644a78eca68fbc9772b244fbbacde1f
@@ -104,8 +104,7 @@ module Dependabot
104
104
 
105
105
  # Filter excluded files from final collection
106
106
  filtered_files = fetched_files.uniq.reject do |file|
107
- Dependabot::Experiments.enabled?(:enable_exclude_paths_subdirectory_manifest_files) &&
108
- !@exclude_paths.empty? && Dependabot::FileFiltering.exclude_path?(file.name, @exclude_paths)
107
+ !@exclude_paths.empty? && Dependabot::FileFiltering.exclude_path?(file.name, @exclude_paths)
109
108
  end
110
109
 
111
110
  filtered_files
@@ -486,8 +485,7 @@ module Dependabot
486
485
  next if fetched_files.map(&:name).include?(cleaned_name)
487
486
 
488
487
  # Skip excluded path dependencies
489
- if Dependabot::Experiments.enabled?(:enable_exclude_paths_subdirectory_manifest_files) &&
490
- !@exclude_paths.empty? && Dependabot::FileFiltering.exclude_path?(cleaned_name, @exclude_paths)
488
+ if !@exclude_paths.empty? && Dependabot::FileFiltering.exclude_path?(cleaned_name, @exclude_paths)
491
489
  Dependabot.logger.warn(
492
490
  "Skipping excluded path dependency '#{cleaned_name}' for package '#{name}'. " \
493
491
  "This file is excluded by exclude_paths configuration: #{@exclude_paths}"
@@ -727,8 +725,7 @@ module Dependabot
727
725
  file = File.join(workspace, MANIFEST_FILENAME)
728
726
 
729
727
  # Skip excluded workspace packages
730
- if Dependabot::Experiments.enabled?(:enable_exclude_paths_subdirectory_manifest_files) &&
731
- !@exclude_paths.empty? && Dependabot::FileFiltering.exclude_path?(file, @exclude_paths)
728
+ if !@exclude_paths.empty? && Dependabot::FileFiltering.exclude_path?(file, @exclude_paths)
732
729
  Dependabot.logger.info(
733
730
  "Skipping excluded workspace package '#{file}' from workspace '#{workspace}'. " \
734
731
  "This file is excluded by exclude_paths configuration: #{@exclude_paths}"
@@ -229,45 +229,31 @@ module Dependabot
229
229
  PNPM_FALLBACK_VERSION
230
230
  end
231
231
 
232
- # The concrete pnpm version that will run for this update — resolved via
233
- # Corepack when the corepack experiment is enabled (honouring the repo's
234
- # `packageManager` pin), otherwise the pnpm on PATH. Returns nil when the
235
- # version can't be determined. Used to gate version-specific config such as
232
+ # The concrete pnpm version that will run for this update. Returns nil when
233
+ # the version can't be determined. Used to gate version-specific config such as
236
234
  # `minimumReleaseAge` (added in pnpm 10.16) and `minimumReleaseAgeStrict`
237
235
  # (added in pnpm 11.0), which older pnpm versions silently ignore.
238
236
  sig { returns(T.nilable(Dependabot::Version)) }
239
237
  def self.pnpm_version
240
- raw = if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
241
- package_manager_version(PNPMPackageManager::NAME, env: merge_corepack_env(nil))
242
- else
243
- local_package_manager_version(PNPMPackageManager::NAME)
244
- end
238
+ raw = local_package_manager_version(PNPMPackageManager::NAME)
245
239
  Version.new(raw)
246
240
  rescue StandardError => e
247
241
  Dependabot.logger.warn("Could not determine pnpm version to gate release-age settings: #{e.message}")
248
242
  nil
249
243
  end
250
244
 
251
- # The concrete npm version that will run — via Corepack when the corepack
252
- # experiment is enabled (honouring the repo's `packageManager` pin, which can
253
- # select npm 7-11), otherwise the npm on PATH. Returns nil when it can't be
254
- # determined. Used to gate `--min-release-age`, added in npm 11.10.
245
+ # The concrete npm version that will run. Returns nil when it can't be determined.
246
+ # Used to gate `--min-release-age`, added in npm 11.10.
255
247
  sig { returns(T.nilable(Dependabot::Version)) }
256
248
  def self.npm_version
257
- raw = if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
258
- package_manager_version(NpmPackageManager::NAME, env: merge_corepack_env(nil))
259
- else
260
- local_package_manager_version(NpmPackageManager::NAME)
261
- end
249
+ raw = local_package_manager_version(NpmPackageManager::NAME)
262
250
  Version.new(raw)
263
251
  rescue StandardError => e
264
252
  Dependabot.logger.warn("Could not determine npm version to gate release-age settings: #{e.message}")
265
253
  nil
266
254
  end
267
255
 
268
- # True when the running npm supports `--min-release-age` (npm 11.10+). Because
269
- # npm runs through Corepack, a repo pinned to an older npm via `packageManager`
270
- # would reject the flag, so the cooldown gate must be skipped for it.
256
+ # True when the running npm supports `--min-release-age` (npm 11.10+).
271
257
  sig { returns(T::Boolean) }
272
258
  def self.npm_supports_min_release_age?
273
259
  version = npm_version
@@ -452,10 +438,6 @@ module Dependabot
452
438
  end
453
439
 
454
440
  # Run single npm command returning stdout/stderr.
455
- #
456
- # NOTE: Needs to be explicitly run through corepack to respect the
457
- # `packageManager` setting in `package.json`, because corepack does not
458
- # add shims for NPM.
459
441
  sig do
460
442
  params(
461
443
  command: String,
@@ -464,22 +446,12 @@ module Dependabot
464
446
  ).returns(String)
465
447
  end
466
448
  def self.run_npm_command(command, fingerprint: command, env: nil)
467
- merged_env = merge_corepack_env(env)
468
- if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
469
- package_manager_run_command(
470
- NpmPackageManager::NAME,
471
- command,
472
- fingerprint: fingerprint,
473
- output_observer: ->(output) { command_observer(output) },
474
- env: merged_env
475
- )
476
- else
477
- Dependabot::SharedHelpers.run_shell_command(
478
- "npm #{command}",
479
- fingerprint: "npm #{fingerprint}",
480
- output_observer: ->(output) { command_observer(output) }
481
- )
482
- end
449
+ Dependabot::SharedHelpers.run_shell_command(
450
+ "npm #{command}",
451
+ fingerprint: "npm #{fingerprint}",
452
+ output_observer: ->(output) { command_observer(output) },
453
+ env: env
454
+ )
483
455
  end
484
456
 
485
457
  sig do
@@ -551,15 +523,11 @@ module Dependabot
551
523
  ).returns(String)
552
524
  end
553
525
  def self.run_pnpm_command(command, fingerprint: nil, env: nil)
554
- if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
555
- merged_env = merge_corepack_env(env)
556
- package_manager_run_command(PNPMPackageManager::NAME, command, fingerprint: fingerprint, env: merged_env)
557
- else
558
- Dependabot::SharedHelpers.run_shell_command(
559
- "pnpm #{command}",
560
- fingerprint: "pnpm #{fingerprint || command}"
561
- )
562
- end
526
+ Dependabot::SharedHelpers.run_shell_command(
527
+ "pnpm #{command}",
528
+ fingerprint: "pnpm #{fingerprint || command}",
529
+ env: env
530
+ )
563
531
  end
564
532
 
565
533
  # Run single yarn command returning stdout/stderr
@@ -571,16 +539,11 @@ module Dependabot
571
539
  ).returns(String)
572
540
  end
573
541
  def self.run_single_yarn_command(command, fingerprint: nil, env: nil)
574
- if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
575
- merged_env = merge_corepack_env(env)
576
- package_manager_run_command(YarnPackageManager::NAME, command, fingerprint: fingerprint, env: merged_env)
577
- else
578
- Dependabot::SharedHelpers.run_shell_command(
579
- "yarn #{command}",
580
- fingerprint: "yarn #{fingerprint || command}",
581
- env: env
582
- )
583
- end
542
+ Dependabot::SharedHelpers.run_shell_command(
543
+ "yarn #{command}",
544
+ fingerprint: "yarn #{fingerprint || command}",
545
+ env: env
546
+ )
584
547
  end
585
548
 
586
549
  # Activate the package manager for specified version by using corepack
@@ -768,7 +731,6 @@ module Dependabot
768
731
 
769
732
  sig { returns(T.nilable(T::Hash[String, String])) }
770
733
  def self.build_corepack_env_variables
771
- return nil unless Dependabot::Experiments.enabled?(:enable_private_registry_for_corepack)
772
734
  return nil if dependency_files.nil? || credentials.nil?
773
735
 
774
736
  files = T.must(dependency_files)
@@ -1,4 +1,4 @@
1
- # typed: strict
1
+ # typed: strong
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "json"
@@ -6,6 +6,7 @@ require "excon"
6
6
  require "time"
7
7
  require "dependabot/package/package_release"
8
8
  require "dependabot/package/package_details"
9
+ require "dependabot/package/npm_registry_package"
9
10
  require "dependabot/npm_and_yarn/package/registry_finder"
10
11
  require "dependabot/npm_and_yarn/package/registry_credential_helpers"
11
12
 
@@ -23,17 +24,8 @@ module Dependabot
23
24
  API_AUTHORIZATION_VALUE_BASIC_PREFIX = "Basic"
24
25
  API_RESPONSE_STATUS_SUCCESS_PREFIX = "2"
25
26
 
26
- RELEASE_TIME_KEY = "time"
27
- RELEASE_VERSIONS_KEY = "versions"
28
- RELEASE_DIST_TAGS_KEY = "dist-tags"
29
27
  RELEASE_DIST_TAGS_LATEST_KEY = "latest"
30
- RELEASE_ENGINES_KEY = "engines"
31
28
  RELEASE_LANGUAGE_KEY = "node"
32
- RELEASE_DEPRECATION_KEY = "deprecated"
33
- RELEASE_REPOSITORY_KEY = "repository"
34
- RELEASE_PACKAGE_TYPE_KEY = "type"
35
- RELEASE_PACKAGE_TYPE_GIT = "git"
36
- RELEASE_PACKAGE_TYPE_NPM = "npm"
37
29
 
38
30
  REGISTRY_FILE_NPMRC = ".npmrc"
39
31
  REGISTRY_FILE_YARNRC = ".yarnrc"
@@ -55,7 +47,7 @@ module Dependabot
55
47
  @dependency_files = dependency_files
56
48
  @credentials = credentials
57
49
 
58
- @npm_details = T.let(nil, T.nilable(T::Hash[String, T.untyped]))
50
+ @npm_details = T.let(nil, T.nilable(Dependabot::Package::NpmRegistryPackage))
59
51
  @dist_tags = T.let(nil, T.nilable(T::Hash[String, String]))
60
52
  @registry_finder = T.let(nil, T.nilable(Package::RegistryFinder))
61
53
  @version_endpoint_working = T.let(nil, T.nilable(T::Boolean))
@@ -86,7 +78,7 @@ module Dependabot
86
78
  !dist_tags.nil?
87
79
  end
88
80
 
89
- sig { returns(T.nilable(T::Hash[String, T.untyped])) }
81
+ sig { returns(T.nilable(Dependabot::Package::NpmRegistryPackage)) }
90
82
  def npm_details
91
83
  @npm_details ||= fetch_npm_details
92
84
  end
@@ -165,32 +157,26 @@ module Dependabot
165
157
 
166
158
  sig do
167
159
  params(
168
- npm_data: T::Hash[String, T.untyped]
160
+ npm_data: Dependabot::Package::NpmRegistryPackage
169
161
  ).returns(T::Array[Dependabot::Package::PackageRelease])
170
162
  end
171
163
  def parse_versions(npm_data)
172
- time_data = fetch_value_from_hash(npm_data, RELEASE_TIME_KEY) || {}
173
- versions_data = fetch_value_from_hash(npm_data, RELEASE_VERSIONS_KEY) || {}
164
+ latest_version = npm_data.dist_tags&.[](RELEASE_DIST_TAGS_LATEST_KEY)
174
165
 
175
- dist_tags = fetch_value_from_hash(npm_data, RELEASE_DIST_TAGS_KEY)
176
- latest_version = fetch_value_from_hash(dist_tags, RELEASE_DIST_TAGS_LATEST_KEY)
177
-
178
- versions_data.filter_map do |version, details|
179
- next unless Dependabot::NpmAndYarn::Version.correct?(version)
180
-
181
- package_type = infer_package_type(details)
166
+ npm_data.releases.values.filter_map do |release|
167
+ next unless Dependabot::NpmAndYarn::Version.correct?(release.version)
182
168
 
183
169
  Dependabot::Package::PackageRelease.new(
184
- version: Version.new(version),
185
- released_at: time_data[version] ? Time.parse(time_data[version]) : nil,
170
+ version: Version.new(release.version),
171
+ released_at: release.released_at,
186
172
  yanked: false,
187
173
  yanked_reason: nil,
188
174
  downloads: nil,
189
- latest: latest_version.to_s == version,
190
- url: package_version_url(version),
191
- package_type: package_type,
192
- language: package_language(details),
193
- details: details
175
+ latest: latest_version == release.version,
176
+ url: package_version_url(release.version),
177
+ package_type: release.package_type,
178
+ language: package_language(release.node_requirement),
179
+ details: release.details
194
180
  )
195
181
  end.sort_by(&:version).reverse
196
182
  end
@@ -200,39 +186,31 @@ module Dependabot
200
186
  "#{dependency_registry}/#{@dependency.name}/v/#{version}"
201
187
  end
202
188
 
203
- sig do
204
- params(version_details: T::Hash[String, T.untyped])
205
- .returns(T.nilable(Dependabot::Package::PackageLanguage))
206
- end
207
- def package_language(version_details)
208
- # Fetch the engines hash from the version details
209
- engines = version_details.is_a?(Hash) ? version_details[RELEASE_ENGINES_KEY] : nil
210
- # Check if engines is a hash and fetch the node requirement
211
- node_requirement = engines.is_a?(Hash) ? engines.fetch(RELEASE_LANGUAGE_KEY, nil) : nil
212
-
189
+ sig { params(node_requirement: T.nilable(String)).returns(T.nilable(Dependabot::Package::PackageLanguage)) }
190
+ def package_language(node_requirement)
213
191
  return nil unless node_requirement
214
192
 
215
- if node_requirement
216
- Dependabot::Package::PackageLanguage.new(
217
- name: RELEASE_LANGUAGE_KEY,
218
- version: nil,
219
- requirement: Requirement.new(node_requirement)
220
- )
221
- end
193
+ Dependabot::Package::PackageLanguage.new(
194
+ name: RELEASE_LANGUAGE_KEY,
195
+ version: nil,
196
+ requirement: Requirement.new(node_requirement)
197
+ )
222
198
  rescue Gem::Requirement::BadRequirementError
223
199
  nil
224
200
  end
225
201
 
226
202
  sig { returns(T.nilable(T::Hash[String, String])) }
227
203
  def dist_tags
228
- @dist_tags ||= fetch_value_from_hash(npm_details, RELEASE_DIST_TAGS_KEY)
204
+ @dist_tags ||= npm_details&.dist_tags
229
205
  end
230
206
 
231
- sig { returns(T.nilable(T::Hash[String, T.untyped])) }
207
+ sig { returns(T.nilable(Dependabot::Package::NpmRegistryPackage)) }
232
208
  def fetch_npm_details
233
209
  npm_response = fetch_npm_response
234
210
  check_npm_response(npm_response) if npm_response
235
- JSON.parse(npm_response.body)
211
+ Dependabot::Package::NpmRegistryPackage.from_json(npm_response.body) do |version|
212
+ Dependabot::NpmAndYarn::Version.correct?(version)
213
+ end
236
214
  rescue JSON::ParserError, Excon::Error::Timeout, Excon::Error::Socket, RegistryError => e
237
215
  if git_dependency?
238
216
  nil
@@ -257,10 +235,10 @@ module Dependabot
257
235
  # If a private registry returns a 500 error, check authentication
258
236
  return response unless response.status == 500
259
237
 
260
- auth = fetch_value_from_hash(registry_auth_headers, API_AUTHORIZATION_KEY)
238
+ auth = registry_auth_headers[API_AUTHORIZATION_KEY]
261
239
  return response unless auth
262
240
 
263
- return response unless auth&.start_with?(API_AUTHORIZATION_VALUE_BASIC_PREFIX)
241
+ return response unless auth.start_with?(API_AUTHORIZATION_VALUE_BASIC_PREFIX)
264
242
 
265
243
  decoded_token = Base64.decode64(auth.gsub("#{API_AUTHORIZATION_VALUE_BASIC_PREFIX} ", "")).strip
266
244
 
@@ -282,29 +260,6 @@ module Dependabot
282
260
  raise DependencyFileNotResolvable, e.message
283
261
  end
284
262
 
285
- sig do
286
- params(
287
- details: T::Hash[String, T.untyped],
288
- git_dependency: T::Boolean
289
- )
290
- .returns(String)
291
- end
292
- def infer_package_type(details, git_dependency: false)
293
- return RELEASE_PACKAGE_TYPE_GIT if git_dependency
294
-
295
- repository = fetch_value_from_hash(details, RELEASE_REPOSITORY_KEY)
296
-
297
- case repository
298
- when String
299
- return repository.start_with?("git+") ? RELEASE_PACKAGE_TYPE_GIT : RELEASE_PACKAGE_TYPE_NPM
300
- when Hash
301
- type = fetch_value_from_hash(repository, RELEASE_PACKAGE_TYPE_KEY)
302
- return RELEASE_PACKAGE_TYPE_GIT if type == RELEASE_PACKAGE_TYPE_GIT
303
- end
304
-
305
- RELEASE_PACKAGE_TYPE_NPM
306
- end
307
-
308
263
  sig { params(npm_response: Excon::Response).void }
309
264
  def check_npm_response(npm_response)
310
265
  return if git_dependency?
@@ -339,7 +294,7 @@ module Dependabot
339
294
  raise RegistryError.new(status, msg)
340
295
  end
341
296
 
342
- sig { params(error: StandardError).void }
297
+ sig { params(error: StandardError).returns(T.noreturn) }
343
298
  def raise_npm_details_error(error)
344
299
  raise if dependency_registry == GLOBAL_REGISTRY
345
300
  raise unless error.is_a?(Excon::Error::Timeout) || error.is_a?(Excon::Error::Socket)
@@ -379,8 +334,7 @@ module Dependabot
379
334
 
380
335
  sig { params(npm_response: Excon::Response).returns(T::Boolean) }
381
336
  def response_invalid_json?(npm_response)
382
- result = JSON.parse(npm_response.body)
383
- result.is_a?(Hash) || result.is_a?(Array)
337
+ T.cast(JSON.parse(npm_response.body), Object)
384
338
  false
385
339
  rescue JSON::ParserError, TypeError
386
340
  true
@@ -438,15 +392,6 @@ module Dependabot
438
392
  credentials: credentials
439
393
  ).git_dependency?
440
394
  end
441
-
442
- # This function safely retrieves a value for a given key from a Hash.
443
- # If the hash is valid and the key exists, it will return the value, otherwise nil.
444
- sig { params(hash: T.untyped, key: T.untyped).returns(T.untyped) }
445
- def fetch_value_from_hash(hash, key)
446
- return nil unless hash.is_a?(Hash) # Return nil if the hash is not a Hash
447
-
448
- hash.fetch(key, nil) # Fetch the value for the given key, defaulting to nil if not found
449
- end
450
395
  end
451
396
  end
452
397
  end
@@ -289,9 +289,7 @@ module Dependabot
289
289
  :current_engine_version
290
290
 
291
291
  # rubocop:disable Metrics/CyclomaticComplexity
292
- # rubocop:disable Metrics/AbcSize
293
292
  # rubocop:disable Metrics/PerceivedComplexity
294
- # rubocop:disable Metrics/MethodLength
295
293
  sig { params(name: String).returns(T.nilable(T.any(Integer, String))) }
296
294
  def setup(name)
297
295
  # we prioritize version mentioned in "packageManager" instead of "engines"
@@ -325,36 +323,23 @@ module Dependabot
325
323
  )
326
324
  end
327
325
 
328
- if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
329
- version ||= requested_version(name) || guessed_version(name)
326
+ version ||= requested_version(name)
330
327
 
331
- if version
332
- raise_if_unsupported!(name, version.to_s)
333
- install(name, version.to_s)
334
- end
328
+ if version
329
+ raise_if_unsupported!(name, version.to_s)
330
+ install(name, version)
335
331
  else
336
- version ||= requested_version(name)
332
+ version = guessed_version(name)
337
333
 
338
334
  if version
339
335
  raise_if_unsupported!(name, version.to_s)
340
-
341
- install(name, version)
342
- else
343
- version = guessed_version(name)
344
-
345
- if version
346
- raise_if_unsupported!(name, version.to_s)
347
-
348
- install(name, version.to_s) if name == PNPMPackageManager::NAME
349
- end
336
+ install(name, version.to_s) if name == PNPMPackageManager::NAME
350
337
  end
351
338
  end
352
339
  version
353
340
  end
354
341
  # rubocop:enable Metrics/CyclomaticComplexity
355
- # rubocop:enable Metrics/AbcSize
356
342
  # rubocop:enable Metrics/PerceivedComplexity
357
- # rubocop:enable Metrics/MethodLength
358
343
 
359
344
  sig { params(name: String).returns(T.nilable(String)) }
360
345
  def detect_version(name)
@@ -457,15 +442,6 @@ module Dependabot
457
442
 
458
443
  sig { params(name: String, version: T.nilable(String)).void }
459
444
  def install(name, version)
460
- if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
461
- env = {}
462
- if Dependabot::Experiments.enabled?(:enable_private_registry_for_corepack)
463
- env = @registry_helper.find_corepack_env_variables
464
- end
465
- # Use the Helpers.install method to install the package manager
466
- return Helpers.install(name, version.to_s, env: env)
467
- end
468
-
469
445
  Dependabot.logger.info("Installing \"#{name}@#{version}\"")
470
446
 
471
447
  begin
@@ -971,10 +971,9 @@ module Dependabot
971
971
  ).returns(T.nilable(T.any(T::Hash[String, T.untyped], String, T::Array[T::Hash[String, T.untyped]])))
972
972
  end
973
973
  def run_npm8_checker(version:)
974
- env = corepack_registry_override_env
975
974
  cmd =
976
975
  "install #{version_install_arg(version: version)} --package-lock-only --dry-run=true --ignore-scripts"
977
- output = Helpers.run_npm_command(cmd, env: env)
976
+ output = Helpers.run_npm_command(cmd)
978
977
  if output.match?(NPM8_PEER_DEP_ERROR_REGEX)
979
978
  error_context = { command: cmd, process_exit_value: 1 }
980
979
  raise SharedHelpers::HelperSubprocessFailed.new(message: output, error_context: error_context)
@@ -983,19 +982,6 @@ module Dependabot
983
982
  raise if e.message.match?(NPM8_PEER_DEP_ERROR_REGEX)
984
983
  end
985
984
 
986
- sig { returns(T.nilable(T::Hash[String, String])) }
987
- def corepack_registry_override_env
988
- return nil unless Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
989
-
990
- replaces_base_cred = credentials.find { |cred| cred["type"] == "npm_registry" && cred.replaces_base? }
991
- registry_url = replaces_base_cred&.[]("registry")
992
- return nil unless registry_url
993
-
994
- registry_url = Dependabot::NpmAndYarn::RegistryHelper.normalize_registry_url(registry_url)
995
-
996
- { "npm_config_registry" => registry_url }
997
- end
998
-
999
985
  sig do
1000
986
  params(
1001
987
  version: T.nilable(T.any(String, Gem::Version))
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.393.0
4
+ version: 0.394.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.393.0
18
+ version: 0.394.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.393.0
25
+ version: 0.394.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -169,14 +169,14 @@ dependencies:
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '0.22'
172
+ version: '1.1'
173
173
  type: :development
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '0.22'
179
+ version: '1.1'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: turbo_tests
182
182
  requirement: !ruby/object:Gem::Requirement
@@ -388,7 +388,7 @@ licenses:
388
388
  - MIT
389
389
  metadata:
390
390
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
391
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.393.0
391
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.394.0
392
392
  rdoc_options: []
393
393
  require_paths:
394
394
  - lib