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

chore: fix cross project links and missing implicitly exported types #3533

Merged
merged 3 commits into from
Jan 16, 2023

Conversation

legendecas
Copy link
Member

Which problem is this PR solving?

Fixes docs:test failure in PRs like #3514 and #3517.

Short description of the changes

  • Add plugin typedoc-plugin-missing-exports to generate docs for implicitly exported types.
  • Add plugin typedoc-plugin-resolve-crossmodule-references to generate links between projects in the monorepo.

Type of change

  • This change requires a documentation update

How Has This Been Tested?

Tested locally with NODE_OPTIONS=--max-old-space-size=6144 npm run docs and verified that the docs are generated as expected.

Checklist:

  • Followed the style guidelines of this project
  • Documentation has been updated

@legendecas legendecas requested a review from a team January 13, 2023 07:33
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #3533 (b5743a6) into main (a42e4ed) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3533   +/-   ##
=======================================
  Coverage   93.80%   93.80%           
=======================================
  Files         249      249           
  Lines        7640     7640           
  Branches     1589     1589           
=======================================
  Hits         7167     7167           
  Misses        473      473           

@legendecas
Copy link
Member Author

The Lint build would still fail since it checks with the published docs.

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking care of this 🙂

Should the MetricsAPI type be exported directly from the API package? Right now it looks like it is missing. 🤔

I ran the docs step locally and I think the file that's making the lint step fail will end up at
https://open-telemetry.github.io/opentelemetry-js/docs/classes/_opentelemetry_api._internal_.MetricsAPI.html instead of https://open-telemetry.github.io/opentelemetry-js/classes/_opentelemetry_api.MetricsAPI.html.

So the lint step may continue to fail. 🤔

@@ -62,7 +62,9 @@
"markdownlint-cli": "0.32.2",
"prettier": "2.8.0",
"semver": "7.3.5",
"typedoc": "0.22.10",
"typedoc": "0.22.18",
"typedoc-plugin-missing-exports": "1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this add internal details to our docs? Is that wanted? What is it fixing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the underlying problem may be that we're not exporting MetricsAPI from the API package - that makes the lint step fail as it is not part of the docs. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this was never a problem with the other APIs, there is something being done differently then with metrics that needs to be fixed. I think this plugin is hiding a problem rather than fixing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@legendecas legendecas Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some types are not exported but rather their instances are, like in https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-resources/src/detectors/BrowserDetector.ts#L64. It is fine to use those values without their types exported. However, typedoc would explain these and would not document their types and link to their base classes.

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legendecas legendecas merged commit 5127371 into open-telemetry:main Jan 16, 2023
@legendecas legendecas deleted the typedoc branch January 16, 2023 10:00
@dyladan dyladan mentioned this pull request Jan 27, 2023
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

Successfully merging this pull request may close these issues.

4 participants