@nuxt/bridge-edge 3.0.0-27420153.70542a3 → 3.0.0-27428666.bb31df9

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 { useNuxt, addPluginTemplate, resolveModule, addTemplate, resolveAlias, a
3
3
  import fs, { existsSync, promises } from 'fs';
4
4
  import fetch from 'node-fetch';
5
5
  import { joinURL, stringifyQuery, parseURL, parseQuery } from 'ufo';
6
- import { dirname, resolve, isAbsolute, relative, join as join$1, parse as parse$1, normalize } from 'pathe';
6
+ import { dirname, join as join$1, resolve, isAbsolute, relative, parse as parse$1, normalize } from 'pathe';
7
7
  import { getNitroContext, resolveMiddleware, scanMiddleware, writeTypes, build, prepare, generate, wpfs, createDevServer } from '@nuxt/nitro';
8
8
  import { fileURLToPath } from 'url';
9
9
  import { join } from 'path';
@@ -138,6 +138,14 @@ function setupNitroBridge() {
138
138
  Object.assign(nuxt.options.publicRuntimeConfig.app, nuxt.options.publicRuntimeConfig._app);
139
139
  nuxt.options.build.loadingScreen = false;
140
140
  nuxt.options.build.indicator = false;
141
+ if (nuxt.options.build.analyze === true) {
142
+ const { rootDir } = nuxt.options;
143
+ nuxt.options.build.analyze = {
144
+ template: "treemap",
145
+ projectRoot: rootDir,
146
+ filename: join$1(rootDir, ".nuxt/stats", "{name}.html")
147
+ };
148
+ }
141
149
  const nitroOptions = nuxt.options.nitro || {};
142
150
  const nitroContext = getNitroContext(nuxt.options, nitroOptions);
143
151
  const nitroDevContext = getNitroContext(nuxt.options, { ...nitroOptions, preset: "dev" });
@@ -687,7 +695,13 @@ const Nuxt3AutoImports = [
687
695
  "useFetch",
688
696
  "useLazyFetch",
689
697
  "useCookie",
690
- "useRequestHeaders"
698
+ "useRequestHeaders",
699
+ "useRouter",
700
+ "useRoute",
701
+ "defineNuxtRouteMiddleware",
702
+ "navigateTo",
703
+ "abortNavigation",
704
+ "addRouteMiddleware"
691
705
  ]
692
706
  },
693
707
  {
@@ -946,12 +960,6 @@ function setupAutoImports() {
946
960
  autoImport.disabled = true;
947
961
  }
948
962
  }
949
- autoImports2.push({ name: "useRouter", as: "useRouter", from: "#app" });
950
- autoImports2.push({ name: "useRoute", as: "useRoute", from: "#app" });
951
- autoImports2.push({ name: "addRouteMiddleware", as: "addRouteMiddleware", from: "#app" });
952
- autoImports2.push({ name: "navigateTo", as: "navigateTo", from: "#app" });
953
- autoImports2.push({ name: "abortNavigation", as: "abortNavigation", from: "#app" });
954
- autoImports2.push({ name: "defineNuxtRouteMiddleware", as: "defineNuxtRouteMiddleware", from: "#app" });
955
963
  autoImports2.push({ name: "useNuxt2Meta", as: "useNuxt2Meta", from: "#app" });
956
964
  });
957
965
  nuxt.hook("modules:done", () => installModule(autoImports));
@@ -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.0.0-27420153.70542a3";
6
+ const version = "3.0.0-27428666.bb31df9";
7
7
 
8
8
  const middlewareTemplate = {
9
9
  filename: "middleware.js",
@@ -22,7 +22,6 @@ export declare const useNuxt2Meta: (metaOptions: Reffed<MetaInfo> | (() => Reffe
22
22
  export interface AddRouteMiddlewareOptions {
23
23
  global?: boolean;
24
24
  }
25
- export declare const addRouteMiddleware: (name: string, middleware: any, options?: AddRouteMiddlewareOptions) => void;
26
25
  export declare const navigateTo: (to: Route) => Route | Promise<Route>;
27
26
  /** This will abort navigation within a Nuxt route middleware handler. */
28
27
  export declare const abortNavigation: (err?: Error | string) => boolean;
@@ -31,3 +30,8 @@ export interface RouteMiddleware {
31
30
  (to: Route, from: Route): RouteMiddlewareReturn | Promise<RouteMiddlewareReturn>;
32
31
  }
33
32
  export declare const defineNuxtRouteMiddleware: (middleware: RouteMiddleware) => RouteMiddleware;
33
+ interface AddRouteMiddleware {
34
+ (name: string, middleware: RouteMiddleware, options?: AddRouteMiddlewareOptions): void;
35
+ (middleware: RouteMiddleware): void;
36
+ }
37
+ export declare const addRouteMiddleware: AddRouteMiddleware;
@@ -121,14 +121,6 @@ function convertToLegacyMiddleware(middleware) {
121
121
  return result;
122
122
  };
123
123
  }
124
- export const addRouteMiddleware = (name, middleware, options = {}) => {
125
- const nuxtApp = useNuxtApp();
126
- if (options.global) {
127
- nuxtApp._middleware.global.push(middleware);
128
- } else {
129
- nuxtApp._middleware.named[name] = convertToLegacyMiddleware(middleware);
130
- }
131
- };
132
124
  const isProcessingMiddleware = () => {
133
125
  try {
134
126
  if (useNuxtApp()._processingMiddleware) {
@@ -156,3 +148,11 @@ export const abortNavigation = (err) => {
156
148
  return false;
157
149
  };
158
150
  export const defineNuxtRouteMiddleware = (middleware) => middleware;
151
+ export const addRouteMiddleware = (name, middleware, options = {}) => {
152
+ const nuxtApp = useNuxtApp();
153
+ if (options.global || typeof name === "function") {
154
+ nuxtApp._middleware.global.push(typeof name === "function" ? name : middleware);
155
+ } else {
156
+ nuxtApp._middleware.named[name] = convertToLegacyMiddleware(middleware);
157
+ }
158
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/bridge-edge",
3
- "version": "3.0.0-27420153.70542a3",
3
+ "version": "3.0.0-27428666.bb31df9",
4
4
  "repository": "nuxt/framework",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,10 +21,10 @@
21
21
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
22
22
  "@babel/plugin-proposal-optional-chaining": "^7.16.7",
23
23
  "@babel/plugin-transform-typescript": "^7.16.8",
24
- "@nuxt/kit": "npm:@nuxt/kit-edge@3.0.0-27420153.70542a3",
25
- "@nuxt/nitro": "npm:@nuxt/nitro-edge@3.0.0-27420153.70542a3",
24
+ "@nuxt/kit": "npm:@nuxt/kit-edge@3.0.0-27428666.bb31df9",
25
+ "@nuxt/nitro": "npm:@nuxt/nitro-edge@3.0.0-27428666.bb31df9",
26
26
  "@nuxt/postcss8": "^1.1.3",
27
- "@nuxt/schema": "npm:@nuxt/schema-edge@3.0.0-27420153.70542a3",
27
+ "@nuxt/schema": "npm:@nuxt/schema-edge@3.0.0-27428666.bb31df9",
28
28
  "@vitejs/plugin-legacy": "^1.6.4",
29
29
  "@vue/composition-api": "^1.4.6",
30
30
  "@vueuse/head": "^0.7.5",
@@ -45,7 +45,7 @@
45
45
  "mlly": "^0.4.2",
46
46
  "murmurhash-es": "^0.1.1",
47
47
  "node-fetch": "^3.2.0",
48
- "nuxi": "npm:nuxi-edge@3.0.0-27420153.70542a3",
48
+ "nuxi": "npm:nuxi-edge@3.0.0-27428666.bb31df9",
49
49
  "p-debounce": "^4.0.0",
50
50
  "pathe": "^0.2.0",
51
51
  "postcss": "^8",