nuxt-og-image 3.0.0-rc.62 → 3.0.0-rc.64
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 +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/5b462863-5844-4458-a933-139db1c25626.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -7
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +2 -1
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.d.ts +2 -3
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.d.ts +2 -3
- package/dist/runtime/nitro/og-image/satori/instances.d.ts +1 -2
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +8 -0
- package/package.json +7 -8
- package/dist/client/_nuxt/builds/meta/6eeda1e5-e164-49e8-8d5f-4a061a3a1837.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -263,4 +263,4 @@
|
|
|
263
263
|
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.Dxoa4Ooo.css">
|
|
264
264
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/B-hN5syD.js">
|
|
265
265
|
<script type="module" src="/__nuxt-og-image/_nuxt/CAOxhcmA.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
266
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"
|
|
266
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"5b462863-5844-4458-a933-139db1c25626",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -263,4 +263,4 @@
|
|
|
263
263
|
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.Dxoa4Ooo.css">
|
|
264
264
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/B-hN5syD.js">
|
|
265
265
|
<script type="module" src="/__nuxt-og-image/_nuxt/CAOxhcmA.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
266
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"
|
|
266
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"5b462863-5844-4458-a933-139db1c25626",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"5b462863-5844-4458-a933-139db1c25626","timestamp":1721146614819}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"5b462863-5844-4458-a933-139db1c25626","timestamp":1721146614819,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -263,4 +263,4 @@
|
|
|
263
263
|
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.Dxoa4Ooo.css">
|
|
264
264
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/B-hN5syD.js">
|
|
265
265
|
<script type="module" src="/__nuxt-og-image/_nuxt/CAOxhcmA.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
|
|
266
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"
|
|
266
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildId:"5b462863-5844-4458-a933-139db1c25626",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
4
|
-
import { useNuxt, addTemplate, loadNuxtModuleInstance, createResolver, resolvePath,
|
|
4
|
+
import { useNuxt, tryResolveModule, addTemplate, loadNuxtModuleInstance, createResolver, resolvePath, defineNuxtModule, useLogger, addImports, hasNuxtModule, addServerPlugin, addServerHandler, addComponentsDir, addComponent, addPlugin } from '@nuxt/kit';
|
|
5
5
|
import { assertSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config-kit';
|
|
6
6
|
import { provider, env, isCI, isDevelopment } from 'std-env';
|
|
7
7
|
import { hash } from 'ohash';
|
|
@@ -35,7 +35,7 @@ const NodeRuntime = {
|
|
|
35
35
|
// node-server runtime
|
|
36
36
|
"chromium": "on-demand",
|
|
37
37
|
// this gets changed build start
|
|
38
|
-
"css-inline": "
|
|
38
|
+
"css-inline": "node",
|
|
39
39
|
"resvg": "node",
|
|
40
40
|
"satori": "node",
|
|
41
41
|
"sharp": "node"
|
|
@@ -131,9 +131,11 @@ function getPresetNitroPresetCompatibility(target) {
|
|
|
131
131
|
compatibility = RuntimeCompatibility["nitro-dev"];
|
|
132
132
|
return compatibility;
|
|
133
133
|
}
|
|
134
|
-
function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
134
|
+
async function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
135
135
|
const target = resolveNitroPreset(nitroConfig);
|
|
136
136
|
const compatibility = getPresetNitroPresetCompatibility(target);
|
|
137
|
+
const hasCssInlineNode = !!await tryResolveModule("@css-inline/css-inline");
|
|
138
|
+
const hasCssInlineWasm = !!await tryResolveModule("@css-inline/css-inline-wasm");
|
|
137
139
|
const { resolve } = options;
|
|
138
140
|
const satoriEnabled = typeof options.compatibility?.satori !== "undefined" ? !!options.compatibility.satori : !!compatibility.satori;
|
|
139
141
|
const chromiumEnabled = typeof options.compatibility?.chromium !== "undefined" ? !!options.compatibility.chromium : !!compatibility.chromium;
|
|
@@ -146,6 +148,11 @@ function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
146
148
|
binding = compatibility[key];
|
|
147
149
|
if (key === "chromium" && binding === "node")
|
|
148
150
|
binding = "playwright";
|
|
151
|
+
if (key === "css-inline") {
|
|
152
|
+
if (binding === "node" && !hasCssInlineNode || binding === "wasm" && !hasCssInlineWasm) {
|
|
153
|
+
binding = false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
149
156
|
resolvedCompatibility[key] = binding;
|
|
150
157
|
return {
|
|
151
158
|
[`#nuxt-og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/nitro/og-image/bindings/${key}/${binding}`)
|
|
@@ -294,13 +301,13 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
294
301
|
|
|
295
302
|
function setupDevHandler(options, resolve, nuxt = useNuxt()) {
|
|
296
303
|
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
297
|
-
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.dev, resolve });
|
|
304
|
+
await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.dev, resolve });
|
|
298
305
|
});
|
|
299
306
|
}
|
|
300
307
|
|
|
301
308
|
function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
302
309
|
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
303
|
-
applyNitroPresetCompatibility(nitroConfig, {
|
|
310
|
+
await applyNitroPresetCompatibility(nitroConfig, {
|
|
304
311
|
compatibility: {
|
|
305
312
|
"chromium": false,
|
|
306
313
|
"satori": false,
|
|
@@ -321,7 +328,7 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
321
328
|
function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
322
329
|
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
323
330
|
nitro.hooks.hook("prerender:config", async (nitroConfig) => {
|
|
324
|
-
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.prerender, resolve });
|
|
331
|
+
await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.prerender, resolve });
|
|
325
332
|
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
326
333
|
nitroConfig.wasm.esmImport = false;
|
|
327
334
|
const prerenderingPages = (nuxt.options.nitro.prerender?.routes || []).some((r) => r && (!r.includes(".") || r.includes("*")));
|
|
@@ -341,7 +348,7 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
|
341
348
|
if (typeof config.runtimeCacheStorage === "object")
|
|
342
349
|
nuxt.options.nitro.storage["og-image"] = config.runtimeCacheStorage;
|
|
343
350
|
nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
|
|
344
|
-
applyNitroPresetCompatibility(nitroConfig, { compatibility: config.compatibility?.runtime, resolve });
|
|
351
|
+
await applyNitroPresetCompatibility(nitroConfig, { compatibility: config.compatibility?.runtime, resolve });
|
|
345
352
|
nitroConfig.alias.electron = "unenv/runtime/mock/proxy-cjs";
|
|
346
353
|
nitroConfig.alias.bufferutil = "unenv/runtime/mock/proxy-cjs";
|
|
347
354
|
nitroConfig.alias["utf-8-validate"] = "unenv/runtime/mock/proxy-cjs";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type _sharp from 'sharp';
|
|
2
2
|
import type _satori from 'satori';
|
|
3
|
-
import type _cssInline from '@css-inline/css-inline-wasm';
|
|
4
3
|
export declare function useResvg(): Promise<new (svg: Uint8Array | string, options?: import("@resvg/resvg-wasm").ResvgRenderOptions) => {
|
|
5
4
|
free(): void;
|
|
6
5
|
render(): {
|
|
@@ -39,4 +38,4 @@ export declare function useResvg(): Promise<new (svg: Uint8Array | string, optio
|
|
|
39
38
|
}>;
|
|
40
39
|
export declare function useSatori(): Promise<typeof _satori>;
|
|
41
40
|
export declare function useSharp(): Promise<typeof _sharp>;
|
|
42
|
-
export declare function useCssInline(): Promise<
|
|
41
|
+
export declare function useCssInline(): Promise<any>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createConsola } from "consola";
|
|
1
2
|
import { useCssInline } from "../instances.js";
|
|
2
3
|
import { useNitroOrigin } from "#imports";
|
|
3
4
|
export async function applyInlineCss(ctx, island) {
|
|
@@ -30,6 +31,13 @@ export async function applyInlineCss(ctx, island) {
|
|
|
30
31
|
if (!css.trim().length)
|
|
31
32
|
return false;
|
|
32
33
|
const cssInline = await useCssInline();
|
|
34
|
+
if (!cssInline || cssInline?.__unenv__) {
|
|
35
|
+
if (componentInlineStyles.length) {
|
|
36
|
+
const logger = createConsola().withTag("Nuxt OG Image");
|
|
37
|
+
logger.warn("To have inline styles applied you need to install either the `@css-inline/css-inline` or `@css-inline/css-inline-wasm` package.");
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
33
41
|
html = cssInline.inline(island.html, {
|
|
34
42
|
loadRemoteStylesheets: false,
|
|
35
43
|
extraCss: css
|
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-rc.
|
|
4
|
+
"version": "3.0.0-rc.64",
|
|
5
5
|
"description": "Enlightened OG Image generation for Nuxt.",
|
|
6
6
|
"author": {
|
|
7
7
|
"website": "https://harlanzw.com",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"node": ">=18.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@css-inline/css-inline-wasm": "^0.14.1",
|
|
39
38
|
"@nuxt/devtools-kit": "^1.3.9",
|
|
40
39
|
"@nuxt/kit": "^3.12.3",
|
|
41
40
|
"@resvg/resvg-js": "^2.6.2",
|
|
@@ -57,7 +56,6 @@
|
|
|
57
56
|
"radix3": "^1.1.2",
|
|
58
57
|
"satori": "^0.10.14",
|
|
59
58
|
"satori-html": "^0.3.2",
|
|
60
|
-
"shiki": "^1.10.3",
|
|
61
59
|
"sirv": "^2.0.4",
|
|
62
60
|
"std-env": "^3.7.0",
|
|
63
61
|
"ufo": "^1.5.3",
|
|
@@ -66,6 +64,7 @@
|
|
|
66
64
|
},
|
|
67
65
|
"devDependencies": {
|
|
68
66
|
"@antfu/eslint-config": "^2.22.4",
|
|
67
|
+
"@css-inline/css-inline": "^0.14.1",
|
|
69
68
|
"@headlessui/vue": "^1.7.22",
|
|
70
69
|
"@iconify-json/carbon": "^1.1.36",
|
|
71
70
|
"@iconify-json/logos": "^1.1.43",
|
|
@@ -85,10 +84,10 @@
|
|
|
85
84
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
86
85
|
"@nuxtjs/i18n": "^8.3.1",
|
|
87
86
|
"@nuxtjs/tailwindcss": "^6.12.1",
|
|
88
|
-
"@unocss/nuxt": "0.61.
|
|
89
|
-
"@unocss/preset-icons": "0.61.
|
|
90
|
-
"@unocss/preset-uno": "0.61.
|
|
91
|
-
"@unocss/runtime": "0.61.
|
|
87
|
+
"@unocss/nuxt": "^0.61.4",
|
|
88
|
+
"@unocss/preset-icons": "^0.61.4",
|
|
89
|
+
"@unocss/preset-uno": "^0.61.4",
|
|
90
|
+
"@unocss/runtime": "^0.61.4",
|
|
92
91
|
"@vueuse/nuxt": "^10.11.0",
|
|
93
92
|
"bumpp": "^9.4.1",
|
|
94
93
|
"eslint": "9.7.0",
|
|
@@ -98,7 +97,7 @@
|
|
|
98
97
|
"sass": "^1.77.8",
|
|
99
98
|
"sharp": "^0.33.4",
|
|
100
99
|
"typescript": "^5.5.3",
|
|
101
|
-
"unocss": "0.61.
|
|
100
|
+
"unocss": "^0.61.4",
|
|
102
101
|
"vitest": "^2.0.3"
|
|
103
102
|
},
|
|
104
103
|
"build": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"6eeda1e5-e164-49e8-8d5f-4a061a3a1837","timestamp":1721141782409,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|