From babe3229006126cc2db0e7acb73130c5cad0c3d2 Mon Sep 17 00:00:00 2001 From: Pat Sissons Date: Sat, 17 Feb 2024 14:18:09 -0800 Subject: [PATCH] tmp --- package.json | 5 +- pnpm-lock.yaml | 24 +-- src/lib/components/Seo/seo.svelte | 3 +- src/routes/og/[token_id]/+server.ts | 44 +++--- .../og/[token_id]/svelte-to-png/index.ts | 34 +++++ .../og/[token_id]/svelte-to-png/inlineCSS.ts | 80 ++++++++++ .../[token_id]/svelte-to-png/svelteToJsx.ts | 31 ++++ .../svelte-to-png/toReactElement.ts | 139 ++++++++++++++++++ vite.config.ts | 8 +- 9 files changed, 331 insertions(+), 37 deletions(-) create mode 100644 src/routes/og/[token_id]/svelte-to-png/index.ts create mode 100644 src/routes/og/[token_id]/svelte-to-png/inlineCSS.ts create mode 100644 src/routes/og/[token_id]/svelte-to-png/svelteToJsx.ts create mode 100644 src/routes/og/[token_id]/svelte-to-png/toReactElement.ts diff --git a/package.json b/package.json index cc9a019..72119cf 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "clean": "rimraf ./.svelte-kit", "dev": "vite dev", - "build": "vite build", + "build": "pnpm sync && vite build", "preview": "vite preview", "sync": "svelte-kit sync", "validate:svelte": "pnpm sync && svelte-check --tsconfig ./tsconfig.json", @@ -21,7 +21,7 @@ "dependencies": { "@download/blockies": "^1.0.3", "@ensdomains/ensjs": "^3.2.0", - "@ethercorps/sveltekit-og": "^3.0.0", + "@ethercorps/svelte-h2j": "^0.1.0", "@fontsource/inter": "^5.0.16", "@fontsource/roboto-mono": "^5.0.16", "@napi-rs/canvas": "^0.1.45", @@ -30,6 +30,7 @@ "@urql/svelte": "^4.0.4", "date-fns": "^3.3.1", "dotenv": "^16.3.2", + "satori": "^0.10.11", "svelte": "^4.2.7", "tailwindcss": "^3.4.1", "viem": "^2.5.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4372f3c..f7b3df3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,9 +14,9 @@ importers: '@ensdomains/ensjs': specifier: ^3.2.0 version: 3.2.0(typescript@5.3.3)(viem@2.5.0) - '@ethercorps/sveltekit-og': - specifier: ^3.0.0 - version: 3.0.0(svelte@4.2.9) + '@ethercorps/svelte-h2j': + specifier: ^0.1.0 + version: 0.1.0(svelte@4.2.9) '@fontsource/inter': specifier: ^5.0.16 version: 5.0.16 @@ -41,6 +41,9 @@ importers: dotenv: specifier: ^16.3.2 version: 16.3.2 + satori: + specifier: ^0.10.11 + version: 0.10.13 svelte: specifier: ^4.2.7 version: 4.2.9 @@ -539,17 +542,6 @@ packages: svelte: 4.2.9 dev: false - /@ethercorps/sveltekit-og@3.0.0(svelte@4.2.9): - resolution: {integrity: sha512-CQRmcfCPnTEqP+EeHBE7wWp1sNxpBaT4Fb5Js5fGnWEgFFIDbJEEcFiT0Uwc1CteolXY+CyTOg7mokcOtu3d7w==} - peerDependencies: - svelte: ^4.0.0 - dependencies: - '@ethercorps/svelte-h2j': 0.1.0(svelte@4.2.9) - '@resvg/resvg-js': 2.6.0 - satori: 0.10.13 - svelte: 4.2.9 - dev: false - /@ethersproject/abi@5.0.7: resolution: {integrity: sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw==} dependencies: @@ -1469,14 +1461,14 @@ packages: resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} dependencies: '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 + '@noble/hashes': 1.3.3 '@scure/base': 1.1.5 dev: false /@scure/bip39@1.2.1: resolution: {integrity: sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==} dependencies: - '@noble/hashes': 1.3.2 + '@noble/hashes': 1.3.3 '@scure/base': 1.1.5 dev: false diff --git a/src/lib/components/Seo/seo.svelte b/src/lib/components/Seo/seo.svelte index 345eef9..3327a16 100644 --- a/src/lib/components/Seo/seo.svelte +++ b/src/lib/components/Seo/seo.svelte @@ -1,7 +1,8 @@