nuxt-og-image 5.1.12 → 6.0.0-beta.1
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 +2 -2
- package/bin/cli.mjs +2 -0
- package/dist/chunks/tw4-classes.cjs +116 -0
- package/dist/chunks/tw4-classes.mjs +113 -0
- package/dist/chunks/tw4-generator.cjs +118 -0
- package/dist/chunks/tw4-generator.mjs +110 -0
- package/dist/cli.cjs +333 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +330 -0
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_fonts/0xp3SbCWC1OhX7q1-uF6kilMZFm-alJNkUtkLTPCy_A-tN9KwPUWhhXvtqh74sU9FIkI4W6hsbm85r0X24hjOfM.woff2 +0 -0
- package/dist/client/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-D6hedAgqRfOCLZzaShnyeAvlEnMzk4Wm7g9WDKWFHIc.woff +0 -0
- package/dist/client/_fonts/4HA9tc4y8BVQeLXvLn3JgQqilAj1xrAnUSprQGHIPSw-ZPswEL_UDOYaxTLQDUySPjoOHDxhD83pD19HMfKfK9s.woff2 +0 -0
- package/dist/client/_fonts/Bmul3LaKlc7BUKqJHE_UmEoF40Sg_2ga52yJjwyDcKs-TnYmYl1DNYkiWMu0Vx49DakCPBuiCCj9zoLIuQjUdKY.woff2 +0 -0
- package/dist/client/_fonts/DfgmjWGpWte3Q3a54Nevr_BYmMM5YEJXRI1CdI2VwO0-ox5RadQfCyVTmKl_hubTaIJjtRw9oaQz2GDBeZR6l1M.woff2 +0 -0
- package/dist/client/_fonts/Lc_5lWuBuZcZ166p1-s-mnGkMJwIYJE_QDCkws8iCkI-r45Qbm2hCykrfOZ0kowz__uTTTUOPDN9hz34QcRNTY4.woff2 +0 -0
- package/dist/client/_fonts/iEvApgDRmzKzNqOYocBTrmcHZmuGAJloawKDP1S0nyE-T3oc_9We24QGwfw5naik4cM0g7VxylWVaQwKm4dy3cw.woff2 +0 -0
- package/dist/client/_nuxt/0kYTU2a7.js +2 -0
- package/dist/client/_nuxt/B0QDx5EE.js +2 -0
- package/dist/client/_nuxt/BKqzYw6x.js +3 -0
- package/dist/client/_nuxt/C-Ivr2Rl.js +1 -0
- package/dist/client/_nuxt/CLgn8DCr.js +1 -0
- package/dist/client/_nuxt/CwWm-XE3.js +1 -0
- package/dist/client/_nuxt/D9eL2h5z.js +1 -0
- package/dist/client/_nuxt/DJXHIJSq.js +1 -0
- package/dist/client/_nuxt/DVnX3Z-O.js +1 -0
- package/dist/client/_nuxt/DXObZt09.js +184 -0
- package/dist/client/_nuxt/Dxi6QG7I.js +1 -0
- package/dist/client/_nuxt/E8AZ6HoH.js +1 -0
- package/dist/client/_nuxt/IFrameLoader.CGrV1TpP.css +1 -0
- package/dist/client/_nuxt/JAMwWy1K.js +3864 -0
- package/dist/client/_nuxt/OSectionBlock.BVHnMsIr.css +1 -0
- package/dist/client/_nuxt/PONEy9N-.js +1 -0
- package/dist/client/_nuxt/UdkqSAsD.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/5205806b-8e5a-41ea-90c0-9cd83a75fc0a.json +1 -0
- package/dist/client/_nuxt/entry.BEExJd9R.css +2 -0
- package/dist/client/_nuxt/error-404.B79WD2X-.css +1 -0
- package/dist/client/_nuxt/error-500.DT3Sd0Wu.css +1 -0
- package/dist/client/_nuxt/pages.eW3hi7XF.css +1 -0
- package/dist/client/_nuxt/templates.dUiUBaip.css +1 -0
- package/dist/client/_payload.json +1 -0
- package/dist/client/debug/_payload.json +1 -0
- package/dist/client/debug/index.html +1 -0
- package/dist/client/docs/_payload.json +1 -0
- package/dist/client/docs/index.html +1 -0
- package/dist/client/fonts/HubotSans-Regular.woff2 +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/templates/_payload.json +1 -0
- package/dist/client/templates/index.html +1 -0
- package/dist/content.cjs +6 -6
- package/dist/content.d.cts +13 -13
- package/dist/content.d.mts +13 -13
- package/dist/content.d.ts +13 -13
- package/dist/content.mjs +1 -1
- package/dist/module.cjs +36 -1025
- package/dist/module.d.cts +63 -23
- package/dist/module.d.mts +63 -23
- package/dist/module.d.ts +63 -23
- package/dist/module.json +1 -1
- package/dist/module.mjs +32 -1007
- package/dist/runtime/app/components/Templates/Community/Brutalist.satori.d.vue.ts +14 -0
- package/dist/runtime/app/components/Templates/Community/Brutalist.satori.vue +51 -0
- package/dist/runtime/app/components/Templates/Community/Brutalist.satori.vue.d.ts +14 -0
- package/dist/runtime/app/components/Templates/Community/{Frame.vue.d.ts → Frame.satori.d.vue.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/Frame.satori.vue +71 -0
- package/dist/runtime/app/components/Templates/Community/{Frame.d.vue.ts → Frame.satori.vue.d.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/Newspaper.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Newspaper.satori.vue +70 -0
- package/dist/runtime/app/components/Templates/Community/Newspaper.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Nuxt.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/{Nuxt.vue → Nuxt.satori.vue} +3 -3
- package/dist/runtime/app/components/Templates/Community/Nuxt.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.satori.vue +69 -0
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Pergel.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/{Pergel.vue → Pergel.satori.vue} +14 -11
- package/dist/runtime/app/components/Templates/Community/Pergel.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Retro.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Retro.satori.vue +64 -0
- package/dist/runtime/app/components/Templates/Community/Retro.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/SaaS.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/SaaS.satori.vue +60 -0
- package/dist/runtime/app/components/Templates/Community/SaaS.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.satori.d.vue.ts +9 -0
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.satori.vue +38 -0
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.satori.vue.d.ts +9 -0
- package/dist/runtime/app/components/Templates/Community/{UnJs.d.vue.ts → UnJs.satori.d.vue.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/{UnJs.vue → UnJs.satori.vue} +41 -33
- package/dist/runtime/app/components/Templates/Community/{UnJs.vue.d.ts → UnJs.satori.vue.d.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/WithEmoji.satori.d.vue.ts +13 -0
- package/dist/runtime/app/components/Templates/Community/WithEmoji.satori.vue +27 -0
- package/dist/runtime/app/components/Templates/Community/WithEmoji.satori.vue.d.ts +13 -0
- package/dist/runtime/app/composables/_defineOgImageRaw.d.ts +6 -0
- package/dist/runtime/app/composables/_defineOgImageRaw.js +70 -0
- package/dist/runtime/app/composables/defineOgImage.d.ts +14 -2
- package/dist/runtime/app/composables/defineOgImage.js +13 -42
- package/dist/runtime/app/composables/defineOgImageComponent.d.ts +5 -1
- package/dist/runtime/app/composables/defineOgImageComponent.js +4 -5
- package/dist/runtime/app/composables/defineOgImageScreenshot.d.ts +1 -1
- package/dist/runtime/app/composables/defineOgImageScreenshot.js +2 -2
- package/dist/runtime/app/composables/mock.d.ts +7 -4
- package/dist/runtime/app/composables/mock.js +4 -4
- package/dist/runtime/app/utils/plugins.js +22 -28
- package/dist/runtime/app/utils.d.ts +15 -1
- package/dist/runtime/app/utils.js +74 -46
- package/dist/runtime/pure.d.ts +7 -0
- package/dist/runtime/pure.js +105 -0
- package/dist/runtime/server/og-image/bindings/css-inline/wasm-fs.d.ts +3 -2
- package/dist/runtime/server/og-image/bindings/css-inline/wasm.d.ts +3 -2
- package/dist/runtime/server/og-image/bindings/font-assets/cloudflare.d.ts +3 -0
- package/dist/runtime/server/og-image/bindings/font-assets/cloudflare.js +22 -0
- package/dist/runtime/server/og-image/bindings/font-assets/dev-prerender.d.ts +3 -0
- package/dist/runtime/server/og-image/bindings/font-assets/dev-prerender.js +49 -0
- package/dist/runtime/server/og-image/bindings/font-assets/node.d.ts +3 -0
- package/dist/runtime/server/og-image/bindings/font-assets/node.js +14 -0
- package/dist/runtime/server/og-image/bindings/resvg/node-dev.d.ts +5 -0
- package/dist/runtime/server/og-image/bindings/resvg/node-dev.js +70 -0
- package/dist/runtime/server/og-image/bindings/satori/wasm-fs.d.ts +1 -1
- package/dist/runtime/server/og-image/bindings/satori/wasm-fs.js +4 -8
- package/dist/runtime/server/og-image/bindings/satori/wasm.d.ts +1 -1
- package/dist/runtime/server/og-image/bindings/satori/wasm.js +4 -9
- package/dist/runtime/server/og-image/bindings/takumi/node.d.ts +6 -0
- package/dist/runtime/server/og-image/bindings/takumi/node.js +5 -0
- package/dist/runtime/server/og-image/bindings/takumi/wasm.d.ts +6 -0
- package/dist/runtime/server/og-image/bindings/takumi/wasm.js +6 -0
- package/dist/runtime/server/og-image/cache/buildCache.d.ts +16 -0
- package/dist/runtime/server/og-image/cache/buildCache.js +48 -0
- package/dist/runtime/server/og-image/cache/lru.d.ts +2 -2
- package/dist/runtime/server/og-image/cache/lru.js +3 -3
- package/dist/runtime/server/og-image/cache/mock.d.ts +1 -2
- package/dist/runtime/server/og-image/cache/mock.js +0 -1
- package/dist/runtime/server/og-image/chromium/screenshot.js +4 -3
- package/dist/runtime/server/og-image/context.d.ts +2 -3
- package/dist/runtime/server/og-image/context.js +56 -195
- package/dist/runtime/server/og-image/devtools.d.ts +10 -0
- package/dist/runtime/server/og-image/devtools.js +74 -0
- package/dist/runtime/server/og-image/fonts.d.ts +6 -0
- package/dist/runtime/server/og-image/fonts.js +41 -0
- package/dist/runtime/server/og-image/instances.d.ts +1 -0
- package/dist/runtime/server/og-image/instances.js +5 -0
- package/dist/runtime/server/og-image/satori/instances.d.ts +1 -36
- package/dist/runtime/server/og-image/satori/plugins/emojis.js +83 -4
- package/dist/runtime/server/og-image/satori/plugins/encoding.js +11 -1
- package/dist/runtime/server/og-image/satori/plugins/imageSrc.js +5 -1
- package/dist/runtime/server/og-image/satori/plugins/twClasses.js +35 -0
- package/dist/runtime/server/og-image/satori/renderer.js +16 -53
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-names-minimal.d.ts +1 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-names-minimal.js +223 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-utils.d.ts +45 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-utils.js +13 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/fetch.d.ts +6 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/fetch.js +38 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/index.d.ts +7 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/index.js +64 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/local.d.ts +7 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/local.js +32 -0
- package/dist/runtime/server/og-image/satori/utils.js +5 -4
- package/dist/runtime/server/og-image/satori/vnodes.js +7 -6
- package/dist/runtime/server/og-image/takumi/instances.d.ts +1 -0
- package/dist/runtime/server/og-image/takumi/instances.js +6 -0
- package/dist/runtime/server/og-image/takumi/nodes.d.ts +12 -0
- package/dist/runtime/server/og-image/takumi/nodes.js +86 -0
- package/dist/runtime/server/og-image/takumi/renderer.d.ts +3 -0
- package/dist/runtime/server/og-image/takumi/renderer.js +45 -0
- package/dist/runtime/server/og-image/templates/html.js +32 -23
- package/dist/runtime/server/plugins/prerender.d.ts +1 -1
- package/dist/runtime/server/plugins/prerender.js +17 -7
- package/dist/runtime/server/util/auto-eject.d.ts +2 -0
- package/dist/runtime/server/util/auto-eject.js +30 -0
- package/dist/runtime/server/util/eventHandlers.d.ts +0 -1
- package/dist/runtime/server/util/eventHandlers.js +15 -85
- package/dist/runtime/server/util/options.d.ts +7 -2
- package/dist/runtime/server/util/options.js +40 -6
- package/dist/runtime/server/util/wasm.d.ts +1 -1
- package/dist/runtime/server/utils.d.ts +6 -2
- package/dist/runtime/server/utils.js +12 -8
- package/dist/runtime/shared/urlEncoding.d.ts +64 -0
- package/dist/runtime/shared/urlEncoding.js +194 -0
- package/dist/runtime/shared.d.ts +4 -9
- package/dist/runtime/shared.js +31 -50
- package/dist/runtime/types.d.ts +71 -25
- package/dist/shared/nuxt-og-image.DroaQ3v-.cjs +2852 -0
- package/dist/shared/nuxt-og-image.HMyihp-D.mjs +2825 -0
- package/dist/types.d.mts +2 -0
- package/package.json +119 -56
- package/types/virtual.d.ts +7 -1
- package/dist/client/_nuxt/B8PEiB0p.js +0 -1
- package/dist/client/_nuxt/CD9VIl4i.js +0 -4062
- package/dist/client/_nuxt/CI_lqgv7.js +0 -1
- package/dist/client/_nuxt/CVO1_9PV.js +0 -1
- package/dist/client/_nuxt/Cp-IABpG.js +0 -1
- package/dist/client/_nuxt/D0r3Knsf.js +0 -1
- package/dist/client/_nuxt/Dz8kdfgF.js +0 -1
- package/dist/client/_nuxt/builds/meta/71b0f7ea-9aae-4c28-bbd9-8eea71b82dfb.json +0 -1
- package/dist/client/_nuxt/entry.DNM8P-MU.css +0 -1
- package/dist/client/_nuxt/error-404.C2mGI6Vt.css +0 -1
- package/dist/client/_nuxt/error-500.ClHbVBiL.css +0 -1
- package/dist/client/_nuxt/l5rcX3cq.js +0 -8
- package/dist/runtime/app/components/OgImage/OgImage.d.ts +0 -3
- package/dist/runtime/app/components/OgImage/OgImage.js +0 -10
- package/dist/runtime/app/components/Templates/Community/BrandedLogo.d.vue.ts +0 -13
- package/dist/runtime/app/components/Templates/Community/BrandedLogo.vue +0 -22
- package/dist/runtime/app/components/Templates/Community/BrandedLogo.vue.d.ts +0 -13
- package/dist/runtime/app/components/Templates/Community/Frame.vue +0 -58
- package/dist/runtime/app/components/Templates/Community/Nuxt.d.vue.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/Nuxt.vue.d.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.d.vue.ts +0 -15
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.vue +0 -103
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.vue.d.ts +0 -15
- package/dist/runtime/app/components/Templates/Community/Pergel.d.vue.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/Pergel.vue.d.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.d.vue.ts +0 -9
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.vue +0 -27
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.vue.d.ts +0 -9
- package/dist/runtime/app/components/Templates/Community/Wave.d.vue.ts +0 -11
- package/dist/runtime/app/components/Templates/Community/Wave.vue +0 -28
- package/dist/runtime/app/components/Templates/Community/Wave.vue.d.ts +0 -11
- package/dist/runtime/app/components/Templates/Community/WithEmoji.d.vue.ts +0 -13
- package/dist/runtime/app/components/Templates/Community/WithEmoji.vue +0 -21
- package/dist/runtime/app/components/Templates/Community/WithEmoji.vue.d.ts +0 -13
- package/dist/runtime/assets/Inter-normal-400.ttf.base64 +0 -1
- package/dist/runtime/assets/Inter-normal-700.ttf.base64 +0 -1
- package/dist/runtime/server/og-image/satori/font.d.ts +0 -3
- package/dist/runtime/server/og-image/satori/font.js +0 -40
- package/dist/runtime/server/og-image/satori/plugins/unocss.js +0 -55
- package/dist/runtime/server/og-image/satori/transforms/emojis.d.ts +0 -3
- package/dist/runtime/server/og-image/satori/transforms/emojis.js +0 -3595
- package/dist/runtime/server/plugins/__zero-runtime/nuxt-content-v2.d.ts +0 -2
- package/dist/runtime/server/plugins/__zero-runtime/nuxt-content-v2.js +0 -9
- package/dist/runtime/server/plugins/nuxt-content-v2.d.ts +0 -2
- package/dist/runtime/server/plugins/nuxt-content-v2.js +0 -5
- package/dist/runtime/server/routes/__zero-runtime/font.d.ts +0 -2
- package/dist/runtime/server/routes/__zero-runtime/font.js +0 -8
- package/dist/runtime/server/routes/font.d.ts +0 -2
- package/dist/runtime/server/routes/font.js +0 -3
- package/dist/runtime/server/util/plugins.d.ts +0 -2
- package/dist/runtime/server/util/plugins.js +0 -56
- /package/dist/runtime/server/og-image/satori/plugins/{unocss.d.ts → twClasses.d.ts} +0 -0
package/dist/module.d.cts
CHANGED
|
@@ -3,7 +3,8 @@ import { AddComponentOptions } from '@nuxt/kit';
|
|
|
3
3
|
import { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
4
4
|
import { SatoriOptions } from 'satori';
|
|
5
5
|
import { SharpOptions } from 'sharp';
|
|
6
|
-
import {
|
|
6
|
+
import { OgImageComponent, OgImageOptions, CompatibilityFlagEnvOverrides } from '../dist/runtime/types.js';
|
|
7
|
+
export { OgImageComponent, OgImageOptions, OgImageRenderEventContext, OgImageRuntimeConfig, RuntimeCompatibilitySchema, VNode } from '../dist/runtime/types.js';
|
|
7
8
|
|
|
8
9
|
interface ModuleOptions {
|
|
9
10
|
/**
|
|
@@ -20,12 +21,6 @@ interface ModuleOptions {
|
|
|
20
21
|
* @default { component: 'NuxtSeo', width: 1200, height: 630, cache: true, cacheTtl: 24 * 60 * 60 * 1000 }
|
|
21
22
|
*/
|
|
22
23
|
defaults: OgImageOptions;
|
|
23
|
-
/**
|
|
24
|
-
* Fonts to use when rendering the og:image.
|
|
25
|
-
*
|
|
26
|
-
* @example ['Roboto:400', 'Roboto:700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
|
|
27
|
-
*/
|
|
28
|
-
fonts: InputFontConfig[];
|
|
29
24
|
/**
|
|
30
25
|
* Options to pass to satori.
|
|
31
26
|
*
|
|
@@ -55,19 +50,32 @@ interface ModuleOptions {
|
|
|
55
50
|
*/
|
|
56
51
|
componentOptions?: Pick<AddComponentOptions, 'global'>;
|
|
57
52
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
53
|
+
* Configure the runtime cache storage for generated OG images.
|
|
54
|
+
* - `true` - Use Nitro's default cache storage (default)
|
|
55
|
+
* - `false` - Disable caching
|
|
56
|
+
* - `string` - Use a custom storage mount key (e.g., `'redis'`). You must mount the storage yourself via a Nitro plugin.
|
|
57
|
+
* - `object` - Provide a driver config that the module will mount for you (build-time only)
|
|
63
58
|
*
|
|
64
59
|
* @default true
|
|
65
60
|
* @see https://nitro.unjs.io/guide/storage#mountpoints
|
|
66
|
-
* @example
|
|
61
|
+
* @example runtimeCacheStorage: 'redis' // Use your own mounted 'redis' storage
|
|
62
|
+
* @example runtimeCacheStorage: { driver: 'redis', host: 'localhost', port: 6379 }
|
|
67
63
|
*/
|
|
68
|
-
runtimeCacheStorage: boolean | (Record<string, any> & {
|
|
64
|
+
runtimeCacheStorage: boolean | string | (Record<string, any> & {
|
|
69
65
|
driver: string;
|
|
70
66
|
});
|
|
67
|
+
/**
|
|
68
|
+
* Custom version string for cache key namespacing.
|
|
69
|
+
*
|
|
70
|
+
* By default, the module version is used which invalidates cache on upgrades.
|
|
71
|
+
* Set a static value like `'v1'` to persist cache across module updates.
|
|
72
|
+
* Set to `false` to disable versioning entirely.
|
|
73
|
+
*
|
|
74
|
+
* @default module version
|
|
75
|
+
* @example cacheVersion: 'v1'
|
|
76
|
+
* @example cacheVersion: false
|
|
77
|
+
*/
|
|
78
|
+
cacheVersion?: string | false;
|
|
71
79
|
/**
|
|
72
80
|
* Extra component directories that should be used to resolve components.
|
|
73
81
|
*
|
|
@@ -79,23 +87,55 @@ interface ModuleOptions {
|
|
|
79
87
|
*/
|
|
80
88
|
compatibility?: CompatibilityFlagEnvOverrides;
|
|
81
89
|
/**
|
|
82
|
-
*
|
|
90
|
+
* Only allow the prerendering and dev runtimes to generate images.
|
|
91
|
+
*/
|
|
92
|
+
zeroRuntime?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Enable persistent build cache for CI environments.
|
|
95
|
+
* Caches rendered images to disk so they persist between CI runs.
|
|
83
96
|
*
|
|
84
|
-
*
|
|
97
|
+
* @default false
|
|
98
|
+
* @example true
|
|
99
|
+
* @example { base: '.cache/og-image' }
|
|
85
100
|
*/
|
|
86
|
-
|
|
101
|
+
buildCache?: boolean | {
|
|
102
|
+
base?: string;
|
|
103
|
+
};
|
|
87
104
|
/**
|
|
88
|
-
*
|
|
105
|
+
* Warn about OG Image components missing renderer suffix in dev mode.
|
|
106
|
+
* Set to false to suppress warnings for legacy/test components.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
89
109
|
*/
|
|
90
|
-
|
|
110
|
+
warnMissingSuffix?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Strategy for resolving emoji icons.
|
|
113
|
+
*
|
|
114
|
+
* - 'auto': Automatically choose based on available dependencies (default)
|
|
115
|
+
* - 'local': Use local @iconify-json dependencies only
|
|
116
|
+
* - 'fetch': Use Iconify API to fetch emojis
|
|
117
|
+
*
|
|
118
|
+
* @default 'auto'
|
|
119
|
+
*/
|
|
120
|
+
emojiStrategy?: 'auto' | 'local' | 'fetch';
|
|
121
|
+
/**
|
|
122
|
+
* Include query parameters in cache keys.
|
|
123
|
+
*
|
|
124
|
+
* When enabled, requests like `/page?foo=bar` will have a separate cache from `/page`.
|
|
125
|
+
* Enable this if your OG image content depends on query params.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
cacheQueryParams?: boolean;
|
|
91
130
|
/**
|
|
92
|
-
*
|
|
131
|
+
* Path to your Tailwind CSS 4 entry file for OG image styling.
|
|
93
132
|
*
|
|
94
|
-
*
|
|
133
|
+
* Use this when using Tailwind 4 with the Vite plugin instead of @nuxtjs/tailwindcss.
|
|
134
|
+
* The CSS file should include `@import "tailwindcss"` and any `@theme` customizations.
|
|
95
135
|
*
|
|
96
|
-
*
|
|
136
|
+
* @example '~/assets/css/main.css'
|
|
97
137
|
*/
|
|
98
|
-
|
|
138
|
+
tailwindCss?: string;
|
|
99
139
|
}
|
|
100
140
|
interface ModuleHooks {
|
|
101
141
|
'nuxt-og-image:components': (ctx: {
|
package/dist/module.d.mts
CHANGED
|
@@ -3,7 +3,8 @@ import { AddComponentOptions } from '@nuxt/kit';
|
|
|
3
3
|
import { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
4
4
|
import { SatoriOptions } from 'satori';
|
|
5
5
|
import { SharpOptions } from 'sharp';
|
|
6
|
-
import {
|
|
6
|
+
import { OgImageComponent, OgImageOptions, CompatibilityFlagEnvOverrides } from '../dist/runtime/types.js';
|
|
7
|
+
export { OgImageComponent, OgImageOptions, OgImageRenderEventContext, OgImageRuntimeConfig, RuntimeCompatibilitySchema, VNode } from '../dist/runtime/types.js';
|
|
7
8
|
|
|
8
9
|
interface ModuleOptions {
|
|
9
10
|
/**
|
|
@@ -20,12 +21,6 @@ interface ModuleOptions {
|
|
|
20
21
|
* @default { component: 'NuxtSeo', width: 1200, height: 630, cache: true, cacheTtl: 24 * 60 * 60 * 1000 }
|
|
21
22
|
*/
|
|
22
23
|
defaults: OgImageOptions;
|
|
23
|
-
/**
|
|
24
|
-
* Fonts to use when rendering the og:image.
|
|
25
|
-
*
|
|
26
|
-
* @example ['Roboto:400', 'Roboto:700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
|
|
27
|
-
*/
|
|
28
|
-
fonts: InputFontConfig[];
|
|
29
24
|
/**
|
|
30
25
|
* Options to pass to satori.
|
|
31
26
|
*
|
|
@@ -55,19 +50,32 @@ interface ModuleOptions {
|
|
|
55
50
|
*/
|
|
56
51
|
componentOptions?: Pick<AddComponentOptions, 'global'>;
|
|
57
52
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
53
|
+
* Configure the runtime cache storage for generated OG images.
|
|
54
|
+
* - `true` - Use Nitro's default cache storage (default)
|
|
55
|
+
* - `false` - Disable caching
|
|
56
|
+
* - `string` - Use a custom storage mount key (e.g., `'redis'`). You must mount the storage yourself via a Nitro plugin.
|
|
57
|
+
* - `object` - Provide a driver config that the module will mount for you (build-time only)
|
|
63
58
|
*
|
|
64
59
|
* @default true
|
|
65
60
|
* @see https://nitro.unjs.io/guide/storage#mountpoints
|
|
66
|
-
* @example
|
|
61
|
+
* @example runtimeCacheStorage: 'redis' // Use your own mounted 'redis' storage
|
|
62
|
+
* @example runtimeCacheStorage: { driver: 'redis', host: 'localhost', port: 6379 }
|
|
67
63
|
*/
|
|
68
|
-
runtimeCacheStorage: boolean | (Record<string, any> & {
|
|
64
|
+
runtimeCacheStorage: boolean | string | (Record<string, any> & {
|
|
69
65
|
driver: string;
|
|
70
66
|
});
|
|
67
|
+
/**
|
|
68
|
+
* Custom version string for cache key namespacing.
|
|
69
|
+
*
|
|
70
|
+
* By default, the module version is used which invalidates cache on upgrades.
|
|
71
|
+
* Set a static value like `'v1'` to persist cache across module updates.
|
|
72
|
+
* Set to `false` to disable versioning entirely.
|
|
73
|
+
*
|
|
74
|
+
* @default module version
|
|
75
|
+
* @example cacheVersion: 'v1'
|
|
76
|
+
* @example cacheVersion: false
|
|
77
|
+
*/
|
|
78
|
+
cacheVersion?: string | false;
|
|
71
79
|
/**
|
|
72
80
|
* Extra component directories that should be used to resolve components.
|
|
73
81
|
*
|
|
@@ -79,23 +87,55 @@ interface ModuleOptions {
|
|
|
79
87
|
*/
|
|
80
88
|
compatibility?: CompatibilityFlagEnvOverrides;
|
|
81
89
|
/**
|
|
82
|
-
*
|
|
90
|
+
* Only allow the prerendering and dev runtimes to generate images.
|
|
91
|
+
*/
|
|
92
|
+
zeroRuntime?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Enable persistent build cache for CI environments.
|
|
95
|
+
* Caches rendered images to disk so they persist between CI runs.
|
|
83
96
|
*
|
|
84
|
-
*
|
|
97
|
+
* @default false
|
|
98
|
+
* @example true
|
|
99
|
+
* @example { base: '.cache/og-image' }
|
|
85
100
|
*/
|
|
86
|
-
|
|
101
|
+
buildCache?: boolean | {
|
|
102
|
+
base?: string;
|
|
103
|
+
};
|
|
87
104
|
/**
|
|
88
|
-
*
|
|
105
|
+
* Warn about OG Image components missing renderer suffix in dev mode.
|
|
106
|
+
* Set to false to suppress warnings for legacy/test components.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
89
109
|
*/
|
|
90
|
-
|
|
110
|
+
warnMissingSuffix?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Strategy for resolving emoji icons.
|
|
113
|
+
*
|
|
114
|
+
* - 'auto': Automatically choose based on available dependencies (default)
|
|
115
|
+
* - 'local': Use local @iconify-json dependencies only
|
|
116
|
+
* - 'fetch': Use Iconify API to fetch emojis
|
|
117
|
+
*
|
|
118
|
+
* @default 'auto'
|
|
119
|
+
*/
|
|
120
|
+
emojiStrategy?: 'auto' | 'local' | 'fetch';
|
|
121
|
+
/**
|
|
122
|
+
* Include query parameters in cache keys.
|
|
123
|
+
*
|
|
124
|
+
* When enabled, requests like `/page?foo=bar` will have a separate cache from `/page`.
|
|
125
|
+
* Enable this if your OG image content depends on query params.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
cacheQueryParams?: boolean;
|
|
91
130
|
/**
|
|
92
|
-
*
|
|
131
|
+
* Path to your Tailwind CSS 4 entry file for OG image styling.
|
|
93
132
|
*
|
|
94
|
-
*
|
|
133
|
+
* Use this when using Tailwind 4 with the Vite plugin instead of @nuxtjs/tailwindcss.
|
|
134
|
+
* The CSS file should include `@import "tailwindcss"` and any `@theme` customizations.
|
|
95
135
|
*
|
|
96
|
-
*
|
|
136
|
+
* @example '~/assets/css/main.css'
|
|
97
137
|
*/
|
|
98
|
-
|
|
138
|
+
tailwindCss?: string;
|
|
99
139
|
}
|
|
100
140
|
interface ModuleHooks {
|
|
101
141
|
'nuxt-og-image:components': (ctx: {
|
package/dist/module.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { AddComponentOptions } from '@nuxt/kit';
|
|
|
3
3
|
import { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
4
4
|
import { SatoriOptions } from 'satori';
|
|
5
5
|
import { SharpOptions } from 'sharp';
|
|
6
|
-
import {
|
|
6
|
+
import { OgImageComponent, OgImageOptions, CompatibilityFlagEnvOverrides } from '../dist/runtime/types.js';
|
|
7
|
+
export { OgImageComponent, OgImageOptions, OgImageRenderEventContext, OgImageRuntimeConfig, RuntimeCompatibilitySchema, VNode } from '../dist/runtime/types.js';
|
|
7
8
|
|
|
8
9
|
interface ModuleOptions {
|
|
9
10
|
/**
|
|
@@ -20,12 +21,6 @@ interface ModuleOptions {
|
|
|
20
21
|
* @default { component: 'NuxtSeo', width: 1200, height: 630, cache: true, cacheTtl: 24 * 60 * 60 * 1000 }
|
|
21
22
|
*/
|
|
22
23
|
defaults: OgImageOptions;
|
|
23
|
-
/**
|
|
24
|
-
* Fonts to use when rendering the og:image.
|
|
25
|
-
*
|
|
26
|
-
* @example ['Roboto:400', 'Roboto:700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
|
|
27
|
-
*/
|
|
28
|
-
fonts: InputFontConfig[];
|
|
29
24
|
/**
|
|
30
25
|
* Options to pass to satori.
|
|
31
26
|
*
|
|
@@ -55,19 +50,32 @@ interface ModuleOptions {
|
|
|
55
50
|
*/
|
|
56
51
|
componentOptions?: Pick<AddComponentOptions, 'global'>;
|
|
57
52
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
53
|
+
* Configure the runtime cache storage for generated OG images.
|
|
54
|
+
* - `true` - Use Nitro's default cache storage (default)
|
|
55
|
+
* - `false` - Disable caching
|
|
56
|
+
* - `string` - Use a custom storage mount key (e.g., `'redis'`). You must mount the storage yourself via a Nitro plugin.
|
|
57
|
+
* - `object` - Provide a driver config that the module will mount for you (build-time only)
|
|
63
58
|
*
|
|
64
59
|
* @default true
|
|
65
60
|
* @see https://nitro.unjs.io/guide/storage#mountpoints
|
|
66
|
-
* @example
|
|
61
|
+
* @example runtimeCacheStorage: 'redis' // Use your own mounted 'redis' storage
|
|
62
|
+
* @example runtimeCacheStorage: { driver: 'redis', host: 'localhost', port: 6379 }
|
|
67
63
|
*/
|
|
68
|
-
runtimeCacheStorage: boolean | (Record<string, any> & {
|
|
64
|
+
runtimeCacheStorage: boolean | string | (Record<string, any> & {
|
|
69
65
|
driver: string;
|
|
70
66
|
});
|
|
67
|
+
/**
|
|
68
|
+
* Custom version string for cache key namespacing.
|
|
69
|
+
*
|
|
70
|
+
* By default, the module version is used which invalidates cache on upgrades.
|
|
71
|
+
* Set a static value like `'v1'` to persist cache across module updates.
|
|
72
|
+
* Set to `false` to disable versioning entirely.
|
|
73
|
+
*
|
|
74
|
+
* @default module version
|
|
75
|
+
* @example cacheVersion: 'v1'
|
|
76
|
+
* @example cacheVersion: false
|
|
77
|
+
*/
|
|
78
|
+
cacheVersion?: string | false;
|
|
71
79
|
/**
|
|
72
80
|
* Extra component directories that should be used to resolve components.
|
|
73
81
|
*
|
|
@@ -79,23 +87,55 @@ interface ModuleOptions {
|
|
|
79
87
|
*/
|
|
80
88
|
compatibility?: CompatibilityFlagEnvOverrides;
|
|
81
89
|
/**
|
|
82
|
-
*
|
|
90
|
+
* Only allow the prerendering and dev runtimes to generate images.
|
|
91
|
+
*/
|
|
92
|
+
zeroRuntime?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Enable persistent build cache for CI environments.
|
|
95
|
+
* Caches rendered images to disk so they persist between CI runs.
|
|
83
96
|
*
|
|
84
|
-
*
|
|
97
|
+
* @default false
|
|
98
|
+
* @example true
|
|
99
|
+
* @example { base: '.cache/og-image' }
|
|
85
100
|
*/
|
|
86
|
-
|
|
101
|
+
buildCache?: boolean | {
|
|
102
|
+
base?: string;
|
|
103
|
+
};
|
|
87
104
|
/**
|
|
88
|
-
*
|
|
105
|
+
* Warn about OG Image components missing renderer suffix in dev mode.
|
|
106
|
+
* Set to false to suppress warnings for legacy/test components.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
89
109
|
*/
|
|
90
|
-
|
|
110
|
+
warnMissingSuffix?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Strategy for resolving emoji icons.
|
|
113
|
+
*
|
|
114
|
+
* - 'auto': Automatically choose based on available dependencies (default)
|
|
115
|
+
* - 'local': Use local @iconify-json dependencies only
|
|
116
|
+
* - 'fetch': Use Iconify API to fetch emojis
|
|
117
|
+
*
|
|
118
|
+
* @default 'auto'
|
|
119
|
+
*/
|
|
120
|
+
emojiStrategy?: 'auto' | 'local' | 'fetch';
|
|
121
|
+
/**
|
|
122
|
+
* Include query parameters in cache keys.
|
|
123
|
+
*
|
|
124
|
+
* When enabled, requests like `/page?foo=bar` will have a separate cache from `/page`.
|
|
125
|
+
* Enable this if your OG image content depends on query params.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
cacheQueryParams?: boolean;
|
|
91
130
|
/**
|
|
92
|
-
*
|
|
131
|
+
* Path to your Tailwind CSS 4 entry file for OG image styling.
|
|
93
132
|
*
|
|
94
|
-
*
|
|
133
|
+
* Use this when using Tailwind 4 with the Vite plugin instead of @nuxtjs/tailwindcss.
|
|
134
|
+
* The CSS file should include `@import "tailwindcss"` and any `@theme` customizations.
|
|
95
135
|
*
|
|
96
|
-
*
|
|
136
|
+
* @example '~/assets/css/main.css'
|
|
97
137
|
*/
|
|
98
|
-
|
|
138
|
+
tailwindCss?: string;
|
|
99
139
|
}
|
|
100
140
|
interface ModuleHooks {
|
|
101
141
|
'nuxt-og-image:components': (ctx: {
|