@reliverse/relinka 1.2.10 → 1.3.1

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.
@@ -40,6 +40,7 @@ export type FmtMsgOptions = {
40
40
  symbol?: SymbolName;
41
41
  customSymbol?: string;
42
42
  symbolColor?: ColorName;
43
+ noNewLine?: boolean;
43
44
  };
44
45
  export declare const symbols: {
45
46
  readonly pointer: string;
@@ -82,6 +83,7 @@ export declare function msgUndoAll(): void;
82
83
  /**
83
84
  * Prints: "│ <text>" (two spaces after the bar).
84
85
  * If text is empty, it just prints "│".
85
- * If indent is 1, it prints "│ <text>", etc.
86
+ * If indent is 1, it prints "│ <text>" (one space).
87
+ * If indent is 2, it prints "│ <text>" (two spaces), etc.
86
88
  */
87
89
  export declare function printLineBar(text: string, indent?: number): void;
@@ -258,7 +258,7 @@ ${borderTwoSpaces}` : "",
258
258
  }
259
259
  if (opts.type === "M_END" && opts.border && index === 0) {
260
260
  if (!opts.title) return "";
261
- return `${bar({ borderColor: opts.borderColor })} ${line}`;
261
+ return `${bar({ borderColor: opts.borderColor ?? "dim" })} ${line}`;
262
262
  }
263
263
  if (!line.trim() || line.includes(symbols.middle)) {
264
264
  return line;
@@ -279,8 +279,15 @@ ${borderTwoSpaces}` : "",
279
279
  const printedLineStack = [];
280
280
  export function msg(opts) {
281
281
  const { text, lineCount } = fmt(opts);
282
- process.stdout.write(text + "\n");
283
- printedLineStack.push(lineCount + 1);
282
+ if (opts.type === "M_BAR" && opts.noNewLine) {
283
+ process.stdout.write(text);
284
+ } else {
285
+ process.stdout.write(`${text}
286
+ `);
287
+ }
288
+ printedLineStack.push(
289
+ opts.type === "M_BAR" && opts.noNewLine ? lineCount : lineCount + 1
290
+ );
284
291
  }
285
292
  export function msgUndo(count = 1) {
286
293
  for (let i = 0; i < count; i++) {
@@ -301,7 +308,7 @@ export function msgUndoAll() {
301
308
  export function printLineBar(text, indent = 2) {
302
309
  if (text === "") {
303
310
  console.log(re.dim("\u2502"));
304
- return;
311
+ } else {
312
+ console.log(`${re.dim("\u2502")}${" ".repeat(indent)}${text}`);
305
313
  }
306
- console.log(`${re.dim("\u2502")}${" ".repeat(indent)}${text}`);
307
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reliverse/relinka",
3
- "version": "1.2.10",
3
+ "version": "1.3.1",
4
4
  "author": "blefnk",
5
5
  "type": "module",
6
6
  "description": "@reliverse/relinka is a powerful logger for your terminal.",
@@ -56,8 +56,8 @@
56
56
  "license": "MIT",
57
57
  "dependencies": {
58
58
  "@figliolia/chalk-animation": "^1.0.4",
59
- "@reliverse/relico": "^1.0.0",
60
- "@reliverse/runtime": "^1.0.1",
59
+ "@reliverse/relico": "^1.0.1",
60
+ "@reliverse/runtime": "^1.0.2",
61
61
  "@sinclair/typebox": "^0.34.14",
62
62
  "ansi-diff-stream": "^1.2.1",
63
63
  "ansi-escapes": "^7.0.0",
@@ -103,7 +103,7 @@
103
103
  "@eslint/js": "^9.19.0",
104
104
  "@eslint/json": "^0.10.0",
105
105
  "@eslint/markdown": "^6.2.2",
106
- "@stylistic/eslint-plugin": "^2.13.0",
106
+ "@stylistic/eslint-plugin": "^3.0.0",
107
107
  "@types/ansi-diff-stream": "^1.2.3",
108
108
  "@types/bun": "^1.2.0",
109
109
  "@types/chalk-animation": "^1.6.3",