mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
fix(npm): reload an npm package's dependency's information when version not found (#18622)
This reloads an npm package's dependency's information when a version/version req/tag is not found. This PR applies only to dependencies of npm packages. It does NOT yet cause npm specifiers to have their dependency information cache busted. That requires a different solution, but this should help cache bust in more scenarios. Part of #16901, but doesn't close it yet
This commit is contained in:
parent
0dca0c5196
commit
5c7f76c570
15 changed files with 257 additions and 57 deletions
|
@ -117,10 +117,11 @@ pub async fn snapshot_from_lockfile(
|
|||
let mut version_infos =
|
||||
FuturesOrdered::from_iter(packages.iter().map(|p| p.pkg_id.nv.clone()).map(
|
||||
|nv| async move {
|
||||
match api.package_version_info(&nv).await? {
|
||||
Some(version_info) => Ok(version_info),
|
||||
None => {
|
||||
bail!("could not find '{}' specified in the lockfile. Maybe try again with --reload", nv);
|
||||
let package_info = api.package_info(&nv.name).await?;
|
||||
match package_info.version_info(&nv) {
|
||||
Ok(version_info) => Ok(version_info),
|
||||
Err(err) => {
|
||||
bail!("Could not find '{}' specified in the lockfile. Maybe try again with --reload", err.0);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue