@scayle/storefront-nuxt 7.36.3 → 7.37.1

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,26 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.37.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @scayle/storefront-core@7.24.0
9
+
10
+ ## 7.37.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Add `runtimeConfiguration` property to the `RPCContext`
15
+ - Breaking: Remove re-exported `useEventListener` composable
16
+
17
+ Import the composable directly from @vueuse/core
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+ - @scayle/storefront-core@7.23.0
23
+
3
24
  ## 7.36.3
4
25
 
5
26
  ### Patch Changes
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.7.0"
6
6
  },
7
- "version": "7.36.2"
7
+ "version": "7.37.0"
8
8
  }
package/dist/module.mjs CHANGED
@@ -74,7 +74,6 @@ const module = defineNuxtModule({
74
74
  "@scayle/storefront-nuxt",
75
75
  "@scayle/storefront-core",
76
76
  "@aboutyou/backbone",
77
- "isomorphic-dompurify",
78
77
  "slugify"
79
78
  );
80
79
  });
@@ -101,6 +100,7 @@ const module = defineNuxtModule({
101
100
  const template = addTypeTemplate({
102
101
  filename: "types/storefront-bootstrap.d.ts",
103
102
  getContents: () => `// Auto-generated
103
+ import type { RuntimeConfig } from '@nuxt/schema'
104
104
  import type { RpcContext, Cache } from '@scayle/storefront-core'
105
105
  import type { PublicShopConfig } from '@scayle/storefront-nuxt';
106
106
  declare module 'h3' {
@@ -111,6 +111,9 @@ const module = defineNuxtModule({
111
111
  $availableShops: PublicShopConfig[]
112
112
  }
113
113
  }
114
+ declare module '@scayle/storefront-core' {
115
+ export interface RuntimeConfiguration extends RuntimeConfig {}
116
+ }
114
117
  export {}`
115
118
  });
116
119
  nuxt.hook("prepare:types", ({ references }) => {
@@ -8,8 +8,8 @@ import {
8
8
  } from "@scayle/storefront-core";
9
9
  import { useNuxtApp } from "nuxt/app";
10
10
  import { computed } from "vue";
11
+ import { useEventListener } from "@vueuse/core";
11
12
  import { rpcCall } from "../../rpc/rpcCall.mjs";
12
- import useEventListener from "../core/useEventListener.mjs";
13
13
  import { useRpc } from "../core/useRpc.mjs";
14
14
  import { useCurrentShop } from "../core/useCurrentShop.mjs";
15
15
  import { toValue } from "#imports";
@@ -1,5 +1,6 @@
1
1
  import { Log, RpcContext, Cache as CacheInterface } from '@scayle/storefront-core';
2
2
  import type { Session } from '@scayle/h3-session';
3
+ import type { RuntimeConfig } from '@nuxt/schema';
3
4
  import { ShopConfig, StorefrontConfig } from '../module';
4
5
  export interface ContextBuilderOptions {
5
6
  $cache: CacheInterface;
@@ -8,5 +9,6 @@ export interface ContextBuilderOptions {
8
9
  $log: Log;
9
10
  sessionId: string;
10
11
  session: Session;
12
+ config: RuntimeConfig;
11
13
  }
12
14
  export declare const buildContext: (context: ContextBuilderOptions) => Promise<RpcContext>;
@@ -7,7 +7,7 @@ import {
7
7
  generateWishlistKey
8
8
  } from "@scayle/storefront-core/dist/utils/keys";
9
9
  export const buildContext = async (context) => {
10
- const { $cache, $shopConfig, $storefront, $log, session } = context;
10
+ const { $cache, $shopConfig, $storefront, $log, session, config } = context;
11
11
  const bapiConfig = $shopConfig.bapi ?? $storefront.bapi;
12
12
  const appKeys = $shopConfig.appKeys ?? $storefront.appKeys;
13
13
  return {
@@ -93,6 +93,7 @@ export const buildContext = async (context) => {
93
93
  updateTokens: async (tokens) => {
94
94
  Object.assign(session.data, tokens);
95
95
  await session.save();
96
- }
96
+ },
97
+ runtimeConfiguration: config
97
98
  };
98
99
  };
@@ -83,7 +83,7 @@ async function handleOauth(event, storefrontConfig, log) {
83
83
  });
84
84
  await useOauth(event, JWKS);
85
85
  }
86
- async function bootstrap(event, log, url, $shopConfig, $storefrontConfig, apiBasePath) {
86
+ async function bootstrap(event, log, url, $shopConfig, $storefrontConfig, apiBasePath, config) {
87
87
  const bootstrapLog = log.space("bootstrap");
88
88
  bootstrapLog.debug("Bootstrapping request: ", url.toString());
89
89
  const redisConfig = $shopConfig.redis ?? $storefrontConfig.redis;
@@ -136,8 +136,8 @@ async function bootstrap(event, log, url, $shopConfig, $storefrontConfig, apiBas
136
136
  $storefrontConfig.publicShopData
137
137
  );
138
138
  event.context.$availableShops = convertStoresToList($storefrontConfig.stores).filter((store) => store.isEnabled !== false).map(
139
- (config) => getPublicShopData(
140
- config,
139
+ (config2) => getPublicShopData(
140
+ config2,
141
141
  $shopConfig.shopId,
142
142
  apiBasePath,
143
143
  $storefrontConfig.publicShopData
@@ -151,7 +151,8 @@ async function bootstrap(event, log, url, $shopConfig, $storefrontConfig, apiBas
151
151
  $storefront: $storefrontConfig,
152
152
  $log: log,
153
153
  sessionId: event.context.sessionId,
154
- session: event.context.session
154
+ session: event.context.session,
155
+ config
155
156
  });
156
157
  }
157
158
  export default defineEventHandler(async (event) => {
@@ -175,7 +176,8 @@ export default defineEventHandler(async (event) => {
175
176
  url,
176
177
  $shopConfig,
177
178
  $storefrontConfig,
178
- apiBasePath
179
+ apiBasePath,
180
+ config
179
181
  );
180
182
  }
181
183
  if ($storefrontConfig.redirects?.enabled && !url.pathname.startsWith(apiBasePath)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.36.3",
4
+ "version": "7.37.1",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "@nuxt/kit": "3.7.4",
64
64
  "@scayle/h3-session": "0.3.4",
65
- "@scayle/storefront-core": "7.22.1",
65
+ "@scayle/storefront-core": "7.24.0",
66
66
  "@vueuse/core": "10.5.0",
67
67
  "consola": "3.2.3",
68
68
  "core-js": "3.33.2",
@@ -82,7 +82,7 @@
82
82
  "@scayle/eslint-config-storefront": "3.2.5",
83
83
  "@scayle/prettier-config-storefront": "2.0.2",
84
84
  "@types/node": "20.8.10",
85
- "eslint": "8.52.0",
85
+ "eslint": "8.53.0",
86
86
  "eslint-formatter-gitlab": "5.0.0",
87
87
  "node-mocks-http": "1.13.0",
88
88
  "nuxt": "3.7.4",
@@ -1,2 +0,0 @@
1
- import { useEventListener } from '@vueuse/core';
2
- export default useEventListener;
@@ -1,2 +0,0 @@
1
- import { useEventListener } from "@vueuse/core";
2
- export default useEventListener;