@scayle/storefront-nuxt 7.85.2 → 7.85.3

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,18 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.85.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Replaced `radash` utils with custom native implementations
8
+ - Replace `yn` with custom `stringToBoolean` utility function.
9
+ NOTE: As the parsing of boolean environment values has been changed,
10
+ this might have unwanted effects if the respective values have been incorrectly
11
+ defined within the environment.
12
+ **Dependencies**
13
+
14
+ - Updated dependency to @scayle/storefront-core@7.64.4
15
+
3
16
  ## 7.85.2
4
17
 
5
18
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "7.85.2",
3
+ "version": "7.85.3",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import { defineNuxtModule, createResolver, extendViteConfig, addServerHandler, addTypeTemplate, addServerPlugin, addPlugin, addImportsDir } from '@nuxt/kit';
2
- import yn from 'yn';
3
2
  import { rpcMethods } from '@scayle/storefront-core';
4
3
  import { defu } from 'defu';
5
4
  import { genImport, genSafeVariableName } from 'knitwork';
@@ -30,6 +29,9 @@ function getApiBasePath(storefrontConfig, shop, baseUrl) {
30
29
  return joinURL(baseUrl, apiPath);
31
30
  }
32
31
 
32
+ function stringToBoolean(value, defaultValue = false) {
33
+ return value ? value.toLowerCase() === "true" : defaultValue;
34
+ }
33
35
  function getUsedDrivers(options) {
34
36
  const drivers = /* @__PURE__ */ new Set();
35
37
  drivers.add("memory");
@@ -53,7 +55,10 @@ function getUsedDrivers(options) {
53
55
  }
54
56
  function createVirtualDriverImport(options) {
55
57
  const usedDrivers = getUsedDrivers(options);
56
- const usesCompression = !yn(process.env.SFC_OMIT_COMPRESSION);
58
+ const usesCompression = !stringToBoolean(
59
+ process.env.SFC_OMIT_COMPRESSION,
60
+ false
61
+ );
57
62
  return `${usedDrivers.map(
58
63
  (driver) => genImport(builtinDrivers[driver], genSafeVariableName(driver))
59
64
  ).join("\n")}
@@ -66,7 +71,7 @@ export default {
66
71
  }`;
67
72
  }
68
73
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
69
- const PACKAGE_VERSION = "7.85.2";
74
+ const PACKAGE_VERSION = "7.85.3";
70
75
  const logger = createConsola({
71
76
  fancy: true,
72
77
  formatOptions: {
@@ -237,17 +242,17 @@ Missing RPC Overrides: ${Array.from(overridenRPCMethodNames).map((name) => `'${n
237
242
  addServerPlugin(
238
243
  resolve("./runtime/nitro/plugins/nitroRuntimeStorageConfig")
239
244
  );
240
- if (yn(process.env.SFC_PLUGIN_CONFIG_VALIDATION_ENABLED, { default: true })) {
245
+ if (stringToBoolean(process.env.SFC_PLUGIN_CONFIG_VALIDATION_ENABLED, true)) {
241
246
  logger.debug("Installing config validation plugin");
242
247
  addServerPlugin(resolve("./runtime/nitro/plugins/configValidation"));
243
248
  }
244
- if (yn(process.env.SFC_PLUGIN_POWERED_BY_ENABLED, { default: true })) {
249
+ if (stringToBoolean(process.env.SFC_PLUGIN_POWERED_BY_ENABLED, true)) {
245
250
  logger.debug("Installing X-Powered-By plugin");
246
251
  addServerPlugin(
247
252
  resolve("./runtime/nitro/plugins/nitroSetXPoweredByHeader")
248
253
  );
249
254
  }
250
- if (yn(process.env.SFC_PLUGIN_RUNTIME_PERFORMANCE_ENABLED, { default: true })) {
255
+ if (stringToBoolean(process.env.SFC_PLUGIN_RUNTIME_PERFORMANCE_ENABLED, true)) {
251
256
  logger.debug("Installing runtime performance plugin");
252
257
  addServerPlugin(resolve("./runtime/nitro/plugins/cacheRuntimeConfig"));
253
258
  }
@@ -280,7 +285,7 @@ Missing RPC Overrides: ${Array.from(overridenRPCMethodNames).map((name) => `'${n
280
285
  nitroConfig.externals?.inline?.push(file);
281
286
  });
282
287
  nitroConfig.replace = nitroConfig.replace || {};
283
- nitroConfig.replace["process.env.SFC_OMIT_MD5"] = yn(
288
+ nitroConfig.replace["process.env.SFC_OMIT_MD5"] = stringToBoolean(
284
289
  process.env.SFC_OMIT_MD5
285
290
  );
286
291
  nitroConfig.replace.__sfc_version = PACKAGE_VERSION;
@@ -1,4 +1,3 @@
1
- import { isEmpty, isEqual } from "radash";
2
1
  import {
3
2
  isFilterActive,
4
3
  transformToWhereCondition,
@@ -13,6 +12,16 @@ const DEFAULT_QUERY_KEYS = ["page", "sort", "term"];
13
12
  function queryValueToString(value) {
14
13
  return Array.isArray(value) ? value.map((v) => v?.toString()).filter(Boolean).join(",") : value?.toString();
15
14
  }
15
+ const isEqual = (x, y) => {
16
+ if (Object.is(x, y)) {
17
+ return true;
18
+ }
19
+ if (typeof x !== "object" || x === null || typeof y !== "object" || y === null) {
20
+ return x === y;
21
+ }
22
+ const keys = Object.keys(x);
23
+ return keys.length === Object.keys(y).length && keys.every((key) => Reflect.has(y, key) && isEqual(x[key], y[key]));
24
+ };
16
25
  export function useQueryFilterState(options = {}) {
17
26
  const router = useRouter();
18
27
  const route = useRoute();
@@ -26,7 +35,7 @@ export function useQueryFilterState(options = {}) {
26
35
  });
27
36
  const isActiveFilter = (filter) => {
28
37
  if (!filter) {
29
- return isEmpty(activeFilters.value);
38
+ return Object.values(activeFilters.value).length === 0;
30
39
  }
31
40
  return isFilterActive(activeFilters.value, filter);
32
41
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.85.2",
4
+ "version": "7.85.3",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "@nuxt/kit": "^3.12.2",
61
61
  "@opentelemetry/api": "^1.9.0",
62
62
  "@scayle/h3-session": "^0.4.0",
63
- "@scayle/storefront-core": "7.64.3",
63
+ "@scayle/storefront-core": "7.64.4",
64
64
  "@scayle/unstorage-compression-driver": "^0.1.3",
65
65
  "@vueuse/core": "11.0.3",
66
66
  "consola": "^3.2.3",
@@ -71,33 +71,31 @@
71
71
  "knitwork": "^1.1.0",
72
72
  "nitropack": "^2.9.7",
73
73
  "ofetch": "^1.3.4",
74
- "radash": "^12.1.0",
75
74
  "ufo": "^1.5.3",
76
75
  "uncrypto": "^0.1.3",
77
76
  "unstorage": "^1.10.2",
78
77
  "vue-router": "^4.4.0",
79
- "yn": "^5.0.0",
80
78
  "zod": "^3.23.8"
81
79
  },
82
80
  "devDependencies": {
83
- "@nuxt/eslint": "0.5.5",
81
+ "@nuxt/eslint": "0.5.6",
84
82
  "@nuxt/module-builder": "0.5.5",
85
83
  "@nuxt/schema": "3.12.4",
86
- "@nuxt/test-utils": "3.14.1",
84
+ "@nuxt/test-utils": "3.14.2",
87
85
  "@scayle/eslint-config-storefront": "4.3.0",
88
86
  "@scayle/eslint-plugin-vue-composable": "0.2.0",
89
- "@types/node": "20.16.3",
87
+ "@types/node": "20.16.5",
90
88
  "dprint": "0.47.2",
91
- "eslint": "9.9.1",
89
+ "eslint": "9.10.0",
92
90
  "eslint-formatter-gitlab": "5.1.0",
93
91
  "fishery": "2.2.2",
94
92
  "h3": "1.12.0",
95
- "node-mocks-http": "1.15.1",
93
+ "node-mocks-http": "1.16.0",
96
94
  "nuxi": "3.13.1",
97
95
  "nuxt": "3.12.4",
98
96
  "publint": "0.2.10",
99
97
  "vitest": "2.0.5",
100
- "vue-tsc": "2.1.4"
98
+ "vue-tsc": "2.1.6"
101
99
  },
102
100
  "peerDependencies": {
103
101
  "h3": "^1.10.0",