in our typescript library repo, we are experimenting with typedoc to generate api documentation.
as typedoc@next, i could do mode="library", which i am guessing is a best mode for us as its a web library.
we have both .ts and .tsx files that exposes modules and react-components to our users.
when i do :
mode="library", .tsx files are ignored.
mode="modules" those are parsed and .tsx components are documented.
note : i'm not sure whether it's a bug or not.
"compilerOptions":{
"jsx": "react",
... other ts config's
...
"typedocOptions": {
"inputFiles": [
"src/clients",
"src/components",
"src/models"
],
"mode": "modules",
"out": "../docs/ts-docs",
"exclude": [
"**/*+(**Impl|**PostCommand|**WsCommand|**index).ts",
"**/decoders/*",
"**/*+(**Utils).ts"
],
"jsx": "react",
"excludePrivate": true,
"plugin" : "typedoc-plugin-external-module-map",
"external-modulemap" : ".*\/(clients|components|models)\/",
"categorizeByGroup": true,
"categoryOrder": [
"Services",
"Agent-Service",
"Others"
]
}
}
_Originally posted by @Manish3323 in https://github.com/TypeStrong/typedoc/issues/1364#issuecomment-710998307
Pulling this into its own issue to avoid duplicate discussion in the tracking issue.
Could you link to a repo which reproduces this issue? I took a quick look at the code where I'd expect the bug to show up, and both places look correct.
Hi, i have created a similar minimal setup.
https://github.com/Manish3323/typedoc-repro/
Thanks in advance.
I can't seem to reproduce this... I pulled down your repo, installed, ran npx typedoc, and got the following output:
C:\Users\gtbir\Documents\GitHub\typedoc-repro [main ≡ +0 ~1 -0 !]> npx typedoc
Loaded plugin C:\Users\gtbir\Documents\GitHub\typedoc-repro\node_modules\typedoc-plugin-external-module-map
Using TypeScript 4.0.3 from C:\Users\gtbir\Documents\GitHub\typedoc-repro\node_modules\typescript\lib
INFO: applying regexp .*/(components)/ to calculate module names
INFO: Enabled true
Mapping C:/Users/gtbir/Documents/GitHub/typedoc-repro/src/components/Component.tsx ==> components
Mapping C:/Users/gtbir/Documents/GitHub/typedoc-repro/src/components/RandomHelper.ts ==> components
Rendering [========================================] 100%
(The changed file is package-lock.json - my version of npm added the package name, no other changes)
Then, when opening up the documentation, I see this:

i see you marked this issue as bug.. but after reading your comment.. i m bit confused whether it is bug or i have some kind of dependency issue in my setup..
Thanks
I marked it as a bug because I noticed it didn't have any labels, and needed one to be easier to find. I suspect it's an issue with your setup, and not actually a bug though.
i got it working with typedoc@next
however it wasn't setup related but how i define the export inside my .tsx file.
it generates the documentation for react component if i make it inline like this
export default function Component(props: Props){}
earlier i had like this
function Component(props: Props){}
export default Component
Hmmm... I wonder if this is the same bug as #1382 then, will be looking into it this weekend, and most likely fixing on the @beta release.
This is fixed + released in [email protected]
bug still kindof happens in 0.20.1 - tsx files are there, but jsdoc are ignored
Most helpful comment
This is fixed + released in
[email protected]