nuxt-og-image 3.0.0-beta.1 → 3.0.0-beta.12
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.
- package/dist/client/200.html +4 -4
- package/dist/client/404.html +4 -4
- package/dist/client/_nuxt/{IconCSS.ac398b56.js → IconCSS.3f011790.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/f929037e-e674-4060-8070-9dfb30335a28.json +1 -0
- package/dist/client/_nuxt/{entry.bdb8a8d5.js → entry.6c0001e5.js} +3 -3
- package/dist/client/_nuxt/{error-404.f37119e7.js → error-404.0d8fb510.js} +1 -1
- package/dist/client/_nuxt/{error-500.74b0a30f.js → error-500.cefac4a7.js} +1 -1
- package/dist/client/index.html +4 -4
- package/dist/module.d.mts +5 -5
- package/dist/module.d.ts +5 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +33 -34
- package/dist/runtime/core/bindings/resvg/wasm.mjs +2 -3
- package/dist/runtime/core/bindings/satori/wasm.mjs +7 -0
- package/dist/runtime/core/renderers/chromium/screenshot.mjs +1 -0
- package/dist/runtime/core/utils/wasm.d.ts +1 -0
- package/dist/runtime/core/utils/wasm.mjs +6 -0
- package/dist/runtime/server/routes/__og-image__/image-[path]-og.[extension].mjs +1 -0
- package/package.json +5 -1
- package/dist/client/_nuxt/builds/meta/d1d517c3-4927-4803-bbb0-d94e9d3e9581.json +0 -1
- package/dist/runtime/core/bindings/satori/yoga-wasm.mjs +0 -7
- package/dist/runtime/core/bindings/sharp/wasm.d.ts +0 -2
- package/dist/runtime/core/bindings/sharp/wasm.mjs +0 -2
- /package/dist/runtime/core/bindings/satori/{yoga-wasm.d.ts → wasm.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.
|
|
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.6c0001e5.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.
|
|
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.6c0001e5.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};
|
package/dist/client/index.html
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
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.
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.6c0001e5.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.
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.0d8fb510.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.
|
|
11
|
-
<script type="module" src="/__nuxt-og-image/_nuxt/entry.
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.cefac4a7.js">
|
|
11
|
+
<script type="module" src="/__nuxt-og-image/_nuxt/entry.6c0001e5.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,6 +2,7 @@ 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 { WasmOptions } from 'nitropack/types';
|
|
5
6
|
|
|
6
7
|
interface OgImageComponent {
|
|
7
8
|
path?: string;
|
|
@@ -66,11 +67,10 @@ interface RuntimeCompatibilitySchema {
|
|
|
66
67
|
chromium: 'node' | false;
|
|
67
68
|
['css-inline']: 'node' | false;
|
|
68
69
|
resvg: 'node' | 'wasm' | false;
|
|
69
|
-
satori: 'node' | '
|
|
70
|
-
sharp: 'node' |
|
|
70
|
+
satori: 'node' | 'wasm' | false;
|
|
71
|
+
sharp: 'node' | false;
|
|
71
72
|
};
|
|
72
|
-
|
|
73
|
-
wasmImportQuery?: string;
|
|
73
|
+
wasm?: WasmOptions;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
interface ModuleOptions {
|
|
@@ -160,7 +160,7 @@ interface ModuleOptions {
|
|
|
160
160
|
/**
|
|
161
161
|
* Manually modify the deployment compatibility.
|
|
162
162
|
*/
|
|
163
|
-
runtimeCompatibility?:
|
|
163
|
+
runtimeCompatibility?: RuntimeCompatibilitySchema;
|
|
164
164
|
}
|
|
165
165
|
interface ModuleHooks {
|
|
166
166
|
'nuxt-og-image:components': (ctx: {
|
package/dist/module.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ 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 { WasmOptions } from 'nitropack/types';
|
|
5
6
|
|
|
6
7
|
interface OgImageComponent {
|
|
7
8
|
path?: string;
|
|
@@ -66,11 +67,10 @@ interface RuntimeCompatibilitySchema {
|
|
|
66
67
|
chromium: 'node' | false;
|
|
67
68
|
['css-inline']: 'node' | false;
|
|
68
69
|
resvg: 'node' | 'wasm' | false;
|
|
69
|
-
satori: 'node' | '
|
|
70
|
-
sharp: 'node' |
|
|
70
|
+
satori: 'node' | 'wasm' | false;
|
|
71
|
+
sharp: 'node' | false;
|
|
71
72
|
};
|
|
72
|
-
|
|
73
|
-
wasmImportQuery?: string;
|
|
73
|
+
wasm?: WasmOptions;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
interface ModuleOptions {
|
|
@@ -160,7 +160,7 @@ interface ModuleOptions {
|
|
|
160
160
|
/**
|
|
161
161
|
* Manually modify the deployment compatibility.
|
|
162
162
|
*/
|
|
163
|
-
runtimeCompatibility?:
|
|
163
|
+
runtimeCompatibility?: RuntimeCompatibilitySchema;
|
|
164
164
|
}
|
|
165
165
|
interface ModuleHooks {
|
|
166
166
|
'nuxt-og-image:components': (ctx: {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import { useNuxt, createResolver, addTemplate,
|
|
3
|
+
import { useNuxt, createResolver, addTemplate, defineNuxtModule, useLogger, hasNuxtModule, addServerPlugin, addPlugin, addServerHandler, addImports, addComponentsDir, addComponent } from '@nuxt/kit';
|
|
4
4
|
import { installNuxtSiteConfig } from 'nuxt-site-config-kit';
|
|
5
5
|
import { provider, env } from 'std-env';
|
|
6
6
|
import { hash } from 'ohash';
|
|
@@ -9,7 +9,7 @@ import 'nypm';
|
|
|
9
9
|
import { defu } from 'defu';
|
|
10
10
|
import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
11
11
|
|
|
12
|
-
const version = "3.0.0-beta.
|
|
12
|
+
const version = "3.0.0-beta.12";
|
|
13
13
|
|
|
14
14
|
const autodetectableProviders = {
|
|
15
15
|
azure_static: "azure",
|
|
@@ -32,8 +32,7 @@ const NodeRuntime = {
|
|
|
32
32
|
"resvg": "node",
|
|
33
33
|
"satori": "node",
|
|
34
34
|
"sharp": "node"
|
|
35
|
-
}
|
|
36
|
-
wasmStrategy: "import"
|
|
35
|
+
}
|
|
37
36
|
};
|
|
38
37
|
const cloudflare = {
|
|
39
38
|
bindings: {
|
|
@@ -42,18 +41,17 @@ const cloudflare = {
|
|
|
42
41
|
"resvg": "wasm",
|
|
43
42
|
"satori": "node",
|
|
44
43
|
"sharp": false
|
|
45
|
-
}
|
|
46
|
-
|
|
44
|
+
}
|
|
45
|
+
// nitro configures wasm
|
|
47
46
|
};
|
|
48
47
|
const awsLambda = {
|
|
49
48
|
bindings: {
|
|
50
49
|
"chromium": false,
|
|
51
50
|
"css-inline": "node",
|
|
52
|
-
"resvg": "
|
|
51
|
+
"resvg": "node",
|
|
53
52
|
"satori": "node",
|
|
54
53
|
"sharp": "node"
|
|
55
|
-
}
|
|
56
|
-
wasmStrategy: "inline"
|
|
54
|
+
}
|
|
57
55
|
};
|
|
58
56
|
const RuntimeCompatibility = {
|
|
59
57
|
"nitro-dev": NodeRuntime,
|
|
@@ -66,8 +64,7 @@ const RuntimeCompatibility = {
|
|
|
66
64
|
"resvg": "wasm",
|
|
67
65
|
"satori": "node",
|
|
68
66
|
"sharp": "node"
|
|
69
|
-
}
|
|
70
|
-
wasmStrategy: "inline"
|
|
67
|
+
}
|
|
71
68
|
},
|
|
72
69
|
"aws-lambda": awsLambda,
|
|
73
70
|
"netlify": awsLambda,
|
|
@@ -77,20 +74,15 @@ const RuntimeCompatibility = {
|
|
|
77
74
|
"css-inline": "node",
|
|
78
75
|
"resvg": "wasm",
|
|
79
76
|
"satori": "node",
|
|
80
|
-
"sharp":
|
|
81
|
-
},
|
|
82
|
-
wasmStrategy: "inline"
|
|
83
|
-
},
|
|
84
|
-
"vercel": {
|
|
85
|
-
bindings: {
|
|
86
|
-
"chromium": false,
|
|
87
|
-
"css-inline": "node",
|
|
88
|
-
"resvg": "wasm",
|
|
89
|
-
"satori": "node",
|
|
90
|
-
"sharp": "node"
|
|
77
|
+
"sharp": false
|
|
91
78
|
},
|
|
92
|
-
|
|
79
|
+
wasm: {
|
|
80
|
+
rollup: {
|
|
81
|
+
targetEnv: "auto-inline"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
93
84
|
},
|
|
85
|
+
"vercel": awsLambda,
|
|
94
86
|
"vercel-edge": {
|
|
95
87
|
bindings: {
|
|
96
88
|
"chromium": false,
|
|
@@ -99,8 +91,13 @@ const RuntimeCompatibility = {
|
|
|
99
91
|
"satori": "node",
|
|
100
92
|
"sharp": "node"
|
|
101
93
|
},
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
// requires vercel pro
|
|
95
|
+
// TODO support importing
|
|
96
|
+
wasm: {
|
|
97
|
+
rollup: {
|
|
98
|
+
targetEnv: "auto-inline"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
104
101
|
},
|
|
105
102
|
"cloudflare-pages": cloudflare,
|
|
106
103
|
"cloudflare": cloudflare
|
|
@@ -143,10 +140,12 @@ function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
143
140
|
applyBinding("sharp"),
|
|
144
141
|
nitroConfig.alias || {}
|
|
145
142
|
);
|
|
146
|
-
if (
|
|
147
|
-
nitroConfig.
|
|
148
|
-
nitroConfig.
|
|
143
|
+
if (Object.values(compatibility.bindings).includes("wasm")) {
|
|
144
|
+
nitroConfig.experimental = nitroConfig.experimental || {};
|
|
145
|
+
nitroConfig.experimental.wasm = true;
|
|
149
146
|
}
|
|
147
|
+
nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
|
|
148
|
+
nitroConfig.wasm = defu(compatibility.wasm || {}, nitroConfig.wasm);
|
|
150
149
|
return compatibility;
|
|
151
150
|
}
|
|
152
151
|
|
|
@@ -251,12 +250,13 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
251
250
|
}
|
|
252
251
|
|
|
253
252
|
function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
254
|
-
addServerPlugin(resolve("./runtime/nitro/plugins/prerender.ts"));
|
|
255
253
|
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
256
254
|
nitro.hooks.hook("prerender:config", async (nitroConfig) => {
|
|
257
255
|
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = resolve("./runtime/core/renderers/satori");
|
|
258
256
|
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = resolve("./runtime/core/renderers/chromium");
|
|
259
257
|
applyNitroPresetCompatibility(nitroConfig, { resolve });
|
|
258
|
+
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
259
|
+
nitroConfig.wasm.esmImport = false;
|
|
260
260
|
});
|
|
261
261
|
});
|
|
262
262
|
}
|
|
@@ -268,7 +268,7 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
|
268
268
|
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
269
269
|
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = config.runtimeSatori ? resolve("./runtime/core/renderers/satori") : "unenv/runtime/mock/empty";
|
|
270
270
|
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = config.runtimeBrowser ? resolve("./runtime/core/renderers/chromium") : "unenv/runtime/mock/empty";
|
|
271
|
-
applyNitroPresetCompatibility(nitroConfig, { resolve });
|
|
271
|
+
applyNitroPresetCompatibility(nitroConfig, { resolve, compatibility: config.runtimeCompatibility });
|
|
272
272
|
nitroConfig.alias.electron = "unenv/runtime/mock/proxy-cjs";
|
|
273
273
|
nitroConfig.alias.bufferutil = "unenv/runtime/mock/proxy-cjs";
|
|
274
274
|
nitroConfig.alias["utf-8-validate"] = "unenv/runtime/mock/proxy-cjs";
|
|
@@ -495,8 +495,6 @@ ${componentImports}
|
|
|
495
495
|
hasNuxtIcon: hasNuxtModule("nuxt-icon")
|
|
496
496
|
};
|
|
497
497
|
});
|
|
498
|
-
nuxt.options.nitro.experimental = nuxt.options.nitro.experimental || {};
|
|
499
|
-
nuxt.options.nitro.experimental.wasm = true;
|
|
500
498
|
if (nuxt.options.dev) {
|
|
501
499
|
setupDevHandler(config, resolve);
|
|
502
500
|
setupDevToolsUI(config, resolve);
|
|
@@ -505,8 +503,9 @@ ${componentImports}
|
|
|
505
503
|
} else if (nuxt.options.build) {
|
|
506
504
|
await setupBuildHandler(config, resolve);
|
|
507
505
|
}
|
|
508
|
-
if (nuxt.options.nitro.prerender?.routes || nuxt.options._generate)
|
|
509
|
-
|
|
506
|
+
if (nuxt.options.nitro.prerender?.routes?.length || nuxt.options.nitro.prerender?.crawlLinks || nuxt.options._generate)
|
|
507
|
+
addServerPlugin(resolve("./runtime/nitro/plugins/prerender.ts"));
|
|
508
|
+
setupPrerenderHandler(config, resolve);
|
|
510
509
|
}
|
|
511
510
|
});
|
|
512
511
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Resvg as _Resvg, initWasm } from "@resvg/resvg-wasm";
|
|
2
|
-
import
|
|
2
|
+
import { importWasm } from "../../utils/wasm.mjs";
|
|
3
3
|
export default {
|
|
4
|
-
initWasmPromise: initWasm(
|
|
5
|
-
}),
|
|
4
|
+
initWasmPromise: initWasm(importWasm(import("@resvg/resvg-wasm/index_bg.wasm"))),
|
|
6
5
|
Resvg: _Resvg
|
|
7
6
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _satori, { init } from "satori/wasm";
|
|
2
|
+
import initYoga from "yoga-wasm-web";
|
|
3
|
+
import { importWasm } from "../../utils/wasm.mjs";
|
|
4
|
+
export default {
|
|
5
|
+
initWasmPromise: initYoga(importWasm(import("yoga-wasm-web/dist/yoga.wasm"))).then((yoga) => init(yoga)),
|
|
6
|
+
satori: _satori
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function importWasm(input: any): Promise<any>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export async function importWasm(input) {
|
|
2
|
+
const _input = await input;
|
|
3
|
+
const _module = _input.default || _input;
|
|
4
|
+
const _instance = typeof _module === "function" ? await _module({}).then((r) => r.instance || r) : await WebAssembly.instantiate(_module, {});
|
|
5
|
+
return _instance.exports;
|
|
6
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { H3Error, createError, defineEventHandler, setHeader } from "h3";
|
|
2
2
|
import { resolveRendererContext } from "../../../core/utils/resolveRendererContext.mjs";
|
|
3
3
|
import { fetchHTML } from "../../../core/html/fetch.mjs";
|
|
4
|
+
import { useSiteConfig } from "#imports";
|
|
4
5
|
export default defineEventHandler(async (e) => {
|
|
5
6
|
const ctx = await resolveRendererContext(e);
|
|
6
7
|
if (ctx instanceof H3Error)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-og-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.12",
|
|
5
5
|
"packageManager": "pnpm@8.11.0",
|
|
6
6
|
"description": "Enlightened OG Image generation for Nuxt.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
+
"resolutions": {
|
|
30
|
+
"nitropack": "npm:nitropack-nightly@2.8.1-28352923.b53e001"
|
|
31
|
+
},
|
|
29
32
|
"dependencies": {
|
|
30
33
|
"@img/sharp-libvips-dev": "^1.0.0",
|
|
31
34
|
"@img/sharp-wasm32": "0.33.0-rc.2",
|
|
@@ -71,6 +74,7 @@
|
|
|
71
74
|
"yoga-wasm-web": "^0.3.3"
|
|
72
75
|
},
|
|
73
76
|
"devDependencies": {
|
|
77
|
+
"nitropack": "npm:nitropack-nightly@2.8.1-28352923.b53e001",
|
|
74
78
|
"@antfu/eslint-config": "2.1.1",
|
|
75
79
|
"@img/sharp-linux-x64": "0.33.0-rc.2",
|
|
76
80
|
"@nuxt/content": "^2.9.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"d1d517c3-4927-4803-bbb0-d94e9d3e9581","timestamp":1701164186280,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
File without changes
|