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

docs: typedoc improvements #1734

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

docs: typedoc improvements #1734

wants to merge 4 commits into from

Conversation

erickzhao
Copy link
Member

Cleanup PR based on learnings from the TypeDoc PRs.

  • Direct use of npx typedoc rather than JavaScript API removes legacy build_docs.js from code. Their JavaScript API has minimal documentation, and most options are available via typedoc.json configuration anyways.
  • Use of externalSymbolLinkMappings to show links to types available via external Electron packages (e.g. get and notarize).

Tag changes:

  • Changed plaintext examples to use the @example tag.
  • Fixed outstanding cases of legacy [[link tag syntax]] to use {@link tag syntax}.
  • Used @interface to expand utility types whenever possible (e.g. instead of Omit<TypeA, 'KeyB' | 'KeyC'>, adding the @interface tag makes it so that all of TypeA's properties are displayed in the API documentation excluding KeyB and KeyC.
  • Used @internal and excludeInternals to hide types that should not be used by end users of Electron Packager.

@erickzhao erickzhao requested a review from a team as a code owner June 10, 2024 19:37
package.json Show resolved Hide resolved
"sort": ["kind", "required-first", "alphabetical"],
"externalSymbolLinkMappings": {
"@electron/notarize": {
"NotaryToolCredentials": "https://erickzhao.github.io/notarize/types/NotaryToolCredentials.html"
Copy link
Member Author

Choose a reason for hiding this comment

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

DONOTMERGE: let's merge in electron/notarize#199 first!

@erickzhao erickzhao marked this pull request as draft June 10, 2024 19:41
@erickzhao erickzhao marked this pull request as ready for review June 10, 2024 19:41
Comment on lines -14 to -30
const replaceRef = /^refs\/(head|tag)s\//

function gitRevisionFromGitHubRef () {
const githubRef = process.env.GITHUB_REF
if (githubRef) {
return githubRef.replace(replaceRef, '')
}
}

const gitRevision = process.argv[2] || gitRevisionFromGitHubRef()
if (gitRevision) {
if (/^[0-9a-f]+$/i.test(gitRevision)) {
config.gitRevision = gitRevision
} else if (gitRevision.startsWith('v')) {
config.includeVersion = true
}
}
Copy link
Member

Choose a reason for hiding this comment

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

thought: I'm pretty sure this is why I used the JS API instead of the CLI.

"out": "./typedoc",
"excludeInternal": true,
"sort": ["kind", "required-first", "alphabetical"],
"externalSymbolLinkMappings": {
Copy link
Member

Choose a reason for hiding this comment

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

thought: oh, they finally added this?? Amazing

@malept
Copy link
Member

malept commented Jun 10, 2024

Do we also need to add explicit external link config for osx-sign and windows-sign? Plus any other dependency where we proxy the options that I'm forgetting.

Copy link
Member

@felixrieseberg felixrieseberg left a comment

Choose a reason for hiding this comment

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

Approving just so that you can merge when you want to!

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.06%. Comparing base (e94088d) to head (f24e1e6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1734      +/-   ##
==========================================
- Coverage   89.28%   89.06%   -0.23%     
==========================================
  Files          17       17              
  Lines         905      905              
  Branches      187      187              
==========================================
- Hits          808      806       -2     
- Misses         61       62       +1     
- Partials       36       37       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants