summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvin@deno.com>2024-10-24 20:03:56 +0200
committerGitHub <noreply@github.com>2024-10-24 20:03:56 +0200
commit5f0bb3c6f4328003012e98ba70ce18e4e2e842de (patch)
tree5d99b6f2868c70b105ca4ff83f2a7380f4da9ac5 /cli/lsp
parentc71e020668b40666aecfdffb1dbf979abcb41958 (diff)
fix: `.npmrc` settings not being passed to install/add command (#26473)
We weren't passing the resolved npmrc settings to the install commands. This lead us to always fall back to the default registry url instead of using the one from npmrc. Fixes https://github.com/denoland/deno/issues/26139 Fixes https://github.com/denoland/deno/issues/26033 Fixes https://github.com/denoland/deno/issues/25924 Fixes https://github.com/denoland/deno/issues/25822 Fixes https://github.com/denoland/deno/issues/26152 --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/npm.rs6
-rw-r--r--cli/lsp/registries.rs1
2 files changed, 6 insertions, 1 deletions
diff --git a/cli/lsp/npm.rs b/cli/lsp/npm.rs
index 8bdeb7e7d..2decfc342 100644
--- a/cli/lsp/npm.rs
+++ b/cli/lsp/npm.rs
@@ -4,6 +4,7 @@ use dashmap::DashMap;
use deno_core::anyhow::anyhow;
use deno_core::error::AnyError;
use deno_core::serde_json;
+use deno_npm::npm_rc::NpmRc;
use deno_semver::package::PackageNv;
use deno_semver::Version;
use serde::Deserialize;
@@ -25,7 +26,10 @@ pub struct CliNpmSearchApi {
impl CliNpmSearchApi {
pub fn new(file_fetcher: Arc<FileFetcher>) -> Self {
- let resolver = NpmFetchResolver::new(file_fetcher.clone());
+ let resolver = NpmFetchResolver::new(
+ file_fetcher.clone(),
+ Arc::new(NpmRc::default().as_resolved(npm_registry_url()).unwrap()),
+ );
Self {
file_fetcher,
resolver,
diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs
index 5f7ce0082..ade353e68 100644
--- a/cli/lsp/registries.rs
+++ b/cli/lsp/registries.rs
@@ -482,6 +482,7 @@ impl ModuleRegistry {
.fetch_with_options(FetchOptions {
specifier: &specifier,
permissions: FetchPermissionsOptionRef::AllowAll,
+ maybe_auth: None,
maybe_accept: Some("application/vnd.deno.reg.v2+json, application/vnd.deno.reg.v1+json;q=0.9, application/json;q=0.8"),
maybe_cache_setting: None,
})