perf(cli): conditionally load typescript declaration files (#19392)

Closes #18583
This commit is contained in:
David Sherret 2023-06-06 17:07:46 -04:00 committed by GitHub
parent 455b0eb8bb
commit 2aba4365ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 156 additions and 67 deletions

View file

@ -16,6 +16,7 @@ use deno_core::error::AnyError;
use deno_core::resolve_path;
use deno_core::resolve_url_or_path;
use deno_doc as doc;
use deno_graph::GraphKind;
use deno_graph::ModuleSpecifier;
use std::path::PathBuf;
@ -43,7 +44,7 @@ pub async fn print_docs(
Vec::new(),
);
let analyzer = deno_graph::CapturingModuleAnalyzer::default();
let mut graph = deno_graph::ModuleGraph::default();
let mut graph = deno_graph::ModuleGraph::new(GraphKind::TypesOnly);
graph
.build(
vec![source_file_specifier.clone()],
@ -87,7 +88,7 @@ pub async fn print_docs(
file_fetcher.insert_cached(root);
let graph = module_graph_builder
.create_graph(vec![root_specifier.clone()])
.create_graph(GraphKind::TypesOnly, vec![root_specifier.clone()])
.await?;
if let Some(lockfile) = maybe_lockfile {