Skip to content

Missing documentation with library mode #1380

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

Closed
Gerrit0 opened this issue Oct 17, 2020 · 9 comments
Closed

Missing documentation with library mode #1380

Gerrit0 opened this issue Oct 17, 2020 · 9 comments

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 17, 2020

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.

my current ts config

"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 #1364 (comment)

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Oct 17, 2020

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.

@Manish3323
Copy link

Hi, i have created a similar minimal setup.
https://github.com/Manish3323/typedoc-repro/

Thanks in advance.

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Oct 25, 2020

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:

image

@Gerrit0 Gerrit0 added the bug label Oct 25, 2020
@Manish3323
Copy link

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

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Oct 26, 2020

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.

@Manish3323
Copy link

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

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Oct 28, 2020

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.

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Nov 1, 2020

This is fixed + released in [email protected]

@Gerrit0 Gerrit0 closed this as completed Nov 1, 2020
@macrozone
Copy link

bug still kindof happens in 0.20.1 - tsx files are there, but jsdoc are ignored

@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
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

3 participants