@reliverse/relinka 1.3.5 → 1.3.6
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/bin/main.d.ts +22 -1
- package/bin/main.js +58 -1
- package/bin/relinka-impl/deprecated/components/levels/levels.d.ts +13 -0
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/modes/basic.d.ts +3 -3
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/modes/browser.d.ts +4 -4
- package/bin/relinka-impl/deprecated/components/modes/shared.d.ts +2 -0
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/mod.d.ts +3 -3
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/relinka.d.ts +18 -18
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/relinka.js +6 -6
- package/bin/relinka-impl/deprecated/components/relinka-deprecated/relinka.test.d.ts +1 -0
- package/bin/relinka-impl/deprecated/components/relinka-deprecated/relinka.test.js +57 -0
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/basic.d.ts +3 -3
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/browser.d.ts +1 -1
- package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/fancy.d.ts +2 -2
- package/bin/relinka-impl/impl-mod.d.ts +20 -0
- package/bin/relinka-impl/impl-mod.js +454 -0
- package/bin/{types.d.ts → relinka-types.d.ts} +51 -7
- package/package.json +8 -25
- package/bin/libs/core/core-impl/deprecated/components/levels/levels.d.ts +0 -26
- package/bin/libs/core/core-impl/deprecated/components/modes/shared.d.ts +0 -3
- package/bin/libs/core/core-main.d.ts +0 -23
- package/bin/libs/core/core-main.js +0 -49
- package/bin/libs/core/core-types.d.ts +0 -1
- package/bin/libs/core/core-types.js +0 -1
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/levels/levels.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/modes/basic.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/modes/browser.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/modes/shared.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/logger.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/logger.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/mod.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/basic.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/browser.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/fancy.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/box.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/box.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/deprecatedColors.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/deprecatedColors.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/error.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/error.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/format.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/format.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/log.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/log.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/stream.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/stream.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/string.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/string.js +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/tree.d.ts +0 -0
- /package/bin/{libs/core/core-impl → relinka-impl}/deprecated/utils/tree.js +0 -0
- /package/bin/{types.js → relinka-types.js} +0 -0
package/bin/main.d.ts
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { LogLevelsDeprecated, LogTypesDeprecated, } from "./relinka-impl/deprecated/components/levels/levels.js";
|
|
2
|
+
export { createRelinkaBaseDeprecated, relinkaBasicDeprecated, } from "./relinka-impl/deprecated/components/modes/basic.js";
|
|
3
|
+
export { createRelinkaBrowserDeprecatedDeprecated, relinkaBrowserDeprecated, } from "./relinka-impl/deprecated/components/modes/browser.js";
|
|
4
|
+
export { relinkaDeprecated } from "./relinka-impl/deprecated/components/relinka-deprecated/logger.js";
|
|
5
|
+
export { createRelinkaSharedDeprecated, relinkaInstanceDeprecated, } from "./relinka-impl/deprecated/components/relinka-deprecated/mod.js";
|
|
6
|
+
export type { LogFn, RelinkaInstanceDeprecated, } from "./relinka-impl/deprecated/components/relinka-deprecated/relinka.js";
|
|
7
|
+
export { RelinkaInterface, createRelinkaDeprecated, } from "./relinka-impl/deprecated/components/relinka-deprecated/relinka.js";
|
|
8
|
+
export { BasicReporter } from "./relinka-impl/deprecated/components/reporters/basic.js";
|
|
9
|
+
export { BrowserReporter } from "./relinka-impl/deprecated/components/reporters/browser.js";
|
|
10
|
+
export { TYPE_COLOR_MAP, LEVEL_COLOR_MAP, FancyReporter, } from "./relinka-impl/deprecated/components/reporters/fancy.js";
|
|
11
|
+
export type { BoxBorderStyle, BoxStyle, BoxOpts, } from "./relinka-impl/deprecated/utils/box.js";
|
|
12
|
+
export { box } from "./relinka-impl/deprecated/utils/box.js";
|
|
13
|
+
export type { ColorName, ColorFunction, } from "./relinka-impl/deprecated/utils/deprecatedColors.js";
|
|
14
|
+
export { colors, getColor, colorize, } from "./relinka-impl/deprecated/utils/deprecatedColors.js";
|
|
15
|
+
export { parseStack } from "./relinka-impl/deprecated/utils/error.js";
|
|
16
|
+
export { compileFormat, formatString, } from "./relinka-impl/deprecated/utils/format.js";
|
|
17
|
+
export { isPlainObject, isLogObj, } from "./relinka-impl/deprecated/utils/log.js";
|
|
18
|
+
export { writeStream } from "./relinka-impl/deprecated/utils/stream.js";
|
|
19
|
+
export { stripAnsi, centerAlign, rightAlign, leftAlign, align, } from "./relinka-impl/deprecated/utils/string.js";
|
|
20
|
+
export type { TreeItemObject, TreeItem, TreeOptions, } from "./relinka-impl/deprecated/utils/tree.js";
|
|
21
|
+
export { formatTree } from "./relinka-impl/deprecated/utils/tree.js";
|
|
22
|
+
export { configPromise, relinka, relinkaAsync, defineConfig, } from "./relinka-impl/impl-mod.js";
|
package/bin/main.js
CHANGED
|
@@ -1 +1,58 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {
|
|
2
|
+
LogLevelsDeprecated,
|
|
3
|
+
LogTypesDeprecated
|
|
4
|
+
} from "./relinka-impl/deprecated/components/levels/levels.js";
|
|
5
|
+
export {
|
|
6
|
+
createRelinkaBaseDeprecated,
|
|
7
|
+
relinkaBasicDeprecated
|
|
8
|
+
} from "./relinka-impl/deprecated/components/modes/basic.js";
|
|
9
|
+
export {
|
|
10
|
+
createRelinkaBrowserDeprecatedDeprecated,
|
|
11
|
+
relinkaBrowserDeprecated
|
|
12
|
+
} from "./relinka-impl/deprecated/components/modes/browser.js";
|
|
13
|
+
export { relinkaDeprecated } from "./relinka-impl/deprecated/components/relinka-deprecated/logger.js";
|
|
14
|
+
export {
|
|
15
|
+
createRelinkaSharedDeprecated,
|
|
16
|
+
relinkaInstanceDeprecated
|
|
17
|
+
} from "./relinka-impl/deprecated/components/relinka-deprecated/mod.js";
|
|
18
|
+
export {
|
|
19
|
+
RelinkaInterface,
|
|
20
|
+
createRelinkaDeprecated
|
|
21
|
+
} from "./relinka-impl/deprecated/components/relinka-deprecated/relinka.js";
|
|
22
|
+
export { BasicReporter } from "./relinka-impl/deprecated/components/reporters/basic.js";
|
|
23
|
+
export { BrowserReporter } from "./relinka-impl/deprecated/components/reporters/browser.js";
|
|
24
|
+
export {
|
|
25
|
+
TYPE_COLOR_MAP,
|
|
26
|
+
LEVEL_COLOR_MAP,
|
|
27
|
+
FancyReporter
|
|
28
|
+
} from "./relinka-impl/deprecated/components/reporters/fancy.js";
|
|
29
|
+
export { box } from "./relinka-impl/deprecated/utils/box.js";
|
|
30
|
+
export {
|
|
31
|
+
colors,
|
|
32
|
+
getColor,
|
|
33
|
+
colorize
|
|
34
|
+
} from "./relinka-impl/deprecated/utils/deprecatedColors.js";
|
|
35
|
+
export { parseStack } from "./relinka-impl/deprecated/utils/error.js";
|
|
36
|
+
export {
|
|
37
|
+
compileFormat,
|
|
38
|
+
formatString
|
|
39
|
+
} from "./relinka-impl/deprecated/utils/format.js";
|
|
40
|
+
export {
|
|
41
|
+
isPlainObject,
|
|
42
|
+
isLogObj
|
|
43
|
+
} from "./relinka-impl/deprecated/utils/log.js";
|
|
44
|
+
export { writeStream } from "./relinka-impl/deprecated/utils/stream.js";
|
|
45
|
+
export {
|
|
46
|
+
stripAnsi,
|
|
47
|
+
centerAlign,
|
|
48
|
+
rightAlign,
|
|
49
|
+
leftAlign,
|
|
50
|
+
align
|
|
51
|
+
} from "./relinka-impl/deprecated/utils/string.js";
|
|
52
|
+
export { formatTree } from "./relinka-impl/deprecated/utils/tree.js";
|
|
53
|
+
export {
|
|
54
|
+
configPromise,
|
|
55
|
+
relinka,
|
|
56
|
+
relinkaAsync,
|
|
57
|
+
defineConfig
|
|
58
|
+
} from "./relinka-impl/impl-mod.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LogObject, LogTypeDeprecated } from "../../../../relinka-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A mapping of `LogTypeDeprecated` to its corresponding numeric log level.
|
|
4
|
+
*
|
|
5
|
+
* @type {Record<LogTypeDeprecated, number>} LogLevelsDeprecated - key-value pairs of log types to their numeric levels. See {@link LogTypeDeprecated}.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LogLevelsDeprecated: Record<LogTypeDeprecated, number>;
|
|
8
|
+
/**
|
|
9
|
+
* Maps `LogTypeDeprecated` to a `Partial<LogObject>`, primarily defining the log level.
|
|
10
|
+
*
|
|
11
|
+
* @type {Record<LogTypeDeprecated, Partial<LogObject>>} LogTypesDeprecated - key-value pairs of log types to partial log objects, specifying log levels. See {@link LogTypeDeprecated} and {@link LogObject}.
|
|
12
|
+
*/
|
|
13
|
+
export declare const LogTypesDeprecated: Record<LogTypeDeprecated, Partial<LogObject>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { RelinkaInstanceDeprecated } from "../relinka-deprecated/relinka.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RelinkaOptionsDeprecated } from "../../../../relinka-types.js";
|
|
3
3
|
export * from "./shared.js";
|
|
4
4
|
/**
|
|
5
5
|
* Factory function to create a new Relinka instance
|
|
6
6
|
*
|
|
7
|
-
* @param {Partial<
|
|
7
|
+
* @param {Partial<RelinkaOptionsDeprecated & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link RelinkaOptionsDeprecated}.
|
|
8
8
|
* @returns {RelinkaInstanceDeprecated} A new Relinka instance configured with the given options.
|
|
9
9
|
*/
|
|
10
|
-
export declare function createRelinkaBaseDeprecated(options?: Partial<
|
|
10
|
+
export declare function createRelinkaBaseDeprecated(options?: Partial<RelinkaOptionsDeprecated & {
|
|
11
11
|
fancy: boolean;
|
|
12
12
|
}>): RelinkaInstanceDeprecated;
|
|
13
13
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RelinkaOptionsDeprecated } from "../../../../relinka-types.js";
|
|
2
2
|
import { type RelinkaInstanceDeprecated } from "../relinka-deprecated/relinka.js";
|
|
3
3
|
export * from "./shared.js";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a new Relinka instance configured specifically for browser environments.
|
|
6
6
|
* This function sets up default reporters and a prompt method tailored to the browser's dialogue APIs.
|
|
7
7
|
*
|
|
8
|
-
* @param {Partial<
|
|
9
|
-
* The options can override the default reporter and prompt behavior. See {@link
|
|
8
|
+
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Optional configuration options.
|
|
9
|
+
* The options can override the default reporter and prompt behavior. See {@link RelinkaOptionsDeprecated}.
|
|
10
10
|
* @returns {RelinkaInstanceDeprecated} A new Relinka instance optimized for use in browser environments.
|
|
11
11
|
*/
|
|
12
|
-
export declare function createRelinkaBrowserDeprecatedDeprecated(options?: Partial<
|
|
12
|
+
export declare function createRelinkaBrowserDeprecatedDeprecated(options?: Partial<RelinkaOptionsDeprecated>): any;
|
|
13
13
|
/**
|
|
14
14
|
* A standard Relinka instance created with browser-specific configurations.
|
|
15
15
|
* This instance can be used throughout a browser-based project.
|
package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/mod.d.ts
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RelinkaOptionsDeprecated } from "../../../../relinka-types.js";
|
|
2
2
|
import type { RelinkaInstanceDeprecated } from "./relinka.js";
|
|
3
3
|
export * from "../modes/shared.js";
|
|
4
4
|
/**
|
|
5
5
|
* Factory function to create a new Relinka instance tailored for use in different environments.
|
|
6
6
|
* It automatically adjusts logging levels based on environment variables and execution context.
|
|
7
7
|
*
|
|
8
|
-
* @param {Partial<
|
|
8
|
+
* @param {Partial<RelinkaOptionsDeprecated & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link RelinkaOptionsDeprecated}.
|
|
9
9
|
* @returns {RelinkaInstanceDeprecated} A new Relinka instance with configurations based on the given options and the execution environment.
|
|
10
10
|
*/
|
|
11
|
-
export declare function createRelinkaSharedDeprecated(options?: Partial<
|
|
11
|
+
export declare function createRelinkaSharedDeprecated(options?: Partial<RelinkaOptionsDeprecated & {
|
|
12
12
|
fancy: boolean;
|
|
13
13
|
}>): RelinkaInstanceDeprecated;
|
|
14
14
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type { LogTypeDeprecated } from "
|
|
3
|
-
import type { InputLogObject, LogObject,
|
|
2
|
+
import type { LogTypeDeprecated } from "../../../../relinka-types.js";
|
|
3
|
+
import type { InputLogObject, LogObject, RelinkaOptionsDeprecated, RelinkaReporterDeprecated } from "../../../../relinka-types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Relinka class for logging management with support for pause/resume, mocking and customizable reporting.
|
|
6
6
|
* Provides flexible logging capabilities including level-based logging, custom reporters and integration options.
|
|
@@ -8,7 +8,7 @@ import type { InputLogObject, LogObject, RelinkaOptions, RelinkaReporter } from
|
|
|
8
8
|
* @class Relinka
|
|
9
9
|
*/
|
|
10
10
|
export declare class RelinkaInterface {
|
|
11
|
-
options:
|
|
11
|
+
options: RelinkaOptionsDeprecated;
|
|
12
12
|
_lastLog: {
|
|
13
13
|
serialized?: string;
|
|
14
14
|
object?: LogObject;
|
|
@@ -18,13 +18,13 @@ export declare class RelinkaInterface {
|
|
|
18
18
|
};
|
|
19
19
|
_paused: boolean;
|
|
20
20
|
_queue: any[];
|
|
21
|
-
_mockFn?:
|
|
21
|
+
_mockFn?: RelinkaOptionsDeprecated["mockFn"];
|
|
22
22
|
/**
|
|
23
23
|
* Creates an instance of Relinka with specified options or defaults.
|
|
24
24
|
*
|
|
25
|
-
* @param {Partial<
|
|
25
|
+
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Configuration options for the Relinka instance.
|
|
26
26
|
*/
|
|
27
|
-
constructor(options?: Partial<
|
|
27
|
+
constructor(options?: Partial<RelinkaOptionsDeprecated>);
|
|
28
28
|
/**
|
|
29
29
|
* Gets the current log level of the Relinka instance.
|
|
30
30
|
*
|
|
@@ -40,10 +40,10 @@ export declare class RelinkaInterface {
|
|
|
40
40
|
/**
|
|
41
41
|
* Creates a new instance of Relinka, inheriting options from the current instance, with possible overrides.
|
|
42
42
|
*
|
|
43
|
-
* @param {Partial<
|
|
43
|
+
* @param {Partial<RelinkaOptionsDeprecated>} options - Optional overrides for the new instance. See {@link RelinkaOptionsDeprecated}.
|
|
44
44
|
* @returns {RelinkaInstanceDeprecated} A new Relinka instance. See {@link RelinkaInstanceDeprecated}.
|
|
45
45
|
*/
|
|
46
|
-
create(options: Partial<
|
|
46
|
+
create(options: Partial<RelinkaOptionsDeprecated>): RelinkaInstanceDeprecated;
|
|
47
47
|
/**
|
|
48
48
|
* Creates a new Relinka instance with the specified default log object properties.
|
|
49
49
|
*
|
|
@@ -62,25 +62,25 @@ export declare class RelinkaInterface {
|
|
|
62
62
|
* Adds a custom reporter to the Relinka instance.
|
|
63
63
|
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
64
64
|
*
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {RelinkaReporterDeprecated} reporter - The reporter to add. See {@link RelinkaReporterDeprecated}.
|
|
66
66
|
* @returns {Relinka} The current Relinka instance.
|
|
67
67
|
*/
|
|
68
|
-
addReporter(reporter:
|
|
68
|
+
addReporter(reporter: RelinkaReporterDeprecated): this;
|
|
69
69
|
/**
|
|
70
70
|
* Removes a custom reporter from the Relinka instance.
|
|
71
71
|
* If no reporter is specified, all reporters will be removed.
|
|
72
72
|
*
|
|
73
|
-
* @param {
|
|
73
|
+
* @param {RelinkaReporterDeprecated} reporter - The reporter to remove. See {@link RelinkaReporterDeprecated}.
|
|
74
74
|
* @returns {Relinka} The current Relinka instance.
|
|
75
75
|
*/
|
|
76
|
-
removeReporter(reporter:
|
|
76
|
+
removeReporter(reporter: RelinkaReporterDeprecated): any;
|
|
77
77
|
/**
|
|
78
78
|
* Replaces all reporters of the Relinka instance with the specified array of reporters.
|
|
79
79
|
*
|
|
80
|
-
* @param {
|
|
80
|
+
* @param {RelinkaReporterDeprecated[]} reporters - The new reporters to set. See {@link RelinkaReporterDeprecated}.
|
|
81
81
|
* @returns {Relinka} The current Relinka instance.
|
|
82
82
|
*/
|
|
83
|
-
setReporters(reporters:
|
|
83
|
+
setReporters(reporters: RelinkaReporterDeprecated[]): this;
|
|
84
84
|
wrapAll(): void;
|
|
85
85
|
restoreAll(): void;
|
|
86
86
|
/**
|
|
@@ -120,9 +120,9 @@ export declare class RelinkaInterface {
|
|
|
120
120
|
/**
|
|
121
121
|
* Replaces logging methods with mocks if a mock function is provided.
|
|
122
122
|
*
|
|
123
|
-
* @param {
|
|
123
|
+
* @param {RelinkaOptionsDeprecated["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link RelinkaOptionsDeprecated["mockFn"]}.
|
|
124
124
|
*/
|
|
125
|
-
mockTypes(mockFn?:
|
|
125
|
+
mockTypes(mockFn?: RelinkaOptionsDeprecated["mockFn"]): void;
|
|
126
126
|
_wrapLogFn(defaults: InputLogObject, isRaw?: boolean): (...args: any[]) => boolean;
|
|
127
127
|
_logFn(defaults: InputLogObject, args: any[], isRaw?: boolean): boolean;
|
|
128
128
|
_log(logObj: LogObject): void;
|
|
@@ -135,7 +135,7 @@ export type RelinkaInstanceDeprecated = RelinkaInterface & Record<LogTypeDepreca
|
|
|
135
135
|
/**
|
|
136
136
|
* Utility for creating a new Relinka instance with optional configuration.
|
|
137
137
|
*
|
|
138
|
-
* @param {Partial<
|
|
138
|
+
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Optional configuration options for the new Relinka instance. See {@link RelinkaOptionsDeprecated}.
|
|
139
139
|
* @returns {RelinkaInstanceDeprecated} A new instance of RelinkaInterface. See {@link RelinkaInstanceDeprecated}.
|
|
140
140
|
*/
|
|
141
|
-
export declare function createRelinkaDeprecated(options?: Partial<
|
|
141
|
+
export declare function createRelinkaDeprecated(options?: Partial<RelinkaOptionsDeprecated>): RelinkaInstanceDeprecated;
|
package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/relinka.js
RENAMED
|
@@ -11,7 +11,7 @@ export class RelinkaInterface {
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates an instance of Relinka with specified options or defaults.
|
|
13
13
|
*
|
|
14
|
-
* @param {Partial<
|
|
14
|
+
* @param {Partial<RelinkaOptionsDeprecated>} [options={}] - Configuration options for the Relinka instance.
|
|
15
15
|
*/
|
|
16
16
|
constructor(options = {}) {
|
|
17
17
|
const types = options.types || LogTypesDeprecated;
|
|
@@ -72,7 +72,7 @@ export class RelinkaInterface {
|
|
|
72
72
|
/**
|
|
73
73
|
* Creates a new instance of Relinka, inheriting options from the current instance, with possible overrides.
|
|
74
74
|
*
|
|
75
|
-
* @param {Partial<
|
|
75
|
+
* @param {Partial<RelinkaOptionsDeprecated>} options - Optional overrides for the new instance. See {@link RelinkaOptionsDeprecated}.
|
|
76
76
|
* @returns {RelinkaInstanceDeprecated} A new Relinka instance. See {@link RelinkaInstanceDeprecated}.
|
|
77
77
|
*/
|
|
78
78
|
create(options) {
|
|
@@ -115,7 +115,7 @@ export class RelinkaInterface {
|
|
|
115
115
|
* Adds a custom reporter to the Relinka instance.
|
|
116
116
|
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
117
117
|
*
|
|
118
|
-
* @param {
|
|
118
|
+
* @param {RelinkaReporterDeprecated} reporter - The reporter to add. See {@link RelinkaReporterDeprecated}.
|
|
119
119
|
* @returns {Relinka} The current Relinka instance.
|
|
120
120
|
*/
|
|
121
121
|
addReporter(reporter) {
|
|
@@ -126,7 +126,7 @@ export class RelinkaInterface {
|
|
|
126
126
|
* Removes a custom reporter from the Relinka instance.
|
|
127
127
|
* If no reporter is specified, all reporters will be removed.
|
|
128
128
|
*
|
|
129
|
-
* @param {
|
|
129
|
+
* @param {RelinkaReporterDeprecated} reporter - The reporter to remove. See {@link RelinkaReporterDeprecated}.
|
|
130
130
|
* @returns {Relinka} The current Relinka instance.
|
|
131
131
|
*/
|
|
132
132
|
removeReporter(reporter) {
|
|
@@ -143,7 +143,7 @@ export class RelinkaInterface {
|
|
|
143
143
|
/**
|
|
144
144
|
* Replaces all reporters of the Relinka instance with the specified array of reporters.
|
|
145
145
|
*
|
|
146
|
-
* @param {
|
|
146
|
+
* @param {RelinkaReporterDeprecated[]} reporters - The new reporters to set. See {@link RelinkaReporterDeprecated}.
|
|
147
147
|
* @returns {Relinka} The current Relinka instance.
|
|
148
148
|
*/
|
|
149
149
|
setReporters(reporters) {
|
|
@@ -250,7 +250,7 @@ export class RelinkaInterface {
|
|
|
250
250
|
/**
|
|
251
251
|
* Replaces logging methods with mocks if a mock function is provided.
|
|
252
252
|
*
|
|
253
|
-
* @param {
|
|
253
|
+
* @param {RelinkaOptionsDeprecated["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link RelinkaOptionsDeprecated["mockFn"]}.
|
|
254
254
|
*/
|
|
255
255
|
mockTypes(mockFn) {
|
|
256
256
|
const _mockFn = mockFn || this.options.mockFn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, test, expect } from "vitest";
|
|
2
|
+
import { createRelinkaDeprecated } from "./relinka.js";
|
|
3
|
+
import {
|
|
4
|
+
LogLevelsDeprecated
|
|
5
|
+
} from "./mod.js";
|
|
6
|
+
describe("relinka", () => {
|
|
7
|
+
test("can set level", () => {
|
|
8
|
+
const relinka = createRelinkaDeprecated();
|
|
9
|
+
expect(relinka.level).toBe(1);
|
|
10
|
+
for (let i = 0; i <= 5; i++) {
|
|
11
|
+
relinka.level = i;
|
|
12
|
+
expect(relinka.level).toBe(i);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
test("silent log level does't print logs", async () => {
|
|
16
|
+
const logs = [];
|
|
17
|
+
const TestReporter = {
|
|
18
|
+
log(logObj) {
|
|
19
|
+
logs.push(logObj);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const relinka = createRelinkaDeprecated({
|
|
23
|
+
throttle: 100,
|
|
24
|
+
level: LogLevelsDeprecated.silent,
|
|
25
|
+
reporters: [TestReporter]
|
|
26
|
+
});
|
|
27
|
+
for (let i = 0; i < 10; i++) {
|
|
28
|
+
relinka.log("SPAM");
|
|
29
|
+
}
|
|
30
|
+
await wait(200);
|
|
31
|
+
expect(logs.length).toBe(0);
|
|
32
|
+
});
|
|
33
|
+
test("can see spams without ending log", async () => {
|
|
34
|
+
const logs = [];
|
|
35
|
+
const TestReporter = {
|
|
36
|
+
log(logObj) {
|
|
37
|
+
logs.push(logObj);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const relinka = createRelinkaDeprecated({
|
|
41
|
+
throttle: 100,
|
|
42
|
+
level: LogLevelsDeprecated.info,
|
|
43
|
+
reporters: [TestReporter]
|
|
44
|
+
});
|
|
45
|
+
for (let i = 0; i < 10; i++) {
|
|
46
|
+
relinka.log("SPAM");
|
|
47
|
+
}
|
|
48
|
+
await wait(300);
|
|
49
|
+
expect(logs.length).toBe(7);
|
|
50
|
+
expect(logs.at(-1).args).toEqual(["SPAM", "(repeated 4 times)"]);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
function wait(delay) {
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
setTimeout(resolve, delay);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { LogObject,
|
|
2
|
-
export declare class BasicReporter implements
|
|
1
|
+
import type { LogObject, RelinkaReporterDeprecated, FormatOptions, RelinkaOptionsDeprecated } from "../../../../relinka-types.js";
|
|
2
|
+
export declare class BasicReporter implements RelinkaReporterDeprecated {
|
|
3
3
|
formatStack(stack: string): string;
|
|
4
4
|
formatArgs(args: any[], opts: FormatOptions): string;
|
|
5
5
|
formatDate(date: Date, opts: FormatOptions): string;
|
|
6
6
|
filterAndJoin(arr: any[]): string;
|
|
7
7
|
formatLogObj(logObj: LogObject, opts: FormatOptions): string;
|
|
8
8
|
log(logObj: LogObject, ctx: {
|
|
9
|
-
options:
|
|
9
|
+
options: RelinkaOptionsDeprecated;
|
|
10
10
|
}): any;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LogLevelDeprecated, LogTypeDeprecated } from "
|
|
2
|
-
import type { FormatOptions, LogObject } from "../../../../
|
|
1
|
+
import type { LogLevelDeprecated, LogTypeDeprecated } from "../../../../relinka-types.js";
|
|
2
|
+
import type { FormatOptions, LogObject } from "../../../../relinka-types.js";
|
|
3
3
|
import { BasicReporter } from "./basic.js";
|
|
4
4
|
export declare const TYPE_COLOR_MAP: Partial<Record<LogTypeDeprecated, string>>;
|
|
5
5
|
export declare const LEVEL_COLOR_MAP: Partial<Record<LogLevelDeprecated, string>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promise that resolves when the Relinka config has been loaded and merged
|
|
3
|
+
* from defaults, environment variables, and optionally config files.
|
|
4
|
+
*/
|
|
5
|
+
export declare const configPromise: Promise<RelinkaConfig>;
|
|
6
|
+
/**
|
|
7
|
+
* Logs a message synchronously using the current config.
|
|
8
|
+
* Skips debug-level logs unless `debug` is set to true in the config.
|
|
9
|
+
*/
|
|
10
|
+
export declare const relinka: (type: LogLevel, message: string, ...args: unknown[]) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Logs a message asynchronously, waiting for the config to be fully loaded.
|
|
13
|
+
* Also handles file writing and log cleanup if enabled in the config.
|
|
14
|
+
*/
|
|
15
|
+
export declare const relinkaAsync: (type: LogLevel, message: string, ...args: unknown[]) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Type helper for defining configuration in `relinka.config.ts` (or similar).
|
|
18
|
+
* Provides autocompletion and type checking for the configuration object.
|
|
19
|
+
*/
|
|
20
|
+
export declare const defineConfig: (config: RelinkaConfig) => RelinkaConfig;
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import { re } from "@reliverse/relico";
|
|
2
|
+
import { loadConfig } from "c12";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import { createJiti } from "jiti";
|
|
5
|
+
import path from "pathe";
|
|
6
|
+
const DEFAULT_RELINKA_CONFIG = {
|
|
7
|
+
debug: false,
|
|
8
|
+
dirs: {
|
|
9
|
+
dailyLogs: false,
|
|
10
|
+
logDir: ".reliverse",
|
|
11
|
+
maxLogFiles: 0,
|
|
12
|
+
specialDirs: {
|
|
13
|
+
distDirNames: ["dist", "dist-jsr", "dist-npm", "dist-libs"],
|
|
14
|
+
useParentConfigInDist: true
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
disableColors: false,
|
|
18
|
+
logFilePath: "relinka.log",
|
|
19
|
+
saveLogsToFile: false,
|
|
20
|
+
withTimestamp: false
|
|
21
|
+
};
|
|
22
|
+
const SUPPORTED_EXTENSIONS = [".ts", ".js", ".mjs", ".cjs", ".json"];
|
|
23
|
+
function isDebugEnabled(config) {
|
|
24
|
+
return config?.debug ?? DEFAULT_RELINKA_CONFIG.debug;
|
|
25
|
+
}
|
|
26
|
+
function isColorEnabled(config) {
|
|
27
|
+
return !(config?.disableColors ?? DEFAULT_RELINKA_CONFIG.disableColors);
|
|
28
|
+
}
|
|
29
|
+
function getLogDir(config) {
|
|
30
|
+
return config?.dirs?.logDir ?? DEFAULT_RELINKA_CONFIG.dirs.logDir;
|
|
31
|
+
}
|
|
32
|
+
function isDailyLogsEnabled(config) {
|
|
33
|
+
return config?.dirs?.dailyLogs ?? DEFAULT_RELINKA_CONFIG.dirs.dailyLogs;
|
|
34
|
+
}
|
|
35
|
+
function shouldSaveLogs(config) {
|
|
36
|
+
return config?.saveLogsToFile ?? DEFAULT_RELINKA_CONFIG.saveLogsToFile;
|
|
37
|
+
}
|
|
38
|
+
function getMaxLogFiles(config) {
|
|
39
|
+
return config?.dirs?.maxLogFiles ?? DEFAULT_RELINKA_CONFIG.dirs.maxLogFiles;
|
|
40
|
+
}
|
|
41
|
+
function getBaseLogName(config) {
|
|
42
|
+
return config?.logFilePath ?? DEFAULT_RELINKA_CONFIG.logFilePath;
|
|
43
|
+
}
|
|
44
|
+
const getEnvBoolean = (envVarName) => {
|
|
45
|
+
const value = process.env[envVarName];
|
|
46
|
+
if (value === void 0 || value === "") return void 0;
|
|
47
|
+
const lowerValue = value.toLowerCase().trim();
|
|
48
|
+
return !["0", "false"].includes(lowerValue);
|
|
49
|
+
};
|
|
50
|
+
const getEnvString = (envVarName) => {
|
|
51
|
+
return process.env[envVarName] || void 0;
|
|
52
|
+
};
|
|
53
|
+
const getEnvNumber = (envVarName) => {
|
|
54
|
+
const value = process.env[envVarName];
|
|
55
|
+
if (value === void 0) return void 0;
|
|
56
|
+
const parsed = Number.parseInt(value, 10);
|
|
57
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
58
|
+
};
|
|
59
|
+
const getEnvOverrides = () => {
|
|
60
|
+
const overrides = {};
|
|
61
|
+
const dirsOverride = {};
|
|
62
|
+
const specialDirsOverride = {};
|
|
63
|
+
const debug = getEnvBoolean("RELINKA_DEBUG");
|
|
64
|
+
if (debug !== void 0) overrides.debug = debug;
|
|
65
|
+
const withTimestamp = getEnvBoolean("RELINKA_TIMESTAMP");
|
|
66
|
+
if (withTimestamp !== void 0) overrides.withTimestamp = withTimestamp;
|
|
67
|
+
const disableColors = getEnvBoolean("RELINKA_DISABLE_COLORS");
|
|
68
|
+
if (disableColors !== void 0) overrides.disableColors = disableColors;
|
|
69
|
+
const saveLogsToFile = getEnvBoolean("RELINKA_SAVE_LOGS");
|
|
70
|
+
if (saveLogsToFile !== void 0) overrides.saveLogsToFile = saveLogsToFile;
|
|
71
|
+
const logFilePath = getEnvString("RELINKA_LOG_FILE");
|
|
72
|
+
if (logFilePath !== void 0) overrides.logFilePath = logFilePath;
|
|
73
|
+
const logDir = getEnvString("RELINKA_LOG_DIR");
|
|
74
|
+
if (logDir !== void 0) dirsOverride.logDir = logDir;
|
|
75
|
+
const dailyLogs = getEnvBoolean("RELINKA_DAILY_LOGS");
|
|
76
|
+
if (dailyLogs !== void 0) dirsOverride.dailyLogs = dailyLogs;
|
|
77
|
+
const maxLogFiles = getEnvNumber("RELINKA_MAX_LOG_FILES");
|
|
78
|
+
if (maxLogFiles !== void 0) dirsOverride.maxLogFiles = maxLogFiles;
|
|
79
|
+
const useParentConfig = getEnvBoolean("RELINKA_USE_PARENT_CONFIG");
|
|
80
|
+
if (useParentConfig !== void 0) {
|
|
81
|
+
specialDirsOverride.useParentConfigInDist = useParentConfig;
|
|
82
|
+
}
|
|
83
|
+
if (Object.keys(specialDirsOverride).length > 0) {
|
|
84
|
+
dirsOverride.specialDirs = specialDirsOverride;
|
|
85
|
+
}
|
|
86
|
+
if (Object.keys(dirsOverride).length > 0) {
|
|
87
|
+
overrides.dirs = dirsOverride;
|
|
88
|
+
}
|
|
89
|
+
return overrides;
|
|
90
|
+
};
|
|
91
|
+
let currentConfig = { ...DEFAULT_RELINKA_CONFIG };
|
|
92
|
+
let isConfigInitialized = false;
|
|
93
|
+
let resolveConfigPromise;
|
|
94
|
+
export const configPromise = new Promise((resolve) => {
|
|
95
|
+
resolveConfigPromise = resolve;
|
|
96
|
+
});
|
|
97
|
+
const findConfigFile = (basePath) => {
|
|
98
|
+
for (const ext of SUPPORTED_EXTENSIONS) {
|
|
99
|
+
const filePath = basePath + ext;
|
|
100
|
+
if (fs.existsSync(filePath)) {
|
|
101
|
+
return filePath;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return void 0;
|
|
105
|
+
};
|
|
106
|
+
const initializeConfig = async () => {
|
|
107
|
+
try {
|
|
108
|
+
const envOverrides = getEnvOverrides();
|
|
109
|
+
const projectRoot = process.cwd();
|
|
110
|
+
const reliverseDir = path.resolve(projectRoot, ".reliverse");
|
|
111
|
+
const configName = "relinka";
|
|
112
|
+
const resolveConfig = async (id, options) => {
|
|
113
|
+
if (id !== configName) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
const effectiveCwd = options.cwd || projectRoot;
|
|
117
|
+
const _jitiRequire = createJiti(effectiveCwd, options.jitiOptions);
|
|
118
|
+
const loadAndExtract = async (filePath) => {
|
|
119
|
+
try {
|
|
120
|
+
const loadedModule = await _jitiRequire.import(filePath);
|
|
121
|
+
const configData = loadedModule.default || loadedModule;
|
|
122
|
+
return configData;
|
|
123
|
+
} catch (error) {
|
|
124
|
+
console.error(
|
|
125
|
+
`[Relinka Config Error] Failed to load or parse config from ${filePath}: ${error instanceof Error ? error.message : String(error)}`
|
|
126
|
+
);
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const reliverseBasePath = path.resolve(reliverseDir, configName);
|
|
131
|
+
const reliverseConfigFile = findConfigFile(reliverseBasePath);
|
|
132
|
+
if (reliverseConfigFile) {
|
|
133
|
+
const config = await loadAndExtract(reliverseConfigFile);
|
|
134
|
+
if (config !== null) {
|
|
135
|
+
return { config, source: reliverseConfigFile };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const rootBasePath = path.resolve(effectiveCwd, configName);
|
|
139
|
+
const rootConfigFile = findConfigFile(rootBasePath);
|
|
140
|
+
if (rootConfigFile) {
|
|
141
|
+
const config = await loadAndExtract(rootConfigFile);
|
|
142
|
+
if (config !== null) {
|
|
143
|
+
return { config, source: rootConfigFile };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
};
|
|
148
|
+
const loadedConfigResult = await loadConfig({
|
|
149
|
+
name: configName,
|
|
150
|
+
cwd: projectRoot,
|
|
151
|
+
resolve: resolveConfig,
|
|
152
|
+
packageJson: "relinka",
|
|
153
|
+
dotenv: true,
|
|
154
|
+
defaults: DEFAULT_RELINKA_CONFIG,
|
|
155
|
+
overrides: envOverrides
|
|
156
|
+
});
|
|
157
|
+
currentConfig = loadedConfigResult.config ?? { ...DEFAULT_RELINKA_CONFIG };
|
|
158
|
+
isConfigInitialized = true;
|
|
159
|
+
const customResolvedLayer = loadedConfigResult.layers?.find(
|
|
160
|
+
(layer) => layer.source?.includes(configName)
|
|
161
|
+
);
|
|
162
|
+
if (customResolvedLayer?.source) {
|
|
163
|
+
console.log(
|
|
164
|
+
`[Relinka Config] Loaded main configuration from: ${path.relative(
|
|
165
|
+
projectRoot,
|
|
166
|
+
customResolvedLayer.source
|
|
167
|
+
)}`
|
|
168
|
+
);
|
|
169
|
+
} else {
|
|
170
|
+
const pkgJsonLayer = loadedConfigResult.layers?.find(
|
|
171
|
+
(layer) => layer.source?.endsWith("package.json")
|
|
172
|
+
);
|
|
173
|
+
if (pkgJsonLayer?.config) {
|
|
174
|
+
console.log("[Relinka Config] Loaded configuration from package.json.");
|
|
175
|
+
} else {
|
|
176
|
+
console.log(
|
|
177
|
+
"[Relinka Config] No config file or package.json entry found. Using defaults and environment variables."
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (isDebugEnabled(currentConfig)) {
|
|
182
|
+
console.log(
|
|
183
|
+
"[Relinka Config Debug] Final configuration object:",
|
|
184
|
+
JSON.stringify(currentConfig, null, 2)
|
|
185
|
+
);
|
|
186
|
+
console.log(
|
|
187
|
+
"[Relinka Config Debug] Resolved layers:",
|
|
188
|
+
loadedConfigResult.layers?.map((l) => ({
|
|
189
|
+
config: l.config ? "[Object]" : null,
|
|
190
|
+
source: l.source ? path.relative(projectRoot, l.source) : void 0,
|
|
191
|
+
meta: l.meta
|
|
192
|
+
}))
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
if (resolveConfigPromise) {
|
|
196
|
+
resolveConfigPromise(currentConfig);
|
|
197
|
+
}
|
|
198
|
+
return currentConfig;
|
|
199
|
+
} catch (error) {
|
|
200
|
+
console.error(
|
|
201
|
+
`[Relinka Config Error] Failed during configuration loading process: ${error instanceof Error ? error.message : String(error)}`
|
|
202
|
+
);
|
|
203
|
+
currentConfig = { ...DEFAULT_RELINKA_CONFIG };
|
|
204
|
+
isConfigInitialized = true;
|
|
205
|
+
if (resolveConfigPromise) {
|
|
206
|
+
resolveConfigPromise(currentConfig);
|
|
207
|
+
}
|
|
208
|
+
return currentConfig;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
initializeConfig().catch((err) => {
|
|
212
|
+
console.error(
|
|
213
|
+
`[Relinka Config Error] Unhandled error during initial configuration load: ${err instanceof Error ? err.message : String(err)}`
|
|
214
|
+
);
|
|
215
|
+
if (!isConfigInitialized) {
|
|
216
|
+
currentConfig = { ...DEFAULT_RELINKA_CONFIG };
|
|
217
|
+
isConfigInitialized = true;
|
|
218
|
+
if (resolveConfigPromise) {
|
|
219
|
+
resolveConfigPromise(currentConfig);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const getTimestamp = (config) => {
|
|
224
|
+
if (!config?.withTimestamp) return "";
|
|
225
|
+
const now = /* @__PURE__ */ new Date();
|
|
226
|
+
return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(
|
|
227
|
+
2,
|
|
228
|
+
"0"
|
|
229
|
+
)}-${String(now.getDate()).padStart(2, "0")} ${String(
|
|
230
|
+
now.getHours()
|
|
231
|
+
).padStart(2, "0")}:${String(now.getMinutes()).padStart(
|
|
232
|
+
2,
|
|
233
|
+
"0"
|
|
234
|
+
)}:${String(now.getSeconds()).padStart(2, "0")}.${String(
|
|
235
|
+
now.getMilliseconds()
|
|
236
|
+
).padStart(3, "0")}`;
|
|
237
|
+
};
|
|
238
|
+
const getLogFilePath = (config) => {
|
|
239
|
+
const logDir = getLogDir(config);
|
|
240
|
+
const daily = isDailyLogsEnabled(config);
|
|
241
|
+
let finalLogName = getBaseLogName(config);
|
|
242
|
+
if (daily) {
|
|
243
|
+
const now = /* @__PURE__ */ new Date();
|
|
244
|
+
const datePrefix = `${now.getFullYear()}-${String(
|
|
245
|
+
now.getMonth() + 1
|
|
246
|
+
).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}-`;
|
|
247
|
+
finalLogName = datePrefix + finalLogName;
|
|
248
|
+
}
|
|
249
|
+
if (finalLogName && !finalLogName.endsWith(".log")) {
|
|
250
|
+
finalLogName += ".log";
|
|
251
|
+
}
|
|
252
|
+
const effectiveLogName = finalLogName || "relinka.log";
|
|
253
|
+
return path.resolve(process.cwd(), logDir, effectiveLogName);
|
|
254
|
+
};
|
|
255
|
+
const formatLogMessage = (config, level, msg, details) => {
|
|
256
|
+
const timestamp = getTimestamp(config);
|
|
257
|
+
let detailsStr = "";
|
|
258
|
+
if (details !== void 0) {
|
|
259
|
+
if (details instanceof Error) {
|
|
260
|
+
detailsStr = `
|
|
261
|
+
Stack Trace: ${details.stack || details.message}`;
|
|
262
|
+
} else if (typeof details === "object" && details !== null) {
|
|
263
|
+
try {
|
|
264
|
+
detailsStr = ` ${JSON.stringify(details)}`;
|
|
265
|
+
} catch {
|
|
266
|
+
detailsStr = " [object Object]";
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
detailsStr = ` ${String(details)}`;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const paddedLevel = level.padEnd(7, " ");
|
|
273
|
+
return timestamp ? `[${timestamp}] ${paddedLevel} ${msg}${detailsStr}` : `${paddedLevel} ${msg}${detailsStr}`;
|
|
274
|
+
};
|
|
275
|
+
const logToConsole = (config, level, formattedMessage) => {
|
|
276
|
+
if (!isColorEnabled(config)) {
|
|
277
|
+
switch (level) {
|
|
278
|
+
case "ERROR":
|
|
279
|
+
console.error(formattedMessage);
|
|
280
|
+
break;
|
|
281
|
+
default:
|
|
282
|
+
console.log(formattedMessage);
|
|
283
|
+
}
|
|
284
|
+
} else {
|
|
285
|
+
switch (level) {
|
|
286
|
+
case "ERROR":
|
|
287
|
+
console.error(re.redBright(formattedMessage));
|
|
288
|
+
break;
|
|
289
|
+
case "WARN":
|
|
290
|
+
console.warn(re.yellowBright(formattedMessage));
|
|
291
|
+
break;
|
|
292
|
+
case "SUCCESS":
|
|
293
|
+
console.log(re.greenBright(formattedMessage));
|
|
294
|
+
break;
|
|
295
|
+
case "INFO":
|
|
296
|
+
console.log(re.cyanBright(formattedMessage));
|
|
297
|
+
break;
|
|
298
|
+
default:
|
|
299
|
+
console.log(re.dim(formattedMessage));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
const getLogFilesSortedByDate = async (config) => {
|
|
304
|
+
const logDirectoryPath = path.resolve(process.cwd(), getLogDir(config));
|
|
305
|
+
const debugEnabled = isDebugEnabled(config);
|
|
306
|
+
try {
|
|
307
|
+
if (!await fs.pathExists(logDirectoryPath)) {
|
|
308
|
+
if (debugEnabled) {
|
|
309
|
+
console.log(
|
|
310
|
+
`[Relinka FS Debug] Log directory does not exist: ${logDirectoryPath}`
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
return [];
|
|
314
|
+
}
|
|
315
|
+
const files = await fs.readdir(logDirectoryPath);
|
|
316
|
+
const logFilesPromises = files.filter((file) => file.endsWith(".log")).map(async (file) => {
|
|
317
|
+
const filePath = path.join(logDirectoryPath, file);
|
|
318
|
+
try {
|
|
319
|
+
const stats = await fs.stat(filePath);
|
|
320
|
+
return stats.isFile() ? { path: filePath, mtime: stats.mtime.getTime() } : null;
|
|
321
|
+
} catch (statError) {
|
|
322
|
+
if (debugEnabled) {
|
|
323
|
+
console.error(
|
|
324
|
+
`[Relinka FS Debug] Error stating file ${filePath}: ${statError instanceof Error ? statError.message : String(statError)}`
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
const logFiles = (await Promise.all(logFilesPromises)).filter(
|
|
331
|
+
(fileInfo) => Boolean(fileInfo)
|
|
332
|
+
);
|
|
333
|
+
return logFiles.sort((a, b) => b.mtime - a.mtime);
|
|
334
|
+
} catch (readDirError) {
|
|
335
|
+
if (debugEnabled) {
|
|
336
|
+
console.error(
|
|
337
|
+
`[Relinka FS Error] Error reading log directory ${logDirectoryPath}: ${readDirError instanceof Error ? readDirError.message : String(readDirError)}`
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
return [];
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
const deleteFiles = async (filePaths, config) => {
|
|
344
|
+
const debugEnabled = isDebugEnabled(config);
|
|
345
|
+
const deletePromises = filePaths.map(async (filePath) => {
|
|
346
|
+
try {
|
|
347
|
+
await fs.unlink(filePath);
|
|
348
|
+
} catch (unlinkErr) {
|
|
349
|
+
if (debugEnabled) {
|
|
350
|
+
console.error(
|
|
351
|
+
`[Relinka FS Error] Failed to delete log file ${filePath}: ${unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr)}`
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
await Promise.all(deletePromises);
|
|
357
|
+
};
|
|
358
|
+
const cleanupOldLogFiles = async (config) => {
|
|
359
|
+
const maxFiles = getMaxLogFiles(config);
|
|
360
|
+
const debugEnabled = isDebugEnabled(config);
|
|
361
|
+
if (!shouldSaveLogs(config) || maxFiles <= 0) return;
|
|
362
|
+
try {
|
|
363
|
+
const sortedLogFiles = await getLogFilesSortedByDate(config);
|
|
364
|
+
if (sortedLogFiles.length > maxFiles) {
|
|
365
|
+
const filesToDelete = sortedLogFiles.slice(maxFiles).map((f) => f.path);
|
|
366
|
+
if (filesToDelete.length > 0) {
|
|
367
|
+
await deleteFiles(filesToDelete, config);
|
|
368
|
+
if (debugEnabled) {
|
|
369
|
+
console.log(
|
|
370
|
+
`[Relinka Cleanup] Deleted ${filesToDelete.length} old log file(s). Kept ${maxFiles}.`
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
} catch (err) {
|
|
376
|
+
if (debugEnabled) {
|
|
377
|
+
console.error(
|
|
378
|
+
`[Relinka Cleanup Error] Failed during log cleanup: ${err instanceof Error ? err.message : String(err)}`
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
const appendToLogFile = async (config, absoluteLogFilePath, logMessage) => {
|
|
384
|
+
const debugEnabled = isDebugEnabled(config);
|
|
385
|
+
try {
|
|
386
|
+
await fs.ensureDir(path.dirname(absoluteLogFilePath));
|
|
387
|
+
await fs.appendFile(absoluteLogFilePath, `${logMessage}
|
|
388
|
+
`);
|
|
389
|
+
} catch (err) {
|
|
390
|
+
if (debugEnabled) {
|
|
391
|
+
console.error(
|
|
392
|
+
`[Relinka File Error] Failed to write to log file ${absoluteLogFilePath}: ${err instanceof Error ? err.message : String(err)}`
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
export const relinka = (type, message, ...args) => {
|
|
398
|
+
const configToUse = currentConfig;
|
|
399
|
+
if (message === "") {
|
|
400
|
+
console.log();
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
const logLevelLabel = type === "verbose" ? "DEBUG" : type.toUpperCase();
|
|
404
|
+
if (logLevelLabel === "DEBUG" && !isDebugEnabled(configToUse)) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const details = args.length > 0 ? args.length === 1 ? args[0] : args : void 0;
|
|
408
|
+
const formattedMessage = formatLogMessage(
|
|
409
|
+
configToUse,
|
|
410
|
+
logLevelLabel,
|
|
411
|
+
message,
|
|
412
|
+
details
|
|
413
|
+
);
|
|
414
|
+
logToConsole(configToUse, logLevelLabel, formattedMessage);
|
|
415
|
+
};
|
|
416
|
+
export const relinkaAsync = async (type, message, ...args) => {
|
|
417
|
+
const loadedConfig = await configPromise;
|
|
418
|
+
if (message === "") {
|
|
419
|
+
console.log();
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const logLevelLabel = type === "verbose" ? "DEBUG" : type.toUpperCase();
|
|
423
|
+
if (logLevelLabel === "DEBUG" && !isDebugEnabled(loadedConfig)) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const details = args.length > 0 ? args.length === 1 ? args[0] : args : void 0;
|
|
427
|
+
const formattedMessage = formatLogMessage(
|
|
428
|
+
loadedConfig,
|
|
429
|
+
logLevelLabel,
|
|
430
|
+
message,
|
|
431
|
+
details
|
|
432
|
+
);
|
|
433
|
+
logToConsole(loadedConfig, logLevelLabel, formattedMessage);
|
|
434
|
+
if (shouldSaveLogs(loadedConfig)) {
|
|
435
|
+
const absoluteLogFilePath = getLogFilePath(loadedConfig);
|
|
436
|
+
try {
|
|
437
|
+
await appendToLogFile(
|
|
438
|
+
loadedConfig,
|
|
439
|
+
absoluteLogFilePath,
|
|
440
|
+
formattedMessage
|
|
441
|
+
);
|
|
442
|
+
await cleanupOldLogFiles(loadedConfig);
|
|
443
|
+
} catch (err) {
|
|
444
|
+
if (isDebugEnabled(loadedConfig)) {
|
|
445
|
+
console.error(
|
|
446
|
+
`[Relinka File Async Error] Error during file logging/cleanup process: ${err instanceof Error ? err.message : String(err)}`
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
export const defineConfig = (config) => {
|
|
453
|
+
return config;
|
|
454
|
+
};
|
|
@@ -1,10 +1,54 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
export type
|
|
2
|
+
/** Configuration for special directory handling. */
|
|
3
|
+
export type RelinkaSpecialDirsConfig = {
|
|
4
|
+
distDirNames?: string[];
|
|
5
|
+
useParentConfigInDist?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** Configuration for directory-related settings. */
|
|
8
|
+
export type RelinkaDirsConfig = {
|
|
9
|
+
dailyLogs?: boolean;
|
|
10
|
+
logDir?: string;
|
|
11
|
+
maxLogFiles?: number;
|
|
12
|
+
specialDirs?: RelinkaSpecialDirsConfig;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Configuration options for the Relinka logger.
|
|
16
|
+
* All properties are optional to allow for partial configuration.
|
|
17
|
+
* Defaults will be applied during initialization.
|
|
18
|
+
*/
|
|
19
|
+
export type RelinkaConfig = {
|
|
20
|
+
debug?: boolean;
|
|
21
|
+
dirs?: RelinkaDirsConfig;
|
|
22
|
+
disableColors?: boolean;
|
|
23
|
+
logFilePath?: string;
|
|
24
|
+
saveLogsToFile?: boolean;
|
|
25
|
+
withTimestamp?: boolean;
|
|
26
|
+
};
|
|
27
|
+
/** Represents information about a log file for cleanup purposes. */
|
|
28
|
+
export type LogFileInfo = {
|
|
29
|
+
path: string;
|
|
30
|
+
mtime: number;
|
|
31
|
+
};
|
|
32
|
+
/** Log level types used by the logger. */
|
|
33
|
+
export type LogLevel = "error" | "info" | "success" | "verbose" | "warn";
|
|
34
|
+
/**
|
|
35
|
+
* Defines the level of logs as specific numbers or special number types.
|
|
36
|
+
*
|
|
37
|
+
* @type {0 | 1 | 2 | 3 | 4 | 5 | (number & {})} LogLevelDeprecated - Represents the log level.
|
|
38
|
+
* @default 0 - Represents the default log level.
|
|
39
|
+
*/
|
|
40
|
+
export type LogLevelDeprecated = 0 | 1 | 2 | 3 | 4 | 5 | (number & {});
|
|
41
|
+
/**
|
|
42
|
+
* Lists the types of log messages supported by the system.
|
|
43
|
+
*
|
|
44
|
+
* @type {"silent" | "fatal" | "error" | "warn" | "log" | "info" | "success" | "fail" | "ready" | "start" | "box" | "debug" | "trace" | "verbose"} LogTypeDeprecated - Represents the specific type of log message.
|
|
45
|
+
*/
|
|
46
|
+
export type LogTypeDeprecated = "silent" | "fatal" | "error" | "warn" | "log" | "info" | "success" | "fail" | "ready" | "start" | "box" | "debug" | "trace" | "verbose";
|
|
47
|
+
export type RelinkaOptionsDeprecated = {
|
|
4
48
|
/**
|
|
5
|
-
* An array of
|
|
49
|
+
* An array of RelinkaReporterDeprecated instances used to handle and output log messages.
|
|
6
50
|
*/
|
|
7
|
-
reporters:
|
|
51
|
+
reporters: RelinkaReporterDeprecated[];
|
|
8
52
|
/**
|
|
9
53
|
* A record mapping LogTypeDeprecated to InputLogObject, defining the log configuration for each log type.
|
|
10
54
|
* See {@link LogTypeDeprecated} and {@link InputLogObject}.
|
|
@@ -138,13 +182,13 @@ export type LogObject = {
|
|
|
138
182
|
*/
|
|
139
183
|
[key: string]: unknown;
|
|
140
184
|
} & InputLogObject;
|
|
141
|
-
export type
|
|
185
|
+
export type RelinkaReporterDeprecated = {
|
|
142
186
|
/**
|
|
143
187
|
* Defines how a log message is processed and displayed by this reporter.
|
|
144
188
|
* @param logObj The LogObject containing the log information to process. See {@link LogObject}.
|
|
145
|
-
* @param ctx An object containing context information such as options. See {@link
|
|
189
|
+
* @param ctx An object containing context information such as options. See {@link RelinkaOptionsDeprecated}.
|
|
146
190
|
*/
|
|
147
191
|
log: (logObj: LogObject, ctx: {
|
|
148
|
-
options:
|
|
192
|
+
options: RelinkaOptionsDeprecated;
|
|
149
193
|
}) => void;
|
|
150
194
|
};
|
package/package.json
CHANGED
|
@@ -1,38 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
+
"description": "@reliverse/relinka is a powerful logger for your terminal.",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"name": "@reliverse/relinka",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"version": "1.3.6",
|
|
2
7
|
"dependencies": {
|
|
3
8
|
"@reliverse/relico": "^1.0.2",
|
|
4
9
|
"@reliverse/runtime": "^1.0.3",
|
|
10
|
+
"c12": "^3.0.2",
|
|
5
11
|
"defu": "^6.1.4",
|
|
12
|
+
"fs-extra": "^11.3.0",
|
|
6
13
|
"pathe": "^2.0.3",
|
|
7
14
|
"printj": "^1.3.1",
|
|
8
15
|
"std-env": "^3.8.1",
|
|
9
16
|
"string-width": "^7.2.0"
|
|
10
17
|
},
|
|
11
|
-
"
|
|
12
|
-
"homepage": "https://docs.reliverse.org",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"name": "@reliverse/relinka",
|
|
15
|
-
"type": "module",
|
|
16
|
-
"version": "1.3.5",
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@biomejs/biome": "1.9.4",
|
|
19
|
-
"@eslint/js": "^9.23.0",
|
|
20
|
-
"@reliverse/relidler-cfg": "^1.1.3",
|
|
21
|
-
"@stylistic/eslint-plugin": "^4.2.0",
|
|
22
|
-
"@total-typescript/ts-reset": "^0.6.1",
|
|
23
|
-
"@types/bun": "^1.2.8",
|
|
24
|
-
"@types/node": "^22.13.16",
|
|
25
|
-
"@types/sentencer": "^0.2.3",
|
|
26
|
-
"eslint": "^9.23.0",
|
|
27
|
-
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
28
|
-
"eslint-plugin-perfectionist": "^4.10.1",
|
|
29
|
-
"jiti": "^2.4.2",
|
|
30
|
-
"knip": "^5.46.4",
|
|
31
|
-
"sentencer": "^0.2.1",
|
|
32
|
-
"typescript": "^5.8.2",
|
|
33
|
-
"typescript-eslint": "^8.29.0",
|
|
34
|
-
"vitest": "^3.1.1"
|
|
35
|
-
},
|
|
18
|
+
"devDependencies": {},
|
|
36
19
|
"exports": {
|
|
37
20
|
".": "./bin/main.js"
|
|
38
21
|
},
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { LogObject } from "../../../../core-types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Defines the level of logs as specific numbers or special number types.
|
|
4
|
-
*
|
|
5
|
-
* @type {0 | 1 | 2 | 3 | 4 | 5 | (number & {})} LogLevelDeprecated - Represents the log level.
|
|
6
|
-
* @default 0 - Represents the default log level.
|
|
7
|
-
*/
|
|
8
|
-
export type LogLevelDeprecated = 0 | 1 | 2 | 3 | 4 | 5 | (number & {});
|
|
9
|
-
/**
|
|
10
|
-
* A mapping of `LogTypeDeprecated` to its corresponding numeric log level.
|
|
11
|
-
*
|
|
12
|
-
* @type {Record<LogTypeDeprecated, number>} LogLevelsDeprecated - key-value pairs of log types to their numeric levels. See {@link LogTypeDeprecated}.
|
|
13
|
-
*/
|
|
14
|
-
export declare const LogLevelsDeprecated: Record<LogTypeDeprecated, number>;
|
|
15
|
-
/**
|
|
16
|
-
* Lists the types of log messages supported by the system.
|
|
17
|
-
*
|
|
18
|
-
* @type {"silent" | "fatal" | "error" | "warn" | "log" | "info" | "success" | "fail" | "ready" | "start" | "box" | "debug" | "trace" | "verbose"} LogTypeDeprecated - Represents the specific type of log message.
|
|
19
|
-
*/
|
|
20
|
-
export type LogTypeDeprecated = "silent" | "fatal" | "error" | "warn" | "log" | "info" | "success" | "fail" | "ready" | "start" | "box" | "debug" | "trace" | "verbose";
|
|
21
|
-
/**
|
|
22
|
-
* Maps `LogTypeDeprecated` to a `Partial<LogObject>`, primarily defining the log level.
|
|
23
|
-
*
|
|
24
|
-
* @type {Record<LogTypeDeprecated, Partial<LogObject>>} LogTypesDeprecated - key-value pairs of log types to partial log objects, specifying log levels. See {@link LogTypeDeprecated} and {@link LogObject}.
|
|
25
|
-
*/
|
|
26
|
-
export declare const LogTypesDeprecated: Record<LogTypeDeprecated, Partial<LogObject>>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export type { LogLevelDeprecated, LogTypeDeprecated, } from "./core-impl/deprecated/components/levels/levels.js";
|
|
2
|
-
export { LogLevelsDeprecated, LogTypesDeprecated, } from "./core-impl/deprecated/components/levels/levels.js";
|
|
3
|
-
export { createRelinkaBaseDeprecated, relinkaBasicDeprecated, } from "./core-impl/deprecated/components/modes/basic.js";
|
|
4
|
-
export { createRelinkaBrowserDeprecatedDeprecated, relinkaBrowserDeprecated, } from "./core-impl/deprecated/components/modes/browser.js";
|
|
5
|
-
export { relinkaDeprecated } from "./core-impl/deprecated/components/relinka-deprecated/logger.js";
|
|
6
|
-
export { createRelinkaSharedDeprecated, relinkaInstanceDeprecated, } from "./core-impl/deprecated/components/relinka-deprecated/mod.js";
|
|
7
|
-
export type { LogFn, RelinkaInstanceDeprecated, } from "./core-impl/deprecated/components/relinka-deprecated/relinka.js";
|
|
8
|
-
export { RelinkaInterface, createRelinkaDeprecated, } from "./core-impl/deprecated/components/relinka-deprecated/relinka.js";
|
|
9
|
-
export { BasicReporter } from "./core-impl/deprecated/components/reporters/basic.js";
|
|
10
|
-
export { BrowserReporter } from "./core-impl/deprecated/components/reporters/browser.js";
|
|
11
|
-
export { TYPE_COLOR_MAP, LEVEL_COLOR_MAP, FancyReporter, } from "./core-impl/deprecated/components/reporters/fancy.js";
|
|
12
|
-
export type { RelinkaOptions, FormatOptions, InputLogObject, LogObject, RelinkaReporter, } from "./core-types.js";
|
|
13
|
-
export type { BoxBorderStyle, BoxStyle, BoxOpts, } from "./core-impl/deprecated/utils/box.js";
|
|
14
|
-
export { box } from "./core-impl/deprecated/utils/box.js";
|
|
15
|
-
export type { ColorName, ColorFunction, } from "./core-impl/deprecated/utils/deprecatedColors.js";
|
|
16
|
-
export { colors, getColor, colorize, } from "./core-impl/deprecated/utils/deprecatedColors.js";
|
|
17
|
-
export { parseStack } from "./core-impl/deprecated/utils/error.js";
|
|
18
|
-
export { compileFormat, formatString, } from "./core-impl/deprecated/utils/format.js";
|
|
19
|
-
export { isPlainObject, isLogObj } from "./core-impl/deprecated/utils/log.js";
|
|
20
|
-
export { writeStream } from "./core-impl/deprecated/utils/stream.js";
|
|
21
|
-
export { stripAnsi, centerAlign, rightAlign, leftAlign, align, } from "./core-impl/deprecated/utils/string.js";
|
|
22
|
-
export type { TreeItemObject, TreeItem, TreeOptions, } from "./core-impl/deprecated/utils/tree.js";
|
|
23
|
-
export { formatTree } from "./core-impl/deprecated/utils/tree.js";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
LogLevelsDeprecated,
|
|
3
|
-
LogTypesDeprecated
|
|
4
|
-
} from "./core-impl/deprecated/components/levels/levels.js";
|
|
5
|
-
export {
|
|
6
|
-
createRelinkaBaseDeprecated,
|
|
7
|
-
relinkaBasicDeprecated
|
|
8
|
-
} from "./core-impl/deprecated/components/modes/basic.js";
|
|
9
|
-
export {
|
|
10
|
-
createRelinkaBrowserDeprecatedDeprecated,
|
|
11
|
-
relinkaBrowserDeprecated
|
|
12
|
-
} from "./core-impl/deprecated/components/modes/browser.js";
|
|
13
|
-
export { relinkaDeprecated } from "./core-impl/deprecated/components/relinka-deprecated/logger.js";
|
|
14
|
-
export {
|
|
15
|
-
createRelinkaSharedDeprecated,
|
|
16
|
-
relinkaInstanceDeprecated
|
|
17
|
-
} from "./core-impl/deprecated/components/relinka-deprecated/mod.js";
|
|
18
|
-
export {
|
|
19
|
-
RelinkaInterface,
|
|
20
|
-
createRelinkaDeprecated
|
|
21
|
-
} from "./core-impl/deprecated/components/relinka-deprecated/relinka.js";
|
|
22
|
-
export { BasicReporter } from "./core-impl/deprecated/components/reporters/basic.js";
|
|
23
|
-
export { BrowserReporter } from "./core-impl/deprecated/components/reporters/browser.js";
|
|
24
|
-
export {
|
|
25
|
-
TYPE_COLOR_MAP,
|
|
26
|
-
LEVEL_COLOR_MAP,
|
|
27
|
-
FancyReporter
|
|
28
|
-
} from "./core-impl/deprecated/components/reporters/fancy.js";
|
|
29
|
-
export { box } from "./core-impl/deprecated/utils/box.js";
|
|
30
|
-
export {
|
|
31
|
-
colors,
|
|
32
|
-
getColor,
|
|
33
|
-
colorize
|
|
34
|
-
} from "./core-impl/deprecated/utils/deprecatedColors.js";
|
|
35
|
-
export { parseStack } from "./core-impl/deprecated/utils/error.js";
|
|
36
|
-
export {
|
|
37
|
-
compileFormat,
|
|
38
|
-
formatString
|
|
39
|
-
} from "./core-impl/deprecated/utils/format.js";
|
|
40
|
-
export { isPlainObject, isLogObj } from "./core-impl/deprecated/utils/log.js";
|
|
41
|
-
export { writeStream } from "./core-impl/deprecated/utils/stream.js";
|
|
42
|
-
export {
|
|
43
|
-
stripAnsi,
|
|
44
|
-
centerAlign,
|
|
45
|
-
rightAlign,
|
|
46
|
-
leftAlign,
|
|
47
|
-
align
|
|
48
|
-
} from "./core-impl/deprecated/utils/string.js";
|
|
49
|
-
export { formatTree } from "./core-impl/deprecated/utils/tree.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../types.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../types.js";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/logger.js
RENAMED
|
File without changes
|
/package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/relinka-deprecated/mod.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/bin/{libs/core/core-impl → relinka-impl}/deprecated/components/reporters/browser.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|