@storm-software/config-tools 1.119.0 → 1.130.2

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 (157) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-4IYEDNYJ.mjs +426 -0
  3. package/dist/chunk-5QZ7AV2J.js +27 -0
  4. package/dist/chunk-64RYHF5D.mjs +51 -0
  5. package/dist/chunk-66ACWURQ.mjs +125 -0
  6. package/dist/chunk-6OYLNZFT.mjs +169 -0
  7. package/dist/chunk-6SJLAEJ3.js +70 -0
  8. package/dist/chunk-6WPG3DXV.js +32 -0
  9. package/dist/chunk-7KVSSDMX.mjs +545 -0
  10. package/dist/chunk-7XY63NME.js +44 -0
  11. package/dist/chunk-A7VLTBS6.mjs +271 -0
  12. package/dist/chunk-BS5OC5E6.js +426 -0
  13. package/dist/chunk-E3IN3SQD.mjs +6 -0
  14. package/dist/chunk-FW22KPOW.mjs +27 -0
  15. package/dist/chunk-GIZ23UUE.js +189 -0
  16. package/dist/chunk-GOQAHXJF.mjs +28 -0
  17. package/dist/chunk-H6XXDZ7A.js +28 -0
  18. package/dist/chunk-HCF3QA4H.js +102 -0
  19. package/dist/chunk-JDK3PXQR.js +545 -0
  20. package/dist/chunk-K6TQN2LZ.js +6 -0
  21. package/dist/chunk-LKZSRXS7.js +169 -0
  22. package/dist/chunk-MGI2M3SX.js +6 -0
  23. package/dist/chunk-N32EGEJB.js +90 -0
  24. package/dist/chunk-N4BRCEYB.js +27 -0
  25. package/dist/chunk-OXK45X3L.js +125 -0
  26. package/dist/chunk-PEHVR33I.js +67 -0
  27. package/dist/chunk-PQNCKJAR.js +271 -0
  28. package/dist/chunk-PVPSTJNJ.mjs +90 -0
  29. package/dist/chunk-QHVHX67K.js +6 -0
  30. package/dist/chunk-QUVGIEZZ.mjs +6 -0
  31. package/dist/chunk-RAWSXKTG.mjs +189 -0
  32. package/dist/chunk-SJO5XZQA.js +6 -0
  33. package/dist/chunk-TEKFJAJJ.mjs +70 -0
  34. package/dist/chunk-TTCXDK6S.mjs +27 -0
  35. package/dist/chunk-UCUOC6LA.mjs +70 -0
  36. package/dist/chunk-VQLOUFMG.mjs +32 -0
  37. package/dist/chunk-WRFJFYOU.mjs +51 -0
  38. package/dist/chunk-WXOSG64C.js +70 -0
  39. package/dist/chunk-WXYJGX4C.mjs +6 -0
  40. package/dist/chunk-X6VIYUJR.mjs +6 -0
  41. package/dist/chunk-XJEQHMOE.js +49 -0
  42. package/dist/chunk-XLMGW4ZW.mjs +67 -0
  43. package/dist/chunk-XXHENMLT.mjs +44 -0
  44. package/dist/chunk-Z2EXWNIQ.mjs +102 -0
  45. package/dist/chunk-ZVXEYJQO.js +51 -0
  46. package/dist/config-file/get-config-file.d.mts +20 -0
  47. package/dist/config-file/get-config-file.d.ts +20 -0
  48. package/dist/config-file/get-config-file.js +23 -0
  49. package/dist/config-file/get-config-file.mjs +23 -0
  50. package/dist/config-file/index.d.mts +4 -0
  51. package/dist/config-file/index.d.ts +4 -0
  52. package/dist/config-file/index.js +24 -0
  53. package/dist/config-file/index.mjs +24 -0
  54. package/dist/create-storm-config.d.mts +29 -0
  55. package/dist/create-storm-config.d.ts +29 -0
  56. package/dist/create-storm-config.js +30 -0
  57. package/dist/create-storm-config.mjs +30 -0
  58. package/dist/env/get-env.d.mts +19 -0
  59. package/dist/env/get-env.d.ts +19 -0
  60. package/dist/env/get-env.js +13 -0
  61. package/dist/env/get-env.mjs +13 -0
  62. package/dist/env/index.d.mts +5 -0
  63. package/dist/env/index.d.ts +5 -0
  64. package/dist/env/index.js +20 -0
  65. package/dist/env/index.mjs +20 -0
  66. package/{src/env/get-env.d.ts → dist/env/set-env.d.mts} +7 -4
  67. package/{src → dist}/env/set-env.d.ts +7 -3
  68. package/dist/env/set-env.js +12 -0
  69. package/dist/env/set-env.mjs +12 -0
  70. package/dist/index.d.mts +19 -0
  71. package/dist/index.d.ts +19 -0
  72. package/dist/index.js +132 -0
  73. package/dist/index.mjs +132 -0
  74. package/dist/logger/chalk.d.mts +25 -0
  75. package/{src/utilities → dist/logger}/chalk.d.ts +4 -2
  76. package/dist/logger/chalk.js +7 -0
  77. package/dist/logger/chalk.mjs +7 -0
  78. package/dist/logger/console.d.mts +82 -0
  79. package/{src/utilities/logger.d.ts → dist/logger/console.d.ts} +18 -14
  80. package/dist/logger/console.js +35 -0
  81. package/dist/logger/console.mjs +35 -0
  82. package/dist/logger/get-log-level.d.mts +27 -0
  83. package/{src/utilities → dist/logger}/get-log-level.d.ts +9 -4
  84. package/dist/logger/get-log-level.js +12 -0
  85. package/dist/logger/get-log-level.mjs +12 -0
  86. package/dist/logger/index.d.mts +6 -0
  87. package/dist/logger/index.d.ts +6 -0
  88. package/dist/logger/index.js +46 -0
  89. package/dist/logger/index.mjs +46 -0
  90. package/dist/types-DGWqy1xb.d.mts +1395 -0
  91. package/dist/types-DGWqy1xb.d.ts +1395 -0
  92. package/dist/types.d.mts +40 -0
  93. package/{src → dist}/types.d.ts +14 -7
  94. package/dist/types.js +9 -0
  95. package/dist/types.mjs +9 -0
  96. package/dist/utilities/apply-workspace-tokens.d.mts +9 -0
  97. package/dist/utilities/apply-workspace-tokens.d.ts +9 -0
  98. package/dist/utilities/apply-workspace-tokens.js +14 -0
  99. package/dist/utilities/apply-workspace-tokens.mjs +14 -0
  100. package/dist/utilities/correct-paths.d.mts +19 -0
  101. package/dist/utilities/correct-paths.d.ts +19 -0
  102. package/dist/utilities/correct-paths.js +9 -0
  103. package/dist/utilities/correct-paths.mjs +9 -0
  104. package/dist/utilities/file-path-utils.d.mts +4 -0
  105. package/dist/utilities/file-path-utils.d.ts +4 -0
  106. package/dist/utilities/file-path-utils.js +9 -0
  107. package/dist/utilities/file-path-utils.mjs +9 -0
  108. package/dist/utilities/find-up.d.mts +6 -0
  109. package/dist/utilities/find-up.d.ts +6 -0
  110. package/dist/utilities/find-up.js +7 -0
  111. package/dist/utilities/find-up.mjs +7 -0
  112. package/dist/utilities/find-workspace-root.d.mts +16 -0
  113. package/{src → dist}/utilities/find-workspace-root.d.ts +4 -2
  114. package/dist/utilities/find-workspace-root.js +11 -0
  115. package/dist/utilities/find-workspace-root.mjs +11 -0
  116. package/dist/utilities/get-default-config.d.mts +15 -0
  117. package/dist/utilities/get-default-config.d.ts +15 -0
  118. package/dist/utilities/get-default-config.js +13 -0
  119. package/dist/utilities/get-default-config.mjs +13 -0
  120. package/dist/utilities/index.d.mts +11 -0
  121. package/dist/utilities/index.d.ts +11 -0
  122. package/dist/utilities/index.js +58 -0
  123. package/dist/utilities/index.mjs +58 -0
  124. package/dist/utilities/process-handler.d.mts +8 -0
  125. package/dist/utilities/process-handler.d.ts +8 -0
  126. package/dist/utilities/process-handler.js +20 -0
  127. package/dist/utilities/process-handler.mjs +20 -0
  128. package/dist/utilities/run.d.mts +36 -0
  129. package/dist/utilities/run.d.ts +36 -0
  130. package/dist/utilities/run.js +11 -0
  131. package/dist/utilities/run.mjs +11 -0
  132. package/package.json +1 -24
  133. package/CHANGELOG.md +0 -3122
  134. package/declarations.d.ts +0 -304
  135. package/index.cjs +0 -67508
  136. package/index.js +0 -67463
  137. package/meta.cjs.json +0 -5352
  138. package/meta.esm.json +0 -5413
  139. package/src/config-file/get-config-file.d.ts +0 -16
  140. package/src/config-file/index.d.ts +0 -1
  141. package/src/create-storm-config.d.ts +0 -26
  142. package/src/env/index.d.ts +0 -2
  143. package/src/index.d.ts +0 -13
  144. package/src/utilities/apply-workspace-tokens.d.ts +0 -4
  145. package/src/utilities/correct-paths.d.ts +0 -1
  146. package/src/utilities/file-path-utils.d.ts +0 -2
  147. package/src/utilities/find-up.d.ts +0 -4
  148. package/src/utilities/get-default-config.d.ts +0 -15
  149. package/src/utilities/index.d.ts +0 -10
  150. package/src/utilities/process-handler.d.ts +0 -4
  151. package/src/utilities/run.d.ts +0 -18
  152. package/utilities/chalk.cjs +0 -1610
  153. package/utilities/chalk.js +0 -1605
  154. package/utilities/find-workspace-root.cjs +0 -118
  155. package/utilities/find-workspace-root.js +0 -91
  156. package/utilities/logger.cjs +0 -5914
  157. package/utilities/logger.js +0 -5897
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-1.113.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-1.130.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -0,0 +1,426 @@
1
+ import {
2
+ __commonJS,
3
+ __name,
4
+ __require,
5
+ __toESM,
6
+ init_esm_shims
7
+ } from "./chunk-WRFJFYOU.mjs";
8
+
9
+ // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
10
+ var require_util = __commonJS({
11
+ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module) {
12
+ "use strict";
13
+ init_esm_shims();
14
+ var stringReplaceAll = /* @__PURE__ */ __name((string, substring, replacer) => {
15
+ let index = string.indexOf(substring);
16
+ if (index === -1) {
17
+ return string;
18
+ }
19
+ const substringLength = substring.length;
20
+ let endIndex = 0;
21
+ let returnValue = "";
22
+ do {
23
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
24
+ endIndex = index + substringLength;
25
+ index = string.indexOf(substring, endIndex);
26
+ } while (index !== -1);
27
+ returnValue += string.substr(endIndex);
28
+ return returnValue;
29
+ }, "stringReplaceAll");
30
+ var stringEncaseCRLFWithFirstIndex = /* @__PURE__ */ __name((string, prefix, postfix, index) => {
31
+ let endIndex = 0;
32
+ let returnValue = "";
33
+ do {
34
+ const gotCR = string[index - 1] === "\r";
35
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
36
+ endIndex = index + 1;
37
+ index = string.indexOf("\n", endIndex);
38
+ } while (index !== -1);
39
+ returnValue += string.substr(endIndex);
40
+ return returnValue;
41
+ }, "stringEncaseCRLFWithFirstIndex");
42
+ module.exports = {
43
+ stringReplaceAll,
44
+ stringEncaseCRLFWithFirstIndex
45
+ };
46
+ }
47
+ });
48
+
49
+ // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
50
+ var require_templates = __commonJS({
51
+ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module) {
52
+ "use strict";
53
+ init_esm_shims();
54
+ var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
55
+ var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
56
+ var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
57
+ var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
58
+ var ESCAPES = /* @__PURE__ */ new Map([
59
+ [
60
+ "n",
61
+ "\n"
62
+ ],
63
+ [
64
+ "r",
65
+ "\r"
66
+ ],
67
+ [
68
+ "t",
69
+ " "
70
+ ],
71
+ [
72
+ "b",
73
+ "\b"
74
+ ],
75
+ [
76
+ "f",
77
+ "\f"
78
+ ],
79
+ [
80
+ "v",
81
+ "\v"
82
+ ],
83
+ [
84
+ "0",
85
+ "\0"
86
+ ],
87
+ [
88
+ "\\",
89
+ "\\"
90
+ ],
91
+ [
92
+ "e",
93
+ "\x1B"
94
+ ],
95
+ [
96
+ "a",
97
+ "\x07"
98
+ ]
99
+ ]);
100
+ function unescape(c) {
101
+ const u = c[0] === "u";
102
+ const bracket = c[1] === "{";
103
+ if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
104
+ return String.fromCharCode(parseInt(c.slice(1), 16));
105
+ }
106
+ if (u && bracket) {
107
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
108
+ }
109
+ return ESCAPES.get(c) || c;
110
+ }
111
+ __name(unescape, "unescape");
112
+ function parseArguments(name, arguments_) {
113
+ const results = [];
114
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
115
+ let matches;
116
+ for (const chunk of chunks) {
117
+ const number = Number(chunk);
118
+ if (!Number.isNaN(number)) {
119
+ results.push(number);
120
+ } else if (matches = chunk.match(STRING_REGEX)) {
121
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
122
+ } else {
123
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
124
+ }
125
+ }
126
+ return results;
127
+ }
128
+ __name(parseArguments, "parseArguments");
129
+ function parseStyle(style) {
130
+ STYLE_REGEX.lastIndex = 0;
131
+ const results = [];
132
+ let matches;
133
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
134
+ const name = matches[1];
135
+ if (matches[2]) {
136
+ const args = parseArguments(name, matches[2]);
137
+ results.push([
138
+ name
139
+ ].concat(args));
140
+ } else {
141
+ results.push([
142
+ name
143
+ ]);
144
+ }
145
+ }
146
+ return results;
147
+ }
148
+ __name(parseStyle, "parseStyle");
149
+ function buildStyle(chalk2, styles) {
150
+ const enabled = {};
151
+ for (const layer of styles) {
152
+ for (const style of layer.styles) {
153
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
154
+ }
155
+ }
156
+ let current = chalk2;
157
+ for (const [styleName, styles2] of Object.entries(enabled)) {
158
+ if (!Array.isArray(styles2)) {
159
+ continue;
160
+ }
161
+ if (!(styleName in current)) {
162
+ throw new Error(`Unknown Chalk style: ${styleName}`);
163
+ }
164
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
165
+ }
166
+ return current;
167
+ }
168
+ __name(buildStyle, "buildStyle");
169
+ module.exports = (chalk2, temporary) => {
170
+ const styles = [];
171
+ const chunks = [];
172
+ let chunk = [];
173
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
174
+ if (escapeCharacter) {
175
+ chunk.push(unescape(escapeCharacter));
176
+ } else if (style) {
177
+ const string = chunk.join("");
178
+ chunk = [];
179
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
180
+ styles.push({
181
+ inverse,
182
+ styles: parseStyle(style)
183
+ });
184
+ } else if (close) {
185
+ if (styles.length === 0) {
186
+ throw new Error("Found extraneous } in Chalk template literal");
187
+ }
188
+ chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
189
+ chunk = [];
190
+ styles.pop();
191
+ } else {
192
+ chunk.push(character);
193
+ }
194
+ });
195
+ chunks.push(chunk.join(""));
196
+ if (styles.length > 0) {
197
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
198
+ throw new Error(errMessage);
199
+ }
200
+ return chunks.join("");
201
+ };
202
+ }
203
+ });
204
+
205
+ // ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
206
+ var require_source = __commonJS({
207
+ "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module) {
208
+ "use strict";
209
+ init_esm_shims();
210
+ var ansiStyles = __require("ansi-styles");
211
+ var { stdout: stdoutColor, stderr: stderrColor } = __require("supports-color");
212
+ var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util();
213
+ var { isArray } = Array;
214
+ var levelMapping = [
215
+ "ansi",
216
+ "ansi",
217
+ "ansi256",
218
+ "ansi16m"
219
+ ];
220
+ var styles = /* @__PURE__ */ Object.create(null);
221
+ var applyOptions = /* @__PURE__ */ __name((object, options = {}) => {
222
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
223
+ throw new Error("The `level` option should be an integer from 0 to 3");
224
+ }
225
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
226
+ object.level = options.level === void 0 ? colorLevel : options.level;
227
+ }, "applyOptions");
228
+ var ChalkClass = class ChalkClass {
229
+ static {
230
+ __name(this, "ChalkClass");
231
+ }
232
+ constructor(options) {
233
+ return chalkFactory(options);
234
+ }
235
+ };
236
+ var chalkFactory = /* @__PURE__ */ __name((options) => {
237
+ const chalk3 = {};
238
+ applyOptions(chalk3, options);
239
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
240
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
241
+ Object.setPrototypeOf(chalk3.template, chalk3);
242
+ chalk3.template.constructor = () => {
243
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
244
+ };
245
+ chalk3.template.Instance = ChalkClass;
246
+ return chalk3.template;
247
+ }, "chalkFactory");
248
+ function Chalk(options) {
249
+ return chalkFactory(options);
250
+ }
251
+ __name(Chalk, "Chalk");
252
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
253
+ styles[styleName] = {
254
+ get() {
255
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
256
+ Object.defineProperty(this, styleName, {
257
+ value: builder
258
+ });
259
+ return builder;
260
+ }
261
+ };
262
+ }
263
+ styles.visible = {
264
+ get() {
265
+ const builder = createBuilder(this, this._styler, true);
266
+ Object.defineProperty(this, "visible", {
267
+ value: builder
268
+ });
269
+ return builder;
270
+ }
271
+ };
272
+ var usedModels = [
273
+ "rgb",
274
+ "hex",
275
+ "keyword",
276
+ "hsl",
277
+ "hsv",
278
+ "hwb",
279
+ "ansi",
280
+ "ansi256"
281
+ ];
282
+ for (const model of usedModels) {
283
+ styles[model] = {
284
+ get() {
285
+ const { level } = this;
286
+ return function(...arguments_) {
287
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
288
+ return createBuilder(this, styler, this._isEmpty);
289
+ };
290
+ }
291
+ };
292
+ }
293
+ for (const model of usedModels) {
294
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
295
+ styles[bgModel] = {
296
+ get() {
297
+ const { level } = this;
298
+ return function(...arguments_) {
299
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
300
+ return createBuilder(this, styler, this._isEmpty);
301
+ };
302
+ }
303
+ };
304
+ }
305
+ var proto = Object.defineProperties(() => {
306
+ }, {
307
+ ...styles,
308
+ level: {
309
+ enumerable: true,
310
+ get() {
311
+ return this._generator.level;
312
+ },
313
+ set(level) {
314
+ this._generator.level = level;
315
+ }
316
+ }
317
+ });
318
+ var createStyler = /* @__PURE__ */ __name((open, close, parent) => {
319
+ let openAll;
320
+ let closeAll;
321
+ if (parent === void 0) {
322
+ openAll = open;
323
+ closeAll = close;
324
+ } else {
325
+ openAll = parent.openAll + open;
326
+ closeAll = close + parent.closeAll;
327
+ }
328
+ return {
329
+ open,
330
+ close,
331
+ openAll,
332
+ closeAll,
333
+ parent
334
+ };
335
+ }, "createStyler");
336
+ var createBuilder = /* @__PURE__ */ __name((self, _styler, _isEmpty) => {
337
+ const builder = /* @__PURE__ */ __name((...arguments_) => {
338
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
339
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
340
+ }
341
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
342
+ }, "builder");
343
+ Object.setPrototypeOf(builder, proto);
344
+ builder._generator = self;
345
+ builder._styler = _styler;
346
+ builder._isEmpty = _isEmpty;
347
+ return builder;
348
+ }, "createBuilder");
349
+ var applyStyle = /* @__PURE__ */ __name((self, string) => {
350
+ if (self.level <= 0 || !string) {
351
+ return self._isEmpty ? "" : string;
352
+ }
353
+ let styler = self._styler;
354
+ if (styler === void 0) {
355
+ return string;
356
+ }
357
+ const { openAll, closeAll } = styler;
358
+ if (string.indexOf("\x1B") !== -1) {
359
+ while (styler !== void 0) {
360
+ string = stringReplaceAll(string, styler.close, styler.open);
361
+ styler = styler.parent;
362
+ }
363
+ }
364
+ const lfIndex = string.indexOf("\n");
365
+ if (lfIndex !== -1) {
366
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
367
+ }
368
+ return openAll + string + closeAll;
369
+ }, "applyStyle");
370
+ var template;
371
+ var chalkTag = /* @__PURE__ */ __name((chalk3, ...strings) => {
372
+ const [firstString] = strings;
373
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
374
+ return strings.join(" ");
375
+ }
376
+ const arguments_ = strings.slice(1);
377
+ const parts = [
378
+ firstString.raw[0]
379
+ ];
380
+ for (let i = 1; i < firstString.length; i++) {
381
+ parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
382
+ }
383
+ if (template === void 0) {
384
+ template = require_templates();
385
+ }
386
+ return template(chalk3, parts.join(""));
387
+ }, "chalkTag");
388
+ Object.defineProperties(Chalk.prototype, styles);
389
+ var chalk2 = Chalk();
390
+ chalk2.supportsColor = stdoutColor;
391
+ chalk2.stderr = Chalk({
392
+ level: stderrColor ? stderrColor.level : 0
393
+ });
394
+ chalk2.stderr.supportsColor = stderrColor;
395
+ module.exports = chalk2;
396
+ }
397
+ });
398
+
399
+ // src/logger/chalk.ts
400
+ init_esm_shims();
401
+ var import_chalk = __toESM(require_source());
402
+ var chalkDefault = {
403
+ hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
404
+ bgHex: /* @__PURE__ */ __name((_) => ({
405
+ whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
406
+ }), "bgHex"),
407
+ whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright"),
408
+ bold: {
409
+ hex: /* @__PURE__ */ __name((_) => (message) => message, "hex"),
410
+ bgHex: /* @__PURE__ */ __name((_) => ({
411
+ whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
412
+ }), "bgHex"),
413
+ whiteBright: /* @__PURE__ */ __name((message) => message, "whiteBright")
414
+ }
415
+ };
416
+ var getChalk = /* @__PURE__ */ __name(() => {
417
+ let _chalk = import_chalk.default;
418
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
419
+ _chalk = chalkDefault;
420
+ }
421
+ return _chalk;
422
+ }, "getChalk");
423
+
424
+ export {
425
+ getChalk
426
+ };
@@ -0,0 +1,27 @@
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 _chunkXJEQHMOEjs = require('./chunk-XJEQHMOE.js');
5
+
6
+ // src/utilities/file-path-utils.ts
7
+ _chunkXJEQHMOEjs.init_cjs_shims.call(void 0, );
8
+ var _path = require('path');
9
+ var removeExtension = /* @__PURE__ */ _chunkXJEQHMOEjs.__name.call(void 0, (filePath) => {
10
+ const result = !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
11
+ if (result.startsWith("./")) {
12
+ return result.substring(2);
13
+ }
14
+ if (result.startsWith(".") || result.startsWith("/")) {
15
+ return result.substring(1);
16
+ }
17
+ return result;
18
+ }, "removeExtension");
19
+ function findFileName(filePath) {
20
+ return _nullishCoalesce(_optionalChain([filePath, 'optionalAccess', _ => _.split, 'call', _2 => _2(_optionalChain([filePath, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(_path.sep)]) ? _path.sep : _optionalChain([filePath, 'optionalAccess', _5 => _5.includes, 'call', _6 => _6("/")]) ? "/" : "\\"), 'optionalAccess', _7 => _7.pop, 'call', _8 => _8()]), () => ( ""));
21
+ }
22
+ _chunkXJEQHMOEjs.__name.call(void 0, findFileName, "findFileName");
23
+
24
+
25
+
26
+
27
+ exports.removeExtension = removeExtension; exports.findFileName = findFileName;
@@ -0,0 +1,51 @@
1
+ import {
2
+ writeError,
3
+ writeFatal,
4
+ writeSuccess,
5
+ writeTrace
6
+ } from "./chunk-66ACWURQ.mjs";
7
+ import {
8
+ __name,
9
+ init_esm_shims
10
+ } from "./chunk-WRFJFYOU.mjs";
11
+
12
+ // src/utilities/process-handler.ts
13
+ init_esm_shims();
14
+ var exitWithError = /* @__PURE__ */ __name((config) => {
15
+ writeFatal("Exiting script with an error status...", config);
16
+ process.exit(1);
17
+ }, "exitWithError");
18
+ var exitWithSuccess = /* @__PURE__ */ __name((config) => {
19
+ writeSuccess("Script completed successfully. Exiting...", config);
20
+ process.exit(0);
21
+ }, "exitWithSuccess");
22
+ var handleProcess = /* @__PURE__ */ __name((config) => {
23
+ writeTrace(`Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
24
+ process.on("unhandledRejection", (error) => {
25
+ writeError(`An Unhandled Rejection occurred while running the program: ${error}`, config);
26
+ exitWithError(config);
27
+ });
28
+ process.on("uncaughtException", (error) => {
29
+ writeError(`An Uncaught Exception occurred while running the program: ${error.message}
30
+ Stacktrace: ${error.stack}`, config);
31
+ exitWithError(config);
32
+ });
33
+ process.on("SIGTERM", (signal) => {
34
+ writeError(`The program terminated with signal code: ${signal}`, config);
35
+ exitWithError(config);
36
+ });
37
+ process.on("SIGINT", (signal) => {
38
+ writeError(`The program terminated with signal code: ${signal}`, config);
39
+ exitWithError(config);
40
+ });
41
+ process.on("SIGHUP", (signal) => {
42
+ writeError(`The program terminated with signal code: ${signal}`, config);
43
+ exitWithError(config);
44
+ });
45
+ }, "handleProcess");
46
+
47
+ export {
48
+ exitWithError,
49
+ exitWithSuccess,
50
+ handleProcess
51
+ };
@@ -0,0 +1,125 @@
1
+ import {
2
+ DEFAULT_COLOR_CONFIG
3
+ } from "./chunk-PVPSTJNJ.mjs";
4
+ import {
5
+ getLogLevel
6
+ } from "./chunk-UCUOC6LA.mjs";
7
+ import {
8
+ LogLevel,
9
+ LogLevelLabel
10
+ } from "./chunk-VQLOUFMG.mjs";
11
+ import {
12
+ getChalk
13
+ } from "./chunk-4IYEDNYJ.mjs";
14
+ import {
15
+ __name,
16
+ init_esm_shims
17
+ } from "./chunk-WRFJFYOU.mjs";
18
+
19
+ // src/logger/console.ts
20
+ init_esm_shims();
21
+ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) => {
22
+ const _chalk = getChalk();
23
+ 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;
24
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
25
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
26
+ return (_) => {
27
+ };
28
+ }
29
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
30
+ return (message) => {
31
+ console.error(`${_chalk.bold.hex(colors.fatal ?? "#7d1a1a")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#7d1a1a").whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(formatLogMessage(message))}
32
+ `);
33
+ };
34
+ }
35
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
36
+ return (message) => {
37
+ console.error(`${_chalk.bold.hex(colors.danger ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.danger ?? "#f85149").whiteBright(" \u2718 Error ")} ${_chalk.hex(colors.danger ?? "#f85149")(formatLogMessage(message))}
38
+ `);
39
+ };
40
+ }
41
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
42
+ return (message) => {
43
+ console.warn(`${_chalk.bold.hex(colors.warning ?? "#e3b341")(">")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(" \u26A0 Warn ")} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
44
+ `);
45
+ };
46
+ }
47
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
48
+ return (message) => {
49
+ console.info(`${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(" \u2713 Success ")} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
50
+ `);
51
+ };
52
+ }
53
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
54
+ return (message) => {
55
+ console.info(`${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(" \u2139 Info ")} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
56
+ `);
57
+ };
58
+ }
59
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
60
+ return (message) => {
61
+ console.debug(`${_chalk.bold.hex(colors.brand ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.brand ?? "#1fb2a6").whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(colors.brand ?? "#1fb2a6")(formatLogMessage(message))}
62
+ `);
63
+ };
64
+ }
65
+ return (message) => {
66
+ console.log(`${_chalk.bold.hex(colors.brand ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.brand ?? "#1fb2a6").whiteBright(" \u2709 System ")} ${_chalk.hex(colors.brand ?? "#1fb2a6")(formatLogMessage(message))}
67
+ `);
68
+ };
69
+ }, "getLogFn");
70
+ var writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
71
+ var writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
72
+ var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
73
+ var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
74
+ var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
75
+ var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
76
+ var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
77
+ var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
78
+ var getStopwatch = /* @__PURE__ */ __name((name) => {
79
+ const start = process.hrtime();
80
+ return () => {
81
+ const end = process.hrtime(start);
82
+ console.info(`
83
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(end[0] * 1e3 + end[1] / 1e6)}ms to complete
84
+
85
+ `);
86
+ };
87
+ }, "getStopwatch");
88
+ var MAX_DEPTH = 4;
89
+ var formatLogMessage = /* @__PURE__ */ __name((message, options = {}, depth = 0) => {
90
+ if (depth > MAX_DEPTH) {
91
+ return "<max depth>";
92
+ }
93
+ const prefix = options.prefix ?? "-";
94
+ const skip = options.skip ?? [];
95
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
96
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
97
+ prefix: `${prefix}-`,
98
+ skip
99
+ }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
100
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
101
+ prefix: `${prefix}-`,
102
+ skip
103
+ }, depth + 1) : message[key]}`).join("\n")}` : message;
104
+ }, "formatLogMessage");
105
+ var _isFunction = /* @__PURE__ */ __name((value) => {
106
+ try {
107
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
108
+ } catch (e) {
109
+ return false;
110
+ }
111
+ }, "_isFunction");
112
+
113
+ export {
114
+ getLogFn,
115
+ writeFatal,
116
+ writeError,
117
+ writeWarning,
118
+ writeInfo,
119
+ writeSuccess,
120
+ writeDebug,
121
+ writeTrace,
122
+ writeSystem,
123
+ getStopwatch,
124
+ formatLogMessage
125
+ };