Skip to content

Commit

Permalink
chore: update deno_doc to 0.119.0 (#23103)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Mar 27, 2024
1 parent 08d5d32 commit dc98595
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Expand Up @@ -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"] }
Expand Down
22 changes: 17 additions & 5 deletions cli/tools/doc.rs
Expand Up @@ -148,14 +148,26 @@ pub async fn doc(flags: Flags, doc_flags: DocFlags) -> Result<(), AnyError> {
&analyzer,
)
.await?;
let (_, deno_ns) = deno_ns.first().unwrap();

deno_doc::html::compute_namespaced_symbols(deno_ns, &[])
let (_, deno_ns) = deno_ns.into_iter().next().unwrap();

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 =
Expand Down Expand Up @@ -223,7 +235,7 @@ impl deno_doc::html::HrefResolver for DocResolver {
}

fn generate_docs_directory(
doc_nodes_by_url: &IndexMap<ModuleSpecifier, Vec<doc::DocNode>>,
doc_nodes_by_url: IndexMap<ModuleSpecifier, Vec<doc::DocNode>>,
html_options: &DocHtmlFlag,
deno_ns: std::collections::HashSet<Vec<String>>,
) -> Result<(), AnyError> {
Expand Down
12 changes: 11 additions & 1 deletion tests/integration/doc_tests.rs
Expand Up @@ -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());
}
2 changes: 1 addition & 1 deletion tests/testdata/doc/lint_success_html.out
@@ -1 +1 @@
Written 9 files to "./docs/"
Written 12 files to "./docs/"

0 comments on commit dc98595

Please sign in to comment.