@powerlines/core 0.43.31 → 0.44.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.
Files changed (69) hide show
  1. package/dist/constants/index.cjs +5 -1
  2. package/dist/constants/index.d.cts +2 -1
  3. package/dist/constants/index.d.mts +2 -1
  4. package/dist/constants/index.mjs +3 -2
  5. package/dist/constants/log-level.cjs +43 -0
  6. package/dist/constants/log-level.d.cts +40 -0
  7. package/dist/constants/log-level.d.cts.map +1 -0
  8. package/dist/constants/log-level.d.mts +40 -0
  9. package/dist/constants/log-level.d.mts.map +1 -0
  10. package/dist/constants/log-level.mjs +41 -0
  11. package/dist/constants/log-level.mjs.map +1 -0
  12. package/dist/index.cjs +6 -6
  13. package/dist/index.d.cts +3 -3
  14. package/dist/index.d.mts +3 -3
  15. package/dist/index.mjs +3 -2
  16. package/dist/lib/index.cjs +0 -6
  17. package/dist/lib/index.d.cts +1 -2
  18. package/dist/lib/index.d.mts +1 -2
  19. package/dist/lib/index.mjs +1 -2
  20. package/dist/lib/unplugin/plugin.cjs +9 -11
  21. package/dist/lib/unplugin/plugin.d.cts.map +1 -1
  22. package/dist/lib/unplugin/plugin.d.mts.map +1 -1
  23. package/dist/lib/unplugin/plugin.mjs +9 -11
  24. package/dist/lib/unplugin/plugin.mjs.map +1 -1
  25. package/dist/lib/utilities/write-file.cjs +1 -2
  26. package/dist/lib/utilities/write-file.d.cts +1 -1
  27. package/dist/lib/utilities/write-file.d.cts.map +1 -1
  28. package/dist/lib/utilities/write-file.d.mts +1 -1
  29. package/dist/lib/utilities/write-file.d.mts.map +1 -1
  30. package/dist/lib/utilities/write-file.mjs +1 -2
  31. package/dist/lib/utilities/write-file.mjs.map +1 -1
  32. package/dist/plugin-utils/index.cjs +15 -1
  33. package/dist/plugin-utils/index.d.cts +2 -2
  34. package/dist/plugin-utils/index.d.mts +2 -2
  35. package/dist/plugin-utils/index.mjs +2 -2
  36. package/dist/plugin-utils/logging.cjs +375 -1
  37. package/dist/plugin-utils/logging.d.cts +85 -1
  38. package/dist/plugin-utils/logging.d.cts.map +1 -1
  39. package/dist/plugin-utils/logging.d.mts +85 -1
  40. package/dist/plugin-utils/logging.d.mts.map +1 -1
  41. package/dist/plugin-utils/logging.mjs +360 -1
  42. package/dist/plugin-utils/logging.mjs.map +1 -1
  43. package/dist/types/config.d.cts +33 -28
  44. package/dist/types/config.d.cts.map +1 -1
  45. package/dist/types/config.d.mts +33 -28
  46. package/dist/types/config.d.mts.map +1 -1
  47. package/dist/types/context.d.cts +20 -34
  48. package/dist/types/context.d.cts.map +1 -1
  49. package/dist/types/context.d.mts +20 -34
  50. package/dist/types/context.d.mts.map +1 -1
  51. package/dist/types/index.cjs +1 -0
  52. package/dist/types/index.d.cts +2 -1
  53. package/dist/types/index.d.mts +2 -1
  54. package/dist/types/index.mjs +3 -0
  55. package/dist/types/logging.cjs +48 -0
  56. package/dist/types/logging.d.cts +174 -0
  57. package/dist/types/logging.d.cts.map +1 -0
  58. package/dist/types/logging.d.mts +174 -0
  59. package/dist/types/logging.d.mts.map +1 -0
  60. package/dist/types/logging.mjs +45 -0
  61. package/dist/types/logging.mjs.map +1 -0
  62. package/package.json +74 -442
  63. package/dist/lib/logger.cjs +0 -100
  64. package/dist/lib/logger.d.cts +0 -54
  65. package/dist/lib/logger.d.cts.map +0 -1
  66. package/dist/lib/logger.d.mts +0 -54
  67. package/dist/lib/logger.d.mts.map +0 -1
  68. package/dist/lib/logger.mjs +0 -94
  69. package/dist/lib/logger.mjs.map +0 -1
@@ -1,100 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_environments = require('../constants/environments.cjs');
4
- let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
5
- let _storm_software_config_tools_types = require("@storm-software/config-tools/types");
6
- let _storm_software_config_tools_utilities_colors = require("@storm-software/config-tools/utilities/colors");
7
- let _stryke_helpers_noop = require("@stryke/helpers/noop");
8
- let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
- let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
10
- let chalk = require("chalk");
11
- chalk = require_runtime.__toESM(chalk, 1);
12
-
13
- //#region src/lib/logger.ts
14
- /**
15
- * Create a logging function with a specific name and options.
16
- *
17
- * @param name - The name of the logging function.
18
- * @param options - The options to configure the logging function.
19
- * @returns A logging function.
20
- */
21
- const createLog = (name, options = {}) => {
22
- const logLevel = options.logLevel === null ? _storm_software_config_tools_types.LogLevelLabel.SILENT : options.logLevel || _storm_software_config_tools_types.LogLevelLabel.INFO;
23
- if (logLevel === _storm_software_config_tools_types.LogLevelLabel.SILENT) return _stryke_helpers_noop.noop;
24
- if (options.customLogger) return options.customLogger;
25
- const source = options.plugin || options.source;
26
- return (type, ...args) => (0, _storm_software_config_tools_logger.getLogFn)((0, _storm_software_config_tools_logger.getLogLevel)(type), {
27
- ...options,
28
- logLevel
29
- })(`${name ? chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))((0, _stryke_string_format_kebab_case.kebabCase)(name)) : ""}${options.command ? chalk.default.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))(` (${options.command})`) : ""}${name ? chalk.default.grey(" > ") : ""}${source && (!name || (0, _stryke_string_format_kebab_case.kebabCase)(source) !== (0, _stryke_string_format_kebab_case.kebabCase)(name)) ? `${chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))((0, _stryke_string_format_kebab_case.kebabCase)(source))}${chalk.default.grey(" > ")}` : ""}${options.environment && options.environment !== "default" ? `${chalk.default.bold.hex((0, _storm_software_config_tools_utilities_colors.getColor)("brand", options))((0, _stryke_string_format_kebab_case.kebabCase)(options.environment))}${chalk.default.grey(" > ")}` : ""}${args.join(" ")} `.trim());
30
- };
31
- const BADGE_COLORS = [
32
- "#00A0DD",
33
- "#6FCE4E",
34
- "#FBBF24",
35
- "#F43F5E",
36
- "#3B82F6",
37
- "#A855F7",
38
- "#469592",
39
- "#288EDF",
40
- "#D8B4FE",
41
- "#10B981",
42
- "#EF4444",
43
- "#F0EC56",
44
- "#F472B6",
45
- "#22D3EE",
46
- "#EAB308",
47
- "#84CC16",
48
- "#F87171",
49
- "#0EA5E9",
50
- "#D946EF",
51
- "#FACC15",
52
- "#34D399",
53
- "#8B5CF6"
54
- ];
55
- /**
56
- * Generate a consistent color based on the input text.
57
- *
58
- * @param text - The input text to generate the color from.
59
- * @return A hexadecimal color string.
60
- */
61
- const getTextColor = (text) => {
62
- return BADGE_COLORS[text.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0];
63
- };
64
- /**
65
- * Generate a consistent color based on the input text.
66
- *
67
- * @param text - The input text to generate the color from.
68
- * @return A hexadecimal color string.
69
- */
70
- const colorText = (text) => {
71
- const title = (0, _stryke_string_format_title_case.titleCase)(text);
72
- return chalk.default.hex(getTextColor(title))(title);
73
- };
74
- /**
75
- * Generate a consistent color based on the input text.
76
- *
77
- * @param text - The input text to generate the color from.
78
- * @return A hexadecimal color string.
79
- */
80
- const colorBackground = (text) => {
81
- const title = (0, _stryke_string_format_title_case.titleCase)(text);
82
- return chalk.default.inverse.hex(getTextColor(title))(` ${title} `);
83
- };
84
- /**
85
- * Extend a logging function with a specific name, adding a colored badge to the log output.
86
- *
87
- * @param logFn - The original logging function to extend.
88
- * @param name - The name to use for the badge in the log output.
89
- * @returns A new logging function that includes the badge in its output.
90
- */
91
- const extendLog = (logFn, name) => {
92
- return (type, ...args) => logFn(type, `${colorBackground(name)} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `);
93
- };
94
-
95
- //#endregion
96
- exports.colorBackground = colorBackground;
97
- exports.colorText = colorText;
98
- exports.createLog = createLog;
99
- exports.extendLog = extendLog;
100
- exports.getTextColor = getTextColor;
@@ -1,54 +0,0 @@
1
- import { LogFn, WorkspaceConfig } from "../types/config.cjs";
2
- import { LogLevelLabel } from "@storm-software/config-tools/types";
3
-
4
- //#region src/lib/logger.d.ts
5
- interface CreateLogOptions {
6
- source?: string;
7
- command?: string;
8
- environment?: string;
9
- plugin?: string;
10
- logLevel?: LogLevelLabel | null;
11
- customLogger?: LogFn;
12
- colors?: WorkspaceConfig["colors"];
13
- }
14
- /**
15
- * Create a logging function with a specific name and options.
16
- *
17
- * @param name - The name of the logging function.
18
- * @param options - The options to configure the logging function.
19
- * @returns A logging function.
20
- */
21
- declare const createLog: (name: string | null, options?: CreateLogOptions) => LogFn;
22
- /**
23
- * Generate a consistent color based on the input text.
24
- *
25
- * @param text - The input text to generate the color from.
26
- * @return A hexadecimal color string.
27
- */
28
- declare const getTextColor: (text: string) => string;
29
- /**
30
- * Generate a consistent color based on the input text.
31
- *
32
- * @param text - The input text to generate the color from.
33
- * @return A hexadecimal color string.
34
- */
35
- declare const colorText: (text: string) => string;
36
- /**
37
- * Generate a consistent color based on the input text.
38
- *
39
- * @param text - The input text to generate the color from.
40
- * @return A hexadecimal color string.
41
- */
42
- declare const colorBackground: (text: string) => string;
43
- /**
44
- * Extend a logging function with a specific name, adding a colored badge to the log output.
45
- *
46
- * @param logFn - The original logging function to extend.
47
- * @param name - The name to use for the badge in the log output.
48
- * @returns A new logging function that includes the badge in its output.
49
- */
50
- declare const extendLog: (logFn: LogFn, name: string) => LogFn;
51
- declare type __ΩCreateLogOptions = any[];
52
- //#endregion
53
- export { CreateLogOptions, __ΩCreateLogOptions, colorBackground, colorText, createLog, extendLog, getTextColor };
54
- //# sourceMappingURL=logger.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.cts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA4BiB,gBAAA;EACf,MAAA;EACA,OAAA;EACA,WAAA;EACA,MAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAyEU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
@@ -1,54 +0,0 @@
1
- import { LogFn, WorkspaceConfig } from "../types/config.mjs";
2
- import { LogLevelLabel } from "@storm-software/config-tools/types";
3
-
4
- //#region src/lib/logger.d.ts
5
- interface CreateLogOptions {
6
- source?: string;
7
- command?: string;
8
- environment?: string;
9
- plugin?: string;
10
- logLevel?: LogLevelLabel | null;
11
- customLogger?: LogFn;
12
- colors?: WorkspaceConfig["colors"];
13
- }
14
- /**
15
- * Create a logging function with a specific name and options.
16
- *
17
- * @param name - The name of the logging function.
18
- * @param options - The options to configure the logging function.
19
- * @returns A logging function.
20
- */
21
- declare const createLog: (name: string | null, options?: CreateLogOptions) => LogFn;
22
- /**
23
- * Generate a consistent color based on the input text.
24
- *
25
- * @param text - The input text to generate the color from.
26
- * @return A hexadecimal color string.
27
- */
28
- declare const getTextColor: (text: string) => string;
29
- /**
30
- * Generate a consistent color based on the input text.
31
- *
32
- * @param text - The input text to generate the color from.
33
- * @return A hexadecimal color string.
34
- */
35
- declare const colorText: (text: string) => string;
36
- /**
37
- * Generate a consistent color based on the input text.
38
- *
39
- * @param text - The input text to generate the color from.
40
- * @return A hexadecimal color string.
41
- */
42
- declare const colorBackground: (text: string) => string;
43
- /**
44
- * Extend a logging function with a specific name, adding a colored badge to the log output.
45
- *
46
- * @param logFn - The original logging function to extend.
47
- * @param name - The name to use for the badge in the log output.
48
- * @returns A new logging function that includes the badge in its output.
49
- */
50
- declare const extendLog: (logFn: LogFn, name: string) => LogFn;
51
- declare type __ΩCreateLogOptions = any[];
52
- //#endregion
53
- export { CreateLogOptions, __ΩCreateLogOptions, colorBackground, colorText, createLog, extendLog, getTextColor };
54
- //# sourceMappingURL=logger.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.mts","names":[],"sources":["../../src/lib/logger.ts"],"mappings":";;;;UA4BiB,gBAAA;EACf,MAAA;EACA,OAAA;EACA,WAAA;EACA,MAAA;EACA,QAAA,GAAW,aAAA;EACX,YAAA,GAAe,KAAA;EACf,MAAA,GAAS,eAAA;AAAA;;;;;;;;cAUE,SAAA,GACX,IAAA,iBACA,OAAA,GAAS,gBAAA,KACR,KAAA;;;;;;;cAyEU,YAAA,GAAgB,IAAA;;;;;;;cAiBhB,SAAA,GAAa,IAAA;;;AAjB1B;;;;cA6Ba,eAAA,GAAmB,IAAA;AAZhC;;;;;AAYA;;AAZA,cAyBa,SAAA,GAAa,KAAA,EAAO,KAAA,EAAO,IAAA,aAAe,KAAA;AAAA"}
@@ -1,94 +0,0 @@
1
- import { DEFAULT_ENVIRONMENT } from "../constants/environments.mjs";
2
- import { getLogFn, getLogLevel } from "@storm-software/config-tools/logger";
3
- import { LogLevelLabel } from "@storm-software/config-tools/types";
4
- import { getColor } from "@storm-software/config-tools/utilities/colors";
5
- import { noop } from "@stryke/helpers/noop";
6
- import { kebabCase } from "@stryke/string-format/kebab-case";
7
- import { titleCase } from "@stryke/string-format/title-case";
8
- import chalk from "chalk";
9
-
10
- //#region src/lib/logger.ts
11
- /**
12
- * Create a logging function with a specific name and options.
13
- *
14
- * @param name - The name of the logging function.
15
- * @param options - The options to configure the logging function.
16
- * @returns A logging function.
17
- */
18
- const createLog = (name, options = {}) => {
19
- const logLevel = options.logLevel === null ? LogLevelLabel.SILENT : options.logLevel || LogLevelLabel.INFO;
20
- if (logLevel === LogLevelLabel.SILENT) return noop;
21
- if (options.customLogger) return options.customLogger;
22
- const source = options.plugin || options.source;
23
- return (type, ...args) => getLogFn(getLogLevel(type), {
24
- ...options,
25
- logLevel
26
- })(`${name ? chalk.bold.hex(getColor("brand", options))(kebabCase(name)) : ""}${options.command ? chalk.hex(getColor("brand", options))(` (${options.command})`) : ""}${name ? chalk.grey(" > ") : ""}${source && (!name || kebabCase(source) !== kebabCase(name)) ? `${chalk.bold.hex(getColor("brand", options))(kebabCase(source))}${chalk.grey(" > ")}` : ""}${options.environment && options.environment !== "default" ? `${chalk.bold.hex(getColor("brand", options))(kebabCase(options.environment))}${chalk.grey(" > ")}` : ""}${args.join(" ")} `.trim());
27
- };
28
- const BADGE_COLORS = [
29
- "#00A0DD",
30
- "#6FCE4E",
31
- "#FBBF24",
32
- "#F43F5E",
33
- "#3B82F6",
34
- "#A855F7",
35
- "#469592",
36
- "#288EDF",
37
- "#D8B4FE",
38
- "#10B981",
39
- "#EF4444",
40
- "#F0EC56",
41
- "#F472B6",
42
- "#22D3EE",
43
- "#EAB308",
44
- "#84CC16",
45
- "#F87171",
46
- "#0EA5E9",
47
- "#D946EF",
48
- "#FACC15",
49
- "#34D399",
50
- "#8B5CF6"
51
- ];
52
- /**
53
- * Generate a consistent color based on the input text.
54
- *
55
- * @param text - The input text to generate the color from.
56
- * @return A hexadecimal color string.
57
- */
58
- const getTextColor = (text) => {
59
- return BADGE_COLORS[text.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0];
60
- };
61
- /**
62
- * Generate a consistent color based on the input text.
63
- *
64
- * @param text - The input text to generate the color from.
65
- * @return A hexadecimal color string.
66
- */
67
- const colorText = (text) => {
68
- const title = titleCase(text);
69
- return chalk.hex(getTextColor(title))(title);
70
- };
71
- /**
72
- * Generate a consistent color based on the input text.
73
- *
74
- * @param text - The input text to generate the color from.
75
- * @return A hexadecimal color string.
76
- */
77
- const colorBackground = (text) => {
78
- const title = titleCase(text);
79
- return chalk.inverse.hex(getTextColor(title))(` ${title} `);
80
- };
81
- /**
82
- * Extend a logging function with a specific name, adding a colored badge to the log output.
83
- *
84
- * @param logFn - The original logging function to extend.
85
- * @param name - The name to use for the badge in the log output.
86
- * @returns A new logging function that includes the badge in its output.
87
- */
88
- const extendLog = (logFn, name) => {
89
- return (type, ...args) => logFn(type, `${colorBackground(name)} ${args.filter(Boolean).map((arg) => String(arg).trim()).join(" ")} `);
90
- };
91
-
92
- //#endregion
93
- export { colorBackground, colorText, createLog, extendLog, getTextColor };
94
- //# sourceMappingURL=logger.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.mjs","names":[],"sources":["../../src/lib/logger.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getLogFn, getLogLevel } from \"@storm-software/config-tools/logger\";\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getColor } from \"@storm-software/config-tools/utilities/colors\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport chalk from \"chalk\";\nimport { DEFAULT_ENVIRONMENT } from \"../constants/environments\";\nimport type { LogFn, WorkspaceConfig } from \"../types\";\n\nexport interface CreateLogOptions {\n source?: string;\n command?: string;\n environment?: string;\n plugin?: string;\n logLevel?: LogLevelLabel | null;\n customLogger?: LogFn;\n colors?: WorkspaceConfig[\"colors\"];\n}\n\n/**\n * Create a logging function with a specific name and options.\n *\n * @param name - The name of the logging function.\n * @param options - The options to configure the logging function.\n * @returns A logging function.\n */\nexport const createLog = (\n name: string | null,\n options: CreateLogOptions = {}\n): LogFn => {\n const logLevel =\n options.logLevel === null\n ? LogLevelLabel.SILENT\n : options.logLevel || LogLevelLabel.INFO;\n if (logLevel === LogLevelLabel.SILENT) {\n return noop;\n }\n\n if (options.customLogger) {\n return options.customLogger;\n }\n\n const source = options.plugin || options.source;\n\n return (type: LogLevelLabel, ...args: string[]) =>\n getLogFn(getLogLevel(type), {\n ...options,\n logLevel\n })(\n `${\n name ? chalk.bold.hex(getColor(\"brand\", options))(kebabCase(name)) : \"\"\n }${\n options.command\n ? chalk.hex(getColor(\"brand\", options))(` (${options.command})`)\n : \"\"\n }${name ? chalk.grey(\" > \") : \"\"}${\n source && (!name || kebabCase(source) !== kebabCase(name))\n ? `${chalk.bold.hex(getColor(\"brand\", options))(\n kebabCase(source)\n )}${chalk.grey(\" > \")}`\n : \"\"\n }${\n options.environment && options.environment !== DEFAULT_ENVIRONMENT\n ? `${chalk.bold.hex(getColor(\"brand\", options))(\n kebabCase(options.environment)\n )}${chalk.grey(\" > \")}`\n : \"\"\n }${args.join(\" \")} `.trim()\n );\n};\n\nconst BADGE_COLORS = [\n \"#00A0DD\",\n \"#6FCE4E\",\n \"#FBBF24\",\n \"#F43F5E\",\n \"#3B82F6\",\n \"#A855F7\",\n \"#469592\",\n \"#288EDF\",\n \"#D8B4FE\",\n \"#10B981\",\n \"#EF4444\",\n \"#F0EC56\",\n \"#F472B6\",\n \"#22D3EE\",\n \"#EAB308\",\n \"#84CC16\",\n \"#F87171\",\n \"#0EA5E9\",\n \"#D946EF\",\n \"#FACC15\",\n \"#34D399\",\n \"#8B5CF6\"\n] as const;\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const getTextColor = (text: string): string => {\n return (\n BADGE_COLORS[\n text\n .split(\"\")\n .map(char => char.charCodeAt(0))\n .reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length\n ] || BADGE_COLORS[0]\n );\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorText = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.hex(getTextColor(title))(title);\n};\n\n/**\n * Generate a consistent color based on the input text.\n *\n * @param text - The input text to generate the color from.\n * @return A hexadecimal color string.\n */\nexport const colorBackground = (text: string): string => {\n const title = titleCase(text);\n\n return chalk.inverse.hex(getTextColor(title))(` ${title} `);\n};\n\n/**\n * Extend a logging function with a specific name, adding a colored badge to the log output.\n *\n * @param logFn - The original logging function to extend.\n * @param name - The name to use for the badge in the log output.\n * @returns A new logging function that includes the badge in its output.\n */\nexport const extendLog = (logFn: LogFn, name: string): LogFn => {\n return (type: LogLevelLabel, ...args: string[]) =>\n logFn(\n type,\n `${colorBackground(name)} ${args\n .filter(Boolean)\n .map(arg => String(arg).trim())\n .join(\" \")} `\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA6CA,MAAa,aACX,MACA,UAA4B,EAAE,KACpB;CACV,MAAM,WACJ,QAAQ,aAAa,OACjB,cAAc,SACd,QAAQ,YAAY,cAAc;AACxC,KAAI,aAAa,cAAc,OAC7B,QAAO;AAGT,KAAI,QAAQ,aACV,QAAO,QAAQ;CAGjB,MAAM,SAAS,QAAQ,UAAU,QAAQ;AAEzC,SAAQ,MAAqB,GAAG,SAC9B,SAAS,YAAY,KAAK,EAAE;EAC1B,GAAG;EACH;EACD,CAAC,CACA,GACE,OAAO,MAAM,KAAK,IAAI,SAAS,SAAS,QAAQ,CAAC,CAAC,UAAU,KAAK,CAAC,GAAG,KAErE,QAAQ,UACJ,MAAM,IAAI,SAAS,SAAS,QAAQ,CAAC,CAAC,KAAK,QAAQ,QAAQ,GAAG,GAC9D,KACH,OAAO,MAAM,KAAK,MAAM,GAAG,KAC5B,WAAW,CAAC,QAAQ,UAAU,OAAO,KAAK,UAAU,KAAK,IACrD,GAAG,MAAM,KAAK,IAAI,SAAS,SAAS,QAAQ,CAAC,CAC3C,UAAU,OAAO,CAClB,GAAG,MAAM,KAAK,MAAM,KACrB,KAEJ,QAAQ,eAAe,QAAQ,4BAC3B,GAAG,MAAM,KAAK,IAAI,SAAS,SAAS,QAAQ,CAAC,CAC3C,UAAU,QAAQ,YAAY,CAC/B,GAAG,MAAM,KAAK,MAAM,KACrB,KACH,KAAK,KAAK,IAAI,CAAC,GAAG,MAAM,CAC5B;;AAGL,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;AAQD,MAAa,gBAAgB,SAAyB;AACpD,QACE,aACE,KACG,MAAM,GAAG,CACT,KAAI,SAAQ,KAAK,WAAW,EAAE,CAAC,CAC/B,QAAQ,KAAK,aAAa,MAAM,UAAU,EAAE,GAAG,aAAa,WAC5D,aAAa;;;;;;;;AAUtB,MAAa,aAAa,SAAyB;CACjD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,IAAI,aAAa,MAAM,CAAC,CAAC,MAAM;;;;;;;;AAS9C,MAAa,mBAAmB,SAAyB;CACvD,MAAM,QAAQ,UAAU,KAAK;AAE7B,QAAO,MAAM,QAAQ,IAAI,aAAa,MAAM,CAAC,CAAC,IAAI,MAAM,GAAG;;;;;;;;;AAU7D,MAAa,aAAa,OAAc,SAAwB;AAC9D,SAAQ,MAAqB,GAAG,SAC9B,MACE,MACA,GAAG,gBAAgB,KAAK,CAAC,GAAG,KACzB,OAAO,QAAQ,CACf,KAAI,QAAO,OAAO,IAAI,CAAC,MAAM,CAAC,CAC9B,KAAK,IAAI,CAAC,GACd"}