@scayle/storefront-nuxt 7.62.1 → 7.62.2
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.62.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Error pages should be bootstrapped based on the URL where the error occurred
|
|
8
|
+
|
|
9
|
+
This resolves an issue where context properties such as `currentShop` and `availableShops` were not available on the error page.
|
|
10
|
+
|
|
3
11
|
## 7.62.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/module.json
CHANGED
|
@@ -27,10 +27,9 @@ const generateSessionId = (event) => {
|
|
|
27
27
|
}
|
|
28
28
|
return userId ? `${userId}:${randomUUID()}` : randomUUID();
|
|
29
29
|
};
|
|
30
|
-
async function bootstrap(event,
|
|
30
|
+
async function bootstrap(event, $shopConfig, $storefrontConfig, apiBasePath, config) {
|
|
31
31
|
const log = event.context.$log;
|
|
32
32
|
const bootstrapLog = log.space("bootstrap");
|
|
33
|
-
bootstrapLog.debug("Bootstrapping request: " + url.toString());
|
|
34
33
|
const $cache = useCacheStorage(
|
|
35
34
|
String($shopConfig.shopId),
|
|
36
35
|
$shopConfig.shopId,
|
|
@@ -104,30 +103,37 @@ async function bootstrap(event, url, $shopConfig, $storefrontConfig, apiBasePath
|
|
|
104
103
|
event
|
|
105
104
|
});
|
|
106
105
|
}
|
|
106
|
+
function getBootstrapPath(event) {
|
|
107
|
+
const url = getRequestURL(event);
|
|
108
|
+
if (url.pathname === "/__nuxt_error") {
|
|
109
|
+
return url.searchParams.get("url") ?? url.pathname;
|
|
110
|
+
}
|
|
111
|
+
return url.pathname;
|
|
112
|
+
}
|
|
107
113
|
export default defineEventHandler(async (event) => {
|
|
108
114
|
try {
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
115
|
+
const path = getBootstrapPath(event);
|
|
116
|
+
if (path.startsWith("/__nuxt")) {
|
|
111
117
|
return;
|
|
112
118
|
}
|
|
113
119
|
const config = useRuntimeConfig();
|
|
114
120
|
const $storefrontConfig = config.storefront;
|
|
115
|
-
if (
|
|
121
|
+
if (path === `${$storefrontConfig.apiBasePath ?? "/api"}/up`) {
|
|
116
122
|
return;
|
|
117
123
|
}
|
|
118
124
|
const $shopConfig = getShopConfig(event, config);
|
|
119
125
|
const apiBasePath = ($storefrontConfig.shopSelector === "path" && $shopConfig.path ? `/${$shopConfig.path}` : "") + ($shopConfig.apiBasePath || $storefrontConfig.apiBasePath || "/api");
|
|
120
126
|
if (!event.context.$rpcContext) {
|
|
127
|
+
event.context.$log.debug("Bootstrapping request: " + path);
|
|
121
128
|
await bootstrap(
|
|
122
129
|
event,
|
|
123
|
-
url,
|
|
124
130
|
$shopConfig,
|
|
125
131
|
$storefrontConfig,
|
|
126
132
|
apiBasePath,
|
|
127
133
|
config
|
|
128
134
|
);
|
|
129
135
|
}
|
|
130
|
-
if ($storefrontConfig.redirects?.enabled && !
|
|
136
|
+
if ($storefrontConfig.redirects?.enabled && !path.startsWith(apiBasePath)) {
|
|
131
137
|
await useRedirects(event);
|
|
132
138
|
}
|
|
133
139
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.62.
|
|
4
|
+
"version": "7.62.2",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"jose": "^5.2.0",
|
|
72
72
|
"knitwork": "1.0.0",
|
|
73
73
|
"nitropack": "2.9.4",
|
|
74
|
-
"ofetch": "1.3.
|
|
74
|
+
"ofetch": "1.3.4",
|
|
75
75
|
"radash": "12.1.0",
|
|
76
76
|
"uncrypto": "0.1.3",
|
|
77
77
|
"unstorage": "1.10.2",
|