diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d8f676a..16e90a32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -289,6 +289,7 @@ jobs: upload: | tmp/visual/screenshots --prefix screenshots/ --platform chrome-linux tmp/visual/site --prefix site/ + tmp/visual/og --prefix og/ tmp/visual/site/docs/quick-start.md --prefix site/docs/ --format text frontend/src --from vitest --prefix components/ app/tests/golden/api --prefix json/api/ --format json diff --git a/frontend/package.json b/frontend/package.json index 11b83854..176aae8c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -24,11 +24,14 @@ "simple-icons": "^16.39.0" }, "devDependencies": { + "@fontsource/geist": "^5.3.0", + "@resvg/resvg-js": "^2.6.2", "@testing-library/react": "^16.3.3", "@types/react": "^19", "@types/react-dom": "^19", "@vitejs/plugin-react": "^6.0.5", "jsdom": "^27.4.0", + "satori": "^0.64.3", "typescript": "^5", "vite": "^8.2.1", "vitest": "^4.1.12" diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 19719611..e80eec67 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -46,6 +46,12 @@ importers: specifier: ^16.39.0 version: 16.39.0 devDependencies: + '@fontsource/geist': + specifier: ^5.3.0 + version: 5.3.0 + '@resvg/resvg-js': + specifier: ^2.6.2 + version: 2.6.2 '@testing-library/react': specifier: ^16.3.3 version: 16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.3))(@types/react@19.3.3)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) @@ -61,6 +67,9 @@ importers: jsdom: specifier: ^27.4.0 version: 27.4.0 + satori: + specifier: ^0.64.3 + version: 0.64.3 typescript: specifier: ^5 version: 5.9.3 @@ -157,6 +166,9 @@ packages: '@fontsource-variable/geist@5.3.0': resolution: {integrity: sha512-j0m+vLQuG5XAYoHtGCVu0spvlGreR3EzpECUVzkFmI1mTVnAO38l/NEPDCFgZ177JxzYJCLSmTQibIiYPilGrA==} + '@fontsource/geist@5.3.0': + resolution: {integrity: sha512-u03ftlfVwb05uijq2jGDJ03/HKGqMKaNFk7KOhkpBUex8+BhrAOfMs/XciJ2UUNUX9fEsZbZQld/RWMA2oFU7g==} + '@jridgewell/sourcemap-codec@1.6.0': resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} @@ -247,6 +259,82 @@ packages: react: '>= 16.8' react-dom: '>= 16.8' + '@resvg/resvg-js-android-arm-eabi@2.6.2': + resolution: {integrity: sha512-FrJibrAk6v29eabIPgcTUMPXiEz8ssrAk7TXxsiZzww9UTQ1Z5KAbFJs+Z0Ez+VZTYgnE5IQJqBcoSiMebtPHA==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + + '@resvg/resvg-js-android-arm64@2.6.2': + resolution: {integrity: sha512-VcOKezEhm2VqzXpcIJoITuvUS/fcjIw5NA/w3tjzWyzmvoCdd+QXIqy3FBGulWdClvp4g+IfUemigrkLThSjAQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + + '@resvg/resvg-js-darwin-arm64@2.6.2': + resolution: {integrity: sha512-nmok2LnAd6nLUKI16aEB9ydMC6Lidiiq2m1nEBDR1LaaP7FGs4AJ90qDraxX+CWlVuRlvNjyYJTNv8qFjtL9+A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@resvg/resvg-js-darwin-x64@2.6.2': + resolution: {integrity: sha512-GInyZLjgWDfsVT6+SHxQVRwNzV0AuA1uqGsOAW+0th56J7Nh6bHHKXHBWzUrihxMetcFDmQMAX1tZ1fZDYSRsw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@resvg/resvg-js-linux-arm-gnueabihf@2.6.2': + resolution: {integrity: sha512-YIV3u/R9zJbpqTTNwTZM5/ocWetDKGsro0SWp70eGEM9eV2MerWyBRZnQIgzU3YBnSBQ1RcxRZvY/UxwESfZIw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + + '@resvg/resvg-js-linux-arm64-gnu@2.6.2': + resolution: {integrity: sha512-zc2BlJSim7YR4FZDQ8OUoJg5holYzdiYMeobb9pJuGDidGL9KZUv7SbiD4E8oZogtYY42UZEap7dqkkYuA91pg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@resvg/resvg-js-linux-arm64-musl@2.6.2': + resolution: {integrity: sha512-3h3dLPWNgSsD4lQBJPb4f+kvdOSJHa5PjTYVsWHxLUzH4IFTJUAnmuWpw4KqyQ3NA5QCyhw4TWgxk3jRkQxEKg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@resvg/resvg-js-linux-x64-gnu@2.6.2': + resolution: {integrity: sha512-IVUe+ckIerA7xMZ50duAZzwf1U7khQe2E0QpUxu5MBJNao5RqC0zwV/Zm965vw6D3gGFUl7j4m+oJjubBVoftw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@resvg/resvg-js-linux-x64-musl@2.6.2': + resolution: {integrity: sha512-UOf83vqTzoYQO9SZ0fPl2ZIFtNIz/Rr/y+7X8XRX1ZnBYsQ/tTb+cj9TE+KHOdmlTFBxhYzVkP2lRByCzqi4jQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@resvg/resvg-js-win32-arm64-msvc@2.6.2': + resolution: {integrity: sha512-7C/RSgCa+7vqZ7qAbItfiaAWhyRSoD4l4BQAbVDqRRsRgY+S+hgS3in0Rxr7IorKUpGE69X48q6/nOAuTJQxeQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@resvg/resvg-js-win32-ia32-msvc@2.6.2': + resolution: {integrity: sha512-har4aPAlvjnLcil40AC77YDIk6loMawuJwFINEM7n0pZviwMkMvjb2W5ZirsNOZY4aDbo5tLx0wNMREp5Brk+w==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + + '@resvg/resvg-js-win32-x64-msvc@2.6.2': + resolution: {integrity: sha512-ZXtYhtUr5SSaBrUDq7DiyjOFJqBVL/dOBN7N/qmi/pO0IgiWW/f/ue3nbvu9joWE5aAKDoIzy/CxsY0suwGosQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@resvg/resvg-js@2.6.2': + resolution: {integrity: sha512-xBaJish5OeGmniDj9cW5PRa/PtmuVU3ziqrbr5xJj901ZDN4TosrVaNZpEiLZAxdfnhAe7uQ7QFWfjPe9d9K2Q==} + engines: {node: '>= 10'} + '@rolldown/binding-android-arm-eabi@1.2.19': resolution: {integrity: sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==} engines: {node: ^20.19.0 || >=22.12.0} @@ -345,6 +433,11 @@ packages: '@rolldown/pluginutils@1.1.1': resolution: {integrity: sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==} + '@shuding/opentype.js@1.4.0-beta.0': + resolution: {integrity: sha512-3NgmNyH3l/Hv6EvsWJbsvpcpUba6R8IREQ83nH83cyakCw7uM1arZKNfHwv1Wz6jgqrF/j4x5ELvR6PnK9nTcA==} + engines: {node: '>= 8.0.0'} + hasBin: true + '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} @@ -521,9 +614,16 @@ packages: bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + base64-js@0.0.8: + resolution: {integrity: sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==} + engines: {node: '>= 0.4'} + bidi-js@1.1.0: resolution: {integrity: sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==} + camelize@1.0.1: + resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} + ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -543,6 +643,9 @@ packages: character-reference-invalid@2.0.1: resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} @@ -552,6 +655,20 @@ packages: cookie-es@3.1.1: resolution: {integrity: sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==} + css-background-parser@0.1.0: + resolution: {integrity: sha512-2EZLisiZQ+7m4wwur/qiYJRniHX4K5Tc9w93MT3AS0WS1u5kaZ4FKXlOTBhOjc+CgEgPiGY+fX1yWD8UwpEqUA==} + + css-color-keywords@1.0.0: + resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} + engines: {node: '>=4'} + + css-gradient-parser@0.0.17: + resolution: {integrity: sha512-w2Xy9UMMwlKtou0vlRnXvWglPAceXCTtcmVSo8ZBUvqCV5aXEFP/PC6d+I464810I9FT++UACwTD5511bmGPUg==} + engines: {node: '>=16'} + + css-to-react-native@3.2.0: + resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} + css-tree@3.2.1: resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} @@ -596,6 +713,10 @@ packages: dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + emoji-regex-xs@2.0.1: + resolution: {integrity: sha512-1QFuh8l7LqUcKe24LsPUNzjrzJQ7pgRwp1QMcZ5MX6mFplk2zQ08NVCM84++1cveaUUYtcCYHmeFEuNg16sU4g==} + engines: {node: '>=10.0.0'} + entities@9.0.0: resolution: {integrity: sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==} engines: {node: '>=20.19.0'} @@ -603,6 +724,9 @@ packages: es-module-lexer@2.3.2: resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==} + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + estree-util-is-identifier-name@3.0.0: resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} @@ -625,17 +749,27 @@ packages: picomatch: optional: true + fflate@0.7.5: + resolution: {integrity: sha512-QieYf//cis6ywHNi5qW1+PXPQ4bC+XVJAtS4AXIML8P76GroEiOxm/oQtn1f02UkJY1+KsXMJcC+R2v/Eg4G3g==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + harfbuzzjs@0.10.0: + resolution: {integrity: sha512-SN8LVwCOzvTq3OPNd0+EAghgXugItz56wst567D1vs7LnnKGWprhi3EG58aVOBwhN8HEbQxL4I9NDWkcXUutRw==} + hast-util-to-jsx-runtime@2.3.7: resolution: {integrity: sha512-F7DNV2NMcTxA4GqPVHnXzX+mpoPHAIY9rJAVH3CZ1FdBZOcBUEjUuvMkMpHVs/sicEtznh9tMGj5WUR9S4E2rg==} hast-util-whitespace@3.0.0: resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + hex-rgb@4.3.0: + resolution: {integrity: sha512-Ox1pJVrDCyGHMG9CFg1tmrRUMRPRsAWYc/PinY0XzJU4K7y7vjNoLKIQ7BR5UJMCxNN8EM1MNDmHWA/B3aZUuw==} + engines: {node: '>=6'} + html-encoding-sniffer@6.0.0: resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} @@ -759,6 +893,9 @@ packages: resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} engines: {node: '>= 12.0.0'} + linebreak@1.1.0: + resolution: {integrity: sha512-MHp03UImeVhB7XZtjd0E4n6+3xr5Dq/9xI/5FptGk5FrbDR3zagPa2DS6U8ks/3HjbKWG9Q1M2ufOzxV2qLYSQ==} + longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -883,6 +1020,12 @@ packages: resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} engines: {node: '>=12.20.0'} + pako@0.2.9: + resolution: {integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==} + + parse-css-color@0.2.1: + resolution: {integrity: sha512-bwS/GGIFV3b6KS4uwpzCFj4w297Yl3uqnSgIPsoQkx7GMLROXfMnWvxfNkL0oh8HVhZA4hvJoEoEIqonfJ3BWg==} + parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} @@ -903,6 +1046,9 @@ packages: resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} engines: {node: '>=12'} + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss@8.5.33: resolution: {integrity: sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==} engines: {node: ^10 || ^12 || >=14} @@ -951,6 +1097,10 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true + satori@0.64.3: + resolution: {integrity: sha512-OLllvoVcDUU2YGZHS9aiwxaj2o6Ebu/ndDNeZ7JenjtybGfqx/WdpyA87YteID7Jh23DIosdvwwCdRq7PDGjww==} + engines: {node: '>=16'} + saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} @@ -988,6 +1138,9 @@ packages: std-env@4.3.0: resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==} + string.prototype.codepointat@0.2.1: + resolution: {integrity: sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==} + stringify-entities@4.0.5: resolution: {integrity: sha512-jNuI2fNNw5ecxrWmgm90R3iH0Kc/94AQwoQWoSUYphWzvmUA2pjFG34H56Z7Z3FkvH3FpYwwewKAa97oQnPFhw==} @@ -997,6 +1150,9 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + tiny-inflate@1.0.3: + resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} + tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -1041,6 +1197,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + unicode-trie@2.0.0: + resolution: {integrity: sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==} + unified@11.0.5: resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} @@ -1279,6 +1438,8 @@ snapshots: '@fontsource-variable/geist@5.3.0': {} + '@fontsource/geist@5.3.0': {} + '@jridgewell/sourcemap-codec@1.6.0': {} '@napi-rs/canvas-android-arm64@1.2.1': @@ -1343,6 +1504,57 @@ snapshots: react: 19.3.1 react-dom: 19.3.1(react@19.3.1) + '@resvg/resvg-js-android-arm-eabi@2.6.2': + optional: true + + '@resvg/resvg-js-android-arm64@2.6.2': + optional: true + + '@resvg/resvg-js-darwin-arm64@2.6.2': + optional: true + + '@resvg/resvg-js-darwin-x64@2.6.2': + optional: true + + '@resvg/resvg-js-linux-arm-gnueabihf@2.6.2': + optional: true + + '@resvg/resvg-js-linux-arm64-gnu@2.6.2': + optional: true + + '@resvg/resvg-js-linux-arm64-musl@2.6.2': + optional: true + + '@resvg/resvg-js-linux-x64-gnu@2.6.2': + optional: true + + '@resvg/resvg-js-linux-x64-musl@2.6.2': + optional: true + + '@resvg/resvg-js-win32-arm64-msvc@2.6.2': + optional: true + + '@resvg/resvg-js-win32-ia32-msvc@2.6.2': + optional: true + + '@resvg/resvg-js-win32-x64-msvc@2.6.2': + optional: true + + '@resvg/resvg-js@2.6.2': + optionalDependencies: + '@resvg/resvg-js-android-arm-eabi': 2.6.2 + '@resvg/resvg-js-android-arm64': 2.6.2 + '@resvg/resvg-js-darwin-arm64': 2.6.2 + '@resvg/resvg-js-darwin-x64': 2.6.2 + '@resvg/resvg-js-linux-arm-gnueabihf': 2.6.2 + '@resvg/resvg-js-linux-arm64-gnu': 2.6.2 + '@resvg/resvg-js-linux-arm64-musl': 2.6.2 + '@resvg/resvg-js-linux-x64-gnu': 2.6.2 + '@resvg/resvg-js-linux-x64-musl': 2.6.2 + '@resvg/resvg-js-win32-arm64-msvc': 2.6.2 + '@resvg/resvg-js-win32-ia32-msvc': 2.6.2 + '@resvg/resvg-js-win32-x64-msvc': 2.6.2 + '@rolldown/binding-android-arm-eabi@1.2.19': optional: true @@ -1397,6 +1609,11 @@ snapshots: '@rolldown/pluginutils@1.1.1': {} + '@shuding/opentype.js@1.4.0-beta.0': + dependencies: + fflate: 0.7.5 + string.prototype.codepointat: 0.2.1 + '@standard-schema/spec@1.1.0': {} '@tanstack/history@1.162.5': {} @@ -1568,10 +1785,14 @@ snapshots: bail@2.0.2: {} + base64-js@0.0.8: {} + bidi-js@1.1.0: dependencies: require-from-string: 2.0.2 + camelize@1.0.1: {} + ccount@2.0.1: {} chai@6.3.0: {} @@ -1584,12 +1805,26 @@ snapshots: character-reference-invalid@2.0.1: {} + color-name@1.1.4: {} + comma-separated-tokens@2.0.3: {} convert-source-map@2.0.0: {} cookie-es@3.1.1: {} + css-background-parser@0.1.0: {} + + css-color-keywords@1.0.0: {} + + css-gradient-parser@0.0.17: {} + + 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-tree@3.2.1: dependencies: mdn-data: 2.27.1 @@ -1629,10 +1864,14 @@ snapshots: dom-accessibility-api@0.5.16: {} + emoji-regex-xs@2.0.1: {} + entities@9.0.0: {} es-module-lexer@2.3.2: {} + escape-html@1.0.3: {} + estree-util-is-identifier-name@3.0.0: {} estree-walker@3.0.3: @@ -1647,9 +1886,13 @@ snapshots: optionalDependencies: picomatch: 4.0.7 + fflate@0.7.5: {} + fsevents@2.3.3: optional: true + harfbuzzjs@0.10.0: {} + hast-util-to-jsx-runtime@2.3.7: dependencies: '@types/estree': 1.0.11 @@ -1674,6 +1917,8 @@ snapshots: dependencies: '@types/hast': 3.0.5 + hex-rgb@4.3.0: {} + html-encoding-sniffer@6.0.0: dependencies: '@exodus/bytes': 1.16.0 @@ -1794,6 +2039,11 @@ snapshots: lightningcss-win32-arm64-msvc: 1.33.0 lightningcss-win32-x64-msvc: 1.33.0 + linebreak@1.1.0: + dependencies: + base64-js: 0.0.8 + unicode-trie: 2.0.0 + longest-streak@3.1.0: {} lru-cache@11.5.4: {} @@ -2044,6 +2294,13 @@ snapshots: obug@2.2.1: {} + pako@0.2.9: {} + + parse-css-color@0.2.1: + dependencies: + color-name: 1.1.4 + hex-rgb: 4.3.0 + parse-entities@4.0.2: dependencies: '@types/unist': 2.0.11 @@ -2068,6 +2325,8 @@ snapshots: picomatch@4.0.7: {} + postcss-value-parser@4.2.0: {} + postcss@8.5.33: dependencies: nanoid: 3.3.20 @@ -2152,6 +2411,20 @@ snapshots: '@rolldown/binding-win32-arm64-msvc': 1.2.19 '@rolldown/binding-win32-x64-msvc': 1.2.19 + satori@0.64.3: + dependencies: + '@shuding/opentype.js': 1.4.0-beta.0 + css-background-parser: 0.1.0 + css-gradient-parser: 0.0.17 + css-to-react-native: 3.2.0 + emoji-regex-xs: 2.0.1 + escape-html: 1.0.3 + fflate: 0.7.5 + harfbuzzjs: 0.10.0 + linebreak: 1.1.0 + parse-css-color: 0.2.1 + postcss-value-parser: 4.2.0 + saxes@6.0.0: dependencies: xmlchars: 2.2.0 @@ -2176,6 +2449,8 @@ snapshots: std-env@4.3.0: {} + string.prototype.codepointat@0.2.1: {} + stringify-entities@4.0.5: dependencies: character-entities-html4: 2.1.0 @@ -2187,6 +2462,8 @@ snapshots: symbol-tree@3.2.4: {} + tiny-inflate@1.0.3: {} + tinybench@2.9.0: {} tinyexec@1.4.0: {} @@ -2221,6 +2498,11 @@ snapshots: typescript@5.9.3: {} + unicode-trie@2.0.0: + dependencies: + pako: 0.2.9 + tiny-inflate: 1.0.3 + unified@11.0.5: dependencies: '@types/unist': 3.0.3 diff --git a/frontend/scripts/blog.d.mts b/frontend/scripts/blog.d.mts index a160c7e7..b347c08c 100644 --- a/frontend/scripts/blog.d.mts +++ b/frontend/scripts/blog.d.mts @@ -17,3 +17,5 @@ export function sortPosts(posts: Post[]): Post[] export function postMetaHtml(post: Post): string export function postJsonLd(post: Post): string export function atomFeed(posts: Post[], htmlBySlug: Map): string +export function postOgImage(post: Post): string +export function postOgLine(post: Post): string diff --git a/frontend/scripts/blog.mjs b/frontend/scripts/blog.mjs index bd78af95..1ced4488 100644 --- a/frontend/scripts/blog.mjs +++ b/frontend/scripts/blog.mjs @@ -4,7 +4,7 @@ // // Front matter: title, description, date and author, all required. `date` is when the post was published, with its // time and timezone (2026-12-04T18:18:16+13:00): posts are sorted by it, and the page shows its date as written; `image`, a PNG or JPG in the post's -// folder for its link preview; `draft: true` keeps a post out of the build unless VISUALCI_BLOG_DRAFTS=1 (a dev server). +// folder, shown cropped on its link-preview card (scripts/og.mjs draws one for every post, with or without it); `draft: true` keeps a post out of the build unless VISUALCI_BLOG_DRAFTS=1 (a dev server). // A published post with a `[TODO` placeholder left in it fails the build. // With no published posts there's no /blog/ at all, so the site never links an empty blog. import { cp, readdir, readFile, stat } from 'node:fs/promises' @@ -99,6 +99,10 @@ export async function copyPostFiles(posts, dist) { export const postPath = (post) => `/blog/${post.slug}/` export const postMarkdown = (post) => `/blog/${post.slug}.md` export const postImage = (post) => (post.image ? `${SITE}/blog/${post.slug}/${post.image}` : null) +/** The post's link-preview card (scripts/og.mjs), made at build time from its title, date, author and image. */ +export const postOgImage = (post) => `${SITE}/og/blog/${post.slug}.png` +/** The line under the title on the post's card. */ +export const postOgLine = (post) => `${formatDate(post.day)} · ${post.author}` const escapeHtml = (s) => s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"') @@ -126,7 +130,7 @@ export function postJsonLd(post) { publisher: { '@type': 'Organization', name: 'VisualCI', url: SITE }, url: `${SITE}${postPath(post)}`, mainEntityOfPage: `${SITE}${postPath(post)}`, - ...(post.image ? { image: postImage(post) } : {}), + image: [postOgImage(post), ...(post.image ? [postImage(post)] : [])], } return `` } @@ -160,11 +164,12 @@ export function atomFeed(posts, htmlBySlug) { ${p.date} ${escapeHtml(p.author)} ${escapeHtml(p.description)} + ${escapeHtml(absolute(htmlBySlug.get(p.slug)))} `, ) return ` - + VisualCI blog Notes from the people building VisualCI. diff --git a/frontend/scripts/og.mjs b/frontend/scripts/og.mjs new file mode 100644 index 00000000..e187f155 --- /dev/null +++ b/frontend/scripts/og.mjs @@ -0,0 +1,125 @@ +// Link-preview images (og:image), one per page, made at build time from the page's title and front matter: 1200×630 +// PNGs in the site's light theme, written to dist/og/.png. Satori lays the card out as SVG and resvg draws it, +// both in Node, so the prerender needs no browser. The fonts are Geist's static WOFF files (Satori reads WOFF, not +// the WOFF2 the site serves). +import { readFile } from 'node:fs/promises' +import { createRequire } from 'node:module' +import { extname } from 'node:path' +import satori from 'satori' +import { Resvg } from '@resvg/resvg-js' + +const require = createRequire(import.meta.url) +const font = (weight) => readFile(require.resolve(`@fontsource/geist/files/geist-latin-${weight}-normal.woff`)) +const fonts = Promise.all( + [400, 500, 700].map(async (weight) => ({ name: 'Geist', data: await font(weight), weight, style: 'normal' })), +) + +export const OG_WIDTH = 1200 +export const OG_HEIGHT = 630 + +// The site's light theme (src/styles.css), as hex: resvg reads no oklch(). +const PAPER = '#f8f9fc' +const INK = '#16181d' +const MUTED = '#5c6370' +const RULE = '#e3e6ec' +const ACCENT = '#2b4fd8' + +/** A Satori element: the same shape as React's, without JSX. */ +const h = (type, style, ...children) => ({ type, props: { style, children: children.flat().filter((c) => c != null) } }) + +// The mark, from public/favicon.svg: an outlined page with a filled one in front of it. +const mark = { + type: 'svg', + props: { + width: 44, + height: 44, + viewBox: '5 5 22 22', + children: [ + { type: 'rect', props: { x: 7, y: 6, width: 11, height: 15, rx: 1.5, fill: 'none', stroke: INK, 'stroke-width': 2 } }, + { type: 'rect', props: { x: 14, y: 11, width: 11, height: 15, rx: 1.5, fill: ACCENT, stroke: ACCENT, 'stroke-width': 2 } }, + ], + }, +} + +/** Long titles get a smaller size, so the longest post title still fits in four lines. */ +function titleSize(title, narrow) { + const n = title.length + if (n <= 36) return narrow ? 60 : 68 + if (n <= 64) return narrow ? 50 : 58 + return narrow ? 42 : 48 +} + +const dataUri = async (file) => { + const type = extname(file).toLowerCase() === '.png' ? 'image/png' : 'image/jpeg' + return `data:${type};base64,${(await readFile(file)).toString('base64')}` +} + +/** + * The card for one page, as a PNG. + * - `section`: the word beside the mark ("Blog", "Docs"), or none. + * - `title`: the page's title. + * - `line`: the line under it (a post's date and author, a docs page's description). + * - `image`: a PNG or JPG on disk (a post's `image`), shown cropped in the page shape on the right. + */ +export async function ogPng({ section = null, title, line = null, image = null }) { + const narrow = !!image + const left = h( + 'div', + { display: 'flex', flexDirection: 'column', width: narrow ? 640 : 760, height: '100%', padding: '72px 0 0 72px' }, + h( + 'div', + { display: 'flex', alignItems: 'center', gap: 14 }, + mark, + h('div', { fontSize: 34, fontWeight: 500, color: INK, letterSpacing: -0.5 }, 'VisualCI'), + section ? h('div', { fontSize: 34, fontWeight: 400, color: MUTED, marginLeft: 4 }, section) : null, + ), + h( + 'div', + { display: 'flex', fontSize: titleSize(title, narrow), fontWeight: 700, color: INK, lineHeight: 1.1, letterSpacing: -1.5, marginTop: 56 }, + title, + ), + line + ? h('div', { display: 'block', fontSize: 28, color: MUTED, lineHeight: 1.4, marginTop: 28, lineClamp: 3 }, line) + : null, + ) + // The right side: the landing page's two pages, as in public/og.png. With an image, the front page holds it. + const back = h('div', { + position: 'absolute', + left: narrow ? 760 : 960, + top: 150, + width: 340, + height: 340, + border: `40px solid ${RULE}`, + borderRadius: 48, + }) + const front = image + ? h( + 'div', + { + position: 'absolute', + left: 830, + top: 230, + width: 400, + height: 350, + display: 'flex', + borderRadius: 28, + border: `10px solid ${ACCENT}`, + background: '#ffffff', + overflow: 'hidden', + }, + { type: 'img', props: { src: await dataUri(image), width: 380, height: 330, style: { objectFit: 'cover', objectPosition: 'top left' } } }, + ) + : h('div', { position: 'absolute', left: 1105, top: 252, width: 300, height: 346, borderRadius: 48, background: ACCENT }) + const svg = await satori( + h( + 'div', + { display: 'flex', position: 'relative', width: OG_WIDTH, height: OG_HEIGHT, background: PAPER, fontFamily: 'Geist', overflow: 'hidden' }, + back, + front, + left, + h('div', { position: 'absolute', left: 0, bottom: 0, width: OG_WIDTH, height: 12, background: ACCENT }), + ), + { width: OG_WIDTH, height: OG_HEIGHT, fonts: await fonts }, + ) + return new Resvg(svg, { fitTo: { mode: 'width', value: OG_WIDTH } }).render().asPng() +} diff --git a/frontend/scripts/prerender.mjs b/frontend/scripts/prerender.mjs index a3f53404..91e8b964 100644 --- a/frontend/scripts/prerender.mjs +++ b/frontend/scripts/prerender.mjs @@ -22,10 +22,20 @@ const readPage = async (slug) => { } console.log(`the docs install CLI ${cliVersion}`) import { buildHosts, hostsMeta } from './hosts.mjs' -import { atomFeed, copyPostFiles, indexHtml, indexMarkdown, loadPosts, postImage, postJsonLd, postMarkdown, postMetaHtml, postPath } from './blog.mjs' +import { atomFeed, blogDir, copyPostFiles, indexHtml, indexMarkdown, loadPosts, postJsonLd, postMarkdown, postMetaHtml, postOgLine, postPath } from './blog.mjs' +import { ogPng } from './og.mjs' const dist = join(root, 'dist') +/** Draw a page's link-preview card (scripts/og.mjs) to dist/og/.png and return its URL, for og:image. */ +async function writeOg(path, card) { + const file = join(dist, 'og', `${path}.png`) + await mkdir(dirname(file), { recursive: true }) + await writeFile(file, await ogPng(card)) + return `${SITE}/og/${path}.png` +} +const SITE_OG = 'https://visualci.com/og.png' + function fill(html, placeholder, value, file) { if (!html.includes(placeholder)) throw new Error(`${file} has no ${placeholder}`) return html.split(placeholder).join(value) @@ -113,6 +123,7 @@ for (const page of pages) { html = fill(html, '', escapeAttr(page.description), 'docs.html') html = fill(html, '', `${SITE}${docsPath(page.slug)}`, 'docs.html') html = fill(html, '', ``, 'docs.html') + html = fill(html, SITE_OG, await writeOg(`docs/${page.slug}`, { section: 'Docs', title: page.title, line: page.description }), 'docs.html') const htmlFile = page.slug === 'index' ? join(dist, 'docs/index.html') : join(dist, 'docs', page.slug, 'index.html') await mkdir(dirname(htmlFile), { recursive: true }) await writeFile(htmlFile, html) @@ -138,9 +149,10 @@ const standalone = [] for (const slug of await standaloneSlugs(join(root, 'content/pages'))) { standalone.push(parsePage(slug, await readFile(join(root, 'content/pages', `${slug}.md`), 'utf8'))) } -/** Write a page outside the docs: //index.html in the docs' design, and its Markdown copy. `ogImage` replaces - * the site's link-preview image, and `head` is added to the page's (the blog's feed link). */ -async function writeStandalone({ slug, title, description, html: body, copy, ogImage = null, head = '', meta }) { +/** Write a page outside the docs: //index.html in the docs' design, its Markdown copy and its link-preview card + * (dist/og/.png: `og` sets the card's section word, the line under its title, by default the description, and + * its image). `head` is added to the page's (the blog's feed link). */ +async function writeStandalone({ slug, title, description, html: body, copy, og = {}, head = '', meta }) { const markdown = standaloneMarkdown(slug) const path = standalonePath(slug) const data = { slug, title, description, html: body, nav: [], markdown, ...(meta ? { meta } : {}) } @@ -154,7 +166,7 @@ async function writeStandalone({ slug, title, description, html: body, copy, ogI html = fill(html, '', escapeAttr(description), 'docs.html') html = fill(html, '', `${SITE}${path}`, 'docs.html') html = fill(html, '', ``, 'docs.html') - if (ogImage) html = fill(html, 'https://visualci.com/og.png', escapeAttr(ogImage), 'docs.html') + html = fill(html, SITE_OG, await writeOg(slug, { title, line: description, ...og }), 'docs.html') if (head) html = fill(html, '', `${head}\n `, 'docs.html') await mkdir(join(dist, path), { recursive: true }) await writeFile(join(dist, path, 'index.html'), html) @@ -326,7 +338,7 @@ if (posts.length) { html: body, meta: postMetaHtml(post), copy: `${post.day}, ${post.author}\n\n${absoluteLinks(post.body)}`, - ogImage: postImage(post), + og: { section: 'Blog', line: postOgLine(post), image: post.image ? join(blogDir, post.slug, post.image) : null }, head: `${feedLink}\n ${postJsonLd(post)}`, }) } diff --git a/frontend/scripts/site.mjs b/frontend/scripts/site.mjs index 78d42100..549e99de 100644 --- a/frontend/scripts/site.mjs +++ b/frontend/scripts/site.mjs @@ -121,6 +121,15 @@ if (blogPosts.length) { for (const f of [...files].filter((f) => f.endsWith('.html') && f !== '404.html')) { if (!f.endsWith('index.html')) problems.push(`${f} isn't at a directory URL, so the sitemap can't list it`) } +// Each page's link-preview image is its own card from the prerender (dist/og/.png, scripts/og.mjs), or the +// site's og.png on the landing page: an og:image or twitter:image naming a file the site doesn't have is a broken preview. +for (const f of [...files].filter((f) => f.endsWith('.html') && f !== '404.html')) { + const html = await readFile(join(out, f), 'utf8') + const images = [...html.matchAll(/ m[1]) + if (images.length !== 2) problems.push(`${f} has ${images.length} of og:image and twitter:image, not both`) + for (const image of images) if (!files.has(image)) problems.push(`${f}: its link-preview image ${image} isn't in the site`) + if (f !== 'index.html' && images.includes('og.png')) problems.push(`${f} uses the site's og.png, not its own card`) +} if (pageUrls.length < 40) problems.push(`sitemap.xml lists only ${pageUrls.length} pages`) const landing = await readFile(join(out, 'index.html'), 'utf8') // To the app the site was built for (scripts/hosts.mjs: visualci.com's, unless VISUALCI_*_URL name others) diff --git a/frontend/src/__tests__/blog.test.ts b/frontend/src/__tests__/blog.test.ts index 3cf5ffee..c8b77104 100644 --- a/frontend/src/__tests__/blog.test.ts +++ b/frontend/src/__tests__/blog.test.ts @@ -32,6 +32,12 @@ describe('blog', () => { expect(feed).toContain('2026-12-04T03:49:04+13:00') }) + it("points the feed and JSON-LD at the post's generated card", () => { + const p = post('a', '2026-12-04T03:49:04+13:00') + expect(postJsonLd(p)).toContain('"image":["https://visualci.com/og/blog/a.png"]') + expect(atomFeed([p], new Map([['a', '

Body.

']]))).toContain('') + }) + it('lists the WeasyPrint case study before the starter kit published earlier that day', async () => { const slugs = (await loadPosts()).map((p) => p.slug) expect(slugs.indexOf('weasyprint-case-study')).toBeLessThan(slugs.indexOf('laravel-rust-starter-kit')) diff --git a/scripts/ci/visual.sh b/scripts/ci/visual.sh index f7b48308..935293a6 100755 --- a/scripts/ci/visual.sh +++ b/scripts/ci/visual.sh @@ -108,6 +108,8 @@ EOF if curl -fsS "http://127.0.0.1:$port/visualci.schema.json" -o "$out/site/visualci.schema.json" 2>/dev/null; then :; else rm -f "$out/site/visualci.schema.json" fi + # The link-preview cards the prerender drew (scripts/og.mjs), so a broken card template shows up in review. + rm -rf "$out/og" && cp -r "$root/frontend/dist/og" "$out/og" # Component snapshots, written fresh: the baselines are on VisualCI. cd "$root/frontend" find src -name __snapshots__ -type d -prune -exec rm -rf {} + @@ -121,6 +123,7 @@ upload() { export VISUALCI_BUILD_ID=$id "$cli" upload "$out/screenshots" --prefix screenshots/ --platform chrome-linux "$cli" upload "$out/site" --prefix site/ + "$cli" upload "$out/og" --prefix og/ # `upload` skips .md files in a directory, so the docs page goes up by name. "$cli" snapshot site/docs/quick-start "$out/site/docs/quick-start.md" --format text "$cli" upload "$root/frontend/src" --from vitest --prefix components/