nuxt-og-image 3.0.0-beta.2 → 3.0.0-beta.21

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 (108) hide show
  1. package/dist/client/200.html +5 -5
  2. package/dist/client/404.html +5 -5
  3. package/dist/client/_nuxt/{IconCSS.5368a1a4.js → IconCSS.0fff2a4e.js} +1 -1
  4. package/dist/client/_nuxt/IconCSS.7e8f1f7b.css +1 -0
  5. package/dist/client/_nuxt/builds/latest.json +1 -1
  6. package/dist/client/_nuxt/builds/meta/067a31fa-8ddd-4061-85b5-6327dd434f4d.json +1 -0
  7. package/dist/client/_nuxt/entry.3a009184.css +1 -0
  8. package/dist/client/_nuxt/entry.3f6151e3.js +137 -0
  9. package/dist/client/_nuxt/{error-404.4a94a265.js → error-404.751c8eba.js} +1 -1
  10. package/dist/client/_nuxt/{error-500.70093e7d.js → error-500.bb72a49b.js} +1 -1
  11. package/dist/client/index.html +5 -5
  12. package/dist/module.d.mts +41 -24
  13. package/dist/module.d.ts +41 -24
  14. package/dist/module.json +2 -2
  15. package/dist/module.mjs +92 -75
  16. package/dist/runtime/cache.d.ts +7 -10
  17. package/dist/runtime/cache.mjs +38 -26
  18. package/dist/runtime/components/OgImage/OgImage.d.ts +5 -0
  19. package/dist/runtime/components/OgImage/{index.mjs → OgImage.mjs} +1 -1
  20. package/dist/runtime/components/OgImage/OgImageScreenshot.d.ts +5 -0
  21. package/dist/runtime/components/OgImage/{Screenshot.mjs → OgImageScreenshot.mjs} +1 -1
  22. package/dist/runtime/components/Templates/Official/SimpleBlog.vue +1 -0
  23. package/dist/runtime/composables/defineOgImage.d.ts +2 -23
  24. package/dist/runtime/composables/defineOgImage.mjs +32 -115
  25. package/dist/runtime/composables/defineOgImageComponent.d.ts +3 -0
  26. package/dist/runtime/composables/defineOgImageComponent.mjs +8 -0
  27. package/dist/runtime/composables/defineOgImageScreenshot.d.ts +2 -0
  28. package/dist/runtime/composables/defineOgImageScreenshot.mjs +14 -0
  29. package/dist/runtime/core/bindings/css-inline/node.d.ts +2 -5
  30. package/dist/runtime/core/bindings/css-inline/node.mjs +2 -10
  31. package/dist/runtime/core/bindings/resvg/wasm.mjs +2 -3
  32. package/dist/runtime/core/bindings/satori/wasm.mjs +7 -0
  33. package/dist/runtime/core/cache/emojis.d.ts +1 -0
  34. package/dist/runtime/core/cache/emojis.mjs +5 -0
  35. package/dist/runtime/core/cache/htmlPayload.d.ts +5 -0
  36. package/dist/runtime/core/cache/htmlPayload.mjs +6 -0
  37. package/dist/runtime/core/cache/prerender.d.ts +1 -1
  38. package/dist/runtime/core/font/fetch.d.ts +2 -3
  39. package/dist/runtime/core/font/fetch.mjs +10 -4
  40. package/dist/runtime/core/html/applyEmojis.d.ts +3 -0
  41. package/dist/runtime/core/html/applyEmojis.mjs +37 -0
  42. package/dist/runtime/core/html/applyInlineCss.d.ts +3 -0
  43. package/dist/runtime/core/html/applyInlineCss.mjs +32 -0
  44. package/dist/runtime/core/html/devIframeTemplate.d.ts +2 -0
  45. package/dist/runtime/core/html/{fetch.mjs → devIframeTemplate.mjs} +8 -31
  46. package/dist/runtime/core/html/fetchIsland.d.ts +3 -0
  47. package/dist/runtime/core/html/fetchIsland.mjs +17 -0
  48. package/dist/runtime/core/options/fetch.d.ts +1 -1
  49. package/dist/runtime/core/options/fetch.mjs +10 -5
  50. package/dist/runtime/core/options/normalise.d.ts +2 -2
  51. package/dist/runtime/core/renderers/chromium/index.mjs +6 -7
  52. package/dist/runtime/core/renderers/chromium/screenshot.d.ts +2 -3
  53. package/dist/runtime/core/renderers/chromium/screenshot.mjs +5 -4
  54. package/dist/runtime/core/renderers/satori/fonts.d.ts +2 -2
  55. package/dist/runtime/core/renderers/satori/fonts.mjs +2 -2
  56. package/dist/runtime/core/renderers/satori/index.d.ts +2 -3
  57. package/dist/runtime/core/renderers/satori/index.mjs +21 -18
  58. package/dist/runtime/core/renderers/satori/instances.d.ts +3 -0
  59. package/dist/runtime/core/renderers/satori/instances.mjs +15 -0
  60. package/dist/runtime/core/renderers/satori/plugins/emojis.mjs +15 -13
  61. package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +8 -4
  62. package/dist/runtime/core/renderers/satori/utils.d.ts +2 -3
  63. package/dist/runtime/core/renderers/satori/vnodes.d.ts +2 -3
  64. package/dist/runtime/core/renderers/satori/vnodes.mjs +14 -6
  65. package/dist/runtime/core/utils/resolveRendererContext.d.ts +2 -6
  66. package/dist/runtime/core/utils/resolveRendererContext.mjs +34 -21
  67. package/dist/runtime/core/utils/wasm.d.ts +1 -0
  68. package/dist/runtime/core/utils/wasm.mjs +9 -0
  69. package/dist/runtime/nitro/plugins/nuxt-content.mjs +2 -2
  70. package/dist/runtime/nitro/plugins/prerender.mjs +2 -2
  71. package/dist/runtime/nuxt/plugins/nuxt-content-canonical-urls.mjs +2 -2
  72. package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +14 -47
  73. package/dist/runtime/nuxt/utils.d.ts +2 -0
  74. package/dist/runtime/nuxt/utils.mjs +55 -0
  75. package/dist/runtime/server/routes/__og-image__/debug.json.d.ts +0 -2
  76. package/dist/runtime/server/routes/__og-image__/debug.json.mjs +2 -7
  77. package/dist/runtime/server/routes/__og-image__/image.mjs +86 -0
  78. package/dist/runtime/types.d.ts +57 -24
  79. package/dist/runtime/utils.d.ts +3 -0
  80. package/dist/runtime/utils.mjs +11 -0
  81. package/package.json +17 -28
  82. package/virtual.d.ts +49 -0
  83. package/dist/client/_nuxt/IconCSS.8f429b14.css +0 -1
  84. package/dist/client/_nuxt/builds/meta/9c7e316c-59c6-4fd5-966f-dfb7242ba3f3.json +0 -1
  85. package/dist/client/_nuxt/entry.434c2c45.css +0 -1
  86. package/dist/client/_nuxt/entry.60cb5216.js +0 -137
  87. package/dist/client/grid.png +0 -0
  88. package/dist/runtime/components/OgImage/Cached.d.ts +0 -5
  89. package/dist/runtime/components/OgImage/Cached.mjs +0 -10
  90. package/dist/runtime/components/OgImage/Dynamic.d.ts +0 -8
  91. package/dist/runtime/components/OgImage/Dynamic.mjs +0 -10
  92. package/dist/runtime/components/OgImage/Screenshot.d.ts +0 -6
  93. package/dist/runtime/components/OgImage/Static.d.ts +0 -8
  94. package/dist/runtime/components/OgImage/Static.mjs +0 -10
  95. package/dist/runtime/components/OgImage/WithoutCache.d.ts +0 -5
  96. package/dist/runtime/components/OgImage/WithoutCache.mjs +0 -10
  97. package/dist/runtime/components/OgImage/index.d.ts +0 -5
  98. package/dist/runtime/core/bindings/css-inline/mock.d.ts +0 -5
  99. package/dist/runtime/core/bindings/css-inline/mock.mjs +0 -3
  100. package/dist/runtime/core/bindings/satori/yoga-wasm.mjs +0 -7
  101. package/dist/runtime/core/bindings/sharp/wasm.d.ts +0 -2
  102. package/dist/runtime/core/bindings/sharp/wasm.mjs +0 -2
  103. package/dist/runtime/core/html/fetch.d.ts +0 -3
  104. package/dist/runtime/server/routes/__og-image__/image-[path]-og.[extension].mjs +0 -44
  105. package/dist/runtime/utilts.d.ts +0 -2
  106. package/dist/runtime/utilts.mjs +0 -8
  107. /package/dist/runtime/core/bindings/satori/{yoga-wasm.d.ts → wasm.d.ts} +0 -0
  108. /package/dist/runtime/server/routes/__og-image__/{image-[path]-og.[extension].d.ts → image.d.ts} +0 -0
@@ -1 +1 @@
1
- import{_ as a,u as n,o as r,c as l,a as e,t as s,b as d,w as c,d as p,e as f,p as x,f as h}from"./entry.60cb5216.js";const m=t=>(x("data-v-05a2b8a3"),t=t(),h(),t),u={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},g=m(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),b={class:"max-w-520px text-center z-20"},_=["textContent"],w=["textContent"],y={class:"w-full flex items-center justify-center"},S={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const o=t;return n({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(k,v)=>{const i=f;return r(),l("div",u,[g,e("div",b,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,_),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,w),e("div",y,[d(i,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[p(s(t.backHome),1)]),_:1})])])])}}},z=a(S,[["__scopeId","data-v-05a2b8a3"]]);export{z as default};
1
+ import{_ as a,u as n,o as r,c as l,a as e,t as s,b as d,w as c,d as p,e as f,p as x,f as h}from"./entry.3f6151e3.js";const m=t=>(x("data-v-05a2b8a3"),t=t(),h(),t),u={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},g=m(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),b={class:"max-w-520px text-center z-20"},_=["textContent"],w=["textContent"],y={class:"w-full flex items-center justify-center"},S={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const o=t;return n({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(k,v)=>{const i=f;return r(),l("div",u,[g,e("div",b,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,_),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,w),e("div",y,[d(i,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[p(s(t.backHome),1)]),_:1})])])])}}},z=a(S,[["__scopeId","data-v-05a2b8a3"]]);export{z as default};
@@ -1 +1 @@
1
- import{_ as i,u as a,o as r,c as n,a as e,t as s,p as l,f as d}from"./entry.60cb5216.js";const c=t=>(l("data-v-c967d9a9"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},h=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),f={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(u,b)=>(r(),n("div",p,[h,e("div",f,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},w=i(x,[["__scopeId","data-v-c967d9a9"]]);export{w as default};
1
+ import{_ as i,u as a,o as r,c as n,a as e,t as s,p as l,f as d}from"./entry.3f6151e3.js";const c=t=>(l("data-v-c967d9a9"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},h=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),f={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(u,b)=>(r(),n("div",p,[h,e("div",f,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},w=i(x,[["__scopeId","data-v-c967d9a9"]]);export{w as default};
@@ -2,13 +2,13 @@
2
2
  <html >
3
3
  <head><meta charset="utf-8">
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1">
5
- <link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.434c2c45.css">
6
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.60cb5216.js">
5
+ <link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.3a009184.css">
6
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.3f6151e3.js">
7
7
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-404.b751fa02.css">
8
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.4a94a265.js">
8
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.751c8eba.js">
9
9
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.69009e70.css">
10
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.70093e7d.js">
11
- <script type="module" src="/__nuxt-og-image/_nuxt/entry.60cb5216.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
10
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.bb72a49b.js">
11
+ <script type="module" src="/__nuxt-og-image/_nuxt/entry.3f6151e3.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
12
12
  </script></head>
13
13
  <body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
14
14
  <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
package/dist/module.d.mts CHANGED
@@ -2,7 +2,10 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { SatoriOptions } from 'satori';
3
3
  import { ResvgRenderOptions } from '@resvg/resvg-js';
4
4
  import { SharpOptions } from 'sharp';
5
+ import { OgImageComponents } from '#nuxt-og-image/components';
6
+ import { WasmOptions } from 'nitropack/types';
5
7
 
8
+ type IconifyEmojiIconSets = 'twemoji' | 'noto' | 'fluent-emoji' | 'fluent-emoji-flat' | 'fluent-emoji-high-contrast' | 'noto-v1' | 'emojione' | 'emojione-monotone' | 'emojione-v1' | 'streamline-emojis' | 'openmoji';
6
9
  interface OgImageComponent {
7
10
  path?: string;
8
11
  pascalName: string;
@@ -32,27 +35,48 @@ interface ScreenshotOptions {
32
35
  */
33
36
  delay?: number;
34
37
  }
35
- interface OgImageOptions extends Partial<ScreenshotOptions> {
36
- component?: string;
37
- renderer?: 'chromium' | 'satori';
38
- extension?: 'png' | 'jpeg' | 'jpg';
38
+ interface OgImageOptions<T extends keyof OgImageComponents = 'Fallback'> {
39
+ /**
40
+ * The width of the screenshot.
41
+ *
42
+ * @default 1200
43
+ */
44
+ width?: number;
39
45
  /**
40
- * @deprecated use renderer. Replace `browser` with `chromium`
46
+ * The height of the screenshot.
47
+ *
48
+ * @default 630
41
49
  */
42
- provider?: 'browser' | 'satori';
50
+ height?: number;
51
+ /**
52
+ * The alt text for the image.
53
+ */
54
+ alt?: string;
55
+ /**
56
+ * Use a prebuilt image instead of generating one.
57
+ *
58
+ * Should be an absolute URL.
59
+ */
60
+ url?: string;
61
+ /**
62
+ * The name of the component to render.
63
+ */
64
+ component?: T | string;
65
+ /**
66
+ * Props to pass to the component.
67
+ */
68
+ props?: OgImageComponents[T] | Record<string, any>;
69
+ renderer?: 'chromium' | 'satori';
70
+ extension?: 'png' | 'jpeg' | 'jpg';
71
+ emojis?: IconifyEmojiIconSets;
43
72
  /**
44
73
  * Provide a static HTML template to render the OG Image instead of a component.
45
74
  */
46
75
  html?: string;
47
- cache?: boolean;
48
- cacheKey?: string;
49
76
  resvg?: ResvgRenderOptions;
50
77
  satori?: SatoriOptions;
51
- /**
52
- * The time to live of the cache in milliseconds.
53
- */
54
- cacheTtl?: number;
55
- [key: string]: any;
78
+ screenshot?: Partial<ScreenshotOptions>;
79
+ cacheMaxAgeSeconds?: number;
56
80
  }
57
81
  interface FontConfig {
58
82
  name: string;
@@ -66,11 +90,10 @@ interface RuntimeCompatibilitySchema {
66
90
  chromium: 'node' | false;
67
91
  ['css-inline']: 'node' | false;
68
92
  resvg: 'node' | 'wasm' | false;
69
- satori: 'node' | 'yoga-wasm' | false;
70
- sharp: 'node' | 'lambda' | false;
93
+ satori: 'node' | 'wasm' | false;
94
+ sharp: 'node' | false;
71
95
  };
72
- wasmStrategy?: 'inline' | 'import' | 'fetch';
73
- wasmImportQuery?: string;
96
+ wasm?: WasmOptions;
74
97
  }
75
98
 
76
99
  interface ModuleOptions {
@@ -112,12 +135,6 @@ interface ModuleOptions {
112
135
  * @see https://sharp.pixelplumbing.com/api-constructor
113
136
  */
114
137
  sharpOptions?: Partial<SharpOptions>;
115
- /**
116
- * Should the playground at <path>/__og_image__ be enabled in development.
117
- *
118
- * @default true
119
- */
120
- playground: boolean;
121
138
  /**
122
139
  * Include Satori runtime.
123
140
  *
@@ -160,7 +177,7 @@ interface ModuleOptions {
160
177
  /**
161
178
  * Manually modify the deployment compatibility.
162
179
  */
163
- runtimeCompatibility?: Partial<RuntimeCompatibilitySchema>;
180
+ runtimeCompatibility?: RuntimeCompatibilitySchema;
164
181
  }
165
182
  interface ModuleHooks {
166
183
  'nuxt-og-image:components': (ctx: {
package/dist/module.d.ts CHANGED
@@ -2,7 +2,10 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { SatoriOptions } from 'satori';
3
3
  import { ResvgRenderOptions } from '@resvg/resvg-js';
4
4
  import { SharpOptions } from 'sharp';
5
+ import { OgImageComponents } from '#nuxt-og-image/components';
6
+ import { WasmOptions } from 'nitropack/types';
5
7
 
8
+ type IconifyEmojiIconSets = 'twemoji' | 'noto' | 'fluent-emoji' | 'fluent-emoji-flat' | 'fluent-emoji-high-contrast' | 'noto-v1' | 'emojione' | 'emojione-monotone' | 'emojione-v1' | 'streamline-emojis' | 'openmoji';
6
9
  interface OgImageComponent {
7
10
  path?: string;
8
11
  pascalName: string;
@@ -32,27 +35,48 @@ interface ScreenshotOptions {
32
35
  */
33
36
  delay?: number;
34
37
  }
35
- interface OgImageOptions extends Partial<ScreenshotOptions> {
36
- component?: string;
37
- renderer?: 'chromium' | 'satori';
38
- extension?: 'png' | 'jpeg' | 'jpg';
38
+ interface OgImageOptions<T extends keyof OgImageComponents = 'Fallback'> {
39
+ /**
40
+ * The width of the screenshot.
41
+ *
42
+ * @default 1200
43
+ */
44
+ width?: number;
39
45
  /**
40
- * @deprecated use renderer. Replace `browser` with `chromium`
46
+ * The height of the screenshot.
47
+ *
48
+ * @default 630
41
49
  */
42
- provider?: 'browser' | 'satori';
50
+ height?: number;
51
+ /**
52
+ * The alt text for the image.
53
+ */
54
+ alt?: string;
55
+ /**
56
+ * Use a prebuilt image instead of generating one.
57
+ *
58
+ * Should be an absolute URL.
59
+ */
60
+ url?: string;
61
+ /**
62
+ * The name of the component to render.
63
+ */
64
+ component?: T | string;
65
+ /**
66
+ * Props to pass to the component.
67
+ */
68
+ props?: OgImageComponents[T] | Record<string, any>;
69
+ renderer?: 'chromium' | 'satori';
70
+ extension?: 'png' | 'jpeg' | 'jpg';
71
+ emojis?: IconifyEmojiIconSets;
43
72
  /**
44
73
  * Provide a static HTML template to render the OG Image instead of a component.
45
74
  */
46
75
  html?: string;
47
- cache?: boolean;
48
- cacheKey?: string;
49
76
  resvg?: ResvgRenderOptions;
50
77
  satori?: SatoriOptions;
51
- /**
52
- * The time to live of the cache in milliseconds.
53
- */
54
- cacheTtl?: number;
55
- [key: string]: any;
78
+ screenshot?: Partial<ScreenshotOptions>;
79
+ cacheMaxAgeSeconds?: number;
56
80
  }
57
81
  interface FontConfig {
58
82
  name: string;
@@ -66,11 +90,10 @@ interface RuntimeCompatibilitySchema {
66
90
  chromium: 'node' | false;
67
91
  ['css-inline']: 'node' | false;
68
92
  resvg: 'node' | 'wasm' | false;
69
- satori: 'node' | 'yoga-wasm' | false;
70
- sharp: 'node' | 'lambda' | false;
93
+ satori: 'node' | 'wasm' | false;
94
+ sharp: 'node' | false;
71
95
  };
72
- wasmStrategy?: 'inline' | 'import' | 'fetch';
73
- wasmImportQuery?: string;
96
+ wasm?: WasmOptions;
74
97
  }
75
98
 
76
99
  interface ModuleOptions {
@@ -112,12 +135,6 @@ interface ModuleOptions {
112
135
  * @see https://sharp.pixelplumbing.com/api-constructor
113
136
  */
114
137
  sharpOptions?: Partial<SharpOptions>;
115
- /**
116
- * Should the playground at <path>/__og_image__ be enabled in development.
117
- *
118
- * @default true
119
- */
120
- playground: boolean;
121
138
  /**
122
139
  * Include Satori runtime.
123
140
  *
@@ -160,7 +177,7 @@ interface ModuleOptions {
160
177
  /**
161
178
  * Manually modify the deployment compatibility.
162
179
  */
163
- runtimeCompatibility?: Partial<RuntimeCompatibilitySchema>;
180
+ runtimeCompatibility?: RuntimeCompatibilitySchema;
164
181
  }
165
182
  interface ModuleHooks {
166
183
  'nuxt-og-image:components': (ctx: {
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "compatibility": {
4
- "nuxt": "^3.7.0",
4
+ "nuxt": "^3.8.2",
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "ogImage",
8
- "version": "3.0.0-beta.2"
8
+ "version": "3.0.0-beta.21"
9
9
  }
package/dist/module.mjs CHANGED
@@ -1,15 +1,17 @@
1
1
  import * as fs from 'node:fs';
2
2
  import { existsSync } from 'node:fs';
3
- import { useNuxt, createResolver, addTemplate, addServerPlugin, defineNuxtModule, useLogger, hasNuxtModule, addPlugin, addServerHandler, addImports, addComponentsDir, addComponent } from '@nuxt/kit';
3
+ import { useNuxt, createResolver, addTemplate, resolvePath, defineNuxtModule, useLogger, hasNuxtModule, addServerPlugin, addPlugin, addServerHandler, addImports, addComponentsDir, addComponent } from '@nuxt/kit';
4
4
  import { installNuxtSiteConfig } from 'nuxt-site-config-kit';
5
- import { provider, env } from 'std-env';
5
+ import { provider, env, isDevelopment } from 'std-env';
6
6
  import { hash } from 'ohash';
7
7
  import { relative } from 'pathe';
8
8
  import 'nypm';
9
9
  import { defu } from 'defu';
10
10
  import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
11
+ import { readFile, writeFile } from 'node:fs/promises';
12
+ import { createHash } from 'node:crypto';
11
13
 
12
- const version = "3.0.0-beta.2";
14
+ const version = "3.0.0-beta.21";
13
15
 
14
16
  const autodetectableProviders = {
15
17
  azure_static: "azure",
@@ -32,8 +34,7 @@ const NodeRuntime = {
32
34
  "resvg": "node",
33
35
  "satori": "node",
34
36
  "sharp": "node"
35
- },
36
- wasmStrategy: "import"
37
+ }
37
38
  };
38
39
  const cloudflare = {
39
40
  bindings: {
@@ -43,17 +44,18 @@ const cloudflare = {
43
44
  "satori": "node",
44
45
  "sharp": false
45
46
  },
46
- wasmStrategy: "import"
47
+ wasm: {
48
+ esmImport: true
49
+ }
47
50
  };
48
51
  const awsLambda = {
49
52
  bindings: {
50
53
  "chromium": false,
51
54
  "css-inline": "node",
52
- "resvg": "wasm",
55
+ "resvg": "node",
53
56
  "satori": "node",
54
57
  "sharp": "node"
55
- },
56
- wasmStrategy: "inline"
58
+ }
57
59
  };
58
60
  const RuntimeCompatibility = {
59
61
  "nitro-dev": NodeRuntime,
@@ -62,45 +64,41 @@ const RuntimeCompatibility = {
62
64
  "stackblitz": {
63
65
  bindings: {
64
66
  "chromium": false,
65
- "css-inline": "node",
67
+ "css-inline": false,
66
68
  "resvg": "wasm",
67
- "satori": "node",
68
- "sharp": "node"
69
- },
70
- wasmStrategy: "inline"
69
+ "satori": "wasm",
70
+ "sharp": false
71
+ }
71
72
  },
72
73
  "aws-lambda": awsLambda,
73
74
  "netlify": awsLambda,
74
75
  "netlify-edge": {
75
76
  bindings: {
76
77
  "chromium": false,
77
- "css-inline": "node",
78
+ "css-inline": false,
78
79
  "resvg": "wasm",
79
80
  "satori": "node",
80
- "sharp": "node"
81
+ "sharp": false
81
82
  },
82
- wasmStrategy: "inline"
83
- },
84
- "vercel": {
85
- bindings: {
86
- "chromium": false,
87
- "css-inline": "node",
88
- "resvg": "wasm",
89
- "satori": "node",
90
- "sharp": "node"
91
- },
92
- wasmStrategy: "inline"
83
+ wasm: {
84
+ rollup: {
85
+ targetEnv: "auto-inline"
86
+ }
87
+ }
93
88
  },
89
+ "vercel": awsLambda,
94
90
  "vercel-edge": {
95
91
  bindings: {
96
92
  "chromium": false,
97
- "css-inline": "node",
93
+ "css-inline": false,
98
94
  "resvg": "wasm",
99
95
  "satori": "node",
100
- "sharp": "node"
96
+ "sharp": false
101
97
  },
102
- wasmStrategy: "inline",
103
- wasmImportQuery: "?module"
98
+ wasm: {
99
+ // lowers workers kb size
100
+ esmImport: true
101
+ }
104
102
  },
105
103
  "cloudflare-pages": cloudflare,
106
104
  "cloudflare": cloudflare
@@ -141,12 +139,15 @@ function applyNitroPresetCompatibility(nitroConfig, options) {
141
139
  applyBinding("satori"),
142
140
  applyBinding("resvg"),
143
141
  applyBinding("sharp"),
142
+ applyBinding("css-inline"),
144
143
  nitroConfig.alias || {}
145
144
  );
146
- if (target.includes("cloudflare")) {
147
- nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
148
- nitroConfig.rollupConfig.output.inlineDynamicImports = true;
145
+ if (Object.values(compatibility.bindings).includes("wasm")) {
146
+ nitroConfig.experimental = nitroConfig.experimental || {};
147
+ nitroConfig.experimental.wasm = true;
149
148
  }
149
+ nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
150
+ nitroConfig.wasm = defu(compatibility.wasm, nitroConfig.wasm);
150
151
  return compatibility;
151
152
  }
152
153
 
@@ -251,12 +252,13 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
251
252
  }
252
253
 
253
254
  function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
254
- addServerPlugin(resolve("./runtime/nitro/plugins/prerender.ts"));
255
255
  nuxt.hooks.hook("nitro:init", async (nitro) => {
256
256
  nitro.hooks.hook("prerender:config", async (nitroConfig) => {
257
257
  nitroConfig.alias["#nuxt-og-image/renderers/satori"] = resolve("./runtime/core/renderers/satori");
258
258
  nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = resolve("./runtime/core/renderers/chromium");
259
259
  applyNitroPresetCompatibility(nitroConfig, { resolve });
260
+ nitroConfig.wasm = nitroConfig.wasm || {};
261
+ nitroConfig.wasm.esmImport = false;
260
262
  });
261
263
  });
262
264
  }
@@ -268,19 +270,37 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
268
270
  nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
269
271
  nitroConfig.alias["#nuxt-og-image/renderers/satori"] = config.runtimeSatori ? resolve("./runtime/core/renderers/satori") : "unenv/runtime/mock/empty";
270
272
  nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = config.runtimeBrowser ? resolve("./runtime/core/renderers/chromium") : "unenv/runtime/mock/empty";
271
- applyNitroPresetCompatibility(nitroConfig, { resolve });
273
+ applyNitroPresetCompatibility(nitroConfig, { resolve, compatibility: config.runtimeCompatibility });
272
274
  nitroConfig.alias.electron = "unenv/runtime/mock/proxy-cjs";
273
275
  nitroConfig.alias.bufferutil = "unenv/runtime/mock/proxy-cjs";
274
276
  nitroConfig.alias["utf-8-validate"] = "unenv/runtime/mock/proxy-cjs";
275
277
  nitroConfig.alias.queue = "unenv/runtime/mock/proxy-cjs";
276
278
  });
279
+ nuxt.hooks.hook("nitro:init", async (nitro) => {
280
+ nitro.hooks.hook("compiled", async (_nitro) => {
281
+ const target = resolveNitroPreset(_nitro.options);
282
+ const compatibility = getPresetNitroPresetCompatibility(target);
283
+ if (compatibility.wasm?.esmImport !== true)
284
+ return;
285
+ const configuredEntry = nitro.options.rollupConfig?.output.entryFileNames;
286
+ const serverEntry = resolve(_nitro.options.output.serverDir, typeof configuredEntry === "string" ? configuredEntry : "index.mjs");
287
+ const contents = await readFile(serverEntry, "utf-8");
288
+ const resvgHash = sha1(await readFile(await resolvePath("@resvg/resvg-wasm/index_bg.wasm")));
289
+ const yogaHash = sha1(await readFile(await resolvePath("yoga-wasm-web/dist/yoga.wasm")));
290
+ const postfix = target === "vercel-edge" ? "?module" : "";
291
+ await writeFile(serverEntry, contents.replaceAll('"@resvg/resvg-wasm/index_bg.wasm"', `"./wasm/index_bg-${resvgHash}.wasm${postfix}"`).replaceAll('"yoga-wasm-web/dist/yoga.wasm"', `"./wasm/yoga-${yogaHash}.wasm${postfix}"`), { encoding: "utf-8" });
292
+ });
293
+ });
294
+ }
295
+ function sha1(source) {
296
+ return createHash("sha1").update(source).digest("hex").slice(0, 16);
277
297
  }
278
298
 
279
299
  const module = defineNuxtModule({
280
300
  meta: {
281
301
  name: "nuxt-og-image",
282
302
  compatibility: {
283
- nuxt: "^3.7.0",
303
+ nuxt: "^3.8.2",
284
304
  bridge: false
285
305
  },
286
306
  configKey: "ogImage"
@@ -289,21 +309,20 @@ const module = defineNuxtModule({
289
309
  return {
290
310
  enabled: true,
291
311
  defaults: {
312
+ emojis: "noto",
292
313
  renderer: "satori",
293
314
  component: "Fallback",
294
315
  width: 1200,
295
316
  height: 600,
296
- cache: true,
297
317
  // default is to cache the image for 1 day (24 hours)
298
- cacheTtl: 24 * 60 * 60 * 1e3
318
+ cacheMaxAgeSeconds: 60 * 60 * 24 * 3
299
319
  },
300
320
  componentDirs: ["OgImage", "OgImageTemplate"],
301
- runtimeSatori: true,
302
- runtimeBrowser: nuxt.options.dev,
303
321
  fonts: [],
304
322
  runtimeCacheStorage: true,
305
- playground: env.NODE_ENV === "development" || nuxt.options.dev,
306
- debug: false
323
+ runtimeSatori: true,
324
+ runtimeBrowser: nuxt.options.dev,
325
+ debug: isDevelopment
307
326
  };
308
327
  },
309
328
  async setup(config, nuxt) {
@@ -320,9 +339,17 @@ const module = defineNuxtModule({
320
339
  const { resolve } = createResolver(import.meta.url);
321
340
  const preset = resolveNitroPreset(nuxt.options.nitro);
322
341
  const compatibility = getPresetNitroPresetCompatibility(preset);
323
- config.defaults.extension = "jpg";
324
- if (!compatibility.bindings.sharp)
342
+ const userConfiguredExtension = config.defaults.extension;
343
+ config.defaults.extension = userConfiguredExtension || "jpg";
344
+ if (!compatibility.bindings.sharp && config.defaults.renderer !== "chromium") {
345
+ if (userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension))
346
+ logger.warn("The sharp runtime is not available for this target, disabling sharp and using png instead.");
325
347
  config.defaults.extension = "png";
348
+ }
349
+ if (config.runtimeBrowser && !compatibility.bindings.chromium) {
350
+ logger.warn("The Chromium runtime is not available for this target, disabling runtimeBrowser.");
351
+ config.runtimeBrowser = false;
352
+ }
326
353
  await installNuxtSiteConfig();
327
354
  if (hasNuxtModule("@nuxt/content")) {
328
355
  addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
@@ -346,24 +373,13 @@ const module = defineNuxtModule({
346
373
  addServerHandler({
347
374
  lazy: true,
348
375
  route: "/__og-image__/image/**",
349
- handler: resolve("./runtime/server/routes/__og-image__/image-[path]-og.[extension]")
376
+ handler: resolve("./runtime/server/routes/__og-image__/image")
350
377
  });
351
378
  nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"] = [];
352
- [
353
- // deprecated
354
- "Dynamic",
355
- "Static",
356
- // new
357
- "index",
358
- "Cached",
359
- "Component",
360
- "WithoutCache",
361
- "Screenshot"
362
- ].forEach((name) => {
363
- name = name === "index" ? "defineOgImage" : `defineOgImage${name}`;
379
+ ["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name) => {
364
380
  addImports({
365
381
  name,
366
- from: resolve("./runtime/composables/defineOgImage")
382
+ from: resolve(`./runtime/composables/${name}`)
367
383
  });
368
384
  nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name);
369
385
  });
@@ -376,18 +392,12 @@ const module = defineNuxtModule({
376
392
  island: true
377
393
  });
378
394
  [
379
- // deprecated
380
- "Static",
381
- "Dynamic",
382
395
  // new
383
- "index",
384
- "Cached",
385
- "WithoutCache",
386
- "Screenshot"
396
+ "OgImage",
397
+ "OgImageScreenshot"
387
398
  ].forEach((name) => {
388
399
  addComponent({
389
- global: hasNuxtModule("@nuxt/content"),
390
- name: name === "index" ? "OgImage" : `OgImage${name}`,
400
+ name,
391
401
  filePath: resolve(`./runtime/components/OgImage/${name}`)
392
402
  });
393
403
  });
@@ -445,12 +455,13 @@ const module = defineNuxtModule({
445
455
  return `
446
456
  declare module 'nitropack' {
447
457
  interface NitroRouteRules {
448
- ogImage?: false | import('${typesPath}').OgImageOptions
458
+ ogImage?: false | import('${typesPath}').OgImageOptions & Record<string, any>
449
459
  }
450
460
  interface NitroRouteConfig {
451
- ogImage?: false | import('${typesPath}').OgImageOptions
461
+ ogImage?: false | import('${typesPath}').OgImageOptions & Record<string, any>
452
462
  }
453
463
  }
464
+
454
465
  declare module '#nuxt-og-image/components' {
455
466
  export interface OgImageComponents {
456
467
  ${componentImports}
@@ -458,6 +469,11 @@ ${componentImports}
458
469
  }
459
470
  `;
460
471
  });
472
+ const cacheEnabled = typeof config.runtimeCacheStorage !== "undefined" && config.runtimeCacheStorage !== false;
473
+ const runtimeCacheStorage = typeof config.runtimeCacheStorage === "boolean" ? "default" : config.runtimeCacheStorage.driver;
474
+ let baseCacheKey = runtimeCacheStorage === "default" ? `/cache/nuxt-og-image@${version}` : `/nuxt-og-image@${version}`;
475
+ if (!cacheEnabled)
476
+ baseCacheKey = false;
461
477
  nuxt.hooks.hook("modules:done", async () => {
462
478
  nuxt.hooks.callHook("og-image:config", config);
463
479
  const normalisedFonts = config.fonts.map((f) => {
@@ -488,15 +504,15 @@ ${componentImports}
488
504
  runtimeBrowser: config.runtimeBrowser,
489
505
  // @ts-expect-error runtime type
490
506
  defaults: config.defaults,
507
+ debug: config.debug,
491
508
  // avoid adding credentials
492
- runtimeCacheStorage: typeof config.runtimeCacheStorage === "boolean" ? "default" : config.runtimeCacheStorage.driver,
509
+ // @ts-expect-error runtime type
510
+ baseCacheKey,
493
511
  // convert the fonts to uniform type to fix ts issue
494
512
  fonts: normalisedFonts,
495
513
  hasNuxtIcon: hasNuxtModule("nuxt-icon")
496
514
  };
497
515
  });
498
- nuxt.options.nitro.experimental = nuxt.options.nitro.experimental || {};
499
- nuxt.options.nitro.experimental.wasm = true;
500
516
  if (nuxt.options.dev) {
501
517
  setupDevHandler(config, resolve);
502
518
  setupDevToolsUI(config, resolve);
@@ -505,8 +521,9 @@ ${componentImports}
505
521
  } else if (nuxt.options.build) {
506
522
  await setupBuildHandler(config, resolve);
507
523
  }
508
- if (nuxt.options.nitro.prerender?.routes || nuxt.options._generate)
509
- setupPrerenderHandler(config, resolve);
524
+ if (nuxt.options.nitro.prerender?.routes?.length || nuxt.options.nitro.prerender?.crawlLinks || nuxt.options._generate)
525
+ addServerPlugin(resolve("./runtime/nitro/plugins/prerender.ts"));
526
+ setupPrerenderHandler(config, resolve);
510
527
  }
511
528
  });
512
529
 
@@ -1,12 +1,9 @@
1
- import type { H3Event } from 'h3';
2
- export declare function useNitroCache<T>(e: H3Event, options: {
3
- key: string;
4
- cacheTtl: number;
5
- cache: boolean;
6
- headers: boolean;
7
- skipRestore?: boolean;
8
- }): Promise<{
9
- cachedItem: false | T;
1
+ import type { H3EventOgImageRender } from './core/utils/resolveRendererContext';
2
+ export declare function useOgImageBufferCache(ctx: H3EventOgImageRender, options: {
3
+ baseCacheKey: string | false;
4
+ cacheMaxAgeSeconds?: number;
5
+ }): Promise<void | {
6
+ cachedItem: false | BufferSource;
10
7
  enabled: boolean;
11
- update: (item: T) => Promise<void>;
8
+ update: (image: BufferSource) => Promise<void>;
12
9
  }>;