nuxt-og-image 3.0.0-beta.0 → 3.0.0-beta.10
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.2211d324.js → IconCSS.389cad49.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3185e4a0-6b15-4476-b2f3-85ef31d35fc6.json +1 -0
- package/dist/client/_nuxt/{entry.e6eb9476.js → entry.e62f04d6.js} +3 -3
- package/dist/client/_nuxt/{error-404.cd9bab3b.js → error-404.91508473.js} +1 -1
- package/dist/client/_nuxt/{error-500.6f73f34f.js → error-500.b66f3aae.js} +1 -1
- package/dist/client/index.html +4 -4
- package/dist/module.d.mts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +20 -23
- package/dist/runtime/components/Templates/Official/Fallback.vue +3 -3
- package/dist/runtime/core/bindings/resvg/wasm.mjs +5 -3
- package/dist/runtime/core/font/fetch.mjs +2 -2
- package/dist/runtime/core/options/fetch.mjs +0 -12
- package/dist/runtime/core/renderers/chromium/screenshot.mjs +1 -0
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +1 -0
- package/dist/runtime/core/utils/resolveRendererContext.mjs +1 -1
- package/dist/runtime/nitro/plugins/prerender.d.ts +1 -1
- package/dist/runtime/nitro/plugins/prerender.mjs +1 -0
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +1 -1
- 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/f5ab7749-50de-4d6e-a4e4-00f34f3fe2c6.json +0 -1
|
@@ -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.e62f04d6.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.e62f04d6.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.e62f04d6.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.91508473.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.b66f3aae.js">
|
|
11
|
+
<script type="module" src="/__nuxt-og-image/_nuxt/entry.e62f04d6.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
|
@@ -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
|
@@ -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.10";
|
|
13
13
|
|
|
14
14
|
const autodetectableProviders = {
|
|
15
15
|
azure_static: "azure",
|
|
@@ -49,7 +49,7 @@ const awsLambda = {
|
|
|
49
49
|
bindings: {
|
|
50
50
|
"chromium": false,
|
|
51
51
|
"css-inline": "node",
|
|
52
|
-
"resvg": "
|
|
52
|
+
"resvg": "node",
|
|
53
53
|
"satori": "node",
|
|
54
54
|
"sharp": "node"
|
|
55
55
|
},
|
|
@@ -77,20 +77,11 @@ const RuntimeCompatibility = {
|
|
|
77
77
|
"css-inline": "node",
|
|
78
78
|
"resvg": "wasm",
|
|
79
79
|
"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"
|
|
80
|
+
"sharp": false
|
|
91
81
|
},
|
|
92
82
|
wasmStrategy: "inline"
|
|
93
83
|
},
|
|
84
|
+
"vercel": awsLambda,
|
|
94
85
|
"vercel-edge": {
|
|
95
86
|
bindings: {
|
|
96
87
|
"chromium": false,
|
|
@@ -143,9 +134,15 @@ function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
143
134
|
applyBinding("sharp"),
|
|
144
135
|
nitroConfig.alias || {}
|
|
145
136
|
);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
nitroConfig.
|
|
137
|
+
nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
|
|
138
|
+
if (target === "netlify-edge") {
|
|
139
|
+
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
140
|
+
nitroConfig.wasm.rollup = nitroConfig.wasm.rollup || {};
|
|
141
|
+
nitroConfig.wasm.rollup.targetEnv = "auto-inline";
|
|
142
|
+
}
|
|
143
|
+
if (target.includes("edge") || target.includes("cloudflare")) {
|
|
144
|
+
nitroConfig.experimental = nitroConfig.experimental || {};
|
|
145
|
+
nitroConfig.experimental.wasm = true;
|
|
149
146
|
}
|
|
150
147
|
return compatibility;
|
|
151
148
|
}
|
|
@@ -251,12 +248,13 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
251
248
|
}
|
|
252
249
|
|
|
253
250
|
function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
254
|
-
addServerPlugin(resolve("./runtime/nitro/plugins/prerender.ts"));
|
|
255
251
|
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
256
252
|
nitro.hooks.hook("prerender:config", async (nitroConfig) => {
|
|
257
253
|
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = resolve("./runtime/core/renderers/satori");
|
|
258
254
|
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = resolve("./runtime/core/renderers/chromium");
|
|
259
255
|
applyNitroPresetCompatibility(nitroConfig, { resolve });
|
|
256
|
+
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
257
|
+
nitroConfig.wasm.esmImport = false;
|
|
260
258
|
});
|
|
261
259
|
});
|
|
262
260
|
}
|
|
@@ -268,7 +266,7 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
|
268
266
|
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
269
267
|
nitroConfig.alias["#nuxt-og-image/renderers/satori"] = config.runtimeSatori ? resolve("./runtime/core/renderers/satori") : "unenv/runtime/mock/empty";
|
|
270
268
|
nitroConfig.alias["#nuxt-og-image/renderers/chromium"] = config.runtimeBrowser ? resolve("./runtime/core/renderers/chromium") : "unenv/runtime/mock/empty";
|
|
271
|
-
applyNitroPresetCompatibility(nitroConfig, { resolve });
|
|
269
|
+
applyNitroPresetCompatibility(nitroConfig, { resolve, compatibility: config.runtimeCompatibility });
|
|
272
270
|
nitroConfig.alias.electron = "unenv/runtime/mock/proxy-cjs";
|
|
273
271
|
nitroConfig.alias.bufferutil = "unenv/runtime/mock/proxy-cjs";
|
|
274
272
|
nitroConfig.alias["utf-8-validate"] = "unenv/runtime/mock/proxy-cjs";
|
|
@@ -495,8 +493,6 @@ ${componentImports}
|
|
|
495
493
|
hasNuxtIcon: hasNuxtModule("nuxt-icon")
|
|
496
494
|
};
|
|
497
495
|
});
|
|
498
|
-
nuxt.options.nitro.experimental = nuxt.options.nitro.experimental || {};
|
|
499
|
-
nuxt.options.nitro.experimental.wasm = true;
|
|
500
496
|
if (nuxt.options.dev) {
|
|
501
497
|
setupDevHandler(config, resolve);
|
|
502
498
|
setupDevToolsUI(config, resolve);
|
|
@@ -505,8 +501,9 @@ ${componentImports}
|
|
|
505
501
|
} else if (nuxt.options.build) {
|
|
506
502
|
await setupBuildHandler(config, resolve);
|
|
507
503
|
}
|
|
508
|
-
if (nuxt.options.nitro.prerender?.routes || nuxt.options._generate)
|
|
509
|
-
|
|
504
|
+
if (nuxt.options.nitro.prerender?.routes?.length || nuxt.options.nitro.prerender?.crawlLinks || nuxt.options._generate)
|
|
505
|
+
addServerPlugin(resolve("./runtime/nitro/plugins/prerender.ts"));
|
|
506
|
+
setupPrerenderHandler(config, resolve);
|
|
510
507
|
}
|
|
511
508
|
});
|
|
512
509
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, defineComponent, resolveComponent } from 'vue'
|
|
3
|
-
import { useSiteConfig } from '#imports'
|
|
2
|
+
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
3
|
+
import { useRuntimeConfig, useSiteConfig } from '#imports'
|
|
4
4
|
|
|
5
5
|
// inherited attrs can mess up the satori parser
|
|
6
6
|
defineOptions({
|
|
@@ -104,7 +104,7 @@ const IconComponent = runtimeConfig.hasNuxtIcon
|
|
|
104
104
|
? resolveComponent('Icon')
|
|
105
105
|
: defineComponent({
|
|
106
106
|
render() {
|
|
107
|
-
return h('div',
|
|
107
|
+
return h('div', 'missing nuxt-icon')
|
|
108
108
|
},
|
|
109
109
|
})
|
|
110
110
|
if (typeof props.icon === 'string' && !runtimeConfig.hasNuxtIcon && process.dev) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Resvg as _Resvg, initWasm } from "@resvg/resvg-wasm";
|
|
2
|
-
import ReSVGWasm from "@resvg/resvg-wasm/index_bg.wasm";
|
|
3
2
|
export default {
|
|
4
|
-
initWasmPromise: initWasm(
|
|
5
|
-
|
|
3
|
+
initWasmPromise: initWasm(import("@resvg/resvg-wasm/index_bg.wasm").then((m) => {
|
|
4
|
+
let mod = m.default;
|
|
5
|
+
mod = typeof mod === "function" ? mod() : mod;
|
|
6
|
+
return "instance" in mod ? mod.instance : mod;
|
|
7
|
+
})),
|
|
6
8
|
Resvg: _Resvg
|
|
7
9
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import { base64ToArrayBuffer } from "../env/assets.mjs";
|
|
3
3
|
import { fontCache } from "./cache.mjs";
|
|
4
|
-
import { useStorage } from "#imports";
|
|
4
|
+
import { useNitroOrigin, useStorage } from "#imports";
|
|
5
5
|
export async function loadFont(e, font) {
|
|
6
6
|
const fontKey = `${font.name}:${font.weight}`;
|
|
7
7
|
const storageKey = `assets:nuxt-og-image:font:${fontKey}`;
|
|
@@ -14,7 +14,7 @@ export async function loadFont(e, font) {
|
|
|
14
14
|
if (!data) {
|
|
15
15
|
if (font.path) {
|
|
16
16
|
data = await e.$fetch(font.path, {
|
|
17
|
-
baseURL: useNitroOrigin(e)
|
|
17
|
+
baseURL: useNitroOrigin(e),
|
|
18
18
|
responseType: "arrayBuffer"
|
|
19
19
|
});
|
|
20
20
|
} else {
|
|
@@ -10,18 +10,6 @@ export async function fetchPathHtmlAndExtractOptions(e, path) {
|
|
|
10
10
|
statusMessage: `Failed to read the path ${path} for og-image extraction. ${err.message}.`
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
e.node.req.url = path;
|
|
14
|
-
const oldRouteRules = e.context._nitro.routeRules;
|
|
15
|
-
e.context._nitro.routeRules = void 0;
|
|
16
|
-
const routeRules = getRouteRules(e)?.ogImage || {};
|
|
17
|
-
e.context._nitro.routeRules = oldRouteRules;
|
|
18
|
-
e.node.req.url = e.path;
|
|
19
|
-
if (routeRules === false) {
|
|
20
|
-
return createError({
|
|
21
|
-
statusCode: 400,
|
|
22
|
-
statusMessage: `This path has disabled OG images using route rules.`
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
13
|
const payload = extractAndNormaliseOgImageOptions(html);
|
|
26
14
|
if (!payload) {
|
|
27
15
|
return createError({
|
|
@@ -3,6 +3,7 @@ import { withBase } from "ufo";
|
|
|
3
3
|
import sizeOf from "image-size";
|
|
4
4
|
import { defineSatoriTransformer } from "../utils.mjs";
|
|
5
5
|
import { toBase64Image } from "../../../env/assets.mjs";
|
|
6
|
+
import { useNitroOrigin } from "#imports";
|
|
6
7
|
export default defineSatoriTransformer({
|
|
7
8
|
filter: (node) => node.type === "img",
|
|
8
9
|
transform: async (node, e) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseURL, withoutBase, withoutLeadingSlash, withoutTrailingSlash } from "ufo";
|
|
2
|
-
import { createError } from "h3";
|
|
2
|
+
import { createError, getQuery } from "h3";
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
5
5
|
import { fetchPathHtmlAndExtractOptions } from "../options/fetch.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack/dist/runtime/plugin").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -3,6 +3,7 @@ import { getRouteRules } from "nitropack/dist/runtime/route-rules";
|
|
|
3
3
|
import { extractAndNormaliseOgImageOptions } from "../../core/options/extract.mjs";
|
|
4
4
|
import { prerenderCache, prerenderChromiumContext } from "../../core/cache/prerender.mjs";
|
|
5
5
|
import { isInternalRoute } from "../../utilts.mjs";
|
|
6
|
+
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
6
7
|
export default defineNitroPlugin(async (nitro) => {
|
|
7
8
|
if (!import.meta.prerender)
|
|
8
9
|
return;
|
|
@@ -3,7 +3,7 @@ import { parseURL, withoutBase } from "ufo";
|
|
|
3
3
|
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
4
4
|
import { normaliseOptions } from "../../core/options/normalise.mjs";
|
|
5
5
|
import { getOgImagePath, isInternalRoute } from "../../utilts.mjs";
|
|
6
|
-
import { useRequestEvent, useRuntimeConfig } from "#imports";
|
|
6
|
+
import { defineNuxtPlugin, useRequestEvent, useRuntimeConfig } from "#imports";
|
|
7
7
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
8
8
|
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
9
9
|
const { ssrContext } = ctx;
|
|
@@ -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.10",
|
|
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":"f5ab7749-50de-4d6e-a4e4-00f34f3fe2c6","timestamp":1701161511204,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|