From b305ba3e1c155a33139ec0d764f547ffde4d4de4 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 24 Jul 2024 12:23:16 -0700 Subject: [PATCH] perf: update deno_doc (#24700) Ref https://github.com/denoland/deno_doc/pull/616 --- Cargo.lock | 5 +++-- cli/Cargo.toml | 2 +- cli/tools/doc.rs | 12 ++++++------ tests/testdata/doc/lint_success_json.out | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e8406f5c8..db31a66380 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1424,9 +1424,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.142.0" +version = "0.144.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16293d4ab42fdb4b499bf0bdc30def02048525c59cf268f65a66c4ab1d4520dc" +checksum = "12e151a1f29dcea4fe698123fa9693bc77574abf51a6add54d5d39cda99dd7f5" dependencies = [ "ammonia", "anyhow", @@ -1439,6 +1439,7 @@ dependencies = [ "html-escape", "import_map", "indexmap", + "itoa", "lazy_static", "regex", "serde", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3fa5b54ed9..4242fb09cd 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -67,7 +67,7 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa deno_cache_dir = { workspace = true } deno_config = { version = "=0.26.1", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } -deno_doc = { version = "=0.142.0", features = ["html", "syntect"] } +deno_doc = { version = "0.144.0", features = ["html", "syntect"] } deno_emit = "=0.43.1" deno_graph = { version = "=0.80.1", features = ["tokio_executor"] } deno_lint = { version = "=0.60.1", features = ["docs"] } diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index 824a3fc389..bc0d81cc90 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -178,10 +178,10 @@ pub async fn doc( .into_iter() .map(|node| deno_doc::html::DocNodeWithContext { origin: short_path.clone(), - ns_qualifiers: Rc::new(vec![]), + ns_qualifiers: Rc::new([]), kind_with_drilldown: - deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind), - inner: std::sync::Arc::new(node), + deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind()), + inner: Rc::new(node), drilldown_parent_kind: None, parent: None, }) @@ -300,7 +300,7 @@ impl deno_doc::html::HrefResolver for DocResolver { } fn resolve_source(&self, location: &deno_doc::Location) -> Option { - Some(location.filename.clone()) + Some(location.filename.to_string()) } } @@ -492,9 +492,9 @@ fn print_docs_to_stdout( doc_flags: DocFlags, mut doc_nodes: Vec, ) -> Result<(), AnyError> { - doc_nodes.retain(|doc_node| doc_node.kind != doc::DocNodeKind::Import); + doc_nodes.retain(|doc_node| doc_node.kind() != doc::DocNodeKind::Import); let details = if let Some(filter) = doc_flags.filter { - let nodes = doc::find_nodes_by_name_recursively(doc_nodes, filter.clone()); + let nodes = doc::find_nodes_by_name_recursively(doc_nodes, &filter); if nodes.is_empty() { bail!("Node {} was not found!", filter); } diff --git a/tests/testdata/doc/lint_success_json.out b/tests/testdata/doc/lint_success_json.out index d87654c91c..19f04c6a86 100644 --- a/tests/testdata/doc/lint_success_json.out +++ b/tests/testdata/doc/lint_success_json.out @@ -1,6 +1,5 @@ [ { - "kind": "class", "name": "Test", "isDefault": false, "location": { @@ -13,6 +12,7 @@ "jsDoc": { "doc": "My test class." }, + "kind": "class", "classDef": { "isAbstract": false, "constructors": [],