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

feat(): experimental support for typedoc generation #17377

Closed
wants to merge 1 commit into from

Conversation

boneskull
Copy link
Contributor

Run npm run typedoc to generate docs in typedoc-docs dir.

I thought I'd take a few mins and set this up. It was mostly straightforward, except:

  1. Figuring out the "entry point" for each package was difficult until I realized .js entry points are assumed to be compiled, and thus require a sourceMappingUrl reference. IMO this is probably a bug in TypeDoc
  2. The sourceMappingUrl must reference an external sourcemap file; not an inline source map. If it's an inline source map, the system tries to fs.open a large data-url.
  3. The babel config does not control whether external sourcemaps are created; @babel/cli does. So I needed to change those.
  4. Practically speaking, I don't see any drawback to external sourcemaps yet
  5. TypeDoc has poor support for cross-package type references in monorepos, and I had to add a plugin which implements a workaround
  6. Per some suggestions in the docs, I modified the order of references in the root tsconfig.json to start with "the biggest one first"

I didn't modify any types or docstrings anywhere.

The intent here is to show a proof-of-concept.

Run `npm run typedoc` to generate docs in `typedoc-docs` dir.

I thought I'd take a few mins and set this up.  It was _mostly_ straightforward, except:

1. Figuring out the "entry point" for each package was difficult until I realized `.js` entry points are assumed to be compiled, and thus require a `sourceMappingUrl` reference. IMO this is probably a bug in TypeDoc
2. The `sourceMappingUrl` must reference an external sourcemap file; not an inline source map.  If it's an inline source map, the system tries to `fs.open` a large data-url.
3. The babel config does not control whether external sourcemaps are created; `@babel/cli` does. So I needed to change those.
4. Practically speaking, I don't see any drawback to external sourcemaps _yet_
5. TypeDoc has poor support for cross-package type references in monorepos, and I had to add a plugin which implements a workaround
6. Per some suggestions in the docs, I modified the order of references in the root `tsconfig.json` to start with "the biggest one first"

I didn't modify any types or docstrings anywhere.
@boneskull boneskull added the Documentation related to writing, reading, or generating documentation label Aug 17, 2022
@boneskull boneskull requested a review from jlipps August 17, 2022 19:27
@boneskull boneskull self-assigned this Aug 17, 2022
@boneskull
Copy link
Contributor Author

See TypeStrong/typedoc#2037

@boneskull boneskull closed this Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation related to writing, reading, or generating documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant