@scayle/storefront-nuxt 8.62.5 → 8.62.7
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-V7.md +3 -3
- package/CHANGELOG.md +28 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +16 -14
- package/dist/runtime/api/rpcHandler.js +1 -1
- package/dist/runtime/nitro/plugins/configValidation.js +4 -2
- package/dist/runtime/nitro/plugins/nitroLogger.js +11 -11
- package/dist/runtime/server/middleware/bootstrap-utils.d.ts +0 -10
- package/dist/runtime/server/middleware/bootstrap-utils.js +1 -1
- package/dist/runtime/utils/promise.js +2 -2
- package/dist/test/factories.d.mts +2 -2
- package/package.json +15 -15
package/CHANGELOG-V7.md
CHANGED
|
@@ -1193,8 +1193,8 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
1193
1193
|
|
|
1194
1194
|
### Patch Changes
|
|
1195
1195
|
|
|
1196
|
-
- Updated to `vue@3.4.21` (
|
|
1197
|
-
- Updated to `nuxt@3.10.3` (
|
|
1196
|
+
- Updated to `vue@3.4.21` (For more details check the [Vue 3.4.21 Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md#3421-2024-02-28)
|
|
1197
|
+
- Updated to `nuxt@3.10.3` (For more details check the [Nuxt 3.10.3 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.10.3))
|
|
1198
1198
|
- Updated dependencies
|
|
1199
1199
|
- @scayle/storefront-core@7.44.1
|
|
1200
1200
|
|
|
@@ -1437,7 +1437,7 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
1437
1437
|
|
|
1438
1438
|
### Patch Changes
|
|
1439
1439
|
|
|
1440
|
-
- Update to `vue@3.4.10` (
|
|
1440
|
+
- Update to `vue@3.4.10` (For detailed changes see [Changelog for Vue](https://github.com/vuejs/core/blob/main/CHANGELOG.md))
|
|
1441
1441
|
|
|
1442
1442
|
## 7.50.0
|
|
1443
1443
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.62.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed fatal errors reaching the log as one record per line when `storefront.log.json` is enabled.
|
|
8
|
+
|
|
9
|
+
Nitro reports fatal and unhandled errors with a plain `console.error`, which bypassed the Storefront logger and its JSON reporter. The stack trace, cause and data were printed across dozens of lines, and a log pipeline that treats every line as a record turned one error into about 25 unstructured records. With `storefront.log.json` enabled, the Nitro logger plugin now routes all `console` output through the JSON reporter. A fatal error is written as one JSON line with the severity `error`, and the stack trace and cause are part of its `message`. Plain console output, like `console.log('text')`, is also wrapped in JSON, with the severity matching the console method.
|
|
10
|
+
|
|
11
|
+
The `statusCode` and `data` properties of an error are no longer printed, since the JSON reporter formats only the message, the stack trace and the cause. Without `storefront.log.json`, the console output is unchanged.
|
|
12
|
+
|
|
13
|
+
**Dependencies**
|
|
14
|
+
|
|
15
|
+
**@scayle/storefront-core v8.62.7**
|
|
16
|
+
|
|
17
|
+
- No changes in this release.
|
|
18
|
+
|
|
19
|
+
## 8.62.6
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependency `@vercel/nft@1.10.2` to `@vercel/nft@1.11.0`
|
|
24
|
+
|
|
25
|
+
**Dependencies**
|
|
26
|
+
|
|
27
|
+
**@scayle/storefront-core v8.62.6**
|
|
28
|
+
|
|
29
|
+
- No changes in this release.
|
|
30
|
+
|
|
3
31
|
## 8.62.5
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -31,7 +31,7 @@ function getUsedDrivers(options) {
|
|
|
31
31
|
Object.values(shops).forEach((shop) => {
|
|
32
32
|
addDriver(shop.storage);
|
|
33
33
|
});
|
|
34
|
-
return
|
|
34
|
+
return [...drivers];
|
|
35
35
|
}
|
|
36
36
|
function createVirtualDriverImport(usedDrivers) {
|
|
37
37
|
const usesCompression = !stringToBoolean(
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
}`;
|
|
58
58
|
}
|
|
59
59
|
const PACKAGE_NAME = "@scayle/storefront-nuxt";
|
|
60
|
-
const PACKAGE_VERSION = "8.62.
|
|
60
|
+
const PACKAGE_VERSION = "8.62.7";
|
|
61
61
|
const logger = createConsola({
|
|
62
62
|
fancy: true,
|
|
63
63
|
formatOptions: {
|
|
@@ -79,11 +79,10 @@ function createRpcMethodTypeDeclaration(customRpcImports) {
|
|
|
79
79
|
return `// Auto-generated
|
|
80
80
|
type RpcMethodsCustomType = {
|
|
81
81
|
${customRpcImports.reduce(
|
|
82
|
-
(lines, { source, names }) =>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
),
|
|
82
|
+
(lines, { source, names }) => [
|
|
83
|
+
...lines,
|
|
84
|
+
names.map((name) => `${name}: typeof import('${source}')['${name}'],`).join("\n")
|
|
85
|
+
],
|
|
87
86
|
[]
|
|
88
87
|
).join("\n")}
|
|
89
88
|
}
|
|
@@ -226,7 +225,10 @@ async function nitroSetup(nitroConfig, config, moduleOptions, nuxt) {
|
|
|
226
225
|
middleware: true,
|
|
227
226
|
handler: resolve("./runtime/server/middleware/bootstrap")
|
|
228
227
|
});
|
|
229
|
-
const allRpcNames =
|
|
228
|
+
const allRpcNames = [
|
|
229
|
+
...customRpcImports.flatMap(({ names }) => names),
|
|
230
|
+
...coreMethodNames
|
|
231
|
+
];
|
|
230
232
|
for (const methodName of allRpcNames) {
|
|
231
233
|
const httpMethod = rpcHttpMethodManifest[methodName] ?? DEFAULT_RPC_HTTP_METHOD;
|
|
232
234
|
nitroConfig.handlers.push({
|
|
@@ -295,7 +297,7 @@ async function nitroSetup(nitroConfig, config, moduleOptions, nuxt) {
|
|
|
295
297
|
[...handlerPaths, ...pluginPaths].map((p) => resolvePath2(p))
|
|
296
298
|
);
|
|
297
299
|
const trace = await nodeFileTrace(runtimeEntries, { base });
|
|
298
|
-
const tracedImports =
|
|
300
|
+
const tracedImports = Array.from(trace.fileList, (p) => resolve(p));
|
|
299
301
|
nitroConfig.externals = nitroConfig.externals ?? {};
|
|
300
302
|
nitroConfig.externals.inline = nitroConfig.externals.inline ?? [];
|
|
301
303
|
nitroConfig.externals.inline.push(...tracedImports);
|
|
@@ -330,7 +332,10 @@ In the future this will become an error where overrides need to be explicitly de
|
|
|
330
332
|
logger.warn(`
|
|
331
333
|
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.
|
|
332
334
|
|
|
333
|
-
Missing RPC Method Overrides: ${Array.from(
|
|
335
|
+
Missing RPC Method Overrides: ${Array.from(
|
|
336
|
+
overriddenRPCMethodNames,
|
|
337
|
+
(name) => `'${name}'`
|
|
338
|
+
).join(", ")}
|
|
334
339
|
`);
|
|
335
340
|
}
|
|
336
341
|
}
|
|
@@ -464,10 +469,7 @@ const module$1 = defineNuxtModule({
|
|
|
464
469
|
}
|
|
465
470
|
validateRpcMethodOverrides(
|
|
466
471
|
options.rpcMethodOverrides ?? [],
|
|
467
|
-
customRpcImports.
|
|
468
|
-
(acc, { names }) => acc.concat(names),
|
|
469
|
-
[]
|
|
470
|
-
),
|
|
472
|
+
customRpcImports.flatMap(({ names }) => names),
|
|
471
473
|
rpcMethodNames
|
|
472
474
|
);
|
|
473
475
|
rpcHttpMethodManifest = await buildRpcHttpMethodManifest(
|
|
@@ -25,7 +25,7 @@ export default defineEventHandler(async (event) => {
|
|
|
25
25
|
}
|
|
26
26
|
const tracer = trace.getTracer("storefront-nuxt", "__sfc_version");
|
|
27
27
|
const pathComponents = event.path.split("?")[0].split("/");
|
|
28
|
-
const method = pathComponents
|
|
28
|
+
const method = pathComponents.at(-1);
|
|
29
29
|
const httpMethod = rpcHttpMethods[method] ?? DEFAULT_RPC_HTTP_METHOD;
|
|
30
30
|
const isGetMethod = httpMethod === "GET";
|
|
31
31
|
let payload;
|
|
@@ -26,7 +26,7 @@ export const formatZodError = (issues, runtimeConfig) => {
|
|
|
26
26
|
errorMessages.push(...formatZodError(unionError, runtimeConfig));
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
const key = issue.path
|
|
29
|
+
const key = issue.path.at(-1);
|
|
30
30
|
let value = "";
|
|
31
31
|
if (sensitiveKeys.includes(key)) {
|
|
32
32
|
value = purifySensitiveValue(getValue(runtimeConfig, issue.path), true);
|
|
@@ -51,7 +51,9 @@ export default defineNitroPlugin(() => {
|
|
|
51
51
|
if (!success) {
|
|
52
52
|
const errorMessages = formatZodError(error.issues, runtimeConfig);
|
|
53
53
|
consola.error("[storefront-nuxt] configValidation:", errorMessages);
|
|
54
|
-
throw Error(
|
|
54
|
+
throw new Error(
|
|
55
|
+
"[storefront-nuxt] configValidation: Runtime config invalid"
|
|
56
|
+
);
|
|
55
57
|
}
|
|
56
58
|
consola.success("[storefront-nuxt] configValidation: Runtime config valid");
|
|
57
59
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createConsola } from "consola";
|
|
1
|
+
import { createConsola, LogLevels } from "consola";
|
|
2
2
|
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
4
|
import createLog from "../../createLog.js";
|
|
@@ -6,16 +6,16 @@ import { JSONReporter } from "../../JSONReporter.js";
|
|
|
6
6
|
export default defineNitroPlugin((nitroApp) => {
|
|
7
7
|
const config = useRuntimeConfig();
|
|
8
8
|
const logConfig = config.public.storefront.log;
|
|
9
|
-
const
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const createLogInstance = (opts) => createConsola({
|
|
10
|
+
...logConfig.json ? { reporters: [new JSONReporter()] } : void 0,
|
|
11
|
+
stderr: logConfig.output === "stdout" ? process.stdout : process.stderr,
|
|
12
|
+
stdout: logConfig.output === "stderr" ? process.stderr : process.stdout,
|
|
13
|
+
...opts
|
|
14
|
+
});
|
|
15
|
+
const log = createLog(createLogInstance, logConfig.name, logConfig.level);
|
|
16
|
+
if (logConfig.json) {
|
|
17
|
+
createLogInstance({ level: LogLevels.verbose }).wrapConsole();
|
|
18
|
+
}
|
|
19
19
|
log.info(`Logger instance created. Level: ${logConfig.level}`);
|
|
20
20
|
nitroApp.hooks.hook("request", (event) => {
|
|
21
21
|
event.context.$log = log;
|
|
@@ -22,16 +22,6 @@ interface BootstrapPath {
|
|
|
22
22
|
* @returns A `BootstrapPath` object containing the resolved path and original path.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getBootstrapPath(url: URL, baseUrl: string): BootstrapPath;
|
|
25
|
-
/**
|
|
26
|
-
* Gets the shop configuration based on the request path.
|
|
27
|
-
*
|
|
28
|
-
* @param event The H3 event object.
|
|
29
|
-
* @param shops An array of shop configurations.
|
|
30
|
-
* @param appBasePath The base path of the application.
|
|
31
|
-
*
|
|
32
|
-
* @returns The matching shop configuration, or undefined if not found.
|
|
33
|
-
*/
|
|
34
|
-
export declare const getShopByPath: (event: H3Event, shops: ShopConfig[], appBasePath: string) => ShopConfig | undefined;
|
|
35
25
|
/**
|
|
36
26
|
* Converts the shops configuration to a list.
|
|
37
27
|
* Handles cases where shops are provided as an array or an indexed object.
|
|
@@ -9,7 +9,7 @@ const getShopByDomain = (event, shops) => {
|
|
|
9
9
|
const host = getRequestHost(event, { xForwardedHost: true });
|
|
10
10
|
return shops.find((s) => s.domain === host);
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
const getShopByPath = (event, shops, appBasePath) => {
|
|
13
13
|
const url = getRequestURL(event);
|
|
14
14
|
const { path } = getBootstrapPath(url, appBasePath);
|
|
15
15
|
const localeIndex = appBasePath !== "/" ? 2 : 1;
|
|
@@ -2,11 +2,11 @@ export function extendPromise(promise, source) {
|
|
|
2
2
|
const newPromise = promise.then(
|
|
3
3
|
(result) => Object.assign(result, source)
|
|
4
4
|
);
|
|
5
|
-
const withoutPromise =
|
|
5
|
+
const withoutPromise = { ...promise };
|
|
6
6
|
for (const key of Object.getOwnPropertyNames(
|
|
7
7
|
Promise.prototype
|
|
8
8
|
)) {
|
|
9
9
|
delete withoutPromise[key];
|
|
10
10
|
}
|
|
11
|
-
return Object.assign(newPromise,
|
|
11
|
+
return Object.assign(newPromise, withoutPromise, source);
|
|
12
12
|
}
|
|
@@ -54,7 +54,7 @@ declare const rpcContextFactory: Factory<RpcContext, RpcContextFactoryParams, Rp
|
|
|
54
54
|
generateBasketKeyForUserId: (userId: string) => Promise<string>;
|
|
55
55
|
generateWishlistKeyForUserId: (userId: string) => Promise<string>;
|
|
56
56
|
routerBasePath?: string;
|
|
57
|
-
ip?: string
|
|
57
|
+
ip?: string;
|
|
58
58
|
originalIp?: string;
|
|
59
59
|
log: Log;
|
|
60
60
|
auth: {
|
|
@@ -93,7 +93,7 @@ declare const rpcContextFactory: Factory<RpcContext, RpcContextFactoryParams, Rp
|
|
|
93
93
|
generateBasketKeyForUserId: (userId: string) => Promise<string>;
|
|
94
94
|
generateWishlistKeyForUserId: (userId: string) => Promise<string>;
|
|
95
95
|
routerBasePath?: string;
|
|
96
|
-
ip?: string
|
|
96
|
+
ip?: string;
|
|
97
97
|
originalIp?: string;
|
|
98
98
|
log: Log;
|
|
99
99
|
auth: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.62.
|
|
4
|
+
"version": "8.62.7",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -78,9 +78,11 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@opentelemetry/api": "^1.9.1",
|
|
81
|
-
"@scayle/
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
81
|
+
"@scayle/h3-session": "0.7.2",
|
|
82
|
+
"@scayle/storefront-core": "8.62.7",
|
|
83
|
+
"@scayle/unstorage-compression-driver": "1.6.0",
|
|
84
|
+
"@vercel/nft": "1.11.0",
|
|
85
|
+
"@vueuse/core": "15.0.0",
|
|
84
86
|
"consola": "^3.4.2",
|
|
85
87
|
"core-js": "^3.49.0",
|
|
86
88
|
"defu": "^6.1.7",
|
|
@@ -95,9 +97,7 @@
|
|
|
95
97
|
"unstorage": "1.17.5",
|
|
96
98
|
"utility-types": "^3.11.0",
|
|
97
99
|
"vue-router": "4.6.4",
|
|
98
|
-
"zod": "^4.4.3"
|
|
99
|
-
"@scayle/h3-session": "0.7.2",
|
|
100
|
-
"@scayle/storefront-core": "8.62.5"
|
|
100
|
+
"zod": "^4.4.3"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@arethetypeswrong/cli": "0.18.5",
|
|
@@ -107,26 +107,26 @@
|
|
|
107
107
|
"@nuxt/module-builder": "1.0.3",
|
|
108
108
|
"@nuxt/schema": "^3.21.10",
|
|
109
109
|
"@nuxt/test-utils": "4.0.3",
|
|
110
|
-
"@scayle/eslint-config-storefront": "^
|
|
110
|
+
"@scayle/eslint-config-storefront": "^5.1.0",
|
|
111
111
|
"@scayle/eslint-plugin-vue-composable": "^1.1.0",
|
|
112
112
|
"@scayle/unstorage-scayle-kv-driver": "^3.0.0",
|
|
113
|
+
"@scayle/vitest-config-storefront": "1.0.0",
|
|
113
114
|
"@types/node": "^24",
|
|
114
|
-
"@vitest/coverage-v8": "
|
|
115
|
-
"eslint": "10.
|
|
115
|
+
"@vitest/coverage-v8": "5.0.3",
|
|
116
|
+
"eslint": "10.12.0",
|
|
116
117
|
"eslint-formatter-gitlab": "7.2.0",
|
|
117
118
|
"fishery": "2.4.0",
|
|
118
119
|
"h3": "1.15.11",
|
|
119
|
-
"happy-dom": "20.
|
|
120
|
+
"happy-dom": "20.14.5",
|
|
120
121
|
"nitro-test-utils": "0.11.2",
|
|
121
122
|
"nitropack": "2.13.4",
|
|
122
123
|
"node-mocks-http": "1.18.1",
|
|
123
124
|
"nuxt": "^3.21.10",
|
|
124
|
-
"publint": "0.3.
|
|
125
|
+
"publint": "0.3.25",
|
|
125
126
|
"typescript": "6.0.3",
|
|
126
127
|
"unbuild": "3.6.1",
|
|
127
|
-
"vitest": "
|
|
128
|
-
"vue-tsc": "3.3.
|
|
129
|
-
"@scayle/vitest-config-storefront": "1.0.0"
|
|
128
|
+
"vitest": "5.0.3",
|
|
129
|
+
"vue-tsc": "3.3.11"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"build": "nuxt-module-build build",
|