@scayle/storefront-nuxt 7.90.0 → 7.91.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,17 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.91.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Remove `category` utils
8
+
9
+ ### Patch Changes
10
+
11
+ **Dependencies**
12
+
13
+ - Updated dependency to @scayle/storefront-core@7.66.2
14
+
3
15
  ## 7.90.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.80aa5060.mjs';
2
2
  export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
3
3
  export { extendPromise } from '../dist/runtime/utils/promise.js';
4
- export * from '../dist/runtime/utils/category.js';
5
4
  export * from '../dist/runtime/utils/seo.js';
6
5
  export * from '@scayle/storefront-core';
7
6
  export { LogLevel } from '@scayle/storefront-core';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.80aa5060.js';
2
2
  export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
3
3
  export { extendPromise } from '../dist/runtime/utils/promise.js';
4
- export * from '../dist/runtime/utils/category.js';
5
4
  export * from '../dist/runtime/utils/seo.js';
6
5
  export * from '@scayle/storefront-core';
7
6
  export { LogLevel } from '@scayle/storefront-core';
package/dist/index.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
2
2
  export { extendPromise } from '../dist/runtime/utils/promise.js';
3
- export * from '../dist/runtime/utils/category.js';
4
3
  export * from '../dist/runtime/utils/seo.js';
5
4
  export * from '@scayle/storefront-core';
6
5
  export { unwrap } from '@scayle/storefront-core/dist/utils/response';
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "7.90.0",
3
+ "version": "7.91.0",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -48,7 +48,7 @@ export default {
48
48
  }`;
49
49
  }
50
50
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
51
- const PACKAGE_VERSION = "7.90.0";
51
+ const PACKAGE_VERSION = "7.91.0";
52
52
  const logger = createConsola({
53
53
  fancy: true,
54
54
  formatOptions: {
@@ -1,4 +1,4 @@
1
1
  import type { ConsolaInstance, ConsolaOptions } from 'consola';
2
2
  import type { LogLevel } from '../types/module.js';
3
- import { Log } from './log.js';
3
+ import { Log } from '@scayle/storefront-core';
4
4
  export default function createLog(createConsola: (options?: Partial<ConsolaOptions>) => ConsolaInstance, space: string | undefined, level: LogLevel): Log;
@@ -1,4 +1,4 @@
1
- import { Log } from "./log.js";
1
+ import { Log } from "@scayle/storefront-core";
2
2
  const levelMap = {
3
3
  error: 0,
4
4
  warn: 1,
@@ -1,8 +1,9 @@
1
+ import type { Log } from '@scayle/storefront-core';
1
2
  declare const _default: import("nuxt/app").Plugin<{
2
- log: import("../log").Log;
3
- coreLog: import("../log").Log;
3
+ log: Log;
4
+ coreLog: Log;
4
5
  }> & import("nuxt/app").ObjectPlugin<{
5
- log: import("../log").Log;
6
- coreLog: import("../log").Log;
6
+ log: Log;
7
+ coreLog: Log;
7
8
  }>;
8
9
  export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.90.0",
4
+ "version": "7.91.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -69,7 +69,7 @@
69
69
  "@nuxt/kit": "^3.12.2",
70
70
  "@opentelemetry/api": "^1.9.0",
71
71
  "@scayle/h3-session": "^0.4.1",
72
- "@scayle/storefront-core": "7.66.1",
72
+ "@scayle/storefront-core": "7.66.2",
73
73
  "@scayle/unstorage-compression-driver": "^0.1.5",
74
74
  "@vueuse/core": "11.2.0",
75
75
  "consola": "^3.2.3",
@@ -94,7 +94,7 @@
94
94
  "@nuxt/test-utils": "3.14.4",
95
95
  "@scayle/eslint-config-storefront": "4.3.2",
96
96
  "@scayle/eslint-plugin-vue-composable": "0.2.1",
97
- "@types/node": "22.8.7",
97
+ "@types/node": "22.9.0",
98
98
  "dprint": "0.47.5",
99
99
  "eslint": "9.14.0",
100
100
  "eslint-formatter-gitlab": "5.1.0",
@@ -1,38 +0,0 @@
1
- export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
2
- export interface LogEntry {
3
- level: LogLevel;
4
- space: string;
5
- message: string;
6
- data?: object | undefined;
7
- }
8
- export type LogHandler = (entry: LogEntry) => void;
9
- export interface LogOptions {
10
- handler?: LogHandler;
11
- space: string;
12
- }
13
- /**
14
- * This log provides a way to log messages to a custom log handler (in a serial manner).
15
- * If no handler is provided, it will log to the console.
16
- */
17
- export declare class Log {
18
- static default: Log;
19
- _handler?: LogHandler;
20
- _space: string;
21
- _type: string;
22
- constructor(options?: LogOptions);
23
- debug(message: string, data?: unknown): void;
24
- info(message: string, data?: unknown): void;
25
- warn(message: string, data?: unknown): void;
26
- error(message: string | Error, data?: unknown): void;
27
- write(level: LogLevel, message: string, data?: unknown): void;
28
- /**
29
- * Create a new sub-space.
30
- * All spaces are being separated by a dot. E.g. `global.api` and `global.api.getUser`
31
- * @param subSpace The name of the sub-space in camel-case (e.g. `api` and `api.getUser`)
32
- */
33
- space(subSpace: string): Log;
34
- /**
35
- * Measure the time of a function.
36
- */
37
- time<T>(message: string, func: () => T): Promise<T>;
38
- }
@@ -1,76 +0,0 @@
1
- function dataToObject(data) {
2
- if (data === null || data === void 0) {
3
- return void 0;
4
- }
5
- return typeof data !== "object" ? { data } : data;
6
- }
7
- export class Log {
8
- static default = new this({
9
- space: "global",
10
- handler: consoleLogHandler
11
- });
12
- _handler;
13
- _space;
14
- _type = "log";
15
- constructor(options) {
16
- this._handler = options?.handler || Log.default._handler;
17
- this._space = options?.space || Log.default._space;
18
- }
19
- debug(message, data) {
20
- this.write("debug", message, data);
21
- }
22
- info(message, data) {
23
- this.write("info", message, data);
24
- }
25
- warn(message, data) {
26
- this.write("warn", message, data);
27
- }
28
- error(message, data) {
29
- const error = message instanceof Error ? message : null;
30
- if (error) {
31
- data = {
32
- error: message,
33
- ...dataToObject(data)
34
- };
35
- }
36
- this.write("error", error?.message ?? message, data);
37
- }
38
- write(level, message, data) {
39
- const d = dataToObject(data);
40
- if (this._handler) {
41
- try {
42
- this._handler({ level, message, data: d, space: this._space });
43
- } catch (e) {
44
- console.error(`Error writing log message: "${message}" -- ${e}`);
45
- }
46
- } else {
47
- const logFunc = console[level] || console.log;
48
- logFunc.apply(console, data ? [message, data] : [message]);
49
- }
50
- }
51
- /**
52
- * Create a new sub-space.
53
- * All spaces are being separated by a dot. E.g. `global.api` and `global.api.getUser`
54
- * @param subSpace The name of the sub-space in camel-case (e.g. `api` and `api.getUser`)
55
- */
56
- space(subSpace) {
57
- return new Log({
58
- space: `${this._space}.${subSpace}`,
59
- handler: this._handler
60
- });
61
- }
62
- /**
63
- * Measure the time of a function.
64
- */
65
- async time(message, func) {
66
- const start = Date.now();
67
- const result = await func();
68
- const end = Date.now();
69
- this.debug(`${message} took ${end - start}ms`);
70
- return result;
71
- }
72
- }
73
- function consoleLogHandler({ level, message, data }) {
74
- const logFunc = console[level] || console.log;
75
- logFunc.apply(console, data ? [message, data] : [message]);
76
- }
@@ -1,4 +0,0 @@
1
- import type { Category } from '@scayle/storefront-core';
2
- export declare const getCategoryAncestors: (category: Category, categories?: Category[]) => Category[];
3
- export declare const isSaleCategory: (category: Category) => boolean;
4
- export declare const flattenCategoryTree: (categoryTree: Category[]) => Category[];
@@ -1,20 +0,0 @@
1
- export const getCategoryAncestors = (category, categories = []) => {
2
- if (!category?.parent) {
3
- return categories;
4
- }
5
- return getCategoryAncestors(category.parent, [category.parent, ...categories]);
6
- };
7
- export const isSaleCategory = (category) => {
8
- return category.properties.some(({ name }) => name === "sale");
9
- };
10
- export const flattenCategoryTree = (categoryTree) => {
11
- const flattenedCategoryTreeList = categoryTree.flatMap((categoryNode) => [
12
- categoryNode,
13
- ...categoryNode.children ? flattenCategoryTree(categoryNode.children) : []
14
- ]);
15
- return [
16
- ...new Map(
17
- flattenedCategoryTreeList.map((item) => [item.id, item])
18
- ).values()
19
- ];
20
- };