@scayle/storefront-nuxt 8.12.1 → 8.12.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/dist/module.d.mts CHANGED
@@ -58,4 +58,5 @@ declare module '@nuxt/schema' {
58
58
  */
59
59
  declare const _default: _nuxt_schema.NuxtModule<ModuleBaseOptions, ModuleBaseOptions, false>;
60
60
 
61
- export { ModuleBaseOptions, type ModuleHooks, _default as default };
61
+ export { ModuleBaseOptions, _default as default };
62
+ export type { ModuleHooks };
package/dist/module.d.ts CHANGED
@@ -58,4 +58,5 @@ declare module '@nuxt/schema' {
58
58
  */
59
59
  declare const _default: _nuxt_schema.NuxtModule<ModuleBaseOptions, ModuleBaseOptions, false>;
60
60
 
61
- export { ModuleBaseOptions, type ModuleHooks, _default as default };
61
+ export { ModuleBaseOptions, _default as default };
62
+ export type { ModuleHooks };
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.12.1",
3
+ "version": "8.12.3",
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.1";
56
+ const PACKAGE_VERSION = "8.12.3";
57
57
  const logger = createConsola({
58
58
  fancy: true,
59
59
  formatOptions: {
@@ -4,10 +4,6 @@ import { trace, SpanStatusCode } from "@opentelemetry/api";
4
4
  import { handler } from "../handler.js";
5
5
  import { resolveError } from "../error/handler.js";
6
6
  import { useNitroApp } from "nitropack/runtime";
7
- const tracer = trace.getTracer(
8
- "storefront-nuxt",
9
- "__sfc_version"
10
- );
11
7
  export default defineEventHandler(async (event) => {
12
8
  const $rpcContext = event.context.$rpcContext;
13
9
  if (!$rpcContext) {
@@ -15,6 +11,10 @@ export default defineEventHandler(async (event) => {
15
11
  status: HttpStatusCode.INTERNAL_SERVER_ERROR
16
12
  });
17
13
  }
14
+ const tracer = trace.getTracer(
15
+ "storefront-nuxt",
16
+ "__sfc_version"
17
+ );
18
18
  const pathComponents = event.path.split("?")[0].split("/");
19
19
  const method = pathComponents[pathComponents.length - 1];
20
20
  const body = await readBody(event);
@@ -26,10 +26,6 @@ const generateSessionId = (event) => {
26
26
  }
27
27
  return userId ? `${userId}:${randomUUID()}` : randomUUID();
28
28
  };
29
- const tracer = trace.getTracer(
30
- "storefront-nuxt",
31
- "__sfc_version"
32
- );
33
29
  async function getOldSessionData(event, cookieName, store, secret) {
34
30
  const rawCookie = getCookie(event, cookieName);
35
31
  const normalizedSecrets = Array.isArray(secret) ? secret : [secret];
@@ -143,6 +139,10 @@ export default defineEventHandler(async (event) => {
143
139
  const config = useRuntimeConfig(event);
144
140
  const url = getRequestURL(event);
145
141
  const { path, originalPath } = getBootstrapPath(url, config.app.baseURL);
142
+ const tracer = trace.getTracer(
143
+ "storefront-nuxt",
144
+ "__sfc_version"
145
+ );
146
146
  if (path.startsWith(joinURL(config.app.baseURL, "/__nuxt"))) {
147
147
  return;
148
148
  }
@@ -153,34 +153,34 @@ export default defineEventHandler(async (event) => {
153
153
  if (path === `${$storefrontConfig.apiBasePath ?? "/api"}/up`) {
154
154
  return;
155
155
  }
156
- await tracer.startActiveSpan(
157
- `storefront-nuxt.middleware/bootstrap`,
158
- {
159
- attributes: {
160
- path,
161
- originalPath
162
- }
163
- },
164
- async (span) => {
165
- try {
166
- const $shopConfig = getCurrentShopConfigForRequest(
167
- event,
168
- $storefrontConfig,
169
- config.app
170
- );
171
- if (!$shopConfig) {
172
- event.context.$log.debug(
173
- "Could not find shop config for this request",
174
- path
175
- );
176
- return;
156
+ const $shopConfig = getCurrentShopConfigForRequest(
157
+ event,
158
+ $storefrontConfig,
159
+ config.app
160
+ );
161
+ if (!$shopConfig) {
162
+ event.context.$log.debug(
163
+ "Could not find shop config for this request",
164
+ path
165
+ );
166
+ return;
167
+ }
168
+ const apiBasePath = getApiBasePath(
169
+ $storefrontConfig,
170
+ config.app.baseURL
171
+ );
172
+ if (!event.context.$rpcContext) {
173
+ event.context.$log.debug("Bootstrapping request: " + path);
174
+ await tracer.startActiveSpan(
175
+ `storefront-nuxt.middleware/bootstrap`,
176
+ {
177
+ attributes: {
178
+ path,
179
+ originalPath
177
180
  }
178
- const apiBasePath = getApiBasePath(
179
- $storefrontConfig,
180
- config.app.baseURL
181
- );
182
- if (!event.context.$rpcContext) {
183
- event.context.$log.debug("Bootstrapping request: " + path);
181
+ },
182
+ async (span) => {
183
+ try {
184
184
  await bootstrap(
185
185
  event,
186
186
  $shopConfig,
@@ -188,25 +188,28 @@ export default defineEventHandler(async (event) => {
188
188
  apiBasePath,
189
189
  config
190
190
  );
191
+ } catch (e) {
192
+ span.setStatus({ code: SpanStatusCode.ERROR });
193
+ if (e instanceof Error) {
194
+ event.context.$log.error(e);
195
+ span.recordException(e);
196
+ }
197
+ span.end();
198
+ throw e;
191
199
  }
192
- if ($storefrontConfig.redirects?.enabled && !path.startsWith(apiBasePath) && originalPath !== joinURL(config.app.baseURL, "/__nuxt_error")) {
193
- await tracer.startActiveSpan(
194
- `storefront-nuxt.middleware/redirects`,
195
- {},
196
- async (innerSpan) => {
197
- await useRedirects(event);
198
- innerSpan.end();
199
- }
200
- );
201
- }
202
- } catch (e) {
203
- console.error(e);
204
- span.setStatus({ code: SpanStatusCode.ERROR });
205
- if (e instanceof Error) {
206
- span.recordException(e);
207
- }
200
+ span.setStatus({ code: SpanStatusCode.OK });
201
+ span.end();
208
202
  }
209
- span.end();
210
- }
211
- );
203
+ );
204
+ }
205
+ if ($storefrontConfig.redirects?.enabled && !path.startsWith(apiBasePath) && originalPath !== joinURL(config.app.baseURL, "/__nuxt_error")) {
206
+ await tracer.startActiveSpan(
207
+ `storefront-nuxt.middleware/redirects`,
208
+ {},
209
+ async (innerSpan) => {
210
+ await useRedirects(event);
211
+ innerSpan.end();
212
+ }
213
+ );
214
+ }
212
215
  });
package/dist/types.d.mts CHANGED
@@ -1,9 +1,8 @@
1
1
  import type { NuxtModule } from '@nuxt/schema'
2
2
 
3
- import type { default as Module, ModuleHooks, ModulePublicRuntimeConfig } from './module.js'
3
+ import type { default as Module, ModulePublicRuntimeConfig } from './module.js'
4
4
 
5
5
  declare module '@nuxt/schema' {
6
- interface NuxtHooks extends ModuleHooks {}
7
6
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
8
7
  }
9
8
 
package/dist/types.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import type { NuxtModule } from '@nuxt/schema'
2
2
 
3
- import type { default as Module, ModuleHooks, ModulePublicRuntimeConfig } from './module'
3
+ import type { default as Module, ModulePublicRuntimeConfig } from './module'
4
4
 
5
5
  declare module '@nuxt/schema' {
6
- interface NuxtHooks extends ModuleHooks {}
7
6
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
8
7
  }
9
8
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.12.1",
4
+ "version": "8.12.3",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -55,6 +55,9 @@
55
55
  "types": "./dist/index.d.ts",
56
56
  "files": [
57
57
  "CHANGELOG.md",
58
+ "CHANGELOG-V7.md",
59
+ "LICENSE",
60
+ "README.md",
58
61
  "dist"
59
62
  ],
60
63
  "engines": {
@@ -78,7 +81,7 @@
78
81
  "dependencies": {
79
82
  "@opentelemetry/api": "^1.9.0",
80
83
  "@scayle/h3-session": "0.6.0",
81
- "@scayle/storefront-core": "8.14.1",
84
+ "@scayle/storefront-core": "8.14.2",
82
85
  "@scayle/unstorage-compression-driver": "^0.2.4",
83
86
  "@vercel/nft": "0.29.2",
84
87
  "@vueuse/core": "13.0.0",
@@ -97,7 +100,7 @@
97
100
  "schema-dts": "1.1.5"
98
101
  },
99
102
  "devDependencies": {
100
- "@eslint/eslintrc": "3.3.0",
103
+ "@eslint/eslintrc": "3.3.1",
101
104
  "@nuxt/eslint": "1.2.0",
102
105
  "@nuxt/kit": "3.15.4",
103
106
  "@nuxt/module-builder": "0.8.4",
@@ -106,15 +109,15 @@
106
109
  "@scayle/eslint-config-storefront": "4.4.1",
107
110
  "@scayle/eslint-plugin-vue-composable": "0.2.1",
108
111
  "@scayle/unstorage-scayle-kv-driver": "0.1.1",
109
- "@types/node": "22.13.10",
110
- "dprint": "0.49.0",
112
+ "@types/node": "22.13.13",
113
+ "dprint": "0.49.1",
111
114
  "eslint-formatter-gitlab": "5.1.0",
112
- "eslint": "9.22.0",
115
+ "eslint": "9.23.0",
113
116
  "fishery": "2.2.3",
114
117
  "h3": "1.15.0",
115
- "nitropack": "2.9.7",
118
+ "nitropack": "2.10.4",
116
119
  "node-mocks-http": "1.16.2",
117
- "nuxi": "3.23.0",
120
+ "nuxi": "3.23.1",
118
121
  "nuxt": "3.15.4",
119
122
  "publint": "0.2.12",
120
123
  "typescript": "5.8.2",