mirror of
https://github.com/discordjs/discord.js.git
synced 2026-07-21 21:52:57 +00:00
fix(scripts): correctly mark external docs on non-main tags (#11514)
* fix(scripts): correctly mark external docs on non-main tags * fix: missing scoped package name --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -537,10 +537,15 @@ function resolveFileUrl(item: ApiDeclaredItem) {
|
||||
sourceURL: `/docs/packages/${pkgName}/${version}/${(currentItem.parent as ApiEntryPoint).importPath}/${currentItem.displayName}:${currentItem.kind}`,
|
||||
};
|
||||
}
|
||||
} else if (fileUrl?.includes('/dist/') && fileUrl.includes('/main/packages/')) {
|
||||
const [, pkg] = fileUrl.split('/main/packages/');
|
||||
} else if (fileUrl?.includes('/dist/') && fileUrl.includes('/packages/')) {
|
||||
const [dir, pkg] = fileUrl.split('/packages/');
|
||||
const pkgName = pkg!.split('/')[0];
|
||||
const version = 'main';
|
||||
const prefix = pkgName === 'discord.js' ? '' : '@discordjs/';
|
||||
const version =
|
||||
dir?.split('/').at(-1) === 'main'
|
||||
? 'main'
|
||||
: // eslint-disable-next-line unicorn/better-regex
|
||||
item.getAssociatedPackage()?.dependencies?.[`${prefix}${pkgName}`]?.replace(/[~^]/, '');
|
||||
|
||||
// https://github.com/discordjs/discord.js/tree/main/packages/builders/dist/index.d.ts
|
||||
let currentItem = item;
|
||||
|
||||
Reference in New Issue
Block a user