@scayle/storefront-nuxt 7.66.1 → 7.66.3
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 +15 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/rpc.mjs +1 -1
- package/dist/runtime/composables/core/useRpc.mjs +2 -2
- package/dist/runtime/error/handler.mjs +1 -1
- package/dist/runtime/log.d.ts +1 -1
- package/dist/runtime/plugin/shop.mjs +1 -1
- package/dist/runtime/rpc/rpcCall.mjs +1 -1
- package/dist/runtime/server/middleware/bootstrap.mjs +3 -1
- package/dist/runtime/server/middleware/bootstrap.utils.d.ts +1 -1
- package/package.json +14 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.66.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @scayle/storefront-core@7.49.0
|
|
9
|
+
|
|
10
|
+
## 7.66.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- We fixed a bug where we would attach a session to a request for `/favicon.ico` when no favicon was present in the public directory.
|
|
15
|
+
|
|
16
|
+
This leads to a session conflict when using a path-based shop selector.
|
|
17
|
+
|
|
3
18
|
## 7.66.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
package/dist/rpc.mjs
CHANGED
|
@@ -4,7 +4,7 @@ const rpcCall = (nuxtApp, method, shop) => {
|
|
|
4
4
|
const fetch = nuxtApp.ssrContext?.event.$fetch ?? $fetch;
|
|
5
5
|
return async (params = void 0) => {
|
|
6
6
|
const data = await fetch(`${shop.apiBasePath ?? "/api"}/rpc/${method}`, {
|
|
7
|
-
// @ts-
|
|
7
|
+
// @ts-expect-error Type '"POST"' is not assignable to type 'AvailableRouterMethod<`${string}/rpc/${N}`> | Uppercase<AvailableRouterMethod<`${string}/rpc/${N}`>> | undefined'.ts(2322)
|
|
8
8
|
method: "POST",
|
|
9
9
|
body: {
|
|
10
10
|
payload: params
|
|
@@ -41,7 +41,7 @@ export const useRpc = async (method, key, params, options = { autoFetch: true, l
|
|
|
41
41
|
const fetch2 = getFetch(nuxtApp, log);
|
|
42
42
|
data.value = await unwrap(
|
|
43
43
|
await fetch2(`/rpc/${method}`, {
|
|
44
|
-
// @ts-
|
|
44
|
+
// @ts-expect-error Type '"POST"' is not assignable to type 'AvailableRouterMethod<`/rpc/${N}`> | Uppercase<AvailableRouterMethod<`/rpc/${N}`>> | undefined'.ts(2322)
|
|
45
45
|
method: "POST",
|
|
46
46
|
body: {
|
|
47
47
|
payload: toValue(params)
|
|
@@ -60,7 +60,7 @@ export const useRpc = async (method, key, params, options = { autoFetch: true, l
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
if (isAutoFetchEnabled && status.value === "idle") {
|
|
63
|
-
if (
|
|
63
|
+
if (import.meta.server) {
|
|
64
64
|
await fetch();
|
|
65
65
|
} else {
|
|
66
66
|
options.lazy ? fetch() : await fetch();
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { FetchError } from "ofetch";
|
|
9
9
|
const parseErrorData = (error) => {
|
|
10
10
|
if (error instanceof FetchError) {
|
|
11
|
-
const url = error.request?.url ??
|
|
11
|
+
const url = error.request?.url ?? error.request?.toString() ?? "/";
|
|
12
12
|
return {
|
|
13
13
|
statusCode: error.status ?? HttpStatusCode.INTERNAL_SERVER_ERROR,
|
|
14
14
|
statusMessage: error.statusText ?? HttpStatusMessage.INTERNAL_SERVER_ERROR,
|
package/dist/runtime/log.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useAvailableShops } from "../composables/core/useAvailableShops.mjs";
|
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
5
|
const currentShop = useCurrentShop();
|
|
6
6
|
const availableShops = useAvailableShops();
|
|
7
|
-
if (
|
|
7
|
+
if (import.meta.server && nuxtApp.ssrContext) {
|
|
8
8
|
currentShop.value = nuxtApp.ssrContext.event.context.$currentShop;
|
|
9
9
|
availableShops.value = nuxtApp.ssrContext.event.context.$availableShops;
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ export const rpcCall = (nuxtApp, method, shop) => {
|
|
|
3
3
|
const fetch = nuxtApp.ssrContext?.event.$fetch ?? $fetch;
|
|
4
4
|
return async (params = void 0) => {
|
|
5
5
|
const data = await fetch(`${shop.apiBasePath ?? "/api"}/rpc/${method}`, {
|
|
6
|
-
// @ts-
|
|
6
|
+
// @ts-expect-error Type '"POST"' is not assignable to type 'AvailableRouterMethod<`${string}/rpc/${N}`> | Uppercase<AvailableRouterMethod<`${string}/rpc/${N}`>> | undefined'.ts(2322)
|
|
7
7
|
method: "POST",
|
|
8
8
|
body: {
|
|
9
9
|
payload: params
|
|
@@ -56,7 +56,6 @@ async function bootstrap(event, $shopConfig, $storefrontConfig, apiBasePath, con
|
|
|
56
56
|
await useSession(event, {
|
|
57
57
|
...sessionConfig,
|
|
58
58
|
store: sessionStorage,
|
|
59
|
-
// @ts-ignore
|
|
60
59
|
genid: generateSessionId,
|
|
61
60
|
saveUninitialized: true,
|
|
62
61
|
cookie: {
|
|
@@ -114,6 +113,9 @@ export default defineEventHandler(async (event) => {
|
|
|
114
113
|
if (path.startsWith("/__nuxt")) {
|
|
115
114
|
return;
|
|
116
115
|
}
|
|
116
|
+
if (path === "/favicon.ico") {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
117
119
|
const config = useRuntimeConfig();
|
|
118
120
|
const $storefrontConfig = config.storefront;
|
|
119
121
|
if (path === `${$storefrontConfig.apiBasePath ?? "/api"}/up`) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H3Event } from 'h3';
|
|
1
|
+
import { type H3Event } from 'h3';
|
|
2
2
|
import type { ModuleOptions, PublicShopConfig, ShopConfig, ShopConfigIndexed } from '../../../module';
|
|
3
3
|
export declare const convertStoresToList: (stores: ShopConfig[] | ShopConfigIndexed) => ShopConfig[];
|
|
4
4
|
export declare function getCurrentShopForRequest(event: H3Event, config: Pick<ModuleOptions, 'stores' | 'shopSelector'>): ShopConfig;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.66.
|
|
4
|
+
"version": "7.66.3",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"prep": "nuxi prepare playground",
|
|
52
52
|
"format": "dprint check",
|
|
53
53
|
"format:fix": "dprint fmt",
|
|
54
|
-
"lint": "eslint . --format gitlab",
|
|
55
|
-
"lint:fix": "eslint . --fix",
|
|
54
|
+
"lint": "nuxi prepare playground & eslint . --format gitlab",
|
|
55
|
+
"lint:fix": "nuxi prepare playground & eslint . --fix",
|
|
56
56
|
"typecheck": "vue-tsc --noEmit -p tsconfig.check.json",
|
|
57
57
|
"package:lint": "publint",
|
|
58
58
|
"test": "vitest run",
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
"@nuxt/kit": "3.11.1",
|
|
64
64
|
"@opentelemetry/api": "1.8.0",
|
|
65
65
|
"@scayle/h3-session": "0.3.6",
|
|
66
|
-
"@scayle/storefront-core": "7.
|
|
66
|
+
"@scayle/storefront-core": "7.49.0",
|
|
67
67
|
"@scayle/unstorage-compression-driver": "0.1.3",
|
|
68
68
|
"@vueuse/core": "10.9.0",
|
|
69
69
|
"consola": "3.2.3",
|
|
70
|
-
"core-js": "3.
|
|
70
|
+
"core-js": "3.37.0",
|
|
71
71
|
"defu": "6.1.4",
|
|
72
72
|
"jose": "^5.2.0",
|
|
73
73
|
"knitwork": "1.1.0",
|
|
@@ -76,29 +76,31 @@
|
|
|
76
76
|
"radash": "12.1.0",
|
|
77
77
|
"uncrypto": "0.1.3",
|
|
78
78
|
"unstorage": "1.10.2",
|
|
79
|
-
"vue-router": "4.3.
|
|
79
|
+
"vue-router": "4.3.2",
|
|
80
80
|
"yn": "5.0.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
+
"@nuxt/eslint": "0.3.9",
|
|
83
84
|
"@nuxt/module-builder": "0.5.5",
|
|
84
85
|
"@nuxt/schema": "3.11.1",
|
|
85
|
-
"@nuxt/test-utils": "3.12.
|
|
86
|
-
"@scayle/eslint-config-storefront": "
|
|
86
|
+
"@nuxt/test-utils": "3.12.1",
|
|
87
|
+
"@scayle/eslint-config-storefront": "4.1.0",
|
|
87
88
|
"@scayle/eslint-plugin-vue-composable": "0.1.1",
|
|
88
89
|
"@types/node": "20.12.7",
|
|
89
90
|
"dprint": "0.45.1",
|
|
90
|
-
"eslint": "
|
|
91
|
+
"eslint": "9.0.0",
|
|
91
92
|
"eslint-formatter-gitlab": "5.1.0",
|
|
92
93
|
"h3": "1.11.1",
|
|
93
94
|
"node-mocks-http": "1.14.1",
|
|
95
|
+
"nuxi": "3.11.1",
|
|
94
96
|
"nuxt": "3.11.1",
|
|
95
97
|
"publint": "0.2.7",
|
|
96
|
-
"vitest": "1.5.
|
|
97
|
-
"vue-tsc": "2.0.
|
|
98
|
+
"vitest": "1.5.1",
|
|
99
|
+
"vue-tsc": "2.0.14"
|
|
98
100
|
},
|
|
99
101
|
"peerDependencies": {
|
|
100
102
|
"h3": "^1.10.0",
|
|
101
|
-
"nuxt": ">=3.
|
|
103
|
+
"nuxt": ">=3.10.0",
|
|
102
104
|
"unstorage": ">= 1.10.1",
|
|
103
105
|
"vue": ">=3.4.0"
|
|
104
106
|
},
|