From 56579e38b239e1d96445b0d8ce601fb995bccbe3 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:22:58 +0100 Subject: [PATCH] fix: install peer dependencies & silence warn in x command --- src/resolver.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/resolver.rs b/src/resolver.rs index c9ab73a..0d8ef8d 100644 --- a/src/resolver.rs +++ b/src/resolver.rs @@ -19,7 +19,8 @@ impl Project { &self, previous_graph: Option<&DependencyGraph>, refreshed_sources: &mut HashSet, - manifest_transformed: bool, + // used by `x` command - if true, specifier indices are expected to be URLs. will not do peer dependency checks + is_published_package: bool, ) -> Result> { let manifest = self .deser_manifest() @@ -140,7 +141,7 @@ impl Project { ); let source = match &specifier { DependencySpecifiers::Pesde(specifier) => { - let index_url = if !manifest_transformed && (depth == 0 || overridden) { + let index_url = if !is_published_package && (depth == 0 || overridden) { let index_name = specifier.index.as_deref().unwrap_or(DEFAULT_INDEX_NAME); manifest @@ -164,7 +165,7 @@ impl Project { } #[cfg(feature = "wally-compat")] DependencySpecifiers::Wally(specifier) => { - let index_url = if !manifest_transformed && (depth == 0 || overridden) { + let index_url = if !is_published_package && (depth == 0 || overridden) { let index_name = specifier.index.as_deref().unwrap_or(DEFAULT_INDEX_NAME); manifest @@ -220,7 +221,8 @@ impl Project { ))); }; - let resolved_ty = if depth == 0 && ty == DependencyType::Peer { + let resolved_ty = if (is_published_package || depth == 0) && ty == DependencyType::Peer + { DependencyType::Standard } else { ty