diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-12-01 15:12:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-01 20:12:10 +0000 |
commit | a1d823e27d1b605b5658fddc1c9273667f0e9e84 (patch) | |
tree | 213f35fb40b5c70832b1d9473947b3de48d4ec9e /cli/tools/doc.rs | |
parent | d8e8497eb3049f58632e4d7507090ef9915b3af6 (diff) |
feat(compile): support discovering modules for more dynamic arguments (#21381)
This PR causes Deno to include more files in the graph based on how a
template literal looks that's provided to a dynamic import:
```ts
const file = await import(`./dir/${expr}`);
```
In this case, it will search the `dir` directory and descendant
directories for any .js/jsx/etc modules and include them in the graph.
To opt out of this behaviour, move the template literal to a separate
line:
```ts
const specifier = `./dir/${expr}`
const file = await import(specifier);
```
Diffstat (limited to 'cli/tools/doc.rs')
-rw-r--r-- | cli/tools/doc.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index ff8b8d62e..be3f029ec 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -28,6 +28,7 @@ use doc::DocDiagnostic; use indexmap::IndexMap; use std::collections::BTreeMap; use std::path::PathBuf; +use std::rc::Rc; use std::sync::Arc; async fn generate_doc_nodes_for_builtin_types( @@ -185,7 +186,11 @@ async fn generate_docs_directory( let output_dir_resolved = cwd.join(&html_options.output); let options = deno_doc::html::GenerateOptions { - package_name: html_options.name, + package_name: Some(html_options.name), + main_entrypoint: None, + global_symbols: Default::default(), + global_symbol_href_resolver: Rc::new(|_, _| String::new()), + url_resolver: Rc::new(deno_doc::html::default_url_resolver), }; let files = deno_doc::html::generate(options, doc_nodes_by_url) |