Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove @vercel/og #28

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/seven-berries-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hono-og": patch
---

Migrated from `@vercel/og` to direct Satori + Resvg for non-edge/worker targets.
20 changes: 20 additions & 0 deletions .scripts/postbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { copyFileSync, mkdirSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const __dirname = dirname(fileURLToPath(import.meta.url));

await copyWasm();

async function copyWasm() {
const distDir = resolve(__dirname, "../src/lib/wasm");
mkdirSync(distDir);
copyFileSync(
resolve(__dirname, "../src/wasm/resvg.wasm"),
resolve(distDir, "resvg.wasm"),
);
copyFileSync(
resolve(__dirname, "../src/wasm/yoga.wasm"),
resolve(distDir, "yoga.wasm"),
);
}
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "example",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "bun run --hot src/index.tsx"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"workspaces": ["src", "example", "vendor/*"],
"workspaces": ["src", "example"],
"scripts": {
"build": "bun run clean && tsc --project ./tsconfig.build.json",
"build": "bun run clean && tsc --project ./tsconfig.build.json && bun .scripts/postbuild.ts",
"changeset": "changeset",
"changeset:release": "bun run build && changeset publish",
"changeset:version": "changeset version && bun install --lockfile-only",
Expand Down
Loading
Loading