@scayle/storefront-nuxt 8.7.1 → 8.8.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,19 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 8.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [Rpc] Add check for the existence of the rpc directory, in order to prevent errors when trying import custom Rpc's.
8
+
9
+ ## 8.7.2
10
+
11
+ ### Patch Changes
12
+
13
+ **Dependencies**
14
+
15
+ - Updated dependency to @scayle/storefront-core@8.4.0
16
+
3
17
  ## 8.7.1
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { d as AdditionalShopConfig, A as AppKeys, h as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, i as ModulePublicRuntimeConfig, P as PublicShopConfig, c as SapiConfig, S as SessionConfig, e as ShopConfig, f as ShopConfigIndexed, b as StorageConfig, a as StorageEntity, g as StorefrontConfig } from './shared/storefront-nuxt.a816664e.mjs';
2
+ export { ModuleHooks } from './module.mjs';
2
3
  export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
3
4
  export { extendPromise } from '../dist/runtime/utils/promise.js';
4
5
  export * from '../dist/runtime/utils/seo.js';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { d as AdditionalShopConfig, A as AppKeys, h as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, i as ModulePublicRuntimeConfig, P as PublicShopConfig, c as SapiConfig, S as SessionConfig, e as ShopConfig, f as ShopConfigIndexed, b as StorageConfig, a as StorageEntity, g as StorefrontConfig } from './shared/storefront-nuxt.a816664e.js';
2
+ export { ModuleHooks } from './module.js';
2
3
  export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
3
4
  export { extendPromise } from '../dist/runtime/utils/promise.js';
4
5
  export * from '../dist/runtime/utils/seo.js';
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.7.1",
3
+ "version": "8.8.0",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { existsSync } from 'node:fs';
1
2
  import { defineNuxtModule, createResolver, extendViteConfig, addTypeTemplate, addPlugin, addImportsDir } from '@nuxt/kit';
2
3
  import { rpcMethods } from '@scayle/storefront-core';
3
4
  import { defu } from 'defu';
@@ -44,7 +45,7 @@ export default {
44
45
  }`;
45
46
  }
46
47
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
47
- const PACKAGE_VERSION = "8.7.1";
48
+ const PACKAGE_VERSION = "8.8.0";
48
49
  const logger = createConsola({
49
50
  fancy: true,
50
51
  formatOptions: {
@@ -179,9 +180,9 @@ function nitroSetup(nitroConfig, config) {
179
180
  }
180
181
  }
181
182
  function validateRpcMethodOverrides(rpcMethodOverrides, customRpcNames, coreRpcNames) {
182
- const overridenRPCMethodNames = new Set(rpcMethodOverrides);
183
+ const overriddenRPCMethodNames = new Set(rpcMethodOverrides);
183
184
  for (const rpcMethodName of customRpcNames) {
184
- if (coreRpcNames.has(rpcMethodName) && !overridenRPCMethodNames.has(rpcMethodName)) {
185
+ if (coreRpcNames.has(rpcMethodName) && !overriddenRPCMethodNames.has(rpcMethodName)) {
185
186
  logger.warn(`
186
187
  Overriding RPC method '${rpcMethodName}' from '@scayle/storefront-nuxt' with a local custom implementation.
187
188
 
@@ -191,14 +192,14 @@ To silence this warning, you can add '${rpcMethodName}' to 'rpcMethodOverrides'
191
192
  In the future this will become an error where overrides need to be explicitly defined as an override.
192
193
  `);
193
194
  } else {
194
- overridenRPCMethodNames.delete(rpcMethodName);
195
+ overriddenRPCMethodNames.delete(rpcMethodName);
195
196
  }
196
197
  }
197
- if (overridenRPCMethodNames.size > 0) {
198
+ if (overriddenRPCMethodNames.size > 0) {
198
199
  logger.warn(`
199
200
  Detected RPC methods which were supposed to be overridden but are not. This indicates an incorrect configuration and should be adjusted. Check the 'rpcMethodOverrides' property.
200
201
 
201
- Missing RPC Method Overrides: ${Array.from(overridenRPCMethodNames).map((name) => `'${name}'`).join(", ")}
202
+ Missing RPC Method Overrides: ${Array.from(overriddenRPCMethodNames).map((name) => `'${name}'`).join(", ")}
202
203
  `);
203
204
  }
204
205
  }
@@ -278,7 +279,7 @@ const module = defineNuxtModule({
278
279
  customImport.names.forEach((name) => {
279
280
  if (rpcMethodNames.has(name)) {
280
281
  throw new Error(
281
- `Core RPC method '${name}' cannot be overriden via the 'storefront:custom-rpc:extend' hook`
282
+ `Core RPC method '${name}' cannot be overridden via the 'storefront:custom-rpc:extend' hook`
282
283
  );
283
284
  }
284
285
  });
@@ -286,10 +287,13 @@ const module = defineNuxtModule({
286
287
  (name) => !storefrontRpcMethodNames.includes(name)
287
288
  );
288
289
  });
289
- customRpcImports.push({
290
- source: appResolve(options.rpcDir ?? "./rpcMethods"),
291
- names: storefrontRpcMethodNames
292
- });
290
+ const rpcDir = appResolve(options.rpcDir ?? "./rpcMethods");
291
+ if (existsSync(rpcDir)) {
292
+ customRpcImports.push({
293
+ source: rpcDir,
294
+ names: storefrontRpcMethodNames
295
+ });
296
+ }
293
297
  validateRpcMethodOverrides(
294
298
  options.rpcMethodOverrides ?? [],
295
299
  customRpcImports.reduce(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.7.1",
4
+ "version": "8.8.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -72,7 +72,7 @@
72
72
  "dependencies": {
73
73
  "@opentelemetry/api": "^1.9.0",
74
74
  "@scayle/h3-session": "0.6.0",
75
- "@scayle/storefront-core": "8.3.2",
75
+ "@scayle/storefront-core": "8.4.0",
76
76
  "@scayle/unstorage-compression-driver": "^0.2.3",
77
77
  "@vueuse/core": "12.5.0",
78
78
  "consola": "^3.2.3",
@@ -90,7 +90,7 @@
90
90
  "schema-dts": "1.1.2"
91
91
  },
92
92
  "devDependencies": {
93
- "@nuxt/eslint": "1.0.0",
93
+ "@nuxt/eslint": "1.0.1",
94
94
  "@nuxt/kit": "3.14.1592",
95
95
  "@nuxt/module-builder": "0.8.4",
96
96
  "@nuxt/schema": "3.14.1592",
@@ -99,10 +99,10 @@
99
99
  "@scayle/eslint-plugin-vue-composable": "0.2.1",
100
100
  "@types/node": "22.13.1",
101
101
  "dprint": "0.49.0",
102
- "eslint": "9.19.0",
102
+ "eslint": "9.20.0",
103
103
  "eslint-formatter-gitlab": "5.1.0",
104
104
  "fishery": "2.2.3",
105
- "h3": "1.14.0",
105
+ "h3": "1.15.0",
106
106
  "nitropack": "2.9.7",
107
107
  "node-mocks-http": "1.16.2",
108
108
  "nuxi": "3.21.1",
@@ -122,7 +122,7 @@
122
122
  "vue": ">=3.4.0"
123
123
  },
124
124
  "resolutions": {
125
- "h3": "1.14.0",
125
+ "h3": "1.15.0",
126
126
  "vue": "3.5.13",
127
127
  "@nuxt/kit": "3.14.1592",
128
128
  "@nuxt/schema": "3.14.1592"