mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
parent
e36b1a3aa8
commit
3f692bed0a
6 changed files with 40 additions and 0 deletions
|
@ -124,6 +124,10 @@ impl NpmFetchResolver {
|
|||
let maybe_get_nv = || async {
|
||||
let name = req.name.clone();
|
||||
let package_info = self.package_info(&name).await?;
|
||||
if let Some(dist_tag) = req.version_req.tag() {
|
||||
let version = package_info.dist_tags.get(dist_tag)?.clone();
|
||||
return Some(PackageNv { name, version });
|
||||
}
|
||||
// Find the first matching version of the package.
|
||||
let mut versions = package_info.versions.keys().collect::<Vec<_>>();
|
||||
versions.sort();
|
||||
|
|
9
tests/specs/add/dist_tag/__test__.jsonc
Normal file
9
tests/specs/add/dist_tag/__test__.jsonc
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"tempDir": true,
|
||||
"steps": [
|
||||
{
|
||||
"args": "add npm:ajv@latest",
|
||||
"output": "Add npm:ajv@8.11.0\n"
|
||||
}
|
||||
]
|
||||
}
|
0
tests/specs/add/dist_tag/deno.json
Normal file
0
tests/specs/add/dist_tag/deno.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"tempDir": true,
|
||||
"steps": [
|
||||
{
|
||||
"envs": {
|
||||
"DENO_FUTURE": "1"
|
||||
},
|
||||
"args": "install npm:ajv@latest",
|
||||
"output": "install.out"
|
||||
}
|
||||
]
|
||||
}
|
15
tests/specs/install/future_install_add_dist_tag/install.out
Normal file
15
tests/specs/install/future_install_add_dist_tag/install.out
Normal file
|
@ -0,0 +1,15 @@
|
|||
Add npm:ajv@8.11.0
|
||||
[UNORDERED_START]
|
||||
Download http://localhost:4260/ajv
|
||||
Download http://localhost:4260/fast-deep-equal
|
||||
Download http://localhost:4260/json-schema-traverse
|
||||
Download http://localhost:4260/require-from-string
|
||||
Download http://localhost:4260/uri-js
|
||||
Download http://localhost:4260/punycode
|
||||
Download http://localhost:4260/ajv/ajv-8.11.0.tgz
|
||||
Download http://localhost:4260/fast-deep-equal/fast-deep-equal-3.1.3.tgz
|
||||
Download http://localhost:4260/uri-js/uri-js-4.4.1.tgz
|
||||
Download http://localhost:4260/json-schema-traverse/json-schema-traverse-1.0.0.tgz
|
||||
Download http://localhost:4260/require-from-string/require-from-string-2.0.2.tgz
|
||||
Download http://localhost:4260/punycode/punycode-2.1.1.tgz
|
||||
[UNORDERED_END]
|
Loading…
Reference in a new issue