@storm-software/config-tools 1.189.7 → 1.189.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 (42) hide show
  1. package/README.md +1 -1
  2. package/bin/config.cjs +0 -3
  3. package/bin/config.js +0 -3
  4. package/dist/chunk-2YZ5KRRZ.cjs +931 -0
  5. package/dist/{chunk-SBJJ3URW.js → chunk-7XZ53BLB.js} +1 -1
  6. package/dist/{chunk-OZ6NKEEC.cjs → chunk-D7M3EBCK.cjs} +9 -9
  7. package/dist/{chunk-GLYIZSQP.cjs → chunk-FIJZNJOM.cjs} +2 -2
  8. package/dist/{chunk-RVHA3XPD.cjs → chunk-GLF62BIP.cjs} +9 -9
  9. package/dist/{chunk-CSO3LQWV.cjs → chunk-IOQ5VDAA.cjs} +3 -3
  10. package/dist/{chunk-DPDS4CSW.cjs → chunk-Q5Y5FFCH.cjs} +3 -3
  11. package/dist/chunk-SPHE3YEH.js +931 -0
  12. package/dist/{chunk-ZVA3DOGV.js → chunk-T32OBFSH.js} +1 -1
  13. package/dist/{chunk-OGXIFMHW.js → chunk-T4YVVO6G.js} +1 -1
  14. package/dist/{chunk-RSTBLBBG.js → chunk-VOEYKXJ6.js} +2 -2
  15. package/dist/{chunk-RKSFAUGQ.js → chunk-WH6MLTFO.js} +1 -1
  16. package/dist/{chunk-B3OWNYW5.cjs → chunk-Z6KNQQGD.cjs} +10 -10
  17. package/dist/{chunk-ZGGNJYIH.js → chunk-ZFTN72CN.js} +1 -1
  18. package/dist/config-file/get-config-file.cjs +6 -6
  19. package/dist/config-file/get-config-file.js +5 -5
  20. package/dist/config-file/index.cjs +6 -6
  21. package/dist/config-file/index.js +5 -5
  22. package/dist/create-storm-config.cjs +7 -7
  23. package/dist/create-storm-config.js +6 -6
  24. package/dist/get-config.cjs +8 -8
  25. package/dist/get-config.js +7 -7
  26. package/dist/index.cjs +8 -8
  27. package/dist/index.js +7 -7
  28. package/dist/logger/console.cjs +2 -2
  29. package/dist/logger/console.js +1 -1
  30. package/dist/logger/create-logger.cjs +3 -3
  31. package/dist/logger/create-logger.js +2 -2
  32. package/dist/logger/index.cjs +3 -3
  33. package/dist/logger/index.js +2 -2
  34. package/dist/utilities/index.cjs +5 -5
  35. package/dist/utilities/index.js +4 -4
  36. package/dist/utilities/process-handler.cjs +3 -3
  37. package/dist/utilities/process-handler.js +2 -2
  38. package/dist/utilities/toml.cjs +4 -4
  39. package/dist/utilities/toml.js +3 -3
  40. package/package.json +3 -3
  41. package/dist/chunk-4XZCLDX5.cjs +0 -192
  42. package/dist/chunk-QKYARTIV.js +0 -192
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkRVHA3XPDcjs = require('../chunk-RVHA3XPD.cjs');
6
+ var _chunkGLF62BIPcjs = require('../chunk-GLF62BIP.cjs');
7
7
 
8
8
 
9
9
 
@@ -15,7 +15,7 @@ var _chunk6Y623TCScjs = require('../chunk-6Y623TCS.cjs');
15
15
 
16
16
 
17
17
 
18
- var _chunkGLYIZSQPcjs = require('../chunk-GLYIZSQP.cjs');
18
+ var _chunkFIJZNJOMcjs = require('../chunk-FIJZNJOM.cjs');
19
19
 
20
20
 
21
21
 
@@ -36,8 +36,8 @@ var _chunkCFXT4ZAWcjs = require('../chunk-CFXT4ZAW.cjs');
36
36
  var _chunk3CNCDDWZcjs = require('../chunk-3CNCDDWZ.cjs');
37
37
  require('../chunk-NJFLUTGH.cjs');
38
38
  require('../chunk-7PV6L7I7.cjs');
39
- require('../chunk-OZ6NKEEC.cjs');
40
- require('../chunk-4XZCLDX5.cjs');
39
+ require('../chunk-D7M3EBCK.cjs');
40
+ require('../chunk-2YZ5KRRZ.cjs');
41
41
 
42
42
 
43
43
 
@@ -106,4 +106,4 @@ require('../chunk-IRCFHYKZ.cjs');
106
106
 
107
107
 
108
108
 
109
- exports.DEFAULT_COLOR_CONFIG = _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunk6Y623TCScjs.LARGE_BUFFER; exports.applyDefaultConfig = _chunkCFXT4ZAWcjs.applyDefaultConfig; exports.applyWorkspaceBaseTokens = _chunkEMO3BY53cjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunkEMO3BY53cjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunkEMO3BY53cjs.applyWorkspaceTokens; exports.basename = _chunkBDATZ3UBcjs.basename; exports.correctPaths = _chunkBDATZ3UBcjs.correctPaths; exports.dirname = _chunkBDATZ3UBcjs.dirname; exports.exitWithError = _chunkRVHA3XPDcjs.exitWithError; exports.exitWithSuccess = _chunkRVHA3XPDcjs.exitWithSuccess; exports.extname = _chunkBDATZ3UBcjs.extname; exports.findFileName = _chunk2WBD2G3Ecjs.findFileName; exports.findFilePath = _chunk2WBD2G3Ecjs.findFilePath; exports.findWorkspaceRoot = _chunk3CNCDDWZcjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunk3CNCDDWZcjs.findWorkspaceRootSafe; exports.format = _chunkBDATZ3UBcjs.format; exports.getColor = _chunkIKP3QKCZcjs.getColor; exports.getColors = _chunkIKP3QKCZcjs.getColors; exports.getGradient = _chunkIKP3QKCZcjs.getGradient; exports.getPackageJsonConfig = _chunkCFXT4ZAWcjs.getPackageJsonConfig; exports.handleProcess = _chunkRVHA3XPDcjs.handleProcess; exports.isAbsolute = _chunkBDATZ3UBcjs.isAbsolute; exports.joinPaths = _chunkBDATZ3UBcjs.joinPaths; exports.modifyCargoNestedTable = _chunkGLYIZSQPcjs.modifyCargoNestedTable; exports.modifyCargoTable = _chunkGLYIZSQPcjs.modifyCargoTable; exports.normalizeString = _chunkBDATZ3UBcjs.normalizeString; exports.normalizeWindowsPath = _chunkBDATZ3UBcjs.normalizeWindowsPath; exports.parse = _chunkBDATZ3UBcjs.parse; exports.parseCargoToml = _chunkGLYIZSQPcjs.parseCargoToml; exports.parseCargoTomlWithTree = _chunkGLYIZSQPcjs.parseCargoTomlWithTree; exports.relative = _chunkBDATZ3UBcjs.relative; exports.removeExtension = _chunk2WBD2G3Ecjs.removeExtension; exports.resolve = _chunkBDATZ3UBcjs.resolve; exports.run = _chunk6Y623TCScjs.run; exports.runAsync = _chunk6Y623TCScjs.runAsync; exports.sep = _chunkBDATZ3UBcjs.sep; exports.stringifyCargoToml = _chunkGLYIZSQPcjs.stringifyCargoToml; exports.toNamespacedPath = _chunkBDATZ3UBcjs.toNamespacedPath;
109
+ exports.DEFAULT_COLOR_CONFIG = _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunk6Y623TCScjs.LARGE_BUFFER; exports.applyDefaultConfig = _chunkCFXT4ZAWcjs.applyDefaultConfig; exports.applyWorkspaceBaseTokens = _chunkEMO3BY53cjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunkEMO3BY53cjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunkEMO3BY53cjs.applyWorkspaceTokens; exports.basename = _chunkBDATZ3UBcjs.basename; exports.correctPaths = _chunkBDATZ3UBcjs.correctPaths; exports.dirname = _chunkBDATZ3UBcjs.dirname; exports.exitWithError = _chunkGLF62BIPcjs.exitWithError; exports.exitWithSuccess = _chunkGLF62BIPcjs.exitWithSuccess; exports.extname = _chunkBDATZ3UBcjs.extname; exports.findFileName = _chunk2WBD2G3Ecjs.findFileName; exports.findFilePath = _chunk2WBD2G3Ecjs.findFilePath; exports.findWorkspaceRoot = _chunk3CNCDDWZcjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunk3CNCDDWZcjs.findWorkspaceRootSafe; exports.format = _chunkBDATZ3UBcjs.format; exports.getColor = _chunkIKP3QKCZcjs.getColor; exports.getColors = _chunkIKP3QKCZcjs.getColors; exports.getGradient = _chunkIKP3QKCZcjs.getGradient; exports.getPackageJsonConfig = _chunkCFXT4ZAWcjs.getPackageJsonConfig; exports.handleProcess = _chunkGLF62BIPcjs.handleProcess; exports.isAbsolute = _chunkBDATZ3UBcjs.isAbsolute; exports.joinPaths = _chunkBDATZ3UBcjs.joinPaths; exports.modifyCargoNestedTable = _chunkFIJZNJOMcjs.modifyCargoNestedTable; exports.modifyCargoTable = _chunkFIJZNJOMcjs.modifyCargoTable; exports.normalizeString = _chunkBDATZ3UBcjs.normalizeString; exports.normalizeWindowsPath = _chunkBDATZ3UBcjs.normalizeWindowsPath; exports.parse = _chunkBDATZ3UBcjs.parse; exports.parseCargoToml = _chunkFIJZNJOMcjs.parseCargoToml; exports.parseCargoTomlWithTree = _chunkFIJZNJOMcjs.parseCargoTomlWithTree; exports.relative = _chunkBDATZ3UBcjs.relative; exports.removeExtension = _chunk2WBD2G3Ecjs.removeExtension; exports.resolve = _chunkBDATZ3UBcjs.resolve; exports.run = _chunk6Y623TCScjs.run; exports.runAsync = _chunk6Y623TCScjs.runAsync; exports.sep = _chunkBDATZ3UBcjs.sep; exports.stringifyCargoToml = _chunkFIJZNJOMcjs.stringifyCargoToml; exports.toNamespacedPath = _chunkBDATZ3UBcjs.toNamespacedPath;
@@ -3,7 +3,7 @@ import {
3
3
  exitWithError,
4
4
  exitWithSuccess,
5
5
  handleProcess
6
- } from "../chunk-OGXIFMHW.js";
6
+ } from "../chunk-T4YVVO6G.js";
7
7
  import {
8
8
  LARGE_BUFFER,
9
9
  run,
@@ -15,7 +15,7 @@ import {
15
15
  parseCargoToml,
16
16
  parseCargoTomlWithTree,
17
17
  stringifyCargoToml
18
- } from "../chunk-SBJJ3URW.js";
18
+ } from "../chunk-7XZ53BLB.js";
19
19
  import {
20
20
  applyWorkspaceBaseTokens,
21
21
  applyWorkspaceProjectTokens,
@@ -36,8 +36,8 @@ import {
36
36
  } from "../chunk-LF3SAK2O.js";
37
37
  import "../chunk-RUKM6FCF.js";
38
38
  import "../chunk-RRKB32OH.js";
39
- import "../chunk-RKSFAUGQ.js";
40
- import "../chunk-QKYARTIV.js";
39
+ import "../chunk-WH6MLTFO.js";
40
+ import "../chunk-SPHE3YEH.js";
41
41
  import {
42
42
  DEFAULT_COLOR_CONFIG,
43
43
  getColor,
@@ -2,8 +2,8 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkRVHA3XPDcjs = require('../chunk-RVHA3XPD.cjs');
6
- require('../chunk-4XZCLDX5.cjs');
5
+ var _chunkGLF62BIPcjs = require('../chunk-GLF62BIP.cjs');
6
+ require('../chunk-2YZ5KRRZ.cjs');
7
7
  require('../chunk-IKP3QKCZ.cjs');
8
8
  require('../chunk-LOY6ICHZ.cjs');
9
9
  require('../chunk-NSUIDUD7.cjs');
@@ -15,4 +15,4 @@ require('../chunk-IRCFHYKZ.cjs');
15
15
 
16
16
 
17
17
 
18
- exports.exitWithError = _chunkRVHA3XPDcjs.exitWithError; exports.exitWithSuccess = _chunkRVHA3XPDcjs.exitWithSuccess; exports.handleProcess = _chunkRVHA3XPDcjs.handleProcess;
18
+ exports.exitWithError = _chunkGLF62BIPcjs.exitWithError; exports.exitWithSuccess = _chunkGLF62BIPcjs.exitWithSuccess; exports.handleProcess = _chunkGLF62BIPcjs.handleProcess;
@@ -2,8 +2,8 @@ import {
2
2
  exitWithError,
3
3
  exitWithSuccess,
4
4
  handleProcess
5
- } from "../chunk-OGXIFMHW.js";
6
- import "../chunk-QKYARTIV.js";
5
+ } from "../chunk-T4YVVO6G.js";
6
+ import "../chunk-SPHE3YEH.js";
7
7
  import "../chunk-DJB7XLHA.js";
8
8
  import "../chunk-HVVJHTFS.js";
9
9
  import "../chunk-AITAR5W5.js";
@@ -4,10 +4,10 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkGLYIZSQPcjs = require('../chunk-GLYIZSQP.cjs');
7
+ var _chunkFIJZNJOMcjs = require('../chunk-FIJZNJOM.cjs');
8
8
  require('../chunk-7PV6L7I7.cjs');
9
- require('../chunk-OZ6NKEEC.cjs');
10
- require('../chunk-4XZCLDX5.cjs');
9
+ require('../chunk-D7M3EBCK.cjs');
10
+ require('../chunk-2YZ5KRRZ.cjs');
11
11
  require('../chunk-IKP3QKCZ.cjs');
12
12
  require('../chunk-LOY6ICHZ.cjs');
13
13
  require('../chunk-NSUIDUD7.cjs');
@@ -21,4 +21,4 @@ require('../chunk-IRCFHYKZ.cjs');
21
21
 
22
22
 
23
23
 
24
- exports.modifyCargoNestedTable = _chunkGLYIZSQPcjs.modifyCargoNestedTable; exports.modifyCargoTable = _chunkGLYIZSQPcjs.modifyCargoTable; exports.parseCargoToml = _chunkGLYIZSQPcjs.parseCargoToml; exports.parseCargoTomlWithTree = _chunkGLYIZSQPcjs.parseCargoTomlWithTree; exports.stringifyCargoToml = _chunkGLYIZSQPcjs.stringifyCargoToml;
24
+ exports.modifyCargoNestedTable = _chunkFIJZNJOMcjs.modifyCargoNestedTable; exports.modifyCargoTable = _chunkFIJZNJOMcjs.modifyCargoTable; exports.parseCargoToml = _chunkFIJZNJOMcjs.parseCargoToml; exports.parseCargoTomlWithTree = _chunkFIJZNJOMcjs.parseCargoTomlWithTree; exports.stringifyCargoToml = _chunkFIJZNJOMcjs.stringifyCargoToml;
@@ -4,10 +4,10 @@ import {
4
4
  parseCargoToml,
5
5
  parseCargoTomlWithTree,
6
6
  stringifyCargoToml
7
- } from "../chunk-SBJJ3URW.js";
7
+ } from "../chunk-7XZ53BLB.js";
8
8
  import "../chunk-RRKB32OH.js";
9
- import "../chunk-RKSFAUGQ.js";
10
- import "../chunk-QKYARTIV.js";
9
+ import "../chunk-WH6MLTFO.js";
10
+ import "../chunk-SPHE3YEH.js";
11
11
  import "../chunk-DJB7XLHA.js";
12
12
  import "../chunk-HVVJHTFS.js";
13
13
  import "../chunk-AITAR5W5.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/config-tools",
3
- "version": "1.189.7",
3
+ "version": "1.189.9",
4
4
  "type": "module",
5
5
  "description": "A package containing various utilities to support custom workspace configurations and environment management for Storm Software projects, including configuration file handling, environment variable management, and logging utilities.",
6
6
  "repository": {
@@ -211,7 +211,7 @@
211
211
  ],
212
212
  "dependencies": {
213
213
  "@ltd/j-toml": "1.38.0",
214
- "@storm-software/config": "^1.135.8",
214
+ "@storm-software/config": "^1.135.10",
215
215
  "c12": "^2.0.4",
216
216
  "chalk": "^4.1.2",
217
217
  "commander": "^12.1.0",
@@ -225,5 +225,5 @@
225
225
  "devDependencies": { "@types/node": "^25.3.0", "tsup": "8.4.0" },
226
226
  "publishConfig": { "access": "public" },
227
227
  "sideEffects": false,
228
- "gitHead": "1246351be8bc0444be4f05feb8ddf68950fb4e39"
228
+ "gitHead": "119c9bc1238cfee3860bcc9f7a7445ecbac88aa2"
229
229
  }
@@ -1,192 +0,0 @@
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
-
4
- var _chunkIKP3QKCZcjs = require('./chunk-IKP3QKCZ.cjs');
5
-
6
-
7
- var _chunkLOY6ICHZcjs = require('./chunk-LOY6ICHZ.cjs');
8
-
9
-
10
- var _chunkNSUIDUD7cjs = require('./chunk-NSUIDUD7.cjs');
11
-
12
-
13
- var _chunkBN6MEGGYcjs = require('./chunk-BN6MEGGY.cjs');
14
-
15
-
16
- var _chunk4PX5UVANcjs = require('./chunk-4PX5UVAN.cjs');
17
-
18
-
19
-
20
- var _chunkIRCFHYKZcjs = require('./chunk-IRCFHYKZ.cjs');
21
-
22
- // src/logger/console.ts
23
- var _formatDistanceToNow = require('date-fns/formatDistanceToNow');
24
- var getLogFn = (logLevel = _chunkIRCFHYKZcjs.LogLevel.INFO, config = {}, _chalk = _chunkLOY6ICHZcjs.getChalk.call(void 0, )) => {
25
- 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]) ? _chunkIKP3QKCZcjs.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"]]) : _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG;
26
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || _chunkIRCFHYKZcjs.LogLevelLabel.INFO;
27
- if (logLevel > _chunk4PX5UVANcjs.getLogLevel.call(void 0, configLogLevel) || logLevel <= _chunkIRCFHYKZcjs.LogLevel.SILENT || _chunk4PX5UVANcjs.getLogLevel.call(void 0, configLogLevel) <= _chunkIRCFHYKZcjs.LogLevel.SILENT) {
28
- return (_) => {
29
- };
30
- }
31
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.FATAL >= logLevel) {
32
- return (message) => {
33
- console.error(
34
- `
35
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
36
- _nullishCoalesce(colors.fatal, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.fatal))
37
- )(
38
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.FATAL]} Fatal] `
39
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
40
- `
41
- );
42
- };
43
- }
44
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.ERROR >= logLevel) {
45
- return (message) => {
46
- console.error(
47
- `
48
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
49
- _nullishCoalesce(colors.danger, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.danger))
50
- )(
51
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.ERROR]} Error] `
52
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
53
- `
54
- );
55
- };
56
- }
57
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.WARN >= logLevel) {
58
- return (message) => {
59
- console.warn(
60
- `
61
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
62
- _nullishCoalesce(colors.warning, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.warning))
63
- )(
64
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.WARN]} Warn] `
65
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
66
- `
67
- );
68
- };
69
- }
70
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.SUCCESS >= logLevel) {
71
- return (message) => {
72
- console.info(
73
- `
74
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
75
- _nullishCoalesce(colors.success, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.success))
76
- )(
77
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.SUCCESS]} Success] `
78
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
79
- `
80
- );
81
- };
82
- }
83
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.INFO >= logLevel) {
84
- return (message) => {
85
- console.info(
86
- `
87
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
88
- _nullishCoalesce(colors.info, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.info))
89
- )(
90
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.INFO]} Info] `
91
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
92
- `
93
- );
94
- };
95
- }
96
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.DEBUG >= logLevel) {
97
- return (message) => {
98
- console.debug(
99
- `
100
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
101
- _nullishCoalesce(colors.debug, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.debug))
102
- )(
103
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.DEBUG]} Debug] `
104
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
105
- `
106
- );
107
- };
108
- }
109
- if (typeof logLevel === "number" && _chunkIRCFHYKZcjs.LogLevel.TRACE >= logLevel) {
110
- return (message) => {
111
- console.debug(
112
- `
113
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex("#bbbbbb")(
114
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.TRACE]} Trace] `
115
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
116
- `
117
- );
118
- };
119
- }
120
- return (message) => {
121
- console.log(
122
- `
123
- ${_chalk.gray(_chunkBN6MEGGYcjs.formatTimestamp.call(void 0, ))} ${_chalk.hex(
124
- _nullishCoalesce(colors.brand, () => ( _chunkIKP3QKCZcjs.DEFAULT_COLOR_CONFIG.dark.brand))
125
- )(
126
- `[${_chunkNSUIDUD7cjs.CONSOLE_ICONS[_chunkIRCFHYKZcjs.LogLevelLabel.ALL]} System] `
127
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
128
- `
129
- );
130
- };
131
- };
132
- var writeFatal = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.FATAL, config)(message);
133
- var writeError = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.ERROR, config)(message);
134
- var writeWarning = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.WARN, config)(message);
135
- var writeInfo = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.INFO, config)(message);
136
- var writeSuccess = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.SUCCESS, config)(message);
137
- var writeDebug = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.DEBUG, config)(message);
138
- var writeTrace = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.TRACE, config)(message);
139
- var writeSystem = (message, config) => getLogFn(_chunkIRCFHYKZcjs.LogLevel.ALL, config)(message);
140
- var getStopwatch = (name) => {
141
- const start = /* @__PURE__ */ new Date();
142
- return () => {
143
- console.info(
144
- `> \u23F1 The${name ? ` ${name}` : ""} process took ${_formatDistanceToNow.formatDistanceToNow.call(void 0,
145
- start,
146
- {
147
- includeSeconds: true
148
- }
149
- )} to complete`
150
- );
151
- };
152
- };
153
- var MAX_DEPTH = 6;
154
- var formatLogMessage = (message, options = {}, depth = 0) => {
155
- if (depth > MAX_DEPTH) {
156
- return "<max depth>";
157
- }
158
- const prefix = _nullishCoalesce(options.prefix, () => ( "-"));
159
- const skip = _nullishCoalesce(options.skip, () => ( []));
160
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
161
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
162
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
163
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
164
- message[key],
165
- { prefix: `${prefix}-`, skip },
166
- depth + 1
167
- ) : message[key]}`
168
- ).join("\n")}` : message;
169
- };
170
- var _isFunction = (value) => {
171
- try {
172
- 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]));
173
- } catch (e) {
174
- return false;
175
- }
176
- };
177
- var brandIcon = (config = {}, _chalk = _chunkLOY6ICHZcjs.getChalk.call(void 0, )) => _chalk.hex(_chunkIKP3QKCZcjs.getColor.call(void 0, "brand", config))("\u{1F5F2}");
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
- exports.getLogFn = getLogFn; exports.writeFatal = writeFatal; exports.writeError = writeError; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.writeSystem = writeSystem; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage; exports.brandIcon = brandIcon;
@@ -1,192 +0,0 @@
1
- import {
2
- DEFAULT_COLOR_CONFIG,
3
- getColor
4
- } from "./chunk-DJB7XLHA.js";
5
- import {
6
- getChalk
7
- } from "./chunk-HVVJHTFS.js";
8
- import {
9
- CONSOLE_ICONS
10
- } from "./chunk-AITAR5W5.js";
11
- import {
12
- formatTimestamp
13
- } from "./chunk-CZ4IE2QN.js";
14
- import {
15
- getLogLevel
16
- } from "./chunk-K4CDYUQR.js";
17
- import {
18
- LogLevel,
19
- LogLevelLabel
20
- } from "./chunk-POXTJ6GF.js";
21
-
22
- // src/logger/console.ts
23
- import { formatDistanceToNow } from "date-fns/formatDistanceToNow";
24
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
25
- 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;
26
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
27
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
28
- return (_) => {
29
- };
30
- }
31
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
32
- return (message) => {
33
- console.error(
34
- `
35
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
36
- colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal
37
- )(
38
- `[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
39
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
40
- `
41
- );
42
- };
43
- }
44
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
45
- return (message) => {
46
- console.error(
47
- `
48
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
49
- colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger
50
- )(
51
- `[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
52
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
53
- `
54
- );
55
- };
56
- }
57
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
58
- return (message) => {
59
- console.warn(
60
- `
61
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
62
- colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning
63
- )(
64
- `[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
65
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
66
- `
67
- );
68
- };
69
- }
70
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
71
- return (message) => {
72
- console.info(
73
- `
74
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
75
- colors.success ?? DEFAULT_COLOR_CONFIG.dark.success
76
- )(
77
- `[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
78
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
79
- `
80
- );
81
- };
82
- }
83
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
84
- return (message) => {
85
- console.info(
86
- `
87
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
88
- colors.info ?? DEFAULT_COLOR_CONFIG.dark.info
89
- )(
90
- `[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
91
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
92
- `
93
- );
94
- };
95
- }
96
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
97
- return (message) => {
98
- console.debug(
99
- `
100
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
101
- colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug
102
- )(
103
- `[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
104
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
105
- `
106
- );
107
- };
108
- }
109
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
110
- return (message) => {
111
- console.debug(
112
- `
113
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
114
- `[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
115
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
116
- `
117
- );
118
- };
119
- }
120
- return (message) => {
121
- console.log(
122
- `
123
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(
124
- colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand
125
- )(
126
- `[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
127
- )}${_chalk.bold.whiteBright(formatLogMessage(message))}
128
- `
129
- );
130
- };
131
- };
132
- var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
133
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
134
- var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
135
- var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
136
- var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
137
- var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
138
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
139
- var writeSystem = (message, config) => getLogFn(LogLevel.ALL, config)(message);
140
- var getStopwatch = (name) => {
141
- const start = /* @__PURE__ */ new Date();
142
- return () => {
143
- console.info(
144
- `> \u23F1 The${name ? ` ${name}` : ""} process took ${formatDistanceToNow(
145
- start,
146
- {
147
- includeSeconds: true
148
- }
149
- )} to complete`
150
- );
151
- };
152
- };
153
- var MAX_DEPTH = 6;
154
- var formatLogMessage = (message, options = {}, depth = 0) => {
155
- if (depth > MAX_DEPTH) {
156
- return "<max depth>";
157
- }
158
- const prefix = options.prefix ?? "-";
159
- const skip = options.skip ?? [];
160
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
161
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
162
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
163
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
164
- message[key],
165
- { prefix: `${prefix}-`, skip },
166
- depth + 1
167
- ) : message[key]}`
168
- ).join("\n")}` : message;
169
- };
170
- var _isFunction = (value) => {
171
- try {
172
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
173
- } catch {
174
- return false;
175
- }
176
- };
177
- var brandIcon = (config = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config))("\u{1F5F2}");
178
-
179
- export {
180
- getLogFn,
181
- writeFatal,
182
- writeError,
183
- writeWarning,
184
- writeInfo,
185
- writeSuccess,
186
- writeDebug,
187
- writeTrace,
188
- writeSystem,
189
- getStopwatch,
190
- formatLogMessage,
191
- brandIcon
192
- };