@scayle/storefront-product-listing 2.4.0 → 2.5.0

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,11 @@
1
1
  # @scayle/storefront-product-listing
2
2
 
3
+ ## 2.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **[RPC]** Updated built-in RPC methods to use `GET` for safe, cacheable reads and `PUT`/`POST`/`DELETE` for mutations, enabling CDN and browser caching for public data fetches.
8
+
3
9
  ## 2.4.0
4
10
 
5
11
  ### Minor Changes
@@ -128,20 +134,20 @@
128
134
 
129
135
  ```ts
130
136
  // Before
131
- const { data } = await useRpc('getProduct', 'my-static-product-key', {
137
+ const { data } = await useRpc("getProduct", "my-static-product-key", {
132
138
  productId: 123,
133
- })
139
+ });
134
140
 
135
141
  // After
136
- const productId = ref(123)
142
+ const productId = ref(123);
137
143
 
138
144
  // The key is now reactive. If `productId` changes, the key updates
139
145
  // to 'product-456' (for example) and triggers a new fetch.
140
146
  const { data } = await useRpc(
141
- 'getProduct',
147
+ "getProduct",
142
148
  () => `product-${productId.value}`,
143
- { productId },
144
- )
149
+ { productId }
150
+ );
145
151
  ```
146
152
 
147
153
  ## 2.2.0
@@ -221,14 +227,14 @@
221
227
  **Before**
222
228
 
223
229
  ```ts
224
- import { defaultSortingOptions } from '#storefront-product-listing'
230
+ import { defaultSortingOptions } from "#storefront-product-listing";
225
231
  const { sortLinks } = useProductListSort(useRoute(), {
226
232
  sortingOptions: defaultSortingOptions,
227
- })
233
+ });
228
234
  ```
229
235
 
230
236
  ```ts
231
- const { sortLinks } = useProductListSort(useRoute())
237
+ const { sortLinks } = useProductListSort(useRoute());
232
238
  ```
233
239
 
234
240
  (Both before approaches are equivalent.)
@@ -236,19 +242,19 @@
236
242
  **After**
237
243
 
238
244
  ```ts
239
- import { SORT_PRICE_ASC, SORT_PRICE_DESC } from '#storefront-product-listing'
245
+ import { SORT_PRICE_ASC, SORT_PRICE_DESC } from "#storefront-product-listing";
240
246
  const { sortLinks } = useProductListSort(useRoute(), {
241
247
  sortingOptions: [
242
248
  {
243
249
  ...SORT_PRICE_ASC,
244
- label: 'Price Ascending',
250
+ label: "Price Ascending",
245
251
  },
246
252
  {
247
253
  ...SORT_PRICE_DESC,
248
- label: 'Price Descending',
254
+ label: "Price Descending",
249
255
  },
250
256
  ],
251
- })
257
+ });
252
258
  ```
253
259
 
254
260
  - **BREAKING**: `useProductListingSeoData` now expects `isDefaultSortSelected` to be passed as the final parameter. This removes the internal dependency on `useProductListSort`. It is typed as `MaybeRefOrGetter<Boolean>` to support reactive usage.
@@ -256,12 +262,12 @@
256
262
  **Before**
257
263
 
258
264
  ```ts
259
- const route = useRoute()
265
+ const route = useRoute();
260
266
  const { title, robots, canonicalLink, categoryBreadcrumbSchema } =
261
267
  useProductListingSeoData(breadcrumbs, route, {
262
268
  baseUrl: baseUrl,
263
269
  fullPath: fullPath,
264
- })
270
+ });
265
271
  ```
266
272
 
267
273
  **After**
@@ -433,7 +439,7 @@
433
439
  They can be used as follows:
434
440
 
435
441
  ```ts
436
- import { filtersFactory } from '@scayle/storefront-product-listing'
442
+ import { filtersFactory } from "@scayle/storefront-product-listing";
437
443
  ```
438
444
 
439
445
  - Upgrade the `storefront-core` and `storefront-nuxt` packages to version 8 and update your implementation to reflect the changes in RPC composables:
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-product-listing",
3
3
  "configKey": "product-listing",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "compatibility": {
6
6
  "bridge": false,
7
7
  "nuxt": ">=3.13"
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineNuxtModule, createResolver, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const PACKAGE_NAME = "@scayle/storefront-product-listing";
4
- const PACKAGE_VERSION = "2.4.0";
4
+ const PACKAGE_VERSION = "2.5.0";
5
5
  const module$1 = defineNuxtModule({
6
6
  meta: {
7
7
  name: PACKAGE_NAME,
@@ -44,4 +44,4 @@ export const getAllShopCategoriesForId = defineRpcHandler(async ({ id, propertie
44
44
  // 12 hours
45
45
  })();
46
46
  return result;
47
- });
47
+ }, { method: "GET" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-product-listing",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Collection of essential composables and utilities to work with product listing",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -28,6 +28,9 @@
28
28
  "CHANGELOG.md",
29
29
  "dist"
30
30
  ],
31
+ "engines": {
32
+ "node": ">= 22.0.0"
33
+ },
31
34
  "imports": {
32
35
  "#storefront-product-listing": "./dist/runtime/index.js"
33
36
  },
@@ -41,29 +44,29 @@
41
44
  },
42
45
  "devDependencies": {
43
46
  "@arethetypeswrong/cli": "0.18.2",
44
- "@nuxt/kit": "3.20.0",
47
+ "@nuxt/kit": "^3.20.2",
45
48
  "@nuxt/module-builder": "1.0.2",
46
- "@nuxt/schema": "3.20.0",
47
- "@nuxt/test-utils": "3.23.0",
48
- "@types/node": "22.19.5",
49
- "@vitest/coverage-v8": "4.0.16",
50
- "@vueuse/core": "14.1.0",
51
- "dprint": "0.51.1",
52
- "eslint-formatter-gitlab": "7.0.1",
53
- "eslint": "9.39.2",
49
+ "@nuxt/schema": "^3.20.2",
50
+ "@nuxt/test-utils": "4.0.0",
51
+ "@scayle/eslint-config-storefront": "^4.8.0",
52
+ "@types/node": "22.19.17",
53
+ "@vitest/coverage-v8": "4.1.5",
54
+ "@vueuse/core": "14.2.1",
55
+ "eslint-formatter-gitlab": "7.1.0",
56
+ "eslint": "10.2.1",
54
57
  "fishery": "2.4.0",
55
- "happy-dom": "20.1.0",
56
- "nuxt": "3.20.0",
57
- "publint": "0.3.16",
58
+ "h3": "1.15.11",
59
+ "happy-dom": "20.9.0",
60
+ "nuxt": "^3.20.2",
61
+ "publint": "0.3.18",
58
62
  "schema-dts": "1.1.5",
59
63
  "typescript": "5.9.3",
60
64
  "unbuild": "3.6.1",
61
- "vitest": "4.0.16",
65
+ "vitest": "4.1.5",
62
66
  "vue-router": "4.6.4",
63
- "vue-tsc": "3.2.2",
64
- "vue": "3.5.26",
65
- "@scayle/eslint-config-storefront": "4.7.20",
66
- "@scayle/storefront-nuxt": "8.58.0",
67
+ "vue-tsc": "3.2.6",
68
+ "vue": "3.5.32",
69
+ "@scayle/storefront-nuxt": "8.61.0",
67
70
  "@scayle/vitest-config-storefront": "1.0.0"
68
71
  },
69
72
  "scripts": {
@@ -74,11 +77,6 @@
74
77
  "lint": "eslint .",
75
78
  "lint:ci": "eslint . --format gitlab",
76
79
  "lint:fix": "eslint . --fix",
77
- "format": "dprint check",
78
- "format:fix": "dprint fmt",
79
- "test": "vitest --run",
80
- "test:watch": "vitest",
81
- "test:ci": "vitest --run --coverage --reporter=default --reporter=junit --outputFile=./coverage/junit.xml",
82
80
  "typecheck": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
83
81
  "package:lint": "publint",
84
82
  "verify-packaging": "attw --pack . --profile esm-only"