From 4d2d764816d266e42f3b2251248b100abb667c83 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 10 Jul 2024 14:46:09 -0400 Subject: feat(jsr): support publishing jsr packages in npm workspaces (#24507) Supports publishing an npm workspace with a directory structure similar to the following: - workspace - package.json - package-a - package.json - jsr.json - package-b - package.json - jsr.json deno_config PR: https://github.com/denoland/deno_config/pull/77 Closes https://github.com/denoland/deno/issues/23638 --- cli/args/mod.rs | 21 ++++++++++++--------- cli/lsp/resolver.rs | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'cli') diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 6a8eaa268..60cc97e2d 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -1297,15 +1297,18 @@ impl CliOptions { pub fn to_compiler_option_types( &self, ) -> Result, AnyError> { - self.workspace.to_maybe_imports().map(|maybe_imports| { - maybe_imports - .into_iter() - .map(|(referrer, imports)| deno_graph::ReferrerImports { - referrer, - imports, - }) - .collect() - }) + self + .workspace + .to_compiler_option_types() + .map(|maybe_imports| { + maybe_imports + .into_iter() + .map(|(referrer, imports)| deno_graph::ReferrerImports { + referrer, + imports, + }) + .collect() + }) } pub fn npmrc(&self) -> &Arc { diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index d6414697b..f160622ab 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -115,7 +115,7 @@ impl LspScopeResolver { let npm_graph_resolver = graph_resolver.create_graph_npm_resolver(); let graph_imports = config_data .and_then(|d| d.config_file.as_ref()) - .and_then(|cf| cf.to_maybe_imports().ok()) + .and_then(|cf| cf.to_compiler_option_types().ok()) .map(|imports| { Arc::new( imports -- cgit v1.2.3