@nuxt/bridge-edge 3.2.1-28616936.8cd2a5a → 3.2.1-28628424.85cf8fc

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.
@@ -3,7 +3,7 @@ import hash from 'hash-sum';
3
3
  import { resolve } from 'pathe';
4
4
  import { genImport, genObjectFromRawEntries } from 'knitwork';
5
5
 
6
- const version = "3.2.1-28616936.8cd2a5a";
6
+ const version = "3.2.1-28628424.85cf8fc";
7
7
 
8
8
  const middlewareTemplate = {
9
9
  filename: "middleware.js",
@@ -336,18 +336,22 @@ async function buildClient(ctx) {
336
336
  clientConfig.server.hmr = false;
337
337
  }
338
338
  if (clientConfig.server && clientConfig.server.hmr !== false) {
339
- const hmrPortDefault = 24678;
340
- const hmrPort = await getPort({
341
- port: hmrPortDefault,
342
- ports: Array.from({ length: 20 }, (_, i) => hmrPortDefault + 1 + i)
343
- });
344
- clientConfig.server = defu(clientConfig.server, {
345
- https: ctx.nuxt.options.server.https,
339
+ const serverDefaults = {
346
340
  hmr: {
347
- protocol: ctx.nuxt.options.server.https ? "wss" : "ws",
348
- port: hmrPort
341
+ protocol: ctx.nuxt.options.devServer.https ? "wss" : "ws"
349
342
  }
350
- });
343
+ };
344
+ if (typeof clientConfig.server.hmr !== "object" || !clientConfig.server.hmr.server) {
345
+ const hmrPortDefault = 24678;
346
+ serverDefaults.hmr.port = await getPort({
347
+ port: hmrPortDefault,
348
+ ports: Array.from({ length: 20 }, (_, i) => hmrPortDefault + 1 + i)
349
+ });
350
+ }
351
+ if (ctx.nuxt.options.devServer.https) {
352
+ serverDefaults.https = ctx.nuxt.options.devServer.https === true ? {} : ctx.nuxt.options.devServer.https;
353
+ }
354
+ clientConfig.server = defu(clientConfig.server, serverDefaults);
351
355
  }
352
356
  ctx.config.build.rollupOptions = defu(ctx.config.build.rollupOptions, {
353
357
  output: {
@@ -483,6 +487,7 @@ async function buildServer(ctx) {
483
487
  jsxPlugin(),
484
488
  vuePlugin,
485
489
  replace$1({
490
+ preventAssignment: true,
486
491
  "typeof window": '"undefined"',
487
492
  "typeof document": '"undefined"',
488
493
  "typeof navigator": '"undefined"',
@@ -2,6 +2,7 @@ import type { RuntimeConfig } from '@nuxt/schema';
2
2
  import type { NuxtAppCompat } from '@nuxt/bridge-schema';
3
3
  import type { Ref } from 'vue';
4
4
  import type { MetaInfo } from 'vue-meta';
5
+ import type { EventHandlerRequest, H3Event } from 'h3';
5
6
  export interface Context {
6
7
  $_nuxtApp: NuxtAppCompat;
7
8
  }
@@ -25,5 +26,5 @@ interface Plugin {
25
26
  }
26
27
  export declare function defineNuxtPlugin(plugin: Plugin): (ctx: Context, inject: (id: string, value: any) => void) => void;
27
28
  export declare const useNuxtApp: () => NuxtAppCompat;
28
- export declare const useRuntimeConfig: () => RuntimeConfig;
29
+ export declare const useRuntimeConfig: (_event?: H3Event<EventHandlerRequest>) => RuntimeConfig;
29
30
  export {};
@@ -91,7 +91,7 @@ export const useNuxtApp = () => {
91
91
  }
92
92
  return vm.proxy.$_nuxtApp;
93
93
  };
94
- export const useRuntimeConfig = () => {
94
+ export const useRuntimeConfig = (_event) => {
95
95
  const nuxtApp = useNuxtApp();
96
96
  if (nuxtApp._config) {
97
97
  return nuxtApp._config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/bridge-edge",
3
- "version": "3.2.1-28616936.8cd2a5a",
3
+ "version": "3.2.1-28628424.85cf8fc",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/bridge.git"
@@ -21,16 +21,16 @@
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.24.5",
25
- "@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.2.1-28616936.8cd2a5a",
24
+ "@babel/plugin-transform-typescript": "^7.24.6",
25
+ "@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.2.1-28628424.85cf8fc",
26
26
  "@nuxt/devalue": "^2.0.2",
27
27
  "@nuxt/kit": "3.11.2",
28
28
  "@nuxt/postcss8": "^1.1.3",
29
29
  "@nuxt/schema": "3.11.2",
30
30
  "@nuxt/ui-templates": "^1.3.4",
31
31
  "@rollup/plugin-replace": "^5.0.5",
32
- "@unhead/ssr": "^1.9.10",
33
- "@unhead/vue": "^1.9.10",
32
+ "@unhead/ssr": "^1.9.11",
33
+ "@unhead/vue": "^1.9.11",
34
34
  "@vitejs/plugin-legacy": "^5.4.0",
35
35
  "@vitejs/plugin-vue2": "^2.3.1",
36
36
  "acorn": "^8.11.3",
@@ -63,7 +63,7 @@
63
63
  "postcss": "^8.4.38",
64
64
  "postcss-import": "^16.1.0",
65
65
  "postcss-import-resolver": "^2.0.0",
66
- "postcss-preset-env": "^9.5.13",
66
+ "postcss-preset-env": "^9.5.14",
67
67
  "postcss-url": "^10.1.3",
68
68
  "scule": "^1.3.0",
69
69
  "semver": "^7.6.2",
@@ -71,10 +71,10 @@
71
71
  "terser": "^5.31.0",
72
72
  "ufo": "^1.5.3",
73
73
  "unctx": "^2.3.1",
74
- "unimport": "^3.7.1",
74
+ "unimport": "^3.7.2",
75
75
  "unplugin": "^1.10.1",
76
76
  "untyped": "^1.4.2",
77
- "vite": "~5.2.11",
77
+ "vite": "~5.2.12",
78
78
  "vite-node": "^1.6.0",
79
79
  "vue-bundle-renderer": "^2.1.0"
80
80
  },
@@ -86,7 +86,7 @@
86
86
  "@types/hash-sum": "^1.0.2",
87
87
  "@types/node-fetch": "^3.0.2",
88
88
  "nuxt": "^2.17.2",
89
- "rollup": "^4.17.2",
89
+ "rollup": "^4.18.0",
90
90
  "unbuild": "2.0.0",
91
91
  "vue": "^2.7.15",
92
92
  "vue-router": "^3.6.5"