nuxt-og-image 2.0.0-beta.32 → 2.0.0-beta.33
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/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
Enlightened OG Image generation for Nuxt 3.
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<img src="https://repository-images.githubusercontent.com/578125755/
|
|
16
|
+
<img src="https://repository-images.githubusercontent.com/578125755/90f77ca8-95be-4e06-9600-332afe1ba24f">
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
19
19
|
<table>
|
package/dist/module.json
CHANGED
|
@@ -12,10 +12,10 @@ import loadSatori from "#nuxt-og-image/satori";
|
|
|
12
12
|
import { useRuntimeConfig } from "#imports";
|
|
13
13
|
const satoriFonts = [];
|
|
14
14
|
let fontLoadPromise = null;
|
|
15
|
-
function loadFonts(fonts) {
|
|
15
|
+
function loadFonts(baseURL, fonts) {
|
|
16
16
|
if (fontLoadPromise)
|
|
17
17
|
return fontLoadPromise;
|
|
18
|
-
return fontLoadPromise = Promise.all(fonts.map((font) => loadFont(font)));
|
|
18
|
+
return fontLoadPromise = Promise.all(fonts.map((font) => loadFont(baseURL, font)));
|
|
19
19
|
}
|
|
20
20
|
export default {
|
|
21
21
|
name: "satori",
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
const { fonts, satoriOptions } = useRuntimeConfig()["nuxt-og-image"];
|
|
56
56
|
const vnodes = await this.createVNode(baseUrl, options);
|
|
57
57
|
if (!satoriFonts.length)
|
|
58
|
-
satoriFonts.push(...await loadFonts(fonts));
|
|
58
|
+
satoriFonts.push(...await loadFonts(baseUrl, fonts));
|
|
59
59
|
const satori = await loadSatori();
|
|
60
60
|
return await satori(vnodes, {
|
|
61
61
|
...satoriOptions,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ParsedURL } from 'ufo';
|
|
2
2
|
import type { FontConfig, SatoriTransformer, VNode } from '../../../../types';
|
|
3
|
-
export declare function loadFont(font: FontConfig): Promise<any>;
|
|
3
|
+
export declare function loadFont(baseURL: string, font: FontConfig): Promise<any>;
|
|
4
4
|
export declare function walkSatoriTree(url: ParsedURL, node: VNode, plugins: SatoriTransformer[]): Promise<void>;
|
|
5
5
|
export declare function defineSatoriTransformer(transformer: (url: ParsedURL) => SatoriTransformer): (url: ParsedURL) => SatoriTransformer;
|
|
@@ -2,7 +2,7 @@ import { Buffer } from "node:buffer";
|
|
|
2
2
|
import { base64ToArrayBuffer, readPublicAsset } from "../../utils.mjs";
|
|
3
3
|
import { useStorage } from "#internal/nitro";
|
|
4
4
|
const cachedFonts = {};
|
|
5
|
-
export async function loadFont(font) {
|
|
5
|
+
export async function loadFont(baseURL, font) {
|
|
6
6
|
let fontKey = font;
|
|
7
7
|
if (typeof font === "object")
|
|
8
8
|
fontKey = `${font.name}:${font.weight}`;
|
|
@@ -19,9 +19,13 @@ export async function loadFont(font) {
|
|
|
19
19
|
if (typeof font === "object") {
|
|
20
20
|
data = await readPublicAsset(font.path);
|
|
21
21
|
if (!data) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
try {
|
|
23
|
+
data = await globalThis.$fetch(font.path, {
|
|
24
|
+
responseType: "arrayBuffer",
|
|
25
|
+
baseURL
|
|
26
|
+
});
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
if (!data) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-og-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.33",
|
|
5
5
|
"packageManager": "pnpm@8.1.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -46,29 +46,29 @@
|
|
|
46
46
|
"pathe": "^1.1.0",
|
|
47
47
|
"playwright-core": "^1.33.0",
|
|
48
48
|
"radix3": "^1.0.1",
|
|
49
|
-
"satori": "0.7.
|
|
49
|
+
"satori": "0.7.4",
|
|
50
50
|
"satori-html": "^0.3.2",
|
|
51
51
|
"sirv": "^2.0.3",
|
|
52
|
-
"std-env": "^3.3.
|
|
52
|
+
"std-env": "^3.3.3",
|
|
53
53
|
"svg2png-wasm": "^1.3.4",
|
|
54
54
|
"tinyws": "^0.1.0",
|
|
55
55
|
"twemoji": "^14.0.2",
|
|
56
|
-
"ufo": "^1.1.
|
|
56
|
+
"ufo": "^1.1.2",
|
|
57
57
|
"ws": "^8.13.0",
|
|
58
58
|
"yoga-wasm-web": "^0.3.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@antfu/eslint-config": "^0.38.
|
|
62
|
-
"@nuxt/devtools-edge": "0.4.5-
|
|
61
|
+
"@antfu/eslint-config": "^0.38.6",
|
|
62
|
+
"@nuxt/devtools-edge": "0.4.5-28053684.ddd2e41",
|
|
63
63
|
"@nuxt/module-builder": "^0.3.1",
|
|
64
64
|
"@nuxt/test-utils": "3.4.3",
|
|
65
65
|
"@nuxtjs/eslint-config-typescript": "^12.0.0",
|
|
66
66
|
"@types/ws": "^8.5.4",
|
|
67
67
|
"bumpp": "^9.1.0",
|
|
68
|
-
"eslint": "8.
|
|
68
|
+
"eslint": "8.40.0",
|
|
69
69
|
"jest-image-snapshot": "^6.1.0",
|
|
70
70
|
"nuxt": "^3.4.3",
|
|
71
|
-
"vitest": "^0.
|
|
71
|
+
"vitest": "^0.31.0"
|
|
72
72
|
},
|
|
73
73
|
"resolutions": {
|
|
74
74
|
"nitropack": "npm:nitropack-edge@2.4.0-28027501.1cf01bf",
|