Skip to content

Commit d0c8256

Browse files
authored
fix: fixed react/astro/guide/discord.js build, updated dependencies, fix crawlvatar (#8861)
1 parent 256677b commit d0c8256

File tree

8 files changed

+144
-883
lines changed

8 files changed

+144
-883
lines changed

apps/guide/astro.config.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const createSROnlyLabel = (text: string) => {
4343
return node;
4444
};
4545

46+
const rootDir = new URL('../../', import.meta.url);
47+
4648
export default defineConfig({
4749
integrations: [
4850
react(),
@@ -54,7 +56,7 @@ export default defineConfig({
5456
throttle: 3,
5557
}),
5658
Unocss({
57-
configFile: fileURLToPath(new URL('../../unocss.config.ts', import.meta.url)),
59+
configFile: fileURLToPath(new URL('unocss.config.ts', rootDir)),
5860
}),
5961
critters(),
6062
compress(),
@@ -95,19 +97,19 @@ export default defineConfig({
9597
vite: {
9698
resolve: {
9799
alias: {
98-
'ariakit/button': fileURLToPath(new URL('node_modules/ariakit/esm/button/index.js', import.meta.url)),
99-
'ariakit/disclosure': fileURLToPath(new URL('node_modules/ariakit/esm/disclosure/index.js', import.meta.url)),
100-
'ariakit/separator': fileURLToPath(new URL('node_modules/ariakit/esm/separator/index.js', import.meta.url)),
101-
'ariakit-utils/dom': fileURLToPath(new URL('node_modules/ariakit-utils/esm/dom.js', import.meta.url)),
102-
'ariakit-utils/events': fileURLToPath(new URL('node_modules/ariakit-utils/esm/events.js', import.meta.url)),
103-
'ariakit-utils/focus': fileURLToPath(new URL('node_modules/ariakit-utils/esm/focus.js', import.meta.url)),
104-
'ariakit-utils/hooks': fileURLToPath(new URL('node_modules/ariakit-utils/esm/hooks.js', import.meta.url)),
105-
'ariakit-utils/misc': fileURLToPath(new URL('node_modules/ariakit-utils/esm/misc.js', import.meta.url)),
106-
'ariakit-utils/platform': fileURLToPath(new URL('node_modules/ariakit-utils/esm/platform.js', import.meta.url)),
107-
'ariakit-utils/system': fileURLToPath(new URL('node_modules/ariakit-utils/esm/system.js', import.meta.url)),
108-
'react-icons/fi': fileURLToPath(new URL('node_modules/react-icons/fi/index.esm.js', import.meta.url)),
109-
'react-icons/vsc': fileURLToPath(new URL('node_modules/react-icons/vsc/index.esm.js', import.meta.url)),
110-
'react-use': fileURLToPath(new URL('node_modules/react-use/esm/index.js', import.meta.url)),
100+
'ariakit/button': fileURLToPath(new URL('node_modules/ariakit/esm/button/index.js', rootDir)),
101+
'ariakit/disclosure': fileURLToPath(new URL('node_modules/ariakit/esm/disclosure/index.js', rootDir)),
102+
'ariakit/separator': fileURLToPath(new URL('node_modules/ariakit/esm/separator/index.js', rootDir)),
103+
'ariakit-utils/dom': fileURLToPath(new URL('node_modules/ariakit-utils/esm/dom.js', rootDir)),
104+
'ariakit-utils/events': fileURLToPath(new URL('node_modules/ariakit-utils/esm/events.js', rootDir)),
105+
'ariakit-utils/focus': fileURLToPath(new URL('node_modules/ariakit-utils/esm/focus.js', rootDir)),
106+
'ariakit-utils/hooks': fileURLToPath(new URL('node_modules/ariakit-utils/esm/hooks.js', rootDir)),
107+
'ariakit-utils/misc': fileURLToPath(new URL('node_modules/ariakit-utils/esm/misc.js', rootDir)),
108+
'ariakit-utils/platform': fileURLToPath(new URL('node_modules/ariakit-utils/esm/platform.js', rootDir)),
109+
'ariakit-utils/system': fileURLToPath(new URL('node_modules/ariakit-utils/esm/system.js', rootDir)),
110+
'react-icons/fi': fileURLToPath(new URL('node_modules/react-icons/fi/index.esm.js', rootDir)),
111+
'react-icons/vsc': fileURLToPath(new URL('node_modules/react-icons/vsc/index.esm.js', rootDir)),
112+
'react-use': fileURLToPath(new URL('node_modules/react-use/esm/index.js', rootDir)),
111113
},
112114
},
113115
},

apps/guide/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
"homepage": "https://discord.js.org",
3636
"dependencies": {
3737
"@astrojs/image": "^0.11.6",
38-
"@astrojs/mdx": "^0.11.6",
38+
"@astrojs/mdx": "^0.12.0",
3939
"@astrojs/react": "^1.2.2",
4040
"@code-hike/mdx": "^0.7.4",
4141
"@discordjs/ui": "workspace:^",
4242
"ariakit": "^2.0.0-next.41",
4343
"cmdk": "^0.1.20",
4444
"meilisearch": "^0.29.1",
45-
"react": "^17.0.2",
45+
"react": "^18.2.0",
4646
"react-custom-scrollbars-2": "^4.5.0",
47-
"react-dom": "^17.0.2",
47+
"react-dom": "^18.2.0",
4848
"react-icons": "^4.6.0",
4949
"react-use": "^17.4.0",
5050
"sharp": "^0.31.2",
@@ -55,16 +55,16 @@
5555
"@testing-library/react": "^13.4.0",
5656
"@testing-library/user-event": "^14.4.3",
5757
"@types/node": "16.18.3",
58-
"@types/react": "^17.0.52",
59-
"@types/react-dom": "^17.0.18",
58+
"@types/react": "^18.0.25",
59+
"@types/react-dom": "^18.0.9",
6060
"@types/react-syntax-highlighter": "^15.5.5",
6161
"@unocss/cli": "^0.46.5",
6262
"@unocss/reset": "^0.46.5",
6363
"@vitejs/plugin-react": "^2.2.0",
6464
"@vitest/coverage-c8": "^0.25.3",
65-
"astro": "^1.6.10",
66-
"astro-compress": "^1.1.9",
67-
"astro-critters": "^1.1.9",
65+
"astro": "^1.6.11",
66+
"astro-compress": "^1.1.10",
67+
"astro-critters": "^1.1.10",
6868
"cross-env": "^7.0.3",
6969
"eslint": "^8.28.0",
7070
"eslint-config-neon": "^0.1.40",

apps/guide/src/pages/creating-your-bot/creating-commands.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ import { ResultingCode } from '../../components/ResultingCode.jsx';
1919
<DiscordMessage
2020
interaction={{
2121
author: {
22-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
22+
avatar:
23+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
2324
username: 'Crawl',
2425
},
2526
command: 'ping',
2627
}}
2728
author={{
28-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
29+
avatar:
30+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
2931
username: 'Crawl',
3032
time: 'Today at 21:00',
3133
}}
@@ -154,13 +156,15 @@ client.on('interactionCreate', async (interaction) => {
154156
<DiscordMessage
155157
interaction={{
156158
author: {
157-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
159+
avatar:
160+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
158161
username: 'Crawl',
159162
},
160163
command: 'server',
161164
}}
162165
author={{
163-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
166+
avatar:
167+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
164168
username: 'Crawl',
165169
time: 'Today at 21:00',
166170
}}
@@ -202,13 +206,15 @@ client.on('interactionCreate', async (interaction) => {
202206
<DiscordMessage
203207
interaction={{
204208
author: {
205-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
209+
avatar:
210+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
206211
username: 'Crawl',
207212
},
208213
command: 'user',
209214
}}
210215
author={{
211-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
216+
avatar:
217+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
212218
username: 'Crawl',
213219
time: 'Today at 21:00',
214220
}}

apps/guide/src/pages/test.mdx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
99
<DiscordMessage
1010
reply={{
1111
author: {
12-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
12+
avatar:
13+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
1314
username: 'Crawl',
1415
},
1516
content: 'Test',
1617
}}
1718
author={{
18-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
19+
avatar:
20+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
1921
username: 'Crawl',
2022
time: 'Today at 21:00',
2123
}}
@@ -24,7 +26,8 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
2426
</DiscordMessage>
2527
<DiscordMessage
2628
author={{
27-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
29+
avatar:
30+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
2831
username: 'Crawl',
2932
time: 'Today at 21:00',
3033
}}
@@ -39,13 +42,15 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
3942
<DiscordMessage
4043
reply={{
4144
author: {
42-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
45+
avatar:
46+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
4347
username: 'Crawl',
4448
},
4549
content: 'Test',
4650
}}
4751
author={{
48-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
52+
avatar:
53+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
4954
username: 'Crawl',
5055
time: 'Today at 21:00',
5156
}}
@@ -58,29 +63,33 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
5863
<DiscordMessage
5964
reply={{
6065
author: {
61-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
66+
avatar:
67+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
6268
username: 'Crawl',
6369
},
6470
content: 'Test',
6571
}}
6672
author={{
67-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
73+
avatar:
74+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
6875
username: 'Crawl',
6976
time: 'Today at 21:00',
7077
}}
7178
>
7279
<>
7380
<DiscordMessageEmbed
7481
author={{
75-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
82+
avatar:
83+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
7684
username: 'Crawl',
7785
}}
7886
/>
7987
<DiscordMessageEmbed title={{ title: 'Title' }} />
8088
<DiscordMessageEmbed footer={{ content: 'Footer' }} />
8189
<DiscordMessageEmbed
8290
author={{
83-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
91+
avatar:
92+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
8493
username: 'Crawl',
8594
}}
8695
title={{ title: 'Title' }}

apps/guide/src/pages/whats-new.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import { DiscordMessages, DiscordMessage } from '@discordjs/ui';
1313
<DiscordMessage
1414
interaction={{
1515
author: {
16-
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
16+
avatar:
17+
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
1718
username: 'Crawl',
1819
},
1920
command: 'upgrade',

apps/website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"react-syntax-highlighter": "^15.5.0",
6262
"react-use": "^17.4.0",
6363
"rehype-ignore": "^1.0.3",
64-
"rehype-pretty-code": "^0.5.0",
64+
"rehype-pretty-code": "^0.5.1",
6565
"rehype-raw": "^6.1.1",
6666
"rehype-slug": "^5.1.0",
6767
"remark-gfm": "^3.0.1",

packages/discord.js/typings/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// DOM types required for undici
2+
/// <reference lib="dom" />
3+
14
import {
25
ActionRowBuilder as BuilderActionRow,
36
MessageActionRowComponentBuilder,

0 commit comments

Comments
 (0)