@scayle/storefront-nuxt 8.12.4 → 8.14.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
+ ## 8.14.4
4
+
5
+ ### Patch Changes
6
+
7
+ **@scayle/storefront-core v8.14.4**
8
+
9
+ **Dependencies**
10
+
3
11
  ## 8.12.4
4
12
 
5
13
  ### Patch Changes
@@ -406,28 +414,28 @@
406
414
  **rpc-methods.ts**
407
415
 
408
416
  ```typescript
409
- import type { RpcContext, RpcHandler } from '@scayle/storefront-nuxt'
417
+ import type { RpcContext, RpcHandler } from "@scayle/storefront-nuxt";
410
418
 
411
419
  export const foo: RpcHandler<string, number> = function testing(
412
420
  param: string,
413
- _: RpcContext,
421
+ _: RpcContext
414
422
  ) {
415
- return param.length
416
- }
423
+ return param.length;
424
+ };
417
425
  ```
418
426
 
419
427
  **module.ts**
420
428
 
421
429
  ```typescript
422
430
  function setup() {
423
- const resolver = createResolver(import.meta.url)
431
+ const resolver = createResolver(import.meta.url);
424
432
 
425
- nuxt.hook('storefront:custom-rpc:extend', (customRpcImports) => {
433
+ nuxt.hook("storefront:custom-rpc:extend", (customRpcImports) => {
426
434
  customRpcImports.push({
427
- source: resolver.resolve('./rpc-methods.ts'),
428
- names: ['foo'],
429
- })
430
- })
435
+ source: resolver.resolve("./rpc-methods.ts"),
436
+ names: ["foo"],
437
+ });
438
+ });
431
439
  }
432
440
  ```
433
441
 
@@ -649,23 +657,23 @@
649
657
  storefront: {
650
658
  // ...
651
659
  redis: {
652
- host: 'localhost',
660
+ host: "localhost",
653
661
  port: 6379,
654
- prefix: '',
655
- user: '',
656
- password: '',
662
+ prefix: "",
663
+ user: "",
664
+ password: "",
657
665
  sslTransit: false,
658
666
  },
659
667
  // ...
660
668
  session: {
661
669
  // ...
662
- provider: 'redis',
670
+ provider: "redis",
663
671
  },
664
672
  },
665
673
  // ...
666
674
  },
667
675
  // ...
668
- })
676
+ });
669
677
  ```
670
678
 
671
679
  - _Current Unified Storage Approach (`nuxt.config.ts`):_
@@ -679,13 +687,13 @@
679
687
  // ...
680
688
  storage: {
681
689
  cache: {
682
- driver: 'redis',
683
- host: 'localhost',
690
+ driver: "redis",
691
+ host: "localhost",
684
692
  port: 6379,
685
693
  },
686
694
  session: {
687
- driver: 'redis',
688
- host: 'localhost',
695
+ driver: "redis",
696
+ host: "localhost",
689
697
  port: 6379,
690
698
  },
691
699
  // ...
@@ -695,7 +703,7 @@
695
703
  // ...
696
704
  },
697
705
  // ...
698
- })
706
+ });
699
707
  ```
700
708
 
701
709
  - **\[💥 BREAKING\]** The composable `useSearch` has been replaced by `useStorefrontSearch`, consolidating and transitioning to SCAYLE Search v2.
@@ -762,9 +770,9 @@
762
770
 
763
771
  ```ts
764
772
  const { activeFilters, applyFilters, resetFilterUrl, productConditions } =
765
- useQueryFilterState()
773
+ useQueryFilterState();
766
774
 
767
- applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 })
775
+ applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 });
768
776
  ```
769
777
 
770
778
  - _Current Usage of `useFilter` and `useAppliedFilters`:_
@@ -777,20 +785,20 @@
777
785
  resetFilters,
778
786
  resetPriceFilter,
779
787
  resetFilter,
780
- } = useFilter()
788
+ } = useFilter();
781
789
 
782
- applyPriceFilter([0, 100])
783
- applyBooleanFilter('sale', true)
784
- applyAttributeFilter('brand', 23)
790
+ applyPriceFilter([0, 100]);
791
+ applyBooleanFilter("sale", true);
792
+ applyAttributeFilter("brand", 23);
785
793
 
786
- const route = useRoute()
794
+ const route = useRoute();
787
795
  const {
788
796
  appliedFilter,
789
797
  appliedFiltersCount,
790
798
  appliedAttributeValues,
791
799
  appliedBooleanValues,
792
800
  areFiltersApplied,
793
- } = useAppliedFilters(route)
801
+ } = useAppliedFilters(route);
794
802
  ```
795
803
 
796
804
  - **\[💥 BREAKING\]** The `getBadgeLabel` helper function has been removed, giving you more control over badge label display.
@@ -800,43 +808,43 @@
800
808
 
801
809
  ```ts
802
810
  const BadgeLabel = {
803
- NEW: 'new',
804
- SOLD_OUT: 'sold_out',
805
- ONLINE_EXCLUSIVE: 'online_exclusive',
806
- SUSTAINABLE: 'sustainable',
807
- PREMIUM: 'premium',
808
- DEFAULT: '',
809
- } as const
811
+ NEW: "new",
812
+ SOLD_OUT: "sold_out",
813
+ ONLINE_EXCLUSIVE: "online_exclusive",
814
+ SUSTAINABLE: "sustainable",
815
+ PREMIUM: "premium",
816
+ DEFAULT: "",
817
+ } as const;
810
818
 
811
819
  type BadgeLabelParamsKeys =
812
- | 'isNew'
813
- | 'isSoldOut'
814
- | 'isOnlineOnly'
815
- | 'isSustainable'
816
- | 'isPremium'
817
- type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>
820
+ | "isNew"
821
+ | "isSoldOut"
822
+ | "isOnlineOnly"
823
+ | "isSustainable"
824
+ | "isPremium";
825
+ type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>;
818
826
 
819
827
  const getBadgeLabel = (params: BadgeLabelParams = {}): string => {
820
828
  if (!params) {
821
- return BadgeLabel.DEFAULT
829
+ return BadgeLabel.DEFAULT;
822
830
  }
823
831
  const { isNew, isSoldOut, isOnlineOnly, isSustainable, isPremium } =
824
- params
832
+ params;
825
833
 
826
834
  if (isNew) {
827
- return BadgeLabel.NEW
835
+ return BadgeLabel.NEW;
828
836
  } else if (isSoldOut) {
829
- return BadgeLabel.SOLD_OUT
837
+ return BadgeLabel.SOLD_OUT;
830
838
  } else if (isOnlineOnly) {
831
- return BadgeLabel.ONLINE_EXCLUSIVE
839
+ return BadgeLabel.ONLINE_EXCLUSIVE;
832
840
  } else if (isSustainable) {
833
- return BadgeLabel.SUSTAINABLE
841
+ return BadgeLabel.SUSTAINABLE;
834
842
  } else if (isPremium) {
835
- return BadgeLabel.PREMIUM
843
+ return BadgeLabel.PREMIUM;
836
844
  } else {
837
- return BadgeLabel.DEFAULT
845
+ return BadgeLabel.DEFAULT;
838
846
  }
839
- }
847
+ };
840
848
  ```
841
849
 
842
850
  - **\[💥 BREAKING\]** The `store` option in the module configuration has been removed. `œscayle/storefront-nuxt@7.84.0` introduced the `shops` option as a replacement, but maintained backward compatibility with the `store` option. Going forward, configuring shops must be done using the `shops` keyword.
@@ -860,7 +868,7 @@
860
868
  // ...
861
869
  },
862
870
  // ...
863
- })
871
+ });
864
872
  ```
865
873
 
866
874
  - _Previous Environment Variables for Store Configuration:_
@@ -889,7 +897,7 @@
889
897
  // ...
890
898
  },
891
899
  // ...
892
- })
900
+ });
893
901
  ```
894
902
 
895
903
  - _Current Environment Variables for Shops Configuration:_
@@ -909,8 +917,8 @@
909
917
  ```ts
910
918
  useProduct({
911
919
  // ...
912
- key: 'productKey',
913
- })
920
+ key: "productKey",
921
+ });
914
922
  ```
915
923
 
916
924
  - _Current `key` as dedicated composables argument:_
@@ -920,8 +928,8 @@
920
928
  {
921
929
  // ...
922
930
  },
923
- 'productKey',
924
- )
931
+ "productKey"
932
+ );
925
933
  ```
926
934
 
927
935
  - **\[💥 BREAKING\]** Introducing a new feature flag `storefront.legacy.enableSessionMigration` to control the automatic migration of legacy session data, set to `false` by default. Starting with `@scayle/storefront-nuxt@7.68.0` Storefront uses unique session cookie names for each shop, simplifying implementation and enhancing stability.
@@ -938,27 +946,27 @@
938
946
  - _Previous Usage of `handleIDPLoginCallback`:_
939
947
 
940
948
  ```ts
941
- const { handleIDPLoginCallback } = await useIDP()
949
+ const { handleIDPLoginCallback } = await useIDP();
942
950
 
943
951
  watch(
944
952
  () => route.query,
945
953
  async (query) => {
946
954
  if (query.code && isString(query.code)) {
947
- await handleIDPLoginCallback(query.code)
955
+ await handleIDPLoginCallback(query.code);
948
956
  }
949
957
  },
950
- { immediate: true },
951
- )
958
+ { immediate: true }
959
+ );
952
960
  ```
953
961
 
954
962
  - _Current Usage of `loginIDP`:_
955
963
 
956
964
  ```ts
957
- const { loginIDP } = useAuthentication('login')
965
+ const { loginIDP } = useAuthentication("login");
958
966
 
959
967
  onMounted(async () => {
960
- await loginIDP(props.code)
961
- })
968
+ await loginIDP(props.code);
969
+ });
962
970
  ```
963
971
 
964
972
  - **\[🧹 NON-BREAKING\]** Addressed various type resolution errors that were present when using the `@scayle/storefront-nuxt` package with different Node.js versions and module systems. These errors manifested as internal resolution errors or ESM dynamic import only warnings. With this fix, the package now more consistently resolves types correctly across Node.js 16 (CJS and ESM), and bundlers, ensuring a smoother developer experience.
@@ -968,17 +976,17 @@
968
976
  - _Previous `useRpc` with `autoFetch`:_
969
977
 
970
978
  ```ts
971
- useRpc('rpcMethod', key, params, { autoFetch: true })
979
+ useRpc("rpcMethod", key, params, { autoFetch: true });
972
980
 
973
- useUser({ autoFetch: true })
981
+ useUser({ autoFetch: true });
974
982
  ```
975
983
 
976
984
  - _Current `useRpc` with `immediate`:_
977
985
 
978
986
  ```ts
979
- useRpc('rpcMethod', key, params, { immediate: true })
987
+ useRpc("rpcMethod", key, params, { immediate: true });
980
988
 
981
- useUser({ immediate: true })
989
+ useUser({ immediate: true });
982
990
  ```
983
991
 
984
992
  - **\[💥 BREAKING\]** The attribute `isCmsPreview` has been removed from `RpcContext`.
@@ -998,18 +1006,18 @@
998
1006
  getSearchSuggestions,
999
1007
  fetching,
1000
1008
  ...searchData
1001
- } = useStorefrontSearch(searchQuery, { key })
1009
+ } = useStorefrontSearch(searchQuery, { key });
1002
1010
 
1003
- fetching.value // true or false
1011
+ fetching.value; // true or false
1004
1012
  ```
1005
1013
 
1006
1014
  - _Current `useStorefrontSearch` returning `status`:_
1007
1015
 
1008
1016
  ```ts
1009
1017
  const { data, resolveSearch, getSearchSuggestions, status, ...searchData } =
1010
- useStorefrontSearch(searchQuery, {}, key)
1018
+ useStorefrontSearch(searchQuery, {}, key);
1011
1019
 
1012
- status.value // 'idle', 'pending', 'error' or 'success'
1020
+ status.value; // 'idle', 'pending', 'error' or 'success'
1013
1021
  ```
1014
1022
 
1015
1023
  - **\[💥 BREAKING\]** We've simplified composable caching and clarified the control you have over shared state behavior. The configuration option `disableDefaultGetCachedDataOverride` has been replaced with `legacy.enableDefaultGetCachedDataOverride`, and its logic has been reversed. Now, when `legacy.enableDefaultGetCachedDataOverride` is not set or set to `false`, the default behavior maintains the shared state functionality of `useRpc`, where multiple calls with the same key use the same cached data. Setting the option to `true` bypasses this shared caching, providing data isolation between calls. To maintain your existing caching behavior, simply change the value of `disableDefaultGetCachedDataOverride` to its opposite in your `nuxt.config.ts` file.
@@ -1034,7 +1042,7 @@
1034
1042
  // ...
1035
1043
  },
1036
1044
  // ...
1037
- })
1045
+ });
1038
1046
  ```
1039
1047
 
1040
1048
  - _Current `enableDefaultGetCachedDataOverride`in `nuxt.config.ts`:_
@@ -1059,7 +1067,7 @@
1059
1067
  // ...
1060
1068
  },
1061
1069
  // ...
1062
- })
1070
+ });
1063
1071
  ```
1064
1072
 
1065
1073
  - **\[💥 BREAKING\]** The `useRpc` composable has been updated to provide a more modern and robust data fetching experience, aligning its interface with the current and underlying [Nuxt 3 `useAsyncData`.](https://nuxt.com/docs/api/composables/use-async-data#return-values).
@@ -1081,7 +1089,7 @@
1081
1089
  function myCustomRpc() {
1082
1090
  // ...
1083
1091
 
1084
- throw new BaseError(404)
1092
+ throw new BaseError(404);
1085
1093
  }
1086
1094
  ```
1087
1095
 
@@ -1091,7 +1099,7 @@
1091
1099
  function myCustomRpc() {
1092
1100
  // ...
1093
1101
 
1094
- return new Response(null, { status: 404 })
1102
+ return new Response(null, { status: 404 });
1095
1103
  }
1096
1104
  ```
1097
1105
 
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.12.4",
3
+ "version": "8.14.4",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -53,7 +53,7 @@ export default {
53
53
  }`;
54
54
  }
55
55
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
56
- const PACKAGE_VERSION = "8.12.4";
56
+ const PACKAGE_VERSION = "8.14.4";
57
57
  const logger = createConsola({
58
58
  fancy: true,
59
59
  formatOptions: {
@@ -10,37 +10,5 @@
10
10
  *
11
11
  * @returns The result of the RPC call or a `Response` object with an error status.
12
12
  */
13
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | true | string[] | import("@scayle/storefront-core").ShopUser | Response | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").Product[] | import("@scayle/storefront-core").FetchProductsCountResponse | import("@scayle/storefront-core").FetchFiltersResponse | import("@scayle/storefront-core").FetchProductsByCategoryResponse | import("@scayle/storefront-api").Wishlist | {
14
- accessToken: string;
15
- checkoutJwt: string;
16
- } | import("@scayle/storefront-api").VariantDetail[] | {
17
- basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
18
- } | {
19
- readonly type: "success";
20
- readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
21
- } | {
22
- readonly type: "failure";
23
- readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
24
- readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
25
- } | import("@scayle/storefront-api").BrandsEndpointResponseData | import("@scayle/storefront-api").Brand | {
26
- categories: import("@scayle/storefront-api").Category[];
27
- activeNode: undefined;
28
- } | import("@scayle/storefront-api").Category | {
29
- categories: import("@scayle/storefront-api").Category;
30
- activeNode: import("@scayle/storefront-api").Category;
31
- } | import("@scayle/storefront-core").Order<Record<string, unknown>, Record<string, unknown>> | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
32
- user: import("@scayle/storefront-core").ShopUser | undefined;
33
- } | import("@scayle/storefront-core").ShopUserAddress[] | import("@scayle/storefront-api").NavigationAllEndpointResponseData | import("@scayle/storefront-api").NavigationTree | {
34
- success: true;
35
- } | {
36
- success: false;
37
- } | {
38
- result: true;
39
- } | {
40
- result: false;
41
- } | import("@scayle/storefront-api").PromotionsEndpointResponseData | {
42
- [k: string]: string;
43
- } | {
44
- message: string;
45
- } | null | undefined>>;
13
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
46
14
  export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.12.4",
4
+ "version": "8.14.4",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@opentelemetry/api": "^1.9.0",
83
83
  "@scayle/h3-session": "0.6.0",
84
- "@scayle/storefront-core": "8.14.3",
84
+ "@scayle/storefront-core": "8.14.4",
85
85
  "@scayle/unstorage-compression-driver": "^0.2.4",
86
86
  "@vercel/nft": "0.29.2",
87
87
  "@vueuse/core": "13.0.0",
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "devDependencies": {
103
103
  "@eslint/eslintrc": "3.3.1",
104
- "@nuxt/eslint": "1.2.0",
104
+ "@nuxt/eslint": "1.3.0",
105
105
  "@nuxt/kit": "3.15.4",
106
106
  "@nuxt/module-builder": "0.8.4",
107
107
  "@nuxt/schema": "3.15.4",