nuxt-og-image 6.7.8 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/chunks/tw4.mjs +2 -2
  2. package/dist/chunks/uno.mjs +4 -4
  3. package/dist/cli.mjs +1 -1
  4. package/dist/devtools/nuxt.config.ts +4 -1
  5. package/dist/module.d.mts +10 -0
  6. package/dist/module.d.ts +10 -0
  7. package/dist/module.json +1 -1
  8. package/dist/module.mjs +3 -3
  9. package/dist/runtime/app/client-utils.js +4 -3
  10. package/dist/runtime/app/utils.js +3 -2
  11. package/dist/runtime/server/nitro.d.ts +9 -0
  12. package/dist/runtime/server/nitro.js +10 -0
  13. package/dist/runtime/server/og-image/bindings/fetch/node.d.ts +2 -0
  14. package/dist/runtime/server/og-image/bindings/fetch/node.js +42 -0
  15. package/dist/runtime/server/og-image/bindings/fetch/web.d.ts +7 -0
  16. package/dist/runtime/server/og-image/bindings/fetch/web.js +3 -0
  17. package/dist/runtime/server/og-image/bindings/font-assets/external-url.d.ts +0 -11
  18. package/dist/runtime/server/og-image/bindings/font-assets/external-url.js +2 -19
  19. package/dist/runtime/server/og-image/bindings/satori/harfbuzz.d.ts +4 -0
  20. package/dist/runtime/server/og-image/bindings/satori/harfbuzz.js +33 -0
  21. package/dist/runtime/server/og-image/browser/screenshot.js +4 -1
  22. package/dist/runtime/server/og-image/context.js +9 -1
  23. package/dist/runtime/server/og-image/font-subsets.d.ts +3 -11
  24. package/dist/runtime/server/og-image/font-subsets.js +50 -27
  25. package/dist/runtime/server/og-image/fonts.d.ts +1 -1
  26. package/dist/runtime/server/routes/resolve.js +2 -2
  27. package/dist/runtime/server/util/cloudflare.js +2 -2
  28. package/dist/runtime/server/util/eventHandlers.js +3 -3
  29. package/dist/runtime/server/util/ssrf.d.ts +31 -0
  30. package/dist/runtime/server/util/ssrf.js +64 -5
  31. package/dist/runtime/server/utils.d.ts +1 -1
  32. package/dist/runtime/server/utils.js +3 -3
  33. package/dist/runtime/shared.d.ts +10 -1
  34. package/dist/runtime/shared.js +2 -2
  35. package/dist/runtime/types.d.ts +5 -1
  36. package/dist/shared/{nuxt-og-image.BMHzg1Vz.mjs → nuxt-og-image.CTD0ZPNd.mjs} +634 -468
  37. package/package.json +70 -66
  38. package/types/virtual.d.ts +26 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "6.7.8",
4
+ "version": "6.9.0",
5
5
  "description": "Enlightened OG Image generation for Nuxt.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",
@@ -53,15 +53,15 @@
53
53
  "@takumi-rs/core": "^1.0.0-beta.3 || ^2.0.0",
54
54
  "@takumi-rs/wasm": "^1.0.0-beta.3 || ^2.0.0",
55
55
  "@unhead/vue": "^2.0.5 || ^3.0.0",
56
- "@unocss/config": "^66.7.5",
57
- "@unocss/core": "^66.7.5",
58
- "fontless": "^0.2.0",
56
+ "@unocss/config": "^66.10.5",
57
+ "@unocss/core": "^66.10.5",
58
+ "fontless": "^0.2.0 || ^0.4.3 || ^1.0.0",
59
59
  "nitropack": "^2.13.4",
60
60
  "playwright-core": "^1.50.0",
61
- "satori": ">=0.19.2",
62
- "sharp": "^0.34.0",
61
+ "satori": ">=0.33.5",
62
+ "sharp": "^0.35.4",
63
63
  "tailwindcss": "^4.0.0",
64
- "unifont": "^0.7.0",
64
+ "unifont": "^0.7.0 || ^0.8.3",
65
65
  "unstorage": "^1.15.0",
66
66
  "zod": ">=3"
67
67
  },
@@ -110,56 +110,56 @@
110
110
  }
111
111
  },
112
112
  "dependencies": {
113
- "@clack/prompts": "^1.7.0",
113
+ "@clack/prompts": "^1.8.1",
114
114
  "@nuxt/kit": "^4.5.2",
115
- "@vue/compiler-sfc": "^3.5.41",
115
+ "@vue/compiler-sfc": "^3.5.43",
116
116
  "chrome-launcher": "^1.2.1",
117
117
  "consola": "^3.4.2",
118
118
  "defu": "^6.1.7",
119
- "devalue": "^5.9.0",
119
+ "devalue": "^5.9.2",
120
120
  "exsolve": "^1.1.1",
121
121
  "fnv1a-64": "^0.1.2",
122
122
  "lightningcss": "^1.33.0",
123
- "magic-string": "^1.1.0",
124
- "magicast": "^0.5.4",
123
+ "magic-string": "^1.4.1",
124
+ "magicast": "^0.5.5",
125
125
  "mocked-exports": "^0.1.1",
126
- "nuxt-site-config": "^4.2.0",
127
- "nuxtseo-shared": "^5.3.12",
128
- "nypm": "^0.6.9",
126
+ "nuxt-site-config": "^4.2.3",
127
+ "nuxtseo-shared": "^5.3.16",
128
+ "nypm": "^0.6.10",
129
129
  "object-identity": "^0.2.3",
130
130
  "ofetch": "^1.5.1",
131
- "ohash": "^2.0.11",
132
- "oxc-parser": "^0.143.0",
131
+ "ohash": "^2.0.12",
132
+ "oxc-parser": "^0.151.0",
133
133
  "oxc-walker": "^1.1.1",
134
134
  "pathe": "^2.0.3",
135
- "pkg-types": "^2.3.1",
135
+ "pkg-types": "^2.3.3",
136
136
  "radix3": "^1.1.2",
137
137
  "std-env": "^4.2.0",
138
138
  "strip-literal": "^4.0.0",
139
- "tinyexec": "^1.3.0",
139
+ "tinyexec": "^1.3.1",
140
140
  "ufo": "^1.6.4",
141
141
  "ultrahtml": "^1.7.0",
142
- "unplugin": "^3.3.0"
142
+ "unplugin": "^3.4.0"
143
143
  },
144
144
  "devDependencies": {
145
- "@antfu/eslint-config": "^9.3.0",
145
+ "@antfu/eslint-config": "^9.5.1",
146
146
  "@fontsource/noto-sans-sc": "^5.3.0",
147
- "@iconify-json/carbon": "^1.2.25",
148
- "@iconify-json/logos": "^1.2.12",
149
- "@iconify-json/noto": "^1.2.7",
147
+ "@iconify-json/carbon": "^1.2.27",
148
+ "@iconify-json/logos": "^1.2.14",
149
+ "@iconify-json/noto": "^1.2.8",
150
150
  "@iconify-json/ri": "^1.2.10",
151
- "@iconify-json/tabler": "^1.2.38",
151
+ "@iconify-json/tabler": "^1.2.39",
152
152
  "@iconify/types": "^2.0.0",
153
- "@img/sharp-linux-x64": "^0.35.3",
154
- "@nuxt/content": "^3.15.2",
155
- "@nuxt/devtools": "4.0.0-alpha.9",
156
- "@nuxt/devtools-kit": "4.0.0-alpha.9",
153
+ "@img/sharp-linux-x64": "^0.35.4",
154
+ "@nuxt/content": "^3.16.1",
155
+ "@nuxt/devtools": "4.0.0-beta.1",
156
+ "@nuxt/devtools-kit": "4.0.0-beta.1",
157
157
  "@nuxt/fonts": "^0.14.0",
158
- "@nuxt/icon": "^2.4.1",
158
+ "@nuxt/icon": "^2.5.1",
159
159
  "@nuxt/image": "^2.1.0",
160
160
  "@nuxt/module-builder": "^1.0.3",
161
- "@nuxt/test-utils": "^4.1.0",
162
- "@nuxt/ui": "^4.10.0",
161
+ "@nuxt/test-utils": "^4.3.2",
162
+ "@nuxt/ui": "^4.11.1",
163
163
  "@nuxtjs/color-mode": "^4.0.1",
164
164
  "@nuxtjs/eslint-config-typescript": "^12.1.0",
165
165
  "@nuxtjs/i18n": "^10.6.0",
@@ -167,53 +167,56 @@
167
167
  "@resvg/resvg-js": "^2.6.2",
168
168
  "@resvg/resvg-wasm": "^2.6.2",
169
169
  "@tailwindcss/vite": "^4.3.3",
170
- "@takumi-rs/core": "^2.5.11",
170
+ "@takumi-rs/core": "^2.14.0",
171
171
  "@takumi-rs/core-v1": "npm:@takumi-rs/core@1.8.7",
172
- "@takumi-rs/helpers": "^2.5.11",
172
+ "@takumi-rs/helpers": "^2.14.0",
173
173
  "@takumi-rs/helpers-v1": "npm:@takumi-rs/helpers@1.8.7",
174
- "@takumi-rs/wasm": "^2.5.11",
174
+ "@takumi-rs/wasm": "^2.14.0",
175
175
  "@takumi-rs/wasm-v1": "npm:@takumi-rs/wasm@1.8.7",
176
- "@unocss/config": "^66.7.5",
177
- "@unocss/core": "^66.7.5",
178
- "@unocss/nuxt": "^66.7.5",
179
- "@unocss/preset-icons": "^66.7.5",
180
- "@unocss/preset-wind": "^66.7.5",
181
- "@unocss/preset-wind4": "^66.7.5",
182
- "@vitejs/plugin-vue": "^6.0.8",
183
- "@vue/compiler-core": "^3.5.41",
184
- "@vueuse/nuxt": "^14.4.0",
185
- "birpc": "^4.0.0",
186
- "bumpp": "^12.2.0",
187
- "eslint": "^10.8.1",
188
- "eslint-plugin-harlanzw": "^0.17.1",
189
- "fontless": "^0.2.1",
190
- "globby": "^16.2.3",
191
- "happy-dom": "^20.11.2",
192
- "hookable": "^6.1.1",
176
+ "@unocss/config": "^66.10.5",
177
+ "@unocss/core": "^66.10.5",
178
+ "@unocss/nuxt": "^66.10.5",
179
+ "@unocss/preset-icons": "^66.10.5",
180
+ "@unocss/preset-wind": "^66.10.5",
181
+ "@unocss/preset-wind4": "^66.10.5",
182
+ "@vitejs/plugin-vue": "^6.0.9",
183
+ "@vue/compiler-core": "^3.5.43",
184
+ "@vueuse/nuxt": "^15.0.0",
185
+ "birpc": "^4.2.0",
186
+ "bumpp": "^12.3.0",
187
+ "eslint": "^10.11.0",
188
+ "eslint-plugin-harlanzw": "^0.22.0",
189
+ "fontless": "^1.0.0",
190
+ "fontless-v0-2": "npm:fontless@0.2.0",
191
+ "globby": "^16.2.4",
192
+ "happy-dom": "^20.14.5",
193
+ "hookable": "^6.1.2",
193
194
  "jest-image-snapshot": "^6.5.2",
194
195
  "lightningcss": "^1.33.0",
195
196
  "nitropack": "^2.13.4",
196
197
  "nuxt": "^4.5.2",
197
- "nuxtseo-layer-devtools": "^5.3.12",
198
- "playwright": "^1.62.1",
199
- "playwright-core": "^1.62.1",
200
- "sass": "^1.102.0",
201
- "satori": "^0.29.0",
202
- "sharp": "^0.35.3",
198
+ "nuxtseo-layer-devtools": "^5.3.16",
199
+ "playwright": "^1.63.0",
200
+ "playwright-core": "^1.63.0",
201
+ "sass": "^1.104.1",
202
+ "satori": "^0.33.5",
203
+ "sharp": "^0.35.4",
203
204
  "sirv": "^3.0.2",
204
205
  "tailwindcss": "^4.3.3",
205
206
  "typescript": "6.0.3",
206
207
  "unbuild": "^3.6.1",
207
- "unifont": "^0.7.4",
208
- "unocss": "^66.7.5",
209
- "vitest": "^4.1.10",
210
- "vue": "^3.5.41",
211
- "vue-tsc": "^3.3.9",
212
- "wrangler": "^4.120.0",
208
+ "unifont": "^0.8.3",
209
+ "unifont-v0-7": "npm:unifont@0.7.0",
210
+ "unocss": "^66.10.5",
211
+ "vitest": "^5.0.1",
212
+ "vue": "^3.5.43",
213
+ "vue-tsc": "^3.3.11",
214
+ "wrangler": "^4.136.1",
213
215
  "yoga-wasm-web": "^0.3.3",
214
- "zod": "^4.4.3"
216
+ "zod": "^4.6.5"
215
217
  },
216
218
  "scripts": {
219
+ "bench:edge-startup": "nuxt build bench/fixtures/edge-startup && node bench/edge-startup.mjs bench/fixtures/edge-startup/.netlify/edge-functions/server/server.js",
217
220
  "snapshots": "node --import jiti/register scripts/generate-template-snapshots.ts",
218
221
  "stub": "nuxt-build-module build --stub && nuxt-module-build prepare",
219
222
  "build": "pnpm stub && nuxt-module-build build && pnpm run build:client",
@@ -229,9 +232,10 @@
229
232
  "typecheck": "pnpm stub && nuxt typecheck",
230
233
  "test": "pnpm run prepare:fixtures && vitest",
231
234
  "test:run": "pnpm test -- --run && pnpm test:nuxt5",
232
- "test:nuxt5": "pnpm pack --out test/fixtures/nuxt5/nuxt-og-image.tgz && pnpm install --dir test/fixtures/nuxt5 --no-frozen-lockfile --force --update-checksums && pnpm --dir test/fixtures/nuxt5 test",
235
+ "test:nuxt5": "pnpm pack --out test/fixtures/nuxt5/nuxt-og-image.tgz && node -e \"require('node:fs').rmSync('test/fixtures/nuxt5/node_modules', { recursive: true, force: true })\" && pnpm install --dir test/fixtures/nuxt5 --no-frozen-lockfile --force --update-checksums && pnpm --dir test/fixtures/nuxt5 test",
233
236
  "test:chrome": "HAS_CHROME=true vitest",
234
237
  "test:packed-install": "node scripts/smoke-packed-install.mjs",
238
+ "test:peers": "node scripts/test-peer-compatibility.mjs",
235
239
  "test:takumi:e2e": "node scripts/test-takumi-e2e.mjs",
236
240
  "test:takumi:e2e:matrix": "node scripts/test-takumi-e2e.mjs --matrix",
237
241
  "test:takumi:e2e:compare": "node scripts/test-takumi-e2e.mjs --compare"
@@ -29,6 +29,14 @@ declare module '#og-image/renderers/browser' {
29
29
  export default renderer
30
30
  }
31
31
 
32
+ declare module '#og-image/bindings/fetch' {
33
+ export function guardedFetch(url: string, init: {
34
+ headers?: Record<string, string>
35
+ signal: AbortSignal
36
+ isBlockedAddress?: (address: string) => boolean
37
+ }): Promise<Response>
38
+ }
39
+
32
40
  declare module '#og-image/bindings/satori' {
33
41
  const satori: typeof import('satori').satori
34
42
  export default satori
@@ -107,3 +115,21 @@ declare module '#og-image-cache' {
107
115
 
108
116
  export const emojiCache: Storage<string>
109
117
  }
118
+
119
+ declare module '#og-image/harfbuzz-factory' {
120
+ const createHarfBuzz: (options: {
121
+ convertJsFunctionToWasm?: (callback: WebAssembly.ImportValue, signature: string) => WebAssembly.ExportValue
122
+ instantiateWasm: (imports: WebAssembly.Imports, receiveInstance: (instance: WebAssembly.Instance) => void) => object
123
+ }) => Promise<unknown>
124
+ export default createHarfBuzz
125
+ }
126
+
127
+ declare module '#og-image/harfbuzz-adapter' {
128
+ const wrapHarfBuzz: (instance: unknown) => unknown
129
+ export default wrapHarfBuzz
130
+ }
131
+
132
+ declare module '#og-image/harfbuzz-callbacks' {
133
+ const callbacks: Record<string, WebAssembly.Module | Promise<WebAssembly.Module>> | undefined
134
+ export default callbacks
135
+ }