@scayle/storefront-nuxt 7.90.0 → 7.92.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,30 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.92.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add nitropack as a peer dependency
8
+
9
+ ### Patch Changes
10
+
11
+ - Removed dependency `nitropack@^2.9.7`
12
+ **Dependencies**
13
+
14
+ - Updated dependency to @scayle/storefront-core@7.66.3
15
+
16
+ ## 7.91.0
17
+
18
+ ### Minor Changes
19
+
20
+ - Remove `category` utils
21
+
22
+ ### Patch Changes
23
+
24
+ **Dependencies**
25
+
26
+ - Updated dependency to @scayle/storefront-core@7.66.2
27
+
3
28
  ## 7.90.0
4
29
 
5
30
  ### 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.92.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.92.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.92.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.3",
73
73
  "@scayle/unstorage-compression-driver": "^0.1.5",
74
74
  "@vueuse/core": "11.2.0",
75
75
  "consola": "^3.2.3",
@@ -78,7 +78,6 @@
78
78
  "hookable": "^5.5.3",
79
79
  "jose": "^5.2.0",
80
80
  "knitwork": "^1.1.0",
81
- "nitropack": "^2.9.7",
82
81
  "ofetch": "^1.3.4",
83
82
  "ufo": "^1.5.4",
84
83
  "uncrypto": "^0.1.3",
@@ -94,12 +93,13 @@
94
93
  "@nuxt/test-utils": "3.14.4",
95
94
  "@scayle/eslint-config-storefront": "4.3.2",
96
95
  "@scayle/eslint-plugin-vue-composable": "0.2.1",
97
- "@types/node": "22.8.7",
96
+ "@types/node": "22.9.0",
98
97
  "dprint": "0.47.5",
99
98
  "eslint": "9.14.0",
100
99
  "eslint-formatter-gitlab": "5.1.0",
101
100
  "fishery": "2.2.2",
102
101
  "h3": "1.13.0",
102
+ "nitropack": "2.9.7",
103
103
  "node-mocks-http": "1.16.1",
104
104
  "nuxi": "3.15.0",
105
105
  "nuxt": "3.13.2",
@@ -108,11 +108,12 @@
108
108
  "vue-tsc": "2.1.10"
109
109
  },
110
110
  "peerDependencies": {
111
+ "fishery": "^2.2.2",
111
112
  "h3": "^1.10.0",
113
+ "nitropack": "^2.9.7",
112
114
  "nuxt": ">=3.10.0",
113
115
  "unstorage": ">= 1.10.1",
114
- "vue": ">=3.4.0",
115
- "fishery": "^2.2.2"
116
+ "vue": ">=3.4.0"
116
117
  },
117
118
  "resolutions": {
118
119
  "h3": "1.13.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
- };