Skip to content

Commit

Permalink
Explicit Buffer import for Deno compatibility (#72)
Browse files Browse the repository at this point in the history
* Explicit Buffer import for Deno compatibility

* Add changeset

---------

Co-authored-by: Chris Swithinbank <[email protected]>
  • Loading branch information
marekbrze and delucis authored Oct 12, 2024
1 parent 50b862b commit 252e840
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-hornets-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro-og-canvas": patch
---

Adds an explicit `Buffer` import for Deno compatibility
1 change: 1 addition & 0 deletions packages/astro-og-canvas/src/assetLoaders.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { FontMgr, CanvasKit } from 'canvaskit-wasm/full';
import fs from 'node:fs/promises';
import { createRequire } from 'node:module';
import { Buffer } from 'node:buffer';
import { shorthash } from './shorthash';
const { resolve } = createRequire(import.meta.url);

Expand Down
1 change: 1 addition & 0 deletions packages/astro-og-canvas/src/generateOpenGraphImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { deterministicString } from 'deterministic-object-hash';
import { decodeHTMLStrict } from 'entities';
import fs from 'node:fs/promises';
import path from 'node:path';
import { Buffer } from 'node:buffer';
import { getCanvasKit, fontManager, loadImage } from './assetLoaders';
import { shorthash } from './shorthash';
import type {
Expand Down

0 comments on commit 252e840

Please sign in to comment.