Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(doc): display non-exported types referenced in exported types #20990

Merged
merged 2 commits into from Oct 27, 2023

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Oct 26, 2023

Upgrades to deno_doc 0.70 which includes the feature for showing non-exported types referenced in exported types as well as a much more advanced deno doc that uses a symbol graph.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines -73 to -86
// If the root module has external types, the module graph won't redirect it,
// so instead create a dummy file which exports everything from the actual file being documented.
let root_specifier =
resolve_path("./$deno$doc.ts", cli_options.initial_cwd()).unwrap();
let root = File {
maybe_types: None,
media_type: MediaType::TypeScript,
source: format!("export * from \"{module_specifier}\";").into(),
specifier: root_specifier.clone(),
maybe_headers: None,
};

// Save our fake file into file fetcher cache.
file_fetcher.insert_cached(root);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet that this funky bit is gone!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That actually probably fixes some bugs too.

Comment on lines 1 to 12
Defined in file:///V:/deno/cli/tests/testdata/doc/referenced_private_types.ts:5:0

class MyClass

prop: MyInterface

Defined in file:///V:/deno/cli/tests/testdata/doc/referenced_private_types.ts:1:0

private interface MyInterface

prop?: string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@dsherret dsherret merged commit 9ec18c3 into denoland:main Oct 27, 2023
13 checks passed
@dsherret dsherret deleted the feat_deno_doc_private_types branch October 27, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants