From 0675c73df0680826558889aa8b84f0dfa1ec1fa8 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Sun, 4 Jan 2026 17:39:42 -0500 Subject: [PATCH] @vercel/og --- index.html | 10 ++- package.json | 1 + pnpm-lock.yaml | 220 +++++++++++++++++++++++++++++++++++++++++++++++++ src/api/og.tsx | 7 ++ vercel.json | 7 +- 5 files changed, 237 insertions(+), 8 deletions(-) create mode 100644 src/api/og.tsx diff --git a/index.html b/index.html index e0f1a42b..e9a7231f 100644 --- a/index.html +++ b/index.html @@ -6,18 +6,20 @@ + - - - - + + + + + = 10" } + "@rolldown/pluginutils@1.0.0-beta.11": resolution: { @@ -1729,6 +1739,14 @@ packages: integrity: sha512-+AkJDbu1GFMPIU8Sb7TLVXDv/Q7Mkvx+wAjEl8XiXVVq+p1FmWW6M3LYpJMmoHNckSofeMecgWg5lfMwNAAsEQ== } + "@shuding/opentype.js@1.4.0-beta.0": + resolution: + { + integrity: sha512-3NgmNyH3l/Hv6EvsWJbsvpcpUba6R8IREQ83nH83cyakCw7uM1arZKNfHwv1Wz6jgqrF/j4x5ELvR6PnK9nTcA== + } + engines: { node: ">= 8.0.0" } + hasBin: true + "@sindresorhus/merge-streams@2.3.0": resolution: { @@ -2391,6 +2409,13 @@ packages: } engines: { node: ^18.18.0 || ^20.9.0 || >=21.1.0 } + "@vercel/og@0.8.6": + resolution: + { + integrity: sha512-hBcWIOppZV14bi+eAmCZj8Elj8hVSUZJTpf1lgGBhVD85pervzQ1poM/qYfFUlPraYSZYP+ASg6To5BwYmUSGQ== + } + engines: { node: ">=16" } + "@vitejs/plugin-react-swc@3.10.2": resolution: { @@ -2664,6 +2689,13 @@ packages: integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== } + base64-js@0.0.8: + resolution: + { + integrity: sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw== + } + engines: { node: ">= 0.4" } + brace-expansion@1.1.12: resolution: { @@ -2725,6 +2757,12 @@ packages: } engines: { node: ">=10" } + camelize@1.0.1: + resolution: + { + integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ== + } + caniuse-lite@1.0.30001726: resolution: { @@ -2894,6 +2932,38 @@ packages: } engines: { node: ">= 8" } + css-background-parser@0.1.0: + resolution: + { + integrity: sha512-2EZLisiZQ+7m4wwur/qiYJRniHX4K5Tc9w93MT3AS0WS1u5kaZ4FKXlOTBhOjc+CgEgPiGY+fX1yWD8UwpEqUA== + } + + css-box-shadow@1.0.0-3: + resolution: + { + integrity: sha512-9jaqR6e7Ohds+aWwmhe6wILJ99xYQbfmK9QQB9CcMjDbTxPZjwEmUQpU91OG05Xgm8BahT5fW+svbsQGjS/zPg== + } + + css-color-keywords@1.0.0: + resolution: + { + integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg== + } + engines: { node: ">=4" } + + css-gradient-parser@0.0.16: + resolution: + { + integrity: sha512-3O5QdqgFRUbXvK1x5INf1YkBz1UKSWqrd63vWsum8MNHDBYD5urm3QtxZbKU259OrEXNM26lP/MPY3d1IGkBgA== + } + engines: { node: ">=16" } + + css-to-react-native@3.2.0: + resolution: + { + integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ== + } + css.escape@1.5.1: resolution: { @@ -3022,6 +3092,13 @@ packages: integrity: sha512-UWKi/EbBopgfFsc5k61wFpV7WrnnSlSzW/e2XcBmS6qKYTivZlLtoll5/rdqRTxGglGHkmkW0j0pFNJG10EUIQ== } + emoji-regex-xs@2.0.1: + resolution: + { + integrity: sha512-1QFuh8l7LqUcKe24LsPUNzjrzJQ7pgRwp1QMcZ5MX6mFplk2zQ08NVCM84++1cveaUUYtcCYHmeFEuNg16sU4g== + } + engines: { node: ">=10.0.0" } + emoji-regex@10.4.0: resolution: { @@ -3097,6 +3174,12 @@ packages: } engines: { node: ">=6" } + escape-html@1.0.3: + resolution: + { + integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + } + escape-string-regexp@4.0.0: resolution: { @@ -3263,6 +3346,12 @@ packages: picomatch: optional: true + fflate@0.7.4: + resolution: + { + integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw== + } + file-entry-cache@8.0.0: resolution: { @@ -3426,6 +3515,13 @@ packages: } hasBin: true + hex-rgb@4.3.0: + resolution: + { + integrity: sha512-Ox1pJVrDCyGHMG9CFg1tmrRUMRPRsAWYc/PinY0XzJU4K7y7vjNoLKIQ7BR5UJMCxNN8EM1MNDmHWA/B3aZUuw== + } + engines: { node: ">=6" } + html-encoding-sniffer@4.0.0: resolution: { @@ -3825,6 +3921,12 @@ packages: } engines: { node: ">=14" } + linebreak@1.1.0: + resolution: + { + integrity: sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ== + } + lines-and-columns@1.2.4: resolution: { @@ -4130,6 +4232,12 @@ packages: } engines: { node: ">=10" } + pako@0.2.9: + resolution: + { + integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA== + } + parent-module@1.0.1: resolution: { @@ -4137,6 +4245,12 @@ packages: } engines: { node: ">=6" } + parse-css-color@0.2.1: + resolution: + { + integrity: sha512-bwS/GGIFV3b6KS4uwpzCFj4w297Yl3uqnSgIPsoQkx7GMLROXfMnWvxfNkL0oh8HVhZA4hvJoEoEIqonfJ3BWg== + } + parse-json@5.2.0: resolution: { @@ -4576,6 +4690,13 @@ packages: integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== } + satori@0.16.0: + resolution: + { + integrity: sha512-ZvHN3ygzZ8FuxjSNB+mKBiF/NIoqHzlBGbD0MJiT+MvSsFOvotnWOhdTjxKzhHRT2wPC1QbhLzx2q/Y83VhfYQ== + } + engines: { node: ">=16" } + saxes@6.0.0: resolution: { @@ -4759,6 +4880,12 @@ packages: } engines: { node: ">=18" } + string.prototype.codepointat@0.2.1: + resolution: + { + integrity: sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg== + } + strip-ansi@6.0.1: resolution: { @@ -4872,6 +4999,12 @@ packages: engines: { node: ">=10" } hasBin: true + tiny-inflate@1.0.3: + resolution: + { + integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw== + } + tinybench@2.9.0: resolution: { @@ -5065,6 +5198,12 @@ packages: integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== } + unicode-trie@2.0.0: + resolution: + { + integrity: sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ== + } + unicorn-magic@0.3.0: resolution: { @@ -5390,6 +5529,12 @@ packages: } engines: { node: ">=10" } + yoga-layout@3.2.1: + resolution: + { + integrity: sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ== + } + zustand@5.0.7: resolution: { @@ -6176,6 +6321,8 @@ snapshots: dependencies: react: 19.2.3 + "@resvg/resvg-wasm@2.4.0": {} + "@rolldown/pluginutils@1.0.0-beta.11": {} "@rollup/pluginutils@5.2.0(rollup@4.44.2)": @@ -6280,6 +6427,11 @@ snapshots: transitivePeerDependencies: - "@types/node" + "@shuding/opentype.js@1.4.0-beta.0": + dependencies: + fflate: 0.7.4 + string.prototype.codepointat: 0.2.1 + "@sindresorhus/merge-streams@2.3.0": {} "@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.28.0)": @@ -6689,6 +6841,11 @@ snapshots: "@typescript-eslint/types": 8.35.1 eslint-visitor-keys: 4.2.1 + "@vercel/og@0.8.6": + dependencies: + "@resvg/resvg-wasm": 2.4.0 + satori: 0.16.0 + "@vitejs/plugin-react-swc@3.10.2(@swc/helpers@0.5.17)(vite@7.0.6(@types/node@24.2.0)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(tsx@4.21.0)(yaml@2.8.0))": dependencies: "@rolldown/pluginutils": 1.0.0-beta.11 @@ -6861,6 +7018,8 @@ snapshots: balanced-match@1.0.2: {} + base64-js@0.0.8: {} + brace-expansion@1.1.12: dependencies: balanced-match: 1.0.2 @@ -6891,6 +7050,8 @@ snapshots: camelcase@6.3.0: {} + camelize@1.0.1: {} + caniuse-lite@1.0.30001726: {} chai@5.2.1: @@ -6972,6 +7133,20 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + css-background-parser@0.1.0: {} + + css-box-shadow@1.0.0-3: {} + + css-color-keywords@1.0.0: {} + + css-gradient-parser@0.0.16: {} + + css-to-react-native@3.2.0: + dependencies: + camelize: 1.0.1 + css-color-keywords: 1.0.0 + postcss-value-parser: 4.2.0 + css.escape@1.5.1: {} cssstyle@4.6.0: @@ -7021,6 +7196,8 @@ snapshots: electron-to-chromium@1.5.179: {} + emoji-regex-xs@2.0.1: {} + emoji-regex@10.4.0: {} emoji-regex@8.0.0: {} @@ -7101,6 +7278,8 @@ snapshots: escalade@3.2.0: {} + escape-html@1.0.3: {} + escape-string-regexp@4.0.0: {} eslint-plugin-react-hooks@5.2.0(eslint@9.30.1(jiti@2.4.2)): @@ -7214,6 +7393,8 @@ snapshots: optionalDependencies: picomatch: 4.0.3 + fflate@0.7.4: {} + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -7299,6 +7480,8 @@ snapshots: he@1.2.0: {} + hex-rgb@4.3.0: {} + html-encoding-sniffer@4.0.0: dependencies: whatwg-encoding: 3.1.1 @@ -7500,6 +7683,11 @@ snapshots: lilconfig@3.1.3: {} + linebreak@1.1.0: + dependencies: + base64-js: 0.0.8 + unicode-trie: 2.0.0 + lines-and-columns@1.2.4: {} linkify-it@5.0.0: @@ -7679,10 +7867,17 @@ snapshots: dependencies: p-limit: 3.1.0 + pako@0.2.9: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 + parse-css-color@0.2.1: + dependencies: + color-name: 1.1.4 + hex-rgb: 4.3.0 + parse-json@5.2.0: dependencies: "@babel/code-frame": 7.27.1 @@ -7898,6 +8093,20 @@ snapshots: safer-buffer@2.1.2: {} + satori@0.16.0: + dependencies: + "@shuding/opentype.js": 1.4.0-beta.0 + css-background-parser: 0.1.0 + css-box-shadow: 1.0.0-3 + css-gradient-parser: 0.0.16 + css-to-react-native: 3.2.0 + emoji-regex-xs: 2.0.1 + escape-html: 1.0.3 + linebreak: 1.1.0 + parse-css-color: 0.2.1 + postcss-value-parser: 4.2.0 + yoga-layout: 3.2.1 + saxes@6.0.0: dependencies: xmlchars: 2.2.0 @@ -8009,6 +8218,8 @@ snapshots: get-east-asian-width: 1.3.0 strip-ansi: 7.1.0 + string.prototype.codepointat@0.2.1: {} + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -8067,6 +8278,8 @@ snapshots: commander: 2.20.3 source-map-support: 0.5.21 + tiny-inflate@1.0.3: {} + tinybench@2.9.0: {} tinyexec@0.3.2: {} @@ -8199,6 +8412,11 @@ snapshots: undici-types@7.10.0: {} + unicode-trie@2.0.0: + dependencies: + pako: 0.2.9 + tiny-inflate: 1.0.3 + unicorn-magic@0.3.0: {} universalify@2.0.1: {} @@ -8408,6 +8626,8 @@ snapshots: yocto-queue@0.1.0: {} + yoga-layout@3.2.1: {} + zustand@5.0.7(@types/react@19.2.7)(react@19.2.3)(use-sync-external-store@1.5.0(react@19.2.3)): optionalDependencies: "@types/react": 19.2.7 diff --git a/src/api/og.tsx b/src/api/og.tsx new file mode 100644 index 00000000..e864fbc0 --- /dev/null +++ b/src/api/og.tsx @@ -0,0 +1,7 @@ +import { ImageResponse } from "@vercel/og"; + +export default { + fetch(request: Request) { + return new ImageResponse(
Testing
, {}); + } +}; diff --git a/vercel.json b/vercel.json index 1323cdac..ecd28c0c 100644 --- a/vercel.json +++ b/vercel.json @@ -1,8 +1,7 @@ { "rewrites": [ - { - "source": "/(.*)", - "destination": "/index.html" - } + { "source": "/api/(.*)", "destination": "/api/$1" }, + { "source": "/[^.]+", "destination": "/api/og" }, + { "source": "/", "destination": "/api/og" } ] }