@storm-software/config-tools 1.150.5 → 1.150.9

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 (130) hide show
  1. package/README.md +1 -1
  2. package/bin/config.cjs +14795 -283
  3. package/bin/config.js +14806 -266
  4. package/dist/chunk-2MY3KGBB.cjs +70 -0
  5. package/dist/chunk-322YBAWX.js +6 -0
  6. package/dist/chunk-3BGF4LNL.cjs +67 -0
  7. package/dist/chunk-3OZGKUMC.js +1120 -0
  8. package/dist/chunk-4CTFS6DM.js +143 -0
  9. package/dist/chunk-4YA7DJB5.cjs +451 -0
  10. package/dist/chunk-56RY3KW7.cjs +6 -0
  11. package/dist/chunk-5LYWI7E7.cjs +49 -0
  12. package/dist/chunk-5SDU662B.js +274 -0
  13. package/dist/chunk-5XAQKBRL.js +510 -0
  14. package/dist/chunk-6JG5O6FD.js +2645 -0
  15. package/dist/chunk-6R6FJLKT.cjs +84 -0
  16. package/dist/chunk-6ZPVROB4.js +51 -0
  17. package/dist/chunk-73C3QB67.js +27 -0
  18. package/dist/chunk-77YC3XPW.js +9228 -0
  19. package/dist/chunk-7PDFNXOV.js +67 -0
  20. package/dist/chunk-B2HXAAFT.cjs +274 -0
  21. package/dist/chunk-BKJUQIEL.cjs +6 -0
  22. package/dist/chunk-CHYZZRN6.cjs +165 -0
  23. package/dist/chunk-CUX3BOLK.cjs +6 -0
  24. package/dist/chunk-DYTSQ3L3.js +14 -0
  25. package/dist/chunk-E554LMEP.cjs +28 -0
  26. package/dist/chunk-FUALBFYR.cjs +247 -0
  27. package/dist/chunk-FZMUKCM5.js +50 -0
  28. package/dist/chunk-G62PQROD.cjs +510 -0
  29. package/dist/chunk-GJDVCWVL.cjs +27 -0
  30. package/dist/chunk-GZ6SGFYZ.cjs +2645 -0
  31. package/dist/chunk-HAYTD5F2.js +247 -0
  32. package/dist/chunk-HBJSM6VU.js +6 -0
  33. package/dist/chunk-HLB4MOTZ.js +6 -0
  34. package/dist/chunk-HUMXKKE6.js +765 -0
  35. package/dist/chunk-HVVHVCVH.js +24 -0
  36. package/dist/chunk-I2LFMHGF.cjs +14 -0
  37. package/dist/chunk-I5FJ2QOS.js +84 -0
  38. package/dist/chunk-IYMLNFGA.cjs +33 -0
  39. package/dist/chunk-JN37L7NL.js +33 -0
  40. package/dist/chunk-JVONSFJS.cjs +765 -0
  41. package/dist/chunk-KN7POPML.cjs +21 -0
  42. package/dist/chunk-KONO4OMT.cjs +9231 -0
  43. package/dist/chunk-KQLERSRE.js +93 -0
  44. package/dist/chunk-KXHNOCVY.cjs +24 -0
  45. package/dist/chunk-LAIQ2Z5B.cjs +93 -0
  46. package/dist/chunk-LUQRLSMI.js +6 -0
  47. package/dist/chunk-M3KQNO7N.cjs +93 -0
  48. package/dist/chunk-MJL6D7T3.js +28 -0
  49. package/dist/chunk-MKB5GTL4.js +451 -0
  50. package/dist/chunk-MMMRCNC6.js +77 -0
  51. package/dist/chunk-NERZUU47.js +93 -0
  52. package/dist/chunk-NVXMXDZM.js +70 -0
  53. package/dist/chunk-NWFS53UA.js +21 -0
  54. package/dist/chunk-PBEGXSGU.js +165 -0
  55. package/dist/chunk-PMRCDW2Q.cjs +44 -0
  56. package/dist/chunk-RDWCJD4I.cjs +30 -0
  57. package/dist/chunk-RN5XBSCX.cjs +77 -0
  58. package/dist/chunk-TJ7RSPG3.cjs +6 -0
  59. package/dist/chunk-US52HP52.cjs +143 -0
  60. package/dist/chunk-UXYX4UF4.cjs +50 -0
  61. package/dist/chunk-W7YJIINP.js +49 -0
  62. package/dist/chunk-WTHXS4H2.js +44 -0
  63. package/dist/chunk-X3T2GC65.cjs +51 -0
  64. package/dist/chunk-XUGBUGHC.cjs +1120 -0
  65. package/dist/chunk-YO6XHACG.js +30 -0
  66. package/dist/config-file/get-config-file.cjs +26 -66
  67. package/dist/config-file/get-config-file.js +25 -65
  68. package/dist/config-file/index.cjs +31 -1
  69. package/dist/config-file/index.js +31 -1
  70. package/dist/create-storm-config.cjs +30 -68
  71. package/dist/create-storm-config.js +29 -67
  72. package/dist/env/get-env.cjs +8 -152
  73. package/dist/env/get-env.js +7 -151
  74. package/dist/env/index.cjs +19 -2
  75. package/dist/env/index.js +19 -2
  76. package/dist/env/set-env.cjs +8 -259
  77. package/dist/env/set-env.js +7 -258
  78. package/dist/esm-HKV66HQZ.js +1716 -0
  79. package/dist/esm-TZUWSATN.cjs +1716 -0
  80. package/dist/get-config.cjs +29 -9
  81. package/dist/get-config.js +29 -9
  82. package/dist/index.cjs +180 -7
  83. package/dist/index.js +180 -7
  84. package/dist/json5-NI4CISQP.cjs +10 -0
  85. package/dist/json5-XMK3UBET.js +10 -0
  86. package/dist/jsonc-GYGN4BMZ.js +15 -0
  87. package/dist/jsonc-TDL6NXBV.cjs +15 -0
  88. package/dist/logger/chalk.cjs +4 -30
  89. package/dist/logger/chalk.js +3 -29
  90. package/dist/logger/console-icons.cjs +5 -15
  91. package/dist/logger/console-icons.js +5 -15
  92. package/dist/logger/console.cjs +37 -125
  93. package/dist/logger/console.js +23 -111
  94. package/dist/logger/create-logger.cjs +15 -31
  95. package/dist/logger/create-logger.js +14 -30
  96. package/dist/logger/format-timestamp.cjs +3 -5
  97. package/dist/logger/format-timestamp.js +3 -5
  98. package/dist/logger/get-log-level.cjs +6 -56
  99. package/dist/logger/get-log-level.js +6 -56
  100. package/dist/logger/index.cjs +61 -7
  101. package/dist/logger/index.js +61 -7
  102. package/dist/logger/is-unicode-supported.cjs +4 -16
  103. package/dist/logger/is-unicode-supported.js +3 -15
  104. package/dist/toml-5NX5FGDD.cjs +10 -0
  105. package/dist/toml-ZYXFVZLI.js +10 -0
  106. package/dist/types.cjs +6 -24
  107. package/dist/types.js +5 -23
  108. package/dist/utilities/apply-workspace-tokens.cjs +9 -55
  109. package/dist/utilities/apply-workspace-tokens.js +8 -54
  110. package/dist/utilities/correct-paths.cjs +33 -242
  111. package/dist/utilities/correct-paths.js +16 -225
  112. package/dist/utilities/file-path-utils.cjs +5 -18
  113. package/dist/utilities/file-path-utils.js +4 -17
  114. package/dist/utilities/find-up.cjs +4 -22
  115. package/dist/utilities/find-up.js +3 -21
  116. package/dist/utilities/find-workspace-root.cjs +7 -64
  117. package/dist/utilities/find-workspace-root.js +6 -63
  118. package/dist/utilities/get-default-config.cjs +7 -79
  119. package/dist/utilities/get-default-config.js +7 -79
  120. package/dist/utilities/index.cjs +84 -7
  121. package/dist/utilities/index.js +84 -7
  122. package/dist/utilities/process-handler.cjs +16 -35
  123. package/dist/utilities/process-handler.js +16 -35
  124. package/dist/utilities/run.cjs +6 -34
  125. package/dist/utilities/run.js +5 -33
  126. package/dist/yaml-GRT7ORXT.cjs +10 -0
  127. package/dist/yaml-WD4DF2QH.js +10 -0
  128. package/package.json +7 -4
  129. package/dist/chunk-SHUYVCID.js +0 -6
  130. package/dist/chunk-USNT2KNT.cjs +0 -6
@@ -1,125 +1,37 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
- var _types = require('../types');
5
- var _getdefaultconfig = require('../utilities/get-default-config');
6
- var _chalk2 = require('./chalk');
7
- var _consoleicons = require('./console-icons');
8
- var _formattimestamp = require('./format-timestamp');
9
- var _getloglevel = require('./get-log-level');
10
- const getLogFn = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel = _types.LogLevel.INFO, config = {}, _chalk = _chalk2.getChalk.call(void 0, )) => {
11
- const colors = !_optionalChain([config, 'access', _2 => _2.colors, 'optionalAccess', _3 => _3.dark]) && !_optionalChain([config, 'access', _4 => _4.colors, 'optionalAccess', _5 => _5["base"]]) && !_optionalChain([config, 'access', _6 => _6.colors, 'optionalAccess', _7 => _7["base"], 'optionalAccess', _8 => _8.dark]) ? _getdefaultconfig.DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _9 => _9.colors, 'optionalAccess', _10 => _10.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12["base"], 'optionalAccess', _13 => _13.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _14 => _14.colors, 'optionalAccess', _15 => _15["base"]]) ? _optionalChain([config, 'access', _16 => _16.colors, 'optionalAccess', _17 => _17["base"]]) : _getdefaultconfig.DEFAULT_COLOR_CONFIG;
12
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || _types.LogLevelLabel.INFO;
13
- if (logLevel > _getloglevel.getLogLevel.call(void 0, configLogLevel) || logLevel <= _types.LogLevel.SILENT || _getloglevel.getLogLevel.call(void 0, configLogLevel) <= _types.LogLevel.SILENT) {
14
- return (_) => {
15
- };
16
- }
17
- if (typeof logLevel === "number" && _types.LogLevel.FATAL >= logLevel) {
18
- return (message) => {
19
- console.error(`
20
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
21
- `);
22
- };
23
- }
24
- if (typeof logLevel === "number" && _types.LogLevel.ERROR >= logLevel) {
25
- return (message) => {
26
- console.error(`
27
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
28
- `);
29
- };
30
- }
31
- if (typeof logLevel === "number" && _types.LogLevel.WARN >= logLevel) {
32
- return (message) => {
33
- console.warn(`
34
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
35
- `);
36
- };
37
- }
38
- if (typeof logLevel === "number" && _types.LogLevel.SUCCESS >= logLevel) {
39
- return (message) => {
40
- console.info(`
41
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
42
- `);
43
- };
44
- }
45
- if (typeof logLevel === "number" && _types.LogLevel.INFO >= logLevel) {
46
- return (message) => {
47
- console.info(`
48
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
49
- `);
50
- };
51
- }
52
- if (typeof logLevel === "number" && _types.LogLevel.DEBUG >= logLevel) {
53
- return (message) => {
54
- console.debug(`
55
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
56
- `);
57
- };
58
- }
59
- if (typeof logLevel === "number" && _types.LogLevel.TRACE >= logLevel) {
60
- return (message) => {
61
- console.debug(`
62
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
63
- `);
64
- };
65
- }
66
- return (message) => {
67
- console.log(`
68
- ${_chalk.gray(_formattimestamp.formatTimestamp.call(void 0, ))} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${_consoleicons.CONSOLE_ICONS[_types.LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
69
- `);
70
- };
71
- }, "getLogFn");
72
- const writeFatal = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.FATAL, config)(message), "writeFatal");
73
- const writeError = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.ERROR, config)(message), "writeError");
74
- const writeWarning = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.WARN, config)(message), "writeWarning");
75
- const writeInfo = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.INFO, config)(message), "writeInfo");
76
- const writeSuccess = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.SUCCESS, config)(message), "writeSuccess");
77
- const writeDebug = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.DEBUG, config)(message), "writeDebug");
78
- const writeTrace = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.TRACE, config)(message), "writeTrace");
79
- const writeSystem = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, config) => getLogFn(_types.LogLevel.ALL, config)(message), "writeSystem");
80
- const getStopwatch = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (name) => {
81
- const start = process.hrtime();
82
- return () => {
83
- const end = process.hrtime(start);
84
- console.info(`
85
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
86
- `);
87
- };
88
- }, "getStopwatch");
89
- const MAX_DEPTH = 4;
90
- const formatLogMessage = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (message, options = {}, depth = 0) => {
91
- if (depth > MAX_DEPTH) {
92
- return "<max depth>";
93
- }
94
- const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
95
- const skip = _nullishCoalesce(options.skip, () => ( []));
96
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
97
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
98
- prefix: `${prefix}-`,
99
- skip
100
- }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
101
- ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
102
- prefix: `${prefix}-`,
103
- skip
104
- }, depth + 1) : message[key]}`).join("\n")}` : message;
105
- }, "formatLogMessage");
106
- const _isFunction = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (value) => {
107
- try {
108
- return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _18 => _18.constructor]) && _optionalChain([value, 'optionalAccess', _19 => _19.call]) && _optionalChain([value, 'optionalAccess', _20 => _20.apply]));
109
- } catch (e) {
110
- return false;
111
- }
112
- }, "_isFunction");
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
- exports.formatLogMessage = formatLogMessage; exports.getLogFn = getLogFn; exports.getStopwatch = getStopwatch; exports.writeDebug = writeDebug; exports.writeError = writeError; exports.writeFatal = writeFatal; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeSystem = writeSystem; exports.writeTrace = writeTrace; exports.writeWarning = writeWarning;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ var _chunkUS52HP52cjs = require('../chunk-US52HP52.cjs');
14
+ require('../chunk-M3KQNO7N.cjs');
15
+ require('../chunk-RN5XBSCX.cjs');
16
+ require('../chunk-RDWCJD4I.cjs');
17
+ require('../chunk-GZ6SGFYZ.cjs');
18
+ require('../chunk-E554LMEP.cjs');
19
+ require('../chunk-KXHNOCVY.cjs');
20
+ require('../chunk-I2LFMHGF.cjs');
21
+ require('../chunk-FUALBFYR.cjs');
22
+ require('../chunk-2MY3KGBB.cjs');
23
+ require('../chunk-IYMLNFGA.cjs');
24
+ require('../chunk-5LYWI7E7.cjs');
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ exports.formatLogMessage = _chunkUS52HP52cjs.formatLogMessage; exports.getLogFn = _chunkUS52HP52cjs.getLogFn; exports.getStopwatch = _chunkUS52HP52cjs.getStopwatch; exports.writeDebug = _chunkUS52HP52cjs.writeDebug; exports.writeError = _chunkUS52HP52cjs.writeError; exports.writeFatal = _chunkUS52HP52cjs.writeFatal; exports.writeInfo = _chunkUS52HP52cjs.writeInfo; exports.writeSuccess = _chunkUS52HP52cjs.writeSuccess; exports.writeSystem = _chunkUS52HP52cjs.writeSystem; exports.writeTrace = _chunkUS52HP52cjs.writeTrace; exports.writeWarning = _chunkUS52HP52cjs.writeWarning;
@@ -1,115 +1,27 @@
1
1
  import {
2
- __name
3
- } from "../chunk-SHUYVCID.js";
4
- import { LogLevel, LogLevelLabel } from "../types";
5
- import { DEFAULT_COLOR_CONFIG } from "../utilities/get-default-config";
6
- import { getChalk } from "./chalk";
7
- import { CONSOLE_ICONS } from "./console-icons";
8
- import { formatTimestamp } from "./format-timestamp";
9
- import { getLogLevel } from "./get-log-level";
10
- const getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
11
- const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
12
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
13
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
14
- return (_) => {
15
- };
16
- }
17
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
18
- return (message) => {
19
- console.error(`
20
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
21
- `);
22
- };
23
- }
24
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
25
- return (message) => {
26
- console.error(`
27
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
28
- `);
29
- };
30
- }
31
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
32
- return (message) => {
33
- console.warn(`
34
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
35
- `);
36
- };
37
- }
38
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
39
- return (message) => {
40
- console.info(`
41
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
42
- `);
43
- };
44
- }
45
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
46
- return (message) => {
47
- console.info(`
48
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
49
- `);
50
- };
51
- }
52
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
53
- return (message) => {
54
- console.debug(`
55
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
56
- `);
57
- };
58
- }
59
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
60
- return (message) => {
61
- console.debug(`
62
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
63
- `);
64
- };
65
- }
66
- return (message) => {
67
- console.log(`
68
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
69
- `);
70
- };
71
- }, "getLogFn");
72
- const writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
73
- const writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
74
- const writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
75
- const writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
76
- const writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
77
- const writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
78
- const writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
79
- const writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
80
- const getStopwatch = /* @__PURE__ */ __name((name) => {
81
- const start = process.hrtime();
82
- return () => {
83
- const end = process.hrtime(start);
84
- console.info(`
85
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
86
- `);
87
- };
88
- }, "getStopwatch");
89
- const MAX_DEPTH = 4;
90
- const formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth = 0) => {
91
- if (depth > MAX_DEPTH) {
92
- return "<max depth>";
93
- }
94
- const prefix = options.prefix ?? "-";
95
- const skip = options.skip ?? [];
96
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
97
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
98
- prefix: `${prefix}-`,
99
- skip
100
- }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
101
- ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
102
- prefix: `${prefix}-`,
103
- skip
104
- }, depth + 1) : message[key]}`).join("\n")}` : message;
105
- }, "formatLogMessage");
106
- const _isFunction = /* @__PURE__ */ __name((value) => {
107
- try {
108
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
109
- } catch (e) {
110
- return false;
111
- }
112
- }, "_isFunction");
2
+ formatLogMessage,
3
+ getLogFn,
4
+ getStopwatch,
5
+ writeDebug,
6
+ writeError,
7
+ writeFatal,
8
+ writeInfo,
9
+ writeSuccess,
10
+ writeSystem,
11
+ writeTrace,
12
+ writeWarning
13
+ } from "../chunk-4CTFS6DM.js";
14
+ import "../chunk-KQLERSRE.js";
15
+ import "../chunk-MMMRCNC6.js";
16
+ import "../chunk-YO6XHACG.js";
17
+ import "../chunk-6JG5O6FD.js";
18
+ import "../chunk-MJL6D7T3.js";
19
+ import "../chunk-HVVHVCVH.js";
20
+ import "../chunk-DYTSQ3L3.js";
21
+ import "../chunk-HAYTD5F2.js";
22
+ import "../chunk-NVXMXDZM.js";
23
+ import "../chunk-JN37L7NL.js";
24
+ import "../chunk-W7YJIINP.js";
113
25
  export {
114
26
  formatLogMessage,
115
27
  getLogFn,
@@ -1,34 +1,18 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
- var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
5
- var _types = require('../types');
6
- var _findworkspaceroot = require('../utilities/find-workspace-root');
7
- var _console = require('./console');
8
- async function createLogger(config) {
9
- const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, );
10
- if (!workspaceRoot) {
11
- throw new Error("Cannot find workspace root");
12
- }
13
- const writeFatal = _console.getLogFn.call(void 0, _types.LogLevel.FATAL, config, _chalk2.default);
14
- const writeError = _console.getLogFn.call(void 0, _types.LogLevel.ERROR, config, _chalk2.default);
15
- const writeWarning = _console.getLogFn.call(void 0, _types.LogLevel.WARN, config, _chalk2.default);
16
- const writeInfo = _console.getLogFn.call(void 0, _types.LogLevel.INFO, config, _chalk2.default);
17
- const writeSuccess = _console.getLogFn.call(void 0, _types.LogLevel.SUCCESS, config, _chalk2.default);
18
- const writeDebug = _console.getLogFn.call(void 0, _types.LogLevel.DEBUG, config, _chalk2.default);
19
- const writeTrace = _console.getLogFn.call(void 0, _types.LogLevel.DEBUG, config, _chalk2.default);
20
- return {
21
- fatal: writeFatal,
22
- error: writeError,
23
- warning: writeWarning,
24
- info: writeInfo,
25
- success: writeSuccess,
26
- debug: writeDebug,
27
- trace: writeTrace,
28
- getStopwatch: _console.getStopwatch
29
- };
30
- }
31
- _chunkUSNT2KNTcjs.__name.call(void 0, createLogger, "createLogger");
3
+ var _chunkUXYX4UF4cjs = require('../chunk-UXYX4UF4.cjs');
4
+ require('../chunk-US52HP52.cjs');
5
+ require('../chunk-M3KQNO7N.cjs');
6
+ require('../chunk-RN5XBSCX.cjs');
7
+ require('../chunk-RDWCJD4I.cjs');
8
+ require('../chunk-GZ6SGFYZ.cjs');
9
+ require('../chunk-E554LMEP.cjs');
10
+ require('../chunk-KXHNOCVY.cjs');
11
+ require('../chunk-I2LFMHGF.cjs');
12
+ require('../chunk-FUALBFYR.cjs');
13
+ require('../chunk-2MY3KGBB.cjs');
14
+ require('../chunk-IYMLNFGA.cjs');
15
+ require('../chunk-5LYWI7E7.cjs');
32
16
 
33
17
 
34
- exports.createLogger = createLogger;
18
+ exports.createLogger = _chunkUXYX4UF4cjs.createLogger;
@@ -1,34 +1,18 @@
1
1
  import {
2
- __name
3
- } from "../chunk-SHUYVCID.js";
4
- import chalk from "chalk";
5
- import { LogLevel } from "../types";
6
- import { findWorkspaceRoot } from "../utilities/find-workspace-root";
7
- import { getLogFn, getStopwatch } from "./console";
8
- async function createLogger(config) {
9
- const workspaceRoot = findWorkspaceRoot();
10
- if (!workspaceRoot) {
11
- throw new Error("Cannot find workspace root");
12
- }
13
- const writeFatal = getLogFn(LogLevel.FATAL, config, chalk);
14
- const writeError = getLogFn(LogLevel.ERROR, config, chalk);
15
- const writeWarning = getLogFn(LogLevel.WARN, config, chalk);
16
- const writeInfo = getLogFn(LogLevel.INFO, config, chalk);
17
- const writeSuccess = getLogFn(LogLevel.SUCCESS, config, chalk);
18
- const writeDebug = getLogFn(LogLevel.DEBUG, config, chalk);
19
- const writeTrace = getLogFn(LogLevel.DEBUG, config, chalk);
20
- return {
21
- fatal: writeFatal,
22
- error: writeError,
23
- warning: writeWarning,
24
- info: writeInfo,
25
- success: writeSuccess,
26
- debug: writeDebug,
27
- trace: writeTrace,
28
- getStopwatch
29
- };
30
- }
31
- __name(createLogger, "createLogger");
2
+ createLogger
3
+ } from "../chunk-FZMUKCM5.js";
4
+ import "../chunk-4CTFS6DM.js";
5
+ import "../chunk-KQLERSRE.js";
6
+ import "../chunk-MMMRCNC6.js";
7
+ import "../chunk-YO6XHACG.js";
8
+ import "../chunk-6JG5O6FD.js";
9
+ import "../chunk-MJL6D7T3.js";
10
+ import "../chunk-HVVHVCVH.js";
11
+ import "../chunk-DYTSQ3L3.js";
12
+ import "../chunk-HAYTD5F2.js";
13
+ import "../chunk-NVXMXDZM.js";
14
+ import "../chunk-JN37L7NL.js";
15
+ import "../chunk-W7YJIINP.js";
32
16
  export {
33
17
  createLogger
34
18
  };
@@ -1,9 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
- const formatTimestamp = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (date = /* @__PURE__ */ new Date()) => {
5
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
6
- }, "formatTimestamp");
3
+ var _chunkI2LFMHGFcjs = require('../chunk-I2LFMHGF.cjs');
4
+ require('../chunk-5LYWI7E7.cjs');
7
5
 
8
6
 
9
- exports.formatTimestamp = formatTimestamp;
7
+ exports.formatTimestamp = _chunkI2LFMHGFcjs.formatTimestamp;
@@ -1,9 +1,7 @@
1
1
  import {
2
- __name
3
- } from "../chunk-SHUYVCID.js";
4
- const formatTimestamp = /* @__PURE__ */ __name((date = /* @__PURE__ */ new Date()) => {
5
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
6
- }, "formatTimestamp");
2
+ formatTimestamp
3
+ } from "../chunk-DYTSQ3L3.js";
4
+ import "../chunk-W7YJIINP.js";
7
5
  export {
8
6
  formatTimestamp
9
7
  };
@@ -1,62 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
- var _types = require('../types');
5
- const getLogLevel = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (label) => {
6
- switch (label) {
7
- case "all":
8
- return _types.LogLevel.ALL;
9
- case "trace":
10
- return _types.LogLevel.TRACE;
11
- case "debug":
12
- return _types.LogLevel.DEBUG;
13
- case "info":
14
- return _types.LogLevel.INFO;
15
- case "warn":
16
- return _types.LogLevel.WARN;
17
- case "error":
18
- return _types.LogLevel.ERROR;
19
- case "fatal":
20
- return _types.LogLevel.FATAL;
21
- case "silent":
22
- return _types.LogLevel.SILENT;
23
- default:
24
- return _types.LogLevel.INFO;
25
- }
26
- }, "getLogLevel");
27
- const getLogLevelLabel = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel = _types.LogLevel.INFO) => {
28
- if (logLevel >= _types.LogLevel.ALL) {
29
- return _types.LogLevelLabel.ALL;
30
- }
31
- if (logLevel >= _types.LogLevel.TRACE) {
32
- return _types.LogLevelLabel.TRACE;
33
- }
34
- if (logLevel >= _types.LogLevel.DEBUG) {
35
- return _types.LogLevelLabel.DEBUG;
36
- }
37
- if (logLevel >= _types.LogLevel.INFO) {
38
- return _types.LogLevelLabel.INFO;
39
- }
40
- if (logLevel >= _types.LogLevel.WARN) {
41
- return _types.LogLevelLabel.WARN;
42
- }
43
- if (logLevel >= _types.LogLevel.ERROR) {
44
- return _types.LogLevelLabel.ERROR;
45
- }
46
- if (logLevel >= _types.LogLevel.FATAL) {
47
- return _types.LogLevelLabel.FATAL;
48
- }
49
- if (logLevel <= _types.LogLevel.SILENT) {
50
- return _types.LogLevelLabel.SILENT;
51
- }
52
- return _types.LogLevelLabel.INFO;
53
- }, "getLogLevelLabel");
54
- const isVerbose = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (label = _types.LogLevelLabel.SILENT) => {
55
- const logLevel = typeof label === "string" ? getLogLevel(label) : label;
56
- return logLevel >= _types.LogLevel.DEBUG;
57
- }, "isVerbose");
58
3
 
59
4
 
5
+ var _chunk2MY3KGBBcjs = require('../chunk-2MY3KGBB.cjs');
6
+ require('../chunk-IYMLNFGA.cjs');
7
+ require('../chunk-5LYWI7E7.cjs');
60
8
 
61
9
 
62
- exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose;
10
+
11
+
12
+ exports.getLogLevel = _chunk2MY3KGBBcjs.getLogLevel; exports.getLogLevelLabel = _chunk2MY3KGBBcjs.getLogLevelLabel; exports.isVerbose = _chunk2MY3KGBBcjs.isVerbose;
@@ -1,60 +1,10 @@
1
1
  import {
2
- __name
3
- } from "../chunk-SHUYVCID.js";
4
- import { LogLevel, LogLevelLabel } from "../types";
5
- const getLogLevel = /* @__PURE__ */ __name((label) => {
6
- switch (label) {
7
- case "all":
8
- return LogLevel.ALL;
9
- case "trace":
10
- return LogLevel.TRACE;
11
- case "debug":
12
- return LogLevel.DEBUG;
13
- case "info":
14
- return LogLevel.INFO;
15
- case "warn":
16
- return LogLevel.WARN;
17
- case "error":
18
- return LogLevel.ERROR;
19
- case "fatal":
20
- return LogLevel.FATAL;
21
- case "silent":
22
- return LogLevel.SILENT;
23
- default:
24
- return LogLevel.INFO;
25
- }
26
- }, "getLogLevel");
27
- const getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
28
- if (logLevel >= LogLevel.ALL) {
29
- return LogLevelLabel.ALL;
30
- }
31
- if (logLevel >= LogLevel.TRACE) {
32
- return LogLevelLabel.TRACE;
33
- }
34
- if (logLevel >= LogLevel.DEBUG) {
35
- return LogLevelLabel.DEBUG;
36
- }
37
- if (logLevel >= LogLevel.INFO) {
38
- return LogLevelLabel.INFO;
39
- }
40
- if (logLevel >= LogLevel.WARN) {
41
- return LogLevelLabel.WARN;
42
- }
43
- if (logLevel >= LogLevel.ERROR) {
44
- return LogLevelLabel.ERROR;
45
- }
46
- if (logLevel >= LogLevel.FATAL) {
47
- return LogLevelLabel.FATAL;
48
- }
49
- if (logLevel <= LogLevel.SILENT) {
50
- return LogLevelLabel.SILENT;
51
- }
52
- return LogLevelLabel.INFO;
53
- }, "getLogLevelLabel");
54
- const isVerbose = /* @__PURE__ */ __name((label = LogLevelLabel.SILENT) => {
55
- const logLevel = typeof label === "string" ? getLogLevel(label) : label;
56
- return logLevel >= LogLevel.DEBUG;
57
- }, "isVerbose");
2
+ getLogLevel,
3
+ getLogLevelLabel,
4
+ isVerbose
5
+ } from "../chunk-NVXMXDZM.js";
6
+ import "../chunk-JN37L7NL.js";
7
+ import "../chunk-W7YJIINP.js";
58
8
  export {
59
9
  getLogLevel,
60
10
  getLogLevelLabel,
@@ -1,7 +1,61 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _chalk = require('./chalk'); _createStarExport(_chalk);
2
- var _console = require('./console'); _createStarExport(_console);
3
- var _consoleicons = require('./console-icons'); _createStarExport(_consoleicons);
4
- var _createlogger = require('./create-logger'); _createStarExport(_createlogger);
5
- var _formattimestamp = require('./format-timestamp'); _createStarExport(_formattimestamp);
6
- var _getloglevel = require('./get-log-level'); _createStarExport(_getloglevel);
7
- var _isunicodesupported = require('./is-unicode-supported'); _createStarExport(_isunicodesupported);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-CUX3BOLK.cjs');
2
+
3
+
4
+ var _chunkUXYX4UF4cjs = require('../chunk-UXYX4UF4.cjs');
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkUS52HP52cjs = require('../chunk-US52HP52.cjs');
18
+ require('../chunk-M3KQNO7N.cjs');
19
+ require('../chunk-RN5XBSCX.cjs');
20
+ require('../chunk-RDWCJD4I.cjs');
21
+
22
+
23
+ var _chunkGZ6SGFYZcjs = require('../chunk-GZ6SGFYZ.cjs');
24
+
25
+
26
+ var _chunkE554LMEPcjs = require('../chunk-E554LMEP.cjs');
27
+
28
+
29
+ var _chunkKXHNOCVYcjs = require('../chunk-KXHNOCVY.cjs');
30
+
31
+
32
+ var _chunkI2LFMHGFcjs = require('../chunk-I2LFMHGF.cjs');
33
+ require('../chunk-FUALBFYR.cjs');
34
+
35
+
36
+
37
+
38
+ var _chunk2MY3KGBBcjs = require('../chunk-2MY3KGBB.cjs');
39
+ require('../chunk-IYMLNFGA.cjs');
40
+ require('../chunk-5LYWI7E7.cjs');
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+ exports.CONSOLE_ICONS = _chunkE554LMEPcjs.CONSOLE_ICONS; exports.createLogger = _chunkUXYX4UF4cjs.createLogger; exports.formatLogMessage = _chunkUS52HP52cjs.formatLogMessage; exports.formatTimestamp = _chunkI2LFMHGFcjs.formatTimestamp; exports.getChalk = _chunkGZ6SGFYZcjs.getChalk; exports.getLogFn = _chunkUS52HP52cjs.getLogFn; exports.getLogLevel = _chunk2MY3KGBBcjs.getLogLevel; exports.getLogLevelLabel = _chunk2MY3KGBBcjs.getLogLevelLabel; exports.getStopwatch = _chunkUS52HP52cjs.getStopwatch; exports.isUnicodeSupported = _chunkKXHNOCVYcjs.isUnicodeSupported; exports.isVerbose = _chunk2MY3KGBBcjs.isVerbose; exports.writeDebug = _chunkUS52HP52cjs.writeDebug; exports.writeError = _chunkUS52HP52cjs.writeError; exports.writeFatal = _chunkUS52HP52cjs.writeFatal; exports.writeInfo = _chunkUS52HP52cjs.writeInfo; exports.writeSuccess = _chunkUS52HP52cjs.writeSuccess; exports.writeSystem = _chunkUS52HP52cjs.writeSystem; exports.writeTrace = _chunkUS52HP52cjs.writeTrace; exports.writeWarning = _chunkUS52HP52cjs.writeWarning;