Typedoc: Re-exports do not work with library mode

Created on 17 Mar 2020  路  3Comments  路  Source: TypeStrong/typedoc

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
bug

Most helpful comment

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.

All 3 comments

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)

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?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nidsharm picture nidsharm  路  3Comments

mcmath picture mcmath  路  3Comments

KevinEady picture KevinEady  路  3Comments

0815fox picture 0815fox  路  3Comments

atomsoftwarestudios picture atomsoftwarestudios  路  4Comments