@scayle/storefront-nuxt 7.85.0 → 7.85.1

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,10 +1,84 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.85.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix `@vueuse/core` version to `11.0.3`
8
+
3
9
  ## 7.85.0
4
10
 
5
11
  ### Minor Changes
6
12
 
7
- - Improve typing when using `transform` or `pick` in RPC composables
13
+ - Fix typing when using `transform`, `default` or `pick` in RPC composables
14
+
15
+ NOTE: This update corrects some broken typings and as a result may require some code changes.
16
+ Previously many composables asserted that the default value would match the response value even when relying on the fallback `default` factory function: `() => null`.
17
+ Due to this, the `data` property would be typed as `Ref<T>` even when it would be `Ref<null>` in case of error on a still pending request.
18
+ The types have now been corrected to respect the `default` factory function's return and accurately represent the behavior.
19
+ This means that you may have to add additional null checks in your code for typechecking to pass.
20
+
21
+ For example:
22
+
23
+ **In 7.84.6**
24
+
25
+ ```ts
26
+ useBrand({
27
+ params: { brandId: 1 },
28
+ }).data satisfies Ref<Brand>
29
+
30
+ useBrand({
31
+ params: { brandId: 1 },
32
+ options: {
33
+ pick: ['id', 'isActive'],
34
+ },
35
+ }).data satisfies Ref<Brand>
36
+
37
+ useBrand({
38
+ params: { brandId: 1 },
39
+ options: {
40
+ transform: (brand) => brand.slug,
41
+ },
42
+ }).data satisfies Ref<Brand>
43
+
44
+ useBrand({
45
+ params: { brandId: 1 },
46
+ options: {
47
+ default: () => 'Brand not found',
48
+ },
49
+ }).data satisfies Ref<Brand>
50
+ ```
51
+
52
+ **In 7.85.0**
53
+
54
+ ```ts
55
+ useBrand({
56
+ params: { brandId: 1 },
57
+ }).data satisfies Ref<Brand | null>
58
+
59
+ useBrand({
60
+ params: { brandId: 1 },
61
+ options: {
62
+ pick: ['id', 'isActive'],
63
+ },
64
+ }).data satisfies Ref<Pick<Brand, 'id' | 'isActive'> | null>
65
+
66
+ useBrand({
67
+ params: { brandId: 1 },
68
+ options: {
69
+ transform: (brand) => brand.slug,
70
+ },
71
+ }).data satisfies Ref<string | null>
72
+
73
+ useBrand({
74
+ params: { brandId: 1 },
75
+ options: {
76
+ default: () => 'Brand not found',
77
+ },
78
+ }).data satisfies Ref<Brand | string>
79
+ ```
80
+
81
+ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.com/docs/api/composables/use-async-data)
8
82
 
9
83
  ### Patch Changes
10
84
 
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "7.85.0",
3
+ "version": "7.85.1",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -66,7 +66,7 @@ export default {
66
66
  }`;
67
67
  }
68
68
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
69
- const PACKAGE_VERSION = "7.85.0";
69
+ const PACKAGE_VERSION = "7.85.1";
70
70
  const logger = createConsola({
71
71
  fancy: true,
72
72
  formatOptions: {
@@ -23,7 +23,7 @@ export function useIDP(params = {}, key) {
23
23
  error,
24
24
  refresh,
25
25
  status,
26
- // TODO: Deprecate the property here and remove it with the next major release
26
+ // TODO: [Next Major Release] Deprecate the property here and remove it with the next major release
27
27
  handleIDPLoginCallback
28
28
  });
29
29
  }
@@ -27,7 +27,7 @@ export function useBasket({
27
27
  const removeItemFromBasketRpc = useRpcCall("removeItemFromBasket");
28
28
  const asyncData = useRpc("getBasket", key, params, {
29
29
  server: false,
30
- // TODO: In some cases it might be ok to fetch on server
30
+ // NOTE: In some cases it might be ok to fetch on server
31
31
  watch: [toRef(params)],
32
32
  dedupe: "defer",
33
33
  getCachedData: (key2) => {
@@ -23,7 +23,7 @@ export function useWishlist({
23
23
  params,
24
24
  {
25
25
  server: false,
26
- // TODO: In some cases it might be ok to fetch on server
26
+ // NOTE: In some cases it might be ok to fetch on server
27
27
  watch: [toRef(params)],
28
28
  dedupe: "defer",
29
29
  getCachedData: (key2) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.85.0",
4
+ "version": "7.85.1",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -62,7 +62,7 @@
62
62
  "@scayle/h3-session": "^0.4.0",
63
63
  "@scayle/storefront-core": "7.64.3",
64
64
  "@scayle/unstorage-compression-driver": "^0.1.3",
65
- "@vueuse/core": "^11.0.0",
65
+ "@vueuse/core": "11.0.3",
66
66
  "consola": "^3.2.3",
67
67
  "core-js": "^3.37.1",
68
68
  "defu": "^6.1.4",
@@ -80,24 +80,24 @@
80
80
  "zod": "^3.23.8"
81
81
  },
82
82
  "devDependencies": {
83
- "@nuxt/eslint": "0.5.3",
83
+ "@nuxt/eslint": "0.5.4",
84
84
  "@nuxt/module-builder": "0.5.5",
85
85
  "@nuxt/schema": "3.12.4",
86
86
  "@nuxt/test-utils": "3.14.1",
87
87
  "@scayle/eslint-config-storefront": "4.3.0",
88
88
  "@scayle/eslint-plugin-vue-composable": "0.2.0",
89
- "@types/node": "20.16.1",
89
+ "@types/node": "20.16.2",
90
90
  "dprint": "0.47.2",
91
91
  "eslint": "9.9.1",
92
92
  "eslint-formatter-gitlab": "5.1.0",
93
93
  "fishery": "2.2.2",
94
94
  "h3": "1.12.0",
95
95
  "node-mocks-http": "1.15.1",
96
- "nuxi": "3.13.0",
96
+ "nuxi": "3.13.1",
97
97
  "nuxt": "3.12.4",
98
98
  "publint": "0.2.10",
99
99
  "vitest": "2.0.5",
100
- "vue-tsc": "2.0.29"
100
+ "vue-tsc": "2.1.2"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "h3": "^1.10.0",