@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.
- package/README.md +1 -1
- package/bin/config.cjs +14795 -283
- package/bin/config.js +14806 -266
- package/dist/chunk-2MY3KGBB.cjs +70 -0
- package/dist/chunk-322YBAWX.js +6 -0
- package/dist/chunk-3BGF4LNL.cjs +67 -0
- package/dist/chunk-3OZGKUMC.js +1120 -0
- package/dist/chunk-4CTFS6DM.js +143 -0
- package/dist/chunk-4YA7DJB5.cjs +451 -0
- package/dist/chunk-56RY3KW7.cjs +6 -0
- package/dist/chunk-5LYWI7E7.cjs +49 -0
- package/dist/chunk-5SDU662B.js +274 -0
- package/dist/chunk-5XAQKBRL.js +510 -0
- package/dist/chunk-6JG5O6FD.js +2645 -0
- package/dist/chunk-6R6FJLKT.cjs +84 -0
- package/dist/chunk-6ZPVROB4.js +51 -0
- package/dist/chunk-73C3QB67.js +27 -0
- package/dist/chunk-77YC3XPW.js +9228 -0
- package/dist/chunk-7PDFNXOV.js +67 -0
- package/dist/chunk-B2HXAAFT.cjs +274 -0
- package/dist/chunk-BKJUQIEL.cjs +6 -0
- package/dist/chunk-CHYZZRN6.cjs +165 -0
- package/dist/chunk-CUX3BOLK.cjs +6 -0
- package/dist/chunk-DYTSQ3L3.js +14 -0
- package/dist/chunk-E554LMEP.cjs +28 -0
- package/dist/chunk-FUALBFYR.cjs +247 -0
- package/dist/chunk-FZMUKCM5.js +50 -0
- package/dist/chunk-G62PQROD.cjs +510 -0
- package/dist/chunk-GJDVCWVL.cjs +27 -0
- package/dist/chunk-GZ6SGFYZ.cjs +2645 -0
- package/dist/chunk-HAYTD5F2.js +247 -0
- package/dist/chunk-HBJSM6VU.js +6 -0
- package/dist/chunk-HLB4MOTZ.js +6 -0
- package/dist/chunk-HUMXKKE6.js +765 -0
- package/dist/chunk-HVVHVCVH.js +24 -0
- package/dist/chunk-I2LFMHGF.cjs +14 -0
- package/dist/chunk-I5FJ2QOS.js +84 -0
- package/dist/chunk-IYMLNFGA.cjs +33 -0
- package/dist/chunk-JN37L7NL.js +33 -0
- package/dist/chunk-JVONSFJS.cjs +765 -0
- package/dist/chunk-KN7POPML.cjs +21 -0
- package/dist/chunk-KONO4OMT.cjs +9231 -0
- package/dist/chunk-KQLERSRE.js +93 -0
- package/dist/chunk-KXHNOCVY.cjs +24 -0
- package/dist/chunk-LAIQ2Z5B.cjs +93 -0
- package/dist/chunk-LUQRLSMI.js +6 -0
- package/dist/chunk-M3KQNO7N.cjs +93 -0
- package/dist/chunk-MJL6D7T3.js +28 -0
- package/dist/chunk-MKB5GTL4.js +451 -0
- package/dist/chunk-MMMRCNC6.js +77 -0
- package/dist/chunk-NERZUU47.js +93 -0
- package/dist/chunk-NVXMXDZM.js +70 -0
- package/dist/chunk-NWFS53UA.js +21 -0
- package/dist/chunk-PBEGXSGU.js +165 -0
- package/dist/chunk-PMRCDW2Q.cjs +44 -0
- package/dist/chunk-RDWCJD4I.cjs +30 -0
- package/dist/chunk-RN5XBSCX.cjs +77 -0
- package/dist/chunk-TJ7RSPG3.cjs +6 -0
- package/dist/chunk-US52HP52.cjs +143 -0
- package/dist/chunk-UXYX4UF4.cjs +50 -0
- package/dist/chunk-W7YJIINP.js +49 -0
- package/dist/chunk-WTHXS4H2.js +44 -0
- package/dist/chunk-X3T2GC65.cjs +51 -0
- package/dist/chunk-XUGBUGHC.cjs +1120 -0
- package/dist/chunk-YO6XHACG.js +30 -0
- package/dist/config-file/get-config-file.cjs +26 -66
- package/dist/config-file/get-config-file.js +25 -65
- package/dist/config-file/index.cjs +31 -1
- package/dist/config-file/index.js +31 -1
- package/dist/create-storm-config.cjs +30 -68
- package/dist/create-storm-config.js +29 -67
- package/dist/env/get-env.cjs +8 -152
- package/dist/env/get-env.js +7 -151
- package/dist/env/index.cjs +19 -2
- package/dist/env/index.js +19 -2
- package/dist/env/set-env.cjs +8 -259
- package/dist/env/set-env.js +7 -258
- package/dist/esm-HKV66HQZ.js +1716 -0
- package/dist/esm-TZUWSATN.cjs +1716 -0
- package/dist/get-config.cjs +29 -9
- package/dist/get-config.js +29 -9
- package/dist/index.cjs +180 -7
- package/dist/index.js +180 -7
- package/dist/json5-NI4CISQP.cjs +10 -0
- package/dist/json5-XMK3UBET.js +10 -0
- package/dist/jsonc-GYGN4BMZ.js +15 -0
- package/dist/jsonc-TDL6NXBV.cjs +15 -0
- package/dist/logger/chalk.cjs +4 -30
- package/dist/logger/chalk.js +3 -29
- package/dist/logger/console-icons.cjs +5 -15
- package/dist/logger/console-icons.js +5 -15
- package/dist/logger/console.cjs +37 -125
- package/dist/logger/console.js +23 -111
- package/dist/logger/create-logger.cjs +15 -31
- package/dist/logger/create-logger.js +14 -30
- package/dist/logger/format-timestamp.cjs +3 -5
- package/dist/logger/format-timestamp.js +3 -5
- package/dist/logger/get-log-level.cjs +6 -56
- package/dist/logger/get-log-level.js +6 -56
- package/dist/logger/index.cjs +61 -7
- package/dist/logger/index.js +61 -7
- package/dist/logger/is-unicode-supported.cjs +4 -16
- package/dist/logger/is-unicode-supported.js +3 -15
- package/dist/toml-5NX5FGDD.cjs +10 -0
- package/dist/toml-ZYXFVZLI.js +10 -0
- package/dist/types.cjs +6 -24
- package/dist/types.js +5 -23
- package/dist/utilities/apply-workspace-tokens.cjs +9 -55
- package/dist/utilities/apply-workspace-tokens.js +8 -54
- package/dist/utilities/correct-paths.cjs +33 -242
- package/dist/utilities/correct-paths.js +16 -225
- package/dist/utilities/file-path-utils.cjs +5 -18
- package/dist/utilities/file-path-utils.js +4 -17
- package/dist/utilities/find-up.cjs +4 -22
- package/dist/utilities/find-up.js +3 -21
- package/dist/utilities/find-workspace-root.cjs +7 -64
- package/dist/utilities/find-workspace-root.js +6 -63
- package/dist/utilities/get-default-config.cjs +7 -79
- package/dist/utilities/get-default-config.js +7 -79
- package/dist/utilities/index.cjs +84 -7
- package/dist/utilities/index.js +84 -7
- package/dist/utilities/process-handler.cjs +16 -35
- package/dist/utilities/process-handler.js +16 -35
- package/dist/utilities/run.cjs +6 -34
- package/dist/utilities/run.js +5 -33
- package/dist/yaml-GRT7ORXT.cjs +10 -0
- package/dist/yaml-WD4DF2QH.js +10 -0
- package/package.json +7 -4
- package/dist/chunk-SHUYVCID.js +0 -6
- package/dist/chunk-USNT2KNT.cjs +0 -6
package/dist/logger/console.cjs
CHANGED
|
@@ -1,125 +1,37 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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;
|
package/dist/logger/console.js
CHANGED
|
@@ -1,115 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
4
|
-
|
|
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
|
-
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
|
|
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
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.getLogLevel = _chunk2MY3KGBBcjs.getLogLevel; exports.getLogLevelLabel = _chunk2MY3KGBBcjs.getLogLevelLabel; exports.isVerbose = _chunk2MY3KGBBcjs.isVerbose;
|
|
@@ -1,60 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
package/dist/logger/index.cjs
CHANGED
|
@@ -1,7 +1,61 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|