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

fix(website): doc links to other packages #9994

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

Qjuh
Copy link
Contributor

@Qjuh Qjuh commented Nov 22, 2023

Please describe the changes this PR makes and why it should be merged:

Assures links to other packages of the monorepo link to the appropriate version used by the currently viewed version.

Also removes inherited methods from the api.json, as they get correctly parsed from inheritance tree and caused issues by being duplicated in the api.json causing wrong type links and missing inheritance information.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@Qjuh Qjuh requested review from a team and iCrawl as code owners November 22, 2023 17:12
Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2023 5:44pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Nov 22, 2023 5:44pm

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (57c414b) 58.89% compared to head (32aa03e) 58.79%.

Files Patch % Lines
apps/website/src/components/ExcerptText.tsx 0.00% 11 Missing ⚠️
apps/website/src/components/ItemLink.tsx 0.00% 7 Missing ⚠️
...bsite/src/components/documentation/tsdoc/TSDoc.tsx 0.00% 7 Missing ⚠️
apps/website/src/components/documentation/util.ts 0.00% 7 Missing ⚠️
apps/website/src/components/Property.tsx 0.00% 3 Missing ⚠️
apps/website/src/components/SignatureText.tsx 0.00% 3 Missing ⚠️
...s/website/src/components/model/enum/EnumMember.tsx 0.00% 3 Missing ⚠️
apps/website/src/components/TypeParamTable.tsx 0.00% 2 Missing ⚠️
apps/website/src/components/ParameterTable.tsx 0.00% 1 Missing ⚠️
...ite/src/components/documentation/HierarchyText.tsx 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9994      +/-   ##
==========================================
- Coverage   58.89%   58.79%   -0.11%     
==========================================
  Files         240      240              
  Lines       17003    17033      +30     
  Branches     1240     1240              
==========================================
  Hits        10014    10014              
- Misses       6944     6974      +30     
  Partials       45       45              
Flag Coverage Δ
brokers 63.49% <ø> (ø)
builders 95.53% <ø> (ø)
collection 99.32% <ø> (ø)
formatters 99.47% <ø> (ø)
next ∅ <ø> (∅)
proxy 75.00% <ø> (ø)
rest 92.87% <ø> (ø)
util 70.70% <ø> (ø)
voice 63.64% <ø> (ø)
website 0.00% <0.00%> (ø)
ws 52.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

packages/api-extractor/src/generators/ApiModelGenerator.ts Outdated Show resolved Hide resolved
version={
resolved?.package
? // eslint-disable-next-line unicorn/better-regex
item.getAssociatedPackage()?.dependencies?.[resolved.package]?.replace(/[~^]/, '')
Copy link
Member

Choose a reason for hiding this comment

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

item.getAssociatedPackage() is called 3 times in this block, do you think it is necessary to cache the result of this?

Example
						let associatedPackage: ApiPackage | null | undefined = null;

						// eslint-disable-next-line no-inner-declarations
						function getAssociatedPackage() {
							if (associatedPackage !== null) return associatedPackage;
							return (associatedPackage = item.getAssociatedPackage());
						}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be a good idea. But if we talk about caching stuff it would be way better to cache the ApiModel/ApiPackage in a more central place, because currently the website rebuilds the Model a lot...

packages/api-extractor/src/generators/ApiModelGenerator.ts Outdated Show resolved Hide resolved
Co-authored-by: Almeida <almeidx@pm.me>
@iCrawl iCrawl merged commit 9fdbf0a into discordjs:main Nov 22, 2023
22 checks passed
@Qjuh Qjuh deleted the fix/website-subpackage-doc-links branch November 23, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants