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

TypeDoc renders main entry point containing only exports default and reexport declarations as empty #596

Closed
octatone opened this issue Sep 22, 2017 · 11 comments

Comments

@octatone
Copy link

I have an entry point index.ts for my library that contains only an export default and export declarations:

import Main from './Main'
export default Main

export { default as State } from './state'
export { default as ThingModel } from './state/Thing/Model'
export { default as ThingCollection } from './state/Thing/Collection'

// etc ...

When I generate docs via TypeDoc it is an empty file. I would expect it to list what is exported from this module:

empty

@aciccarello
Copy link
Collaborator

Hi @octatone, how are you calling/what are you using for your typedoc configuration.

@octatone
Copy link
Author

octatone commented Sep 22, 2017

via shell:
typedoc --options ./config/typedoc.js --out ./docs ./src

typedoc.js:

module.exports = {
  mode: "modules",
  module: "umd",
  target: "ES5",
  externalPattern: "node_modules",
  excludeExternals: true,
  excludePrivate: true
}

index.ts lives at ./src/index.ts

I get the same empty output regardless of options or no options (default options).

@chrisprice
Copy link

From a quick poke around, am I right in thinking this behavior is because typedoc only supports ts.SyntaxKind.ExportAssignment and the export syntax in use is ts.SyntaxKind.ExportDeclaration?

@pluma
Copy link

pluma commented Feb 20, 2018

I'm guessing this isn't going to be fixed anytime soon?

@pabloFuente
Copy link

And how can the export syntax be changed from ExportDeclaration to ExportAssignment? Any idea?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 16, 2019

This will be fixed by #801

@pluma
Copy link

pluma commented Mar 30, 2020

#801 was closed and replaced by #1157, which has been merged. I can't seem to get reexports to show up with the latest release, though.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 30, 2020

Could you set up an example repo showing this problem? The tests for it are passing... seems to be working for me.

@pluma
Copy link

pluma commented Mar 30, 2020

Here's my setup:

index.ts
typedoc.json

Only the default export shows up in the documentation:

image

@pluma
Copy link

pluma commented Mar 30, 2020

Ah, nevermind, explicitly changing it to export {...} from syntax fixes this. Re-exporting the imports doesn't work though.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 5, 2020

Ah, that makes some sense. Yet another reason coming back to why we need to use the type checker to get this information instead of walking the node tree and trying to figure it out ourselves... Glad you found a workaround for now.

@Gerrit0 Gerrit0 closed this as completed Nov 28, 2020
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

No branches or pull requests

6 participants