mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(npm): improve peer dependency resolution (#17835)
This PR fixes peer dependency resolution to only resolve peers based on the current graph traversal path. Previously, it would resolve a peers by looking at a graph node's ancestors, which is not correct because graph nodes are shared by different resolutions. It also stores more information about peer dependency resolution in the lockfile.
This commit is contained in:
parent
608c855f11
commit
3479bc7661
27 changed files with 2743 additions and 1579 deletions
|
@ -73,7 +73,7 @@ use crate::graph_util;
|
|||
use crate::http_util::HttpClient;
|
||||
use crate::npm::NpmCache;
|
||||
use crate::npm::NpmPackageResolver;
|
||||
use crate::npm::RealNpmRegistryApi;
|
||||
use crate::npm::NpmRegistryApi;
|
||||
use crate::proc_state::ProcState;
|
||||
use crate::tools::fmt::format_file;
|
||||
use crate::tools::fmt::format_parsed_source;
|
||||
|
@ -304,7 +304,7 @@ fn create_lsp_npm_resolver(
|
|||
dir: &DenoDir,
|
||||
http_client: HttpClient,
|
||||
) -> NpmPackageResolver {
|
||||
let registry_url = RealNpmRegistryApi::default_url();
|
||||
let registry_url = NpmRegistryApi::default_url();
|
||||
let progress_bar = ProgressBar::new(ProgressBarStyle::TextOnly);
|
||||
let npm_cache = NpmCache::from_deno_dir(
|
||||
dir,
|
||||
|
@ -316,8 +316,8 @@ fn create_lsp_npm_resolver(
|
|||
http_client.clone(),
|
||||
progress_bar.clone(),
|
||||
);
|
||||
let api = RealNpmRegistryApi::new(
|
||||
registry_url,
|
||||
let api = NpmRegistryApi::new(
|
||||
registry_url.clone(),
|
||||
npm_cache.clone(),
|
||||
http_client,
|
||||
progress_bar,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue