@scayle/storefront-nuxt 7.61.3 → 7.61.4

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.61.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix the type of unitialized data in `useBasket` and `useWishlist`
8
+
9
+ When the request for the basket/wishlist has not completed or has failed, the `data` property is `undefined`. In the previous release this was inadvertently changed to `null`. Now it is once again `undefined`.
10
+
3
11
  ## 7.61.3
4
12
 
5
13
  ### Patch Changes
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.9.0"
6
6
  },
7
- "version": "7.61.2"
7
+ "version": "7.61.3"
8
8
  }
@@ -6,7 +6,7 @@ type UseBasketOptions = Partial<{
6
6
  key: string;
7
7
  }>;
8
8
  export declare function useBasket({ params, key, }?: UseBasketOptions): Promise<{
9
- data: import("vue").Ref<BasketResponseData<import("@scayle/storefront-core").Product, import("@scayle/storefront-core").Variant> | null>;
9
+ data: import("vue").Ref<BasketResponseData<import("@scayle/storefront-core").Product, import("@scayle/storefront-core").Variant> | undefined>;
10
10
  items: import("vue").ComputedRef<import("@scayle/storefront-core").BasketItem<import("@scayle/storefront-core").Product, import("@scayle/storefront-core").Variant>[] | undefined>;
11
11
  cost: import("vue").ComputedRef<import("@scayle/storefront-core").BasketTotalPrice | undefined>;
12
12
  key: import("vue").ComputedRef<import("@aboutyou/backbone").BasketKey | undefined>;
@@ -44,8 +44,9 @@ export async function useBasket({
44
44
  watch: [toRef(params)],
45
45
  dedupe: "defer",
46
46
  getCachedData: (key2) => {
47
- return toValue(nuxtApp._asyncData[key2]?.data);
48
- }
47
+ return toValue(nuxtApp._asyncData[key2]?.data) ?? void 0;
48
+ },
49
+ default: () => void 0
49
50
  }
50
51
  );
51
52
  useEventListener(
@@ -5,7 +5,7 @@ type Options = Partial<{
5
5
  key: string;
6
6
  }>;
7
7
  export declare function useWishlist({ params, key, }?: Options): Promise<{
8
- data: import("vue").Ref<WishlistResponseData | null>;
8
+ data: import("vue").Ref<WishlistResponseData | undefined>;
9
9
  count: import("vue").ComputedRef<number | undefined>;
10
10
  items: import("vue").ComputedRef<WishlistItem[] | undefined>;
11
11
  products: import("vue").ComputedRef<Product[]>;
@@ -29,8 +29,9 @@ export async function useWishlist({
29
29
  watch: [toRef(params)],
30
30
  dedupe: "defer",
31
31
  getCachedData: (key2) => {
32
- return toValue(nuxtApp._asyncData[key2]?.data);
33
- }
32
+ return toValue(nuxtApp._asyncData[key2]?.data) ?? void 0;
33
+ },
34
+ default: () => void 0
34
35
  }
35
36
  );
36
37
  const addItem = async (item) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.61.3",
4
+ "version": "7.61.4",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -70,7 +70,7 @@
70
70
  "defu": "6.1.4",
71
71
  "jose": "^5.2.0",
72
72
  "knitwork": "1.0.0",
73
- "nitropack": "2.9.1",
73
+ "nitropack": "2.9.3",
74
74
  "ofetch": "1.3.3",
75
75
  "radash": "12.1.0",
76
76
  "uncrypto": "0.1.3",
@@ -84,7 +84,7 @@
84
84
  "@nuxt/test-utils": "3.11.0",
85
85
  "@scayle/eslint-config-storefront": "3.2.6",
86
86
  "@scayle/prettier-config-storefront": "2.0.2",
87
- "@types/node": "20.11.25",
87
+ "@types/node": "20.11.26",
88
88
  "eslint": "8.57.0",
89
89
  "eslint-formatter-gitlab": "5.1.0",
90
90
  "h3": "1.11.1",