Skip to content

Commit

Permalink
feat: remove @vercel/og (#28)
Browse files Browse the repository at this point in the history
* wip

* wip

* support dynamic assets

* changeset
  • Loading branch information
jxom authored Mar 13, 2024
1 parent 36f2ab7 commit 95db657
Show file tree
Hide file tree
Showing 50 changed files with 12,292 additions and 54,977 deletions.
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

0 comments on commit 95db657

Please sign in to comment.