nuxt-og-image 6.7.5 → 6.7.6

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 (61) hide show
  1. package/dist/chunks/tw4.cjs +2 -2
  2. package/dist/chunks/tw4.mjs +2 -2
  3. package/dist/chunks/uno.cjs +20 -5
  4. package/dist/chunks/uno.mjs +19 -5
  5. package/dist/module.cjs +2 -2
  6. package/dist/module.json +1 -1
  7. package/dist/module.mjs +2 -2
  8. package/dist/runtime/app/utils/plugins.js +4 -10
  9. package/dist/runtime/server/og-image/bindings/browser/chrome-launcher.d.ts +1 -1
  10. package/dist/runtime/server/og-image/bindings/browser/cloudflare.d.ts +1 -1
  11. package/dist/runtime/server/og-image/bindings/browser/on-demand.d.ts +1 -1
  12. package/dist/runtime/server/og-image/bindings/browser/playwright.d.ts +1 -1
  13. package/dist/runtime/server/og-image/bindings/font-assets/cloudflare.d.ts +1 -1
  14. package/dist/runtime/server/og-image/bindings/font-assets/cloudflare.js +1 -1
  15. package/dist/runtime/server/og-image/bindings/font-assets/dev-prerender.d.ts +1 -1
  16. package/dist/runtime/server/og-image/bindings/font-assets/dev-prerender.js +2 -2
  17. package/dist/runtime/server/og-image/bindings/font-assets/node.d.ts +1 -1
  18. package/dist/runtime/server/og-image/bindings/font-assets/node.js +1 -1
  19. package/dist/runtime/server/og-image/bindings/resvg/node-dev.js +18 -64
  20. package/dist/runtime/server/og-image/bindings/takumi/node-dev.js +26 -83
  21. package/dist/runtime/server/og-image/bindings/worker-queue.d.ts +34 -0
  22. package/dist/runtime/server/og-image/bindings/worker-queue.js +150 -0
  23. package/dist/runtime/server/og-image/browser/renderer.js +1 -1
  24. package/dist/runtime/server/og-image/context.d.ts +1 -1
  25. package/dist/runtime/server/og-image/context.js +2 -3
  26. package/dist/runtime/server/og-image/core/plugins/imageSrc.js +1 -1
  27. package/dist/runtime/server/og-image/core/transforms/emojis/local.d.ts +2 -17
  28. package/dist/runtime/server/og-image/core/transforms/emojis/local.js +1 -1
  29. package/dist/runtime/server/og-image/devtools.d.ts +1 -1
  30. package/dist/runtime/server/og-image/devtools.js +1 -1
  31. package/dist/runtime/server/og-image/fonts.d.ts +1 -1
  32. package/dist/runtime/server/og-image/templates/html.js +1 -1
  33. package/dist/runtime/server/plugins/prerender.d.ts +1 -1
  34. package/dist/runtime/server/plugins/prerender.js +2 -2
  35. package/dist/runtime/server/routes/__zero-runtime/image.d.ts +1 -1
  36. package/dist/runtime/server/routes/__zero-runtime/image.js +1 -1
  37. package/dist/runtime/server/routes/debug.json.d.ts +1 -10
  38. package/dist/runtime/server/routes/debug.json.js +1 -1
  39. package/dist/runtime/server/routes/image.d.ts +1 -1
  40. package/dist/runtime/server/routes/image.js +1 -1
  41. package/dist/runtime/server/routes/resolve.d.ts +1 -1
  42. package/dist/runtime/server/routes/resolve.js +1 -1
  43. package/dist/runtime/server/util/cache.d.ts +1 -6
  44. package/dist/runtime/server/util/cache.js +2 -2
  45. package/dist/runtime/server/util/cloudflare.d.ts +1 -1
  46. package/dist/runtime/server/util/cloudflareAssets.d.ts +1 -1
  47. package/dist/runtime/server/util/cloudflareAssets.js +1 -1
  48. package/dist/runtime/server/util/eventHandlers.d.ts +1 -1
  49. package/dist/runtime/server/util/eventHandlers.js +1 -1
  50. package/dist/runtime/server/util/fetchLocalAsset.d.ts +1 -1
  51. package/dist/runtime/server/util/kit.d.ts +7 -3
  52. package/dist/runtime/server/util/kit.js +4 -18
  53. package/dist/runtime/server/util/options.js +1 -1
  54. package/dist/runtime/server/util/query.d.ts +1 -1
  55. package/dist/runtime/server/utils.d.ts +1 -1
  56. package/dist/runtime/server/utils.js +1 -1
  57. package/dist/runtime/types.d.ts +11 -9
  58. package/dist/shared/{nuxt-og-image.D3mV8OQ9.mjs → nuxt-og-image.BIbfn5xQ.mjs} +111 -83
  59. package/dist/shared/{nuxt-og-image.Cctpuv4O.cjs → nuxt-og-image.CdpC3njh.cjs} +113 -82
  60. package/package.json +38 -27
  61. package/types/virtual.d.ts +15 -0
@@ -3,15 +3,15 @@ import * as fs from 'node:fs';
3
3
  import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, rmSync } from 'node:fs';
4
4
  import { readdir, readFile, writeFile, mkdir } from 'node:fs/promises';
5
5
  import { pathToFileURL } from 'node:url';
6
- import { resolvePath, useNuxt, addTemplate, updateTemplates, addTypeTemplate, defineNuxtModule, createResolver, addImports, hasNuxtModule, hasNuxtModuleCompatibility, getNuxtModuleVersion, addVitePlugin, addBuildPlugin, addServerHandler, addPlugin, addComponentsDir, getNuxtVersion, addServerPlugin } from '@nuxt/kit';
6
+ import { resolvePath, useNuxt, addTemplate, updateTemplates, directoryToURL, tryResolveModule, addTypeTemplate, defineNuxtModule, createResolver, addImports, hasNuxtModule, hasNuxtModuleCompatibility, getNuxtModuleVersion, addVitePlugin, addBuildPlugin, addServerHandler, addPlugin, addComponentsDir, getNuxtVersion, addServerPlugin } from '@nuxt/kit';
7
7
  import { defu } from 'defu';
8
8
  import { fnv1a64Base36 } from 'fnv1a-64';
9
9
  import { installNuxtSiteConfig } from 'nuxt-site-config/kit';
10
+ import { resolveNitroPreset, renderNitroTypeAugmentations, setupNitroRuntimeCompatibility, getNuxtModuleOptions, isNuxtGenerate } from 'nuxtseo-shared/kit';
10
11
  import { basename, join, dirname, relative, isAbsolute, resolve } from 'pathe';
11
12
  import { readPackageJSON } from 'pkg-types';
12
13
  import { isCI, isAgent, hasTTY } from 'std-env';
13
14
  import { parseAndWalk } from 'oxc-walker';
14
- import { resolveNitroPreset, getNuxtModuleOptions, isNuxtGenerate } from 'nuxtseo-shared/kit';
15
15
  import { logger } from '../../dist/runtime/logger.js';
16
16
  import { Launcher } from 'chrome-launcher';
17
17
  import { detectPackageManager, addDependency } from 'nypm';
@@ -308,23 +308,32 @@ async function setupBuildHandler(config, resolve, getDetectedRenderers, getCompa
308
308
  nuxt.options.nitro.storage = nuxt.options.nitro.storage || {};
309
309
  if (typeof config.runtimeCacheStorage === "object")
310
310
  nuxt.options.nitro.storage["nuxt-og-image"] = config.runtimeCacheStorage;
311
- nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
312
- const mockCode = `import proxy from 'mocked-exports/proxy';export default proxy;export * from 'mocked-exports/proxy';`;
313
- nitroConfig.virtual = nitroConfig.virtual || {};
314
- nitroConfig.virtual["playwright-core"] = mockCode;
315
- nitroConfig.virtual.electron = mockCode;
316
- nitroConfig.virtual["electron/index"] = mockCode;
317
- nitroConfig.virtual["electron/index.js"] = mockCode;
318
- nitroConfig.virtual.bufferutil = mockCode;
319
- nitroConfig.virtual["utf-8-validate"] = mockCode;
320
- nitroConfig.virtual["chromium-bidi"] = mockCode;
321
- nitroConfig.virtual["chromium-bidi/lib/cjs/bidiMapper/BidiMapper"] = mockCode;
322
- nitroConfig.virtual["chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js"] = mockCode;
323
- nitroConfig.virtual.queue = mockCode;
311
+ const nitroConfig = nuxt.options.nitro;
312
+ const mockCode = `import proxy from 'mocked-exports/proxy';export default proxy;export * from 'mocked-exports/proxy';`;
313
+ nitroConfig.virtual = nitroConfig.virtual || {};
314
+ nitroConfig.virtual["playwright-core"] = mockCode;
315
+ nitroConfig.virtual.electron = mockCode;
316
+ nitroConfig.virtual["electron/index"] = mockCode;
317
+ nitroConfig.virtual["electron/index.js"] = mockCode;
318
+ nitroConfig.virtual.bufferutil = mockCode;
319
+ nitroConfig.virtual["utf-8-validate"] = mockCode;
320
+ nitroConfig.virtual["chromium-bidi"] = mockCode;
321
+ nitroConfig.virtual["chromium-bidi/lib/cjs/bidiMapper/BidiMapper"] = mockCode;
322
+ nitroConfig.virtual["chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js"] = mockCode;
323
+ nitroConfig.virtual.queue = mockCode;
324
+ await applyNitroPresetCompatibility(nitroConfig, {
325
+ compatibility: config.compatibility?.runtime,
326
+ resolve,
327
+ detectedRenderers: getDetectedRenderers(),
328
+ metadata: getCompatibilityMeta()
324
329
  });
325
330
  nuxt.hooks.hook("nitro:init", async (nitro) => {
326
- const renderers = getDetectedRenderers();
327
- await applyNitroPresetCompatibility(nitro.options, { compatibility: config.compatibility?.runtime, resolve, detectedRenderers: renderers, metadata: getCompatibilityMeta() });
331
+ await applyNitroPresetCompatibility(nitro.options, {
332
+ compatibility: config.compatibility?.runtime,
333
+ resolve,
334
+ detectedRenderers: getDetectedRenderers(),
335
+ metadata: getCompatibilityMeta()
336
+ });
328
337
  const target = resolveOgImagePreset(nitro.options);
329
338
  const normalizedTarget = target.replace(RE_LEGACY_SUFFIX, "");
330
339
  const isEdgePreset = ["cloudflare", "cloudflare-pages", "cloudflare-pages-static", "cloudflare-module", "cloudflare-durable", "vercel-edge", "netlify-edge"].includes(normalizedTarget);
@@ -649,10 +658,10 @@ async function validateProviderSetup(renderer, compatibility) {
649
658
  return { valid: issues.length === 0, issues };
650
659
  }
651
660
 
652
- function setupDevHandler(options, resolve, getDetectedRenderers, getCompatibilityMeta = () => ({}), nuxt = useNuxt()) {
653
- nuxt.hooks.hook("nitro:init", async (nitro) => {
661
+ async function setupDevHandler(options, resolve, getDetectedRenderers, getCompatibilityMeta = () => ({}), nuxt = useNuxt()) {
662
+ const applyCompatibility = async (nitroConfig) => {
654
663
  const detectedRenderers = new Set(getDetectedRenderers());
655
- const targetCompatibility = getPresetNitroPresetCompatibility(resolveOgImagePreset(nitro.options));
664
+ const targetCompatibility = getPresetNitroPresetCompatibility(resolveOgImagePreset(nitroConfig));
656
665
  for (const renderer of ["satori", "takumi", "browser"]) {
657
666
  if (!detectedRenderers.has(renderer)) {
658
667
  const binding = getRecommendedBinding(renderer, targetCompatibility);
@@ -661,8 +670,10 @@ function setupDevHandler(options, resolve, getDetectedRenderers, getCompatibilit
661
670
  detectedRenderers.add(renderer);
662
671
  }
663
672
  }
664
- await applyNitroPresetCompatibility(nitro.options, { compatibility: options.compatibility?.dev, resolve, detectedRenderers, metadata: getCompatibilityMeta() });
665
- });
673
+ await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.dev, resolve, detectedRenderers, metadata: getCompatibilityMeta() });
674
+ };
675
+ await applyCompatibility(nuxt.options.nitro);
676
+ nuxt.hooks.hook("nitro:init", (nitro) => applyCompatibility(nitro.options));
666
677
  }
667
678
 
668
679
  const RE_TILDE_SLASH = /^~\//;
@@ -2181,7 +2192,7 @@ async function downloadStaticFonts(options) {
2181
2192
  results.push(...familyResults);
2182
2193
  }
2183
2194
  }
2184
- if (unresolvedFamilies.length > 0) {
2195
+ if (options.warnOnMissingStaticFonts !== false && unresolvedFamilies.length > 0) {
2185
2196
  const providerList = fontlessCtx.providerNames.join(", ") || "none";
2186
2197
  const localFonts = await listLocalPublicFontFiles(options.nuxt).catch(() => []);
2187
2198
  const matchedLocal = unresolvedFamilies.map((family) => {
@@ -2313,7 +2324,8 @@ async function convertWoff2ToTtf(options) {
2313
2324
  families,
2314
2325
  nuxt,
2315
2326
  logger,
2316
- fontSubsets
2327
+ fontSubsets,
2328
+ warnOnMissingStaticFonts
2317
2329
  });
2318
2330
  for (const font of downloaded) {
2319
2331
  const key = `${font.family}-${font.weight}-${font.style}`;
@@ -2452,6 +2464,34 @@ function setupGenerateHandler(_options, resolve, _getDetectedRenderers, nuxt = u
2452
2464
  });
2453
2465
  }
2454
2466
 
2467
+ async function resolveOptionalModulePath(id, rootDir, fallbackPackages = []) {
2468
+ const rootUrl = directoryToURL(rootDir);
2469
+ const direct = await tryResolveModule(id, rootUrl);
2470
+ if (direct)
2471
+ return direct;
2472
+ for (const pkg of fallbackPackages) {
2473
+ const pkgJson = await tryResolveModule(`${pkg}/package.json`, rootUrl);
2474
+ if (!pkgJson)
2475
+ continue;
2476
+ const nested = await tryResolveModule(id, directoryToURL(dirname(pkgJson)));
2477
+ if (nested)
2478
+ return nested;
2479
+ }
2480
+ }
2481
+ async function importResolvedModule(id, resolvedPath) {
2482
+ return await (resolvedPath ? import(pathToFileURL(resolvedPath).href) : import(id));
2483
+ }
2484
+ async function importOptionalPeer(id, resolvedPath, usage) {
2485
+ try {
2486
+ return await importResolvedModule(id, resolvedPath);
2487
+ } catch (cause) {
2488
+ throw new Error(
2489
+ `[nuxt-og-image] Missing optional peer dependency "${id}". Install it to use ${usage}.`,
2490
+ { cause }
2491
+ );
2492
+ }
2493
+ }
2494
+
2455
2495
  const ONE_WEEK_MS = 7 * 24 * 60 * 60 * 1e3;
2456
2496
  function setupPrerenderHandler(options, resolve, getDetectedRenderers, getCompatibilityMeta = () => ({}), nuxt = useNuxt()) {
2457
2497
  nuxt.hooks.hook("nitro:init", async (nitro) => {
@@ -4431,7 +4471,7 @@ function getComponentTypeExpression(component, nuxt) {
4431
4471
  return `typeof import('${relativeComponentPath}')['default']`;
4432
4472
  }
4433
4473
  function registerTypeTemplates(ctx) {
4434
- const { nuxt, config, componentCtx } = ctx;
4474
+ const { nuxt, config, componentCtx, nitroCompatibility } = ctx;
4435
4475
  nuxt.hook("prepare:types", ({ tsConfig }) => {
4436
4476
  tsConfig.include = tsConfig.include || [];
4437
4477
  tsConfig.include.push("./module/nuxt-og-image-components.d.ts");
@@ -4482,7 +4522,7 @@ ${lines.join("\n")}
4482
4522
  getContents: (data) => {
4483
4523
  const typesPath = relative(resolve(data.nuxt.options.rootDir, data.nuxt.options.buildDir, "types"), resolve("runtime/types"));
4484
4524
  return `declare module '#og-image-virtual/public-assets.mjs' {
4485
- import type { H3Event } from 'h3'
4525
+ import type { H3Event } from '#nuxtseo/h3'
4486
4526
  import type { FontConfig } from '${typesPath}'
4487
4527
  export function resolve(event: H3Event, font: FontConfig): Promise<BufferSource>
4488
4528
  }
@@ -4561,7 +4601,7 @@ declare module '#og-image-virtual/tw4-theme.mjs' {
4561
4601
  getContents: (data) => {
4562
4602
  const typesPath = relative(resolve(data.nuxt.options.rootDir, data.nuxt.options.buildDir, "types"), resolve("runtime/types"));
4563
4603
  return `declare module '#og-image/bindings/browser' {
4564
- import type { H3Event } from 'h3'
4604
+ import type { H3Event } from '#nuxtseo/h3'
4565
4605
  export function createBrowser(event?: H3Event): Promise<any>
4566
4606
  }
4567
4607
 
@@ -4621,61 +4661,34 @@ declare module '#og-image-cache' {
4621
4661
  filename: "types/og-image-augments.d.ts",
4622
4662
  getContents: (data) => {
4623
4663
  const typesPath = relative(resolve(data.nuxt.options.rootDir, data.nuxt.options.buildDir, "types"), resolve("runtime/types"));
4664
+ const nitroAugmentations = renderNitroTypeAugmentations(nitroCompatibility, {
4665
+ nitroInterfaces: {
4666
+ NitroApp: `_ogImageCacheBackendWarned?: boolean
4667
+ _ogImageIconsData?: OgImageIconsData`,
4668
+ NitroRuntimeConfig: `'nuxt-og-image': OgImageRuntimeConfig
4669
+ ogImage?: {
4670
+ secret?: string
4671
+ }`
4672
+ },
4673
+ routeRules: "ogImage?: false | OgImageOptions & Record<string, any>",
4674
+ routeConfig: "ogImage?: false | OgImageOptions & Record<string, any>",
4675
+ runtimeHooks: `'nuxt-og-image:context': (ctx: OgImageRenderEventContext) => void | Promise<void>
4676
+ 'nuxt-og-image:satori:vnodes': (vnodes: VNode, ctx: OgImageRenderEventContext) => void | Promise<void>`,
4677
+ eventContext: `_nitro?: {
4678
+ routeRules?: import('${nitroCompatibility.nitroTypesModule}').NitroRouteRules
4679
+ }
4680
+ _ogImagePrerenderPaths?: Map<string, string>`
4681
+ });
4624
4682
  return `/// <reference path="./og-image-virtual.d.ts" />
4625
4683
  /// <reference path="./og-image-bindings.d.ts" />
4626
- import type { OgImageOptions, OgImageRenderEventContext, VNode } from '${typesPath}'
4684
+ import type { OgImageIconsData, OgImageOptions, OgImageRenderEventContext, OgImageRuntimeConfig, VNode } from '${typesPath}'
4627
4685
 
4628
- declare module 'nitropack' {
4629
- interface NitroRuntimeConfig {
4630
- 'nuxt-og-image': OgImageRuntimeConfig
4631
- ogImage?: {
4632
- secret?: string
4633
- }
4634
- }
4635
- interface NitroRouteRules {
4636
- ogImage?: false | OgImageOptions & Record<string, any>
4637
- }
4638
- interface NitroRouteConfig {
4639
- ogImage?: false | OgImageOptions & Record<string, any>
4640
- }
4641
- interface NitroRuntimeHooks {
4642
- 'nuxt-og-image:context': (ctx: OgImageRenderEventContext) => void | Promise<void>
4643
- 'nuxt-og-image:satori:vnodes': (vnodes: VNode, ctx: OgImageRenderEventContext) => void | Promise<void>
4644
- }
4645
- }
4646
-
4647
- declare module 'nitropack/types' {
4648
- interface NitroRuntimeConfig {
4649
- 'nuxt-og-image': OgImageRuntimeConfig
4650
- ogImage?: {
4651
- secret?: string
4652
- }
4653
- }
4654
- interface NitroRouteRules {
4655
- ogImage?: false | OgImageOptions & Record<string, any>
4656
- }
4657
- interface NitroRouteConfig {
4658
- ogImage?: false | OgImageOptions & Record<string, any>
4659
- }
4660
- interface NitroRuntimeHooks {
4661
- 'nuxt-og-image:context': (ctx: OgImageRenderEventContext) => void | Promise<void>
4662
- 'nuxt-og-image:satori:vnodes': (vnodes: VNode, ctx: OgImageRenderEventContext) => void | Promise<void>
4663
- }
4664
- }
4665
-
4666
- declare module 'h3' {
4667
- interface H3EventContext {
4668
- _nitro?: {
4669
- routeRules?: import('nitropack').NitroRouteRules
4670
- }
4671
- _ogImagePrerenderPaths?: Map<string, string>
4672
- }
4673
- }
4686
+ ${nitroAugmentations}
4674
4687
 
4675
4688
  export {}
4676
4689
  `;
4677
4690
  }
4678
- });
4691
+ }, { nitro: true, nuxt: true });
4679
4692
  }
4680
4693
 
4681
4694
  const RE_INLINE_CONFIG = /const\s+inlineConfig\s*=\s*(\{[\s\S]*?\n\})/;
@@ -4790,6 +4803,12 @@ const module$1 = defineNuxtModule({
4790
4803
  });
4791
4804
  return;
4792
4805
  }
4806
+ const nitroCompatibility = setupNitroRuntimeCompatibility(nuxt);
4807
+ const setRuntimeAlias = (id, path) => {
4808
+ nuxt.options.alias[id] = path;
4809
+ nuxt.options.nitro.alias ||= {};
4810
+ nuxt.options.nitro.alias[id] = path;
4811
+ };
4793
4812
  if (config.enabled && !nuxt.options.ssr) {
4794
4813
  logger.warn("Nuxt OG Image is enabled but SSR is disabled.\n\nYou should enable SSR (`ssr: true`) or disable the module (`ogImage: { enabled: false }`).");
4795
4814
  return;
@@ -4866,8 +4885,7 @@ Or pin to a specific version in package.json:
4866
4885
  break;
4867
4886
  }
4868
4887
  }
4869
- nuxt.options.alias["#og-image"] = resolve("./runtime");
4870
- nuxt.options.alias["#og-image-cache"] = resolve("./runtime/server/og-image/cache/lru");
4888
+ setRuntimeAlias("#og-image-cache", resolve("./runtime/server/og-image/cache/lru"));
4871
4889
  const preset = resolveOgImagePreset(nuxt.options.nitro);
4872
4890
  const targetCompatibility = getPresetNitroPresetCompatibility(preset);
4873
4891
  const runtimeCompatibilityMeta = {};
@@ -4888,11 +4906,11 @@ Or pin to a specific version in package.json:
4888
4906
  let buildEmojiSet;
4889
4907
  if (config.defaults.emojis === false) {
4890
4908
  logger.debug("Emoji support disabled.");
4891
- nuxt.options.alias["#og-image/emoji-transform"] = resolve("./runtime/server/og-image/core/transforms/emojis/noop");
4909
+ setRuntimeAlias("#og-image/emoji-transform", resolve("./runtime/server/og-image/core/transforms/emojis/noop"));
4892
4910
  buildEmojiSet = void 0;
4893
4911
  } else {
4894
4912
  buildEmojiSet = config.defaults.emojis || "noto";
4895
- nuxt.options.alias["#og-image/emoji-transform"] = resolve("./runtime/server/og-image/core/transforms/emojis/fetch");
4913
+ setRuntimeAlias("#og-image/emoji-transform", resolve("./runtime/server/og-image/core/transforms/emojis/fetch"));
4896
4914
  }
4897
4915
  const { detectCssProvider } = await Promise.resolve().then(function () { return cssProvider; });
4898
4916
  const cssFramework = detectCssProvider(nuxt);
@@ -4900,6 +4918,10 @@ Or pin to a specific version in package.json:
4900
4918
  if (cssFramework === "unocss") {
4901
4919
  logger.debug("UnoCSS detected, using UnoCSS provider for OG image styling");
4902
4920
  const { setUnoConfig, setUnoRootDir, createUnoProvider } = await import('../chunks/uno.mjs');
4921
+ const [unocssCorePath, unocssConfigPath] = await Promise.all([
4922
+ resolveOptionalModulePath("@unocss/core", nuxt.options.rootDir, ["@unocss/nuxt", "unocss"]),
4923
+ resolveOptionalModulePath("@unocss/config", nuxt.options.rootDir, ["@unocss/nuxt", "unocss"])
4924
+ ]);
4903
4925
  setUnoRootDir(nuxt.options.rootDir);
4904
4926
  nuxt.hook("unocss:config", (config2) => {
4905
4927
  setUnoConfig(config2);
@@ -4911,6 +4933,8 @@ Or pin to a specific version in package.json:
4911
4933
  config2.content.pipeline.exclude.push(...excludePatterns);
4912
4934
  });
4913
4935
  cssProvider$1 = createUnoProvider({
4936
+ unocssCorePath,
4937
+ unocssConfigPath,
4914
4938
  async resolveCssPath() {
4915
4939
  for (const cssEntry of nuxt.options.css) {
4916
4940
  const cssPath = typeof cssEntry === "string" ? cssEntry : cssEntry?.src;
@@ -5114,7 +5138,7 @@ ${familyInfo}`);
5114
5138
  });
5115
5139
  if (!nuxt.options.dev) {
5116
5140
  addBuildPlugin(TreeShakeComposablesPlugin, { server: true, client: true, build: true });
5117
- nuxt.options.alias["#og-image-cache"] = resolve("./runtime/server/og-image/cache/mock");
5141
+ setRuntimeAlias("#og-image-cache", resolve("./runtime/server/og-image/cache/mock"));
5118
5142
  }
5119
5143
  }
5120
5144
  const basePath = config.zeroRuntime ? "./runtime/server/routes/__zero-runtime" : "./runtime/server/routes";
@@ -5680,7 +5704,8 @@ export const rootDir = ${JSON.stringify(nuxt.options.rootDir)}`;
5680
5704
  registerTypeTemplates({
5681
5705
  nuxt,
5682
5706
  config,
5683
- componentCtx: ogImageComponentCtx
5707
+ componentCtx: ogImageComponentCtx,
5708
+ nitroCompatibility
5684
5709
  });
5685
5710
  const cacheEnabled = typeof config.runtimeCacheStorage !== "undefined" && config.runtimeCacheStorage !== false;
5686
5711
  const cacheVersion = config.cacheVersion === false ? "" : config.cacheVersion ?? version;
@@ -5784,7 +5809,7 @@ export const rootDir = ${JSON.stringify(nuxt.options.rootDir)}`;
5784
5809
  const getDetectedRenderers = () => ogImageComponentCtx.detectedRenderers;
5785
5810
  const getCompatibilityMeta = () => runtimeCompatibilityMeta;
5786
5811
  if (nuxt.options.dev) {
5787
- setupDevHandler(config, resolver, getDetectedRenderers, getCompatibilityMeta);
5812
+ await setupDevHandler(config, resolver, getDetectedRenderers, getCompatibilityMeta);
5788
5813
  setupDevToolsUI(config, resolve, nuxt, cssFramework || "none");
5789
5814
  const useNitro = new Promise((resolveNitro) => {
5790
5815
  nuxt.hooks.hook("nitro:init", resolveNitro);
@@ -5820,6 +5845,9 @@ export const rootDir = ${JSON.stringify(nuxt.options.rootDir)}`;
5820
5845
  } else if (nuxt.options.build) {
5821
5846
  await setupBuildHandler(config, resolver, getDetectedRenderers, getCompatibilityMeta);
5822
5847
  }
5848
+ setRuntimeAlias("#og-image/app", resolve("./runtime/app"));
5849
+ setRuntimeAlias("#og-image/shared", resolve("./runtime/shared"));
5850
+ setRuntimeAlias("#og-image/types", resolve("./runtime/types"));
5823
5851
  if (nuxt.options.build)
5824
5852
  addServerPlugin(resolve("./runtime/server/plugins/prerender"));
5825
5853
  setupPrerenderHandler(config, resolver, getDetectedRenderers, getCompatibilityMeta);
@@ -5831,4 +5859,4 @@ export const rootDir = ${JSON.stringify(nuxt.options.rootDir)}`;
5831
5859
  }
5832
5860
  });
5833
5861
 
5834
- export { extractCssVars as a, extractPropertyInitialValues as b, extractUniversalVars as c, extractPerClassVars as d, extractVariantBaseClasses as e, extractClassStyles as f, extractVarsFromCss as g, resolveExtractedVars as h, resolveVarsDeep as i, loadLightningCss as l, module$1 as m, postProcessStyles as p, resolveVariantPrefixes as r, simplifyCss as s };
5862
+ export { extractCssVars as a, extractPropertyInitialValues as b, extractUniversalVars as c, extractPerClassVars as d, extractVariantBaseClasses as e, extractClassStyles as f, extractVarsFromCss as g, resolveExtractedVars as h, importOptionalPeer as i, importResolvedModule as j, resolveOptionalModulePath as k, resolveVarsDeep as l, loadLightningCss as m, module$1 as n, postProcessStyles as p, resolveVariantPrefixes as r, simplifyCss as s };