dependabot-bun 0.389.0 → 0.391.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/helpers/package-lock.json +66 -66
- data/helpers/test/npm6/fixtures/conflicting-dependency-parser/deeply-nested/package-lock.json +4 -3
- data/lib/dependabot/bun/constraint_helper.rb +15 -21
- data/lib/dependabot/bun/dependency_files_filterer.rb +1 -1
- data/lib/dependabot/bun/file_parser.rb +5 -5
- data/lib/dependabot/bun/file_updater/npmrc_builder.rb +1 -1
- data/lib/dependabot/bun/file_updater/package_json_updater.rb +44 -43
- data/lib/dependabot/bun/metadata_finder.rb +9 -9
- data/lib/dependabot/bun/package/package_details_fetcher.rb +3 -3
- data/lib/dependabot/bun/package/registry_finder.rb +3 -3
- data/lib/dependabot/bun/registry_helper.rb +2 -2
- data/lib/dependabot/bun/requirement.rb +3 -3
- data/lib/dependabot/bun/update_checker/latest_version_finder.rb +13 -10
- data/lib/dependabot/bun/update_checker/requirements_updater.rb +11 -11
- data/lib/dependabot/bun/update_checker/version_resolver.rb +16 -15
- data/lib/dependabot/bun/update_checker.rb +11 -10
- 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: 8c780794b3492c9c16abad2a46f2d48797beec9bf74f951945e6d0d22772039d
|
|
4
|
+
data.tar.gz: 49f31895cd22a23cdd66d8ed57c9ba5b4eb7bb8ad948a71689e98ce2095e98b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c73c9ef6474b3e9b7ccd94c1568239f60cfb4524f087d414b79e11301bc718d93457524715939095523e4b30cf4a3983b3944befd0de2fb707906092f12c766
|
|
7
|
+
data.tar.gz: fc887be654050067bbfb8c8b23c8dc0e2667eb8e0a12d5dcb6e21d067941c41b1585f1dad1fa4381f6e41127b4463408184ba6f7d10bf2cf9924ebd27f0ebbd5
|
data/helpers/package-lock.json
CHANGED
|
@@ -2043,9 +2043,9 @@
|
|
|
2043
2043
|
}
|
|
2044
2044
|
},
|
|
2045
2045
|
"node_modules/@npmcli/arborist/node_modules/brace-expansion": {
|
|
2046
|
-
"version": "2.
|
|
2047
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
2048
|
-
"integrity": "sha512-
|
|
2046
|
+
"version": "2.1.4",
|
|
2047
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
2048
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
2049
2049
|
"dependencies": {
|
|
2050
2050
|
"balanced-match": "^1.0.0"
|
|
2051
2051
|
}
|
|
@@ -2173,9 +2173,9 @@
|
|
|
2173
2173
|
}
|
|
2174
2174
|
},
|
|
2175
2175
|
"node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": {
|
|
2176
|
-
"version": "2.
|
|
2177
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
2178
|
-
"integrity": "sha512-
|
|
2176
|
+
"version": "2.1.4",
|
|
2177
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
2178
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
2179
2179
|
"dependencies": {
|
|
2180
2180
|
"balanced-match": "^1.0.0"
|
|
2181
2181
|
}
|
|
@@ -2270,9 +2270,9 @@
|
|
|
2270
2270
|
}
|
|
2271
2271
|
},
|
|
2272
2272
|
"node_modules/@npmcli/package-json/node_modules/brace-expansion": {
|
|
2273
|
-
"version": "2.
|
|
2274
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
2275
|
-
"integrity": "sha512-
|
|
2273
|
+
"version": "2.1.4",
|
|
2274
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
2275
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
2276
2276
|
"dependencies": {
|
|
2277
2277
|
"balanced-match": "^1.0.0"
|
|
2278
2278
|
}
|
|
@@ -2993,9 +2993,9 @@
|
|
|
2993
2993
|
}
|
|
2994
2994
|
},
|
|
2995
2995
|
"node_modules/@tufjs/models/node_modules/brace-expansion": {
|
|
2996
|
-
"version": "2.
|
|
2997
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
2998
|
-
"integrity": "sha512-
|
|
2996
|
+
"version": "2.1.4",
|
|
2997
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
2998
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
2999
2999
|
"dependencies": {
|
|
3000
3000
|
"balanced-match": "^1.0.0"
|
|
3001
3001
|
}
|
|
@@ -3706,9 +3706,9 @@
|
|
|
3706
3706
|
}
|
|
3707
3707
|
},
|
|
3708
3708
|
"node_modules/brace-expansion": {
|
|
3709
|
-
"version": "1.1.
|
|
3710
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.
|
|
3711
|
-
"integrity": "sha512-
|
|
3709
|
+
"version": "1.1.18",
|
|
3710
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
|
|
3711
|
+
"integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
|
|
3712
3712
|
"dependencies": {
|
|
3713
3713
|
"balanced-match": "^1.0.0",
|
|
3714
3714
|
"concat-map": "0.0.1"
|
|
@@ -3863,9 +3863,9 @@
|
|
|
3863
3863
|
}
|
|
3864
3864
|
},
|
|
3865
3865
|
"node_modules/cacache/node_modules/brace-expansion": {
|
|
3866
|
-
"version": "2.
|
|
3867
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
3868
|
-
"integrity": "sha512-
|
|
3866
|
+
"version": "2.1.4",
|
|
3867
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
3868
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
3869
3869
|
"dependencies": {
|
|
3870
3870
|
"balanced-match": "^1.0.0"
|
|
3871
3871
|
}
|
|
@@ -5790,9 +5790,9 @@
|
|
|
5790
5790
|
}
|
|
5791
5791
|
},
|
|
5792
5792
|
"node_modules/ignore-walk/node_modules/brace-expansion": {
|
|
5793
|
-
"version": "2.
|
|
5794
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
5795
|
-
"integrity": "sha512-
|
|
5793
|
+
"version": "2.1.4",
|
|
5794
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
5795
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
5796
5796
|
"dependencies": {
|
|
5797
5797
|
"balanced-match": "^1.0.0"
|
|
5798
5798
|
}
|
|
@@ -5989,9 +5989,9 @@
|
|
|
5989
5989
|
}
|
|
5990
5990
|
},
|
|
5991
5991
|
"node_modules/ip-address": {
|
|
5992
|
-
"version": "10.
|
|
5993
|
-
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.
|
|
5994
|
-
"integrity": "sha512
|
|
5992
|
+
"version": "10.4.0",
|
|
5993
|
+
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.4.0.tgz",
|
|
5994
|
+
"integrity": "sha512-oSK96Grm3aP6OrS263xVxbNDGVL7rzBtYdpGqlDG8iQdoenDoTs/nkki+DflYbAEE8Xl6o5YxhxlrKvI3nqKXQ==",
|
|
5995
5995
|
"engines": {
|
|
5996
5996
|
"node": ">= 12"
|
|
5997
5997
|
}
|
|
@@ -8482,9 +8482,9 @@
|
|
|
8482
8482
|
}
|
|
8483
8483
|
},
|
|
8484
8484
|
"node_modules/make-fetch-happen/node_modules/brace-expansion": {
|
|
8485
|
-
"version": "2.
|
|
8486
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
8487
|
-
"integrity": "sha512-
|
|
8485
|
+
"version": "2.1.4",
|
|
8486
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
8487
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
8488
8488
|
"dependencies": {
|
|
8489
8489
|
"balanced-match": "^1.0.0"
|
|
8490
8490
|
}
|
|
@@ -9086,9 +9086,9 @@
|
|
|
9086
9086
|
}
|
|
9087
9087
|
},
|
|
9088
9088
|
"node_modules/node-gyp/node_modules/brace-expansion": {
|
|
9089
|
-
"version": "2.
|
|
9090
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
9091
|
-
"integrity": "sha512-
|
|
9089
|
+
"version": "2.1.4",
|
|
9090
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
9091
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
9092
9092
|
"dependencies": {
|
|
9093
9093
|
"balanced-match": "^1.0.0"
|
|
9094
9094
|
}
|
|
@@ -15096,9 +15096,9 @@
|
|
|
15096
15096
|
}
|
|
15097
15097
|
},
|
|
15098
15098
|
"node_modules/rimraf/node_modules/brace-expansion": {
|
|
15099
|
-
"version": "2.
|
|
15100
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
15101
|
-
"integrity": "sha512-
|
|
15099
|
+
"version": "2.1.4",
|
|
15100
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
15101
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
15102
15102
|
"dependencies": {
|
|
15103
15103
|
"balanced-match": "^1.0.0"
|
|
15104
15104
|
}
|
|
@@ -17869,9 +17869,9 @@
|
|
|
17869
17869
|
},
|
|
17870
17870
|
"dependencies": {
|
|
17871
17871
|
"brace-expansion": {
|
|
17872
|
-
"version": "2.
|
|
17873
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
17874
|
-
"integrity": "sha512-
|
|
17872
|
+
"version": "2.1.4",
|
|
17873
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
17874
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
17875
17875
|
"requires": {
|
|
17876
17876
|
"balanced-match": "^1.0.0"
|
|
17877
17877
|
}
|
|
@@ -17964,9 +17964,9 @@
|
|
|
17964
17964
|
},
|
|
17965
17965
|
"dependencies": {
|
|
17966
17966
|
"brace-expansion": {
|
|
17967
|
-
"version": "2.
|
|
17968
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
17969
|
-
"integrity": "sha512-
|
|
17967
|
+
"version": "2.1.4",
|
|
17968
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
17969
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
17970
17970
|
"requires": {
|
|
17971
17971
|
"balanced-match": "^1.0.0"
|
|
17972
17972
|
}
|
|
@@ -18038,9 +18038,9 @@
|
|
|
18038
18038
|
},
|
|
18039
18039
|
"dependencies": {
|
|
18040
18040
|
"brace-expansion": {
|
|
18041
|
-
"version": "2.
|
|
18042
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
18043
|
-
"integrity": "sha512-
|
|
18041
|
+
"version": "2.1.4",
|
|
18042
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
18043
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
18044
18044
|
"requires": {
|
|
18045
18045
|
"balanced-match": "^1.0.0"
|
|
18046
18046
|
}
|
|
@@ -18544,9 +18544,9 @@
|
|
|
18544
18544
|
},
|
|
18545
18545
|
"dependencies": {
|
|
18546
18546
|
"brace-expansion": {
|
|
18547
|
-
"version": "2.
|
|
18548
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
18549
|
-
"integrity": "sha512-
|
|
18547
|
+
"version": "2.1.4",
|
|
18548
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
18549
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
18550
18550
|
"requires": {
|
|
18551
18551
|
"balanced-match": "^1.0.0"
|
|
18552
18552
|
}
|
|
@@ -19112,9 +19112,9 @@
|
|
|
19112
19112
|
}
|
|
19113
19113
|
},
|
|
19114
19114
|
"brace-expansion": {
|
|
19115
|
-
"version": "1.1.
|
|
19116
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.
|
|
19117
|
-
"integrity": "sha512-
|
|
19115
|
+
"version": "1.1.18",
|
|
19116
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
|
|
19117
|
+
"integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
|
|
19118
19118
|
"requires": {
|
|
19119
19119
|
"balanced-match": "^1.0.0",
|
|
19120
19120
|
"concat-map": "0.0.1"
|
|
@@ -19236,9 +19236,9 @@
|
|
|
19236
19236
|
},
|
|
19237
19237
|
"dependencies": {
|
|
19238
19238
|
"brace-expansion": {
|
|
19239
|
-
"version": "2.
|
|
19240
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
19241
|
-
"integrity": "sha512-
|
|
19239
|
+
"version": "2.1.4",
|
|
19240
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
19241
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
19242
19242
|
"requires": {
|
|
19243
19243
|
"balanced-match": "^1.0.0"
|
|
19244
19244
|
}
|
|
@@ -20662,9 +20662,9 @@
|
|
|
20662
20662
|
},
|
|
20663
20663
|
"dependencies": {
|
|
20664
20664
|
"brace-expansion": {
|
|
20665
|
-
"version": "2.
|
|
20666
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
20667
|
-
"integrity": "sha512-
|
|
20665
|
+
"version": "2.1.4",
|
|
20666
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
20667
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
20668
20668
|
"requires": {
|
|
20669
20669
|
"balanced-match": "^1.0.0"
|
|
20670
20670
|
}
|
|
@@ -20816,9 +20816,9 @@
|
|
|
20816
20816
|
}
|
|
20817
20817
|
},
|
|
20818
20818
|
"ip-address": {
|
|
20819
|
-
"version": "10.
|
|
20820
|
-
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.
|
|
20821
|
-
"integrity": "sha512
|
|
20819
|
+
"version": "10.4.0",
|
|
20820
|
+
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.4.0.tgz",
|
|
20821
|
+
"integrity": "sha512-oSK96Grm3aP6OrS263xVxbNDGVL7rzBtYdpGqlDG8iQdoenDoTs/nkki+DflYbAEE8Xl6o5YxhxlrKvI3nqKXQ=="
|
|
20822
20822
|
},
|
|
20823
20823
|
"is-arguments": {
|
|
20824
20824
|
"version": "1.1.0",
|
|
@@ -22659,9 +22659,9 @@
|
|
|
22659
22659
|
}
|
|
22660
22660
|
},
|
|
22661
22661
|
"brace-expansion": {
|
|
22662
|
-
"version": "2.
|
|
22663
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
22664
|
-
"integrity": "sha512-
|
|
22662
|
+
"version": "2.1.4",
|
|
22663
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
22664
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
22665
22665
|
"requires": {
|
|
22666
22666
|
"balanced-match": "^1.0.0"
|
|
22667
22667
|
}
|
|
@@ -23130,9 +23130,9 @@
|
|
|
23130
23130
|
},
|
|
23131
23131
|
"dependencies": {
|
|
23132
23132
|
"brace-expansion": {
|
|
23133
|
-
"version": "2.
|
|
23134
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
23135
|
-
"integrity": "sha512-
|
|
23133
|
+
"version": "2.1.4",
|
|
23134
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
23135
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
23136
23136
|
"requires": {
|
|
23137
23137
|
"balanced-match": "^1.0.0"
|
|
23138
23138
|
}
|
|
@@ -27576,9 +27576,9 @@
|
|
|
27576
27576
|
},
|
|
27577
27577
|
"dependencies": {
|
|
27578
27578
|
"brace-expansion": {
|
|
27579
|
-
"version": "2.
|
|
27580
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.
|
|
27581
|
-
"integrity": "sha512-
|
|
27579
|
+
"version": "2.1.4",
|
|
27580
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz",
|
|
27581
|
+
"integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==",
|
|
27582
27582
|
"requires": {
|
|
27583
27583
|
"balanced-match": "^1.0.0"
|
|
27584
27584
|
}
|
data/helpers/test/npm6/fixtures/conflicting-dependency-parser/deeply-nested/package-lock.json
CHANGED
|
@@ -144,9 +144,10 @@
|
|
|
144
144
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
|
145
145
|
},
|
|
146
146
|
"node_modules/brace-expansion": {
|
|
147
|
-
"version": "1.1.
|
|
148
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.
|
|
149
|
-
"integrity": "sha512-
|
|
147
|
+
"version": "1.1.18",
|
|
148
|
+
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
|
|
149
|
+
"integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
|
|
150
|
+
"license": "MIT",
|
|
150
151
|
"dependencies": {
|
|
151
152
|
"balanced-match": "^1.0.0",
|
|
152
153
|
"concat-map": "0.0.1"
|
|
@@ -16,48 +16,42 @@ module Dependabot
|
|
|
16
16
|
# Matches semantic versions:
|
|
17
17
|
VERSION = T.let("#{DIGIT}(?:\\.#{DIGIT}){0,2}#{PRERELEASE}#{BUILD_METADATA}".freeze, String)
|
|
18
18
|
|
|
19
|
-
VERSION_REGEX =
|
|
19
|
+
VERSION_REGEX = /^#{VERSION}$/
|
|
20
20
|
|
|
21
21
|
# Base regex for SemVer (major.minor.patch[-prerelease][+build])
|
|
22
22
|
# This pattern extracts valid semantic versioning strings based on the SemVer 2.0 specification.
|
|
23
|
-
SEMVER_REGEX =
|
|
24
|
-
/
|
|
23
|
+
SEMVER_REGEX = /
|
|
25
24
|
(?<version>\d+\.\d+\.\d+) # Match major.minor.patch (e.g., 1.2.3)
|
|
26
25
|
(?:-(?<prerelease>[a-zA-Z0-9.-]+))? # Optional prerelease (e.g., -alpha.1, -rc.1, -beta.5)
|
|
27
26
|
(?:\+(?<build>[a-zA-Z0-9.-]+))? # Optional build metadata (e.g., +build.20231101, +exp.sha.5114f85)
|
|
28
|
-
/x
|
|
29
|
-
Regexp
|
|
30
|
-
)
|
|
27
|
+
/x
|
|
31
28
|
|
|
32
29
|
# Full SemVer validation regex (ensures the entire string is a valid SemVer)
|
|
33
30
|
# This ensures the entire input strictly follows SemVer, without extra characters before/after.
|
|
34
|
-
SEMVER_VALIDATION_REGEX =
|
|
31
|
+
SEMVER_VALIDATION_REGEX = /^#{SEMVER_REGEX}$/
|
|
35
32
|
|
|
36
33
|
# SemVer constraint regex (supports package.json version constraints)
|
|
37
34
|
# This pattern ensures proper parsing of SemVer versions with optional operators.
|
|
38
|
-
SEMVER_CONSTRAINT_REGEX =
|
|
39
|
-
/
|
|
35
|
+
SEMVER_CONSTRAINT_REGEX = /
|
|
40
36
|
(?: (>=|<=|>|<|=|~|\^)\s*)? # Make operators optional (e.g., >=, ^, ~)
|
|
41
37
|
(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?(?:\+[a-zA-Z0-9.-]+)?) # Match full SemVer versions
|
|
42
38
|
| (\*|latest) # Match wildcard (*) or 'latest'
|
|
43
|
-
/x
|
|
44
|
-
Regexp
|
|
45
|
-
)
|
|
39
|
+
/x
|
|
46
40
|
|
|
47
41
|
# /(>=|<=|>|<|=|~|\^)\s*(\d+\.\d+\.\d+(?:-[a-zA-Z0-9.-]+)?(?:\+[a-zA-Z0-9.-]+)?)|(\*|latest)/
|
|
48
42
|
|
|
49
43
|
SEMVER_OPERATOR_REGEX = /^(>=|<=|>|<|~|\^|=)$/
|
|
50
44
|
|
|
51
45
|
# Constraint Types as Constants
|
|
52
|
-
CARET_CONSTRAINT_REGEX =
|
|
53
|
-
TILDE_CONSTRAINT_REGEX =
|
|
54
|
-
EXACT_CONSTRAINT_REGEX =
|
|
55
|
-
GREATER_THAN_EQUAL_REGEX =
|
|
56
|
-
LESS_THAN_EQUAL_REGEX =
|
|
57
|
-
GREATER_THAN_REGEX =
|
|
58
|
-
LESS_THAN_REGEX =
|
|
59
|
-
WILDCARD_REGEX =
|
|
60
|
-
LATEST_REGEX =
|
|
46
|
+
CARET_CONSTRAINT_REGEX = /^\^\s*(#{VERSION})$/
|
|
47
|
+
TILDE_CONSTRAINT_REGEX = /^~\s*(#{VERSION})$/
|
|
48
|
+
EXACT_CONSTRAINT_REGEX = /^\s*(#{VERSION})$/
|
|
49
|
+
GREATER_THAN_EQUAL_REGEX = /^>=\s*(#{VERSION})$/
|
|
50
|
+
LESS_THAN_EQUAL_REGEX = /^<=\s*(#{VERSION})$/
|
|
51
|
+
GREATER_THAN_REGEX = /^>\s*(#{VERSION})$/
|
|
52
|
+
LESS_THAN_REGEX = /^<\s*(#{VERSION})$/
|
|
53
|
+
WILDCARD_REGEX = /^\*$/
|
|
54
|
+
LATEST_REGEX = /^latest$/
|
|
61
55
|
SEMVER_CONSTANTS = ["*", "latest"].freeze
|
|
62
56
|
|
|
63
57
|
# Unified Regex for Valid Constraints
|
|
@@ -68,7 +68,7 @@ module Dependabot
|
|
|
68
68
|
def dependency_manifest_requirements
|
|
69
69
|
@dependency_manifest_requirements ||= T.let(
|
|
70
70
|
updated_dependencies.flat_map do |dep|
|
|
71
|
-
dep.requirements.
|
|
71
|
+
dep.requirements.filter_map(&:file)
|
|
72
72
|
end,
|
|
73
73
|
T.nilable(T::Array[String])
|
|
74
74
|
)
|
|
@@ -27,7 +27,7 @@ module Dependabot
|
|
|
27
27
|
require "dependabot/file_parsers/base/dependency_set"
|
|
28
28
|
require_relative "file_parser/lockfile_parser"
|
|
29
29
|
|
|
30
|
-
DEPENDENCY_TYPES =
|
|
30
|
+
DEPENDENCY_TYPES = %w(dependencies devDependencies optionalDependencies).freeze
|
|
31
31
|
GIT_URL_REGEX = %r{
|
|
32
32
|
(?<git_prefix>^|^git.*?|^github:|^bitbucket:|^gitlab:|github\.com/)
|
|
33
33
|
(?<username>[a-z0-9-]+)/
|
|
@@ -67,16 +67,16 @@ module Dependabot
|
|
|
67
67
|
reqs = dep.requirements
|
|
68
68
|
|
|
69
69
|
# Ignore dependencies defined in support files, since we don't want PRs for those
|
|
70
|
-
support_reqs = reqs.select { |r| support_package_files.any? { |f| f.name == r
|
|
70
|
+
support_reqs = reqs.select { |r| support_package_files.any? { |f| f.name == r.file } }
|
|
71
71
|
next true if support_reqs.any?
|
|
72
72
|
|
|
73
73
|
# TODO: Currently, Dependabot can't handle dependencies that have both
|
|
74
74
|
# a git source *and* a non-git source. Fix that!
|
|
75
|
-
git_reqs = reqs.select { |r| r.
|
|
75
|
+
git_reqs = reqs.select { |r| r.source_string("type") == "git" }
|
|
76
76
|
next false if git_reqs.none?
|
|
77
|
-
next true if git_reqs.map
|
|
77
|
+
next true if git_reqs.map(&:source).uniq.count > 1
|
|
78
78
|
|
|
79
|
-
dep.requirements.any? { |r| r.
|
|
79
|
+
dep.requirements.any? { |r| r.source_string("type") != "git" }
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
|
|
@@ -14,7 +14,7 @@ module Dependabot
|
|
|
14
14
|
class NpmrcBuilder
|
|
15
15
|
extend T::Sig
|
|
16
16
|
|
|
17
|
-
CENTRAL_REGISTRIES =
|
|
17
|
+
CENTRAL_REGISTRIES = %w(registry.npmjs.org).freeze
|
|
18
18
|
|
|
19
19
|
SCOPED_REGISTRY = /^\s*@(?<scope>\S+):registry\s*=\s*(?<registry>\S+)/
|
|
20
20
|
|
|
@@ -86,22 +86,22 @@ module Dependabot
|
|
|
86
86
|
sig do
|
|
87
87
|
params(
|
|
88
88
|
dependency: Dependabot::Dependency,
|
|
89
|
-
new_requirement:
|
|
89
|
+
new_requirement: Dependabot::DependencyRequirement
|
|
90
90
|
)
|
|
91
|
-
.returns(T.nilable(
|
|
91
|
+
.returns(T.nilable(Dependabot::DependencyRequirement))
|
|
92
92
|
end
|
|
93
93
|
def old_requirement(dependency, new_requirement)
|
|
94
94
|
T.must(dependency.previous_requirements)
|
|
95
|
-
.select { |r| r
|
|
96
|
-
.find { |r| r
|
|
95
|
+
.select { |r| r.file == package_json.name }
|
|
96
|
+
.find { |r| r.groups == new_requirement.groups }
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
-
sig { params(dependency: Dependabot::Dependency).returns(T::Array[
|
|
99
|
+
sig { params(dependency: Dependabot::Dependency).returns(T::Array[Dependabot::DependencyRequirement]) }
|
|
100
100
|
def new_requirements(dependency)
|
|
101
|
-
dependency.requirements.select { |r| r
|
|
101
|
+
dependency.requirements.select { |r| r.file == package_json.name }
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
sig { params(dependency: Dependabot::Dependency).returns(T.nilable(T::Array[
|
|
104
|
+
sig { params(dependency: Dependabot::Dependency).returns(T.nilable(T::Array[Dependabot::DependencyRequirement])) }
|
|
105
105
|
def updated_requirements(dependency)
|
|
106
106
|
return unless dependency.previous_requirements
|
|
107
107
|
|
|
@@ -111,22 +111,22 @@ module Dependabot
|
|
|
111
111
|
dependency.requirements.zip(T.must(dependency.previous_requirements))
|
|
112
112
|
.reject do |new_req, old_req|
|
|
113
113
|
next true if new_req == old_req
|
|
114
|
-
next false unless old_req&.
|
|
114
|
+
next false unless old_req&.source.nil?
|
|
115
115
|
|
|
116
|
-
new_req
|
|
116
|
+
new_req.requirement == old_req&.requirement
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
updated_requirement_pairs
|
|
120
120
|
.map(&:first)
|
|
121
|
-
.select { |r| r
|
|
121
|
+
.select { |r| r.file == package_json.name }
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
sig do
|
|
125
125
|
params(
|
|
126
126
|
package_json_content: String,
|
|
127
|
-
new_req:
|
|
127
|
+
new_req: Dependabot::DependencyRequirement,
|
|
128
128
|
dependency_name: String,
|
|
129
|
-
old_req: T.nilable(
|
|
129
|
+
old_req: T.nilable(Dependabot::DependencyRequirement)
|
|
130
130
|
)
|
|
131
131
|
.returns(String)
|
|
132
132
|
end
|
|
@@ -143,7 +143,7 @@ module Dependabot
|
|
|
143
143
|
new_req: new_req
|
|
144
144
|
)
|
|
145
145
|
|
|
146
|
-
groups = new_req.
|
|
146
|
+
groups = T.must(new_req.groups).map(&:to_s)
|
|
147
147
|
|
|
148
148
|
update_package_json_sections(
|
|
149
149
|
groups,
|
|
@@ -159,9 +159,9 @@ module Dependabot
|
|
|
159
159
|
sig do
|
|
160
160
|
params(
|
|
161
161
|
package_json_content: String,
|
|
162
|
-
new_req:
|
|
162
|
+
new_req: Dependabot::DependencyRequirement,
|
|
163
163
|
dependency: Dependabot::Dependency,
|
|
164
|
-
old_req: T.nilable(
|
|
164
|
+
old_req: T.nilable(Dependabot::DependencyRequirement)
|
|
165
165
|
)
|
|
166
166
|
.returns(String)
|
|
167
167
|
end
|
|
@@ -179,7 +179,7 @@ module Dependabot
|
|
|
179
179
|
resolutions.each do |_, resolution|
|
|
180
180
|
original_line = declaration_line(
|
|
181
181
|
dependency_name: dep.name,
|
|
182
|
-
dependency_req:
|
|
182
|
+
dependency_req: Dependabot::DependencyRequirement.create(requirement: resolution),
|
|
183
183
|
content: content
|
|
184
184
|
)
|
|
185
185
|
|
|
@@ -187,8 +187,8 @@ module Dependabot
|
|
|
187
187
|
|
|
188
188
|
replacement_line = replacement_declaration_line(
|
|
189
189
|
original_line: original_line,
|
|
190
|
-
old_req:
|
|
191
|
-
new_req:
|
|
190
|
+
old_req: Dependabot::DependencyRequirement.create(requirement: resolution),
|
|
191
|
+
new_req: Dependabot::DependencyRequirement.create(requirement: new_resolution)
|
|
192
192
|
)
|
|
193
193
|
|
|
194
194
|
content = update_package_json_sections(
|
|
@@ -201,16 +201,16 @@ module Dependabot
|
|
|
201
201
|
sig do
|
|
202
202
|
params(
|
|
203
203
|
dependency_name: String,
|
|
204
|
-
dependency_req: T.nilable(
|
|
204
|
+
dependency_req: T.nilable(Dependabot::DependencyRequirement),
|
|
205
205
|
content: String
|
|
206
206
|
)
|
|
207
207
|
.returns(String)
|
|
208
208
|
end
|
|
209
209
|
def declaration_line(dependency_name:, dependency_req:, content:)
|
|
210
|
-
git_dependency = dependency_req&.
|
|
210
|
+
git_dependency = dependency_req&.source_string("type") == "git"
|
|
211
211
|
|
|
212
212
|
unless git_dependency
|
|
213
|
-
requirement = dependency_req&.
|
|
213
|
+
requirement = T.must(dependency_req&.requirement)
|
|
214
214
|
return content.match(
|
|
215
215
|
/"#{Regexp.escape(dependency_name)}"\s*:\s*
|
|
216
216
|
"#{Regexp.escape(requirement)}"/x
|
|
@@ -218,37 +218,37 @@ module Dependabot
|
|
|
218
218
|
end
|
|
219
219
|
|
|
220
220
|
username, repo =
|
|
221
|
-
dependency_req&.
|
|
221
|
+
T.must(dependency_req&.source_string("url")).split("/").last(2)
|
|
222
222
|
|
|
223
223
|
content.match(
|
|
224
224
|
%r{"#{Regexp.escape(dependency_name)}"\s*:\s*
|
|
225
|
-
".*?#{Regexp.escape(username)}/#{Regexp.escape(repo)}.*"}x
|
|
225
|
+
".*?#{Regexp.escape(T.must(username))}/#{Regexp.escape(T.must(repo))}.*"}x
|
|
226
226
|
).to_s
|
|
227
227
|
end
|
|
228
228
|
|
|
229
229
|
sig do
|
|
230
230
|
params(
|
|
231
231
|
original_line: String,
|
|
232
|
-
old_req: T.nilable(
|
|
233
|
-
new_req:
|
|
232
|
+
old_req: T.nilable(Dependabot::DependencyRequirement),
|
|
233
|
+
new_req: Dependabot::DependencyRequirement
|
|
234
234
|
)
|
|
235
235
|
.returns(String)
|
|
236
236
|
end
|
|
237
237
|
def replacement_declaration_line(original_line:, old_req:, new_req:)
|
|
238
|
-
was_git_dependency = old_req&.
|
|
239
|
-
now_git_dependency = new_req.
|
|
238
|
+
was_git_dependency = old_req&.source_string("type") == "git"
|
|
239
|
+
now_git_dependency = new_req.source_string("type") == "git"
|
|
240
240
|
|
|
241
241
|
unless was_git_dependency
|
|
242
242
|
return original_line.gsub(
|
|
243
|
-
%("#{old_req&.
|
|
244
|
-
%("#{new_req.
|
|
243
|
+
%("#{old_req&.requirement}"),
|
|
244
|
+
%("#{new_req.requirement}")
|
|
245
245
|
)
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
unless now_git_dependency
|
|
249
249
|
return original_line.gsub(
|
|
250
250
|
/(?<=\s").*[^\\](?=")/,
|
|
251
|
-
new_req.
|
|
251
|
+
T.must(new_req.requirement_string)
|
|
252
252
|
)
|
|
253
253
|
end
|
|
254
254
|
|
|
@@ -261,32 +261,32 @@ module Dependabot
|
|
|
261
261
|
end
|
|
262
262
|
|
|
263
263
|
original_line.gsub(
|
|
264
|
-
%(##{old_req&.
|
|
265
|
-
%(##{new_req.
|
|
264
|
+
%(##{old_req&.source_string('ref')}"),
|
|
265
|
+
%(##{new_req.source_string('ref')}")
|
|
266
266
|
)
|
|
267
267
|
end
|
|
268
268
|
|
|
269
269
|
sig do
|
|
270
270
|
params(
|
|
271
271
|
original_line: String,
|
|
272
|
-
old_req: T.nilable(
|
|
273
|
-
new_req:
|
|
272
|
+
old_req: T.nilable(Dependabot::DependencyRequirement),
|
|
273
|
+
new_req: Dependabot::DependencyRequirement
|
|
274
274
|
)
|
|
275
275
|
.returns(String)
|
|
276
276
|
end
|
|
277
277
|
def update_git_semver_requirement(original_line:, old_req:, new_req:)
|
|
278
278
|
if original_line.include?("semver:")
|
|
279
279
|
return original_line.gsub(
|
|
280
|
-
%(semver:#{old_req&.
|
|
281
|
-
%(semver:#{new_req.
|
|
280
|
+
%(semver:#{old_req&.requirement}"),
|
|
281
|
+
%(semver:#{new_req.requirement}")
|
|
282
282
|
)
|
|
283
283
|
end
|
|
284
284
|
|
|
285
285
|
raise "Not a semver req!" unless original_line.match?(/#[\^~=<>]/)
|
|
286
286
|
|
|
287
287
|
original_line.gsub(
|
|
288
|
-
%(##{old_req&.
|
|
289
|
-
%(##{new_req.
|
|
288
|
+
%(##{old_req&.requirement}"),
|
|
289
|
+
%(##{new_req.requirement}")
|
|
290
290
|
)
|
|
291
291
|
end
|
|
292
292
|
|
|
@@ -339,13 +339,14 @@ module Dependabot
|
|
|
339
339
|
sig { params(dependency: Dependabot::Dependency).void }
|
|
340
340
|
def preliminary_check_for_update(dependency)
|
|
341
341
|
T.must(dependency.previous_requirements).each do |req, _dep|
|
|
342
|
-
|
|
342
|
+
requirement = req.requirement
|
|
343
|
+
next if requirement.nil?
|
|
343
344
|
|
|
344
345
|
# some deps are patched with local patches, we don't need to update them
|
|
345
|
-
if
|
|
346
|
+
if requirement.match?(Regexp.union(PATCH_PACKAGE))
|
|
346
347
|
Dependabot.logger.info(
|
|
347
348
|
"Func: updated_requirements. dependency patched #{dependency.name}," \
|
|
348
|
-
" Requirement: '#{
|
|
349
|
+
" Requirement: '#{requirement}'"
|
|
349
350
|
)
|
|
350
351
|
|
|
351
352
|
raise DependencyFileNotResolvable,
|
|
@@ -353,11 +354,11 @@ module Dependabot
|
|
|
353
354
|
end
|
|
354
355
|
|
|
355
356
|
# some deps are added as local packages, we don't need to update them as they are referred to a local path
|
|
356
|
-
next unless
|
|
357
|
+
next unless requirement.match?(Regexp.union(LOCAL_PACKAGE))
|
|
357
358
|
|
|
358
359
|
Dependabot.logger.info(
|
|
359
360
|
"Func: updated_requirements. local package #{dependency.name}," \
|
|
360
|
-
" Requirement: '#{
|
|
361
|
+
" Requirement: '#{requirement}'"
|
|
361
362
|
)
|
|
362
363
|
|
|
363
364
|
raise DependencyFileNotResolvable,
|
|
@@ -17,7 +17,7 @@ module Dependabot
|
|
|
17
17
|
extend T::Sig
|
|
18
18
|
|
|
19
19
|
# RFC 3986 unreserved; others need encoding (explicit ASCII class avoids UTF-8 \w issues)
|
|
20
|
-
CHARS_REQUIRING_ENCODING =
|
|
20
|
+
CHARS_REQUIRING_ENCODING = /[^A-Za-z0-9._~-]/
|
|
21
21
|
private_constant :CHARS_REQUIRING_ENCODING
|
|
22
22
|
|
|
23
23
|
sig { override.returns(T.nilable(String)) }
|
|
@@ -117,11 +117,11 @@ module Dependabot
|
|
|
117
117
|
potential_sources.first
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
-
sig { returns(T.nilable(
|
|
120
|
+
sig { returns(T.nilable(Dependabot::DependencyRequirement::ObjectHash)) }
|
|
121
121
|
def new_source
|
|
122
122
|
sources = dependency.requirements
|
|
123
|
-
.map
|
|
124
|
-
.sort_by { |source| Package::RegistryFinder.central_registry?(source[:url]) ? 1 : 0 }
|
|
123
|
+
.map(&:source_hash).uniq.compact
|
|
124
|
+
.sort_by { |source| Package::RegistryFinder.central_registry?(T.cast(source[:url], String)) ? 1 : 0 }
|
|
125
125
|
|
|
126
126
|
sources.first
|
|
127
127
|
end
|
|
@@ -171,7 +171,7 @@ module Dependabot
|
|
|
171
171
|
sig { returns(T.nilable(Source)) }
|
|
172
172
|
def find_source_from_git_url
|
|
173
173
|
url = new_source&.[](:url) || new_source&.fetch("url")
|
|
174
|
-
Source.from_url(url)
|
|
174
|
+
Source.from_url(T.cast(url, T.nilable(String)))
|
|
175
175
|
end
|
|
176
176
|
|
|
177
177
|
sig { returns(T::Hash[String, T.untyped]) }
|
|
@@ -266,10 +266,10 @@ module Dependabot
|
|
|
266
266
|
|
|
267
267
|
sig { returns(String) }
|
|
268
268
|
def dependency_registry
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
source = new_source
|
|
270
|
+
return "registry.npmjs.org" if source.nil?
|
|
271
|
+
|
|
272
|
+
T.cast(source.fetch(:url), String).gsub("https://", "").gsub("http://", "")
|
|
273
273
|
end
|
|
274
274
|
|
|
275
275
|
sig { returns(T.nilable(String)) }
|
|
@@ -49,9 +49,9 @@ module Dependabot
|
|
|
49
49
|
dependency_files:,
|
|
50
50
|
credentials:
|
|
51
51
|
)
|
|
52
|
-
@dependency =
|
|
53
|
-
@dependency_files =
|
|
54
|
-
@credentials =
|
|
52
|
+
@dependency = dependency
|
|
53
|
+
@dependency_files = dependency_files
|
|
54
|
+
@credentials = credentials
|
|
55
55
|
|
|
56
56
|
@npm_details = T.let(nil, T.nilable(T::Hash[String, T.untyped]))
|
|
57
57
|
@dist_tags = T.let(nil, T.nilable(T::Hash[String, String]))
|
|
@@ -393,10 +393,10 @@ module Dependabot
|
|
|
393
393
|
sig { returns(T.nilable(String)) }
|
|
394
394
|
def registry_source_url # rubocop:disable Metrics/PerceivedComplexity
|
|
395
395
|
sources = dependency&.requirements
|
|
396
|
-
&.map
|
|
397
|
-
&.sort_by { |source| self.class.central_registry?(source[:url]) ? 1 : 0 }
|
|
396
|
+
&.map(&:source_hash)&.uniq&.compact
|
|
397
|
+
&.sort_by { |source| self.class.central_registry?(T.cast(source[:url], String)) ? 1 : 0 }
|
|
398
398
|
|
|
399
|
-
sources&.find { |s| s[:type] == "registry" }&.fetch(:url)
|
|
399
|
+
T.cast(sources&.find { |s| s[:type] == "registry" }&.fetch(:url), T.nilable(String))
|
|
400
400
|
end
|
|
401
401
|
|
|
402
402
|
sig { returns(T.nilable(T::Hash[String, T.untyped])) }
|
|
@@ -26,8 +26,8 @@ module Dependabot
|
|
|
26
26
|
).void
|
|
27
27
|
end
|
|
28
28
|
def initialize(registry_config_files, credentials)
|
|
29
|
-
@registry_config_files =
|
|
30
|
-
@credentials =
|
|
29
|
+
@registry_config_files = registry_config_files
|
|
30
|
+
@credentials = credentials
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
private
|
|
@@ -12,15 +12,15 @@ module Dependabot
|
|
|
12
12
|
class Requirement < Dependabot::Requirement
|
|
13
13
|
extend T::Sig
|
|
14
14
|
|
|
15
|
-
AND_SEPARATOR =
|
|
16
|
-
OR_SEPARATOR =
|
|
15
|
+
AND_SEPARATOR = /(?<=[a-zA-Z0-9*])\s+(?:&+\s+)?(?!\s*[|-])/
|
|
16
|
+
OR_SEPARATOR = /(?<=[a-zA-Z0-9*])\s*\|+/
|
|
17
17
|
|
|
18
18
|
# Override the version pattern to allow a 'v' prefix
|
|
19
19
|
quoted = OPS.keys.map { |k| Regexp.quote(k) }.join("|")
|
|
20
20
|
version_pattern = "v?#{Bun::Version::VERSION_PATTERN}"
|
|
21
21
|
|
|
22
22
|
PATTERN_RAW = T.let("\\s*(#{quoted})?\\s*(#{version_pattern})\\s*".freeze, String)
|
|
23
|
-
PATTERN =
|
|
23
|
+
PATTERN = /\A#{PATTERN_RAW}\z/
|
|
24
24
|
|
|
25
25
|
sig do
|
|
26
26
|
params(
|
|
@@ -281,8 +281,8 @@ module Dependabot
|
|
|
281
281
|
return nil unless dist_tags
|
|
282
282
|
|
|
283
283
|
dist_tag_req = dependency.requirements
|
|
284
|
-
.
|
|
285
|
-
|
|
284
|
+
.filter_map(&:requirement_string)
|
|
285
|
+
.find { |req| dist_tags.include?(req) }
|
|
286
286
|
|
|
287
287
|
# For cooldown filtering, use filtered releases
|
|
288
288
|
releases = available_versions
|
|
@@ -331,10 +331,11 @@ module Dependabot
|
|
|
331
331
|
sig { returns(T::Boolean) }
|
|
332
332
|
def specified_dist_tag_requirement?
|
|
333
333
|
dependency.requirements.any? do |req|
|
|
334
|
-
|
|
335
|
-
next false
|
|
334
|
+
requirement = req.requirement_string
|
|
335
|
+
next false if requirement.nil?
|
|
336
|
+
next false unless requirement.match?(/^[A-Za-z]/)
|
|
336
337
|
|
|
337
|
-
!
|
|
338
|
+
!requirement.match?(/^v\d/i)
|
|
338
339
|
end
|
|
339
340
|
end
|
|
340
341
|
|
|
@@ -355,9 +356,10 @@ module Dependabot
|
|
|
355
356
|
sig { params(version: Dependabot::Version).returns(T::Boolean) }
|
|
356
357
|
def current_requirement_greater_than?(version)
|
|
357
358
|
dependency.requirements.any? do |req|
|
|
358
|
-
|
|
359
|
+
requirement = req.requirement_string
|
|
360
|
+
next false unless requirement
|
|
359
361
|
|
|
360
|
-
req_version =
|
|
362
|
+
req_version = requirement.sub(/^\^|~|>=?/, "")
|
|
361
363
|
next false unless version_class.correct?(req_version)
|
|
362
364
|
|
|
363
365
|
version_class.new(req_version) > version
|
|
@@ -373,10 +375,11 @@ module Dependabot
|
|
|
373
375
|
end
|
|
374
376
|
|
|
375
377
|
dependency.requirements.any? do |req|
|
|
376
|
-
|
|
378
|
+
requirement = req.requirement_string
|
|
379
|
+
next unless requirement&.match?(/\d-[A-Za-z]/)
|
|
377
380
|
|
|
378
381
|
Bun::Requirement
|
|
379
|
-
.requirements_array(
|
|
382
|
+
.requirements_array(requirement)
|
|
380
383
|
.any? do |r|
|
|
381
384
|
r.requirements.any? { |a| a.last.release == version.release }
|
|
382
385
|
end
|
|
@@ -403,7 +406,7 @@ module Dependabot
|
|
|
403
406
|
end
|
|
404
407
|
def filter_out_of_range_versions(releases)
|
|
405
408
|
reqs = dependency.requirements.filter_map do |r|
|
|
406
|
-
Bun::Requirement.requirements_array(r.
|
|
409
|
+
Bun::Requirement.requirements_array(r.requirement_string)
|
|
407
410
|
end
|
|
408
411
|
|
|
409
412
|
releases.select do |release|
|
|
@@ -35,7 +35,7 @@ module Dependabot
|
|
|
35
35
|
sig do
|
|
36
36
|
params(
|
|
37
37
|
requirements: T::Array[Dependabot::DependencyRequirement],
|
|
38
|
-
updated_source: T.nilable(
|
|
38
|
+
updated_source: T.nilable(Dependabot::DependencyRequirement::ObjectHash),
|
|
39
39
|
update_strategy: Dependabot::RequirementsUpdateStrategy,
|
|
40
40
|
latest_resolvable_version: T.nilable(T.any(String, Gem::Version))
|
|
41
41
|
)
|
|
@@ -71,8 +71,8 @@ module Dependabot
|
|
|
71
71
|
requirements.map do |req|
|
|
72
72
|
req = Dependabot::DependencyRequirement.create(req.merge(source: updated_source))
|
|
73
73
|
next req unless latest_resolvable_version
|
|
74
|
-
next initial_req_after_source_change(req) unless req
|
|
75
|
-
next req if req
|
|
74
|
+
next initial_req_after_source_change(req) unless req.requirement_string
|
|
75
|
+
next req if T.must(req.requirement_string).match?(/^([A-Za-uw-z]|v[^\d])/)
|
|
76
76
|
|
|
77
77
|
case update_strategy
|
|
78
78
|
when RequirementsUpdateStrategy::WidenRanges then widen_requirement(req)
|
|
@@ -89,7 +89,7 @@ module Dependabot
|
|
|
89
89
|
sig { returns(T::Array[Dependabot::DependencyRequirement]) }
|
|
90
90
|
attr_reader :requirements
|
|
91
91
|
|
|
92
|
-
sig { returns(T.nilable(
|
|
92
|
+
sig { returns(T.nilable(Dependabot::DependencyRequirement::ObjectHash)) }
|
|
93
93
|
attr_reader :updated_source
|
|
94
94
|
|
|
95
95
|
sig { returns(Dependabot::RequirementsUpdateStrategy) }
|
|
@@ -109,21 +109,21 @@ module Dependabot
|
|
|
109
109
|
def updating_from_git_to_npm?
|
|
110
110
|
return false unless updated_source.nil?
|
|
111
111
|
|
|
112
|
-
original_source = requirements.
|
|
113
|
-
original_source&.
|
|
112
|
+
original_source = requirements.find(&:source)
|
|
113
|
+
original_source&.source_string("type") == "git"
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
sig { params(req: Dependabot::DependencyRequirement).returns(Dependabot::DependencyRequirement) }
|
|
117
117
|
def initial_req_after_source_change(req)
|
|
118
118
|
return req unless updating_from_git_to_npm?
|
|
119
|
-
return req unless req
|
|
119
|
+
return req unless req.requirement_string.nil?
|
|
120
120
|
|
|
121
121
|
Dependabot::DependencyRequirement.create(req.merge(requirement: "^#{latest_resolvable_version}"))
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
sig { params(req: Dependabot::DependencyRequirement).returns(Dependabot::DependencyRequirement) }
|
|
125
125
|
def update_version_requirement(req)
|
|
126
|
-
current_requirement = req
|
|
126
|
+
current_requirement = T.must(req.requirement_string)
|
|
127
127
|
|
|
128
128
|
if current_requirement.match?(/(<|-\s)/i)
|
|
129
129
|
ruby_req = ruby_requirements(current_requirement).first
|
|
@@ -134,12 +134,12 @@ module Dependabot
|
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
reqs = current_requirement.strip.split(SEPARATOR).map(&:strip)
|
|
137
|
-
Dependabot::DependencyRequirement.create(req.merge(requirement: update_version_string(reqs.first)))
|
|
137
|
+
Dependabot::DependencyRequirement.create(req.merge(requirement: update_version_string(T.must(reqs.first))))
|
|
138
138
|
end
|
|
139
139
|
|
|
140
140
|
sig { params(req: Dependabot::DependencyRequirement).returns(Dependabot::DependencyRequirement) }
|
|
141
141
|
def update_version_requirement_if_needed(req)
|
|
142
|
-
current_requirement = req
|
|
142
|
+
current_requirement = T.must(req.requirement_string)
|
|
143
143
|
version = latest_resolvable_version
|
|
144
144
|
return req if current_requirement.strip == ""
|
|
145
145
|
|
|
@@ -151,7 +151,7 @@ module Dependabot
|
|
|
151
151
|
|
|
152
152
|
sig { params(req: Dependabot::DependencyRequirement).returns(Dependabot::DependencyRequirement) }
|
|
153
153
|
def widen_requirement(req)
|
|
154
|
-
current_requirement = req
|
|
154
|
+
current_requirement = T.must(req.requirement_string)
|
|
155
155
|
version = latest_resolvable_version
|
|
156
156
|
return req if current_requirement.strip == ""
|
|
157
157
|
|
|
@@ -228,8 +228,8 @@ module Dependabot
|
|
|
228
228
|
relevant_versions = latest_version_finder(dependency)
|
|
229
229
|
.possible_previous_versions_with_details
|
|
230
230
|
.map(&:first)
|
|
231
|
-
reqs = dep.requirements.filter_map
|
|
232
|
-
|
|
231
|
+
reqs = dep.requirements.filter_map(&:requirement_string)
|
|
232
|
+
.map { |r| requirement_class.requirements_array(r) }
|
|
233
233
|
|
|
234
234
|
# Pick the lowest version from the max possible version from all
|
|
235
235
|
# requirements. This matches the logic when combining the same
|
|
@@ -650,10 +650,10 @@ module Dependabot
|
|
|
650
650
|
).returns(String)
|
|
651
651
|
end
|
|
652
652
|
def version_install_arg(version:)
|
|
653
|
-
git_source = dependency.requirements.find { |req| req
|
|
653
|
+
git_source = dependency.requirements.find { |req| req.source_string("type") == "git" }
|
|
654
654
|
|
|
655
655
|
if git_source
|
|
656
|
-
"#{dependency.name}@#{git_source
|
|
656
|
+
"#{dependency.name}@#{git_source.source_string('url')}##{version}"
|
|
657
657
|
else
|
|
658
658
|
"#{dependency.name}@#{version}"
|
|
659
659
|
end
|
|
@@ -661,17 +661,18 @@ module Dependabot
|
|
|
661
661
|
|
|
662
662
|
sig do
|
|
663
663
|
params(
|
|
664
|
-
requirements: T::Array[
|
|
664
|
+
requirements: T::Array[Dependabot::DependencyRequirement],
|
|
665
665
|
path: String
|
|
666
|
-
).returns(T::Array[
|
|
666
|
+
).returns(T::Array[Dependabot::DependencyRequirement])
|
|
667
667
|
end
|
|
668
668
|
def requirements_for_path(requirements, path)
|
|
669
669
|
return requirements if path.to_s == "."
|
|
670
670
|
|
|
671
671
|
requirements.filter_map do |r|
|
|
672
|
-
|
|
672
|
+
file = r.file
|
|
673
|
+
next unless file&.start_with?("#{path}/")
|
|
673
674
|
|
|
674
|
-
r.merge(file:
|
|
675
|
+
Dependabot::DependencyRequirement.create(r.merge(file: file.gsub(/^#{Regexp.quote("#{path}/")}/, "")))
|
|
675
676
|
end
|
|
676
677
|
end
|
|
677
678
|
|
|
@@ -719,13 +720,13 @@ module Dependabot
|
|
|
719
720
|
def version_for_dependency(dep)
|
|
720
721
|
return version_class.new(dep.version) if dep.version && version_class.correct?(dep.version)
|
|
721
722
|
|
|
722
|
-
dep.requirements.filter_map
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
723
|
+
dep.requirements.filter_map(&:requirement_string)
|
|
724
|
+
.reject { |req_string| req_string.start_with?("<") }
|
|
725
|
+
.select { |req_string| req_string.match?(version_regex) }
|
|
726
|
+
.map { |req_string| req_string.match(version_regex) }
|
|
727
|
+
.select { |version| version_class.correct?(version.to_s) }
|
|
728
|
+
.map { |version| version_class.new(version.to_s) }
|
|
729
|
+
.max
|
|
729
730
|
end
|
|
730
731
|
|
|
731
732
|
sig { returns(T.class_of(Dependabot::Version)) }
|
|
@@ -368,9 +368,10 @@ module Dependabot
|
|
|
368
368
|
sig { returns(T.nilable(T.any(String, Dependabot::Version))) }
|
|
369
369
|
def latest_resolvable_version_with_no_unlock_for_git_dependency
|
|
370
370
|
reqs = dependency.requirements.filter_map do |r|
|
|
371
|
-
|
|
371
|
+
requirement = r.requirement_string
|
|
372
|
+
next if requirement.nil?
|
|
372
373
|
|
|
373
|
-
requirement_class.requirements_array(
|
|
374
|
+
requirement_class.requirements_array(requirement)
|
|
374
375
|
end
|
|
375
376
|
|
|
376
377
|
current_version =
|
|
@@ -469,8 +470,8 @@ module Dependabot
|
|
|
469
470
|
def latest_git_version_details
|
|
470
471
|
semver_req =
|
|
471
472
|
dependency.requirements
|
|
472
|
-
.find { |req| req.
|
|
473
|
-
&.
|
|
473
|
+
.find { |req| req.source_string("type") == "git" }
|
|
474
|
+
&.requirement_string
|
|
474
475
|
|
|
475
476
|
# If there was a semver requirement provided or the dependency was
|
|
476
477
|
# pinned to a version, look for the latest tag
|
|
@@ -491,7 +492,7 @@ module Dependabot
|
|
|
491
492
|
{ sha: dependency.version }
|
|
492
493
|
end
|
|
493
494
|
|
|
494
|
-
sig { returns(T.nilable(
|
|
495
|
+
sig { returns(T.nilable(Dependabot::DependencyRequirement::ObjectHash)) }
|
|
495
496
|
def updated_source
|
|
496
497
|
# Never need to update source, unless a git_dependency
|
|
497
498
|
return dependency_source_details unless git_dependency?
|
|
@@ -525,22 +526,22 @@ module Dependabot
|
|
|
525
526
|
security_advisories.any?
|
|
526
527
|
end
|
|
527
528
|
|
|
528
|
-
sig { returns(T.nilable(
|
|
529
|
+
sig { returns(T.nilable(Dependabot::DependencyRequirement::ObjectHash)) }
|
|
529
530
|
def dependency_source_details
|
|
530
531
|
original_source(dependency)
|
|
531
532
|
end
|
|
532
533
|
|
|
533
534
|
sig do
|
|
534
535
|
params(updated_dependency: Dependabot::Dependency)
|
|
535
|
-
.returns(T.nilable(
|
|
536
|
+
.returns(T.nilable(Dependabot::DependencyRequirement::ObjectHash))
|
|
536
537
|
end
|
|
537
538
|
def original_source(updated_dependency)
|
|
538
539
|
sources =
|
|
539
540
|
updated_dependency
|
|
540
|
-
.requirements.map
|
|
541
|
-
|
|
541
|
+
.requirements.map(&:source_hash)
|
|
542
|
+
.uniq.compact
|
|
542
543
|
.sort_by do |source|
|
|
543
|
-
Package::RegistryFinder.central_registry?(source[:url]) ? 1 : 0
|
|
544
|
+
Package::RegistryFinder.central_registry?(T.cast(source[:url], String)) ? 1 : 0
|
|
544
545
|
end
|
|
545
546
|
|
|
546
547
|
sources.first
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-bun
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.391.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.391.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.391.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: debug
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -354,7 +354,7 @@ licenses:
|
|
|
354
354
|
- MIT
|
|
355
355
|
metadata:
|
|
356
356
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
357
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
357
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.391.0
|
|
358
358
|
rdoc_options: []
|
|
359
359
|
require_paths:
|
|
360
360
|
- lib
|