@kitql/helpers
Advanced tools
Comparing version 0.8.6 to 0.8.7
# @kitql/helpers | ||
## 0.8.7 | ||
### Patch Changes | ||
- [#563](https://github.com/jycouet/kitql/pull/563) | ||
[`34dfde6`](https://github.com/jycouet/kitql/commit/34dfde6ac2c590cc77d600f9ea963e48dc92d199) | ||
Thanks [@jycouet](https://github.com/jycouet)! - Pimp default logs look & feel | ||
## 0.8.6 | ||
@@ -4,0 +12,0 @@ |
@@ -39,24 +39,20 @@ "use strict"; | ||
if (this.toolName) { | ||
table.push(String((0, import_colors.magenta)(`[${this.toolName}]`))); | ||
table.push(String((0, import_colors.bgCyanBright)(` ${this.toolName} `))); | ||
} | ||
if (this.withDate === "dateTime") { | ||
table.push(String((0, import_colors.magenta)(`[${(/* @__PURE__ */ new Date()).toISOString()}]`))); | ||
table.push(String((0, import_colors.bgCyanBright)(`${(/* @__PURE__ */ new Date()).toISOString()} `))); | ||
} else if (this.withDate === "time") { | ||
table.push(String((0, import_colors.magenta)(`[${(/* @__PURE__ */ new Date()).toISOString().split("T")[1]}]`))); | ||
table.push(String((0, import_colors.bgCyanBright)(`${(/* @__PURE__ */ new Date()).toISOString().split("T")[1]} `))); | ||
} | ||
if (withError) { | ||
table.push((0, import_colors.bold)((0, import_colors.redBright)("\u2718"))); | ||
table.push((0, import_colors.bold)((0, import_colors.redBright)(" \u2718 "))); | ||
} else if (withSuccess) { | ||
table.push((0, import_colors.bold)((0, import_colors.greenBright)("\u2714"))); | ||
table.push((0, import_colors.bold)((0, import_colors.greenBright)(" \u2714 "))); | ||
} else { | ||
table.push(String(this.prefixEmoji)); | ||
table.push(String(" " + this.prefixEmoji)); | ||
} | ||
table.push(indent); | ||
if (table.join("").length > 0) { | ||
table.push(` `); | ||
} | ||
table.push(String(msg)); | ||
const str = table.join(""); | ||
return (0, import_colors.colorProcess)(str); | ||
return [str]; | ||
} | ||
@@ -63,0 +59,0 @@ info(msg, conf) { |
@@ -1,2 +0,2 @@ | ||
import { bold, colorProcess, greenBright, magenta, redBright } from './colors/index.js'; | ||
import { bgCyanBright, bold, colorProcess, greenBright, magenta, redBright, } from './colors/index.js'; | ||
export class Log { | ||
@@ -16,31 +16,26 @@ toolName; | ||
if (this.toolName) { | ||
table.push(String(magenta(`[${this.toolName}]`))); | ||
// table.push(String(magenta(`[${this.toolName}]`))) | ||
table.push(String(bgCyanBright(` ${this.toolName} `))); | ||
} | ||
// DateTime or Time or nothing | ||
if (this.withDate === 'dateTime') { | ||
table.push(String(magenta(`[${new Date().toISOString()}]`))); | ||
table.push(String(bgCyanBright(`${new Date().toISOString()} `))); | ||
} | ||
else if (this.withDate === 'time') { | ||
table.push(String(magenta(`[${new Date().toISOString().split('T')[1]}]`))); | ||
table.push(String(bgCyanBright(`${new Date().toISOString().split('T')[1]} `))); | ||
} | ||
// Status icon or prefixEmoji | ||
if (withError) { | ||
table.push(bold(redBright('✘'))); | ||
table.push(bold(redBright(' ✘ '))); | ||
} | ||
else if (withSuccess) { | ||
table.push(bold(greenBright('✔'))); | ||
table.push(bold(greenBright(' ✔ '))); | ||
} | ||
else { | ||
table.push(String(this.prefixEmoji)); | ||
table.push(String(' ' + this.prefixEmoji)); | ||
} | ||
table.push(indent); | ||
// prefix message with a space if there is already something in the table | ||
if (table.join('').length > 0) { | ||
table.push(` `); | ||
} | ||
table.push(String(msg)); | ||
const str = table.join(''); | ||
return colorProcess(str); | ||
// wrap it because we always unwrap after ;) | ||
return [str]; | ||
} | ||
@@ -47,0 +42,0 @@ info(msg, conf) { |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "0.8.6", | ||
"version": "0.8.7", | ||
"license": "MIT", | ||
@@ -15,0 +15,0 @@ "type": "module", |
@@ -12,12 +12,15 @@ # ⚡ KitQL - Helpers | ||
It's a | ||
It's a | ||
![](https://img.shields.io/badge/0-Dependencies-FF3E00.svg?style=flat&logo=stackblitz&logoColor=FF3E00) | ||
package. | ||
[![](https://img.shields.io/badge/4.7%20gzip-pkg%20size.dev-FF3E00.svg?style=flat&logo=stackblitz&logoColor=FF3E00)](https://pkg-size.dev/@kitql%2Fhelpers) is the "full" size. But, code splitting is always in mind so that you ship as less as possible in the browser! _(Check out by selecting what you use)_ | ||
[![](https://img.shields.io/badge/4.7%20gzip-pkg%20size.dev-FF3E00.svg?style=flat&logo=stackblitz&logoColor=FF3E00)](https://pkg-size.dev/@kitql%2Fhelpers) | ||
is the "full" size. But, code splitting is always in mind so that you ship as less as possible in | ||
the browser! _(Check out by selecting what you use)_ | ||
## ⭐️ Join us | ||
## ⭐️ Join us | ||
[![GitHub Repo stars](https://img.shields.io/github/stars/jycouet/kitql?logo=github&label=KitQL&color=#4ACC31)](https://github.com/jycouet/kitql) | ||
💡 _[KitQL](https://www.kitql.dev/docs) itself is not a library, it's "nothing" but a collection of standalone libraries._ | ||
💡 _[KitQL](https://www.kitql.dev/docs) itself is not a library, it's "nothing" but a collection of | ||
standalone libraries._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103538
26
2479