mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
perf: update deno_doc (#24700)
Ref https://github.com/denoland/deno_doc/pull/616
This commit is contained in:
parent
fcd9bbe8ee
commit
b305ba3e1c
4 changed files with 11 additions and 10 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -1424,9 +1424,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_doc"
|
name = "deno_doc"
|
||||||
version = "0.142.0"
|
version = "0.144.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "16293d4ab42fdb4b499bf0bdc30def02048525c59cf268f65a66c4ab1d4520dc"
|
checksum = "12e151a1f29dcea4fe698123fa9693bc77574abf51a6add54d5d39cda99dd7f5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ammonia",
|
"ammonia",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -1439,6 +1439,7 @@ dependencies = [
|
||||||
"html-escape",
|
"html-escape",
|
||||||
"import_map",
|
"import_map",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
"itoa",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -67,7 +67,7 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa
|
||||||
deno_cache_dir = { workspace = true }
|
deno_cache_dir = { workspace = true }
|
||||||
deno_config = { version = "=0.26.1", features = ["workspace", "sync"] }
|
deno_config = { version = "=0.26.1", features = ["workspace", "sync"] }
|
||||||
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
|
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_emit = "=0.43.1"
|
||||||
deno_graph = { version = "=0.80.1", features = ["tokio_executor"] }
|
deno_graph = { version = "=0.80.1", features = ["tokio_executor"] }
|
||||||
deno_lint = { version = "=0.60.1", features = ["docs"] }
|
deno_lint = { version = "=0.60.1", features = ["docs"] }
|
||||||
|
|
|
@ -178,10 +178,10 @@ pub async fn doc(
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|node| deno_doc::html::DocNodeWithContext {
|
.map(|node| deno_doc::html::DocNodeWithContext {
|
||||||
origin: short_path.clone(),
|
origin: short_path.clone(),
|
||||||
ns_qualifiers: Rc::new(vec![]),
|
ns_qualifiers: Rc::new([]),
|
||||||
kind_with_drilldown:
|
kind_with_drilldown:
|
||||||
deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind),
|
deno_doc::html::DocNodeKindWithDrilldown::Other(node.kind()),
|
||||||
inner: std::sync::Arc::new(node),
|
inner: Rc::new(node),
|
||||||
drilldown_parent_kind: None,
|
drilldown_parent_kind: None,
|
||||||
parent: None,
|
parent: None,
|
||||||
})
|
})
|
||||||
|
@ -300,7 +300,7 @@ impl deno_doc::html::HrefResolver for DocResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resolve_source(&self, location: &deno_doc::Location) -> Option<String> {
|
fn resolve_source(&self, location: &deno_doc::Location) -> Option<String> {
|
||||||
Some(location.filename.clone())
|
Some(location.filename.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,9 +492,9 @@ fn print_docs_to_stdout(
|
||||||
doc_flags: DocFlags,
|
doc_flags: DocFlags,
|
||||||
mut doc_nodes: Vec<deno_doc::DocNode>,
|
mut doc_nodes: Vec<deno_doc::DocNode>,
|
||||||
) -> Result<(), AnyError> {
|
) -> 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 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() {
|
if nodes.is_empty() {
|
||||||
bail!("Node {} was not found!", filter);
|
bail!("Node {} was not found!", filter);
|
||||||
}
|
}
|
||||||
|
|
2
tests/testdata/doc/lint_success_json.out
vendored
2
tests/testdata/doc/lint_success_json.out
vendored
|
@ -1,6 +1,5 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"kind": "class",
|
|
||||||
"name": "Test",
|
"name": "Test",
|
||||||
"isDefault": false,
|
"isDefault": false,
|
||||||
"location": {
|
"location": {
|
||||||
|
@ -13,6 +12,7 @@
|
||||||
"jsDoc": {
|
"jsDoc": {
|
||||||
"doc": "My test class."
|
"doc": "My test class."
|
||||||
},
|
},
|
||||||
|
"kind": "class",
|
||||||
"classDef": {
|
"classDef": {
|
||||||
"isAbstract": false,
|
"isAbstract": false,
|
||||||
"constructors": [],
|
"constructors": [],
|
||||||
|
|
Loading…
Reference in a new issue