dependabot-npm_and_yarn 0.349.0 → 0.350.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/lib/dependabot/npm_and_yarn/helpers.rb +12 -12
- data/lib/dependabot/npm_and_yarn/registry_helper.rb +7 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c95e5a25dfbc888b7cbe14a06c8545a1dffa0223254983a4fea67b8e372a024
|
|
4
|
+
data.tar.gz: a47db5408d030fbc18d62679d22e3ace24b5f85cbb8de6ae2d153fd46a2c2c9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14d440ca0f12543d02ac0b1d49b6f943c88fec8abb6f96851dfbcb26db1f6737360acc8747f5cd2ee17eefcea34fc57b3e3ef04f6c84999527ef3516c56a3d2d
|
|
7
|
+
data.tar.gz: 64b4cd22bcbe18bc9d82231bce93291cce5dc75ebf43d9c8a40d5ee28f44b9cd2a1b8784b9dd919e5e72e1243bffe5f07bd471c9405d1dda1667ad30be3b2002
|
|
@@ -16,10 +16,11 @@ module Dependabot
|
|
|
16
16
|
/^.*(?<error>The "yarn-path" option has been set \(in [^)]+\), but the specified location doesn't exist)/
|
|
17
17
|
|
|
18
18
|
# NPM Version Constants
|
|
19
|
+
NPM_V11 = 11
|
|
19
20
|
NPM_V10 = 10
|
|
20
21
|
NPM_V8 = 8
|
|
21
22
|
NPM_V6 = 6
|
|
22
|
-
NPM_DEFAULT_VERSION =
|
|
23
|
+
NPM_DEFAULT_VERSION = NPM_V11
|
|
23
24
|
|
|
24
25
|
# PNPM Version Constants
|
|
25
26
|
PNPM_V10 = 10
|
|
@@ -65,7 +66,7 @@ module Dependabot
|
|
|
65
66
|
lockfile_version = lockfile_version_str.to_i
|
|
66
67
|
|
|
67
68
|
# Using npm 8 as the default for lockfile_version > 2.
|
|
68
|
-
return
|
|
69
|
+
return NPM_V11 if lockfile_version >= 3
|
|
69
70
|
return NPM_V8 if lockfile_version >= 2
|
|
70
71
|
|
|
71
72
|
NPM_V6 if lockfile_version >= 1
|
|
@@ -362,7 +363,7 @@ module Dependabot
|
|
|
362
363
|
end
|
|
363
364
|
end
|
|
364
365
|
|
|
365
|
-
#
|
|
366
|
+
# Activate the package manager for specified version by using corepack
|
|
366
367
|
sig do
|
|
367
368
|
params(
|
|
368
369
|
name: String,
|
|
@@ -375,22 +376,20 @@ module Dependabot
|
|
|
375
376
|
Dependabot.logger.info("Installing \"#{name}@#{version}\"")
|
|
376
377
|
|
|
377
378
|
begin
|
|
378
|
-
# Try to
|
|
379
|
-
output =
|
|
379
|
+
# Try to activate the specified version
|
|
380
|
+
output = package_manager_activate(name, version, env: env)
|
|
380
381
|
|
|
381
382
|
# Confirm success based on the output
|
|
382
|
-
if output.
|
|
383
|
+
if output.include?("immediate activation...")
|
|
383
384
|
Dependabot.logger.info("#{name}@#{version} successfully installed.")
|
|
384
385
|
|
|
385
386
|
Dependabot.logger.info("Activating currently installed version of #{name}: #{version}")
|
|
386
|
-
package_manager_activate(name, version)
|
|
387
|
-
|
|
388
387
|
else
|
|
389
388
|
Dependabot.logger.error("Corepack installation output unexpected: #{output}")
|
|
390
389
|
fallback_to_local_version(name)
|
|
391
390
|
end
|
|
392
391
|
rescue StandardError => e
|
|
393
|
-
Dependabot.logger.error("Error
|
|
392
|
+
Dependabot.logger.error("Error activating #{name}@#{version}: #{e.message}")
|
|
394
393
|
fallback_to_local_version(name)
|
|
395
394
|
end
|
|
396
395
|
|
|
@@ -435,13 +434,14 @@ module Dependabot
|
|
|
435
434
|
end
|
|
436
435
|
|
|
437
436
|
# Prepare the package manager for use by using corepack
|
|
438
|
-
sig { params(name: String, version: String).returns(String) }
|
|
439
|
-
def self.package_manager_activate(name, version)
|
|
437
|
+
sig { params(name: String, version: String, env: T.nilable(T::Hash[String, String])).returns(String) }
|
|
438
|
+
def self.package_manager_activate(name, version, env: {})
|
|
440
439
|
return "Corepack does not support #{name}" unless corepack_supported_package_manager?(name)
|
|
441
440
|
|
|
442
441
|
Dependabot::SharedHelpers.run_shell_command(
|
|
443
442
|
"corepack prepare #{name}@#{version} --activate",
|
|
444
|
-
fingerprint: "corepack prepare <name>@<version> --activate"
|
|
443
|
+
fingerprint: "corepack prepare <name>@<version> --activate",
|
|
444
|
+
env: env
|
|
445
445
|
).strip
|
|
446
446
|
end
|
|
447
447
|
|
|
@@ -39,7 +39,13 @@ module Dependabot
|
|
|
39
39
|
registry_info = find_registry_and_token
|
|
40
40
|
|
|
41
41
|
env_variables = {}
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
if registry_info[:registry] # Prevent the https from being stripped in the process
|
|
44
|
+
registry = registry_info[:registry]
|
|
45
|
+
registry = "https://#{T.must(registry)}" unless T.must(registry).start_with?("http://", "https://")
|
|
46
|
+
env_variables[COREPACK_NPM_REGISTRY_ENV] = registry
|
|
47
|
+
end
|
|
48
|
+
|
|
43
49
|
env_variables[COREPACK_NPM_TOKEN_ENV] = registry_info[:auth_token] if registry_info[:auth_token]
|
|
44
50
|
|
|
45
51
|
env_variables
|
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.
|
|
4
|
+
version: 0.350.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.
|
|
18
|
+
version: 0.350.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.
|
|
25
|
+
version: 0.350.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: debug
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -359,7 +359,7 @@ licenses:
|
|
|
359
359
|
- MIT
|
|
360
360
|
metadata:
|
|
361
361
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
362
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
362
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.350.0
|
|
363
363
|
rdoc_options: []
|
|
364
364
|
require_paths:
|
|
365
365
|
- lib
|