From dc985954e1c8f8350a40acbae726909eeef39520 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 27 Mar 2024 16:25:39 -0700 Subject: [PATCH] chore: update deno_doc to 0.119.0 (#23103) --- Cargo.lock | 4 ++-- cli/Cargo.toml | 2 +- cli/tools/doc.rs | 20 ++++++++++++++++---- tests/integration/doc_tests.rs | 12 +++++++++++- tests/testdata/doc/lint_success_html.out | 2 +- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 45dfce2060..c3060ce9d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1346,9 +1346,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.113.1" +version = "0.119.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "394381b3a23173f7bcb309e49ee29f33b8815495ca61fbdc8cb030439dc9d6ed" +checksum = "cbaec0d12c5f161bc96cf077874b586e860538663791d3e5d7df867af2d5f3ec" dependencies = [ "ammonia", "anyhow", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 5345f45cf3..44204fea72 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -66,7 +66,7 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa deno_cache_dir = { workspace = true } deno_config = "=0.15.0" deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } -deno_doc = { version = "=0.113.1", features = ["html"] } +deno_doc = { version = "=0.119.0", features = ["html"] } deno_emit = "=0.38.2" deno_graph = { version = "=0.69.9", features = ["tokio_executor"] } deno_lint = { version = "=0.58.0", features = ["docs"] } diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index 0107402df5..91cede8794 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -148,14 +148,26 @@ pub async fn doc(flags: Flags, doc_flags: DocFlags) -> Result<(), AnyError> { &analyzer, ) .await?; - let (_, deno_ns) = deno_ns.first().unwrap(); + let (_, deno_ns) = deno_ns.into_iter().next().unwrap(); - deno_doc::html::compute_namespaced_symbols(deno_ns, &[]) + deno_doc::html::compute_namespaced_symbols( + deno_ns + .into_iter() + .map(|node| deno_doc::html::DocNodeWithContext { + origin: Rc::new(ShortPath::from("deno".to_string())), + ns_qualifiers: Rc::new(vec![]), + kind_with_drilldown: + deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind), + inner: std::sync::Arc::new(node), + }) + .collect(), + &[], + ) } else { Default::default() }; - generate_docs_directory(&doc_nodes_by_url, html_options, deno_ns) + generate_docs_directory(doc_nodes_by_url, html_options, deno_ns) } else { let modules_len = doc_nodes_by_url.len(); let doc_nodes = @@ -223,7 +235,7 @@ impl deno_doc::html::HrefResolver for DocResolver { } fn generate_docs_directory( - doc_nodes_by_url: &IndexMap>, + doc_nodes_by_url: IndexMap>, html_options: &DocHtmlFlag, deno_ns: std::collections::HashSet>, ) -> Result<(), AnyError> { diff --git a/tests/integration/doc_tests.rs b/tests/integration/doc_tests.rs index ca523f07f2..de28edd10f 100644 --- a/tests/integration/doc_tests.rs +++ b/tests/integration/doc_tests.rs @@ -139,15 +139,25 @@ fn deno_doc_html() { .run(); output.assert_exit_code(0); - assert_contains!(output.stderr(), "Written 10 files to"); + assert_contains!(output.stderr(), "Written 14 files to"); assert!(temp_dir.path().join("all_symbols.html").exists()); assert!(temp_dir.path().join("index.html").exists()); assert!(temp_dir.path().join("fuse.js").exists()); assert!(temp_dir.path().join("page.css").exists()); + assert!(temp_dir.path().join("script.js").exists()); assert!(temp_dir.path().join("search.js").exists()); assert!(temp_dir.path().join("search_index.js").exists()); assert!(temp_dir.path().join("styles.css").exists()); assert!(temp_dir.path().join("~/MyInterface.html").exists()); + assert!(temp_dir + .path() + .join("~/MyInterface.prototype.prop.html") + .exists()); assert!(temp_dir.path().join("~/MyClass.html").exists()); + assert!(temp_dir.path().join("~/MyClass.prototype.html").exists()); + assert!(temp_dir + .path() + .join("~/MyClass.prototype.prop.html") + .exists()); assert!(temp_dir.path().join("~/index.html").exists()); } diff --git a/tests/testdata/doc/lint_success_html.out b/tests/testdata/doc/lint_success_html.out index 9503a335fe..783dd5927e 100644 --- a/tests/testdata/doc/lint_success_html.out +++ b/tests/testdata/doc/lint_success_html.out @@ -1 +1 @@ -Written 9 files to "./docs/" +Written 12 files to "./docs/"