dependabot-elm 0.293.0 → 0.294.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdfa5aca4964e8925e5e3471efed1c5e7acfe49fc353c4200938ff62c635d43a
|
4
|
+
data.tar.gz: f5c1dc0e5702d4434a5a498772bf866e031c8402f9119f6f9de18372486cd390
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054427faa6ac30aec1e63012d309c76d2705970160c596ecf39184db2ae0e948a01222b22b60e98fdb333e0699ce5b65b42c62c2eb2ef2a6b7c53ceb6edcdd7c
|
7
|
+
data.tar.gz: 4af48629664835e70af9f5a1586e1dc090bf4515a2d1aa0c29d9b6df864e59dd27a8aa230189bb0c144b3939084545c54e31241e160e4c006d9330973a48df78
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "dependabot/elm/file_updater"
|
@@ -7,11 +7,15 @@ module Dependabot
|
|
7
7
|
module Elm
|
8
8
|
class FileUpdater
|
9
9
|
class ElmJsonUpdater
|
10
|
+
extend T::Sig
|
11
|
+
|
12
|
+
sig { params(elm_json_file: Dependabot::DependencyFile, dependencies: T::Array[Dependabot::Dependency]).void }
|
10
13
|
def initialize(elm_json_file:, dependencies:)
|
11
14
|
@elm_json_file = elm_json_file
|
12
15
|
@dependencies = dependencies
|
13
16
|
end
|
14
17
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
15
19
|
def updated_content
|
16
20
|
dependencies
|
17
21
|
.select { |dep| requirement_changed?(elm_json_file, dep) }
|
@@ -32,34 +36,33 @@ module Dependabot
|
|
32
36
|
|
33
37
|
private
|
34
38
|
|
39
|
+
sig { returns(Dependabot::DependencyFile) }
|
35
40
|
attr_reader :elm_json_file
|
41
|
+
|
42
|
+
sig { returns(T::Array[Dependabot::Dependency]) }
|
36
43
|
attr_reader :dependencies
|
37
44
|
|
45
|
+
sig { params(file: Dependabot::DependencyFile, dependency: Dependabot::Dependency).returns(T::Boolean) }
|
38
46
|
def requirement_changed?(file, dependency)
|
39
|
-
changed_requirements =
|
40
|
-
dependency.requirements - dependency.previous_requirements
|
47
|
+
changed_requirements = dependency.requirements - T.must(dependency.previous_requirements)
|
41
48
|
|
42
49
|
changed_requirements.any? { |f| f[:file] == file.name }
|
43
50
|
end
|
44
51
|
|
52
|
+
sig { params(content: T.nilable(String), filename: String, dependency: Dependabot::Dependency).returns(String) }
|
45
53
|
def update_requirement(content:, filename:, dependency:)
|
46
|
-
updated_req =
|
47
|
-
|
48
|
-
.find { |r| r.fetch(:file) == filename }
|
49
|
-
.fetch(:requirement)
|
54
|
+
updated_req = dependency.requirements.find { |r| r.fetch(:file) == filename }
|
55
|
+
&.fetch(:requirement)
|
50
56
|
|
51
|
-
old_req =
|
52
|
-
|
53
|
-
.find { |r| r.fetch(:file) == filename }
|
54
|
-
.fetch(:requirement)
|
57
|
+
old_req = dependency.previous_requirements&.find { |r| r.fetch(:file) == filename }
|
58
|
+
&.fetch(:requirement)
|
55
59
|
|
56
|
-
return content unless old_req
|
60
|
+
return T.must(content) unless old_req
|
57
61
|
|
58
62
|
dep = dependency
|
59
|
-
regex =
|
60
|
-
/"#{Regexp.quote(dep.name)}"\s*:\s+"#{Regexp.quote(old_req)}"/
|
63
|
+
regex = /"#{Regexp.quote(dep.name)}"\s*:\s+"#{Regexp.quote(old_req)}"/
|
61
64
|
|
62
|
-
content.gsub(regex) do |declaration|
|
65
|
+
T.must(content).gsub(regex) do |declaration|
|
63
66
|
declaration.gsub(%("#{old_req}"), %("#{updated_req}"))
|
64
67
|
end
|
65
68
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# typed:
|
1
|
+
# typed: strict
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "dependabot/elm/version"
|
@@ -9,20 +9,28 @@ module Dependabot
|
|
9
9
|
module Elm
|
10
10
|
class UpdateChecker
|
11
11
|
class RequirementsUpdater
|
12
|
+
extend T::Sig
|
12
13
|
RANGE_REQUIREMENT_REGEX =
|
13
14
|
/(\d+\.\d+\.\d+) <= v < (\d+\.\d+\.\d+)/
|
14
15
|
SINGLE_VERSION_REGEX = /\A(\d+\.\d+\.\d+)\z/
|
15
16
|
|
17
|
+
sig do
|
18
|
+
params(requirements: T::Array[T::Hash[Symbol, T.nilable(String)]],
|
19
|
+
latest_resolvable_version: T.nilable(T.any(String, Integer, Dependabot::Version))).void
|
20
|
+
end
|
16
21
|
def initialize(requirements:, latest_resolvable_version:)
|
17
|
-
@requirements = requirements
|
22
|
+
@requirements = T.let(requirements, T::Array[T::Hash[Symbol, T.nilable(String)]])
|
18
23
|
|
19
24
|
return unless latest_resolvable_version
|
20
25
|
return unless version_class.correct?(latest_resolvable_version)
|
21
26
|
|
22
|
-
@latest_resolvable_version =
|
23
|
-
version_class.new(latest_resolvable_version)
|
27
|
+
@latest_resolvable_version = T.let(
|
28
|
+
version_class.new(latest_resolvable_version),
|
29
|
+
T.nilable(Dependabot::Version)
|
30
|
+
)
|
24
31
|
end
|
25
32
|
|
33
|
+
sig { returns(T::Array[T::Hash[Symbol, T.nilable(String)]]) }
|
26
34
|
def updated_requirements
|
27
35
|
return requirements unless latest_resolvable_version
|
28
36
|
|
@@ -38,9 +46,12 @@ module Dependabot
|
|
38
46
|
|
39
47
|
private
|
40
48
|
|
49
|
+
sig { returns(T::Array[T::Hash[Symbol, T.nilable(String)]]) }
|
41
50
|
attr_reader :requirements
|
51
|
+
sig { returns(T.nilable(Dependabot::Version)) }
|
42
52
|
attr_reader :latest_resolvable_version
|
43
53
|
|
54
|
+
sig { params(old_req: T.nilable(String), new_version: T.untyped).returns(String) }
|
44
55
|
def update_requirement(old_req, new_version)
|
45
56
|
if requirement_class.new(old_req).satisfied_by?(new_version)
|
46
57
|
old_req
|
@@ -53,19 +64,23 @@ module Dependabot
|
|
53
64
|
end
|
54
65
|
end
|
55
66
|
|
67
|
+
sig { params(minimum: T.untyped, version: T.untyped).returns(String) }
|
56
68
|
def require_range(minimum, version)
|
57
69
|
major, _minor, _patch = version.to_s.split(".").map(&:to_i)
|
58
70
|
"#{minimum} <= v < #{major + 1}.0.0"
|
59
71
|
end
|
60
72
|
|
73
|
+
sig { params(version: Dependabot::Elm::Version).returns(String) }
|
61
74
|
def require_exactly(version)
|
62
75
|
"#{version} <= v <= #{version}"
|
63
76
|
end
|
64
77
|
|
78
|
+
sig { returns(T.class_of(Dependabot::Elm::Version)) }
|
65
79
|
def version_class
|
66
80
|
Elm::Version
|
67
81
|
end
|
68
82
|
|
83
|
+
sig { returns(T.class_of(Dependabot::Elm::Requirement)) }
|
69
84
|
def requirement_class
|
70
85
|
Elm::Requirement
|
71
86
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-elm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.294.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.294.0
|
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.
|
26
|
+
version: 0.294.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: debug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,7 +261,7 @@ licenses:
|
|
261
261
|
- MIT
|
262
262
|
metadata:
|
263
263
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
264
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
264
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.294.0
|
265
265
|
post_install_message:
|
266
266
|
rdoc_options: []
|
267
267
|
require_paths:
|