diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5e3088e0c..b1c467403 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -9,6 +9,7 @@ "christian-kohler.npm-intellisense", "christian-kohler.path-intellisense", "antfu.unocss", - "astro-build.astro-vscode" + "astro-build.astro-vscode", + "unifiedjs.vscode-mdx" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 14454b301..90194ce05 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,9 +8,12 @@ "source.fixAll": true, "source.organizeImports": false }, + "editor.trimAutoWhitespace": false, "files.associations": { "*.mdx": "markdown" }, - "unocss.root": "./packages/ui", + "files.insertFinalNewline": true, + "files.eol": "\n", + "npm.packageManager": "yarn", "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/apps/guide/astro.config.ts b/apps/guide/astro.config.ts index 14084be80..81533812c 100644 --- a/apps/guide/astro.config.ts +++ b/apps/guide/astro.config.ts @@ -54,7 +54,7 @@ export default defineConfig({ throttle: 3, }), Unocss({ - configFile: fileURLToPath(new URL('../../packages/ui/unocss.config.ts', import.meta.url)), + configFile: fileURLToPath(new URL('../../unocss.config.ts', import.meta.url)), }), critters(), compress(), diff --git a/apps/website/.gitignore b/apps/website/.gitignore index 7a01b5c3b..9c93f933b 100644 --- a/apps/website/.gitignore +++ b/apps/website/.gitignore @@ -19,7 +19,6 @@ dist/ typings/ .cache/ build/ -api/ src/styles/unocss.css .next/ diff --git a/apps/website/package.json b/apps/website/package.json index 8e4d7bcdd..eb6c7503f 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -6,14 +6,14 @@ "scripts": { "test": "vitest run", "build:local": "yarn run --top-level docs --force && cross-env NEXT_PUBLIC_LOCAL_DEV=true yarn build:prod", - "build:prod": "yarn workspace @discordjs/api-extractor-utils run build && yarn workspace @discordjs/scripts run build && yarn workspace @discordjs/ui run build && yarn build:css && yarn build:next", + "build:prod": "yarn workspaces foreach -ptR run build && yarn build:css && yarn build:next", "build:next": "next build", "build:css": "yarn generate:css", "build:search_indicies": "yarn node scripts/generateAllIndicies.js", "dev": "yarn run --top-level docs && concurrently 'yarn dev:css' 'yarn dev:next'", "dev:next": "next dev", "dev:css": "yarn generate:css --watch", - "generate:css": "unocss 'src/**/*.tsx' '../../packages/ui/src/lib/components/**/*.tsx' --out-file ./src/styles/unocss.css --config ../../packages/ui/unocss.config.ts", + "generate:css": "unocss 'src/**/*.tsx' '../../packages/ui/src/lib/components/**/*.tsx' --out-file ./src/styles/unocss.css --config ../../unocss.config.ts", "lint": "prettier --check . && cross-env TIMING=1 eslint src --ext .mjs,.js,.cjs,.ts,.tsx", "format": "prettier --write . && cross-env TIMING=1 eslint src --ext .mjs,.js,.cjs,.ts,.tsx --fix" }, @@ -45,6 +45,7 @@ "@discordjs/ui": "workspace:^", "@microsoft/api-extractor-model": "7.24.0", "@microsoft/tsdoc": "0.14.1", + "@vercel/og": "^0.0.15", "@vscode/codicons": "^0.0.32", "ariakit": "^2.0.0-next.41", "cmdk": "^0.1.20", diff --git a/apps/website/public/fonts/Inter-Black.woff2 b/apps/website/public/fonts/Inter-Black.woff2 new file mode 100644 index 000000000..68f64c9ed Binary files /dev/null and b/apps/website/public/fonts/Inter-Black.woff2 differ diff --git a/apps/website/public/fonts/Inter-BlackItalic.woff2 b/apps/website/public/fonts/Inter-BlackItalic.woff2 new file mode 100644 index 000000000..1c9c7ca8b Binary files /dev/null and b/apps/website/public/fonts/Inter-BlackItalic.woff2 differ diff --git a/apps/website/public/fonts/Inter-Bold.woff2 b/apps/website/public/fonts/Inter-Bold.woff2 new file mode 100644 index 000000000..2846f29cc Binary files /dev/null and b/apps/website/public/fonts/Inter-Bold.woff2 differ diff --git a/apps/website/public/fonts/Inter-BoldItalic.woff2 b/apps/website/public/fonts/Inter-BoldItalic.woff2 new file mode 100644 index 000000000..0b1fe8e12 Binary files /dev/null and b/apps/website/public/fonts/Inter-BoldItalic.woff2 differ diff --git a/apps/website/public/fonts/Inter-Italic.woff2 b/apps/website/public/fonts/Inter-Italic.woff2 new file mode 100644 index 000000000..a619fc548 Binary files /dev/null and b/apps/website/public/fonts/Inter-Italic.woff2 differ diff --git a/apps/website/public/fonts/Inter-Light.woff2 b/apps/website/public/fonts/Inter-Light.woff2 new file mode 100644 index 000000000..bc4be6658 Binary files /dev/null and b/apps/website/public/fonts/Inter-Light.woff2 differ diff --git a/apps/website/public/fonts/Inter-LightItalic.woff2 b/apps/website/public/fonts/Inter-LightItalic.woff2 new file mode 100644 index 000000000..842b2dfcb Binary files /dev/null and b/apps/website/public/fonts/Inter-LightItalic.woff2 differ diff --git a/apps/website/public/fonts/Inter-Medium.woff2 b/apps/website/public/fonts/Inter-Medium.woff2 new file mode 100644 index 000000000..f92498a2e Binary files /dev/null and b/apps/website/public/fonts/Inter-Medium.woff2 differ diff --git a/apps/website/public/fonts/Inter-MediumItalic.woff2 b/apps/website/public/fonts/Inter-MediumItalic.woff2 new file mode 100644 index 000000000..0e3019f4a Binary files /dev/null and b/apps/website/public/fonts/Inter-MediumItalic.woff2 differ diff --git a/apps/website/public/fonts/Inter-Regular.woff2 b/apps/website/public/fonts/Inter-Regular.woff2 new file mode 100644 index 000000000..6c2b6893d Binary files /dev/null and b/apps/website/public/fonts/Inter-Regular.woff2 differ diff --git a/apps/website/public/fonts/Inter-SemiBold.woff2 b/apps/website/public/fonts/Inter-SemiBold.woff2 new file mode 100644 index 000000000..611e90c95 Binary files /dev/null and b/apps/website/public/fonts/Inter-SemiBold.woff2 differ diff --git a/apps/website/public/fonts/Inter-SemiBoldItalic.woff2 b/apps/website/public/fonts/Inter-SemiBoldItalic.woff2 new file mode 100644 index 000000000..545685bd2 Binary files /dev/null and b/apps/website/public/fonts/Inter-SemiBoldItalic.woff2 differ diff --git a/apps/website/public/fonts/Inter-italic.var.woff2 b/apps/website/public/fonts/Inter-italic.var.woff2 new file mode 100644 index 000000000..b826d5af8 Binary files /dev/null and b/apps/website/public/fonts/Inter-italic.var.woff2 differ diff --git a/apps/website/public/fonts/Inter-roman.var.woff2 b/apps/website/public/fonts/Inter-roman.var.woff2 new file mode 100644 index 000000000..6a256a068 Binary files /dev/null and b/apps/website/public/fonts/Inter-roman.var.woff2 differ diff --git a/apps/website/src/assets/fonts/Inter-Black.ttf b/apps/website/src/assets/fonts/Inter-Black.ttf new file mode 100644 index 000000000..5aecf7dc4 Binary files /dev/null and b/apps/website/src/assets/fonts/Inter-Black.ttf differ diff --git a/apps/website/src/assets/fonts/Inter-Bold.ttf b/apps/website/src/assets/fonts/Inter-Bold.ttf new file mode 100644 index 000000000..8e82c70d1 Binary files /dev/null and b/apps/website/src/assets/fonts/Inter-Bold.ttf differ diff --git a/apps/website/src/assets/fonts/Inter-Light.ttf b/apps/website/src/assets/fonts/Inter-Light.ttf new file mode 100644 index 000000000..9e265d890 Binary files /dev/null and b/apps/website/src/assets/fonts/Inter-Light.ttf differ diff --git a/apps/website/src/assets/fonts/Inter-Medium.ttf b/apps/website/src/assets/fonts/Inter-Medium.ttf new file mode 100644 index 000000000..b53fb1c4a Binary files /dev/null and b/apps/website/src/assets/fonts/Inter-Medium.ttf differ diff --git a/apps/website/src/assets/fonts/Inter-Regular.ttf b/apps/website/src/assets/fonts/Inter-Regular.ttf new file mode 100644 index 000000000..8d4eebf20 Binary files /dev/null and b/apps/website/src/assets/fonts/Inter-Regular.ttf differ diff --git a/apps/website/src/assets/fonts/Inter-SemiBold.ttf b/apps/website/src/assets/fonts/Inter-SemiBold.ttf new file mode 100644 index 000000000..c6aeeb16a Binary files /dev/null and b/apps/website/src/assets/fonts/Inter-SemiBold.ttf differ diff --git a/apps/website/src/pages/_app.tsx b/apps/website/src/pages/_app.tsx index 84079ed88..57f555d35 100644 --- a/apps/website/src/pages/_app.tsx +++ b/apps/website/src/pages/_app.tsx @@ -3,6 +3,7 @@ import Head from 'next/head'; import NextProgress from 'next-progress'; import { ThemeProvider } from 'next-themes'; import '@unocss/reset/tailwind.css'; +import '../styles/inter.css'; import '../styles/unocss.css'; import '../styles/cmdk.css'; import '../styles/main.css'; diff --git a/apps/website/src/pages/_document.tsx b/apps/website/src/pages/_document.tsx index e5a9cc96d..9b6d87acc 100644 --- a/apps/website/src/pages/_document.tsx +++ b/apps/website/src/pages/_document.tsx @@ -19,7 +19,7 @@ export default function Document() { - + diff --git a/apps/website/src/pages/api/og.tsx b/apps/website/src/pages/api/og.tsx new file mode 100644 index 000000000..a87a55b5d --- /dev/null +++ b/apps/website/src/pages/api/og.tsx @@ -0,0 +1,56 @@ +/* eslint-disable react/no-unknown-property */ +import { ImageResponse } from '@vercel/og'; + +const fonts = Promise.all([ + fetch(new URL('../../assets/fonts/Inter-Light.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + fetch(new URL('../../assets/fonts/Inter-Regular.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + fetch(new URL('../../assets/fonts/Inter-Medium.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + fetch(new URL('../../assets/fonts/Inter-SemiBold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + fetch(new URL('../../assets/fonts/Inter-Bold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + fetch(new URL('../../assets/fonts/Inter-Black.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), +]); + +export default async function handler() { + const fontData = await fonts; + + return new ImageResponse( + ( +