summaryrefslogtreecommitdiff
path: root/cli/graph_util.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-02-19 10:28:41 -0500
committerGitHub <noreply@github.com>2024-02-19 15:28:41 +0000
commit66424032a2c78c6010c0a1a1b22a26d081166660 (patch)
tree610e95beba5685ef1ba322375bf31a3fd6c5a187 /cli/graph_util.rs
parent2b279ad630651e973d5a31586f58809f005bc925 (diff)
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`
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r--cli/graph_util.rs24
1 files changed, 22 insertions, 2 deletions
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<ModuleSpecifier>,
loader: &mut dyn Loader,
- ) -> Result<deno_graph::ModuleGraph, AnyError> {
+ ) -> Result<ModuleGraph, AnyError> {
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<ModuleGraph, AnyError> {
+ 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<deno_graph::ModuleGraph, AnyError> {
+ ) -> Result<ModuleGraph, AnyError> {
let mut graph = ModuleGraph::new(options.graph_kind);
self