nuxt-og-image 2.0.0-beta.7 → 2.0.0-beta.71

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.
Files changed (117) hide show
  1. package/README.md +312 -97
  2. package/dist/client/200.html +2 -2
  3. package/dist/client/404.html +2 -2
  4. package/dist/client/_nuxt/IconCSS.0f60f096.js +1 -0
  5. package/dist/client/_nuxt/IconCSS.b41b9663.css +1 -0
  6. package/dist/client/_nuxt/ImageLoader.7571516f.css +1 -0
  7. package/dist/client/_nuxt/ImageLoader.87552e43.js +1 -0
  8. package/dist/client/_nuxt/entry.07d246ba.js +143 -0
  9. package/dist/client/_nuxt/entry.1311cc29.css +1 -0
  10. package/dist/client/_nuxt/{error-404.1ff52902.js → error-404.23b0054d.js} +1 -1
  11. package/dist/client/_nuxt/error-404.f3dd5020.css +1 -0
  12. package/dist/client/_nuxt/error-500.06915589.css +1 -0
  13. package/dist/client/_nuxt/{error-500.f7d30da5.js → error-500.6db75894.js} +1 -1
  14. package/dist/client/_nuxt/index.a32ee818.js +1 -0
  15. package/dist/client/_nuxt/index.ffbea0a9.css +1 -0
  16. package/dist/client/_nuxt/options.9bea558a.js +1 -0
  17. package/dist/client/_nuxt/png.d8e4cfeb.js +1 -0
  18. package/dist/client/_nuxt/{shiki.3a930bb8.js → shiki.aaf0d7e1.js} +1 -1
  19. package/dist/client/_nuxt/svg.43caac0d.js +1 -0
  20. package/dist/client/_nuxt/vnodes.574f3876.js +1 -0
  21. package/dist/client/index.html +2 -2
  22. package/dist/client/options/index.html +2 -2
  23. package/dist/client/png/index.html +2 -2
  24. package/dist/client/svg/index.html +2 -2
  25. package/dist/client/vnodes/index.html +2 -2
  26. package/dist/module.d.ts +101 -11
  27. package/dist/module.json +2 -2
  28. package/dist/module.mjs +394 -134
  29. package/dist/runtime/browserUtil.d.ts +1 -0
  30. package/dist/runtime/browserUtil.mjs +10 -5
  31. package/dist/runtime/components/{OgImageDynamic.d.ts → OgImage/Cached.d.ts} +2 -2
  32. package/dist/runtime/components/OgImage/Cached.mjs +10 -0
  33. package/dist/runtime/components/OgImage/Dynamic.d.ts +8 -0
  34. package/dist/runtime/components/{OgImageDynamic.mjs → OgImage/Dynamic.mjs} +3 -3
  35. package/dist/runtime/components/{OgImageScreenshot.d.ts → OgImage/Screenshot.d.ts} +2 -2
  36. package/dist/runtime/components/{OgImageScreenshot.mjs → OgImage/Screenshot.mjs} +2 -2
  37. package/dist/runtime/components/OgImage/Static.d.ts +8 -0
  38. package/dist/runtime/components/{OgImageStatic.mjs → OgImage/Static.mjs} +3 -3
  39. package/dist/runtime/components/{OgImageStatic.d.ts → OgImage/WithoutCache.d.ts} +2 -2
  40. package/dist/runtime/components/OgImage/WithoutCache.mjs +10 -0
  41. package/dist/runtime/components/OgImage/index.d.ts +5 -0
  42. package/dist/runtime/components/OgImage/index.mjs +10 -0
  43. package/dist/runtime/components/OgImageTemplate/Fallback.vue +170 -0
  44. package/dist/runtime/composables/defineOgImage.d.ts +12 -4
  45. package/dist/runtime/composables/defineOgImage.mjs +31 -49
  46. package/dist/runtime/composables/util.d.ts +2 -0
  47. package/dist/runtime/composables/util.mjs +26 -0
  48. package/dist/runtime/nitro/middleware/og.png.mjs +54 -8
  49. package/dist/runtime/nitro/middleware/playground.mjs +4 -3
  50. package/dist/runtime/nitro/plugins/prerender.d.ts +3 -0
  51. package/dist/runtime/nitro/plugins/prerender.mjs +28 -0
  52. package/dist/runtime/nitro/providers/browser/lambda.d.ts +1 -1
  53. package/dist/runtime/nitro/providers/browser/lambda.mjs +3 -3
  54. package/dist/runtime/nitro/providers/browser/{node.mjs → playwright.mjs} +0 -9
  55. package/dist/runtime/nitro/providers/browser/universal.d.ts +1 -0
  56. package/dist/runtime/nitro/providers/browser/universal.mjs +33 -0
  57. package/dist/runtime/nitro/providers/png/resvg-node.d.ts +4 -0
  58. package/dist/runtime/nitro/providers/png/resvg-node.mjs +6 -0
  59. package/dist/runtime/nitro/providers/png/resvg-wasm.d.ts +3 -0
  60. package/dist/runtime/nitro/providers/png/resvg-wasm.mjs +11 -0
  61. package/dist/runtime/nitro/providers/{svg2png/universal.d.ts → png/svg2png.d.ts} +2 -3
  62. package/dist/runtime/nitro/providers/png/svg2png.mjs +11 -0
  63. package/dist/runtime/nitro/providers/satori/{webworker.d.ts → yoga-wasm.d.ts} +2 -3
  64. package/dist/runtime/nitro/providers/satori/{webworker.mjs → yoga-wasm.mjs} +4 -5
  65. package/dist/runtime/nitro/renderers/browser.d.ts +2 -2
  66. package/dist/runtime/nitro/renderers/browser.mjs +14 -10
  67. package/dist/runtime/nitro/renderers/satori/index.d.ts +2 -2
  68. package/dist/runtime/nitro/renderers/satori/index.mjs +27 -32
  69. package/dist/runtime/nitro/renderers/satori/plugins/emojis.d.ts +1 -1
  70. package/dist/runtime/nitro/renderers/satori/plugins/emojis.mjs +19 -6
  71. package/dist/runtime/nitro/renderers/satori/plugins/encoding.d.ts +1 -1
  72. package/dist/runtime/nitro/renderers/satori/plugins/encoding.mjs +5 -7
  73. package/dist/runtime/nitro/renderers/satori/plugins/flex.d.ts +1 -1
  74. package/dist/runtime/nitro/renderers/satori/plugins/flex.mjs +8 -10
  75. package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.d.ts +1 -1
  76. package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.mjs +45 -13
  77. package/dist/runtime/nitro/renderers/satori/plugins/twClasses.d.ts +1 -1
  78. package/dist/runtime/nitro/renderers/satori/plugins/twClasses.mjs +5 -7
  79. package/dist/runtime/nitro/renderers/satori/utils.d.ts +4 -5
  80. package/dist/runtime/nitro/renderers/satori/utils.mjs +28 -17
  81. package/dist/runtime/nitro/routes/debug.d.ts +8 -0
  82. package/dist/runtime/nitro/routes/debug.mjs +14 -0
  83. package/dist/runtime/nitro/routes/font.mjs +2 -2
  84. package/dist/runtime/nitro/routes/html.mjs +102 -27
  85. package/dist/runtime/nitro/routes/options.d.ts +2 -2
  86. package/dist/runtime/nitro/routes/options.mjs +25 -22
  87. package/dist/runtime/nitro/routes/svg.mjs +5 -3
  88. package/dist/runtime/nitro/routes/vnode.mjs +5 -3
  89. package/dist/runtime/nitro/utils-pure.d.ts +2 -2
  90. package/dist/runtime/nitro/utils-pure.mjs +1 -4
  91. package/dist/runtime/nitro/utils.d.ts +11 -11
  92. package/dist/runtime/nitro/utils.mjs +69 -54
  93. package/dist/runtime/public-assets/__nuxt_og_image__/browser-provider-not-supported.png +0 -0
  94. package/dist/runtime/public-assets-optional/resvg/resvg.wasm +0 -0
  95. package/dist/types.d.ts +6 -0
  96. package/package.json +39 -27
  97. package/dist/client/_nuxt/IconCSS.a041aca0.js +0 -1
  98. package/dist/client/_nuxt/ImageLoader.9bf39d71.js +0 -1
  99. package/dist/client/_nuxt/entry.74018bda.js +0 -5
  100. package/dist/client/_nuxt/entry.7a8c1ab2.css +0 -1
  101. package/dist/client/_nuxt/error-404.1469f10f.css +0 -1
  102. package/dist/client/_nuxt/error-500.92b94fae.css +0 -1
  103. package/dist/client/_nuxt/error-component.cf7543e5.js +0 -3
  104. package/dist/client/_nuxt/index.3f356409.js +0 -1
  105. package/dist/client/_nuxt/options.56a3e5f9.js +0 -1
  106. package/dist/client/_nuxt/png.37f3e77b.js +0 -1
  107. package/dist/client/_nuxt/svg.186c6bd1.js +0 -1
  108. package/dist/client/_nuxt/vnodes.a799f183.js +0 -1
  109. package/dist/runtime/components/OgImageBasic.island.vue +0 -92
  110. package/dist/runtime/nitro/providers/svg2png/universal.mjs +0 -9
  111. /package/dist/runtime/nitro/providers/browser/{node.d.ts → playwright.d.ts} +0 -0
  112. /package/dist/runtime/nitro/providers/satori/{node.d.ts → default.d.ts} +0 -0
  113. /package/dist/runtime/nitro/providers/satori/{node.mjs → default.mjs} +0 -0
  114. /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-400-normal.woff +0 -0
  115. /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-700-normal.woff +0 -0
  116. /package/dist/runtime/{public-assets → public-assets-optional/svg2png}/svg2png.wasm +0 -0
  117. /package/dist/runtime/{public-assets → public-assets-optional/yoga}/yoga.wasm +0 -0
package/dist/module.d.ts CHANGED
@@ -24,30 +24,120 @@ interface ScreenshotOptions {
24
24
  }
25
25
  interface OgImageOptions extends Partial<ScreenshotOptions> {
26
26
  provider?: 'browser' | 'satori';
27
- static?: boolean;
28
27
  title?: string;
29
28
  description?: string;
30
29
  component?: string | null;
31
30
  alt?: string;
31
+ cache?: boolean;
32
+ cacheKey?: string;
33
+ cacheTtl?: number;
34
+ /**
35
+ * @deprecated Use `cache` instead
36
+ */
37
+ static?: boolean;
32
38
  [key: string]: any;
33
39
  }
40
+ interface FontConfig {
41
+ name: string;
42
+ weight: number;
43
+ path?: string;
44
+ }
45
+ type InputFontConfig = (`${string}:${number}` | FontConfig);
34
46
 
35
47
  interface ModuleOptions {
36
48
  /**
37
- * The hostname of your website.
38
- * @deprecated use `siteUrl`
49
+ * Whether the og:image images should be generated.
50
+ *
51
+ * @default true
52
+ */
53
+ enabled: boolean;
54
+ /**
55
+ * Default data used within the payload to generate the OG Image.
56
+ *
57
+ * You can use this to change the default template, image sizing and more.
58
+ *
59
+ * @default { component: 'OgImageTemplateFallback', width: 1200, height: 630, cache: true, cacheTtl: 24 * 60 * 60 * 1000 }
39
60
  */
40
- host?: string;
41
- siteUrl: string;
42
61
  defaults: OgImageOptions;
43
- fonts: `${string}:${number}`[];
62
+ /**
63
+ * Fonts to use when rendering the og:image.
64
+ *
65
+ * @example ['Roboto:400,700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
66
+ */
67
+ fonts: InputFontConfig[];
68
+ /**
69
+ * Options to pass to satori.
70
+ *
71
+ * @see https://github.com/vercel/satori/blob/main/src/satori.ts#L18
72
+ */
44
73
  satoriOptions: Partial<SatoriOptions>;
45
- forcePrerender: boolean;
46
- satoriProvider: boolean;
47
- browserProvider: boolean;
48
- experimentalInlineWasm: boolean;
49
- experimentalRuntimeBrowser: boolean;
74
+ /**
75
+ * Should the playground at <path>/__og_image__ be enabled in development.
76
+ *
77
+ * @default true
78
+ */
50
79
  playground: boolean;
80
+ /**
81
+ * Include Satori runtime.
82
+ *
83
+ * @default true
84
+ */
85
+ runtimeSatori: boolean;
86
+ /**
87
+ * Include the Browser runtime.
88
+ * This will need to be manually enabled for production environments.
89
+ *
90
+ * @default `process.dev`
91
+ */
92
+ runtimeBrowser: boolean;
93
+ /**
94
+ * Enables debug logs and a debug endpoint.
95
+ *
96
+ * @false false
97
+ */
98
+ debug: boolean;
99
+ /**
100
+ * Modify the cache behavior.
101
+ *
102
+ * Passing a boolean will enable or disable the runtime cache with the default options.
103
+ *
104
+ * Providing a record will allow you to configure the runtime cache fully.
105
+ *
106
+ * @default true
107
+ * @see https://nitro.unjs.io/guide/storage#mountpoints
108
+ * @example { driver: 'redis', host: 'localhost', port: 6379, password: 'password' }
109
+ */
110
+ runtimeCacheStorage: boolean | (Record<string, any> & {
111
+ driver: string;
112
+ });
113
+ /**
114
+ * Extra component directories that should be used to resolve components.
115
+ *
116
+ * @default ['OgImage', 'OgImageTemplate']
117
+ */
118
+ componentDirs: string[];
119
+ /**
120
+ * The url of your site.
121
+ * Used to generate absolute URLs for the og:image.
122
+ *
123
+ * Note: This is only required when prerendering your site.
124
+ *
125
+ * @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
126
+ * This is powered by the `nuxt-site-config` module.
127
+ * @see https://github.com/harlan-zw/nuxt-site-config
128
+ */
129
+ host?: string;
130
+ /**
131
+ * The url of your site.
132
+ * Used to generate absolute URLs for the og:image.
133
+ *
134
+ * Note: This is only required when prerendering your site.
135
+ *
136
+ * @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
137
+ * This is powered by the `nuxt-site-config` module.
138
+ * @see https://github.com/harlan-zw/nuxt-site-config
139
+ */
140
+ siteUrl?: string;
51
141
  }
52
142
  interface ModuleHooks {
53
143
  'og-image:config': (config: ModuleOptions) => Promise<void> | void;
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "compatibility": {
4
- "nuxt": "^3.3.1",
4
+ "nuxt": "^3.6.1",
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "ogImage",
8
- "version": "2.0.0-beta.7"
8
+ "version": "2.0.0-beta.71"
9
9
  }