From 66424032a2c78c6010c0a1a1b22a26d081166660 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 19 Feb 2024 10:28:41 -0500 Subject: feat(unstable/lint): no-slow-types for JSR packages (#22430) 1. Renames zap/fast-check to instead be a `no-slow-types` lint rule. 1. This lint rule is automatically run when doing `deno lint` for packages (deno.json files with a name, version, and exports field) 1. This lint rules still occurs on publish. It can be skipped by running with `--no-slow-types` --- cli/graph_util.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'cli/graph_util.rs') diff --git a/cli/graph_util.rs b/cli/graph_util.rs index b9027afa3..380d82cbf 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -23,6 +23,7 @@ use crate::util::sync::TaskQueue; use crate::util::sync::TaskQueuePermit; use deno_config::ConfigFile; +use deno_config::WorkspaceMemberConfig; use deno_core::anyhow::bail; use deno_core::anyhow::Context; use deno_core::error::custom_error; @@ -277,7 +278,7 @@ impl ModuleGraphBuilder { graph_kind: GraphKind, roots: Vec, loader: &mut dyn Loader, - ) -> Result { + ) -> Result { self .create_graph_with_options(CreateGraphOptions { is_dynamic: false, @@ -289,10 +290,29 @@ impl ModuleGraphBuilder { .await } + pub async fn create_publish_graph( + &self, + packages: &[WorkspaceMemberConfig], + ) -> Result { + let mut roots = Vec::new(); + for package in packages { + roots.extend(package.config_file.resolve_export_value_urls()?); + } + self + .create_graph_with_options(CreateGraphOptions { + is_dynamic: false, + graph_kind: deno_graph::GraphKind::All, + roots, + workspace_fast_check: true, + loader: None, + }) + .await + } + pub async fn create_graph_with_options( &self, options: CreateGraphOptions<'_>, - ) -> Result { + ) -> Result { let mut graph = ModuleGraph::new(options.graph_kind); self -- cgit v1.2.3