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

Re-exports do not work with library mode #1232

Closed
euberdeveloper opened this issue Mar 17, 2020 · 3 comments
Closed

Re-exports do not work with library mode #1232

euberdeveloper opened this issue Mar 17, 2020 · 3 comments
Labels
bug Functionality does not match expectation

Comments

@euberdeveloper
Copy link

Expected Behavior

On the root of this project, I run this command (after having installed typedoc):

npx typedoc --mode library --inputFiles source/lib/index.ts --tsconfig source/tsconfig.json --out docs/documentation

Everything works well. The index.ts exports a function (generate) and re-exports the Options from another file.

I get something like this:

first

What I want is the same thing, but without the externals, like this:

second

Hence I run this command:

npx typedoc --inputFiles source/lib/index.ts --excludeExternals --mode library --tsconfig source/tsconfig.json --out docs/documentation

With the --excludeExternals added

Actual Behavior

The problem is that now the re-exported Options is disappeard, and I get this:

third

Steps to reproduce the bug

To reproduce, clone this project, install typedoc 0.17.0 as dev dependency and run this: npx typedoc --inputFiles source/lib/index.ts --excludeExternals --mode library --tsconfig source/tsconfig.json --out docs/documentation to generate the documentation of source/lib/index.ts

Environment

  • Typedoc version: 0.17.0
  • Node.js version: 12
  • OS: Ubuntu 18
@euberdeveloper euberdeveloper added the bug Functionality does not match expectation label Mar 17, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 18, 2020

So, there is a problem here, but it isn't exactly what you thought it was.

Version 0.17.0 doesn't include library mode - and TypeDoc has a bug so it doesn't tell you that it is ignoring that you told it to use library mode and is using modules mode #1237.

--excludeExternals is working as expected. The Options type is not included in your input files, and is therefore considered external, so it is removed by --excludeExternals.

What you are looking for is not to remove the "externals" (bad name, needs fixing, after library mode is done...) from your documentation (after all, that's where Options is defined!) but simply removing it them from the navigation.

The --toc option is supposed to let you do this, and I was going to suggest creating a typedoc.json file with { "toc": [ "\"index\"" ] } in it, but this seems to be broken in modules mode (the globals list appears to be unaffected by this option, which seems like a bug that I don't have time to chase down right now)

@euberdeveloper
Copy link
Author

Ok, thank you, sorry if I did not notice library mode was still not available

I see now a 0.17.1, is it still without lib mode?

When library is available, will I be able to have what I need (have the documentation of all things exported or re-exported by the only index.ts file)?

Is there any other way to do this with the current version?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 21, 2020

Yes, library mode is supporting precisely that use case.

0.18 (assuming no required breaking changes are needed before library mode is done) will contain library mode.

You can install typedoc@next if you want to use library mode now. I'm afraid there isn't a great solution in the existing version for your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants