mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
fix(outdated): retain strict semver specifier when updating (#27701)
Fixes https://github.com/denoland/deno/issues/27697 If it's a strict bound (e.g. `1.0.0` as opposed to `^1.0.0` or other), retain the strictness when we update
This commit is contained in:
parent
464ee9155e
commit
256950ddb6
10 changed files with 27 additions and 21 deletions
|
@ -280,9 +280,15 @@ fn choose_new_version_req(
|
||||||
if preferred.version <= resolved?.version {
|
if preferred.version <= resolved?.version {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
let exact = if let Some(range) = dep.req.version_req.range() {
|
||||||
|
range.0[0].start == range.0[0].end
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
};
|
||||||
Some(
|
Some(
|
||||||
VersionReq::parse_from_specifier(
|
VersionReq::parse_from_specifier(
|
||||||
format!("^{}", preferred.version).as_str(),
|
format!("{}{}", if exact { "" } else { "^" }, preferred.version)
|
||||||
|
.as_str(),
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"@denotest/subtract": "jsr:@denotest/subtract@^0.2.0",
|
"@denotest/subtract": "jsr:@denotest/subtract@^0.2.0",
|
||||||
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.5.0/data-json",
|
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@0.5.0/data-json",
|
||||||
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0",
|
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@1.0.0",
|
||||||
"@denotest/bin": "npm:@denotest/bin@^1.0.0",
|
"@denotest/bin": "npm:@denotest/bin@1.0.0",
|
||||||
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.1.0"
|
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.1.0"
|
||||||
},
|
},
|
||||||
"scopes": {
|
"scopes": {
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
||||||
"@denotest/add/": "jsr:/@denotest/add@^1.0.0/",
|
"@denotest/add/": "jsr:/@denotest/add@^1.0.0/",
|
||||||
"@denotest/subtract": "jsr:@denotest/subtract@^1.0.0",
|
"@denotest/subtract": "jsr:@denotest/subtract@^1.0.0",
|
||||||
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json",
|
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@1.0.0/data-json",
|
||||||
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@^2.0.0",
|
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@2.0.0",
|
||||||
"@denotest/bin": "npm:@denotest/bin@^1.0.0",
|
"@denotest/bin": "npm:@denotest/bin@1.0.0",
|
||||||
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.2.0"
|
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.2.0"
|
||||||
},
|
},
|
||||||
"scopes": {
|
"scopes": {
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
||||||
"@denotest/add/": "jsr:/@denotest/add@^1.0.0/",
|
"@denotest/add/": "jsr:/@denotest/add@^1.0.0/",
|
||||||
"@denotest/subtract": "jsr:@denotest/subtract@^1.0.0",
|
"@denotest/subtract": "jsr:@denotest/subtract@^1.0.0",
|
||||||
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json"
|
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@1.0.0/data-json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
"version": "4",
|
"version": "4",
|
||||||
"specifiers": {
|
"specifiers": {
|
||||||
"jsr:@denotest/add@1": "1.0.0",
|
"jsr:@denotest/add@1": "1.0.0",
|
||||||
"jsr:@denotest/multiple-exports@1": "1.0.0",
|
"jsr:@denotest/multiple-exports@1.0.0": "1.0.0",
|
||||||
"jsr:@denotest/subtract@1": "1.0.0",
|
"jsr:@denotest/subtract@1": "1.0.0",
|
||||||
"npm:@denotest/bin@1": "1.0.0",
|
"npm:@denotest/bin@1.0.0": "1.0.0",
|
||||||
"npm:@denotest/breaking-change-between-versions@2": "2.0.0",
|
"npm:@denotest/breaking-change-between-versions@2.0.0": "2.0.0",
|
||||||
"npm:@denotest/has-patch-versions@0.2": "0.2.0"
|
"npm:@denotest/has-patch-versions@0.2": "0.2.0"
|
||||||
},
|
},
|
||||||
"jsr": {
|
"jsr": {
|
||||||
|
@ -33,10 +33,10 @@
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"jsr:@denotest/add@1",
|
"jsr:@denotest/add@1",
|
||||||
"jsr:@denotest/multiple-exports@1",
|
"jsr:@denotest/multiple-exports@1.0.0",
|
||||||
"jsr:@denotest/subtract@1",
|
"jsr:@denotest/subtract@1",
|
||||||
"npm:@denotest/bin@1",
|
"npm:@denotest/bin@1.0.0",
|
||||||
"npm:@denotest/breaking-change-between-versions@2",
|
"npm:@denotest/breaking-change-between-versions@2.0.0",
|
||||||
"npm:@denotest/has-patch-versions@0.2"
|
"npm:@denotest/has-patch-versions@0.2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"imports": {
|
"imports": {
|
||||||
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
||||||
"@denotest/subtract": "jsr:@denotest/subtract@^1.0.0",
|
"@denotest/subtract": "jsr:@denotest/subtract@^1.0.0",
|
||||||
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@^2.0.0",
|
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@2.0.0",
|
||||||
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.2.0"
|
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@denotest/has-patch-versions": "0.1.0",
|
"@denotest/has-patch-versions": "0.1.0",
|
||||||
"aliased": "npm:@denotest/bin@^1.0.0"
|
"aliased": "npm:@denotest/bin@1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"imports": {
|
"imports": {
|
||||||
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
"@denotest/add": "jsr:@denotest/add@^1.0.0",
|
||||||
"@denotest/add/": "jsr:/@denotest/add@^1.0.0/",
|
"@denotest/add/": "jsr:/@denotest/add@^1.0.0/",
|
||||||
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json",
|
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@1.0.0/data-json",
|
||||||
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@^2.0.0"
|
"@denotest/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "@denotest/member-b",
|
"name": "@denotest/member-b",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@denotest/has-patch-versions": "^0.2.0",
|
"@denotest/has-patch-versions": "0.2.0",
|
||||||
"aliased": "npm:@denotest/bin@^1.0.0"
|
"aliased": "npm:@denotest/bin@1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"version": "4",
|
"version": "4",
|
||||||
"specifiers": {
|
"specifiers": {
|
||||||
"npm:@denotest/bin@1": "1.0.0",
|
"npm:@denotest/bin@1": "1.0.0",
|
||||||
"npm:@denotest/breaking-change-between-versions@2": "2.0.0",
|
"npm:@denotest/breaking-change-between-versions@2.0.0": "2.0.0",
|
||||||
"npm:@denotest/has-patch-versions@0.2": "0.2.0"
|
"npm:@denotest/has-patch-versions@0.2": "0.2.0"
|
||||||
},
|
},
|
||||||
"npm": {
|
"npm": {
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
"packageJson": {
|
"packageJson": {
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"npm:@denotest/bin@1",
|
"npm:@denotest/bin@1",
|
||||||
"npm:@denotest/breaking-change-between-versions@2",
|
"npm:@denotest/breaking-change-between-versions@2.0.0",
|
||||||
"npm:@denotest/has-patch-versions@0.2"
|
"npm:@denotest/has-patch-versions@0.2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@denotest/has-patch-versions": "^0.2.0",
|
"@denotest/has-patch-versions": "^0.2.0",
|
||||||
"@denotest/breaking-change-between-versions": "^2.0.0"
|
"@denotest/breaking-change-between-versions": "2.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"aliased": "npm:@denotest/bin@^1.0.0"
|
"aliased": "npm:@denotest/bin@^1.0.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue