@reliverse/relinka 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-npm/components/messages/mapping.js +26 -26
- package/dist-npm/components/messages/messages.js +7 -7
- package/dist-npm/components/messages/mod.d.ts +0 -1
- package/dist-npm/components/messages/mod.js +0 -1
- package/dist-npm/components/reporters/fancy.js +2 -2
- package/dist-npm/utils/box.js +1 -1
- package/dist-npm/utils/mod.d.ts +1 -1
- package/dist-npm/utils/mod.js +1 -1
- package/dist-npm/utils/tree.d.ts +1 -1
- package/dist-npm/utils/tree.js +1 -1
- package/package.json +22 -19
- package/dist-npm/components/messages/platforms.d.ts +0 -10
- package/dist-npm/components/messages/platforms.js +0 -67
- /package/dist-npm/utils/{color.d.ts → deprecatedColors.d.ts} +0 -0
- /package/dist-npm/utils/{color.js → deprecatedColors.js} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
|
+
import { re } from "@reliverse/relico";
|
|
1
2
|
import gradient, { cristal, mind, passion, retro, vice } from "gradient-string";
|
|
2
3
|
import { rainbow } from "gradient-string";
|
|
3
|
-
import pc from "picocolors";
|
|
4
4
|
export const colorMap = {
|
|
5
|
-
//
|
|
5
|
+
// @reliverse/relico
|
|
6
6
|
none: (text) => text,
|
|
7
|
-
reset:
|
|
8
|
-
bgCyan:
|
|
9
|
-
bgCyanBright:
|
|
10
|
-
black:
|
|
11
|
-
blue:
|
|
12
|
-
blueBright:
|
|
13
|
-
cyan:
|
|
14
|
-
cyanBright:
|
|
15
|
-
dim:
|
|
16
|
-
gray:
|
|
17
|
-
green:
|
|
18
|
-
greenBright:
|
|
19
|
-
inverse: (text) =>
|
|
20
|
-
magenta:
|
|
21
|
-
magentaBright:
|
|
22
|
-
red:
|
|
23
|
-
redBright:
|
|
24
|
-
white:
|
|
25
|
-
yellow:
|
|
26
|
-
yellowBright:
|
|
7
|
+
reset: re.reset,
|
|
8
|
+
bgCyan: re.bgCyan,
|
|
9
|
+
bgCyanBright: re.bgCyanBright,
|
|
10
|
+
black: re.black,
|
|
11
|
+
blue: re.blue,
|
|
12
|
+
blueBright: re.blueBright,
|
|
13
|
+
cyan: re.cyan,
|
|
14
|
+
cyanBright: re.cyanBright,
|
|
15
|
+
dim: re.dim,
|
|
16
|
+
gray: re.gray,
|
|
17
|
+
green: re.green,
|
|
18
|
+
greenBright: re.greenBright,
|
|
19
|
+
inverse: (text) => re.bold(re.inverse(text)),
|
|
20
|
+
magenta: re.magenta,
|
|
21
|
+
magentaBright: re.magentaBright,
|
|
22
|
+
red: re.red,
|
|
23
|
+
redBright: re.redBright,
|
|
24
|
+
white: re.white,
|
|
25
|
+
yellow: re.yellow,
|
|
26
|
+
yellowBright: re.yellowBright,
|
|
27
27
|
// gradient-string
|
|
28
28
|
cristalGradient: cristal,
|
|
29
29
|
gradientGradient: gradient([
|
|
@@ -42,8 +42,8 @@ export const colorMap = {
|
|
|
42
42
|
};
|
|
43
43
|
export const typographyMap = {
|
|
44
44
|
none: (text) => text,
|
|
45
|
-
bold:
|
|
46
|
-
italic:
|
|
47
|
-
strikethrough:
|
|
48
|
-
underline:
|
|
45
|
+
bold: re.bold,
|
|
46
|
+
italic: re.italic,
|
|
47
|
+
strikethrough: re.strikethrough,
|
|
48
|
+
underline: re.underline
|
|
49
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { re } from "@reliverse/relico";
|
|
2
|
+
import { isUnicodeSupported } from "@reliverse/runtime";
|
|
2
3
|
import wrapAnsi from "wrap-ansi";
|
|
3
4
|
import { colorMap, typographyMap } from "./mapping.js";
|
|
4
|
-
import { isUnicodeSupported } from "./platforms.js";
|
|
5
5
|
import {
|
|
6
6
|
deleteLastLines,
|
|
7
7
|
getExactTerminalWidth,
|
|
@@ -138,7 +138,7 @@ export function fmt(opts) {
|
|
|
138
138
|
const lineLength = opts.horizontalLineLength === 0 ? getExactTerminalWidth() - 3 : opts.horizontalLineLength ?? getExactTerminalWidth() - 3;
|
|
139
139
|
const suffixStartLine = opts.borderColor ? colorMap[opts.borderColor](`${symbols.line.repeat(lineLength)}\u22B1`) : `${symbols.line.repeat(lineLength)}\u22B1`;
|
|
140
140
|
const suffixEndLine = opts.borderColor ? colorMap[opts.borderColor](`${symbols.line.repeat(lineLength)}\u22B1`) : `${symbols.line.repeat(lineLength)}\u22B1`;
|
|
141
|
-
const computedSymbol = getColoredSymbol(opts.customSymbol, opts.symbol, opts.symbolColor) ??
|
|
141
|
+
const computedSymbol = getColoredSymbol(opts.customSymbol, opts.symbol, opts.symbolColor) ?? re.green(symbols.step_active);
|
|
142
142
|
const MESSAGE_CONFIG_MAP = {
|
|
143
143
|
M_NULL: {
|
|
144
144
|
symbol: "",
|
|
@@ -191,14 +191,14 @@ ${borderTwoSpaces}`,
|
|
|
191
191
|
newLineAfter: opts.addNewLineAfter ?? false
|
|
192
192
|
},
|
|
193
193
|
M_INFO: {
|
|
194
|
-
symbol: computedSymbol ||
|
|
194
|
+
symbol: computedSymbol || re.green(symbols.info),
|
|
195
195
|
prefix: borderTwoSpaces,
|
|
196
196
|
suffix: "",
|
|
197
197
|
newLineBefore: opts.addNewLineBefore ?? false,
|
|
198
198
|
newLineAfter: opts.addNewLineAfter ?? true
|
|
199
199
|
},
|
|
200
200
|
M_ERROR: {
|
|
201
|
-
symbol: computedSymbol ||
|
|
201
|
+
symbol: computedSymbol || re.redBright(symbols.step_error),
|
|
202
202
|
prefix: borderTwoSpaces,
|
|
203
203
|
suffix: "",
|
|
204
204
|
newLineBefore: opts.addNewLineBefore ?? false,
|
|
@@ -300,8 +300,8 @@ export function msgUndoAll() {
|
|
|
300
300
|
}
|
|
301
301
|
export function printLineBar(text, indent = 2) {
|
|
302
302
|
if (text === "") {
|
|
303
|
-
console.log(
|
|
303
|
+
console.log(re.dim("\u2502"));
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
console.log(`${
|
|
306
|
+
console.log(`${re.dim("\u2502")}${" ".repeat(indent)}${text}`);
|
|
307
307
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import isUnicodeSupported from "
|
|
1
|
+
import { isUnicodeSupported } from "@reliverse/runtime";
|
|
2
2
|
import stringWidth from "string-width";
|
|
3
3
|
import { BasicReporter } from "../../components/reporters/basic.js";
|
|
4
4
|
import { box } from "../../utils/box.js";
|
|
5
|
-
import { colors } from "../../utils/
|
|
5
|
+
import { colors } from "../../utils/deprecatedColors.js";
|
|
6
6
|
import { parseStack } from "../../utils/error.js";
|
|
7
7
|
import { stripAnsi } from "../../utils/string.js";
|
|
8
8
|
export const TYPE_COLOR_MAP = {
|
package/dist-npm/utils/box.js
CHANGED
package/dist-npm/utils/mod.d.ts
CHANGED
package/dist-npm/utils/mod.js
CHANGED
package/dist-npm/utils/tree.d.ts
CHANGED
package/dist-npm/utils/tree.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reliverse/relinka",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"author": "blefnk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "@reliverse/relinka is a powerful logger for your terminal.",
|
|
@@ -56,31 +56,34 @@
|
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@figliolia/chalk-animation": "^1.0.4",
|
|
59
|
-
"@
|
|
59
|
+
"@reliverse/relico": "^1.0.0",
|
|
60
|
+
"@reliverse/runtime": "^1.0.1",
|
|
61
|
+
"@sinclair/typebox": "^0.34.14",
|
|
60
62
|
"ansi-diff-stream": "^1.2.1",
|
|
61
63
|
"ansi-escapes": "^7.0.0",
|
|
62
64
|
"chalk": "^5.4.1",
|
|
63
65
|
"cli-spinners": "^3.2.0",
|
|
64
66
|
"cli-styles": "^1.0.0",
|
|
65
67
|
"cli-width": "^4.1.0",
|
|
68
|
+
"confbox": "^0.1.8",
|
|
66
69
|
"defu": "^6.1.4",
|
|
70
|
+
"destr": "^2.0.3",
|
|
67
71
|
"detect-package-manager": "^3.0.2",
|
|
68
72
|
"external-editor": "^3.1.0",
|
|
69
73
|
"fast-glob": "^3.3.3",
|
|
70
74
|
"figlet": "^1.8.0",
|
|
71
|
-
"fs-extra": "^11.
|
|
75
|
+
"fs-extra": "^11.3.0",
|
|
72
76
|
"get-pixels": "^3.3.3",
|
|
73
77
|
"globby": "^14.0.2",
|
|
74
78
|
"gradient-string": "^3.0.0",
|
|
75
|
-
"is-unicode-supported": "^2.1.0",
|
|
76
79
|
"kleur": "^4.1.5",
|
|
77
80
|
"log-update": "^6.1.0",
|
|
81
|
+
"mri": "^1.2.0",
|
|
78
82
|
"mute-stream": "^2.0.0",
|
|
79
83
|
"node-emoji": "^2.2.0",
|
|
80
|
-
"nypm": "^0.
|
|
84
|
+
"nypm": "^0.5.0",
|
|
81
85
|
"ora": "^8.1.1",
|
|
82
|
-
"pathe": "^2.0.
|
|
83
|
-
"picocolors": "^1.1.1",
|
|
86
|
+
"pathe": "^2.0.2",
|
|
84
87
|
"precision": "^1.0.1",
|
|
85
88
|
"seventh": "^0.9.2",
|
|
86
89
|
"signal-exit": "^4.1.0",
|
|
@@ -96,38 +99,38 @@
|
|
|
96
99
|
"devDependencies": {
|
|
97
100
|
"@arethetypeswrong/cli": "^0.17.3",
|
|
98
101
|
"@biomejs/biome": "1.9.4",
|
|
99
|
-
"@cspell/dict-npm": "^5.1.
|
|
100
|
-
"@eslint/js": "^9.
|
|
101
|
-
"@eslint/json": "^0.
|
|
102
|
-
"@eslint/markdown": "^6.2.
|
|
102
|
+
"@cspell/dict-npm": "^5.1.23",
|
|
103
|
+
"@eslint/js": "^9.19.0",
|
|
104
|
+
"@eslint/json": "^0.10.0",
|
|
105
|
+
"@eslint/markdown": "^6.2.2",
|
|
103
106
|
"@stylistic/eslint-plugin": "^2.13.0",
|
|
104
107
|
"@types/ansi-diff-stream": "^1.2.3",
|
|
105
|
-
"@types/bun": "^1.
|
|
108
|
+
"@types/bun": "^1.2.0",
|
|
106
109
|
"@types/chalk-animation": "^1.6.3",
|
|
107
110
|
"@types/eslint__js": "^8.42.3",
|
|
108
111
|
"@types/figlet": "^1.7.0",
|
|
109
112
|
"@types/fs-extra": "^11.0.4",
|
|
110
113
|
"@types/mute-stream": "^0.0.4",
|
|
111
|
-
"@types/node": "^22.10.
|
|
114
|
+
"@types/node": "^22.10.10",
|
|
112
115
|
"@types/sentencer": "^0.2.3",
|
|
113
116
|
"@types/signal-exit": "^3.0.4",
|
|
114
117
|
"@types/strip-comments": "^2.0.4",
|
|
115
118
|
"@types/window-size": "^1.1.4",
|
|
116
119
|
"c12": "^2.0.1",
|
|
117
120
|
"citty": "^0.1.6",
|
|
118
|
-
"eslint": "^9.
|
|
119
|
-
"eslint-plugin-perfectionist": "^4.
|
|
121
|
+
"eslint": "^9.19.0",
|
|
122
|
+
"eslint-plugin-perfectionist": "^4.7.0",
|
|
120
123
|
"execa": "^9.5.2",
|
|
121
124
|
"jiti": "^2.4.2",
|
|
122
|
-
"knip": "^5.
|
|
125
|
+
"knip": "^5.43.3",
|
|
123
126
|
"mock-stdin": "^1.0.0",
|
|
124
127
|
"printj": "^1.3.1",
|
|
125
128
|
"sentencer": "^0.2.1",
|
|
126
129
|
"strip-comments": "^2.0.1",
|
|
127
130
|
"tsx": "^4.19.2",
|
|
128
131
|
"typescript": "^5.7.3",
|
|
129
|
-
"typescript-eslint": "^8.
|
|
132
|
+
"typescript-eslint": "^8.21.0",
|
|
130
133
|
"unbuild": "^3.3.1",
|
|
131
|
-
"vitest": "^
|
|
134
|
+
"vitest": "^3.0.4"
|
|
132
135
|
}
|
|
133
|
-
}
|
|
136
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines if Unicode is supported in the current terminal.
|
|
3
|
-
* @returns {boolean} True if Unicode is supported, false otherwise.
|
|
4
|
-
*/
|
|
5
|
-
export declare function isUnicodeSupported(): boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Determines the current terminal name based on environment variables.
|
|
8
|
-
* @returns {string} The name of the current terminal or "Unknown" if it cannot be determined.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getCurrentTerminalName(): string;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { env, isWindows, isLinux, isMacOS } from "std-env";
|
|
2
|
-
export function isUnicodeSupported() {
|
|
3
|
-
if (isLinux) {
|
|
4
|
-
return env["TERM"] !== "linux";
|
|
5
|
-
}
|
|
6
|
-
return env["WT_SESSION"] !== void 0 || env["TERMINUS_SUBLIME"] !== void 0 || env["ConEmuTask"] === "{cmd::Cmder}" || env["TERM_PROGRAM"] === "Terminus-Sublime" || env["TERM_PROGRAM"] === "vscode" || env["TERM"] === "xterm-256color" || env["TERM"] === "alacritty" || env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
7
|
-
}
|
|
8
|
-
export function getCurrentTerminalName() {
|
|
9
|
-
const termProgram = env["TERM_PROGRAM"];
|
|
10
|
-
const term = env["TERM"];
|
|
11
|
-
const terminalEmulator = env["TERMINAL_EMULATOR"];
|
|
12
|
-
if (termProgram) {
|
|
13
|
-
switch (termProgram.toLowerCase()) {
|
|
14
|
-
case "vscode":
|
|
15
|
-
return "VSCode Terminal";
|
|
16
|
-
case "terminus-sublime":
|
|
17
|
-
return "Terminus Sublime";
|
|
18
|
-
case "hyper":
|
|
19
|
-
return "Hyper";
|
|
20
|
-
case "iterm.app":
|
|
21
|
-
case "iterm":
|
|
22
|
-
return "iTerm2";
|
|
23
|
-
case "alacritty":
|
|
24
|
-
return "Alacritty";
|
|
25
|
-
case "wezterm":
|
|
26
|
-
return "WezTerm";
|
|
27
|
-
case "terminus":
|
|
28
|
-
return "Terminus";
|
|
29
|
-
default:
|
|
30
|
-
return `TERM_PROGRAM: ${termProgram}`;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (terminalEmulator) {
|
|
34
|
-
switch (terminalEmulator.toLowerCase()) {
|
|
35
|
-
case "jetbrains-jediterm":
|
|
36
|
-
return "JetBrains JediTerm";
|
|
37
|
-
case "cmder":
|
|
38
|
-
return "Cmder";
|
|
39
|
-
case "conemu":
|
|
40
|
-
return "ConEmu";
|
|
41
|
-
default:
|
|
42
|
-
return `TERMINAL_EMULATOR: ${terminalEmulator}`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (term) {
|
|
46
|
-
switch (term.toLowerCase()) {
|
|
47
|
-
case "xterm-256color":
|
|
48
|
-
return "Xterm 256 Color";
|
|
49
|
-
case "alacritty":
|
|
50
|
-
return "Alacritty";
|
|
51
|
-
case "xterm":
|
|
52
|
-
return "Xterm";
|
|
53
|
-
case "linux":
|
|
54
|
-
return "Linux Console Kernel";
|
|
55
|
-
default:
|
|
56
|
-
return `TERM: ${term}`;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (isWindows) {
|
|
60
|
-
return "Windows Terminal";
|
|
61
|
-
} else if (isMacOS) {
|
|
62
|
-
return "macOS Terminal";
|
|
63
|
-
} else if (isLinux) {
|
|
64
|
-
return "Linux Terminal";
|
|
65
|
-
}
|
|
66
|
-
return "Unknown Terminal";
|
|
67
|
-
}
|
|
File without changes
|
|
File without changes
|