@storm-software/git-tools 2.131.127 → 2.131.128

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 (66) hide show
  1. package/README.md +1 -1
  2. package/bin/{chunk-GAHICIOD.js → chunk-A5X7CY3W.js} +3 -3
  3. package/bin/{chunk-GAHICIOD.js.map → chunk-A5X7CY3W.js.map} +1 -1
  4. package/bin/{chunk-ZBZINLOA.js → chunk-AOZSGQGA.js} +3 -3
  5. package/bin/{chunk-ZBZINLOA.js.map → chunk-AOZSGQGA.js.map} +1 -1
  6. package/bin/chunk-FOMBLMLH.js +2073 -0
  7. package/bin/chunk-FOMBLMLH.js.map +1 -0
  8. package/bin/{chunk-B5CZCP2Y.cjs → chunk-GT7HITVF.cjs} +4 -4
  9. package/bin/{chunk-B5CZCP2Y.cjs.map → chunk-GT7HITVF.cjs.map} +1 -1
  10. package/bin/{chunk-ZL2JPPJF.cjs → chunk-IHDSESSE.cjs} +4 -4
  11. package/bin/{chunk-ZL2JPPJF.cjs.map → chunk-IHDSESSE.cjs.map} +1 -1
  12. package/bin/{chunk-SASCLX6I.js → chunk-IIH7F7OZ.js} +3 -3
  13. package/bin/{chunk-SASCLX6I.js.map → chunk-IIH7F7OZ.js.map} +1 -1
  14. package/bin/{chunk-KFRB3UCF.js → chunk-JBHMFR7F.js} +3 -3
  15. package/bin/{chunk-KFRB3UCF.js.map → chunk-JBHMFR7F.js.map} +1 -1
  16. package/bin/{chunk-KJMWPKRH.cjs → chunk-JYYYVLIU.cjs} +4 -4
  17. package/bin/{chunk-KJMWPKRH.cjs.map → chunk-JYYYVLIU.cjs.map} +1 -1
  18. package/bin/{chunk-MUNEGKNC.cjs → chunk-ML5MZIGJ.cjs} +5 -5
  19. package/bin/{chunk-MUNEGKNC.cjs.map → chunk-ML5MZIGJ.cjs.map} +1 -1
  20. package/bin/{chunk-NNIW4L2Q.js → chunk-NG23E43K.js} +3 -3
  21. package/bin/{chunk-NNIW4L2Q.js.map → chunk-NG23E43K.js.map} +1 -1
  22. package/bin/{chunk-2NTFR3EF.cjs → chunk-QBI7KQ6A.cjs} +6 -6
  23. package/bin/{chunk-2NTFR3EF.cjs.map → chunk-QBI7KQ6A.cjs.map} +1 -1
  24. package/bin/{chunk-VIFL2F7H.js → chunk-SHH572XU.js} +3 -3
  25. package/bin/{chunk-VIFL2F7H.js.map → chunk-SHH572XU.js.map} +1 -1
  26. package/bin/{chunk-NZ4HDNJ7.cjs → chunk-SZFP3TKI.cjs} +4 -4
  27. package/bin/{chunk-NZ4HDNJ7.cjs.map → chunk-SZFP3TKI.cjs.map} +1 -1
  28. package/bin/chunk-TOLGVHZM.cjs +2116 -0
  29. package/bin/chunk-TOLGVHZM.cjs.map +1 -0
  30. package/bin/{chunk-MSQDEBW3.js → chunk-WUN4N3D7.js} +3 -3
  31. package/bin/{chunk-MSQDEBW3.js.map → chunk-WUN4N3D7.js.map} +1 -1
  32. package/bin/{chunk-IXUKWNVT.cjs → chunk-ZJN2D7NE.cjs} +4 -4
  33. package/bin/{chunk-IXUKWNVT.cjs.map → chunk-ZJN2D7NE.cjs.map} +1 -1
  34. package/bin/git.cjs +185 -195
  35. package/bin/git.cjs.map +1 -1
  36. package/bin/git.js +46 -54
  37. package/bin/git.js.map +1 -1
  38. package/bin/post-checkout.cjs +7 -7
  39. package/bin/post-checkout.js +2 -2
  40. package/bin/post-commit.cjs +7 -7
  41. package/bin/post-commit.js +2 -2
  42. package/bin/post-merge.cjs +7 -7
  43. package/bin/post-merge.js +2 -2
  44. package/bin/pre-commit.cjs +7 -7
  45. package/bin/pre-commit.js +2 -2
  46. package/bin/pre-install.cjs +7 -7
  47. package/bin/pre-install.js +2 -2
  48. package/bin/pre-push.cjs +7 -7
  49. package/bin/pre-push.js +2 -2
  50. package/bin/prepare.cjs +7 -7
  51. package/bin/prepare.js +2 -2
  52. package/bin/version-warning.cjs +5 -5
  53. package/bin/version-warning.js +1 -1
  54. package/dist/chunk-52Z6PKZI.js +2412 -0
  55. package/dist/chunk-U5IGP2SZ.cjs +2454 -0
  56. package/dist/index.cjs +18 -18
  57. package/dist/index.js +1 -1
  58. package/dist/release/config.cjs +18 -18
  59. package/dist/release/config.js +1 -1
  60. package/package.json +10 -14
  61. package/bin/chunk-DGRFGD2R.cjs +0 -3578
  62. package/bin/chunk-DGRFGD2R.cjs.map +0 -1
  63. package/bin/chunk-ZW42VDY5.js +0 -3554
  64. package/bin/chunk-ZW42VDY5.js.map +0 -1
  65. package/dist/chunk-IVBFLZSL.cjs +0 -3863
  66. package/dist/chunk-J5FHPMMG.js +0 -3840
@@ -0,0 +1,2116 @@
1
+ 'use strict';
2
+
3
+ require('date-fns/formatDistanceToNow');
4
+ var chalk = require('chalk');
5
+ var z = require('zod/v4/mini');
6
+ var defu = require('defu');
7
+ var fs = require('fs');
8
+ var c12 = require('c12');
9
+ var path = require('path');
10
+ var promises = require('fs/promises');
11
+
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n.default = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var chalk__default = /*#__PURE__*/_interopDefault(chalk);
33
+ var z__namespace = /*#__PURE__*/_interopNamespace(z);
34
+ var defu__default = /*#__PURE__*/_interopDefault(defu);
35
+
36
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
37
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
38
+ }) : x)(function(x) {
39
+ if (typeof require !== "undefined") return require.apply(this, arguments);
40
+ throw Error('Dynamic require of "' + x + '" is not supported');
41
+ });
42
+
43
+ // ../config-tools/src/types.ts
44
+ var LogLevel = {
45
+ SILENT: 0,
46
+ FATAL: 10,
47
+ ERROR: 20,
48
+ WARN: 30,
49
+ SUCCESS: 35,
50
+ INFO: 40,
51
+ PERFORMANCE: 50,
52
+ DEBUG: 60,
53
+ TRACE: 70,
54
+ ALL: 100
55
+ };
56
+ var LogLevelLabel = {
57
+ SILENT: "silent",
58
+ FATAL: "fatal",
59
+ ERROR: "error",
60
+ WARN: "warn",
61
+ SUCCESS: "success",
62
+ INFO: "info",
63
+ PERFORMANCE: "performance",
64
+ DEBUG: "debug",
65
+ TRACE: "trace",
66
+ ALL: "all"
67
+ };
68
+
69
+ // ../config-tools/src/utilities/colors.ts
70
+ var DEFAULT_COLOR_CONFIG = {
71
+ light: {
72
+ background: "#fafafa",
73
+ foreground: "#1d1e22",
74
+ brand: "#1fb2a6",
75
+ alternate: "#db2777",
76
+ discovery: "#5C4EE5",
77
+ success: "#087f5b",
78
+ info: "#0550ae",
79
+ debug: "#8afafc",
80
+ warning: "#e3b341",
81
+ danger: "#D8314A",
82
+ fatal: "#51070f",
83
+ performance: "#13c302",
84
+ link: "#3fa6ff",
85
+ positive: "#22c55e",
86
+ negative: "#dc2626",
87
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
88
+ },
89
+ dark: {
90
+ background: "#1e2124",
91
+ foreground: "#cbd5e1",
92
+ brand: "#2dd4bf",
93
+ alternate: "#db2777",
94
+ discovery: "#818cf8",
95
+ success: "#10b981",
96
+ info: "#58a6ff",
97
+ debug: "#8afafc",
98
+ warning: "#f3d371",
99
+ danger: "#D8314A",
100
+ fatal: "#a40e26",
101
+ performance: "#80fd74",
102
+ link: "#3fa6ff",
103
+ positive: "#22c55e",
104
+ negative: "#dc2626",
105
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
106
+ }
107
+ };
108
+ function getColors(config) {
109
+ if (!config?.colors || typeof config.colors !== "object" || !config.colors["dark"] && (!config.colors["base"] || typeof config.colors !== "object" || !config.colors["base"]?.["dark"])) {
110
+ return DEFAULT_COLOR_CONFIG;
111
+ }
112
+ if (config.colors["base"]) {
113
+ if (typeof config.colors["base"]["dark"] === "object") {
114
+ return config.colors["base"]["dark"];
115
+ } else if (config.colors["base"]["dark"] === "string") {
116
+ return config.colors["base"];
117
+ }
118
+ }
119
+ if (typeof config.colors["dark"] === "object") {
120
+ return config.colors["dark"];
121
+ }
122
+ return config.colors ?? DEFAULT_COLOR_CONFIG;
123
+ }
124
+ function getColor(key, config) {
125
+ const colors = getColors(config);
126
+ const result = (typeof colors["dark"] === "object" ? colors["dark"][key] : colors[key]) || DEFAULT_COLOR_CONFIG["dark"][key] || DEFAULT_COLOR_CONFIG[key];
127
+ if (result) {
128
+ return result;
129
+ }
130
+ return getColor("brand", config);
131
+ }
132
+ var chalkDefault = {
133
+ hex: (_) => (message) => message,
134
+ bgHex: (_) => ({
135
+ whiteBright: (message) => message,
136
+ white: (message) => message
137
+ }),
138
+ white: (message) => message,
139
+ whiteBright: (message) => message,
140
+ gray: (message) => message,
141
+ bold: {
142
+ hex: (_) => (message) => message,
143
+ bgHex: (_) => ({
144
+ whiteBright: (message) => message,
145
+ white: (message) => message
146
+ }),
147
+ whiteBright: (message) => message,
148
+ white: (message) => message
149
+ },
150
+ dim: {
151
+ hex: (_) => (message) => message,
152
+ gray: (message) => message
153
+ }
154
+ };
155
+ var getChalk = () => {
156
+ let _chalk = chalk__default.default;
157
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
158
+ _chalk = chalkDefault;
159
+ }
160
+ return _chalk;
161
+ };
162
+
163
+ // ../config-tools/src/logger/is-unicode-supported.ts
164
+ function isUnicodeSupported() {
165
+ if (process.platform !== "win32") {
166
+ return process.env.TERM !== "linux";
167
+ }
168
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
169
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
170
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
171
+ process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
172
+ }
173
+
174
+ // ../config-tools/src/logger/console-icons.ts
175
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
176
+ var CONSOLE_ICONS = {
177
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
178
+ [LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
179
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
180
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
181
+ [LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
182
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
183
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
184
+ [LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
185
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
186
+ };
187
+
188
+ // ../config-tools/src/logger/format-timestamp.ts
189
+ var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
190
+ return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
191
+ };
192
+
193
+ // ../config-tools/src/logger/get-log-level.ts
194
+ var getLogLevel = (label) => {
195
+ switch (label) {
196
+ case "all":
197
+ return LogLevel.ALL;
198
+ case "trace":
199
+ return LogLevel.TRACE;
200
+ case "debug":
201
+ return LogLevel.DEBUG;
202
+ case "performance":
203
+ return LogLevel.PERFORMANCE;
204
+ case "info":
205
+ return LogLevel.INFO;
206
+ case "warn":
207
+ return LogLevel.WARN;
208
+ case "error":
209
+ return LogLevel.ERROR;
210
+ case "fatal":
211
+ return LogLevel.FATAL;
212
+ case "silent":
213
+ return LogLevel.SILENT;
214
+ default:
215
+ return LogLevel.INFO;
216
+ }
217
+ };
218
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
219
+ if (logLevel >= LogLevel.ALL) {
220
+ return LogLevelLabel.ALL;
221
+ }
222
+ if (logLevel >= LogLevel.TRACE) {
223
+ return LogLevelLabel.TRACE;
224
+ }
225
+ if (logLevel >= LogLevel.DEBUG) {
226
+ return LogLevelLabel.DEBUG;
227
+ }
228
+ if (logLevel >= LogLevel.PERFORMANCE) {
229
+ return LogLevelLabel.PERFORMANCE;
230
+ }
231
+ if (logLevel >= LogLevel.INFO) {
232
+ return LogLevelLabel.INFO;
233
+ }
234
+ if (logLevel >= LogLevel.WARN) {
235
+ return LogLevelLabel.WARN;
236
+ }
237
+ if (logLevel >= LogLevel.ERROR) {
238
+ return LogLevelLabel.ERROR;
239
+ }
240
+ if (logLevel >= LogLevel.FATAL) {
241
+ return LogLevelLabel.FATAL;
242
+ }
243
+ if (logLevel <= LogLevel.SILENT) {
244
+ return LogLevelLabel.SILENT;
245
+ }
246
+ return LogLevelLabel.INFO;
247
+ };
248
+ var isVerbose = (label = LogLevelLabel.SILENT) => {
249
+ const logLevel = typeof label === "string" ? getLogLevel(label) : label;
250
+ return logLevel >= LogLevel.DEBUG;
251
+ };
252
+
253
+ // ../config-tools/src/logger/console.ts
254
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, options = {}) => {
255
+ const {
256
+ chalk: _chalk = getChalk(),
257
+ fullDateTime = false,
258
+ hideDateTime = false
259
+ } = options;
260
+ 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;
261
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
262
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
263
+ return (_) => {
264
+ };
265
+ }
266
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
267
+ return (message) => {
268
+ console.error(
269
+ `
270
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
271
+ `[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
272
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
273
+ `
274
+ );
275
+ };
276
+ }
277
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
278
+ return (message) => {
279
+ console.error(
280
+ `
281
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
282
+ `[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
283
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
284
+ `
285
+ );
286
+ };
287
+ }
288
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
289
+ return (message) => {
290
+ console.warn(
291
+ `
292
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
293
+ `[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
294
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
295
+ `
296
+ );
297
+ };
298
+ }
299
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
300
+ return (message) => {
301
+ console.info(
302
+ `
303
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
304
+ `[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
305
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
306
+ `
307
+ );
308
+ };
309
+ }
310
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
311
+ return (message) => {
312
+ console.info(
313
+ `
314
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
315
+ `[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
316
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
317
+ `
318
+ );
319
+ };
320
+ }
321
+ if (typeof logLevel === "number" && LogLevel.PERFORMANCE >= logLevel) {
322
+ return (message) => {
323
+ console.debug(
324
+ `
325
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
326
+ `[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
327
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
328
+ `
329
+ );
330
+ };
331
+ }
332
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
333
+ return (message) => {
334
+ console.debug(
335
+ `
336
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
337
+ `[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
338
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
339
+ `
340
+ );
341
+ };
342
+ }
343
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
344
+ return (message) => {
345
+ console.debug(
346
+ `
347
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
348
+ `[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
349
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
350
+ `
351
+ );
352
+ };
353
+ }
354
+ return (message) => {
355
+ console.log(
356
+ `
357
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
358
+ `[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
359
+ )}${_chalk.bold.whiteBright(formatLogMessage(message))}
360
+ `
361
+ );
362
+ };
363
+ };
364
+ var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
365
+ var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
366
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
367
+ var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
368
+ var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
369
+ var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
370
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
371
+ var MAX_DEPTH = 10;
372
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
373
+ if (depth2 > MAX_DEPTH) {
374
+ return "<max depth>";
375
+ }
376
+ const prefix = options.prefix ?? "";
377
+ const skip = options.skip ?? [];
378
+ const sort = options.sort ?? true;
379
+ return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
380
+ ${message.sort(
381
+ sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
382
+ ).map(
383
+ (item, index) => ` ${prefix}> #${index} = ${formatLogMessage(
384
+ item,
385
+ { prefix: `${prefix}--`, skip, sort },
386
+ depth2 + 1
387
+ )}`
388
+ ).join("\n")}` : typeof message === "object" && message ? `
389
+ ${Object.keys(message).filter(
390
+ (key) => typeof key !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key.toLowerCase().trim())
391
+ ).sort(
392
+ sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
393
+ ).map(
394
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" && message[key] ? Object.keys(message[key]).filter(
395
+ (key2) => typeof key2 !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key2.toLowerCase().trim())
396
+ ).length === 0 ? "{}" : formatLogMessage(
397
+ message[key],
398
+ { prefix: `${prefix}--`, skip, sort },
399
+ depth2 + 1
400
+ ) : message[key]}`
401
+ ).join("\n")}` : String(message);
402
+ };
403
+ var _isFunction = (value) => {
404
+ try {
405
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
406
+ } catch {
407
+ return false;
408
+ }
409
+ };
410
+ var brandIcon = (config = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config))("\u{1F5F2}");
411
+
412
+ // ../config-tools/src/utilities/process-handler.ts
413
+ var exitWithError = (config) => {
414
+ writeFatal("Exiting script with an error status...", config);
415
+ process.exit(1);
416
+ };
417
+ var exitWithSuccess = (config) => {
418
+ writeSuccess("Script completed successfully. Exiting...", config);
419
+ process.exit(0);
420
+ };
421
+ var handleProcess = (config) => {
422
+ writeTrace(
423
+ `Using the following arguments to process the script: ${process.argv.join(", ")}`,
424
+ config
425
+ );
426
+ process.on("unhandledRejection", (error) => {
427
+ writeError(
428
+ `An Unhandled Rejection occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"}
429
+ Stacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`,
430
+ config
431
+ );
432
+ exitWithError(config);
433
+ });
434
+ process.on("uncaughtException", (error) => {
435
+ writeError(
436
+ `An Uncaught Exception occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"}
437
+ Stacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`,
438
+ config
439
+ );
440
+ exitWithError(config);
441
+ });
442
+ process.on("SIGTERM", (signal) => {
443
+ writeError(`The program terminated with signal code: ${signal}`, config);
444
+ exitWithError(config);
445
+ });
446
+ process.on("SIGINT", (signal) => {
447
+ writeError(`The program terminated with signal code: ${signal}`, config);
448
+ exitWithError(config);
449
+ });
450
+ process.on("SIGHUP", (signal) => {
451
+ writeError(`The program terminated with signal code: ${signal}`, config);
452
+ exitWithError(config);
453
+ });
454
+ };
455
+
456
+ // ../config/src/constants.ts
457
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
458
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
459
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
460
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
461
+ var STORM_DEFAULT_RELEASE_BANNER = "https://public.storm-cdn.com/storm-software/media/banner-1280x320.gif";
462
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
463
+ var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
464
+ var COLOR_KEYS = [
465
+ "dark",
466
+ "light",
467
+ "base",
468
+ "brand",
469
+ "alternate",
470
+ "accent",
471
+ "link",
472
+ "success",
473
+ "discovery",
474
+ "info",
475
+ "warning",
476
+ "danger",
477
+ "fatal",
478
+ "performance",
479
+ "positive",
480
+ "negative"
481
+ ];
482
+
483
+ // ../config/src/schema.ts
484
+ var schemaRegistry = z__namespace.registry();
485
+ var colorSchema = z__namespace.string().check(
486
+ z__namespace.length(7),
487
+ z__namespace.toLowerCase(),
488
+ z__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),
489
+ z__namespace.trim()
490
+ );
491
+ schemaRegistry.add(colorSchema, {
492
+ description: "A base schema for describing the format of colors"
493
+ });
494
+ var darkColorSchema = z__namespace._default(colorSchema, "#1e2124");
495
+ schemaRegistry.add(darkColorSchema, {
496
+ description: "The dark background color of the workspace"
497
+ });
498
+ var lightColorSchema = z__namespace._default(colorSchema, "#cbd5e1");
499
+ schemaRegistry.add(lightColorSchema, {
500
+ description: "The light background color of the workspace"
501
+ });
502
+ var brandColorSchema = z__namespace._default(colorSchema, "#1fb2a6");
503
+ schemaRegistry.add(brandColorSchema, {
504
+ description: "The primary brand specific color of the workspace"
505
+ });
506
+ var alternateColorSchema = z__namespace.optional(colorSchema);
507
+ schemaRegistry.add(alternateColorSchema, {
508
+ description: "The alternate brand specific color of the workspace"
509
+ });
510
+ var accentColorSchema = z__namespace.optional(colorSchema);
511
+ schemaRegistry.add(accentColorSchema, {
512
+ description: "The secondary brand specific color of the workspace"
513
+ });
514
+ var linkColorSchema = z__namespace._default(colorSchema, "#3fa6ff");
515
+ schemaRegistry.add(linkColorSchema, {
516
+ description: "The color used to display hyperlink text"
517
+ });
518
+ var discoveryColorSchema = z__namespace._default(colorSchema, "#818cf8");
519
+ schemaRegistry.add(discoveryColorSchema, {
520
+ description: "The second brand specific color of the workspace"
521
+ });
522
+ var successColorSchema = z__namespace._default(colorSchema, "#45b27e");
523
+ schemaRegistry.add(successColorSchema, {
524
+ description: "The success color of the workspace"
525
+ });
526
+ var infoColorSchema = z__namespace._default(colorSchema, "#38bdf8");
527
+ schemaRegistry.add(infoColorSchema, {
528
+ description: "The informational color of the workspace"
529
+ });
530
+ var debugColorSchema = z__namespace._default(colorSchema, "#8afafc");
531
+ schemaRegistry.add(debugColorSchema, {
532
+ description: "The debug color of the workspace"
533
+ });
534
+ var warningColorSchema = z__namespace._default(colorSchema, "#f3d371");
535
+ schemaRegistry.add(warningColorSchema, {
536
+ description: "The warning color of the workspace"
537
+ });
538
+ var dangerColorSchema = z__namespace._default(colorSchema, "#d8314a");
539
+ schemaRegistry.add(dangerColorSchema, {
540
+ description: "The danger color of the workspace"
541
+ });
542
+ var fatalColorSchema = z__namespace.optional(colorSchema);
543
+ schemaRegistry.add(fatalColorSchema, {
544
+ description: "The fatal color of the workspace"
545
+ });
546
+ var performanceColorSchema = z__namespace._default(colorSchema, "#80fd74");
547
+ schemaRegistry.add(performanceColorSchema, {
548
+ description: "The performance color of the workspace"
549
+ });
550
+ var positiveColorSchema = z__namespace._default(colorSchema, "#4ade80");
551
+ schemaRegistry.add(positiveColorSchema, {
552
+ description: "The positive number color of the workspace"
553
+ });
554
+ var negativeColorSchema = z__namespace._default(colorSchema, "#ef4444");
555
+ schemaRegistry.add(negativeColorSchema, {
556
+ description: "The negative number color of the workspace"
557
+ });
558
+ var gradientStopsSchema = z__namespace.optional(z__namespace.array(colorSchema));
559
+ schemaRegistry.add(gradientStopsSchema, {
560
+ description: "The color stops for the base gradient color pattern used in the workspace"
561
+ });
562
+ var darkColorsSchema = z__namespace.object({
563
+ foreground: lightColorSchema,
564
+ background: darkColorSchema,
565
+ brand: brandColorSchema,
566
+ alternate: alternateColorSchema,
567
+ accent: accentColorSchema,
568
+ link: linkColorSchema,
569
+ discovery: discoveryColorSchema,
570
+ success: successColorSchema,
571
+ info: infoColorSchema,
572
+ debug: debugColorSchema,
573
+ warning: warningColorSchema,
574
+ danger: dangerColorSchema,
575
+ fatal: fatalColorSchema,
576
+ performance: performanceColorSchema,
577
+ positive: positiveColorSchema,
578
+ negative: negativeColorSchema,
579
+ gradient: gradientStopsSchema
580
+ });
581
+ var lightColorsSchema = z__namespace.object({
582
+ foreground: darkColorSchema,
583
+ background: lightColorSchema,
584
+ brand: brandColorSchema,
585
+ alternate: alternateColorSchema,
586
+ accent: accentColorSchema,
587
+ link: linkColorSchema,
588
+ discovery: discoveryColorSchema,
589
+ success: successColorSchema,
590
+ info: infoColorSchema,
591
+ debug: debugColorSchema,
592
+ warning: warningColorSchema,
593
+ danger: dangerColorSchema,
594
+ fatal: fatalColorSchema,
595
+ performance: performanceColorSchema,
596
+ positive: positiveColorSchema,
597
+ negative: negativeColorSchema,
598
+ gradient: gradientStopsSchema
599
+ });
600
+ var multiColorsSchema = z__namespace.object({
601
+ dark: darkColorsSchema,
602
+ light: lightColorsSchema
603
+ });
604
+ var singleColorsSchema = z__namespace.object({
605
+ dark: darkColorSchema,
606
+ light: lightColorSchema,
607
+ brand: brandColorSchema,
608
+ alternate: alternateColorSchema,
609
+ accent: accentColorSchema,
610
+ link: linkColorSchema,
611
+ discovery: discoveryColorSchema,
612
+ success: successColorSchema,
613
+ info: infoColorSchema,
614
+ debug: debugColorSchema,
615
+ warning: warningColorSchema,
616
+ danger: dangerColorSchema,
617
+ fatal: fatalColorSchema,
618
+ performance: performanceColorSchema,
619
+ positive: positiveColorSchema,
620
+ negative: negativeColorSchema,
621
+ gradient: gradientStopsSchema
622
+ });
623
+ var registryUrlConfigSchema = z__namespace.optional(z__namespace.url());
624
+ schemaRegistry.add(registryUrlConfigSchema, {
625
+ description: "A remote registry URL used to publish distributable packages"
626
+ });
627
+ var registrySchema = z__namespace._default(
628
+ z__namespace.object({
629
+ github: registryUrlConfigSchema,
630
+ npm: registryUrlConfigSchema,
631
+ cargo: registryUrlConfigSchema,
632
+ cyclone: registryUrlConfigSchema,
633
+ container: registryUrlConfigSchema
634
+ }),
635
+ {}
636
+ );
637
+ schemaRegistry.add(registrySchema, {
638
+ description: "A list of remote registry URLs used by Storm Software"
639
+ });
640
+ var colorsSchema = z__namespace.union([singleColorsSchema, multiColorsSchema]);
641
+ schemaRegistry.add(colorsSchema, {
642
+ description: "Colors used for various workspace elements"
643
+ });
644
+ var themeColorsSchema = z__namespace.record(
645
+ z__namespace.union([z__namespace.union([z__namespace.literal("base"), z__namespace.string()]), z__namespace.string()]),
646
+ colorsSchema
647
+ );
648
+ schemaRegistry.add(themeColorsSchema, {
649
+ description: "Storm theme config values used for styling various package elements"
650
+ });
651
+ var extendsSchema = z__namespace.optional(
652
+ z__namespace.union([z__namespace.string().check(z__namespace.trim()), z__namespace.array(z__namespace.string().check(z__namespace.trim()))])
653
+ );
654
+ schemaRegistry.add(extendsSchema, {
655
+ description: "The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
656
+ });
657
+ var workspaceBotNameSchema = z__namespace.string().check(z__namespace.trim());
658
+ schemaRegistry.add(workspaceBotNameSchema, {
659
+ description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
660
+ });
661
+ var workspaceBotEmailSchema = z__namespace.string().check(z__namespace.trim());
662
+ schemaRegistry.add(workspaceBotEmailSchema, {
663
+ description: "The email of the workspace bot"
664
+ });
665
+ var workspaceBotSchema = z__namespace.object({
666
+ name: workspaceBotNameSchema,
667
+ email: workspaceBotEmailSchema
668
+ });
669
+ schemaRegistry.add(workspaceBotSchema, {
670
+ description: "The workspace's bot user's config used to automated various operations tasks"
671
+ });
672
+ var workspaceReleaseBannerUrlSchema = z__namespace.optional(
673
+ z__namespace.string().check(z__namespace.trim(), z__namespace.url())
674
+ );
675
+ schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
676
+ description: "A URL to a banner image used to display the workspace's release"
677
+ });
678
+ var workspaceReleaseBannerAltSchema = z__namespace._default(
679
+ z__namespace.string().check(z__namespace.trim()),
680
+ STORM_DEFAULT_BANNER_ALT
681
+ );
682
+ schemaRegistry.add(workspaceReleaseBannerAltSchema, {
683
+ description: "The alt text for the workspace's release banner image"
684
+ });
685
+ var workspaceReleaseBannerSchema = z__namespace.object({
686
+ url: workspaceReleaseBannerUrlSchema,
687
+ alt: workspaceReleaseBannerAltSchema
688
+ });
689
+ schemaRegistry.add(workspaceReleaseBannerSchema, {
690
+ description: "The workspace's banner image used during the release process"
691
+ });
692
+ var workspaceReleaseHeaderSchema = z__namespace.optional(
693
+ z__namespace.string().check(z__namespace.trim())
694
+ );
695
+ schemaRegistry.add(workspaceReleaseHeaderSchema, {
696
+ description: "A header message appended to the start of the workspace's release notes"
697
+ });
698
+ var workspaceReleaseFooterSchema = z__namespace.optional(
699
+ z__namespace.string().check(z__namespace.trim())
700
+ );
701
+ schemaRegistry.add(workspaceReleaseFooterSchema, {
702
+ description: "A footer message appended to the end of the workspace's release notes"
703
+ });
704
+ var workspaceReleaseSchema = z__namespace.object({
705
+ banner: z__namespace.union([
706
+ workspaceReleaseBannerSchema,
707
+ z__namespace.string().check(z__namespace.trim(), z__namespace.url())
708
+ ]),
709
+ header: workspaceReleaseHeaderSchema,
710
+ footer: workspaceReleaseFooterSchema
711
+ });
712
+ schemaRegistry.add(workspaceReleaseSchema, {
713
+ description: "The workspace's release config used during the release process"
714
+ });
715
+ var workspaceSocialsTwitterSchema = z__namespace.optional(
716
+ z__namespace.string().check(z__namespace.trim())
717
+ );
718
+ schemaRegistry.add(workspaceSocialsTwitterSchema, {
719
+ description: "A Twitter/X account associated with the organization/project"
720
+ });
721
+ var workspaceSocialsDiscordSchema = z__namespace.optional(
722
+ z__namespace.string().check(z__namespace.trim())
723
+ );
724
+ schemaRegistry.add(workspaceSocialsDiscordSchema, {
725
+ description: "A Discord account associated with the organization/project"
726
+ });
727
+ var workspaceSocialsTelegramSchema = z__namespace.optional(
728
+ z__namespace.string().check(z__namespace.trim())
729
+ );
730
+ schemaRegistry.add(workspaceSocialsTelegramSchema, {
731
+ description: "A Telegram account associated with the organization/project"
732
+ });
733
+ var workspaceSocialsSlackSchema = z__namespace.optional(
734
+ z__namespace.string().check(z__namespace.trim())
735
+ );
736
+ schemaRegistry.add(workspaceSocialsSlackSchema, {
737
+ description: "A Slack account associated with the organization/project"
738
+ });
739
+ var workspaceSocialsMediumSchema = z__namespace.optional(
740
+ z__namespace.string().check(z__namespace.trim())
741
+ );
742
+ schemaRegistry.add(workspaceSocialsMediumSchema, {
743
+ description: "A Medium account associated with the organization/project"
744
+ });
745
+ var workspaceSocialsGithubSchema = z__namespace.optional(
746
+ z__namespace.string().check(z__namespace.trim())
747
+ );
748
+ schemaRegistry.add(workspaceSocialsGithubSchema, {
749
+ description: "A GitHub account associated with the organization/project"
750
+ });
751
+ var workspaceSocialsSchema = z__namespace.object({
752
+ twitter: workspaceSocialsTwitterSchema,
753
+ discord: workspaceSocialsDiscordSchema,
754
+ telegram: workspaceSocialsTelegramSchema,
755
+ slack: workspaceSocialsSlackSchema,
756
+ medium: workspaceSocialsMediumSchema,
757
+ github: workspaceSocialsGithubSchema
758
+ });
759
+ schemaRegistry.add(workspaceSocialsSchema, {
760
+ description: "The workspace's account config used to store various social media links"
761
+ });
762
+ var workspaceDirectoryCacheSchema = z__namespace.optional(
763
+ z__namespace.string().check(z__namespace.trim())
764
+ );
765
+ schemaRegistry.add(workspaceDirectoryCacheSchema, {
766
+ description: "The directory used to store the environment's cached file data"
767
+ });
768
+ var workspaceDirectoryDataSchema = z__namespace.optional(
769
+ z__namespace.string().check(z__namespace.trim())
770
+ );
771
+ schemaRegistry.add(workspaceDirectoryDataSchema, {
772
+ description: "The directory used to store the environment's data files"
773
+ });
774
+ var workspaceDirectoryConfigSchema = z__namespace.optional(
775
+ z__namespace.string().check(z__namespace.trim())
776
+ );
777
+ schemaRegistry.add(workspaceDirectoryConfigSchema, {
778
+ description: "The directory used to store the environment's configuration files"
779
+ });
780
+ var workspaceDirectoryTempSchema = z__namespace.optional(
781
+ z__namespace.string().check(z__namespace.trim())
782
+ );
783
+ schemaRegistry.add(workspaceDirectoryTempSchema, {
784
+ description: "The directory used to store the environment's temp files"
785
+ });
786
+ var workspaceDirectoryLogSchema = z__namespace.optional(
787
+ z__namespace.string().check(z__namespace.trim())
788
+ );
789
+ schemaRegistry.add(workspaceDirectoryLogSchema, {
790
+ description: "The directory used to store the environment's log files"
791
+ });
792
+ var workspaceDirectoryBuildSchema = z__namespace._default(
793
+ z__namespace.string().check(z__namespace.trim()),
794
+ "dist"
795
+ );
796
+ schemaRegistry.add(workspaceDirectoryBuildSchema, {
797
+ description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
798
+ });
799
+ var workspaceDirectorySchema = z__namespace.object({
800
+ cache: workspaceDirectoryCacheSchema,
801
+ data: workspaceDirectoryDataSchema,
802
+ config: workspaceDirectoryConfigSchema,
803
+ temp: workspaceDirectoryTempSchema,
804
+ log: workspaceDirectoryLogSchema,
805
+ build: workspaceDirectoryBuildSchema
806
+ });
807
+ schemaRegistry.add(workspaceDirectorySchema, {
808
+ description: "Various directories used by the workspace to store data, cache, and configuration files"
809
+ });
810
+ var variantSchema = z__namespace._default(
811
+ z__namespace.enum(["minimal", "monorepo"]),
812
+ "monorepo"
813
+ );
814
+ schemaRegistry.add(variantSchema, {
815
+ description: "The variant of the workspace. This can be used to enable or disable certain features or configurations."
816
+ });
817
+ var errorCodesFileSchema = z__namespace._default(
818
+ z__namespace.string().check(z__namespace.trim()),
819
+ STORM_DEFAULT_ERROR_CODES_FILE
820
+ );
821
+ schemaRegistry.add(errorCodesFileSchema, {
822
+ description: "The path to the workspace's error codes JSON file"
823
+ });
824
+ var errorUrlSchema = z__namespace.optional(z__namespace.url());
825
+ schemaRegistry.add(errorUrlSchema, {
826
+ description: "A URL to a page that looks up the workspace's error messages given a specific error code"
827
+ });
828
+ var errorSchema = z__namespace.object({
829
+ codesFile: errorCodesFileSchema,
830
+ url: errorUrlSchema
831
+ });
832
+ schemaRegistry.add(errorSchema, {
833
+ description: "The workspace's error config used when creating error details during a system error"
834
+ });
835
+ var organizationNameSchema = z__namespace.optional(
836
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
837
+ );
838
+ schemaRegistry.add(organizationNameSchema, {
839
+ description: "The name of the organization"
840
+ });
841
+ var organizationDescriptionSchema = z__namespace.optional(
842
+ z__namespace.string().check(z__namespace.trim())
843
+ );
844
+ schemaRegistry.add(organizationDescriptionSchema, {
845
+ description: "A description of the organization"
846
+ });
847
+ var organizationLogoSchema = z__namespace.optional(z__namespace.url());
848
+ schemaRegistry.add(organizationLogoSchema, {
849
+ description: "A URL to the organization's logo image"
850
+ });
851
+ var organizationIconSchema = z__namespace.optional(z__namespace.url());
852
+ schemaRegistry.add(organizationIconSchema, {
853
+ description: "A URL to the organization's icon image"
854
+ });
855
+ var organizationUrlSchema = z__namespace.optional(z__namespace.url());
856
+ schemaRegistry.add(organizationUrlSchema, {
857
+ description: "A URL to a page that provides more information about the organization"
858
+ });
859
+ var organizationSchema = z__namespace.object({
860
+ name: organizationNameSchema,
861
+ description: organizationDescriptionSchema,
862
+ logo: organizationLogoSchema,
863
+ icon: organizationIconSchema,
864
+ url: organizationUrlSchema
865
+ });
866
+ schemaRegistry.add(organizationSchema, {
867
+ description: "The workspace's organization details"
868
+ });
869
+ var schemaNameSchema = z__namespace._default(
870
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase()),
871
+ "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
872
+ );
873
+ schemaRegistry.add(schemaNameSchema, {
874
+ description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
875
+ });
876
+ var nameSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
877
+ schemaRegistry.add(nameSchema, {
878
+ description: "The name of the workspace/project/service/package/scope using this configuration"
879
+ });
880
+ var namespaceSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
881
+ schemaRegistry.add(namespaceSchema, {
882
+ description: "The namespace of the workspace/project/service/package/scope using this configuration"
883
+ });
884
+ var orgSchema = z__namespace.union([
885
+ organizationSchema,
886
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
887
+ ]);
888
+ schemaRegistry.add(orgSchema, {
889
+ description: "The organization of the workspace. This can be a string or an object containing the organization's details"
890
+ });
891
+ var repositorySchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
892
+ schemaRegistry.add(repositorySchema, {
893
+ description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
894
+ });
895
+ var licenseSchema = z__namespace._default(
896
+ z__namespace.string().check(z__namespace.trim()),
897
+ "Apache-2.0"
898
+ );
899
+ schemaRegistry.add(licenseSchema, {
900
+ description: "The license type of the package"
901
+ });
902
+ var homepageSchema = z__namespace.optional(z__namespace.url());
903
+ schemaRegistry.add(homepageSchema, {
904
+ description: "The homepage of the workspace"
905
+ });
906
+ var docsSchema = z__namespace.optional(z__namespace.url());
907
+ schemaRegistry.add(docsSchema, {
908
+ description: "The documentation site for the workspace"
909
+ });
910
+ var portalSchema = z__namespace.optional(z__namespace.url());
911
+ schemaRegistry.add(portalSchema, {
912
+ description: "The development portal site for the workspace"
913
+ });
914
+ var licensingSchema = z__namespace.optional(z__namespace.url());
915
+ schemaRegistry.add(licensingSchema, {
916
+ description: "The licensing site for the workspace"
917
+ });
918
+ var contactSchema = z__namespace.optional(z__namespace.url());
919
+ schemaRegistry.add(contactSchema, {
920
+ description: "The contact site for the workspace"
921
+ });
922
+ var supportSchema = z__namespace.optional(z__namespace.url());
923
+ schemaRegistry.add(supportSchema, {
924
+ description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
925
+ });
926
+ var branchSchema = z__namespace._default(
927
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase()),
928
+ "main"
929
+ );
930
+ schemaRegistry.add(branchSchema, {
931
+ description: "The branch of the workspace"
932
+ });
933
+ var preidSchema = z__namespace.optional(
934
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
935
+ );
936
+ schemaRegistry.add(preidSchema, {
937
+ description: "A tag specifying the version pre-release identifier"
938
+ });
939
+ var ownerSchema = z__namespace.optional(
940
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
941
+ );
942
+ schemaRegistry.add(ownerSchema, {
943
+ description: "The owner of the package"
944
+ });
945
+ var modeSchema = z__namespace._default(
946
+ z__namespace.enum(["development", "test", "production"]).check(z__namespace.trim(), z__namespace.toLowerCase()),
947
+ "production"
948
+ );
949
+ schemaRegistry.add(modeSchema, {
950
+ description: "The current runtime environment mode for the package"
951
+ });
952
+ var workspaceRootSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
953
+ schemaRegistry.add(workspaceRootSchema, {
954
+ description: "The root directory of the workspace"
955
+ });
956
+ var skipCacheSchema = z__namespace._default(z__namespace.boolean(), false);
957
+ schemaRegistry.add(skipCacheSchema, {
958
+ description: "Should all known types of workspace caching be skipped?"
959
+ });
960
+ var packageManagerSchema = z__namespace._default(
961
+ z__namespace.enum(["npm", "yarn", "pnpm", "bun"]),
962
+ "npm"
963
+ );
964
+ schemaRegistry.add(packageManagerSchema, {
965
+ description: "The JavaScript/TypeScript package manager used by the repository"
966
+ });
967
+ var timezoneSchema = z__namespace._default(
968
+ z__namespace.string().check(z__namespace.trim()),
969
+ "America/New_York"
970
+ );
971
+ schemaRegistry.add(timezoneSchema, {
972
+ description: "The default timezone of the workspace"
973
+ });
974
+ var localeSchema = z__namespace._default(z__namespace.string().check(z__namespace.trim()), "en-US");
975
+ schemaRegistry.add(localeSchema, {
976
+ description: "The default locale of the workspace"
977
+ });
978
+ var logLevelSchema = z__namespace._default(
979
+ z__namespace.enum([
980
+ "silent",
981
+ "fatal",
982
+ "error",
983
+ "warn",
984
+ "success",
985
+ "info",
986
+ "performance",
987
+ "debug",
988
+ "trace",
989
+ "all"
990
+ ]),
991
+ "info"
992
+ );
993
+ schemaRegistry.add(logLevelSchema, {
994
+ description: "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
995
+ });
996
+ var skipConfigLoggingSchema = z__namespace._default(z__namespace.boolean(), true);
997
+ schemaRegistry.add(skipConfigLoggingSchema, {
998
+ description: "Should the logging of the current Storm Workspace configuration be skipped?"
999
+ });
1000
+ var configFileSchema = z__namespace._default(
1001
+ z__namespace.nullable(z__namespace.string().check(z__namespace.trim())),
1002
+ null
1003
+ );
1004
+ schemaRegistry.add(configFileSchema, {
1005
+ description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
1006
+ });
1007
+ var extensionsSchema = z__namespace._default(z__namespace.record(z__namespace.string(), z__namespace.any()), {});
1008
+ schemaRegistry.add(extensionsSchema, {
1009
+ description: "Configuration of each used extension"
1010
+ });
1011
+ var workspaceConfigSchema = z__namespace.object({
1012
+ $schema: schemaNameSchema,
1013
+ extends: extendsSchema,
1014
+ name: nameSchema,
1015
+ variant: variantSchema,
1016
+ namespace: namespaceSchema,
1017
+ organization: orgSchema,
1018
+ repository: repositorySchema,
1019
+ license: licenseSchema,
1020
+ homepage: homepageSchema,
1021
+ docs: docsSchema,
1022
+ portal: portalSchema,
1023
+ licensing: licensingSchema,
1024
+ contact: contactSchema,
1025
+ support: supportSchema,
1026
+ branch: branchSchema,
1027
+ preid: preidSchema,
1028
+ owner: ownerSchema,
1029
+ bot: workspaceBotSchema,
1030
+ release: workspaceReleaseSchema,
1031
+ socials: workspaceSocialsSchema,
1032
+ error: errorSchema,
1033
+ mode: modeSchema,
1034
+ workspaceRoot: workspaceRootSchema,
1035
+ skipCache: skipCacheSchema,
1036
+ directories: workspaceDirectorySchema,
1037
+ packageManager: packageManagerSchema,
1038
+ timezone: timezoneSchema,
1039
+ locale: localeSchema,
1040
+ logLevel: logLevelSchema,
1041
+ skipConfigLogging: skipConfigLoggingSchema,
1042
+ registry: registrySchema,
1043
+ configFile: configFileSchema,
1044
+ colors: z__namespace.union([colorsSchema, themeColorsSchema]),
1045
+ extensions: extensionsSchema
1046
+ });
1047
+ schemaRegistry.add(extensionsSchema, {
1048
+ description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
1049
+ });
1050
+
1051
+ // ../config-tools/src/utilities/correct-paths.ts
1052
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
1053
+ function normalizeWindowsPath(input = "") {
1054
+ if (!input) {
1055
+ return input;
1056
+ }
1057
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
1058
+ }
1059
+ var _UNC_REGEX = /^[/\\]{2}/;
1060
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
1061
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
1062
+ var correctPaths = function(path) {
1063
+ if (!path || path.length === 0) {
1064
+ return ".";
1065
+ }
1066
+ path = normalizeWindowsPath(path);
1067
+ const isUNCPath = path?.match(_UNC_REGEX);
1068
+ const isPathAbsolute = isAbsolute(path);
1069
+ const trailingSeparator = path[path.length - 1] === "/";
1070
+ path = normalizeString(path, !isPathAbsolute);
1071
+ if (path.length === 0) {
1072
+ if (isPathAbsolute) {
1073
+ return "/";
1074
+ }
1075
+ return trailingSeparator ? "./" : ".";
1076
+ }
1077
+ if (trailingSeparator) {
1078
+ path += "/";
1079
+ }
1080
+ if (_DRIVE_LETTER_RE.test(path)) {
1081
+ path += "/";
1082
+ }
1083
+ if (isUNCPath) {
1084
+ if (!isPathAbsolute) {
1085
+ return `//./${path}`;
1086
+ }
1087
+ return `//${path}`;
1088
+ }
1089
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
1090
+ };
1091
+ var joinPaths = function(...segments) {
1092
+ let path = "";
1093
+ for (const seg of segments) {
1094
+ if (!seg) {
1095
+ continue;
1096
+ }
1097
+ if (path.length > 0) {
1098
+ const pathTrailing = path[path.length - 1] === "/";
1099
+ const segLeading = seg[0] === "/";
1100
+ const both = pathTrailing && segLeading;
1101
+ if (both) {
1102
+ path += seg.slice(1);
1103
+ } else {
1104
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
1105
+ }
1106
+ } else {
1107
+ path += seg;
1108
+ }
1109
+ }
1110
+ return correctPaths(path);
1111
+ };
1112
+ function normalizeString(path, allowAboveRoot) {
1113
+ let res = "";
1114
+ let lastSegmentLength = 0;
1115
+ let lastSlash = -1;
1116
+ let dots = 0;
1117
+ let char = null;
1118
+ for (let index = 0; index <= path.length; ++index) {
1119
+ if (index < path.length) {
1120
+ char = path[index];
1121
+ } else if (char === "/") {
1122
+ break;
1123
+ } else {
1124
+ char = "/";
1125
+ }
1126
+ if (char === "/") {
1127
+ if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
1128
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
1129
+ if (res.length > 2) {
1130
+ const lastSlashIndex = res.lastIndexOf("/");
1131
+ if (lastSlashIndex === -1) {
1132
+ res = "";
1133
+ lastSegmentLength = 0;
1134
+ } else {
1135
+ res = res.slice(0, lastSlashIndex);
1136
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
1137
+ }
1138
+ lastSlash = index;
1139
+ dots = 0;
1140
+ continue;
1141
+ } else if (res.length > 0) {
1142
+ res = "";
1143
+ lastSegmentLength = 0;
1144
+ lastSlash = index;
1145
+ dots = 0;
1146
+ continue;
1147
+ }
1148
+ }
1149
+ if (allowAboveRoot) {
1150
+ res += res.length > 0 ? "/.." : "..";
1151
+ lastSegmentLength = 2;
1152
+ }
1153
+ } else {
1154
+ if (res.length > 0) {
1155
+ res += `/${path.slice(lastSlash + 1, index)}`;
1156
+ } else {
1157
+ res = path.slice(lastSlash + 1, index);
1158
+ }
1159
+ lastSegmentLength = index - lastSlash - 1;
1160
+ }
1161
+ lastSlash = index;
1162
+ dots = 0;
1163
+ } else if (char === "." && dots !== -1) {
1164
+ ++dots;
1165
+ } else {
1166
+ dots = -1;
1167
+ }
1168
+ }
1169
+ return res;
1170
+ }
1171
+ var isAbsolute = function(p) {
1172
+ return _IS_ABSOLUTE_RE.test(p);
1173
+ };
1174
+ var MAX_PATH_SEARCH_DEPTH = 30;
1175
+ var depth = 0;
1176
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
1177
+ const _startPath = startPath ?? process.cwd();
1178
+ if (endDirectoryNames.some(
1179
+ (endDirName) => fs.existsSync(path.join(_startPath, endDirName))
1180
+ )) {
1181
+ return _startPath;
1182
+ }
1183
+ if (endFileNames.some((endFileName) => fs.existsSync(path.join(_startPath, endFileName)))) {
1184
+ return _startPath;
1185
+ }
1186
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
1187
+ const parent = path.join(_startPath, "..");
1188
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
1189
+ }
1190
+ return void 0;
1191
+ }
1192
+
1193
+ // ../config-tools/src/utilities/find-workspace-root.ts
1194
+ var rootFiles = [
1195
+ "storm-workspace.json",
1196
+ "storm-workspace.yaml",
1197
+ "storm-workspace.yml",
1198
+ "storm-workspace.js",
1199
+ "storm-workspace.ts",
1200
+ ".storm-workspace.json",
1201
+ ".storm-workspace.yaml",
1202
+ ".storm-workspace.yml",
1203
+ ".storm-workspace.js",
1204
+ ".storm-workspace.ts",
1205
+ "lerna.json",
1206
+ "nx.json",
1207
+ "turbo.json",
1208
+ "npm-workspace.json",
1209
+ "yarn-workspace.json",
1210
+ "pnpm-workspace.json",
1211
+ "npm-workspace.yaml",
1212
+ "yarn-workspace.yaml",
1213
+ "pnpm-workspace.yaml",
1214
+ "npm-workspace.yml",
1215
+ "yarn-workspace.yml",
1216
+ "pnpm-workspace.yml",
1217
+ "npm-lock.json",
1218
+ "yarn-lock.json",
1219
+ "pnpm-lock.json",
1220
+ "npm-lock.yaml",
1221
+ "yarn-lock.yaml",
1222
+ "pnpm-lock.yaml",
1223
+ "npm-lock.yml",
1224
+ "yarn-lock.yml",
1225
+ "pnpm-lock.yml",
1226
+ "bun.lockb",
1227
+ "bun.lock",
1228
+ "bunfig.toml"
1229
+ ];
1230
+ var rootDirectories = [
1231
+ ".storm-workspace",
1232
+ ".nx",
1233
+ ".git",
1234
+ ".github",
1235
+ ".vscode",
1236
+ ".verdaccio"
1237
+ ];
1238
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
1239
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
1240
+ return correctPaths(
1241
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
1242
+ );
1243
+ }
1244
+ return correctPaths(
1245
+ findFolderUp(
1246
+ pathInsideMonorepo ?? process.cwd(),
1247
+ rootFiles,
1248
+ rootDirectories
1249
+ )
1250
+ );
1251
+ }
1252
+ function findWorkspaceRoot(pathInsideMonorepo) {
1253
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
1254
+ if (!result) {
1255
+ throw new Error(
1256
+ `Cannot find workspace root upwards from known path. Files search list includes:
1257
+ ${rootFiles.join(
1258
+ "\n"
1259
+ )}
1260
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
1261
+ );
1262
+ }
1263
+ return result;
1264
+ }
1265
+ async function getPackageJsonConfig(root) {
1266
+ let license = STORM_DEFAULT_LICENSE;
1267
+ let homepage = void 0;
1268
+ let support = void 0;
1269
+ let name = void 0;
1270
+ let namespace = void 0;
1271
+ let repository = void 0;
1272
+ const workspaceRoot = findWorkspaceRoot(root);
1273
+ if (fs.existsSync(path.join(workspaceRoot, "package.json"))) {
1274
+ const file = await promises.readFile(
1275
+ joinPaths(workspaceRoot, "package.json"),
1276
+ "utf8"
1277
+ );
1278
+ if (file) {
1279
+ const packageJson = JSON.parse(file);
1280
+ if (packageJson.name) {
1281
+ name = packageJson.name;
1282
+ }
1283
+ if (packageJson.namespace) {
1284
+ namespace = packageJson.namespace;
1285
+ }
1286
+ if (packageJson.repository) {
1287
+ if (typeof packageJson.repository === "string") {
1288
+ repository = packageJson.repository;
1289
+ } else if (packageJson.repository.url) {
1290
+ repository = packageJson.repository.url;
1291
+ }
1292
+ }
1293
+ if (packageJson.license) {
1294
+ license = packageJson.license;
1295
+ }
1296
+ if (packageJson.homepage) {
1297
+ homepage = packageJson.homepage;
1298
+ }
1299
+ if (packageJson.bugs) {
1300
+ if (typeof packageJson.bugs === "string") {
1301
+ support = packageJson.bugs;
1302
+ } else if (packageJson.bugs.url) {
1303
+ support = packageJson.bugs.url;
1304
+ }
1305
+ }
1306
+ }
1307
+ }
1308
+ return {
1309
+ workspaceRoot,
1310
+ name,
1311
+ namespace,
1312
+ repository,
1313
+ license,
1314
+ homepage,
1315
+ support
1316
+ };
1317
+ }
1318
+ function applyDefaultConfig(config) {
1319
+ if (!config.support && config.contact) {
1320
+ config.support = config.contact;
1321
+ }
1322
+ if (!config.contact && config.support) {
1323
+ config.contact = config.support;
1324
+ }
1325
+ if (config.homepage) {
1326
+ if (!config.docs) {
1327
+ config.docs = `${config.homepage}/docs`;
1328
+ }
1329
+ if (!config.license) {
1330
+ config.license = `${config.homepage}/license`;
1331
+ }
1332
+ if (!config.support) {
1333
+ config.support = `${config.homepage}/support`;
1334
+ }
1335
+ if (!config.contact) {
1336
+ config.contact = `${config.homepage}/contact`;
1337
+ }
1338
+ if (!config.error?.codesFile || !config?.error?.url) {
1339
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
1340
+ if (config.homepage) {
1341
+ config.error.url ??= `${config.homepage}/errors`;
1342
+ }
1343
+ }
1344
+ }
1345
+ return config;
1346
+ }
1347
+
1348
+ // ../config-tools/src/config-file/get-config-file.ts
1349
+ var getConfigFileByName = async (fileName, filePath, options = {}) => {
1350
+ const workspacePath = filePath || findWorkspaceRoot(filePath);
1351
+ const configs = await Promise.all([
1352
+ c12.loadConfig({
1353
+ cwd: workspacePath,
1354
+ packageJson: true,
1355
+ name: fileName,
1356
+ envName: fileName?.toUpperCase(),
1357
+ jitiOptions: {
1358
+ debug: false,
1359
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
1360
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1361
+ "jiti"
1362
+ )
1363
+ },
1364
+ ...options
1365
+ }),
1366
+ c12.loadConfig({
1367
+ cwd: workspacePath,
1368
+ packageJson: true,
1369
+ name: fileName,
1370
+ envName: fileName?.toUpperCase(),
1371
+ jitiOptions: {
1372
+ debug: false,
1373
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
1374
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1375
+ "jiti"
1376
+ )
1377
+ },
1378
+ configFile: fileName,
1379
+ ...options
1380
+ })
1381
+ ]);
1382
+ return defu__default.default(configs[0] ?? {}, configs[1] ?? {});
1383
+ };
1384
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
1385
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
1386
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
1387
+ let config = result.config;
1388
+ const configFile = result.configFile;
1389
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
1390
+ writeTrace(
1391
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
1392
+ {
1393
+ logLevel: "all"
1394
+ }
1395
+ );
1396
+ }
1397
+ if (additionalFileNames && additionalFileNames.length > 0) {
1398
+ const results = await Promise.all(
1399
+ additionalFileNames.map(
1400
+ (fileName) => getConfigFileByName(fileName, workspacePath)
1401
+ )
1402
+ );
1403
+ for (const result2 of results) {
1404
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
1405
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
1406
+ writeTrace(
1407
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
1408
+ {
1409
+ logLevel: "all"
1410
+ }
1411
+ );
1412
+ }
1413
+ config = defu__default.default(result2.config ?? {}, config ?? {});
1414
+ }
1415
+ }
1416
+ }
1417
+ if (!config || Object.keys(config).length === 0) {
1418
+ return void 0;
1419
+ }
1420
+ config.configFile = configFile;
1421
+ return config;
1422
+ };
1423
+ var getConfigEnv = () => {
1424
+ const prefix = "STORM_";
1425
+ let config = {
1426
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
1427
+ name: process.env[`${prefix}NAME`] || void 0,
1428
+ variant: process.env[`${prefix}VARIANT`] || void 0,
1429
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
1430
+ owner: process.env[`${prefix}OWNER`] || void 0,
1431
+ bot: {
1432
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
1433
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
1434
+ },
1435
+ release: {
1436
+ banner: {
1437
+ url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
1438
+ alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
1439
+ },
1440
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
1441
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
1442
+ },
1443
+ error: {
1444
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
1445
+ url: process.env[`${prefix}ERROR_URL`] || void 0
1446
+ },
1447
+ socials: {
1448
+ twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
1449
+ discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
1450
+ telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
1451
+ slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
1452
+ medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
1453
+ github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
1454
+ },
1455
+ organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
1456
+ name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
1457
+ description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
1458
+ url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
1459
+ logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
1460
+ icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
1461
+ } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
1462
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
1463
+ license: process.env[`${prefix}LICENSE`] || void 0,
1464
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
1465
+ docs: process.env[`${prefix}DOCS`] || void 0,
1466
+ portal: process.env[`${prefix}PORTAL`] || void 0,
1467
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
1468
+ contact: process.env[`${prefix}CONTACT`] || void 0,
1469
+ support: process.env[`${prefix}SUPPORT`] || void 0,
1470
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
1471
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
1472
+ configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
1473
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
1474
+ directories: {
1475
+ cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
1476
+ data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
1477
+ config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
1478
+ temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
1479
+ log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
1480
+ build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
1481
+ },
1482
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
1483
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
1484
+ // ci:
1485
+ // process.env[`${prefix}CI`] !== undefined
1486
+ // ? Boolean(
1487
+ // process.env[`${prefix}CI`] ??
1488
+ // process.env.CI ??
1489
+ // process.env.CONTINUOUS_INTEGRATION
1490
+ // )
1491
+ // : undefined,
1492
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
1493
+ branch: process.env[`${prefix}BRANCH`] || void 0,
1494
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
1495
+ registry: {
1496
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
1497
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
1498
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
1499
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
1500
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
1501
+ },
1502
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
1503
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1504
+ ) ? getLogLevelLabel(
1505
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1506
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
1507
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
1508
+ };
1509
+ const themeNames = Object.keys(process.env).filter(
1510
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
1511
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
1512
+ )
1513
+ );
1514
+ config.colors = themeNames.length > 0 ? themeNames.reduce(
1515
+ (ret, themeName) => {
1516
+ ret[themeName] = getThemeColorsEnv(prefix, themeName);
1517
+ return ret;
1518
+ },
1519
+ {}
1520
+ ) : getThemeColorsEnv(prefix);
1521
+ if (config.docs === STORM_DEFAULT_DOCS) {
1522
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
1523
+ config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
1524
+ } else {
1525
+ config.docs = `${config.homepage}/docs`;
1526
+ }
1527
+ }
1528
+ if (config.licensing === STORM_DEFAULT_LICENSING) {
1529
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
1530
+ config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
1531
+ } else {
1532
+ config.licensing = `${config.homepage}/docs`;
1533
+ }
1534
+ }
1535
+ const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
1536
+ if (serializedConfig) {
1537
+ const parsed = JSON.parse(serializedConfig);
1538
+ config = {
1539
+ ...config,
1540
+ ...parsed,
1541
+ colors: { ...config.colors, ...parsed.colors },
1542
+ extensions: { ...config.extensions, ...parsed.extensions }
1543
+ };
1544
+ }
1545
+ return config;
1546
+ };
1547
+ var getThemeColorsEnv = (prefix, theme) => {
1548
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
1549
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
1550
+ };
1551
+ var getSingleThemeColorsEnv = (prefix) => {
1552
+ const gradient = [];
1553
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1554
+ gradient.push(
1555
+ process.env[`${prefix}GRADIENT_START`],
1556
+ process.env[`${prefix}GRADIENT_END`]
1557
+ );
1558
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1559
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1560
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1561
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1562
+ index++;
1563
+ }
1564
+ }
1565
+ return {
1566
+ dark: process.env[`${prefix}DARK`],
1567
+ light: process.env[`${prefix}LIGHT`],
1568
+ brand: process.env[`${prefix}BRAND`],
1569
+ alternate: process.env[`${prefix}ALTERNATE`],
1570
+ accent: process.env[`${prefix}ACCENT`],
1571
+ link: process.env[`${prefix}LINK`],
1572
+ discovery: process.env[`${prefix}DISCOVERY`],
1573
+ success: process.env[`${prefix}SUCCESS`],
1574
+ info: process.env[`${prefix}INFO`],
1575
+ debug: process.env[`${prefix}DEBUG`],
1576
+ warning: process.env[`${prefix}WARNING`],
1577
+ danger: process.env[`${prefix}DANGER`],
1578
+ fatal: process.env[`${prefix}FATAL`],
1579
+ performance: process.env[`${prefix}PERFORMANCE`],
1580
+ positive: process.env[`${prefix}POSITIVE`],
1581
+ negative: process.env[`${prefix}NEGATIVE`],
1582
+ gradient
1583
+ };
1584
+ };
1585
+ var getMultiThemeColorsEnv = (prefix) => {
1586
+ return {
1587
+ light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
1588
+ dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
1589
+ };
1590
+ };
1591
+ var getBaseThemeColorsEnv = (prefix) => {
1592
+ const gradient = [];
1593
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1594
+ gradient.push(
1595
+ process.env[`${prefix}GRADIENT_START`],
1596
+ process.env[`${prefix}GRADIENT_END`]
1597
+ );
1598
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1599
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1600
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1601
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1602
+ index++;
1603
+ }
1604
+ }
1605
+ return {
1606
+ foreground: process.env[`${prefix}FOREGROUND`],
1607
+ background: process.env[`${prefix}BACKGROUND`],
1608
+ brand: process.env[`${prefix}BRAND`],
1609
+ alternate: process.env[`${prefix}ALTERNATE`],
1610
+ accent: process.env[`${prefix}ACCENT`],
1611
+ link: process.env[`${prefix}LINK`],
1612
+ discovery: process.env[`${prefix}DISCOVERY`],
1613
+ success: process.env[`${prefix}SUCCESS`],
1614
+ info: process.env[`${prefix}INFO`],
1615
+ debug: process.env[`${prefix}DEBUG`],
1616
+ warning: process.env[`${prefix}WARNING`],
1617
+ danger: process.env[`${prefix}DANGER`],
1618
+ fatal: process.env[`${prefix}FATAL`],
1619
+ performance: process.env[`${prefix}PERFORMANCE`],
1620
+ positive: process.env[`${prefix}POSITIVE`],
1621
+ negative: process.env[`${prefix}NEGATIVE`],
1622
+ gradient
1623
+ };
1624
+ };
1625
+
1626
+ // ../config-tools/src/env/set-env.ts
1627
+ var setExtensionEnv = (extensionName, extension) => {
1628
+ for (const key of Object.keys(extension ?? {})) {
1629
+ if (extension[key]) {
1630
+ const result = key?.replace(
1631
+ /([A-Z])+/g,
1632
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
1633
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
1634
+ let extensionKey;
1635
+ if (result.length === 0) {
1636
+ return;
1637
+ }
1638
+ if (result.length === 1) {
1639
+ extensionKey = result[0]?.toUpperCase() ?? "";
1640
+ } else {
1641
+ extensionKey = result.reduce((ret, part) => {
1642
+ return `${ret}_${part.toLowerCase()}`;
1643
+ });
1644
+ }
1645
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
1646
+ }
1647
+ }
1648
+ };
1649
+ var setConfigEnv = (config) => {
1650
+ const prefix = "STORM_";
1651
+ if (config.extends) {
1652
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
1653
+ }
1654
+ if (config.name) {
1655
+ process.env[`${prefix}NAME`] = config.name;
1656
+ }
1657
+ if (config.variant) {
1658
+ process.env[`${prefix}VARIANT`] = config.variant;
1659
+ }
1660
+ if (config.namespace) {
1661
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
1662
+ }
1663
+ if (config.owner) {
1664
+ process.env[`${prefix}OWNER`] = config.owner;
1665
+ }
1666
+ if (config.bot) {
1667
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
1668
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
1669
+ }
1670
+ if (config.error) {
1671
+ process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
1672
+ process.env[`${prefix}ERROR_URL`] = config.error.url;
1673
+ }
1674
+ if (config.release) {
1675
+ if (config.release.banner) {
1676
+ if (typeof config.release.banner === "string") {
1677
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
1678
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
1679
+ } else {
1680
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
1681
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
1682
+ process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
1683
+ }
1684
+ }
1685
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
1686
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1687
+ }
1688
+ if (config.socials) {
1689
+ if (config.socials.twitter) {
1690
+ process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
1691
+ }
1692
+ if (config.socials.discord) {
1693
+ process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
1694
+ }
1695
+ if (config.socials.telegram) {
1696
+ process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
1697
+ }
1698
+ if (config.socials.slack) {
1699
+ process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
1700
+ }
1701
+ if (config.socials.medium) {
1702
+ process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
1703
+ }
1704
+ if (config.socials.github) {
1705
+ process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
1706
+ }
1707
+ }
1708
+ if (config.organization) {
1709
+ if (typeof config.organization === "string") {
1710
+ process.env[`${prefix}ORG`] = config.organization;
1711
+ process.env[`${prefix}ORG_NAME`] = config.organization;
1712
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
1713
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
1714
+ } else {
1715
+ process.env[`${prefix}ORG`] = config.organization.name;
1716
+ process.env[`${prefix}ORG_NAME`] = config.organization.name;
1717
+ process.env[`${prefix}ORGANIZATION`] = config.organization.name;
1718
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
1719
+ if (config.organization.url) {
1720
+ process.env[`${prefix}ORG_URL`] = config.organization.url;
1721
+ process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
1722
+ }
1723
+ if (config.organization.description) {
1724
+ process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
1725
+ process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
1726
+ }
1727
+ if (config.organization.logo) {
1728
+ process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
1729
+ process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
1730
+ }
1731
+ if (config.organization.icon) {
1732
+ process.env[`${prefix}ORG_ICON`] = config.organization.icon;
1733
+ process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
1734
+ }
1735
+ }
1736
+ }
1737
+ if (config.packageManager) {
1738
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
1739
+ }
1740
+ if (config.license) {
1741
+ process.env[`${prefix}LICENSE`] = config.license;
1742
+ }
1743
+ if (config.homepage) {
1744
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
1745
+ }
1746
+ if (config.docs) {
1747
+ process.env[`${prefix}DOCS`] = config.docs;
1748
+ }
1749
+ if (config.portal) {
1750
+ process.env[`${prefix}PORTAL`] = config.portal;
1751
+ }
1752
+ if (config.licensing) {
1753
+ process.env[`${prefix}LICENSING`] = config.licensing;
1754
+ }
1755
+ if (config.contact) {
1756
+ process.env[`${prefix}CONTACT`] = config.contact;
1757
+ }
1758
+ if (config.support) {
1759
+ process.env[`${prefix}SUPPORT`] = config.support;
1760
+ }
1761
+ if (config.timezone) {
1762
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
1763
+ process.env.TZ = config.timezone;
1764
+ process.env.DEFAULT_TIMEZONE = config.timezone;
1765
+ process.env.TIMEZONE = config.timezone;
1766
+ }
1767
+ if (config.locale) {
1768
+ process.env[`${prefix}LOCALE`] = config.locale;
1769
+ process.env.DEFAULT_LOCALE = config.locale;
1770
+ process.env.LOCALE = config.locale;
1771
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1772
+ }
1773
+ if (config.configFile) {
1774
+ process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
1775
+ config.configFile
1776
+ );
1777
+ }
1778
+ if (config.workspaceRoot) {
1779
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
1780
+ process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
1781
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
1782
+ }
1783
+ if (config.directories) {
1784
+ if (!config.skipCache && config.directories.cache) {
1785
+ process.env[`${prefix}CACHE_DIR`] = correctPaths(
1786
+ config.directories.cache
1787
+ );
1788
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1789
+ }
1790
+ if (config.directories.data) {
1791
+ process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
1792
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1793
+ }
1794
+ if (config.directories.config) {
1795
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths(
1796
+ config.directories.config
1797
+ );
1798
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1799
+ }
1800
+ if (config.directories.temp) {
1801
+ process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
1802
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1803
+ }
1804
+ if (config.directories.log) {
1805
+ process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
1806
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1807
+ }
1808
+ if (config.directories.build) {
1809
+ process.env[`${prefix}BUILD_DIR`] = correctPaths(
1810
+ config.directories.build
1811
+ );
1812
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1813
+ }
1814
+ }
1815
+ if (config.skipCache !== void 0) {
1816
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
1817
+ if (config.skipCache) {
1818
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
1819
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
1820
+ }
1821
+ }
1822
+ if (config.mode) {
1823
+ process.env[`${prefix}MODE`] = config.mode;
1824
+ process.env.NODE_ENV = config.mode;
1825
+ process.env.ENVIRONMENT = config.mode;
1826
+ }
1827
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
1828
+ for (const key of Object.keys(config.colors)) {
1829
+ setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
1830
+ }
1831
+ } else {
1832
+ setThemeColorsEnv(
1833
+ `${prefix}COLOR_`,
1834
+ config.colors
1835
+ );
1836
+ }
1837
+ if (config.repository) {
1838
+ process.env[`${prefix}REPOSITORY`] = config.repository;
1839
+ }
1840
+ if (config.branch) {
1841
+ process.env[`${prefix}BRANCH`] = config.branch;
1842
+ }
1843
+ if (config.preid) {
1844
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
1845
+ }
1846
+ if (config.registry) {
1847
+ if (config.registry.github) {
1848
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
1849
+ }
1850
+ if (config.registry.npm) {
1851
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
1852
+ }
1853
+ if (config.registry.cargo) {
1854
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
1855
+ }
1856
+ if (config.registry.cyclone) {
1857
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
1858
+ config.registry.cyclone
1859
+ );
1860
+ }
1861
+ if (config.registry.container) {
1862
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
1863
+ config.registry.container
1864
+ );
1865
+ }
1866
+ }
1867
+ if (config.logLevel) {
1868
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
1869
+ process.env.LOG_LEVEL = String(config.logLevel);
1870
+ process.env.NX_VERBOSE_LOGGING = String(
1871
+ getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
1872
+ );
1873
+ process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
1874
+ }
1875
+ if (config.skipConfigLogging !== void 0) {
1876
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
1877
+ config.skipConfigLogging
1878
+ );
1879
+ }
1880
+ process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
1881
+ for (const key of Object.keys(config.extensions ?? {})) {
1882
+ if (config.extensions[key] && Object.keys(config.extensions[key])) {
1883
+ setExtensionEnv(key, config.extensions[key]);
1884
+ }
1885
+ }
1886
+ };
1887
+ var setThemeColorsEnv = (prefix, config) => {
1888
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1889
+ };
1890
+ var setSingleThemeColorsEnv = (prefix, config) => {
1891
+ if (config.dark) {
1892
+ process.env[`${prefix}DARK`] = config.dark;
1893
+ }
1894
+ if (config.light) {
1895
+ process.env[`${prefix}LIGHT`] = config.light;
1896
+ }
1897
+ if (config.brand) {
1898
+ process.env[`${prefix}BRAND`] = config.brand;
1899
+ }
1900
+ if (config.alternate) {
1901
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1902
+ }
1903
+ if (config.accent) {
1904
+ process.env[`${prefix}ACCENT`] = config.accent;
1905
+ }
1906
+ if (config.link) {
1907
+ process.env[`${prefix}LINK`] = config.link;
1908
+ }
1909
+ if (config.discovery) {
1910
+ process.env[`${prefix}DISCOVERY`] = config.discovery;
1911
+ }
1912
+ if (config.success) {
1913
+ process.env[`${prefix}SUCCESS`] = config.success;
1914
+ }
1915
+ if (config.info) {
1916
+ process.env[`${prefix}INFO`] = config.info;
1917
+ }
1918
+ if (config.debug) {
1919
+ process.env[`${prefix}DEBUG`] = config.debug;
1920
+ }
1921
+ if (config.warning) {
1922
+ process.env[`${prefix}WARNING`] = config.warning;
1923
+ }
1924
+ if (config.danger) {
1925
+ process.env[`${prefix}DANGER`] = config.danger;
1926
+ }
1927
+ if (config.fatal) {
1928
+ process.env[`${prefix}FATAL`] = config.fatal;
1929
+ }
1930
+ if (config.performance) {
1931
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1932
+ }
1933
+ if (config.positive) {
1934
+ process.env[`${prefix}POSITIVE`] = config.positive;
1935
+ }
1936
+ if (config.negative) {
1937
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1938
+ }
1939
+ if (config.gradient) {
1940
+ for (let i = 0; i < config.gradient.length; i++) {
1941
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1942
+ }
1943
+ }
1944
+ };
1945
+ var setMultiThemeColorsEnv = (prefix, config) => {
1946
+ return {
1947
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
1948
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
1949
+ };
1950
+ };
1951
+ var setBaseThemeColorsEnv = (prefix, config) => {
1952
+ if (config.foreground) {
1953
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
1954
+ }
1955
+ if (config.background) {
1956
+ process.env[`${prefix}BACKGROUND`] = config.background;
1957
+ }
1958
+ if (config.brand) {
1959
+ process.env[`${prefix}BRAND`] = config.brand;
1960
+ }
1961
+ if (config.alternate) {
1962
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1963
+ }
1964
+ if (config.accent) {
1965
+ process.env[`${prefix}ACCENT`] = config.accent;
1966
+ }
1967
+ if (config.link) {
1968
+ process.env[`${prefix}LINK`] = config.link;
1969
+ }
1970
+ if (config.discovery) {
1971
+ process.env[`${prefix}DISCOVERY`] = config.discovery;
1972
+ }
1973
+ if (config.success) {
1974
+ process.env[`${prefix}SUCCESS`] = config.success;
1975
+ }
1976
+ if (config.info) {
1977
+ process.env[`${prefix}INFO`] = config.info;
1978
+ }
1979
+ if (config.debug) {
1980
+ process.env[`${prefix}DEBUG`] = config.debug;
1981
+ }
1982
+ if (config.warning) {
1983
+ process.env[`${prefix}WARNING`] = config.warning;
1984
+ }
1985
+ if (config.danger) {
1986
+ process.env[`${prefix}DANGER`] = config.danger;
1987
+ }
1988
+ if (config.fatal) {
1989
+ process.env[`${prefix}FATAL`] = config.fatal;
1990
+ }
1991
+ if (config.performance) {
1992
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1993
+ }
1994
+ if (config.positive) {
1995
+ process.env[`${prefix}POSITIVE`] = config.positive;
1996
+ }
1997
+ if (config.negative) {
1998
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1999
+ }
2000
+ if (config.gradient) {
2001
+ for (let i = 0; i < config.gradient.length; i++) {
2002
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
2003
+ }
2004
+ }
2005
+ };
2006
+ var _static_cache = void 0;
2007
+ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
2008
+ let result;
2009
+ if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
2010
+ let _workspaceRoot = workspaceRoot;
2011
+ if (!_workspaceRoot) {
2012
+ _workspaceRoot = findWorkspaceRoot();
2013
+ }
2014
+ const configEnv = getConfigEnv();
2015
+ const configFile = await getConfigFile(_workspaceRoot);
2016
+ if (!configFile) {
2017
+ if (!skipLogs) {
2018
+ writeWarning(
2019
+ "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
2020
+ { logLevel: "all" }
2021
+ );
2022
+ }
2023
+ if (useDefault === false) {
2024
+ return void 0;
2025
+ }
2026
+ }
2027
+ const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
2028
+ const configInput = defu__default.default(
2029
+ configEnv,
2030
+ configFile,
2031
+ defaultConfig
2032
+ );
2033
+ if (!configInput.variant) {
2034
+ configInput.variant = fs.existsSync(joinPaths(_workspaceRoot, "nx.json")) || fs.existsSync(joinPaths(_workspaceRoot, ".nx")) || fs.existsSync(joinPaths(_workspaceRoot, "lerna.json")) || fs.existsSync(joinPaths(_workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
2035
+ }
2036
+ try {
2037
+ const parseResult = await Promise.resolve(
2038
+ workspaceConfigSchema._zod.parse(
2039
+ { value: configInput, issues: [] },
2040
+ { async: true }
2041
+ )
2042
+ );
2043
+ result = applyDefaultConfig(parseResult.value);
2044
+ result.workspaceRoot ??= _workspaceRoot;
2045
+ } catch (error) {
2046
+ throw new Error(
2047
+ `Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
2048
+
2049
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${formatLogMessage(
2050
+ configInput
2051
+ )}`,
2052
+ {
2053
+ cause: error
2054
+ }
2055
+ );
2056
+ }
2057
+ } else {
2058
+ result = _static_cache.data;
2059
+ }
2060
+ _static_cache = {
2061
+ timestamp: Date.now(),
2062
+ data: result
2063
+ };
2064
+ return result;
2065
+ };
2066
+ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
2067
+ const config = await createStormWorkspaceConfig(
2068
+ void 0,
2069
+ void 0,
2070
+ workspaceRoot,
2071
+ skipLogs,
2072
+ true
2073
+ );
2074
+ setConfigEnv(config);
2075
+ if (!skipLogs && !config.skipConfigLogging) {
2076
+ writeTrace(
2077
+ `\u2699\uFE0F Using Storm Workspace configuration:
2078
+ ${formatLogMessage(config)}`,
2079
+ config
2080
+ );
2081
+ }
2082
+ return config;
2083
+ };
2084
+
2085
+ // ../config-tools/src/get-config.ts
2086
+ function getConfig(workspaceRoot, skipLogs = false) {
2087
+ return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
2088
+ }
2089
+ function getWorkspaceConfig(skipLogs = true, options = {}) {
2090
+ let workspaceRoot = options.workspaceRoot;
2091
+ if (!workspaceRoot) {
2092
+ workspaceRoot = findWorkspaceRoot(options.cwd);
2093
+ }
2094
+ return getConfig(workspaceRoot, skipLogs);
2095
+ }
2096
+
2097
+ exports.STORM_DEFAULT_RELEASE_BANNER = STORM_DEFAULT_RELEASE_BANNER;
2098
+ exports.__require = __require;
2099
+ exports.brandIcon = brandIcon;
2100
+ exports.exitWithError = exitWithError;
2101
+ exports.exitWithSuccess = exitWithSuccess;
2102
+ exports.findWorkspaceRootSafe = findWorkspaceRootSafe;
2103
+ exports.formatLogMessage = formatLogMessage;
2104
+ exports.getConfig = getConfig;
2105
+ exports.getWorkspaceConfig = getWorkspaceConfig;
2106
+ exports.handleProcess = handleProcess;
2107
+ exports.isVerbose = isVerbose;
2108
+ exports.joinPaths = joinPaths;
2109
+ exports.writeDebug = writeDebug;
2110
+ exports.writeFatal = writeFatal;
2111
+ exports.writeInfo = writeInfo;
2112
+ exports.writeSuccess = writeSuccess;
2113
+ exports.writeTrace = writeTrace;
2114
+ exports.writeWarning = writeWarning;
2115
+ //# sourceMappingURL=chunk-TOLGVHZM.cjs.map
2116
+ //# sourceMappingURL=chunk-TOLGVHZM.cjs.map