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

Is there a service for automatic TypeDoc generation like in Rust crates.io? #2265

Closed
hydroper opened this issue Apr 26, 2023 · 2 comments
Closed
Labels
question Question about functionality

Comments

@hydroper
Copy link

hydroper commented Apr 26, 2023

Search terms

automatic

Question

Is there a website that automatically builds TypeDoc API documentation from NPM packages, similiar to Cargo's crates.io? I think crates.io uses Docker.

@hydroper hydroper added the question Question about functionality label Apr 26, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 29, 2023

There is not, unfortunately doing this comes with a whole host of problems that rust (and to a lesser extent, deno) don't have. I'm unlikely to ever build something like this.

  1. Most packages don't ship with types... but the compiler in JS mode can infer some types from them that ought to show up.
  2. Packages without types might have an @types package that needs to be paired with the version of the package, and it's not always clear how to do that for anything but the latest version. (And there might be more type dependencies declared with * versions, since that what definitely typed uses), could be mitigated by only supporting the latest version..
  3. What gets used as the entry point or entry points? Support for package exports map #1937 will enable trying to figure this out from package.json, but we don't have that yet. It's tricky to map from JS output files back to the TS files, even trickier when considering libraries that bundle their output so there isn't a 1-1 mapping.
  4. If building from declaration files, we can't link to source code for the declaration. Even if declaration source maps are published, they don't include all exports for some reason, so can't be relied on.
  5. ESM/CJS is terrible, and a service like this should differentiate between them.
  6. A service like this should really allow interconnected docs. This is more possible since 0.24, but it's still not something that'll come for free. I think this one is relatively easy to fix via a custom link resolution plugin.

... probably way more I haven't even thought of, and an unlikely to in the middle of the night.

@Gerrit0 Gerrit0 closed this as completed May 5, 2023
@pastelsky
Copy link

I attempted one anyway — tsdocs.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about functionality
Projects
None yet
Development

No branches or pull requests

4 participants
@pastelsky @Gerrit0 @hydroper and others