@nuxt/bridge-edge 3.2.0-28563709.07ef19e → 3.2.0-28587690.ed6b683
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.
package/dist/chunks/module.mjs
CHANGED
|
@@ -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.0-
|
|
6
|
+
const version = "3.2.0-28587690.ed6b683";
|
|
7
7
|
|
|
8
8
|
const middlewareTemplate = {
|
|
9
9
|
filename: "middleware.js",
|
|
@@ -2,13 +2,11 @@ import type { ComputedRef } from 'vue';
|
|
|
2
2
|
import { defineComponent as defineComponentVue, ref } from 'vue';
|
|
3
3
|
import type { Route } from 'vue-router';
|
|
4
4
|
import type { Nuxt2Context } from '@nuxt/bridge-schema';
|
|
5
|
-
export { computed, customRef, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, isReactive, isReadonly, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, reactive, readonly, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssModule as useCSSModule, useSlots, version, watch, watchEffect, watchPostEffect, watchSyncEffect } from 'vue';
|
|
5
|
+
export { computed, customRef, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, isReactive, isReadonly, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, reactive, readonly, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssModule as useCSSModule, useSlots, version, watch, watchEffect, watchPostEffect, watchSyncEffect, defineAsyncComponent, proxyRefs } from 'vue';
|
|
6
6
|
export { ref };
|
|
7
7
|
export declare const createApp: () => () => never;
|
|
8
8
|
export declare const createRef: () => () => never;
|
|
9
|
-
export declare const defineAsyncComponent: () => () => never;
|
|
10
9
|
export declare const isRaw: () => () => never;
|
|
11
|
-
export declare const proxyRefs: () => () => never;
|
|
12
10
|
export declare const warn: () => () => never;
|
|
13
11
|
export declare const defineNuxtMiddleware: () => never;
|
|
14
12
|
export declare const defineNuxtPlugin: () => never;
|
|
@@ -49,7 +49,9 @@ export {
|
|
|
49
49
|
watch,
|
|
50
50
|
watchEffect,
|
|
51
51
|
watchPostEffect,
|
|
52
|
-
watchSyncEffect
|
|
52
|
+
watchSyncEffect,
|
|
53
|
+
defineAsyncComponent,
|
|
54
|
+
proxyRefs
|
|
53
55
|
} from "vue";
|
|
54
56
|
export { ref };
|
|
55
57
|
const checkDocsMsg = "Please see https://nuxt.com/docs/bridge/bridge-composition-api for more information.";
|
|
@@ -69,9 +71,7 @@ const warnOnce = (id, message) => {
|
|
|
69
71
|
};
|
|
70
72
|
export const createApp = () => unsupported("`createApp` is not provided by Vue 2.7.");
|
|
71
73
|
export const createRef = () => unsupported("`createRef` is not provided by Vue 2.7.");
|
|
72
|
-
export const defineAsyncComponent = () => unsupported("`defineAsyncComponent` is not provided by Vue 2.7.");
|
|
73
74
|
export const isRaw = () => unsupported("`isRaw` is not provided by Vue 2.7.");
|
|
74
|
-
export const proxyRefs = () => unsupported("`proxyRefs` is not provided by Vue 2.7.");
|
|
75
75
|
export const warn = () => unsupported("`warn` is not provided by Vue 2.7.");
|
|
76
76
|
warnOnce("import", "`@nuxtjs/composition-api` is deprecated.");
|
|
77
77
|
export const defineNuxtMiddleware = unsupported("You are using `defineNuxtMiddleware`, which is not supported.");
|
|
@@ -11,7 +11,7 @@ export interface NavigateToOptions {
|
|
|
11
11
|
redirectCode?: number;
|
|
12
12
|
external?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const navigateTo: (to: RawLocation | undefined | null, options?: NavigateToOptions) => Promise<void | Route | NavigationFailure> | RawLocation | Route;
|
|
14
|
+
export declare const navigateTo: (to: RawLocation | undefined | null, options?: NavigateToOptions) => Promise<void | Route | NavigationFailure | false> | false | void | RawLocation | Route;
|
|
15
15
|
/** This will abort navigation within a Nuxt route middleware handler. */
|
|
16
16
|
export declare const abortNavigation: (err?: string | Partial<NuxtError>) => boolean;
|
|
17
17
|
type RouteMiddlewareReturn = void | Error | string | Location | boolean | Route;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentInstance, reactive } from "vue";
|
|
2
2
|
import { sendRedirect } from "h3";
|
|
3
3
|
import { useRouter as useVueRouter, useRoute as useVueRoute } from "vue-router/composables";
|
|
4
|
-
import { hasProtocol, joinURL, parseURL } from "ufo";
|
|
4
|
+
import { hasProtocol, joinURL, parseURL, withQuery } from "ufo";
|
|
5
5
|
import { useNuxtApp, callWithNuxt, useRuntimeConfig } from "../nuxt.mjs";
|
|
6
6
|
import { createError, showError } from "./error.mjs";
|
|
7
7
|
export const useRouter = () => {
|
|
@@ -53,23 +53,33 @@ export const navigateTo = (to, options) => {
|
|
|
53
53
|
if (!to) {
|
|
54
54
|
to = "/";
|
|
55
55
|
}
|
|
56
|
-
const toPath = typeof to === "string" ? to : to.path || "/";
|
|
57
|
-
const isExternal = hasProtocol(toPath, true);
|
|
56
|
+
const toPath = typeof to === "string" ? to : withQuery(to.path || "/", to.query || {}) + (to.hash || "");
|
|
57
|
+
const isExternal = options?.external || hasProtocol(toPath, { acceptRelative: true });
|
|
58
58
|
if (isExternal && !options?.external) {
|
|
59
59
|
throw new Error("Navigating to external URL is not allowed by default. Use `nagivateTo (url, { external: true })`.");
|
|
60
60
|
}
|
|
61
61
|
if (isExternal && parseURL(toPath).protocol === "script:") {
|
|
62
62
|
throw new Error("Cannot navigate to an URL with script protocol.");
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
const inMiddleware = isProcessingMiddleware();
|
|
65
|
+
if (process.client && !isExternal && inMiddleware) {
|
|
65
66
|
return to;
|
|
66
67
|
}
|
|
67
68
|
const router = useRouter();
|
|
69
|
+
const nuxtApp = useNuxtApp();
|
|
68
70
|
if (process.server) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
if (nuxtApp.ssrContext) {
|
|
72
|
+
const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).resolved.fullPath || "/";
|
|
73
|
+
const location2 = isExternal ? toPath : joinURL(useRuntimeConfig().app.baseURL, fullPath);
|
|
74
|
+
const redirect = async function(response) {
|
|
75
|
+
await nuxtApp.callHook("app:redirected");
|
|
76
|
+
await sendRedirect(nuxtApp.ssrContext.event, location2, options?.redirectCode || 302);
|
|
77
|
+
return response;
|
|
78
|
+
};
|
|
79
|
+
return redirect(!inMiddleware ? void 0 : (
|
|
80
|
+
/* abort route navigation */
|
|
81
|
+
false
|
|
82
|
+
));
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
85
|
if (isExternal) {
|
|
@@ -78,6 +88,13 @@ export const navigateTo = (to, options) => {
|
|
|
78
88
|
} else {
|
|
79
89
|
location.href = toPath;
|
|
80
90
|
}
|
|
91
|
+
if (inMiddleware) {
|
|
92
|
+
if (!nuxtApp.isHydrating) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return new Promise(() => {
|
|
96
|
+
});
|
|
97
|
+
}
|
|
81
98
|
return Promise.resolve();
|
|
82
99
|
}
|
|
83
100
|
return options?.replace ? router.replace(to) : router.push(to);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/bridge-edge",
|
|
3
|
-
"version": "3.2.0-
|
|
3
|
+
"version": "3.2.0-28587690.ed6b683",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/bridge.git"
|
|
@@ -21,23 +21,23 @@
|
|
|
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.
|
|
25
|
-
"@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.2.0-
|
|
24
|
+
"@babel/plugin-transform-typescript": "^7.24.5",
|
|
25
|
+
"@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.2.0-28587690.ed6b683",
|
|
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.3",
|
|
31
31
|
"@rollup/plugin-replace": "^5.0.5",
|
|
32
|
-
"@unhead/ssr": "^1.9.
|
|
33
|
-
"@unhead/vue": "^1.9.
|
|
34
|
-
"@vitejs/plugin-legacy": "^5.
|
|
32
|
+
"@unhead/ssr": "^1.9.10",
|
|
33
|
+
"@unhead/vue": "^1.9.10",
|
|
34
|
+
"@vitejs/plugin-legacy": "^5.4.0",
|
|
35
35
|
"@vitejs/plugin-vue2": "^2.3.1",
|
|
36
36
|
"acorn": "^8.11.3",
|
|
37
37
|
"cookie-es": "^1.1.0",
|
|
38
38
|
"defu": "^6.1.4",
|
|
39
39
|
"destr": "^2.0.3",
|
|
40
|
-
"enhanced-resolve": "^5.16.
|
|
40
|
+
"enhanced-resolve": "^5.16.1",
|
|
41
41
|
"esbuild-loader": "^4.1.0",
|
|
42
42
|
"escape-string-regexp": "^5.0.0",
|
|
43
43
|
"estree-walker": "^3.0.3",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"klona": "^2.0.6",
|
|
52
52
|
"knitwork": "^1.1.0",
|
|
53
53
|
"magic-string": "^0.30.10",
|
|
54
|
-
"mlly": "^1.
|
|
54
|
+
"mlly": "^1.7.0",
|
|
55
55
|
"nitropack": "^2.9.6",
|
|
56
56
|
"node-fetch": "^3.3.2",
|
|
57
57
|
"nypm": "^0.3.8",
|
|
@@ -63,19 +63,19 @@
|
|
|
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.
|
|
66
|
+
"postcss-preset-env": "^9.5.11",
|
|
67
67
|
"postcss-url": "^10.1.3",
|
|
68
68
|
"scule": "^1.3.0",
|
|
69
|
-
"semver": "^7.6.
|
|
69
|
+
"semver": "^7.6.1",
|
|
70
70
|
"std-env": "^3.7.0",
|
|
71
|
-
"terser": "^5.
|
|
71
|
+
"terser": "^5.31.0",
|
|
72
72
|
"ufo": "^1.5.3",
|
|
73
73
|
"unctx": "^2.3.1",
|
|
74
74
|
"unimport": "^3.7.1",
|
|
75
75
|
"unplugin": "^1.10.1",
|
|
76
76
|
"untyped": "^1.4.2",
|
|
77
|
-
"vite": "~5.2.
|
|
78
|
-
"vite-node": "^1.
|
|
77
|
+
"vite": "~5.2.11",
|
|
78
|
+
"vite-node": "^1.6.0",
|
|
79
79
|
"vue-bundle-renderer": "^2.0.0"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
@@ -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.
|
|
89
|
+
"rollup": "^4.17.2",
|
|
90
90
|
"unbuild": "2.0.0",
|
|
91
91
|
"vue": "^2.7.15",
|
|
92
92
|
"vue-router": "^3.6.5"
|