@nuxt/bridge-edge 3.4.0-29110408.3747562 → 3.6.0-29254306.aa54696

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.
@@ -7,7 +7,7 @@ import { genObjectFromRawEntries, genDynamicImport } from 'knitwork';
7
7
  import fse from 'fs-extra';
8
8
  import { debounce } from 'perfect-debounce';
9
9
  import { isIgnored, logger } from '@nuxt/kit';
10
- import { g as generateDevSSRManifest, i as isCSS, h as hashId, u as uniq } from '../shared/bridge-edge.Cw3-PVIz.mjs';
10
+ import { g as generateDevSSRManifest, i as isCSS, h as hashId, u as uniq } from '../shared/bridge-edge.DfLAC_Lt.mjs';
11
11
  import { c as createIsExternal } from './vite.mjs';
12
12
  import 'h3';
13
13
  import 'node-fetch';
@@ -3,7 +3,7 @@ import hash from 'hash-sum';
3
3
  import { resolve } from 'pathe';
4
4
  import { genObjectFromRawEntries, genImport } from 'knitwork';
5
5
 
6
- const version = "3.4.0-29110408.3747562";
6
+ const version = "3.6.0-29254306.aa54696";
7
7
 
8
8
  const middlewareTemplate = {
9
9
  filename: "middleware.js",
@@ -2,11 +2,11 @@ import { normalize, resolve, isAbsolute, join } from 'pathe';
2
2
  import { logger, isIgnored } from '@nuxt/kit';
3
3
  import { resolve as resolve$1, findExports, sanitizeFilePath } from 'mlly';
4
4
  import { joinURL, withoutLeadingSlash, withTrailingSlash } from 'ufo';
5
- import { d as distDir, t as transpile, i as isCSS, p as prepareManifests, a as pkgDir } from '../shared/bridge-edge.Cw3-PVIz.mjs';
5
+ import { d as distDir, t as transpile, i as isCSS, p as prepareManifests, a as pkgDir } from '../shared/bridge-edge.DfLAC_Lt.mjs';
6
6
  import createVuePlugin from '@vitejs/plugin-vue2';
7
7
  import { getPort } from 'get-port-please';
8
8
  import { toNodeListener, createApp, defineEventHandler, defineLazyEventHandler, eventHandler, createError } from 'h3';
9
- import defu, { defu as defu$1 } from 'defu';
9
+ import { defu } from 'defu';
10
10
  import { pathToFileURL } from 'node:url';
11
11
  import { ViteNodeServer } from 'vite-node/server';
12
12
  import fse from 'fs-extra';
@@ -368,8 +368,8 @@ async function buildClient(ctx) {
368
368
  ctx.config.build.rollupOptions = defu(ctx.config.build.rollupOptions, {
369
369
  output: {
370
370
  // https://github.com/vitejs/vite/tree/main/packages/vite/src/node/build.ts#L464-L478
371
- assetFileNames: ctx.nuxt.options.dev ? undefined : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, "[name].[hash].[ext]")),
372
- chunkFileNames: ctx.nuxt.options.dev ? undefined : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, "[name].[hash].js")),
371
+ assetFileNames: ctx.nuxt.options.dev ? void 0 : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, "[name].[hash].[ext]")),
372
+ chunkFileNames: ctx.nuxt.options.dev ? void 0 : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, "[name].[hash].js")),
373
373
  entryFileNames: ctx.nuxt.options.dev ? "entry.js" : withoutLeadingSlash(join(ctx.nuxt.options.app.buildAssetsDir, "[name].[hash].js"))
374
374
  }
375
375
  });
@@ -428,7 +428,7 @@ async function buildServer(ctx) {
428
428
  alias[p.name] = p.mode === "client" ? `defaultexport:${resolve(ctx.nuxt.options.buildDir, "empty.js")}` : `defaultexport:${p.src}`;
429
429
  }
430
430
  const serverConfig = await stubViteExports.mergeConfig(ctx.config, {
431
- base: ctx.nuxt.options.dev ? joinURL(ctx.nuxt.options.app.baseURL, ctx.nuxt.options.app.buildAssetsDir) : undefined,
431
+ base: ctx.nuxt.options.dev ? joinURL(ctx.nuxt.options.app.baseURL, ctx.nuxt.options.app.buildAssetsDir) : void 0,
432
432
  experimental: {
433
433
  renderBuiltUrl: (filename, { type, hostType }) => {
434
434
  if (hostType !== "js") {
@@ -594,7 +594,7 @@ function resolveCSSOptions(nuxt) {
594
594
  plugins: []
595
595
  }
596
596
  };
597
- const plugins = defu$1(nuxt.options.build.postcss.plugins, {
597
+ const plugins = defu(nuxt.options.build.postcss.plugins, {
598
598
  // https://github.com/postcss/postcss-import
599
599
  "postcss-import": {
600
600
  resolve: createResolver({
@@ -714,8 +714,8 @@ async function bundle(nuxt, builder) {
714
714
  )
715
715
  };
716
716
  if (!nuxt.options.dev) {
717
- ctx.config.server.watch = undefined;
718
- ctx.config.build.watch = undefined;
717
+ ctx.config.server.watch = void 0;
718
+ ctx.config.build.watch = void 0;
719
719
  }
720
720
  await ctx.nuxt.callHook("vite:extend", ctx);
721
721
  if (nuxt.options.dev) {
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import '@nuxt/kit';
2
2
  import 'h3';
3
- export { m as default } from './shared/bridge-edge.Cw3-PVIz.mjs';
3
+ export { m as default } from './shared/bridge-edge.DfLAC_Lt.mjs';
4
4
  import 'fs';
5
5
  import 'url';
6
6
  import 'node-fetch';
@@ -1,5 +1,6 @@
1
1
  import type { Ref, WatchSource } from 'vue';
2
2
  import type { NuxtAppCompat } from '@nuxt/bridge-schema';
3
+ import type { NuxtError } from './error';
3
4
  export type _Transform<Input = any, Output = any> = (input: Input) => Output | Promise<Output>;
4
5
  export type PickFrom<T, K extends Array<string>> = T extends Array<any> ? T : T extends Record<string, any> ? Pick<T, K[number]> : T;
5
6
  export type KeysOf<T> = Array<keyof T extends string ? keyof T : string>;
@@ -23,10 +24,10 @@ export interface AsyncDataOptions<ResT, DataT = ResT, PickKeys extends KeysOf<Da
23
24
  default?: () => DefaultT | Ref<DefaultT>;
24
25
  /**
25
26
  * Provide a function which returns cached data.
26
- * A `null` or `undefined` return value will trigger a fetch.
27
+ * A `undefined` return value will trigger a fetch.
27
28
  * Default is `key => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key]` which only caches data when payloadExtraction is enabled.
28
29
  */
29
- getCachedData?: (key: string, nuxtApp: NuxtAppCompat) => DataT;
30
+ getCachedData?: (key: string, nuxtApp: NuxtAppCompat) => NoInfer<DataT> | undefined;
30
31
  /**
31
32
  * A function that can be used to alter handler function result after resolving
32
33
  */
@@ -79,13 +80,13 @@ export interface _AsyncData<DataT, ErrorT> {
79
80
  status: Ref<AsyncDataRequestStatus>;
80
81
  }
81
82
  export type AsyncData<Data, Error> = _AsyncData<Data, Error> & Promise<_AsyncData<Data, Error>>;
82
- export declare function useAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
83
- export declare function useAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
84
- export declare function useAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
85
- export declare function useAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
86
- export declare function useLazyAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
87
- export declare function useLazyAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
88
- export declare function useLazyAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
89
- export declare function useLazyAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, DataE | null>;
83
+ export declare function useAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
84
+ export declare function useAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
85
+ export declare function useAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
86
+ export declare function useAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
87
+ export declare function useLazyAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
88
+ export declare function useLazyAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
89
+ export declare function useLazyAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
90
+ export declare function useLazyAsyncData<ResT, NuxtErrorDataT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DataT>(key: string, handler: (ctx?: NuxtAppCompat) => Promise<ResT>, options?: Omit<AsyncDataOptions<ResT, DataT, PickKeys, DefaultT>, 'lazy'>): AsyncData<PickFrom<DataT, PickKeys> | DefaultT, (NuxtErrorDataT extends Error | NuxtError ? NuxtErrorDataT : NuxtError<NuxtErrorDataT>) | null>;
90
91
  export declare function refreshNuxtData(keys?: string | string[]): Promise<void>;
91
92
  export declare function clearNuxtData(keys?: string | string[] | ((key: string) => boolean)): void;
@@ -1,7 +1,7 @@
1
1
  import { ref, watch, getCurrentScope, onScopeDispose, customRef, nextTick } from "vue";
2
2
  import { parse, serialize } from "cookie-es";
3
3
  import { deleteCookie, getCookie, getRequestHeader, setCookie } from "h3";
4
- import destr from "destr";
4
+ import { destr } from "destr";
5
5
  import { isEqual } from "ohash/utils";
6
6
  import { klona } from "klona";
7
7
  import { useNuxtApp } from "../nuxt.mjs";
@@ -22,6 +22,7 @@ export function useCookie(name, _opts) {
22
22
  delay = opts.expires.getTime() - Date.now();
23
23
  }
24
24
  const hasExpired = delay !== void 0 && delay <= 0;
25
+ const shouldSetInitialClientCookie = process.client && (hasExpired || cookies[name] === void 0 || cookies[name] === null);
25
26
  const cookieValue = klona(hasExpired ? void 0 : cookies[name] ?? opts.default?.());
26
27
  const cookie = process.client && delay && !hasExpired ? cookieRef(cookieValue, delay, opts.watch && opts.watch !== "shallow") : ref(cookieValue);
27
28
  if (process.dev && hasExpired) {
@@ -35,9 +36,11 @@ export function useCookie(name, _opts) {
35
36
  }
36
37
  } catch {
37
38
  }
38
- const callback = () => {
39
- if (opts.readonly || isEqual(cookie.value, cookies[name])) {
40
- return;
39
+ const callback = (force = false) => {
40
+ if (!force) {
41
+ if (opts.readonly || isEqual(cookie.value, cookies[name])) {
42
+ return;
43
+ }
41
44
  }
42
45
  writeClientCookie(name, cookie.value, opts);
43
46
  channel?.postMessage(opts.encode(cookie.value));
@@ -70,8 +73,9 @@ export function useCookie(name, _opts) {
70
73
  },
71
74
  { deep: opts.watch !== "shallow" }
72
75
  );
73
- } else {
74
- callback();
76
+ }
77
+ if (shouldSetInitialClientCookie) {
78
+ callback(shouldSetInitialClientCookie);
75
79
  }
76
80
  } else if (process.server) {
77
81
  const nuxtApp = useNuxtApp();
@@ -79,6 +83,16 @@ export function useCookie(name, _opts) {
79
83
  if (opts.readonly || isEqual(cookie.value, cookies[name])) {
80
84
  return;
81
85
  }
86
+ nuxtApp._cookies = nuxtApp._cookies || {};
87
+ if (name in nuxtApp._cookies) {
88
+ if (isEqual(cookie.value, nuxtApp._cookies[name])) {
89
+ return;
90
+ }
91
+ if (process.dev) {
92
+ console.warn(`[nuxt] cookie \`${name}\` was previously set to \`${opts.encode(nuxtApp._cookies[name])}\` and is being overridden to \`${opts.encode(cookie.value)}\`. This may cause unexpected issues.`);
93
+ }
94
+ }
95
+ nuxtApp._cookies[name] = cookie.value;
82
96
  writeServerCookie(useRequestEvent(nuxtApp), name, cookie.value, opts);
83
97
  };
84
98
  const unhook = nuxtApp.hooks.hookOnce("app:rendered", writeFinalCookieValue);
@@ -1,21 +1,13 @@
1
1
  import { H3Error } from 'h3';
2
+ export declare const NUXT_ERROR_SIGNATURE = "__nuxt_error";
2
3
  export declare const useError: () => import("vue").Ref<any>;
3
4
  export interface NuxtError<DataT = unknown> extends H3Error<DataT> {
4
5
  }
5
- export declare const showError: <DataT = unknown>(_err: string | Error | (Partial<NuxtError<DataT>> & {
6
- status?: number;
7
- statusText?: string;
8
- })) => NuxtError<unknown>;
6
+ export declare const showError: <DataT = unknown>(error: string | Error | Partial<NuxtError<DataT>>) => NuxtError<DataT>;
9
7
  /** @deprecated Use `throw createError()` or `showError` */
10
- export declare const throwError: <DataT = unknown>(_err: string | Error | (Partial<NuxtError<DataT>> & {
11
- status?: number;
12
- statusText?: string;
13
- })) => NuxtError<unknown>;
8
+ export declare const throwError: <DataT = unknown>(error: string | Error | Partial<NuxtError<DataT>>) => NuxtError<DataT>;
14
9
  export declare const clearError: (options?: {
15
10
  redirect?: string;
16
11
  }) => Promise<void>;
17
- export declare const isNuxtError: (err?: string | object) => err is NuxtError;
18
- export declare const createError: <DataT = unknown>(err: string | Error | (Partial<NuxtError<DataT>> & {
19
- status?: number;
20
- statusText?: string;
21
- })) => NuxtError;
12
+ export declare const isNuxtError: <DataT = unknown>(error?: string | object) => error is NuxtError<DataT>;
13
+ export declare const createError: <DataT = unknown>(error: string | Partial<NuxtError<DataT>>) => NuxtError<DataT>;
@@ -1,18 +1,19 @@
1
- import { createError as _createError } from "h3";
1
+ import { createError as createH3Error } from "h3";
2
2
  import { toRef } from "vue";
3
3
  import { useNuxtApp } from "../nuxt.mjs";
4
+ export const NUXT_ERROR_SIGNATURE = "__nuxt_error";
4
5
  export const useError = () => toRef(useNuxtApp().payload, "error");
5
- export const showError = (_err) => {
6
- const err = createError(_err);
6
+ export const showError = (error) => {
7
+ const nuxtError = createError(error);
7
8
  try {
8
9
  const nuxtApp = useNuxtApp();
9
- nuxtApp.callHook("app:error", err);
10
- const error = useError();
11
- error.value = error.value || err;
10
+ nuxtApp.callHook("app:error", nuxtError);
11
+ const error2 = useError();
12
+ error2.value = error2.value || nuxtError;
12
13
  } catch {
13
- throw err;
14
+ throw nuxtError;
14
15
  }
15
- return err;
16
+ return nuxtError;
16
17
  };
17
18
  export const throwError = showError;
18
19
  export const clearError = async (options = {}) => {
@@ -24,9 +25,13 @@ export const clearError = async (options = {}) => {
24
25
  }
25
26
  error.value = null;
26
27
  };
27
- export const isNuxtError = (err) => !!(err && typeof err === "object" && "__nuxt_error" in err);
28
- export const createError = (err) => {
29
- const _err = _createError(err);
30
- _err.__nuxt_error = true;
31
- return _err;
28
+ export const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
29
+ export const createError = (error) => {
30
+ const nuxtError = createH3Error(error);
31
+ Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
32
+ value: true,
33
+ configurable: false,
34
+ writable: false
35
+ });
36
+ return nuxtError;
32
37
  };
@@ -6,3 +6,4 @@ export { useLazyFetch } from './fetch';
6
6
  export * from './router';
7
7
  export { useRequestHeaders, useRequestEvent } from './ssr';
8
8
  export * from './state';
9
+ export { useRuntimeHook } from './runtime-hook';
@@ -6,3 +6,4 @@ export { useLazyFetch } from "./fetch.mjs";
6
6
  export * from "./router.mjs";
7
7
  export { useRequestHeaders, useRequestEvent } from "./ssr.mjs";
8
8
  export * from "./state.mjs";
9
+ export { useRuntimeHook } from "./runtime-hook.mjs";
@@ -0,0 +1,8 @@
1
+ import type { HookCallback } from 'hookable';
2
+ import type { RuntimeNuxtHooks } from '@nuxt/bridge-schema';
3
+ /**
4
+ * Registers a runtime hook in a Nuxt application and ensures it is properly disposed of when the scope is destroyed.
5
+ * @param name - The name of the hook to register.
6
+ * @param fn - The callback function to be executed when the hook is triggered.
7
+ */
8
+ export declare function useRuntimeHook<THookName extends keyof RuntimeNuxtHooks>(name: THookName, fn: RuntimeNuxtHooks[THookName] extends HookCallback ? RuntimeNuxtHooks[THookName] : never): void;
@@ -0,0 +1,7 @@
1
+ import { onScopeDispose } from "vue";
2
+ import { useNuxtApp } from "../nuxt.mjs";
3
+ export function useRuntimeHook(name, fn) {
4
+ const nuxtApp = useNuxtApp();
5
+ const unregister = nuxtApp.hook(name, fn);
6
+ onScopeDispose(unregister);
7
+ }
@@ -259,7 +259,7 @@ async function setupNitroBridge() {
259
259
  encoding: mockProxy,
260
260
  he: mockProxy,
261
261
  resolve: mockProxy,
262
- "source-map": mockProxy,
262
+ ...nuxt.options.dev ? {} : { "source-map": mockProxy },
263
263
  "lodash.template": mockProxy,
264
264
  "serialize-javascript": mockProxy,
265
265
  // Renderer
@@ -811,7 +811,7 @@ async function setupAppBridge(_options) {
811
811
  nuxt.hook("builder:generateApp", () => builder.generateRoutesAndFiles());
812
812
  });
813
813
  nuxt.options.build.transpile.push("vuex");
814
- nuxt.options.build.transpile.push("h3", "iron-webcrypto", "ohash", "ofetch", "unenv", "cookie-es");
814
+ nuxt.options.build.transpile.push("h3", "iron-webcrypto", "ohash", "ofetch", "unenv", "cookie-es", "node-mock-http");
815
815
  nuxt.options.build.transpile.push("unhead");
816
816
  nuxt.options.fetch.server = false;
817
817
  nuxt.options.fetch.client = false;
@@ -1130,6 +1130,10 @@ const granularAppPresets = [
1130
1130
  {
1131
1131
  imports: ["useAsyncData", "useFetch", "useHydration"],
1132
1132
  from: "#app/mocks"
1133
+ },
1134
+ {
1135
+ imports: ["useRuntimeHook"],
1136
+ from: "#app/composables/runtime-hook"
1133
1137
  }
1134
1138
  ];
1135
1139
  const vueKeys = [
@@ -1268,7 +1272,7 @@ const importsModule = defineNuxtModule({
1268
1272
  dirs: [],
1269
1273
  transform: {
1270
1274
  include: [],
1271
- exclude: undefined
1275
+ exclude: void 0
1272
1276
  }
1273
1277
  },
1274
1278
  async setup(options, nuxt) {
@@ -1729,7 +1733,7 @@ const PageMetaPlugin = createUnplugin(
1729
1733
  if (s.hasChanged()) {
1730
1734
  return {
1731
1735
  code: s.toString(),
1732
- map: options.sourcemap ? s.generateMap({ hires: true }) : undefined
1736
+ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0
1733
1737
  };
1734
1738
  }
1735
1739
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/bridge-edge",
3
- "version": "3.4.0-29110408.3747562",
3
+ "version": "3.6.0-29254306.aa54696",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/bridge.git"
@@ -21,74 +21,74 @@
21
21
  "dependencies": {
22
22
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
23
23
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
24
- "@babel/plugin-transform-typescript": "^7.26.7",
25
- "@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.4.0-29110408.3747562",
24
+ "@babel/plugin-transform-typescript": "^7.28.0",
25
+ "@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.6.0-29254306.aa54696",
26
26
  "@nuxt/devalue": "^2.0.2",
27
- "@nuxt/kit": "3.17.1",
28
- "@nuxt/schema": "3.17.1",
27
+ "@nuxt/kit": "3.18.1",
28
+ "@nuxt/schema": "3.18.1",
29
29
  "@nuxt/ui-templates": "^1.3.4",
30
30
  "@rollup/plugin-replace": "^6.0.2",
31
31
  "@unhead/ssr": "^1.11.20",
32
32
  "@unhead/vue": "^1.11.20",
33
- "@vitejs/plugin-legacy": "^6.0.1",
33
+ "@vitejs/plugin-legacy": "^7.2.1",
34
34
  "@vitejs/plugin-vue2": "^2.3.3",
35
- "acorn": "^8.14.0",
35
+ "acorn": "^8.15.0",
36
36
  "cookie-es": "^2.0.0",
37
37
  "defu": "^6.1.4",
38
- "destr": "^2.0.3",
39
- "enhanced-resolve": "^5.18.1",
40
- "esbuild-loader": "^4.2.2",
38
+ "destr": "^2.0.5",
39
+ "enhanced-resolve": "^5.18.3",
40
+ "esbuild-loader": "^4.3.0",
41
41
  "escape-string-regexp": "^5.0.0",
42
42
  "estree-walker": "^3.0.3",
43
- "exsolve": "^1.0.4",
43
+ "exsolve": "^1.0.7",
44
44
  "externality": "^1.0.2",
45
45
  "fs-extra": "^10.1.0",
46
- "get-port-please": "^3.1.2",
47
- "h3": "^1.14.0",
46
+ "get-port-please": "^3.2.0",
47
+ "h3": "~1.15.4",
48
48
  "hash-sum": "^2.0.0",
49
49
  "hookable": "5.5.3",
50
50
  "klona": "^2.0.6",
51
51
  "knitwork": "^1.2.0",
52
52
  "magic-string": "^0.30.17",
53
53
  "mlly": "^1.7.4",
54
- "mocked-exports": "^0.1.0",
55
- "nitropack": "^2.10.4",
54
+ "mocked-exports": "^0.1.1",
55
+ "nitropack": "^2.12.4",
56
56
  "node-fetch": "^3.3.2",
57
- "nypm": "^0.5.2",
57
+ "nypm": "^0.6.1",
58
58
  "ofetch": "^1.4.1",
59
59
  "ohash": "^2.0.11",
60
- "pathe": "^2.0.2",
60
+ "pathe": "^2.0.3",
61
61
  "perfect-debounce": "^1.0.0",
62
- "pkg-types": "^2.0.1",
62
+ "pkg-types": "^2.2.0",
63
63
  "postcss-import-resolver": "^2.0.0",
64
64
  "scule": "^1.3.0",
65
- "std-env": "^3.8.0",
66
- "terser": "^5.38.0",
67
- "ufo": "^1.5.4",
68
- "unimport": "^5.0.0",
65
+ "std-env": "^3.9.0",
66
+ "terser": "^5.43.1",
67
+ "ufo": "^1.6.1",
68
+ "unimport": "^5.2.0",
69
69
  "unplugin": "^1.16.1",
70
70
  "untyped": "^2.0.0",
71
- "vite": "~6.2.7",
72
- "vite-node": "^3.0.5",
73
- "vue-bundle-renderer": "^2.1.1"
71
+ "vite": "~7.1.1",
72
+ "vite-node": "^3.2.4",
73
+ "vue-bundle-renderer": "^2.1.2"
74
74
  },
75
75
  "devDependencies": {
76
- "@babel/core": "^7.26.7",
77
- "@types/estree": "^1.0.6",
76
+ "@babel/core": "^7.28.0",
77
+ "@types/estree": "^1.0.8",
78
78
  "@types/fs-extra": "^9.0.13",
79
79
  "@types/hash-sum": "^1.0.2",
80
80
  "@types/webpack": "^4.41.40",
81
81
  "@vue/compiler-sfc": "^2.7.16",
82
- "@vue/reactivity": "^3.5.13",
83
- "rollup": "^4.34.4",
84
- "unbuild": "3.3.1",
82
+ "@vue/reactivity": "^3.5.18",
83
+ "rollup": "^4.46.2",
84
+ "unbuild": "3.6.0",
85
85
  "vue": "^2.7.16",
86
86
  "vue-meta": "^2.4.0",
87
87
  "vue-router": "^3.6.5",
88
88
  "zhead": "^2.2.4"
89
89
  },
90
90
  "engines": {
91
- "node": "^18.20.5 || ^20.0.0 || >=22.0.0"
91
+ "node": "^20.19.0 || >=22.12.0"
92
92
  },
93
93
  "_name": "@nuxt/bridge",
94
94
  "scripts": {