@scayle/storefront-product-detail 1.5.5 → 1.5.6

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,34 @@
1
1
  # @scayle/storefront-product-detail
2
2
 
3
+ ## 1.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Enhanced data fetching composables to support reactive keys, aligning with [Nuxt 3.17 data fetching improvements](https://nuxt.com/blog/v3-17#data-fetching-improvements).
8
+
9
+ You can now pass a `ref`, `computed`, or getter function as the `key` parameter to `useRpc` and derived composables (like `useProducts`, `useBrand` etc.). When the reactive key changes, the data will automatically re-fetch.
10
+
11
+ - **Before:** Keys were static strings.
12
+ - **After:** Keys can be reactive, enabling dynamic caching and automatic updates.
13
+
14
+ ```ts
15
+ // Before
16
+ const { data } = await useRpc('getProduct', 'my-static-product-key', {
17
+ productId: 123,
18
+ })
19
+
20
+ // After
21
+ const productId = ref(123)
22
+
23
+ // The key is now reactive. If `productId` changes, the key updates
24
+ // to 'product-456' (for example) and triggers a new fetch.
25
+ const { data } = await useRpc(
26
+ 'getProduct',
27
+ () => `product-${productId.value}`,
28
+ { productId },
29
+ )
30
+ ```
31
+
3
32
  ## 1.5.5
4
33
 
5
34
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-product-detail",
3
3
  "configKey": "product-detail",
4
- "version": "1.5.5",
4
+ "version": "1.5.6",
5
5
  "compatibility": {
6
6
  "bridge": false,
7
7
  "nuxt": ">=3.13"
package/dist/module.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const PACKAGE_NAME = "@scayle/storefront-product-detail";
4
- const PACKAGE_VERSION = "1.5.5";
5
- const module = defineNuxtModule({
4
+ const PACKAGE_VERSION = "1.5.6";
5
+ const module$1 = defineNuxtModule({
6
6
  meta: {
7
7
  name: PACKAGE_NAME,
8
8
  configKey: "product-detail",
@@ -37,4 +37,4 @@ const module = defineNuxtModule({
37
37
  }
38
38
  });
39
39
 
40
- export { module as default };
40
+ export { module$1 as default };
@@ -1,7 +1,7 @@
1
- import type { KeysOf, NormalizedRpcResponse, UseRpcOptions, UseRpcReturn } from '@scayle/storefront-nuxt/composables';
1
+ import type { KeysOf, NormalizedRpcResponse, UseRpcOptions, UseRpcReturn, UseRpcCacheKey } from '@scayle/storefront-nuxt/composables';
2
2
  import type { MaybeRefOrGetter } from 'vue';
3
3
  import type { RpcMethodParameters } from '@scayle/storefront-nuxt';
4
4
  export declare function useAllShopProductsForId<DataT = NormalizedRpcResponse<'getAllShopProductsForId'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getAllShopProductsForId'>>;
6
6
  options: UseRpcOptions<'getAllShopProductsForId', DataT, PickKeys, DefaultT>;
7
- }>, key?: string): UseRpcReturn<'getAllShopProductsForId', DataT, PickKeys, DefaultT>;
7
+ }>, key?: UseRpcCacheKey): UseRpcReturn<'getAllShopProductsForId', DataT, PickKeys, DefaultT>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-product-detail",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "Collection of essential composables and utilities to work with product detail",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -37,29 +37,29 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@arethetypeswrong/cli": "0.18.2",
40
- "@nuxt/kit": "3.19.3",
40
+ "@nuxt/kit": "3.20.0",
41
41
  "@nuxt/module-builder": "1.0.2",
42
- "@nuxt/schema": "3.19.3",
42
+ "@nuxt/schema": "3.20.0",
43
43
  "@nuxt/test-utils": "3.20.1",
44
- "@types/node": "22.18.13",
45
- "@vitest/coverage-v8": "3.2.4",
44
+ "@types/node": "22.19.1",
45
+ "@vitest/coverage-v8": "4.0.14",
46
46
  "@vueuse/core": "13.9.0",
47
47
  "dprint": "0.50.2",
48
48
  "eslint-formatter-gitlab": "6.0.1",
49
- "eslint": "9.38.0",
50
- "happy-dom": "20.0.8",
51
- "nuxt": "3.19.3",
49
+ "eslint": "9.39.1",
50
+ "happy-dom": "20.0.10",
51
+ "nuxt": "3.20.0",
52
52
  "publint": "0.3.15",
53
53
  "schema-dts": "1.1.5",
54
54
  "typescript": "5.9.3",
55
55
  "unbuild": "3.6.1",
56
- "vitest": "3.2.4",
56
+ "vitest": "4.0.14",
57
57
  "vue-router": "4.6.3",
58
- "vue-tsc": "3.1.2",
59
- "vue": "3.5.22",
60
- "@scayle/eslint-config-storefront": "4.7.11",
61
- "@scayle/vitest-config-storefront": "1.0.0",
62
- "@scayle/storefront-nuxt": "8.47.0"
58
+ "vue-tsc": "3.1.5",
59
+ "vue": "3.5.25",
60
+ "@scayle/eslint-config-storefront": "4.7.14",
61
+ "@scayle/storefront-nuxt": "8.53.3",
62
+ "@scayle/vitest-config-storefront": "1.0.0"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "nuxt-module-build build",