1
0
Fork 0
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:
Nathan Whitaker 2025-01-16 11:33:38 -08:00 committed by GitHub
parent 464ee9155e
commit 256950ddb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 27 additions and 21 deletions

View file

@ -280,9 +280,15 @@ fn choose_new_version_req(
if preferred.version <= resolved?.version {
return None;
}
let exact = if let Some(range) = dep.req.version_req.range() {
range.0[0].start == range.0[0].end
} else {
false
};
Some(
VersionReq::parse_from_specifier(
format!("^{}", preferred.version).as_str(),
format!("{}{}", if exact { "" } else { "^" }, preferred.version)
.as_str(),
)
.unwrap(),
)

View file

@ -5,7 +5,7 @@
"@denotest/subtract": "jsr:@denotest/subtract@^0.2.0",
"@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/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"
},
"scopes": {

View file

@ -3,9 +3,9 @@
"@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/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/bin": "npm:@denotest/bin@^1.0.0",
"@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/bin": "npm:@denotest/bin@1.0.0",
"@denotest/has-patch-versions": "npm:@denotest/has-patch-versions@^0.2.0"
},
"scopes": {
@ -13,7 +13,7 @@
"@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/with-subpath": "jsr:@denotest/multiple-exports@^1.0.0/data-json"
"@denotest/with-subpath": "jsr:@denotest/multiple-exports@1.0.0/data-json"
}
}
}

View file

@ -2,10 +2,10 @@
"version": "4",
"specifiers": {
"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",
"npm:@denotest/bin@1": "1.0.0",
"npm:@denotest/breaking-change-between-versions@2": "2.0.0",
"npm:@denotest/bin@1.0.0": "1.0.0",
"npm:@denotest/breaking-change-between-versions@2.0.0": "2.0.0",
"npm:@denotest/has-patch-versions@0.2": "0.2.0"
},
"jsr": {
@ -33,10 +33,10 @@
"workspace": {
"dependencies": [
"jsr:@denotest/add@1",
"jsr:@denotest/multiple-exports@1",
"jsr:@denotest/multiple-exports@1.0.0",
"jsr:@denotest/subtract@1",
"npm:@denotest/bin@1",
"npm:@denotest/breaking-change-between-versions@2",
"npm:@denotest/bin@1.0.0",
"npm:@denotest/breaking-change-between-versions@2.0.0",
"npm:@denotest/has-patch-versions@0.2"
]
}

View file

@ -2,7 +2,7 @@
"imports": {
"@denotest/add": "jsr:@denotest/add@^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"
}
}

View file

@ -3,6 +3,6 @@
"version": "0.1.0",
"dependencies": {
"@denotest/has-patch-versions": "0.1.0",
"aliased": "npm:@denotest/bin@^1.0.0"
"aliased": "npm:@denotest/bin@1.0.0"
}
}

View file

@ -4,7 +4,7 @@
"imports": {
"@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/breaking-change-between-versions": "npm:@denotest/breaking-change-between-versions@^2.0.0"
"@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"
}
}

View file

@ -2,7 +2,7 @@
"name": "@denotest/member-b",
"version": "0.1.0",
"dependencies": {
"@denotest/has-patch-versions": "^0.2.0",
"aliased": "npm:@denotest/bin@^1.0.0"
"@denotest/has-patch-versions": "0.2.0",
"aliased": "npm:@denotest/bin@1.0.0"
}
}

View file

@ -2,7 +2,7 @@
"version": "4",
"specifiers": {
"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": {
@ -20,7 +20,7 @@
"packageJson": {
"dependencies": [
"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"
]
}

View file

@ -1,7 +1,7 @@
{
"dependencies": {
"@denotest/has-patch-versions": "^0.2.0",
"@denotest/breaking-change-between-versions": "^2.0.0"
"@denotest/breaking-change-between-versions": "2.0.0"
},
"devDependencies": {
"aliased": "npm:@denotest/bin@^1.0.0"