Skip to content

Commit

Permalink
fix: fixed react/astro/guide/discord.js build, updated dependencies, …
Browse files Browse the repository at this point in the history
…fix crawlvatar (#8861)
  • Loading branch information
favna committed Nov 25, 2022
1 parent 256677b commit d0c8256
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 883 deletions.
30 changes: 16 additions & 14 deletions apps/guide/astro.config.ts
Expand Up @@ -43,6 +43,8 @@ const createSROnlyLabel = (text: string) => {
return node;
};

const rootDir = new URL('../../', import.meta.url);

export default defineConfig({
integrations: [
react(),
Expand All @@ -54,7 +56,7 @@ export default defineConfig({
throttle: 3,
}),
Unocss({
configFile: fileURLToPath(new URL('../../unocss.config.ts', import.meta.url)),
configFile: fileURLToPath(new URL('unocss.config.ts', rootDir)),
}),
critters(),
compress(),
Expand Down Expand Up @@ -95,19 +97,19 @@ export default defineConfig({
vite: {
resolve: {
alias: {
'ariakit/button': fileURLToPath(new URL('node_modules/ariakit/esm/button/index.js', import.meta.url)),
'ariakit/disclosure': fileURLToPath(new URL('node_modules/ariakit/esm/disclosure/index.js', import.meta.url)),
'ariakit/separator': fileURLToPath(new URL('node_modules/ariakit/esm/separator/index.js', import.meta.url)),
'ariakit-utils/dom': fileURLToPath(new URL('node_modules/ariakit-utils/esm/dom.js', import.meta.url)),
'ariakit-utils/events': fileURLToPath(new URL('node_modules/ariakit-utils/esm/events.js', import.meta.url)),
'ariakit-utils/focus': fileURLToPath(new URL('node_modules/ariakit-utils/esm/focus.js', import.meta.url)),
'ariakit-utils/hooks': fileURLToPath(new URL('node_modules/ariakit-utils/esm/hooks.js', import.meta.url)),
'ariakit-utils/misc': fileURLToPath(new URL('node_modules/ariakit-utils/esm/misc.js', import.meta.url)),
'ariakit-utils/platform': fileURLToPath(new URL('node_modules/ariakit-utils/esm/platform.js', import.meta.url)),
'ariakit-utils/system': fileURLToPath(new URL('node_modules/ariakit-utils/esm/system.js', import.meta.url)),
'react-icons/fi': fileURLToPath(new URL('node_modules/react-icons/fi/index.esm.js', import.meta.url)),
'react-icons/vsc': fileURLToPath(new URL('node_modules/react-icons/vsc/index.esm.js', import.meta.url)),
'react-use': fileURLToPath(new URL('node_modules/react-use/esm/index.js', import.meta.url)),
'ariakit/button': fileURLToPath(new URL('node_modules/ariakit/esm/button/index.js', rootDir)),
'ariakit/disclosure': fileURLToPath(new URL('node_modules/ariakit/esm/disclosure/index.js', rootDir)),
'ariakit/separator': fileURLToPath(new URL('node_modules/ariakit/esm/separator/index.js', rootDir)),
'ariakit-utils/dom': fileURLToPath(new URL('node_modules/ariakit-utils/esm/dom.js', rootDir)),
'ariakit-utils/events': fileURLToPath(new URL('node_modules/ariakit-utils/esm/events.js', rootDir)),
'ariakit-utils/focus': fileURLToPath(new URL('node_modules/ariakit-utils/esm/focus.js', rootDir)),
'ariakit-utils/hooks': fileURLToPath(new URL('node_modules/ariakit-utils/esm/hooks.js', rootDir)),
'ariakit-utils/misc': fileURLToPath(new URL('node_modules/ariakit-utils/esm/misc.js', rootDir)),
'ariakit-utils/platform': fileURLToPath(new URL('node_modules/ariakit-utils/esm/platform.js', rootDir)),
'ariakit-utils/system': fileURLToPath(new URL('node_modules/ariakit-utils/esm/system.js', rootDir)),
'react-icons/fi': fileURLToPath(new URL('node_modules/react-icons/fi/index.esm.js', rootDir)),
'react-icons/vsc': fileURLToPath(new URL('node_modules/react-icons/vsc/index.esm.js', rootDir)),
'react-use': fileURLToPath(new URL('node_modules/react-use/esm/index.js', rootDir)),
},
},
},
Expand Down
16 changes: 8 additions & 8 deletions apps/guide/package.json
Expand Up @@ -35,16 +35,16 @@
"homepage": "https://discord.js.org",
"dependencies": {
"@astrojs/image": "^0.11.6",
"@astrojs/mdx": "^0.11.6",
"@astrojs/mdx": "^0.12.0",
"@astrojs/react": "^1.2.2",
"@code-hike/mdx": "^0.7.4",
"@discordjs/ui": "workspace:^",
"ariakit": "^2.0.0-next.41",
"cmdk": "^0.1.20",
"meilisearch": "^0.29.1",
"react": "^17.0.2",
"react": "^18.2.0",
"react-custom-scrollbars-2": "^4.5.0",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"react-icons": "^4.6.0",
"react-use": "^17.4.0",
"sharp": "^0.31.2",
Expand All @@ -55,16 +55,16 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "16.18.3",
"@types/react": "^17.0.52",
"@types/react-dom": "^17.0.18",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"@types/react-syntax-highlighter": "^15.5.5",
"@unocss/cli": "^0.46.5",
"@unocss/reset": "^0.46.5",
"@vitejs/plugin-react": "^2.2.0",
"@vitest/coverage-c8": "^0.25.3",
"astro": "^1.6.10",
"astro-compress": "^1.1.9",
"astro-critters": "^1.1.9",
"astro": "^1.6.11",
"astro-compress": "^1.1.10",
"astro-critters": "^1.1.10",
"cross-env": "^7.0.3",
"eslint": "^8.28.0",
"eslint-config-neon": "^0.1.40",
Expand Down
18 changes: 12 additions & 6 deletions apps/guide/src/pages/creating-your-bot/creating-commands.mdx
Expand Up @@ -19,13 +19,15 @@ import { ResultingCode } from '../../components/ResultingCode.jsx';
<DiscordMessage
interaction={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
command: 'ping',
}}
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
Expand Down Expand Up @@ -154,13 +156,15 @@ client.on('interactionCreate', async (interaction) => {
<DiscordMessage
interaction={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
command: 'server',
}}
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
Expand Down Expand Up @@ -202,13 +206,15 @@ client.on('interactionCreate', async (interaction) => {
<DiscordMessage
interaction={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
command: 'user',
}}
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
Expand Down
27 changes: 18 additions & 9 deletions apps/guide/src/pages/test.mdx
Expand Up @@ -9,13 +9,15 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
<DiscordMessage
reply={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
content: 'Test',
}}
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
Expand All @@ -24,7 +26,8 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
</DiscordMessage>
<DiscordMessage
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
Expand All @@ -39,13 +42,15 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
<DiscordMessage
reply={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
content: 'Test',
}}
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
Expand All @@ -58,29 +63,33 @@ import { DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs
<DiscordMessage
reply={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
content: 'Test',
}}
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
time: 'Today at 21:00',
}}
>
<>
<DiscordMessageEmbed
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
}}
/>
<DiscordMessageEmbed title={{ title: 'Title' }} />
<DiscordMessageEmbed footer={{ content: 'Footer' }} />
<DiscordMessageEmbed
author={{
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
}}
title={{ title: 'Title' }}
Expand Down
3 changes: 2 additions & 1 deletion apps/guide/src/pages/whats-new.mdx
Expand Up @@ -13,7 +13,8 @@ import { DiscordMessages, DiscordMessage } from '@discordjs/ui';
<DiscordMessage
interaction={{
author: {
avatar: 'https://cdn.discordapp.com/avatars/81440962496172032/81c0df2befe565b05018da6b026babb0.webp?size=160',
avatar:
'https://cdn.discordapp.com/guilds/222078108977594368/users/81440962496172032/avatars/c059c5d04d717ea05790f7a6447e4843.webp?size=160',
username: 'Crawl',
},
command: 'upgrade',
Expand Down
2 changes: 1 addition & 1 deletion apps/website/package.json
Expand Up @@ -61,7 +61,7 @@
"react-syntax-highlighter": "^15.5.0",
"react-use": "^17.4.0",
"rehype-ignore": "^1.0.3",
"rehype-pretty-code": "^0.5.0",
"rehype-pretty-code": "^0.5.1",
"rehype-raw": "^6.1.1",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/discord.js/typings/index.d.ts
@@ -1,3 +1,6 @@
// DOM types required for undici
/// <reference lib="dom" />

import {
ActionRowBuilder as BuilderActionRow,
MessageActionRowComponentBuilder,
Expand Down

2 comments on commit d0c8256

@vercel
Copy link

@vercel vercel bot commented on d0c8256 Nov 25, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on d0c8256 Nov 25, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.