mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
fix(guide): Fix unknown component in v14 update guide (#9514)
* chore(constants): update discord.js to 14.10.2 * feat(DocsLink): handle only a package * fix(updating-to-v14): fix unknown component
This commit is contained in:
@@ -19,7 +19,7 @@ interface DocsLinkOptions {
|
|||||||
*
|
*
|
||||||
* @example `'Client'`
|
* @example `'Client'`
|
||||||
*/
|
*/
|
||||||
parent: string;
|
parent?: string;
|
||||||
/**
|
/**
|
||||||
* Whether to reference a static property.
|
* Whether to reference a static property.
|
||||||
*
|
*
|
||||||
@@ -40,7 +40,7 @@ interface DocsLinkOptions {
|
|||||||
* @example `'class'`
|
* @example `'class'`
|
||||||
* @example `'Function'`
|
* @example `'Function'`
|
||||||
*/
|
*/
|
||||||
type: string;
|
type?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DocsLink({
|
export function DocsLink({
|
||||||
@@ -51,23 +51,28 @@ export function DocsLink({
|
|||||||
brackets,
|
brackets,
|
||||||
static: staticReference,
|
static: staticReference,
|
||||||
}: DocsLinkOptions) {
|
}: DocsLinkOptions) {
|
||||||
const bracketText = brackets || type.toUpperCase() === 'FUNCTION' ? '()' : '';
|
// In the case of no type and no parent, this will default to the entry point of the respective documentation.
|
||||||
const trimmedSymbol = symbol;
|
let url = docs === PACKAGES[0] ? `${BASE_URL_LEGACY}/${VERSION}/general/welcome` : `${BASE_URL}/${docs}/stable`;
|
||||||
let url;
|
let text = `${docs === PACKAGES[0] ? '' : '@discordjs/'}${docs}`;
|
||||||
let text;
|
|
||||||
|
|
||||||
if (docs === PACKAGES[0]) {
|
// If there is a type and parent, we need to do some parsing.
|
||||||
url = `${BASE_URL_LEGACY}/${VERSION}/${type}/${parent}`;
|
if (type && parent) {
|
||||||
if (trimmedSymbol) url += `?scrollTo=${trimmedSymbol}`;
|
const bracketText = brackets || type?.toUpperCase() === 'FUNCTION' ? '()' : '';
|
||||||
|
|
||||||
text = `${parent}${trimmedSymbol ? (trimmedSymbol.startsWith('s-') ? '.' : '#') : ''}${
|
// Legacy discord.js documentation parsing.
|
||||||
// eslint-disable-next-line prefer-named-capture-group
|
if (docs === PACKAGES[0]) {
|
||||||
trimmedSymbol ? `${trimmedSymbol.replace(/(e|s)-/, '')}` : ''
|
url = `${BASE_URL_LEGACY}/${VERSION}/${type}/${parent}`;
|
||||||
}${bracketText}`;
|
if (symbol) url += `?scrollTo=${symbol}`;
|
||||||
} else {
|
|
||||||
url = `${BASE_URL}/${docs}/stable/${parent}:${type}`;
|
text = `${parent}${symbol ? (symbol.startsWith('s-') ? '.' : '#') : ''}${
|
||||||
if (trimmedSymbol) url += `#${trimmedSymbol}`;
|
// eslint-disable-next-line prefer-named-capture-group
|
||||||
text = `${parent}${trimmedSymbol ? `${staticReference ? '.' : '#'}${trimmedSymbol}` : ''}${bracketText}`;
|
symbol ? `${symbol.replace(/(e|s)-/, '')}` : ''
|
||||||
|
}${bracketText}`;
|
||||||
|
} else {
|
||||||
|
url += `/${parent}:${type}`;
|
||||||
|
if (symbol) url += `#${symbol}`;
|
||||||
|
text = `${parent}${symbol ? `${staticReference ? '.' : '#'}${symbol}` : ''}${bracketText}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ The base interaction class is now <DocsLink type="class" parent="BaseInteraction
|
|||||||
|
|
||||||
### MessageManager
|
### MessageManager
|
||||||
|
|
||||||
The second parameter of <DocsLink type="class" parent="MessageManager" symbol="fetch" brackets /> has been removed. The <DocsLink type="class" parent="BaseFetchOptions" /> the second parameter once was is now merged into the first parameter.
|
The second parameter of <DocsLink type="class" parent="MessageManager" symbol="fetch" brackets /> has been removed. The <DocsLink type="typedef" parent="BaseFetchOptions" /> the second parameter once was is now merged into the first parameter.
|
||||||
|
|
||||||
<CH.Code>
|
<CH.Code>
|
||||||
|
|
||||||
@@ -807,7 +807,7 @@ Added the _`threadName`_ property in <DocsLink type="typedef" parent="WebhookMes
|
|||||||
|
|
||||||
### WebSocketManager
|
### WebSocketManager
|
||||||
|
|
||||||
discord.js uses <PackageLink name="ws" /> internally.
|
discord.js uses <DocsLink package="ws" /> internally.
|
||||||
|
|
||||||
[^1]: https://github.com/discordjs/discord.js/pull/7188
|
[^1]: https://github.com/discordjs/discord.js/pull/7188
|
||||||
[^2]: https://github.com/discordjs/discord.js/pull/6492
|
[^2]: https://github.com/discordjs/discord.js/pull/6492
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ export const PACKAGES = [
|
|||||||
/**
|
/**
|
||||||
* The stable version of discord.js.
|
* The stable version of discord.js.
|
||||||
*/
|
*/
|
||||||
export const VERSION = '14.10.0' as const;
|
export const VERSION = '14.10.2' as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user