From 506f7fcd3b022822d6abcf32423298e446856402 Mon Sep 17 00:00:00 2001
From: Jiralite <33201955+Jiralite@users.noreply.github.com>
Date: Fri, 5 May 2023 08:37:47 +0100
Subject: [PATCH 1/2] 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
---
apps/guide/src/components/DocsLink.tsx | 39 +++++++++++--------
.../05-additional-info/03-updating-to-v14.mdx | 4 +-
apps/guide/src/util/constants.ts | 2 +-
3 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/apps/guide/src/components/DocsLink.tsx b/apps/guide/src/components/DocsLink.tsx
index 274db38e9891..57ce04fa21c1 100644
--- a/apps/guide/src/components/DocsLink.tsx
+++ b/apps/guide/src/components/DocsLink.tsx
@@ -19,7 +19,7 @@ interface DocsLinkOptions {
*
* @example `'Client'`
*/
- parent: string;
+ parent?: string;
/**
* Whether to reference a static property.
*
@@ -40,7 +40,7 @@ interface DocsLinkOptions {
* @example `'class'`
* @example `'Function'`
*/
- type: string;
+ type?: string;
}
export function DocsLink({
@@ -51,23 +51,28 @@ export function DocsLink({
brackets,
static: staticReference,
}: DocsLinkOptions) {
- const bracketText = brackets || type.toUpperCase() === 'FUNCTION' ? '()' : '';
- const trimmedSymbol = symbol;
- let url;
- let text;
+ // In the case of no type and no parent, this will default to the entry point of the respective documentation.
+ let url = docs === PACKAGES[0] ? `${BASE_URL_LEGACY}/${VERSION}/general/welcome` : `${BASE_URL}/${docs}/stable`;
+ let text = `${docs === PACKAGES[0] ? '' : '@discordjs/'}${docs}`;
- if (docs === PACKAGES[0]) {
- url = `${BASE_URL_LEGACY}/${VERSION}/${type}/${parent}`;
- if (trimmedSymbol) url += `?scrollTo=${trimmedSymbol}`;
+ // If there is a type and parent, we need to do some parsing.
+ if (type && parent) {
+ const bracketText = brackets || type?.toUpperCase() === 'FUNCTION' ? '()' : '';
- text = `${parent}${trimmedSymbol ? (trimmedSymbol.startsWith('s-') ? '.' : '#') : ''}${
- // eslint-disable-next-line prefer-named-capture-group
- trimmedSymbol ? `${trimmedSymbol.replace(/(e|s)-/, '')}` : ''
- }${bracketText}`;
- } else {
- url = `${BASE_URL}/${docs}/stable/${parent}:${type}`;
- if (trimmedSymbol) url += `#${trimmedSymbol}`;
- text = `${parent}${trimmedSymbol ? `${staticReference ? '.' : '#'}${trimmedSymbol}` : ''}${bracketText}`;
+ // Legacy discord.js documentation parsing.
+ if (docs === PACKAGES[0]) {
+ url = `${BASE_URL_LEGACY}/${VERSION}/${type}/${parent}`;
+ if (symbol) url += `?scrollTo=${symbol}`;
+
+ text = `${parent}${symbol ? (symbol.startsWith('s-') ? '.' : '#') : ''}${
+ // eslint-disable-next-line prefer-named-capture-group
+ symbol ? `${symbol.replace(/(e|s)-/, '')}` : ''
+ }${bracketText}`;
+ } else {
+ url += `/${parent}:${type}`;
+ if (symbol) url += `#${symbol}`;
+ text = `${parent}${symbol ? `${staticReference ? '.' : '#'}${symbol}` : ''}${bracketText}`;
+ }
}
return (
diff --git a/apps/guide/src/content/05-additional-info/03-updating-to-v14.mdx b/apps/guide/src/content/05-additional-info/03-updating-to-v14.mdx
index c6a4907363f7..6c6d01172d5f 100644
--- a/apps/guide/src/content/05-additional-info/03-updating-to-v14.mdx
+++ b/apps/guide/src/content/05-additional-info/03-updating-to-v14.mdx
@@ -419,7 +419,7 @@ The base interaction class is now has been removed. The the second parameter once was is now merged into the first parameter.
+The second parameter of has been removed. The the second parameter once was is now merged into the first parameter.
@@ -807,7 +807,7 @@ Added the _`threadName`_ property in internally.
+discord.js uses internally.
[^1]: https://github.com/discordjs/discord.js/pull/7188
[^2]: https://github.com/discordjs/discord.js/pull/6492
diff --git a/apps/guide/src/util/constants.ts b/apps/guide/src/util/constants.ts
index 1ab7ae32411c..72155dee3eb0 100644
--- a/apps/guide/src/util/constants.ts
+++ b/apps/guide/src/util/constants.ts
@@ -24,4 +24,4 @@ export const PACKAGES = [
/**
* The stable version of discord.js.
*/
-export const VERSION = '14.10.0' as const;
+export const VERSION = '14.10.2' as const;
From 166c9612611b8665a62d8a5f657f64b5a266d0f4 Mon Sep 17 00:00:00 2001
From: Jiralite <33201955+Jiralite@users.noreply.github.com>
Date: Fri, 5 May 2023 08:42:12 +0100
Subject: [PATCH 2/2] fix(roleConnections): Fix `body` type for
`updateMetadataRecords()` (#9516)
---
packages/core/src/api/roleConnections.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/core/src/api/roleConnections.ts b/packages/core/src/api/roleConnections.ts
index 2dca47c6f4a4..065444aa6993 100644
--- a/packages/core/src/api/roleConnections.ts
+++ b/packages/core/src/api/roleConnections.ts
@@ -5,7 +5,7 @@ import {
Routes,
type RESTGetAPIApplicationRoleConnectionMetadataResult,
type RESTPutAPIApplicationRoleConnectionMetadataResult,
- type RESTPutAPIApplicationCommandPermissionsJSONBody,
+ type RESTPutAPIApplicationRoleConnectionMetadataJSONBody,
type Snowflake,
} from 'discord-api-types/v10';
@@ -35,7 +35,7 @@ export class RoleConnectionsAPI {
*/
public async updateMetadataRecords(
applicationId: Snowflake,
- body: RESTPutAPIApplicationCommandPermissionsJSONBody,
+ body: RESTPutAPIApplicationRoleConnectionMetadataJSONBody,
{ signal }: Pick = {},
) {
return this.rest.put(Routes.applicationRoleConnectionMetadata(applicationId), {