nuxt-og-image 6.3.2 → 6.3.3
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/chunks/tw4.cjs +1 -1
- package/dist/chunks/tw4.mjs +1 -1
- package/dist/chunks/uno.cjs +1 -1
- package/dist/chunks/uno.mjs +1 -1
- package/dist/devtools/200.html +1 -1
- package/dist/devtools/404.html +1 -1
- package/dist/devtools/_nuxt/25sBfX0g.js +6 -0
- package/dist/devtools/_nuxt/BfLfC02J.js +3 -0
- package/dist/devtools/_nuxt/CXdvjlAh.js +4 -0
- package/dist/devtools/_nuxt/CfJ_B4Jj.js +3 -0
- package/dist/devtools/_nuxt/Cg59iSrl.js +3 -0
- package/dist/devtools/_nuxt/{CoSxBJd8.js → DEOhyhjE.js} +1 -1
- package/dist/devtools/_nuxt/{C9JKABtj.js → DSwQLvvb.js} +1 -1
- package/dist/devtools/_nuxt/DevtoolsSnippet.QjsBSjre.css +1 -0
- package/dist/devtools/_nuxt/QN5ZUyx0.js +174 -0
- package/dist/devtools/_nuxt/TTqexA7S.js +1 -0
- package/dist/devtools/_nuxt/XgRlUfhy.js +2 -0
- package/dist/devtools/_nuxt/builds/latest.json +1 -1
- package/dist/devtools/_nuxt/builds/meta/2a1b436d-89c1-4c47-b621-d8bb140754c5.json +1 -0
- package/dist/devtools/_nuxt/entry.lR7NqsKt.css +2 -0
- package/dist/devtools/_nuxt/{pages.CPczdJu3.css → pages.DpBIgUOF.css} +1 -1
- package/dist/devtools/debug/index.html +1 -1
- package/dist/devtools/docs/index.html +1 -1
- package/dist/devtools/index.html +1 -1
- package/dist/devtools/templates/index.html +1 -1
- package/dist/module.cjs +1 -1
- package/dist/module.d.cts +3 -2
- package/dist/module.d.mts +3 -2
- package/dist/module.d.ts +3 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/app/composables/_defineOgImageRaw.js +13 -7
- package/dist/runtime/app/composables/defineOgImageScreenshot.js +3 -1
- package/dist/runtime/app/utils.d.ts +8 -3
- package/dist/runtime/app/utils.js +79 -10
- package/dist/runtime/server/og-image/bindings/takumi/wasm.d.ts +1 -1
- package/dist/runtime/server/og-image/bindings/takumi/wasm.js +1 -1
- package/dist/runtime/server/og-image/font-subsets.d.ts +24 -0
- package/dist/runtime/server/og-image/font-subsets.js +53 -0
- package/dist/runtime/server/og-image/fonts.d.ts +7 -0
- package/dist/runtime/server/og-image/fonts.js +5 -4
- package/dist/runtime/server/og-image/satori/renderer.js +38 -4
- package/dist/runtime/server/og-image/takumi/renderer.js +28 -12
- package/dist/runtime/types.d.ts +8 -1
- package/dist/shared/{nuxt-og-image.PUNoqZDW.cjs → nuxt-og-image.CW0bAY2T.cjs} +38 -14
- package/dist/shared/{nuxt-og-image.CYm-mAcA.mjs → nuxt-og-image.JSCwEibR.mjs} +37 -13
- package/package.json +20 -19
- package/dist/devtools/_nuxt/BNA9K40e.js +0 -3
- package/dist/devtools/_nuxt/C-b6hTTf.js +0 -6
- package/dist/devtools/_nuxt/CD0R49mQ.js +0 -2
- package/dist/devtools/_nuxt/CaQt7uvw.js +0 -4
- package/dist/devtools/_nuxt/D0q6HvYk.js +0 -174
- package/dist/devtools/_nuxt/D2zWjF09.js +0 -3
- package/dist/devtools/_nuxt/DA9abGfd.js +0 -3
- package/dist/devtools/_nuxt/DGG_4uof.js +0 -1
- package/dist/devtools/_nuxt/DevtoolsSnippet.CHln_zRX.css +0 -1
- package/dist/devtools/_nuxt/builds/meta/9d408b39-cc9a-4751-be86-2f2ab3ba2395.json +0 -1
- package/dist/devtools/_nuxt/entry.BPMZ_Jol.css +0 -2
|
@@ -460,7 +460,7 @@ function patchWebAssemblyInstantiate(code) {
|
|
|
460
460
|
const PROVIDER_DEPENDENCIES = [
|
|
461
461
|
{
|
|
462
462
|
name: "satori",
|
|
463
|
-
description: "SVG-based renderer using Satori
|
|
463
|
+
description: "SVG-based renderer using Satori",
|
|
464
464
|
bindings: {
|
|
465
465
|
"node": [
|
|
466
466
|
{ name: "satori", description: "HTML to SVG renderer" },
|
|
@@ -478,7 +478,7 @@ const PROVIDER_DEPENDENCIES = [
|
|
|
478
478
|
},
|
|
479
479
|
{
|
|
480
480
|
name: "takumi",
|
|
481
|
-
description: "Rust-based high-performance renderer",
|
|
481
|
+
description: "Rust-based high-performance renderer (recommended)",
|
|
482
482
|
bindings: {
|
|
483
483
|
"node": [
|
|
484
484
|
{ name: "@takumi-rs/core", description: "Native Takumi renderer" }
|
|
@@ -597,9 +597,9 @@ async function promptForRendererSelection() {
|
|
|
597
597
|
const renderer = await logger_js.logger.prompt("Which renderer would you like to use?", {
|
|
598
598
|
type: "select",
|
|
599
599
|
options: PROVIDER_DEPENDENCIES.map((p) => p.name),
|
|
600
|
-
initial: "
|
|
600
|
+
initial: "takumi"
|
|
601
601
|
});
|
|
602
|
-
return renderer || "
|
|
602
|
+
return renderer || "takumi";
|
|
603
603
|
}
|
|
604
604
|
async function validateProviderSetup(renderer, compatibility) {
|
|
605
605
|
const issues = [];
|
|
@@ -1620,9 +1620,11 @@ async function extractFontFacesSimple(css) {
|
|
|
1620
1620
|
return fonts.map((font) => {
|
|
1621
1621
|
const urlSource = font.sources.find((s) => s.type === "url");
|
|
1622
1622
|
let weight;
|
|
1623
|
+
let weightRange;
|
|
1623
1624
|
if (Array.isArray(font.weight)) {
|
|
1624
1625
|
const [min, max] = font.weight;
|
|
1625
1626
|
weight = min <= 400 && max >= 400 ? 400 : min;
|
|
1627
|
+
weightRange = [min, max];
|
|
1626
1628
|
} else {
|
|
1627
1629
|
weight = font.weight;
|
|
1628
1630
|
}
|
|
@@ -1633,7 +1635,8 @@ async function extractFontFacesSimple(css) {
|
|
|
1633
1635
|
weight,
|
|
1634
1636
|
style: font.style,
|
|
1635
1637
|
unicodeRange: font.unicodeRange,
|
|
1636
|
-
isWoff2: src.endsWith(".woff2")
|
|
1638
|
+
isWoff2: src.endsWith(".woff2"),
|
|
1639
|
+
weightRange
|
|
1637
1640
|
};
|
|
1638
1641
|
}).filter((f) => f.src);
|
|
1639
1642
|
}
|
|
@@ -1743,7 +1746,8 @@ async function parseAppCssFontFaces(nuxt) {
|
|
|
1743
1746
|
return results;
|
|
1744
1747
|
}
|
|
1745
1748
|
async function parseFontsFromTemplate(nuxt, options) {
|
|
1746
|
-
const
|
|
1749
|
+
const weightsKey = options.requiredWeights?.toSorted((a, b) => a - b).join(",") || "";
|
|
1750
|
+
const cacheKey = `${options.convertedWoff2Files.size}:${[...options.convertedWoff2Files.keys()].toSorted().join(",")}:${weightsKey}`;
|
|
1747
1751
|
const cache = nuxt._ogImageParsedFontsCache ||= /* @__PURE__ */ new Map();
|
|
1748
1752
|
const cached = cache.get(cacheKey);
|
|
1749
1753
|
if (cached)
|
|
@@ -1783,6 +1787,25 @@ async function parseFontsFromTemplate(nuxt, options) {
|
|
|
1783
1787
|
expandedFonts.push({ ...template, weight });
|
|
1784
1788
|
existingKeys.add(key);
|
|
1785
1789
|
}
|
|
1790
|
+
if (options.requiredWeights && options.requiredWeights.length > 0) {
|
|
1791
|
+
const variableFonts = expandedFonts.filter((f) => f.weightRange);
|
|
1792
|
+
for (const varFont of variableFonts) {
|
|
1793
|
+
const [min, max] = varFont.weightRange;
|
|
1794
|
+
for (const w of options.requiredWeights) {
|
|
1795
|
+
if (w < min || w > max)
|
|
1796
|
+
continue;
|
|
1797
|
+
const expandKey = `${varFont.family}-${w}-${varFont.style}`;
|
|
1798
|
+
if (existingKeys.has(expandKey))
|
|
1799
|
+
continue;
|
|
1800
|
+
const templates2 = expandedFonts.filter(
|
|
1801
|
+
(f) => f.family === varFont.family && f.style === varFont.style
|
|
1802
|
+
);
|
|
1803
|
+
for (const template of templates2)
|
|
1804
|
+
expandedFonts.push({ ...template, weight: w });
|
|
1805
|
+
existingKeys.add(expandKey);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1786
1809
|
const defaultUnicodeRange = "U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD";
|
|
1787
1810
|
const result = expandedFonts.map((font) => {
|
|
1788
1811
|
const fKey = `${font.family}-${font.weight}-${font.style}`;
|
|
@@ -2108,7 +2131,7 @@ async function resolveMissingFontFamilies(options) {
|
|
|
2108
2131
|
async function resolveOgImageFonts(options) {
|
|
2109
2132
|
const { nuxt, hasNuxtFonts, hasSatoriRenderer, hasTakumiRenderer, convertedWoff2Files, fontSubsets, fontRequirements, tw4FontVars, logger, ogFontsDir } = options;
|
|
2110
2133
|
const staticInterFonts = getStaticInterFonts(ogFontsDir);
|
|
2111
|
-
const allFonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files }) : [];
|
|
2134
|
+
const allFonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files, requiredWeights: fontRequirements.weights }) : [];
|
|
2112
2135
|
const detectedSubsets = extractSubsetNames(allFonts);
|
|
2113
2136
|
const effectiveSubsets = detectedSubsets.length > 0 ? detectedSubsets : fontSubsets || ["latin"];
|
|
2114
2137
|
const appCssFonts = await parseAppCssFontFaces(nuxt).catch(() => []);
|
|
@@ -2148,7 +2171,7 @@ async function resolveOgImageFonts(options) {
|
|
|
2148
2171
|
}
|
|
2149
2172
|
}
|
|
2150
2173
|
const nuxtFontFamilies = new Set(
|
|
2151
|
-
hasNuxtFonts ? (await parseFontsFromTemplate(nuxt, { convertedWoff2Files })).map((f) => f.family) : []
|
|
2174
|
+
hasNuxtFonts ? (await parseFontsFromTemplate(nuxt, { convertedWoff2Files, requiredWeights: fontRequirements.weights })).map((f) => f.family) : []
|
|
2152
2175
|
);
|
|
2153
2176
|
const fonts = !fontRequirements.hasDynamicBindings ? allFonts.filter(
|
|
2154
2177
|
(f) => nuxtFontFamilies.has(f.family) ? fontRequirements.styles.includes(f.style) : matchesFontRequirements(f, fontRequirements)
|
|
@@ -3652,7 +3675,7 @@ async function onInstall(nuxt) {
|
|
|
3652
3675
|
const installedProviders2 = await getInstalledProviders();
|
|
3653
3676
|
if (installedProviders2.length === 0) {
|
|
3654
3677
|
throw new Error(
|
|
3655
|
-
"[nuxt-og-image] No OG image provider dependencies found. Install a provider before running in CI:\n npm add @resvg/resvg-js satori yoga-wasm-web # for satori\n npm add
|
|
3678
|
+
"[nuxt-og-image] No OG image provider dependencies found. Install a provider before running in CI:\n npm add @resvg/resvg-js satori yoga-wasm-web # for satori\n npm add playwright-core # for browser\nSee: https://nuxtseo.com/og-image/getting-started"
|
|
3656
3679
|
);
|
|
3657
3680
|
}
|
|
3658
3681
|
return;
|
|
@@ -4143,7 +4166,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
4143
4166
|
await onUpgrade(nuxt, options, previousVersion);
|
|
4144
4167
|
},
|
|
4145
4168
|
async setup(config, nuxt) {
|
|
4146
|
-
const _resolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/nuxt-og-image.
|
|
4169
|
+
const _resolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/nuxt-og-image.CW0bAY2T.cjs', document.baseURI).href)));
|
|
4147
4170
|
const fixSharedPath = (p) => {
|
|
4148
4171
|
if (p.includes("/shared/runtime/"))
|
|
4149
4172
|
return p.replace("/shared/runtime/", "/runtime/");
|
|
@@ -4465,7 +4488,8 @@ ${familyInfo}`);
|
|
|
4465
4488
|
runtime: {
|
|
4466
4489
|
browser: false,
|
|
4467
4490
|
// should already be false
|
|
4468
|
-
satori: false
|
|
4491
|
+
satori: false,
|
|
4492
|
+
takumi: false
|
|
4469
4493
|
}
|
|
4470
4494
|
});
|
|
4471
4495
|
if (!nuxt.options.dev) {
|
|
@@ -4723,7 +4747,7 @@ ${familyInfo}`);
|
|
|
4723
4747
|
}
|
|
4724
4748
|
}
|
|
4725
4749
|
await loadSfcCompiler();
|
|
4726
|
-
nuxt.hook("components:extend", (components) => {
|
|
4750
|
+
nuxt.hook("components:extend", async (components) => {
|
|
4727
4751
|
allNuxtComponents = components;
|
|
4728
4752
|
ogImageComponentCtx.components = [];
|
|
4729
4753
|
const invalidComponents = [];
|
|
@@ -4825,7 +4849,7 @@ Run: npx nuxt-og-image migrate v6`;
|
|
|
4825
4849
|
throw new Error(message);
|
|
4826
4850
|
}
|
|
4827
4851
|
}
|
|
4828
|
-
nuxt.hooks.
|
|
4852
|
+
await nuxt.hooks.callHook("nuxt-og-image:components", ogImageComponentCtx);
|
|
4829
4853
|
});
|
|
4830
4854
|
kit.addTemplate({
|
|
4831
4855
|
filename: "nuxt-og-image/components.mjs",
|
|
@@ -4905,7 +4929,7 @@ export const resolve = (import.meta.dev || import.meta.prerender) ? devResolve :
|
|
|
4905
4929
|
return `export default ${JSON.stringify(fonts)}`;
|
|
4906
4930
|
};
|
|
4907
4931
|
nuxt.options.nitro.virtual["#og-image/fonts-available"] = async () => {
|
|
4908
|
-
const fonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files }) : [];
|
|
4932
|
+
const fonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files, requiredWeights: fontRequirementsState.weights }) : [];
|
|
4909
4933
|
return `export default ${JSON.stringify(fonts)}`;
|
|
4910
4934
|
};
|
|
4911
4935
|
nuxt.options.nitro.virtual["#og-image/font-requirements"] = async () => {
|
|
@@ -440,7 +440,7 @@ function patchWebAssemblyInstantiate(code) {
|
|
|
440
440
|
const PROVIDER_DEPENDENCIES = [
|
|
441
441
|
{
|
|
442
442
|
name: "satori",
|
|
443
|
-
description: "SVG-based renderer using Satori
|
|
443
|
+
description: "SVG-based renderer using Satori",
|
|
444
444
|
bindings: {
|
|
445
445
|
"node": [
|
|
446
446
|
{ name: "satori", description: "HTML to SVG renderer" },
|
|
@@ -458,7 +458,7 @@ const PROVIDER_DEPENDENCIES = [
|
|
|
458
458
|
},
|
|
459
459
|
{
|
|
460
460
|
name: "takumi",
|
|
461
|
-
description: "Rust-based high-performance renderer",
|
|
461
|
+
description: "Rust-based high-performance renderer (recommended)",
|
|
462
462
|
bindings: {
|
|
463
463
|
"node": [
|
|
464
464
|
{ name: "@takumi-rs/core", description: "Native Takumi renderer" }
|
|
@@ -577,9 +577,9 @@ async function promptForRendererSelection() {
|
|
|
577
577
|
const renderer = await logger.prompt("Which renderer would you like to use?", {
|
|
578
578
|
type: "select",
|
|
579
579
|
options: PROVIDER_DEPENDENCIES.map((p) => p.name),
|
|
580
|
-
initial: "
|
|
580
|
+
initial: "takumi"
|
|
581
581
|
});
|
|
582
|
-
return renderer || "
|
|
582
|
+
return renderer || "takumi";
|
|
583
583
|
}
|
|
584
584
|
async function validateProviderSetup(renderer, compatibility) {
|
|
585
585
|
const issues = [];
|
|
@@ -1600,9 +1600,11 @@ async function extractFontFacesSimple(css) {
|
|
|
1600
1600
|
return fonts.map((font) => {
|
|
1601
1601
|
const urlSource = font.sources.find((s) => s.type === "url");
|
|
1602
1602
|
let weight;
|
|
1603
|
+
let weightRange;
|
|
1603
1604
|
if (Array.isArray(font.weight)) {
|
|
1604
1605
|
const [min, max] = font.weight;
|
|
1605
1606
|
weight = min <= 400 && max >= 400 ? 400 : min;
|
|
1607
|
+
weightRange = [min, max];
|
|
1606
1608
|
} else {
|
|
1607
1609
|
weight = font.weight;
|
|
1608
1610
|
}
|
|
@@ -1613,7 +1615,8 @@ async function extractFontFacesSimple(css) {
|
|
|
1613
1615
|
weight,
|
|
1614
1616
|
style: font.style,
|
|
1615
1617
|
unicodeRange: font.unicodeRange,
|
|
1616
|
-
isWoff2: src.endsWith(".woff2")
|
|
1618
|
+
isWoff2: src.endsWith(".woff2"),
|
|
1619
|
+
weightRange
|
|
1617
1620
|
};
|
|
1618
1621
|
}).filter((f) => f.src);
|
|
1619
1622
|
}
|
|
@@ -1723,7 +1726,8 @@ async function parseAppCssFontFaces(nuxt) {
|
|
|
1723
1726
|
return results;
|
|
1724
1727
|
}
|
|
1725
1728
|
async function parseFontsFromTemplate(nuxt, options) {
|
|
1726
|
-
const
|
|
1729
|
+
const weightsKey = options.requiredWeights?.toSorted((a, b) => a - b).join(",") || "";
|
|
1730
|
+
const cacheKey = `${options.convertedWoff2Files.size}:${[...options.convertedWoff2Files.keys()].toSorted().join(",")}:${weightsKey}`;
|
|
1727
1731
|
const cache = nuxt._ogImageParsedFontsCache ||= /* @__PURE__ */ new Map();
|
|
1728
1732
|
const cached = cache.get(cacheKey);
|
|
1729
1733
|
if (cached)
|
|
@@ -1763,6 +1767,25 @@ async function parseFontsFromTemplate(nuxt, options) {
|
|
|
1763
1767
|
expandedFonts.push({ ...template, weight });
|
|
1764
1768
|
existingKeys.add(key);
|
|
1765
1769
|
}
|
|
1770
|
+
if (options.requiredWeights && options.requiredWeights.length > 0) {
|
|
1771
|
+
const variableFonts = expandedFonts.filter((f) => f.weightRange);
|
|
1772
|
+
for (const varFont of variableFonts) {
|
|
1773
|
+
const [min, max] = varFont.weightRange;
|
|
1774
|
+
for (const w of options.requiredWeights) {
|
|
1775
|
+
if (w < min || w > max)
|
|
1776
|
+
continue;
|
|
1777
|
+
const expandKey = `${varFont.family}-${w}-${varFont.style}`;
|
|
1778
|
+
if (existingKeys.has(expandKey))
|
|
1779
|
+
continue;
|
|
1780
|
+
const templates2 = expandedFonts.filter(
|
|
1781
|
+
(f) => f.family === varFont.family && f.style === varFont.style
|
|
1782
|
+
);
|
|
1783
|
+
for (const template of templates2)
|
|
1784
|
+
expandedFonts.push({ ...template, weight: w });
|
|
1785
|
+
existingKeys.add(expandKey);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1766
1789
|
const defaultUnicodeRange = "U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD";
|
|
1767
1790
|
const result = expandedFonts.map((font) => {
|
|
1768
1791
|
const fKey = `${font.family}-${font.weight}-${font.style}`;
|
|
@@ -2088,7 +2111,7 @@ async function resolveMissingFontFamilies(options) {
|
|
|
2088
2111
|
async function resolveOgImageFonts(options) {
|
|
2089
2112
|
const { nuxt, hasNuxtFonts, hasSatoriRenderer, hasTakumiRenderer, convertedWoff2Files, fontSubsets, fontRequirements, tw4FontVars, logger, ogFontsDir } = options;
|
|
2090
2113
|
const staticInterFonts = getStaticInterFonts(ogFontsDir);
|
|
2091
|
-
const allFonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files }) : [];
|
|
2114
|
+
const allFonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files, requiredWeights: fontRequirements.weights }) : [];
|
|
2092
2115
|
const detectedSubsets = extractSubsetNames(allFonts);
|
|
2093
2116
|
const effectiveSubsets = detectedSubsets.length > 0 ? detectedSubsets : fontSubsets || ["latin"];
|
|
2094
2117
|
const appCssFonts = await parseAppCssFontFaces(nuxt).catch(() => []);
|
|
@@ -2128,7 +2151,7 @@ async function resolveOgImageFonts(options) {
|
|
|
2128
2151
|
}
|
|
2129
2152
|
}
|
|
2130
2153
|
const nuxtFontFamilies = new Set(
|
|
2131
|
-
hasNuxtFonts ? (await parseFontsFromTemplate(nuxt, { convertedWoff2Files })).map((f) => f.family) : []
|
|
2154
|
+
hasNuxtFonts ? (await parseFontsFromTemplate(nuxt, { convertedWoff2Files, requiredWeights: fontRequirements.weights })).map((f) => f.family) : []
|
|
2132
2155
|
);
|
|
2133
2156
|
const fonts = !fontRequirements.hasDynamicBindings ? allFonts.filter(
|
|
2134
2157
|
(f) => nuxtFontFamilies.has(f.family) ? fontRequirements.styles.includes(f.style) : matchesFontRequirements(f, fontRequirements)
|
|
@@ -3632,7 +3655,7 @@ async function onInstall(nuxt) {
|
|
|
3632
3655
|
const installedProviders2 = await getInstalledProviders();
|
|
3633
3656
|
if (installedProviders2.length === 0) {
|
|
3634
3657
|
throw new Error(
|
|
3635
|
-
"[nuxt-og-image] No OG image provider dependencies found. Install a provider before running in CI:\n npm add @resvg/resvg-js satori yoga-wasm-web # for satori\n npm add
|
|
3658
|
+
"[nuxt-og-image] No OG image provider dependencies found. Install a provider before running in CI:\n npm add @resvg/resvg-js satori yoga-wasm-web # for satori\n npm add playwright-core # for browser\nSee: https://nuxtseo.com/og-image/getting-started"
|
|
3636
3659
|
);
|
|
3637
3660
|
}
|
|
3638
3661
|
return;
|
|
@@ -4445,7 +4468,8 @@ ${familyInfo}`);
|
|
|
4445
4468
|
runtime: {
|
|
4446
4469
|
browser: false,
|
|
4447
4470
|
// should already be false
|
|
4448
|
-
satori: false
|
|
4471
|
+
satori: false,
|
|
4472
|
+
takumi: false
|
|
4449
4473
|
}
|
|
4450
4474
|
});
|
|
4451
4475
|
if (!nuxt.options.dev) {
|
|
@@ -4703,7 +4727,7 @@ ${familyInfo}`);
|
|
|
4703
4727
|
}
|
|
4704
4728
|
}
|
|
4705
4729
|
await loadSfcCompiler();
|
|
4706
|
-
nuxt.hook("components:extend", (components) => {
|
|
4730
|
+
nuxt.hook("components:extend", async (components) => {
|
|
4707
4731
|
allNuxtComponents = components;
|
|
4708
4732
|
ogImageComponentCtx.components = [];
|
|
4709
4733
|
const invalidComponents = [];
|
|
@@ -4805,7 +4829,7 @@ Run: npx nuxt-og-image migrate v6`;
|
|
|
4805
4829
|
throw new Error(message);
|
|
4806
4830
|
}
|
|
4807
4831
|
}
|
|
4808
|
-
nuxt.hooks.
|
|
4832
|
+
await nuxt.hooks.callHook("nuxt-og-image:components", ogImageComponentCtx);
|
|
4809
4833
|
});
|
|
4810
4834
|
addTemplate({
|
|
4811
4835
|
filename: "nuxt-og-image/components.mjs",
|
|
@@ -4885,7 +4909,7 @@ export const resolve = (import.meta.dev || import.meta.prerender) ? devResolve :
|
|
|
4885
4909
|
return `export default ${JSON.stringify(fonts)}`;
|
|
4886
4910
|
};
|
|
4887
4911
|
nuxt.options.nitro.virtual["#og-image/fonts-available"] = async () => {
|
|
4888
|
-
const fonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files }) : [];
|
|
4912
|
+
const fonts = hasNuxtFonts ? await parseFontsFromTemplate(nuxt, { convertedWoff2Files, requiredWeights: fontRequirementsState.weights }) : [];
|
|
4889
4913
|
return `export default ${JSON.stringify(fonts)}`;
|
|
4890
4914
|
};
|
|
4891
4915
|
nuxt.options.nitro.virtual["#og-image/font-requirements"] = async () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-og-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.3.
|
|
4
|
+
"version": "6.3.3",
|
|
5
5
|
"description": "Enlightened OG Image generation for Nuxt.",
|
|
6
6
|
"author": {
|
|
7
7
|
"website": "https://harlanzw.com",
|
|
@@ -94,42 +94,40 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@clack/prompts": "^1.
|
|
98
|
-
"@nuxt/devtools-kit": "^3.2.4",
|
|
97
|
+
"@clack/prompts": "^1.2.0",
|
|
99
98
|
"@nuxt/kit": "^4.4.2",
|
|
100
|
-
"@vue/compiler-sfc": "^3.5.
|
|
99
|
+
"@vue/compiler-sfc": "^3.5.32",
|
|
101
100
|
"chrome-launcher": "^1.2.1",
|
|
102
101
|
"consola": "^3.4.2",
|
|
103
102
|
"culori": "^4.0.2",
|
|
104
|
-
"defu": "^6.1.
|
|
105
|
-
"devalue": "^5.
|
|
103
|
+
"defu": "^6.1.7",
|
|
104
|
+
"devalue": "^5.7.0",
|
|
106
105
|
"exsolve": "^1.0.8",
|
|
107
106
|
"lightningcss": "^1.32.0",
|
|
108
107
|
"magic-string": "^0.30.21",
|
|
109
108
|
"magicast": "^0.5.2",
|
|
110
109
|
"mocked-exports": "^0.1.1",
|
|
111
110
|
"nuxt-site-config": "^4.0.7",
|
|
112
|
-
"nuxtseo-
|
|
113
|
-
"nuxtseo-shared": "^5.0.2",
|
|
111
|
+
"nuxtseo-shared": "^5.1.1",
|
|
114
112
|
"nypm": "^0.6.5",
|
|
115
113
|
"ofetch": "^1.5.1",
|
|
116
114
|
"ohash": "^2.0.11",
|
|
117
|
-
"oxc-parser": "^0.
|
|
115
|
+
"oxc-parser": "^0.124.0",
|
|
118
116
|
"oxc-walker": "^0.7.0",
|
|
119
117
|
"pathe": "^2.0.3",
|
|
120
118
|
"pkg-types": "^2.3.0",
|
|
121
119
|
"radix3": "^1.1.2",
|
|
122
|
-
"sirv": "^3.0.2",
|
|
123
120
|
"std-env": "^4.0.0",
|
|
124
121
|
"strip-literal": "^3.1.0",
|
|
125
|
-
"tinyexec": "^1.
|
|
122
|
+
"tinyexec": "^1.1.1",
|
|
126
123
|
"tinyglobby": "^0.2.15",
|
|
127
124
|
"ufo": "^1.6.3",
|
|
128
125
|
"ultrahtml": "^1.6.0",
|
|
129
126
|
"unplugin": "^3.0.0"
|
|
130
127
|
},
|
|
131
128
|
"devDependencies": {
|
|
132
|
-
"@antfu/eslint-config": "^
|
|
129
|
+
"@antfu/eslint-config": "^8.0.0",
|
|
130
|
+
"@fontsource/noto-sans-sc": "^5.2.9",
|
|
133
131
|
"@iconify-json/carbon": "^1.2.20",
|
|
134
132
|
"@iconify-json/logos": "^1.2.11",
|
|
135
133
|
"@iconify-json/noto": "^1.2.7",
|
|
@@ -138,12 +136,13 @@
|
|
|
138
136
|
"@img/sharp-linux-x64": "^0.34.5",
|
|
139
137
|
"@nuxt/content": "^3.12.0",
|
|
140
138
|
"@nuxt/devtools": "^3.2.4",
|
|
139
|
+
"@nuxt/devtools-kit": "^3.2.4",
|
|
141
140
|
"@nuxt/fonts": "^0.14.0",
|
|
142
141
|
"@nuxt/icon": "^2.2.1",
|
|
143
142
|
"@nuxt/image": "^2.0.0",
|
|
144
143
|
"@nuxt/module-builder": "^1.0.2",
|
|
145
144
|
"@nuxt/test-utils": "^4.0.0",
|
|
146
|
-
"@nuxt/ui": "^4.6.
|
|
145
|
+
"@nuxt/ui": "^4.6.1",
|
|
147
146
|
"@nuxtjs/color-mode": "^4.0.0",
|
|
148
147
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
149
148
|
"@nuxtjs/i18n": "^10.2.4",
|
|
@@ -160,7 +159,7 @@
|
|
|
160
159
|
"@vueuse/nuxt": "^14.2.1",
|
|
161
160
|
"birpc": "^4.0.0",
|
|
162
161
|
"bumpp": "^11.0.1",
|
|
163
|
-
"eslint": "^10.
|
|
162
|
+
"eslint": "^10.2.0",
|
|
164
163
|
"eslint-plugin-harlanzw": "^0.12.0",
|
|
165
164
|
"fontless": "^0.2.1",
|
|
166
165
|
"get-image-colors": "^4.0.1",
|
|
@@ -169,18 +168,20 @@
|
|
|
169
168
|
"jest-image-snapshot": "^6.5.2",
|
|
170
169
|
"lightningcss": "^1.32.0",
|
|
171
170
|
"nuxt": "^4.4.2",
|
|
172
|
-
"
|
|
173
|
-
"playwright
|
|
174
|
-
"
|
|
171
|
+
"nuxtseo-layer-devtools": "^5.1.1",
|
|
172
|
+
"playwright": "^1.59.1",
|
|
173
|
+
"playwright-core": "^1.59.1",
|
|
174
|
+
"sass": "^1.99.0",
|
|
175
175
|
"satori": "^0.26.0",
|
|
176
176
|
"sharp": "^0.34.5",
|
|
177
|
+
"sirv": "^3.0.2",
|
|
177
178
|
"tailwindcss": "^4.2.2",
|
|
178
179
|
"typescript": "^6.0.2",
|
|
179
180
|
"unifont": "^0.7.4",
|
|
180
181
|
"unocss": "^66.6.7",
|
|
181
|
-
"vitest": "^4.1.
|
|
182
|
+
"vitest": "^4.1.3",
|
|
182
183
|
"vue-tsc": "^3.2.6",
|
|
183
|
-
"wrangler": "^4.
|
|
184
|
+
"wrangler": "^4.80.0",
|
|
184
185
|
"yoga-wasm-web": "^0.3.3"
|
|
185
186
|
},
|
|
186
187
|
"scripts": {
|