@storm-software/git-tools 2.123.16 → 2.124.0

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 (84) hide show
  1. package/README.md +1 -1
  2. package/bin/{chunk-SWXHQXUT.cjs → chunk-AU5PZKTN.cjs} +2 -0
  3. package/bin/chunk-AU5PZKTN.cjs.map +1 -0
  4. package/bin/{chunk-G3JMIIRF.cjs → chunk-EHPPIARR.cjs} +12 -17
  5. package/bin/chunk-EHPPIARR.cjs.map +1 -0
  6. package/bin/{chunk-L64XVBGM.cjs → chunk-FH5OSXAJ.cjs} +2 -0
  7. package/bin/chunk-FH5OSXAJ.cjs.map +1 -0
  8. package/bin/{chunk-S5PS23TL.js → chunk-G3YPGVPS.js} +2 -0
  9. package/bin/chunk-G3YPGVPS.js.map +1 -0
  10. package/bin/{chunk-AMSZ7DVW.js → chunk-Q3DQKTOI.js} +2 -0
  11. package/bin/chunk-Q3DQKTOI.js.map +1 -0
  12. package/bin/{chunk-K3LWFM6S.js → chunk-VBJB46HW.js} +13 -17
  13. package/bin/chunk-VBJB46HW.js.map +1 -0
  14. package/bin/git.cjs +941 -1500
  15. package/bin/git.cjs.map +1 -0
  16. package/bin/git.js +887 -1447
  17. package/bin/git.js.map +1 -0
  18. package/bin/post-checkout.cjs +16 -14
  19. package/bin/post-checkout.cjs.map +1 -0
  20. package/bin/post-checkout.js +5 -3
  21. package/bin/post-checkout.js.map +1 -0
  22. package/bin/post-commit.cjs +16 -14
  23. package/bin/post-commit.cjs.map +1 -0
  24. package/bin/post-commit.js +5 -3
  25. package/bin/post-commit.js.map +1 -0
  26. package/bin/post-merge.cjs +16 -14
  27. package/bin/post-merge.cjs.map +1 -0
  28. package/bin/post-merge.js +5 -3
  29. package/bin/post-merge.js.map +1 -0
  30. package/bin/pre-commit.cjs +14 -12
  31. package/bin/pre-commit.cjs.map +1 -0
  32. package/bin/pre-commit.js +4 -2
  33. package/bin/pre-commit.js.map +1 -0
  34. package/bin/pre-install.cjs +13 -11
  35. package/bin/pre-install.cjs.map +1 -0
  36. package/bin/pre-install.js +4 -2
  37. package/bin/pre-install.js.map +1 -0
  38. package/bin/pre-push.cjs +21 -19
  39. package/bin/pre-push.cjs.map +1 -0
  40. package/bin/pre-push.js +5 -3
  41. package/bin/pre-push.js.map +1 -0
  42. package/bin/prepare.cjs +11 -9
  43. package/bin/prepare.cjs.map +1 -0
  44. package/bin/prepare.js +4 -2
  45. package/bin/prepare.js.map +1 -0
  46. package/bin/version-warning.cjs +9 -7
  47. package/bin/version-warning.cjs.map +1 -0
  48. package/bin/version-warning.js +4 -2
  49. package/bin/version-warning.js.map +1 -0
  50. package/dist/chunk-3GGWHKRP.js +3 -6
  51. package/dist/chunk-4VPJA7YJ.cjs +9 -9
  52. package/dist/chunk-5XU2KBM6.js +1 -3
  53. package/dist/chunk-F7OO6L26.cjs +11 -16
  54. package/dist/chunk-JCEVFJCA.js +4 -14
  55. package/dist/chunk-KZRVQ5RZ.js +3 -11
  56. package/dist/chunk-M4QURF2M.cjs +2454 -0
  57. package/dist/chunk-NY53WLGC.cjs +16 -23
  58. package/dist/chunk-RJCCG4TV.js +2420 -0
  59. package/dist/chunk-YBAE6I5L.cjs +3 -3
  60. package/dist/commit/minimal.cjs +11 -3
  61. package/dist/commit/minimal.js +3 -10
  62. package/dist/commit/monorepo.cjs +11 -3
  63. package/dist/commit/monorepo.d.cts +1 -0
  64. package/dist/commit/monorepo.d.ts +1 -0
  65. package/dist/commit/monorepo.js +4 -11
  66. package/dist/commitlint/minimal.cjs +4 -5
  67. package/dist/commitlint/minimal.js +3 -6
  68. package/dist/commitlint/monorepo.cjs +4 -5
  69. package/dist/commitlint/monorepo.js +3 -6
  70. package/dist/index.cjs +40 -14
  71. package/dist/index.d.cts +4 -3
  72. package/dist/index.d.ts +4 -3
  73. package/dist/index.js +5 -20
  74. package/dist/release/config.cjs +30 -6
  75. package/dist/release/config.d.cts +33 -243
  76. package/dist/release/config.d.ts +33 -243
  77. package/dist/release/config.js +5 -14
  78. package/dist/types.cjs +7 -3
  79. package/dist/types.d.cts +91 -94
  80. package/dist/types.d.ts +91 -94
  81. package/dist/types.js +1 -6
  82. package/package.json +12 -12
  83. package/dist/chunk-GOKUSEH3.cjs +0 -77
  84. package/dist/chunk-YCEUZFMU.js +0 -77
@@ -0,0 +1,2454 @@
1
+ 'use strict';
2
+
3
+ var chunkNY53WLGC_cjs = require('./chunk-NY53WLGC.cjs');
4
+ var chunk4VPJA7YJ_cjs = require('./chunk-4VPJA7YJ.cjs');
5
+ var defu = require('defu');
6
+ var c12 = require('c12');
7
+ var chalk = require('chalk');
8
+ var fs = require('fs');
9
+ var path = require('path');
10
+ var z = require('zod/mini');
11
+ var promises = require('fs/promises');
12
+ var axios2 = require('axios');
13
+ var DefaultChangelogRenderer = require('nx/release/changelog-renderer');
14
+ var conventionalCommits = require('nx/src/command-line/release/config/conventional-commits');
15
+ var semver = require('semver');
16
+ require('@nx/devkit');
17
+ require('nx/src/command-line/release/utils/shared');
18
+ require('nx/src/tasks-runner/utils');
19
+ require('prettier');
20
+ require('enquirer');
21
+ require('child_process');
22
+ require('os');
23
+ require('nx/src/command-line/release/utils/print-changes');
24
+ require('nx/src/command-line/release/utils/remote-release-clients/github');
25
+ require('yaml');
26
+
27
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
28
+
29
+ function _interopNamespace(e) {
30
+ if (e && e.__esModule) return e;
31
+ var n = Object.create(null);
32
+ if (e) {
33
+ Object.keys(e).forEach(function (k) {
34
+ if (k !== 'default') {
35
+ var d = Object.getOwnPropertyDescriptor(e, k);
36
+ Object.defineProperty(n, k, d.get ? d : {
37
+ enumerable: true,
38
+ get: function () { return e[k]; }
39
+ });
40
+ }
41
+ });
42
+ }
43
+ n.default = e;
44
+ return Object.freeze(n);
45
+ }
46
+
47
+ var defu__default = /*#__PURE__*/_interopDefault(defu);
48
+ var chalk__default = /*#__PURE__*/_interopDefault(chalk);
49
+ var z__namespace = /*#__PURE__*/_interopNamespace(z);
50
+ var axios2__default = /*#__PURE__*/_interopDefault(axios2);
51
+ var DefaultChangelogRenderer__default = /*#__PURE__*/_interopDefault(DefaultChangelogRenderer);
52
+
53
+ // ../config-tools/src/utilities/correct-paths.ts
54
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
55
+ function normalizeWindowsPath(input = "") {
56
+ if (!input) {
57
+ return input;
58
+ }
59
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
60
+ }
61
+ var _UNC_REGEX = /^[/\\]{2}/;
62
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
63
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
64
+ var correctPaths = function(path) {
65
+ if (!path || path.length === 0) {
66
+ return ".";
67
+ }
68
+ path = normalizeWindowsPath(path);
69
+ const isUNCPath = path?.match(_UNC_REGEX);
70
+ const isPathAbsolute = isAbsolute(path);
71
+ const trailingSeparator = path[path.length - 1] === "/";
72
+ path = normalizeString(path, !isPathAbsolute);
73
+ if (path.length === 0) {
74
+ if (isPathAbsolute) {
75
+ return "/";
76
+ }
77
+ return trailingSeparator ? "./" : ".";
78
+ }
79
+ if (trailingSeparator) {
80
+ path += "/";
81
+ }
82
+ if (_DRIVE_LETTER_RE.test(path)) {
83
+ path += "/";
84
+ }
85
+ if (isUNCPath) {
86
+ if (!isPathAbsolute) {
87
+ return `//./${path}`;
88
+ }
89
+ return `//${path}`;
90
+ }
91
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
92
+ };
93
+ var joinPaths = function(...segments) {
94
+ let path = "";
95
+ for (const seg of segments) {
96
+ if (!seg) {
97
+ continue;
98
+ }
99
+ if (path.length > 0) {
100
+ const pathTrailing = path[path.length - 1] === "/";
101
+ const segLeading = seg[0] === "/";
102
+ const both = pathTrailing && segLeading;
103
+ if (both) {
104
+ path += seg.slice(1);
105
+ } else {
106
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
107
+ }
108
+ } else {
109
+ path += seg;
110
+ }
111
+ }
112
+ return correctPaths(path);
113
+ };
114
+ function normalizeString(path, allowAboveRoot) {
115
+ let res = "";
116
+ let lastSegmentLength = 0;
117
+ let lastSlash = -1;
118
+ let dots = 0;
119
+ let char = null;
120
+ for (let index = 0; index <= path.length; ++index) {
121
+ if (index < path.length) {
122
+ char = path[index];
123
+ } else if (char === "/") {
124
+ break;
125
+ } else {
126
+ char = "/";
127
+ }
128
+ if (char === "/") {
129
+ if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
130
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
131
+ if (res.length > 2) {
132
+ const lastSlashIndex = res.lastIndexOf("/");
133
+ if (lastSlashIndex === -1) {
134
+ res = "";
135
+ lastSegmentLength = 0;
136
+ } else {
137
+ res = res.slice(0, lastSlashIndex);
138
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
139
+ }
140
+ lastSlash = index;
141
+ dots = 0;
142
+ continue;
143
+ } else if (res.length > 0) {
144
+ res = "";
145
+ lastSegmentLength = 0;
146
+ lastSlash = index;
147
+ dots = 0;
148
+ continue;
149
+ }
150
+ }
151
+ if (allowAboveRoot) {
152
+ res += res.length > 0 ? "/.." : "..";
153
+ lastSegmentLength = 2;
154
+ }
155
+ } else {
156
+ if (res.length > 0) {
157
+ res += `/${path.slice(lastSlash + 1, index)}`;
158
+ } else {
159
+ res = path.slice(lastSlash + 1, index);
160
+ }
161
+ lastSegmentLength = index - lastSlash - 1;
162
+ }
163
+ lastSlash = index;
164
+ dots = 0;
165
+ } else if (char === "." && dots !== -1) {
166
+ ++dots;
167
+ } else {
168
+ dots = -1;
169
+ }
170
+ }
171
+ return res;
172
+ }
173
+ var isAbsolute = function(p) {
174
+ return _IS_ABSOLUTE_RE.test(p);
175
+ };
176
+
177
+ // src/utilities/omit.ts
178
+ function omit(obj, keys) {
179
+ const result = { ...obj };
180
+ for (let i = 0; i < keys.length; i++) {
181
+ const key = keys[i];
182
+ if (key && key in result) {
183
+ delete result[key];
184
+ }
185
+ }
186
+ return result;
187
+ }
188
+
189
+ // ../config-tools/src/types.ts
190
+ var LogLevel = {
191
+ SILENT: 0,
192
+ FATAL: 10,
193
+ ERROR: 20,
194
+ WARN: 30,
195
+ SUCCESS: 35,
196
+ INFO: 40,
197
+ DEBUG: 60,
198
+ TRACE: 70,
199
+ ALL: 100
200
+ };
201
+ var LogLevelLabel = {
202
+ SILENT: "silent",
203
+ FATAL: "fatal",
204
+ ERROR: "error",
205
+ WARN: "warn",
206
+ SUCCESS: "success",
207
+ INFO: "info",
208
+ DEBUG: "debug",
209
+ TRACE: "trace",
210
+ ALL: "all"
211
+ };
212
+
213
+ // ../config-tools/src/utilities/colors.ts
214
+ var DEFAULT_COLOR_CONFIG = {
215
+ dark: {
216
+ brand: "#2dd4bf",
217
+ success: "#10b981",
218
+ info: "#58a6ff",
219
+ warning: "#f3d371",
220
+ danger: "#D8314A",
221
+ fatal: "#a40e26"}
222
+ };
223
+ var chalkDefault = {
224
+ hex: (_) => (message) => message,
225
+ bgHex: (_) => ({
226
+ whiteBright: (message) => message,
227
+ white: (message) => message
228
+ }),
229
+ white: (message) => message,
230
+ whiteBright: (message) => message,
231
+ gray: (message) => message,
232
+ bold: {
233
+ hex: (_) => (message) => message,
234
+ bgHex: (_) => ({
235
+ whiteBright: (message) => message,
236
+ white: (message) => message
237
+ }),
238
+ whiteBright: (message) => message,
239
+ white: (message) => message
240
+ },
241
+ dim: {
242
+ hex: (_) => (message) => message,
243
+ gray: (message) => message
244
+ }
245
+ };
246
+ var getChalk = () => {
247
+ let _chalk = chalk__default.default;
248
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
249
+ _chalk = chalkDefault;
250
+ }
251
+ return _chalk;
252
+ };
253
+
254
+ // ../config-tools/src/logger/is-unicode-supported.ts
255
+ function isUnicodeSupported() {
256
+ if (process.platform !== "win32") {
257
+ return process.env.TERM !== "linux";
258
+ }
259
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
260
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
261
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
262
+ 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";
263
+ }
264
+
265
+ // ../config-tools/src/logger/console-icons.ts
266
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
267
+ var CONSOLE_ICONS = {
268
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
269
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
270
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
271
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
272
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
273
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
274
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
275
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
276
+ };
277
+
278
+ // ../config-tools/src/logger/format-timestamp.ts
279
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
280
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
281
+ };
282
+
283
+ // ../config-tools/src/logger/get-log-level.ts
284
+ var getLogLevel = (label) => {
285
+ switch (label) {
286
+ case "all":
287
+ return LogLevel.ALL;
288
+ case "trace":
289
+ return LogLevel.TRACE;
290
+ case "debug":
291
+ return LogLevel.DEBUG;
292
+ case "info":
293
+ return LogLevel.INFO;
294
+ case "warn":
295
+ return LogLevel.WARN;
296
+ case "error":
297
+ return LogLevel.ERROR;
298
+ case "fatal":
299
+ return LogLevel.FATAL;
300
+ case "silent":
301
+ return LogLevel.SILENT;
302
+ default:
303
+ return LogLevel.INFO;
304
+ }
305
+ };
306
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
307
+ if (logLevel >= LogLevel.ALL) {
308
+ return LogLevelLabel.ALL;
309
+ }
310
+ if (logLevel >= LogLevel.TRACE) {
311
+ return LogLevelLabel.TRACE;
312
+ }
313
+ if (logLevel >= LogLevel.DEBUG) {
314
+ return LogLevelLabel.DEBUG;
315
+ }
316
+ if (logLevel >= LogLevel.INFO) {
317
+ return LogLevelLabel.INFO;
318
+ }
319
+ if (logLevel >= LogLevel.WARN) {
320
+ return LogLevelLabel.WARN;
321
+ }
322
+ if (logLevel >= LogLevel.ERROR) {
323
+ return LogLevelLabel.ERROR;
324
+ }
325
+ if (logLevel >= LogLevel.FATAL) {
326
+ return LogLevelLabel.FATAL;
327
+ }
328
+ if (logLevel <= LogLevel.SILENT) {
329
+ return LogLevelLabel.SILENT;
330
+ }
331
+ return LogLevelLabel.INFO;
332
+ };
333
+
334
+ // ../config-tools/src/logger/console.ts
335
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
336
+ 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;
337
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
338
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
339
+ return (_) => {
340
+ };
341
+ }
342
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
343
+ return (message) => {
344
+ console.error(
345
+ `
346
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
347
+ `
348
+ );
349
+ };
350
+ }
351
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
352
+ return (message) => {
353
+ console.error(
354
+ `
355
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
356
+ `
357
+ );
358
+ };
359
+ }
360
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
361
+ return (message) => {
362
+ console.warn(
363
+ `
364
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
365
+ `
366
+ );
367
+ };
368
+ }
369
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
370
+ return (message) => {
371
+ console.info(
372
+ `
373
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
374
+ `
375
+ );
376
+ };
377
+ }
378
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
379
+ return (message) => {
380
+ console.info(
381
+ `
382
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
383
+ `
384
+ );
385
+ };
386
+ }
387
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
388
+ return (message) => {
389
+ console.debug(
390
+ `
391
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
392
+ `
393
+ );
394
+ };
395
+ }
396
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
397
+ return (message) => {
398
+ console.debug(
399
+ `
400
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
401
+ `
402
+ );
403
+ };
404
+ }
405
+ return (message) => {
406
+ console.log(
407
+ `
408
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
409
+ `
410
+ );
411
+ };
412
+ };
413
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
414
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
415
+ var MAX_DEPTH = 4;
416
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
417
+ if (depth2 > MAX_DEPTH) {
418
+ return "<max depth>";
419
+ }
420
+ const prefix = options.prefix ?? "-";
421
+ const skip = options.skip ?? [];
422
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
423
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
424
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
425
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
426
+ message[key],
427
+ { prefix: `${prefix}-`, skip },
428
+ depth2 + 1
429
+ ) : message[key]}`
430
+ ).join("\n")}` : message;
431
+ };
432
+ var _isFunction = (value) => {
433
+ try {
434
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
435
+ } catch {
436
+ return false;
437
+ }
438
+ };
439
+ var MAX_PATH_SEARCH_DEPTH = 30;
440
+ var depth = 0;
441
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
442
+ const _startPath = startPath ?? process.cwd();
443
+ if (endDirectoryNames.some(
444
+ (endDirName) => fs.existsSync(path.join(_startPath, endDirName))
445
+ )) {
446
+ return _startPath;
447
+ }
448
+ if (endFileNames.some(
449
+ (endFileName) => fs.existsSync(path.join(_startPath, endFileName))
450
+ )) {
451
+ return _startPath;
452
+ }
453
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
454
+ const parent = path.join(_startPath, "..");
455
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
456
+ }
457
+ return void 0;
458
+ }
459
+
460
+ // ../config-tools/src/utilities/find-workspace-root.ts
461
+ var rootFiles = [
462
+ "storm-workspace.json",
463
+ "storm-workspace.yaml",
464
+ "storm-workspace.yml",
465
+ "storm-workspace.js",
466
+ "storm-workspace.ts",
467
+ ".storm-workspace.json",
468
+ ".storm-workspace.yaml",
469
+ ".storm-workspace.yml",
470
+ ".storm-workspace.js",
471
+ ".storm-workspace.ts",
472
+ "lerna.json",
473
+ "nx.json",
474
+ "turbo.json",
475
+ "npm-workspace.json",
476
+ "yarn-workspace.json",
477
+ "pnpm-workspace.json",
478
+ "npm-workspace.yaml",
479
+ "yarn-workspace.yaml",
480
+ "pnpm-workspace.yaml",
481
+ "npm-workspace.yml",
482
+ "yarn-workspace.yml",
483
+ "pnpm-workspace.yml",
484
+ "npm-lock.json",
485
+ "yarn-lock.json",
486
+ "pnpm-lock.json",
487
+ "npm-lock.yaml",
488
+ "yarn-lock.yaml",
489
+ "pnpm-lock.yaml",
490
+ "npm-lock.yml",
491
+ "yarn-lock.yml",
492
+ "pnpm-lock.yml",
493
+ "bun.lockb"
494
+ ];
495
+ var rootDirectories = [
496
+ ".storm-workspace",
497
+ ".nx",
498
+ ".git",
499
+ ".github",
500
+ ".vscode",
501
+ ".verdaccio"
502
+ ];
503
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
504
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
505
+ return correctPaths(
506
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
507
+ );
508
+ }
509
+ return correctPaths(
510
+ findFolderUp(
511
+ pathInsideMonorepo ?? process.cwd(),
512
+ rootFiles,
513
+ rootDirectories
514
+ )
515
+ );
516
+ }
517
+ function findWorkspaceRoot(pathInsideMonorepo) {
518
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
519
+ if (!result) {
520
+ throw new Error(
521
+ `Cannot find workspace root upwards from known path. Files search list includes:
522
+ ${rootFiles.join(
523
+ "\n"
524
+ )}
525
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
526
+ );
527
+ }
528
+ return result;
529
+ }
530
+
531
+ // ../config/src/constants.ts
532
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
533
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
534
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
535
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
536
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
537
+ var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
538
+ var schemaRegistry = z__namespace.registry();
539
+ var colorSchema = z__namespace.string().check(
540
+ z__namespace.length(7),
541
+ z__namespace.toLowerCase(),
542
+ z__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),
543
+ z__namespace.trim()
544
+ );
545
+ schemaRegistry.add(colorSchema, {
546
+ description: "A base schema for describing the format of colors"
547
+ });
548
+ var darkColorSchema = z__namespace._default(colorSchema, "#151718");
549
+ schemaRegistry.add(darkColorSchema, {
550
+ description: "The dark background color of the workspace"
551
+ });
552
+ var lightColorSchema = z__namespace._default(colorSchema, "#cbd5e1");
553
+ schemaRegistry.add(lightColorSchema, {
554
+ description: "The light background color of the workspace"
555
+ });
556
+ var brandColorSchema = z__namespace._default(colorSchema, "#1fb2a6");
557
+ schemaRegistry.add(brandColorSchema, {
558
+ description: "The primary brand specific color of the workspace"
559
+ });
560
+ var alternateColorSchema = z__namespace.optional(colorSchema);
561
+ schemaRegistry.add(alternateColorSchema, {
562
+ description: "The alternate brand specific color of the workspace"
563
+ });
564
+ var accentColorSchema = z__namespace.optional(colorSchema);
565
+ schemaRegistry.add(accentColorSchema, {
566
+ description: "The secondary brand specific color of the workspace"
567
+ });
568
+ var linkColorSchema = z__namespace._default(colorSchema, "#3fa6ff");
569
+ schemaRegistry.add(linkColorSchema, {
570
+ description: "The color used to display hyperlink text"
571
+ });
572
+ var helpColorSchema = z__namespace._default(colorSchema, "#818cf8");
573
+ schemaRegistry.add(helpColorSchema, {
574
+ description: "The second brand specific color of the workspace"
575
+ });
576
+ var successColorSchema = z__namespace._default(colorSchema, "#45b27e");
577
+ schemaRegistry.add(successColorSchema, {
578
+ description: "The success color of the workspace"
579
+ });
580
+ var infoColorSchema = z__namespace._default(colorSchema, "#38bdf8");
581
+ schemaRegistry.add(infoColorSchema, {
582
+ description: "The informational color of the workspace"
583
+ });
584
+ var warningColorSchema = z__namespace._default(colorSchema, "#f3d371");
585
+ schemaRegistry.add(warningColorSchema, {
586
+ description: "The warning color of the workspace"
587
+ });
588
+ var dangerColorSchema = z__namespace._default(colorSchema, "#d8314a");
589
+ schemaRegistry.add(dangerColorSchema, {
590
+ description: "The danger color of the workspace"
591
+ });
592
+ var fatalColorSchema = z__namespace.optional(colorSchema);
593
+ schemaRegistry.add(fatalColorSchema, {
594
+ description: "The fatal color of the workspace"
595
+ });
596
+ var positiveColorSchema = z__namespace._default(colorSchema, "#4ade80");
597
+ schemaRegistry.add(positiveColorSchema, {
598
+ description: "The positive number color of the workspace"
599
+ });
600
+ var negativeColorSchema = z__namespace._default(colorSchema, "#ef4444");
601
+ schemaRegistry.add(negativeColorSchema, {
602
+ description: "The negative number color of the workspace"
603
+ });
604
+ var gradientStopsSchema = z__namespace.optional(z__namespace.array(colorSchema));
605
+ schemaRegistry.add(gradientStopsSchema, {
606
+ description: "The color stops for the base gradient color pattern used in the workspace"
607
+ });
608
+ var darkColorsSchema = z__namespace.object({
609
+ foreground: lightColorSchema,
610
+ background: darkColorSchema,
611
+ brand: brandColorSchema,
612
+ alternate: alternateColorSchema,
613
+ accent: accentColorSchema,
614
+ link: linkColorSchema,
615
+ help: helpColorSchema,
616
+ success: successColorSchema,
617
+ info: infoColorSchema,
618
+ warning: warningColorSchema,
619
+ danger: dangerColorSchema,
620
+ fatal: fatalColorSchema,
621
+ positive: positiveColorSchema,
622
+ negative: negativeColorSchema,
623
+ gradient: gradientStopsSchema
624
+ });
625
+ var lightColorsSchema = z__namespace.object({
626
+ foreground: darkColorSchema,
627
+ background: lightColorSchema,
628
+ brand: brandColorSchema,
629
+ alternate: alternateColorSchema,
630
+ accent: accentColorSchema,
631
+ link: linkColorSchema,
632
+ help: helpColorSchema,
633
+ success: successColorSchema,
634
+ info: infoColorSchema,
635
+ warning: warningColorSchema,
636
+ danger: dangerColorSchema,
637
+ fatal: fatalColorSchema,
638
+ positive: positiveColorSchema,
639
+ negative: negativeColorSchema,
640
+ gradient: gradientStopsSchema
641
+ });
642
+ var multiColorsSchema = z__namespace.object({
643
+ dark: darkColorsSchema,
644
+ light: lightColorsSchema
645
+ });
646
+ var singleColorsSchema = z__namespace.object({
647
+ dark: darkColorSchema,
648
+ light: lightColorSchema,
649
+ brand: brandColorSchema,
650
+ alternate: alternateColorSchema,
651
+ accent: accentColorSchema,
652
+ link: linkColorSchema,
653
+ help: helpColorSchema,
654
+ success: successColorSchema,
655
+ info: infoColorSchema,
656
+ warning: warningColorSchema,
657
+ danger: dangerColorSchema,
658
+ fatal: fatalColorSchema,
659
+ positive: positiveColorSchema,
660
+ negative: negativeColorSchema,
661
+ gradient: gradientStopsSchema
662
+ });
663
+ var registryUrlConfigSchema = z__namespace.optional(z__namespace.url());
664
+ schemaRegistry.add(registryUrlConfigSchema, {
665
+ description: "A remote registry URL used to publish distributable packages"
666
+ });
667
+ var registrySchema = z__namespace._default(
668
+ z__namespace.object({
669
+ github: registryUrlConfigSchema,
670
+ npm: registryUrlConfigSchema,
671
+ cargo: registryUrlConfigSchema,
672
+ cyclone: registryUrlConfigSchema,
673
+ container: registryUrlConfigSchema
674
+ }),
675
+ {}
676
+ );
677
+ schemaRegistry.add(registrySchema, {
678
+ description: "A list of remote registry URLs used by Storm Software"
679
+ });
680
+ var colorsSchema = z__namespace.union([singleColorsSchema, multiColorsSchema]);
681
+ schemaRegistry.add(colorsSchema, {
682
+ description: "Colors used for various workspace elements"
683
+ });
684
+ var themeColorsSchema = z__namespace.record(
685
+ z__namespace.union([z__namespace.union([z__namespace.literal("base"), z__namespace.string()]), z__namespace.string()]),
686
+ colorsSchema
687
+ );
688
+ schemaRegistry.add(themeColorsSchema, {
689
+ description: "Storm theme config values used for styling various package elements"
690
+ });
691
+ var extendsSchema = z__namespace.optional(
692
+ z__namespace.union([z__namespace.string().check(z__namespace.trim()), z__namespace.array(z__namespace.string().check(z__namespace.trim()))])
693
+ );
694
+ schemaRegistry.add(extendsSchema, {
695
+ 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."
696
+ });
697
+ var workspaceBotNameSchema = z__namespace.string().check(z__namespace.trim());
698
+ schemaRegistry.add(workspaceBotNameSchema, {
699
+ description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
700
+ });
701
+ var workspaceBotEmailSchema = z__namespace.string().check(z__namespace.trim());
702
+ schemaRegistry.add(workspaceBotEmailSchema, {
703
+ description: "The email of the workspace bot"
704
+ });
705
+ var workspaceBotSchema = z__namespace.object({
706
+ name: workspaceBotNameSchema,
707
+ email: workspaceBotEmailSchema
708
+ });
709
+ schemaRegistry.add(workspaceBotSchema, {
710
+ description: "The workspace's bot user's config used to automated various operations tasks"
711
+ });
712
+ var workspaceReleaseBannerUrlSchema = z__namespace.optional(
713
+ z__namespace.string().check(z__namespace.trim(), z__namespace.url())
714
+ );
715
+ schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
716
+ description: "A URL to a banner image used to display the workspace's release"
717
+ });
718
+ var workspaceReleaseBannerAltSchema = z__namespace._default(
719
+ z__namespace.string().check(z__namespace.trim()),
720
+ STORM_DEFAULT_BANNER_ALT
721
+ );
722
+ schemaRegistry.add(workspaceReleaseBannerAltSchema, {
723
+ description: "The alt text for the workspace's release banner image"
724
+ });
725
+ var workspaceReleaseBannerSchema = z__namespace.object({
726
+ url: workspaceReleaseBannerUrlSchema,
727
+ alt: workspaceReleaseBannerAltSchema
728
+ });
729
+ schemaRegistry.add(workspaceReleaseBannerSchema, {
730
+ description: "The workspace's banner image used during the release process"
731
+ });
732
+ var workspaceReleaseHeaderSchema = z__namespace.optional(
733
+ z__namespace.string().check(z__namespace.trim())
734
+ );
735
+ schemaRegistry.add(workspaceReleaseHeaderSchema, {
736
+ description: "A header message appended to the start of the workspace's release notes"
737
+ });
738
+ var workspaceReleaseFooterSchema = z__namespace.optional(
739
+ z__namespace.string().check(z__namespace.trim())
740
+ );
741
+ schemaRegistry.add(workspaceReleaseFooterSchema, {
742
+ description: "A footer message appended to the end of the workspace's release notes"
743
+ });
744
+ var workspaceReleaseSchema = z__namespace.object({
745
+ banner: z__namespace.union([
746
+ workspaceReleaseBannerSchema,
747
+ z__namespace.string().check(z__namespace.trim(), z__namespace.url())
748
+ ]),
749
+ header: workspaceReleaseHeaderSchema,
750
+ footer: workspaceReleaseFooterSchema
751
+ });
752
+ schemaRegistry.add(workspaceReleaseSchema, {
753
+ description: "The workspace's release config used during the release process"
754
+ });
755
+ var workspaceSocialsTwitterSchema = z__namespace.optional(
756
+ z__namespace.string().check(z__namespace.trim())
757
+ );
758
+ schemaRegistry.add(workspaceSocialsTwitterSchema, {
759
+ description: "A Twitter/X account associated with the organization/project"
760
+ });
761
+ var workspaceSocialsDiscordSchema = z__namespace.optional(
762
+ z__namespace.string().check(z__namespace.trim())
763
+ );
764
+ schemaRegistry.add(workspaceSocialsDiscordSchema, {
765
+ description: "A Discord account associated with the organization/project"
766
+ });
767
+ var workspaceSocialsTelegramSchema = z__namespace.optional(
768
+ z__namespace.string().check(z__namespace.trim())
769
+ );
770
+ schemaRegistry.add(workspaceSocialsTelegramSchema, {
771
+ description: "A Telegram account associated with the organization/project"
772
+ });
773
+ var workspaceSocialsSlackSchema = z__namespace.optional(
774
+ z__namespace.string().check(z__namespace.trim())
775
+ );
776
+ schemaRegistry.add(workspaceSocialsSlackSchema, {
777
+ description: "A Slack account associated with the organization/project"
778
+ });
779
+ var workspaceSocialsMediumSchema = z__namespace.optional(
780
+ z__namespace.string().check(z__namespace.trim())
781
+ );
782
+ schemaRegistry.add(workspaceSocialsMediumSchema, {
783
+ description: "A Medium account associated with the organization/project"
784
+ });
785
+ var workspaceSocialsGithubSchema = z__namespace.optional(
786
+ z__namespace.string().check(z__namespace.trim())
787
+ );
788
+ schemaRegistry.add(workspaceSocialsGithubSchema, {
789
+ description: "A GitHub account associated with the organization/project"
790
+ });
791
+ var workspaceSocialsSchema = z__namespace.object({
792
+ twitter: workspaceSocialsTwitterSchema,
793
+ discord: workspaceSocialsDiscordSchema,
794
+ telegram: workspaceSocialsTelegramSchema,
795
+ slack: workspaceSocialsSlackSchema,
796
+ medium: workspaceSocialsMediumSchema,
797
+ github: workspaceSocialsGithubSchema
798
+ });
799
+ schemaRegistry.add(workspaceSocialsSchema, {
800
+ description: "The workspace's account config used to store various social media links"
801
+ });
802
+ var workspaceDirectoryCacheSchema = z__namespace.optional(
803
+ z__namespace.string().check(z__namespace.trim())
804
+ );
805
+ schemaRegistry.add(workspaceDirectoryCacheSchema, {
806
+ description: "The directory used to store the environment's cached file data"
807
+ });
808
+ var workspaceDirectoryDataSchema = z__namespace.optional(
809
+ z__namespace.string().check(z__namespace.trim())
810
+ );
811
+ schemaRegistry.add(workspaceDirectoryDataSchema, {
812
+ description: "The directory used to store the environment's data files"
813
+ });
814
+ var workspaceDirectoryConfigSchema = z__namespace.optional(
815
+ z__namespace.string().check(z__namespace.trim())
816
+ );
817
+ schemaRegistry.add(workspaceDirectoryConfigSchema, {
818
+ description: "The directory used to store the environment's configuration files"
819
+ });
820
+ var workspaceDirectoryTempSchema = z__namespace.optional(
821
+ z__namespace.string().check(z__namespace.trim())
822
+ );
823
+ schemaRegistry.add(workspaceDirectoryTempSchema, {
824
+ description: "The directory used to store the environment's temp files"
825
+ });
826
+ var workspaceDirectoryLogSchema = z__namespace.optional(
827
+ z__namespace.string().check(z__namespace.trim())
828
+ );
829
+ schemaRegistry.add(workspaceDirectoryLogSchema, {
830
+ description: "The directory used to store the environment's log files"
831
+ });
832
+ var workspaceDirectoryBuildSchema = z__namespace._default(
833
+ z__namespace.string().check(z__namespace.trim()),
834
+ "dist"
835
+ );
836
+ schemaRegistry.add(workspaceDirectoryBuildSchema, {
837
+ description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
838
+ });
839
+ var workspaceDirectorySchema = z__namespace.object({
840
+ cache: workspaceDirectoryCacheSchema,
841
+ data: workspaceDirectoryDataSchema,
842
+ config: workspaceDirectoryConfigSchema,
843
+ temp: workspaceDirectoryTempSchema,
844
+ log: workspaceDirectoryLogSchema,
845
+ build: workspaceDirectoryBuildSchema
846
+ });
847
+ schemaRegistry.add(workspaceDirectorySchema, {
848
+ description: "Various directories used by the workspace to store data, cache, and configuration files"
849
+ });
850
+ var variantSchema = z__namespace._default(
851
+ z__namespace.enum(["minimal", "monorepo"]),
852
+ "monorepo"
853
+ );
854
+ schemaRegistry.add(variantSchema, {
855
+ description: "The variant of the workspace. This can be used to enable or disable certain features or configurations."
856
+ });
857
+ var errorCodesFileSchema = z__namespace._default(
858
+ z__namespace.string().check(z__namespace.trim()),
859
+ STORM_DEFAULT_ERROR_CODES_FILE
860
+ );
861
+ schemaRegistry.add(errorCodesFileSchema, {
862
+ description: "The path to the workspace's error codes JSON file"
863
+ });
864
+ var errorUrlSchema = z__namespace.optional(z__namespace.url());
865
+ schemaRegistry.add(errorUrlSchema, {
866
+ description: "A URL to a page that looks up the workspace's error messages given a specific error code"
867
+ });
868
+ var errorSchema = z__namespace.object({
869
+ codesFile: errorCodesFileSchema,
870
+ url: errorUrlSchema
871
+ });
872
+ schemaRegistry.add(errorSchema, {
873
+ description: "The workspace's error config used when creating error details during a system error"
874
+ });
875
+ var organizationNameSchema = z__namespace.optional(
876
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
877
+ );
878
+ schemaRegistry.add(organizationNameSchema, {
879
+ description: "The name of the organization"
880
+ });
881
+ var organizationDescriptionSchema = z__namespace.optional(
882
+ z__namespace.string().check(z__namespace.trim())
883
+ );
884
+ schemaRegistry.add(organizationDescriptionSchema, {
885
+ description: "A description of the organization"
886
+ });
887
+ var organizationLogoSchema = z__namespace.optional(z__namespace.url());
888
+ schemaRegistry.add(organizationLogoSchema, {
889
+ description: "A URL to the organization's logo image"
890
+ });
891
+ var organizationIconSchema = z__namespace.optional(z__namespace.url());
892
+ schemaRegistry.add(organizationIconSchema, {
893
+ description: "A URL to the organization's icon image"
894
+ });
895
+ var organizationUrlSchema = z__namespace.optional(z__namespace.url());
896
+ schemaRegistry.add(organizationUrlSchema, {
897
+ description: "A URL to a page that provides more information about the organization"
898
+ });
899
+ var organizationSchema = z__namespace.object({
900
+ name: organizationNameSchema,
901
+ description: organizationDescriptionSchema,
902
+ logo: organizationLogoSchema,
903
+ icon: organizationIconSchema,
904
+ url: organizationUrlSchema
905
+ });
906
+ schemaRegistry.add(organizationSchema, {
907
+ description: "The workspace's organization details"
908
+ });
909
+ var schemaNameSchema = z__namespace._default(
910
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase()),
911
+ "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
912
+ );
913
+ schemaRegistry.add(schemaNameSchema, {
914
+ description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
915
+ });
916
+ var nameSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
917
+ schemaRegistry.add(nameSchema, {
918
+ description: "The name of the workspace/project/service/package/scope using this configuration"
919
+ });
920
+ var namespaceSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
921
+ schemaRegistry.add(namespaceSchema, {
922
+ description: "The namespace of the workspace/project/service/package/scope using this configuration"
923
+ });
924
+ var orgSchema = z__namespace.union([
925
+ organizationSchema,
926
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
927
+ ]);
928
+ schemaRegistry.add(orgSchema, {
929
+ description: "The organization of the workspace. This can be a string or an object containing the organization's details"
930
+ });
931
+ var repositorySchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
932
+ schemaRegistry.add(repositorySchema, {
933
+ description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
934
+ });
935
+ var licenseSchema = z__namespace._default(
936
+ z__namespace.string().check(z__namespace.trim()),
937
+ "Apache-2.0"
938
+ );
939
+ schemaRegistry.add(licenseSchema, {
940
+ description: "The license type of the package"
941
+ });
942
+ var homepageSchema = z__namespace.optional(z__namespace.url());
943
+ schemaRegistry.add(homepageSchema, {
944
+ description: "The homepage of the workspace"
945
+ });
946
+ var docsSchema = z__namespace.optional(z__namespace.url());
947
+ schemaRegistry.add(docsSchema, {
948
+ description: "The documentation site for the workspace"
949
+ });
950
+ var portalSchema = z__namespace.optional(z__namespace.url());
951
+ schemaRegistry.add(portalSchema, {
952
+ description: "The development portal site for the workspace"
953
+ });
954
+ var licensingSchema = z__namespace.optional(z__namespace.url());
955
+ schemaRegistry.add(licensingSchema, {
956
+ description: "The licensing site for the workspace"
957
+ });
958
+ var contactSchema = z__namespace.optional(z__namespace.url());
959
+ schemaRegistry.add(contactSchema, {
960
+ description: "The contact site for the workspace"
961
+ });
962
+ var supportSchema = z__namespace.optional(z__namespace.url());
963
+ schemaRegistry.add(supportSchema, {
964
+ description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
965
+ });
966
+ var branchSchema = z__namespace._default(
967
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase()),
968
+ "main"
969
+ );
970
+ schemaRegistry.add(branchSchema, {
971
+ description: "The branch of the workspace"
972
+ });
973
+ var preidSchema = z__namespace.optional(
974
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
975
+ );
976
+ schemaRegistry.add(preidSchema, {
977
+ description: "A tag specifying the version pre-release identifier"
978
+ });
979
+ var ownerSchema = z__namespace.optional(
980
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
981
+ );
982
+ schemaRegistry.add(ownerSchema, {
983
+ description: "The owner of the package"
984
+ });
985
+ var modeSchema = z__namespace._default(
986
+ z__namespace.enum(["development", "test", "production"]).check(z__namespace.trim(), z__namespace.toLowerCase()),
987
+ "production"
988
+ );
989
+ schemaRegistry.add(modeSchema, {
990
+ description: "The current runtime environment mode for the package"
991
+ });
992
+ var workspaceRootSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
993
+ schemaRegistry.add(workspaceRootSchema, {
994
+ description: "The root directory of the workspace"
995
+ });
996
+ var skipCacheSchema = z__namespace._default(z__namespace.boolean(), false);
997
+ schemaRegistry.add(skipCacheSchema, {
998
+ description: "Should all known types of workspace caching be skipped?"
999
+ });
1000
+ var packageManagerSchema = z__namespace._default(
1001
+ z__namespace.enum(["npm", "yarn", "pnpm", "bun"]),
1002
+ "npm"
1003
+ );
1004
+ schemaRegistry.add(packageManagerSchema, {
1005
+ description: "The JavaScript/TypeScript package manager used by the repository"
1006
+ });
1007
+ var timezoneSchema = z__namespace._default(
1008
+ z__namespace.string().check(z__namespace.trim()),
1009
+ "America/New_York"
1010
+ );
1011
+ schemaRegistry.add(timezoneSchema, {
1012
+ description: "The default timezone of the workspace"
1013
+ });
1014
+ var localeSchema = z__namespace._default(z__namespace.string().check(z__namespace.trim()), "en-US");
1015
+ schemaRegistry.add(localeSchema, {
1016
+ description: "The default locale of the workspace"
1017
+ });
1018
+ var logLevelSchema = z__namespace._default(
1019
+ z__namespace.enum([
1020
+ "silent",
1021
+ "fatal",
1022
+ "error",
1023
+ "warn",
1024
+ "success",
1025
+ "info",
1026
+ "debug",
1027
+ "trace",
1028
+ "all"
1029
+ ]),
1030
+ "info"
1031
+ );
1032
+ schemaRegistry.add(logLevelSchema, {
1033
+ 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`)."
1034
+ });
1035
+ var skipConfigLoggingSchema = z__namespace._default(z__namespace.boolean(), true);
1036
+ schemaRegistry.add(skipConfigLoggingSchema, {
1037
+ description: "Should the logging of the current Storm Workspace configuration be skipped?"
1038
+ });
1039
+ var configFileSchema = z__namespace._default(
1040
+ z__namespace.nullable(z__namespace.string().check(z__namespace.trim())),
1041
+ null
1042
+ );
1043
+ schemaRegistry.add(configFileSchema, {
1044
+ description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
1045
+ });
1046
+ var extensionsSchema = z__namespace._default(z__namespace.record(z__namespace.string(), z__namespace.any()), {});
1047
+ schemaRegistry.add(extensionsSchema, {
1048
+ description: "Configuration of each used extension"
1049
+ });
1050
+ var workspaceConfigSchema = z__namespace.object({
1051
+ $schema: schemaNameSchema,
1052
+ extends: extendsSchema,
1053
+ name: nameSchema,
1054
+ variant: variantSchema,
1055
+ namespace: namespaceSchema,
1056
+ organization: orgSchema,
1057
+ repository: repositorySchema,
1058
+ license: licenseSchema,
1059
+ homepage: homepageSchema,
1060
+ docs: docsSchema,
1061
+ portal: portalSchema,
1062
+ licensing: licensingSchema,
1063
+ contact: contactSchema,
1064
+ support: supportSchema,
1065
+ branch: branchSchema,
1066
+ preid: preidSchema,
1067
+ owner: ownerSchema,
1068
+ bot: workspaceBotSchema,
1069
+ release: workspaceReleaseSchema,
1070
+ socials: workspaceSocialsSchema,
1071
+ error: errorSchema,
1072
+ mode: modeSchema,
1073
+ workspaceRoot: workspaceRootSchema,
1074
+ skipCache: skipCacheSchema,
1075
+ directories: workspaceDirectorySchema,
1076
+ packageManager: packageManagerSchema,
1077
+ timezone: timezoneSchema,
1078
+ locale: localeSchema,
1079
+ logLevel: logLevelSchema,
1080
+ skipConfigLogging: skipConfigLoggingSchema,
1081
+ registry: registrySchema,
1082
+ configFile: configFileSchema,
1083
+ colors: z__namespace.union([colorsSchema, themeColorsSchema]),
1084
+ extensions: extensionsSchema
1085
+ });
1086
+ schemaRegistry.add(extensionsSchema, {
1087
+ 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."
1088
+ });
1089
+
1090
+ // ../config/src/types.ts
1091
+ var COLOR_KEYS = [
1092
+ "dark",
1093
+ "light",
1094
+ "base",
1095
+ "brand",
1096
+ "alternate",
1097
+ "accent",
1098
+ "link",
1099
+ "success",
1100
+ "help",
1101
+ "info",
1102
+ "warning",
1103
+ "danger",
1104
+ "fatal",
1105
+ "positive",
1106
+ "negative"
1107
+ ];
1108
+ async function getPackageJsonConfig(root) {
1109
+ let license = STORM_DEFAULT_LICENSE;
1110
+ let homepage = void 0;
1111
+ let support = void 0;
1112
+ let name = void 0;
1113
+ let namespace = void 0;
1114
+ let repository = void 0;
1115
+ const workspaceRoot = findWorkspaceRoot(root);
1116
+ if (fs.existsSync(path.join(workspaceRoot, "package.json"))) {
1117
+ const file = await promises.readFile(
1118
+ joinPaths(workspaceRoot, "package.json"),
1119
+ "utf8"
1120
+ );
1121
+ if (file) {
1122
+ const packageJson = JSON.parse(file);
1123
+ if (packageJson.name) {
1124
+ name = packageJson.name;
1125
+ }
1126
+ if (packageJson.namespace) {
1127
+ namespace = packageJson.namespace;
1128
+ }
1129
+ if (packageJson.repository) {
1130
+ if (typeof packageJson.repository === "string") {
1131
+ repository = packageJson.repository;
1132
+ } else if (packageJson.repository.url) {
1133
+ repository = packageJson.repository.url;
1134
+ }
1135
+ }
1136
+ if (packageJson.license) {
1137
+ license = packageJson.license;
1138
+ }
1139
+ if (packageJson.homepage) {
1140
+ homepage = packageJson.homepage;
1141
+ }
1142
+ if (packageJson.bugs) {
1143
+ if (typeof packageJson.bugs === "string") {
1144
+ support = packageJson.bugs;
1145
+ } else if (packageJson.bugs.url) {
1146
+ support = packageJson.bugs.url;
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ return {
1152
+ workspaceRoot,
1153
+ name,
1154
+ namespace,
1155
+ repository,
1156
+ license,
1157
+ homepage,
1158
+ support
1159
+ };
1160
+ }
1161
+ function applyDefaultConfig(config) {
1162
+ if (!config.support && config.contact) {
1163
+ config.support = config.contact;
1164
+ }
1165
+ if (!config.contact && config.support) {
1166
+ config.contact = config.support;
1167
+ }
1168
+ if (config.homepage) {
1169
+ if (!config.docs) {
1170
+ config.docs = `${config.homepage}/docs`;
1171
+ }
1172
+ if (!config.license) {
1173
+ config.license = `${config.homepage}/license`;
1174
+ }
1175
+ if (!config.support) {
1176
+ config.support = `${config.homepage}/support`;
1177
+ }
1178
+ if (!config.contact) {
1179
+ config.contact = `${config.homepage}/contact`;
1180
+ }
1181
+ if (!config.error?.codesFile || !config?.error?.url) {
1182
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
1183
+ if (config.homepage) {
1184
+ config.error.url ??= `${config.homepage}/errors`;
1185
+ }
1186
+ }
1187
+ }
1188
+ return config;
1189
+ }
1190
+
1191
+ // ../config-tools/src/config-file/get-config-file.ts
1192
+ var getConfigFileByName = async (fileName, filePath, options = {}) => {
1193
+ const workspacePath = filePath || findWorkspaceRoot(filePath);
1194
+ const configs = await Promise.all([
1195
+ c12.loadConfig({
1196
+ cwd: workspacePath,
1197
+ packageJson: true,
1198
+ name: fileName,
1199
+ envName: fileName?.toUpperCase(),
1200
+ jitiOptions: {
1201
+ debug: false,
1202
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
1203
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1204
+ "jiti"
1205
+ )
1206
+ },
1207
+ ...options
1208
+ }),
1209
+ c12.loadConfig({
1210
+ cwd: workspacePath,
1211
+ packageJson: true,
1212
+ name: fileName,
1213
+ envName: fileName?.toUpperCase(),
1214
+ jitiOptions: {
1215
+ debug: false,
1216
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
1217
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1218
+ "jiti"
1219
+ )
1220
+ },
1221
+ configFile: fileName,
1222
+ ...options
1223
+ })
1224
+ ]);
1225
+ return defu__default.default(configs[0] ?? {}, configs[1] ?? {});
1226
+ };
1227
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
1228
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
1229
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
1230
+ let config = result.config;
1231
+ const configFile = result.configFile;
1232
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
1233
+ writeTrace(
1234
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
1235
+ {
1236
+ logLevel: "all"
1237
+ }
1238
+ );
1239
+ }
1240
+ if (additionalFileNames && additionalFileNames.length > 0) {
1241
+ const results = await Promise.all(
1242
+ additionalFileNames.map(
1243
+ (fileName) => getConfigFileByName(fileName, workspacePath)
1244
+ )
1245
+ );
1246
+ for (const result2 of results) {
1247
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
1248
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
1249
+ writeTrace(
1250
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
1251
+ {
1252
+ logLevel: "all"
1253
+ }
1254
+ );
1255
+ }
1256
+ config = defu__default.default(result2.config ?? {}, config ?? {});
1257
+ }
1258
+ }
1259
+ }
1260
+ if (!config || Object.keys(config).length === 0) {
1261
+ return void 0;
1262
+ }
1263
+ config.configFile = configFile;
1264
+ return config;
1265
+ };
1266
+ var getConfigEnv = () => {
1267
+ const prefix = "STORM_";
1268
+ let config = {
1269
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
1270
+ name: process.env[`${prefix}NAME`] || void 0,
1271
+ variant: process.env[`${prefix}VARIANT`] || void 0,
1272
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
1273
+ owner: process.env[`${prefix}OWNER`] || void 0,
1274
+ bot: {
1275
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
1276
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
1277
+ },
1278
+ release: {
1279
+ banner: {
1280
+ url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
1281
+ alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
1282
+ },
1283
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
1284
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
1285
+ },
1286
+ error: {
1287
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
1288
+ url: process.env[`${prefix}ERROR_URL`] || void 0
1289
+ },
1290
+ socials: {
1291
+ twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
1292
+ discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
1293
+ telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
1294
+ slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
1295
+ medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
1296
+ github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
1297
+ },
1298
+ 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`] ? {
1299
+ name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
1300
+ description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
1301
+ url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
1302
+ logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
1303
+ icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
1304
+ } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
1305
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
1306
+ license: process.env[`${prefix}LICENSE`] || void 0,
1307
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
1308
+ docs: process.env[`${prefix}DOCS`] || void 0,
1309
+ portal: process.env[`${prefix}PORTAL`] || void 0,
1310
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
1311
+ contact: process.env[`${prefix}CONTACT`] || void 0,
1312
+ support: process.env[`${prefix}SUPPORT`] || void 0,
1313
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
1314
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
1315
+ configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
1316
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
1317
+ directories: {
1318
+ 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,
1319
+ 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,
1320
+ 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,
1321
+ 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,
1322
+ 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,
1323
+ 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
1324
+ },
1325
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
1326
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
1327
+ // ci:
1328
+ // process.env[`${prefix}CI`] !== undefined
1329
+ // ? Boolean(
1330
+ // process.env[`${prefix}CI`] ??
1331
+ // process.env.CI ??
1332
+ // process.env.CONTINUOUS_INTEGRATION
1333
+ // )
1334
+ // : undefined,
1335
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
1336
+ branch: process.env[`${prefix}BRANCH`] || void 0,
1337
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
1338
+ registry: {
1339
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
1340
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
1341
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
1342
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
1343
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
1344
+ },
1345
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
1346
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1347
+ ) ? getLogLevelLabel(
1348
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1349
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
1350
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
1351
+ };
1352
+ const themeNames = Object.keys(process.env).filter(
1353
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
1354
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
1355
+ )
1356
+ );
1357
+ config.colors = themeNames.length > 0 ? themeNames.reduce(
1358
+ (ret, themeName) => {
1359
+ ret[themeName] = getThemeColorsEnv(prefix, themeName);
1360
+ return ret;
1361
+ },
1362
+ {}
1363
+ ) : getThemeColorsEnv(prefix);
1364
+ if (config.docs === STORM_DEFAULT_DOCS) {
1365
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
1366
+ config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
1367
+ } else {
1368
+ config.docs = `${config.homepage}/docs`;
1369
+ }
1370
+ }
1371
+ if (config.licensing === STORM_DEFAULT_LICENSING) {
1372
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
1373
+ config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
1374
+ } else {
1375
+ config.licensing = `${config.homepage}/docs`;
1376
+ }
1377
+ }
1378
+ const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
1379
+ if (serializedConfig) {
1380
+ const parsed = JSON.parse(serializedConfig);
1381
+ config = {
1382
+ ...config,
1383
+ ...parsed,
1384
+ colors: { ...config.colors, ...parsed.colors },
1385
+ extensions: { ...config.extensions, ...parsed.extensions }
1386
+ };
1387
+ }
1388
+ return config;
1389
+ };
1390
+ var getThemeColorsEnv = (prefix, theme) => {
1391
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
1392
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
1393
+ };
1394
+ var getSingleThemeColorsEnv = (prefix) => {
1395
+ const gradient = [];
1396
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1397
+ gradient.push(
1398
+ process.env[`${prefix}GRADIENT_START`],
1399
+ process.env[`${prefix}GRADIENT_END`]
1400
+ );
1401
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1402
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1403
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1404
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1405
+ index++;
1406
+ }
1407
+ }
1408
+ return {
1409
+ dark: process.env[`${prefix}DARK`],
1410
+ light: process.env[`${prefix}LIGHT`],
1411
+ brand: process.env[`${prefix}BRAND`],
1412
+ alternate: process.env[`${prefix}ALTERNATE`],
1413
+ accent: process.env[`${prefix}ACCENT`],
1414
+ link: process.env[`${prefix}LINK`],
1415
+ help: process.env[`${prefix}HELP`],
1416
+ success: process.env[`${prefix}SUCCESS`],
1417
+ info: process.env[`${prefix}INFO`],
1418
+ warning: process.env[`${prefix}WARNING`],
1419
+ danger: process.env[`${prefix}DANGER`],
1420
+ fatal: process.env[`${prefix}FATAL`],
1421
+ positive: process.env[`${prefix}POSITIVE`],
1422
+ negative: process.env[`${prefix}NEGATIVE`],
1423
+ gradient
1424
+ };
1425
+ };
1426
+ var getMultiThemeColorsEnv = (prefix) => {
1427
+ return {
1428
+ light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
1429
+ dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
1430
+ };
1431
+ };
1432
+ var getBaseThemeColorsEnv = (prefix) => {
1433
+ const gradient = [];
1434
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1435
+ gradient.push(
1436
+ process.env[`${prefix}GRADIENT_START`],
1437
+ process.env[`${prefix}GRADIENT_END`]
1438
+ );
1439
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1440
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1441
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1442
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1443
+ index++;
1444
+ }
1445
+ }
1446
+ return {
1447
+ foreground: process.env[`${prefix}FOREGROUND`],
1448
+ background: process.env[`${prefix}BACKGROUND`],
1449
+ brand: process.env[`${prefix}BRAND`],
1450
+ alternate: process.env[`${prefix}ALTERNATE`],
1451
+ accent: process.env[`${prefix}ACCENT`],
1452
+ link: process.env[`${prefix}LINK`],
1453
+ help: process.env[`${prefix}HELP`],
1454
+ success: process.env[`${prefix}SUCCESS`],
1455
+ info: process.env[`${prefix}INFO`],
1456
+ warning: process.env[`${prefix}WARNING`],
1457
+ danger: process.env[`${prefix}DANGER`],
1458
+ fatal: process.env[`${prefix}FATAL`],
1459
+ positive: process.env[`${prefix}POSITIVE`],
1460
+ negative: process.env[`${prefix}NEGATIVE`],
1461
+ gradient
1462
+ };
1463
+ };
1464
+
1465
+ // ../config-tools/src/env/set-env.ts
1466
+ var setExtensionEnv = (extensionName, extension) => {
1467
+ for (const key of Object.keys(extension ?? {})) {
1468
+ if (extension[key]) {
1469
+ const result = key?.replace(
1470
+ /([A-Z])+/g,
1471
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
1472
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
1473
+ let extensionKey;
1474
+ if (result.length === 0) {
1475
+ return;
1476
+ }
1477
+ if (result.length === 1) {
1478
+ extensionKey = result[0]?.toUpperCase() ?? "";
1479
+ } else {
1480
+ extensionKey = result.reduce((ret, part) => {
1481
+ return `${ret}_${part.toLowerCase()}`;
1482
+ });
1483
+ }
1484
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
1485
+ }
1486
+ }
1487
+ };
1488
+ var setConfigEnv = (config) => {
1489
+ const prefix = "STORM_";
1490
+ if (config.extends) {
1491
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
1492
+ }
1493
+ if (config.name) {
1494
+ process.env[`${prefix}NAME`] = config.name;
1495
+ }
1496
+ if (config.variant) {
1497
+ process.env[`${prefix}VARIANT`] = config.variant;
1498
+ }
1499
+ if (config.namespace) {
1500
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
1501
+ }
1502
+ if (config.owner) {
1503
+ process.env[`${prefix}OWNER`] = config.owner;
1504
+ }
1505
+ if (config.bot) {
1506
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
1507
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
1508
+ }
1509
+ if (config.error) {
1510
+ process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
1511
+ process.env[`${prefix}ERROR_URL`] = config.error.url;
1512
+ }
1513
+ if (config.release) {
1514
+ if (config.release.banner) {
1515
+ if (typeof config.release.banner === "string") {
1516
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
1517
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
1518
+ } else {
1519
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
1520
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
1521
+ process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
1522
+ }
1523
+ }
1524
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
1525
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1526
+ }
1527
+ if (config.socials) {
1528
+ if (config.socials.twitter) {
1529
+ process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
1530
+ }
1531
+ if (config.socials.discord) {
1532
+ process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
1533
+ }
1534
+ if (config.socials.telegram) {
1535
+ process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
1536
+ }
1537
+ if (config.socials.slack) {
1538
+ process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
1539
+ }
1540
+ if (config.socials.medium) {
1541
+ process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
1542
+ }
1543
+ if (config.socials.github) {
1544
+ process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
1545
+ }
1546
+ }
1547
+ if (config.organization) {
1548
+ if (typeof config.organization === "string") {
1549
+ process.env[`${prefix}ORG`] = config.organization;
1550
+ process.env[`${prefix}ORG_NAME`] = config.organization;
1551
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
1552
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
1553
+ } else {
1554
+ process.env[`${prefix}ORG`] = config.organization.name;
1555
+ process.env[`${prefix}ORG_NAME`] = config.organization.name;
1556
+ process.env[`${prefix}ORGANIZATION`] = config.organization.name;
1557
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
1558
+ if (config.organization.url) {
1559
+ process.env[`${prefix}ORG_URL`] = config.organization.url;
1560
+ process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
1561
+ }
1562
+ if (config.organization.description) {
1563
+ process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
1564
+ process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
1565
+ }
1566
+ if (config.organization.logo) {
1567
+ process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
1568
+ process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
1569
+ }
1570
+ if (config.organization.icon) {
1571
+ process.env[`${prefix}ORG_ICON`] = config.organization.icon;
1572
+ process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
1573
+ }
1574
+ }
1575
+ }
1576
+ if (config.packageManager) {
1577
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
1578
+ }
1579
+ if (config.license) {
1580
+ process.env[`${prefix}LICENSE`] = config.license;
1581
+ }
1582
+ if (config.homepage) {
1583
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
1584
+ }
1585
+ if (config.docs) {
1586
+ process.env[`${prefix}DOCS`] = config.docs;
1587
+ }
1588
+ if (config.portal) {
1589
+ process.env[`${prefix}PORTAL`] = config.portal;
1590
+ }
1591
+ if (config.licensing) {
1592
+ process.env[`${prefix}LICENSING`] = config.licensing;
1593
+ }
1594
+ if (config.contact) {
1595
+ process.env[`${prefix}CONTACT`] = config.contact;
1596
+ }
1597
+ if (config.support) {
1598
+ process.env[`${prefix}SUPPORT`] = config.support;
1599
+ }
1600
+ if (config.timezone) {
1601
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
1602
+ process.env.TZ = config.timezone;
1603
+ process.env.DEFAULT_TIMEZONE = config.timezone;
1604
+ process.env.TIMEZONE = config.timezone;
1605
+ }
1606
+ if (config.locale) {
1607
+ process.env[`${prefix}LOCALE`] = config.locale;
1608
+ process.env.DEFAULT_LOCALE = config.locale;
1609
+ process.env.LOCALE = config.locale;
1610
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1611
+ }
1612
+ if (config.configFile) {
1613
+ process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
1614
+ config.configFile
1615
+ );
1616
+ }
1617
+ if (config.workspaceRoot) {
1618
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
1619
+ process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
1620
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
1621
+ }
1622
+ if (config.directories) {
1623
+ if (!config.skipCache && config.directories.cache) {
1624
+ process.env[`${prefix}CACHE_DIR`] = correctPaths(
1625
+ config.directories.cache
1626
+ );
1627
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1628
+ }
1629
+ if (config.directories.data) {
1630
+ process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
1631
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1632
+ }
1633
+ if (config.directories.config) {
1634
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths(
1635
+ config.directories.config
1636
+ );
1637
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1638
+ }
1639
+ if (config.directories.temp) {
1640
+ process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
1641
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1642
+ }
1643
+ if (config.directories.log) {
1644
+ process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
1645
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1646
+ }
1647
+ if (config.directories.build) {
1648
+ process.env[`${prefix}BUILD_DIR`] = correctPaths(
1649
+ config.directories.build
1650
+ );
1651
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1652
+ }
1653
+ }
1654
+ if (config.skipCache !== void 0) {
1655
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
1656
+ if (config.skipCache) {
1657
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
1658
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
1659
+ }
1660
+ }
1661
+ if (config.mode) {
1662
+ process.env[`${prefix}MODE`] = config.mode;
1663
+ process.env.NODE_ENV = config.mode;
1664
+ process.env.ENVIRONMENT = config.mode;
1665
+ }
1666
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
1667
+ for (const key of Object.keys(config.colors)) {
1668
+ setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
1669
+ }
1670
+ } else {
1671
+ setThemeColorsEnv(
1672
+ `${prefix}COLOR_`,
1673
+ config.colors
1674
+ );
1675
+ }
1676
+ if (config.repository) {
1677
+ process.env[`${prefix}REPOSITORY`] = config.repository;
1678
+ }
1679
+ if (config.branch) {
1680
+ process.env[`${prefix}BRANCH`] = config.branch;
1681
+ }
1682
+ if (config.preid) {
1683
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
1684
+ }
1685
+ if (config.registry) {
1686
+ if (config.registry.github) {
1687
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
1688
+ }
1689
+ if (config.registry.npm) {
1690
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
1691
+ }
1692
+ if (config.registry.cargo) {
1693
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
1694
+ }
1695
+ if (config.registry.cyclone) {
1696
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
1697
+ config.registry.cyclone
1698
+ );
1699
+ }
1700
+ if (config.registry.container) {
1701
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
1702
+ config.registry.container
1703
+ );
1704
+ }
1705
+ }
1706
+ if (config.logLevel) {
1707
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
1708
+ process.env.LOG_LEVEL = String(config.logLevel);
1709
+ process.env.NX_VERBOSE_LOGGING = String(
1710
+ getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
1711
+ );
1712
+ process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
1713
+ }
1714
+ if (config.skipConfigLogging !== void 0) {
1715
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
1716
+ config.skipConfigLogging
1717
+ );
1718
+ }
1719
+ process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
1720
+ for (const key of Object.keys(config.extensions ?? {})) {
1721
+ if (config.extensions[key] && Object.keys(config.extensions[key])) {
1722
+ setExtensionEnv(key, config.extensions[key]);
1723
+ }
1724
+ }
1725
+ };
1726
+ var setThemeColorsEnv = (prefix, config) => {
1727
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1728
+ };
1729
+ var setSingleThemeColorsEnv = (prefix, config) => {
1730
+ if (config.dark) {
1731
+ process.env[`${prefix}DARK`] = config.dark;
1732
+ }
1733
+ if (config.light) {
1734
+ process.env[`${prefix}LIGHT`] = config.light;
1735
+ }
1736
+ if (config.brand) {
1737
+ process.env[`${prefix}BRAND`] = config.brand;
1738
+ }
1739
+ if (config.alternate) {
1740
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1741
+ }
1742
+ if (config.accent) {
1743
+ process.env[`${prefix}ACCENT`] = config.accent;
1744
+ }
1745
+ if (config.link) {
1746
+ process.env[`${prefix}LINK`] = config.link;
1747
+ }
1748
+ if (config.help) {
1749
+ process.env[`${prefix}HELP`] = config.help;
1750
+ }
1751
+ if (config.success) {
1752
+ process.env[`${prefix}SUCCESS`] = config.success;
1753
+ }
1754
+ if (config.info) {
1755
+ process.env[`${prefix}INFO`] = config.info;
1756
+ }
1757
+ if (config.warning) {
1758
+ process.env[`${prefix}WARNING`] = config.warning;
1759
+ }
1760
+ if (config.danger) {
1761
+ process.env[`${prefix}DANGER`] = config.danger;
1762
+ }
1763
+ if (config.fatal) {
1764
+ process.env[`${prefix}FATAL`] = config.fatal;
1765
+ }
1766
+ if (config.positive) {
1767
+ process.env[`${prefix}POSITIVE`] = config.positive;
1768
+ }
1769
+ if (config.negative) {
1770
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1771
+ }
1772
+ if (config.gradient) {
1773
+ for (let i = 0; i < config.gradient.length; i++) {
1774
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1775
+ }
1776
+ }
1777
+ };
1778
+ var setMultiThemeColorsEnv = (prefix, config) => {
1779
+ return {
1780
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
1781
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
1782
+ };
1783
+ };
1784
+ var setBaseThemeColorsEnv = (prefix, config) => {
1785
+ if (config.foreground) {
1786
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
1787
+ }
1788
+ if (config.background) {
1789
+ process.env[`${prefix}BACKGROUND`] = config.background;
1790
+ }
1791
+ if (config.brand) {
1792
+ process.env[`${prefix}BRAND`] = config.brand;
1793
+ }
1794
+ if (config.alternate) {
1795
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1796
+ }
1797
+ if (config.accent) {
1798
+ process.env[`${prefix}ACCENT`] = config.accent;
1799
+ }
1800
+ if (config.link) {
1801
+ process.env[`${prefix}LINK`] = config.link;
1802
+ }
1803
+ if (config.help) {
1804
+ process.env[`${prefix}HELP`] = config.help;
1805
+ }
1806
+ if (config.success) {
1807
+ process.env[`${prefix}SUCCESS`] = config.success;
1808
+ }
1809
+ if (config.info) {
1810
+ process.env[`${prefix}INFO`] = config.info;
1811
+ }
1812
+ if (config.warning) {
1813
+ process.env[`${prefix}WARNING`] = config.warning;
1814
+ }
1815
+ if (config.danger) {
1816
+ process.env[`${prefix}DANGER`] = config.danger;
1817
+ }
1818
+ if (config.fatal) {
1819
+ process.env[`${prefix}FATAL`] = config.fatal;
1820
+ }
1821
+ if (config.positive) {
1822
+ process.env[`${prefix}POSITIVE`] = config.positive;
1823
+ }
1824
+ if (config.negative) {
1825
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1826
+ }
1827
+ if (config.gradient) {
1828
+ for (let i = 0; i < config.gradient.length; i++) {
1829
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1830
+ }
1831
+ }
1832
+ };
1833
+ var _static_cache = void 0;
1834
+ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
1835
+ let result;
1836
+ if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
1837
+ let _workspaceRoot = workspaceRoot;
1838
+ if (!_workspaceRoot) {
1839
+ _workspaceRoot = findWorkspaceRoot();
1840
+ }
1841
+ const configEnv = getConfigEnv();
1842
+ const configFile = await getConfigFile(_workspaceRoot);
1843
+ if (!configFile) {
1844
+ if (!skipLogs) {
1845
+ writeWarning(
1846
+ "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",
1847
+ { logLevel: "all" }
1848
+ );
1849
+ }
1850
+ if (useDefault === false) {
1851
+ return void 0;
1852
+ }
1853
+ }
1854
+ const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
1855
+ const configInput = defu__default.default(
1856
+ configEnv,
1857
+ configFile,
1858
+ defaultConfig
1859
+ );
1860
+ if (!configInput.variant) {
1861
+ 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";
1862
+ }
1863
+ try {
1864
+ result = applyDefaultConfig(
1865
+ await workspaceConfigSchema.parseAsync(configInput)
1866
+ );
1867
+ result.workspaceRoot ??= _workspaceRoot;
1868
+ } catch (error) {
1869
+ throw new Error(
1870
+ `Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
1871
+
1872
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${formatLogMessage(
1873
+ configInput
1874
+ )}`,
1875
+ {
1876
+ cause: error
1877
+ }
1878
+ );
1879
+ }
1880
+ } else {
1881
+ result = _static_cache.data;
1882
+ }
1883
+ _static_cache = {
1884
+ timestamp: Date.now(),
1885
+ data: result
1886
+ };
1887
+ return result;
1888
+ };
1889
+ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
1890
+ const config = await createStormWorkspaceConfig(
1891
+ void 0,
1892
+ void 0,
1893
+ workspaceRoot,
1894
+ skipLogs,
1895
+ true
1896
+ );
1897
+ setConfigEnv(config);
1898
+ if (!skipLogs && !config.skipConfigLogging) {
1899
+ writeTrace(
1900
+ `\u2699\uFE0F Using Storm Workspace configuration:
1901
+ ${formatLogMessage(config)}`,
1902
+ config
1903
+ );
1904
+ }
1905
+ return config;
1906
+ };
1907
+
1908
+ // ../config-tools/src/get-config.ts
1909
+ function getConfig(workspaceRoot, skipLogs = false) {
1910
+ return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
1911
+ }
1912
+ function getWorkspaceConfig(skipLogs = true, options = {}) {
1913
+ let workspaceRoot = options.workspaceRoot;
1914
+ if (!workspaceRoot) {
1915
+ workspaceRoot = findWorkspaceRoot(options.cwd);
1916
+ }
1917
+ return getConfig(workspaceRoot, skipLogs);
1918
+ }
1919
+
1920
+ // src/utilities/title-case.ts
1921
+ var ACRONYMS = [
1922
+ "3D",
1923
+ "4D",
1924
+ "5G",
1925
+ "6G",
1926
+ "7G",
1927
+ "8G",
1928
+ "ACID",
1929
+ "AES",
1930
+ "AI",
1931
+ "AJAX",
1932
+ "API",
1933
+ "AR",
1934
+ "ASCII",
1935
+ "B2B",
1936
+ "B2C",
1937
+ "BFF",
1938
+ "BI",
1939
+ "BIOS",
1940
+ "BGP",
1941
+ "BOM",
1942
+ "BYOD",
1943
+ "C2C",
1944
+ "CAGR",
1945
+ "CAPTCHA",
1946
+ "CD",
1947
+ "CDN",
1948
+ "CDP",
1949
+ "CI",
1950
+ "CI/CD",
1951
+ "CIAM",
1952
+ "CICD",
1953
+ "CLI",
1954
+ "CMDB",
1955
+ "CORS",
1956
+ "CPU",
1957
+ "CRUD",
1958
+ "CSR",
1959
+ "CSS",
1960
+ "CX",
1961
+ "DAG",
1962
+ "DBMS",
1963
+ "DDoS",
1964
+ "DNS",
1965
+ "DNSSEC",
1966
+ "DOM",
1967
+ "DR",
1968
+ "DRM",
1969
+ "DWH",
1970
+ "E2E",
1971
+ "EAI",
1972
+ "EKS",
1973
+ "EOF",
1974
+ "EOD",
1975
+ "ETC",
1976
+ "ETL",
1977
+ "EULA",
1978
+ "FIDO",
1979
+ "FQDN",
1980
+ "FTP",
1981
+ "FaaS",
1982
+ "GDPR",
1983
+ "GCP",
1984
+ "GPU",
1985
+ "GUID",
1986
+ "GUI",
1987
+ "GZIP",
1988
+ "HCI",
1989
+ "HDD",
1990
+ "HDFS",
1991
+ "HIPAA",
1992
+ "HMAC",
1993
+ "HOTP",
1994
+ "HSM",
1995
+ "HTML",
1996
+ "HTTP",
1997
+ "HTTP/2",
1998
+ "HTTP/2.0",
1999
+ "HTTP/3",
2000
+ "HTTP/3.0",
2001
+ "HTTP2",
2002
+ "HTTPS",
2003
+ "HTTPS/2",
2004
+ "HTTPS/3",
2005
+ "HTTPS3",
2006
+ "IAM",
2007
+ "IAMM",
2008
+ "IAMT",
2009
+ "IaaS",
2010
+ "ID",
2011
+ "IMAP",
2012
+ "IP",
2013
+ "IPFS",
2014
+ "IoT",
2015
+ "JSON",
2016
+ "JSONP",
2017
+ "JWT",
2018
+ "K8s",
2019
+ "KMS",
2020
+ "KPI",
2021
+ "LAN",
2022
+ "LHS",
2023
+ "LXC",
2024
+ "MFA",
2025
+ "ML",
2026
+ "MLOps",
2027
+ "MVC",
2028
+ "MVP",
2029
+ "NAS",
2030
+ "NAT",
2031
+ "NDA",
2032
+ "NFS",
2033
+ "NIST",
2034
+ "NLP",
2035
+ "NPS",
2036
+ "OCR",
2037
+ "OEM",
2038
+ "OKR",
2039
+ "OLAP",
2040
+ "OLTP",
2041
+ "OOP",
2042
+ "ORM",
2043
+ "OS",
2044
+ "OTP",
2045
+ "P2P",
2046
+ "PDP",
2047
+ "PaaS",
2048
+ "PCI",
2049
+ "PKI",
2050
+ "PP",
2051
+ "PWA",
2052
+ "PX",
2053
+ "QA",
2054
+ "RAID",
2055
+ "RAM",
2056
+ "RDS",
2057
+ "REST",
2058
+ "RHS",
2059
+ "RPC",
2060
+ "RPA",
2061
+ "RUM",
2062
+ "RSS",
2063
+ "SAN",
2064
+ "SASE",
2065
+ "SDLC",
2066
+ "SDK",
2067
+ "SEO",
2068
+ "SFTP",
2069
+ "SIEM",
2070
+ "SLA",
2071
+ "SMB",
2072
+ "SMTP",
2073
+ "SOAP",
2074
+ "SOC",
2075
+ "SOA",
2076
+ "SPDY",
2077
+ "SPF",
2078
+ "SQL",
2079
+ "SRV",
2080
+ "SRE",
2081
+ "SSH",
2082
+ "SSDL",
2083
+ "SSO",
2084
+ "SSL",
2085
+ "SSR",
2086
+ "TDD",
2087
+ "TLD",
2088
+ "TLS",
2089
+ "TLS1.3",
2090
+ "TOTP",
2091
+ "TRPC",
2092
+ "TTL",
2093
+ "UDP",
2094
+ "UI",
2095
+ "UID",
2096
+ "URI",
2097
+ "URL",
2098
+ "UTF",
2099
+ "UUID",
2100
+ "UX",
2101
+ "VM",
2102
+ "VLAN",
2103
+ "VPN",
2104
+ "VR",
2105
+ "WAF",
2106
+ "WAN",
2107
+ "WLAN",
2108
+ "WPA",
2109
+ "XACML",
2110
+ "XML",
2111
+ "XSRF",
2112
+ "XSS",
2113
+ "XR",
2114
+ "YAML",
2115
+ "ZTA"
2116
+ ];
2117
+ ACRONYMS.reduce(
2118
+ (ret, acronym) => {
2119
+ ret[acronym.toLowerCase()] = acronym;
2120
+ return ret;
2121
+ },
2122
+ {
2123
+ cspell: "CSpell",
2124
+ eslint: "ESLint",
2125
+ nx: "Nx"
2126
+ }
2127
+ );
2128
+
2129
+ // src/utilities/changelog-utils.ts
2130
+ function generateChangelogTitle(version, project, workspaceConfig) {
2131
+ if (!workspaceConfig?.name || !project) {
2132
+ return version;
2133
+ }
2134
+ return `[${version}](https://github.com/${typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization?.name}/${workspaceConfig.name}/releases/tag/${project}%40${version}) (${(/* @__PURE__ */ new Date()).getMonth() + 1}/${(/* @__PURE__ */ new Date()).getDate()}/${(/* @__PURE__ */ new Date()).getFullYear()})`;
2135
+ }
2136
+
2137
+ // src/release/changelog-renderer.ts
2138
+ var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.default {
2139
+ /**
2140
+ * The Storm workspace configuration object, which is loaded from the storm-workspace.json file.
2141
+ */
2142
+ workspaceConfig;
2143
+ /**
2144
+ * A ChangelogRenderer class takes in the determined changes and other relevant metadata and returns a string, or a Promise of a string of changelog contents (usually markdown).
2145
+ *
2146
+ * @param config - The configuration object for the ChangelogRenderer
2147
+ */
2148
+ constructor(config) {
2149
+ const resolvedConfig = {
2150
+ entryWhenNoChanges: false,
2151
+ conventionalCommitsConfig: conventionalCommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG,
2152
+ ...config
2153
+ };
2154
+ super(resolvedConfig);
2155
+ this.workspaceConfig = config.workspaceConfig;
2156
+ this.remoteReleaseClient = resolvedConfig.remoteReleaseClient;
2157
+ }
2158
+ async render() {
2159
+ if (!this.workspaceConfig) {
2160
+ this.workspaceConfig = await getWorkspaceConfig();
2161
+ }
2162
+ return super.render();
2163
+ }
2164
+ preprocessChanges() {
2165
+ this.relevantChanges = [...this.changes];
2166
+ this.breakingChanges = [];
2167
+ this.additionalChangesForAuthorsSection = [];
2168
+ for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
2169
+ const change = this.relevantChanges[i];
2170
+ if (change && change.type === "revert" && change.revertedHashes) {
2171
+ for (const revertedHash of change.revertedHashes) {
2172
+ const revertedCommitIndex = this.relevantChanges.findIndex(
2173
+ (c) => c.shortHash && revertedHash.startsWith(c.shortHash)
2174
+ );
2175
+ if (revertedCommitIndex !== -1) {
2176
+ this.relevantChanges.splice(revertedCommitIndex, 1);
2177
+ this.relevantChanges.splice(i, 1);
2178
+ i--;
2179
+ break;
2180
+ }
2181
+ }
2182
+ }
2183
+ }
2184
+ if (this.isVersionPlans) {
2185
+ this.conventionalCommitsConfig = {
2186
+ types: {
2187
+ feat: conventionalCommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.feat,
2188
+ fix: conventionalCommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.fix
2189
+ }
2190
+ };
2191
+ for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
2192
+ if (this.relevantChanges[i]?.isBreaking) {
2193
+ const change = this.relevantChanges[i];
2194
+ if (change) {
2195
+ this.additionalChangesForAuthorsSection.push(change);
2196
+ const line = this.formatChange(change);
2197
+ this.breakingChanges.push(line);
2198
+ this.relevantChanges.splice(i, 1);
2199
+ }
2200
+ }
2201
+ }
2202
+ } else {
2203
+ for (const change of this.relevantChanges) {
2204
+ if (change.isBreaking) {
2205
+ const breakingChangeExplanation = change.body ? this.extractBreakingChangeExplanation(change.body) : "";
2206
+ this.breakingChanges.push(
2207
+ breakingChangeExplanation ? `- ${change.scope ? `**${change.scope.trim()}:** ` : ""}${breakingChangeExplanation}` : this.formatChange(change)
2208
+ );
2209
+ }
2210
+ }
2211
+ }
2212
+ }
2213
+ /**
2214
+ * Determines if the changelog entry should be rendered as empty. This is the case when there are no relevant changes, breaking changes, or dependency bumps.
2215
+ */
2216
+ // protected override shouldRenderEmptyEntry(): boolean {
2217
+ // return true;
2218
+ // }
2219
+ renderVersionTitle() {
2220
+ const isMajorVersion = `${semver.major(this.changelogEntryVersion)}.0.0` === this.changelogEntryVersion.replace(/^v/, "");
2221
+ return isMajorVersion ? `# ${generateChangelogTitle(
2222
+ this.changelogEntryVersion,
2223
+ this.project,
2224
+ this.workspaceConfig
2225
+ )}` : `## ${generateChangelogTitle(
2226
+ this.changelogEntryVersion,
2227
+ this.project,
2228
+ this.workspaceConfig
2229
+ )}`;
2230
+ }
2231
+ renderBreakingChanges() {
2232
+ return [
2233
+ "### Breaking Changes",
2234
+ "",
2235
+ ...Array.from(new Set(this.breakingChanges))
2236
+ ];
2237
+ }
2238
+ renderDependencyBumps() {
2239
+ const markdownLines = ["", "### Updated Dependencies", ""];
2240
+ this.dependencyBumps?.forEach(({ dependencyName, newVersion }) => {
2241
+ const markdownLine = `- Updated **${dependencyName}** to **v${newVersion}**`;
2242
+ if (!markdownLines.includes(markdownLine)) {
2243
+ markdownLines.push(markdownLine);
2244
+ }
2245
+ });
2246
+ return markdownLines;
2247
+ }
2248
+ async renderAuthors() {
2249
+ const markdownLines = [];
2250
+ const _authors = /* @__PURE__ */ new Map();
2251
+ for (const change of [
2252
+ ...this.relevantChanges,
2253
+ ...this.additionalChangesForAuthorsSection
2254
+ ]) {
2255
+ if (!change.authors) {
2256
+ continue;
2257
+ }
2258
+ for (const author of change.authors) {
2259
+ const name = this.formatName(author.name);
2260
+ if (!name || name.includes("[bot]") || name === this.workspaceConfig?.bot.name) {
2261
+ continue;
2262
+ }
2263
+ if (_authors.has(name)) {
2264
+ const entry = _authors.get(name);
2265
+ entry?.email.add(author.email);
2266
+ } else {
2267
+ _authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
2268
+ }
2269
+ }
2270
+ }
2271
+ if (this.changelogRenderOptions.mapAuthorsToGitHubUsernames) {
2272
+ await Promise.all(
2273
+ [..._authors.keys()].map(async (authorName) => {
2274
+ const meta = _authors.get(authorName);
2275
+ if (!meta) {
2276
+ return;
2277
+ }
2278
+ for (const email of meta.email) {
2279
+ if (email?.endsWith("@users.noreply.github.com")) {
2280
+ const match = email?.match(
2281
+ /^(\d+\+)?([^@]+)@users\.noreply\.github\.com$/
2282
+ );
2283
+ if (match && match[2]) {
2284
+ meta.github = match[2];
2285
+ break;
2286
+ }
2287
+ }
2288
+ const { data } = await axios2__default.default.get(`https://ungh.cc/users/find/${email}`).catch(() => ({ data: { user: null } }));
2289
+ if (data?.user) {
2290
+ meta.github = data.user.username;
2291
+ break;
2292
+ }
2293
+ }
2294
+ })
2295
+ );
2296
+ }
2297
+ const authors = [..._authors.entries()].map((e) => ({
2298
+ name: e[0],
2299
+ ...e[1]
2300
+ }));
2301
+ if (authors.length > 0) {
2302
+ markdownLines.push(
2303
+ "",
2304
+ "### \u2764\uFE0F Thank You",
2305
+ "",
2306
+ ...authors.sort((a, b) => a.name.localeCompare(b.name)).map((i) => {
2307
+ const github = i.github ? ` @${i.github}` : "";
2308
+ return `- ${i.name}${github}`;
2309
+ })
2310
+ );
2311
+ }
2312
+ return markdownLines;
2313
+ }
2314
+ formatChange(change) {
2315
+ let description = change.description || "";
2316
+ let extraLines = [];
2317
+ let extraLinesStr = "";
2318
+ if (description.includes("\n")) {
2319
+ const lines = description.split("\n");
2320
+ if (lines.length > 1) {
2321
+ description = lines[0];
2322
+ extraLines = lines.slice(1);
2323
+ }
2324
+ const indentation = " ";
2325
+ extraLinesStr = extraLines.filter((l) => l.trim().length > 0).map((l) => `${indentation}${l}`).join("\n");
2326
+ }
2327
+ let changeLine = "- " + (!this.isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : "") + description;
2328
+ if (change.githubReferences) {
2329
+ changeLine += this.remoteReleaseClient.formatReferences(
2330
+ change.githubReferences
2331
+ );
2332
+ }
2333
+ if (extraLinesStr) {
2334
+ changeLine += "\n\n" + extraLinesStr;
2335
+ }
2336
+ return changeLine;
2337
+ }
2338
+ };
2339
+
2340
+ // src/release/config.ts
2341
+ var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
2342
+ questions: chunkNY53WLGC_cjs.DEFAULT_MONOREPO_COMMIT_QUESTIONS,
2343
+ types: chunk4VPJA7YJ_cjs.DEFAULT_COMMIT_TYPES
2344
+ };
2345
+ var DEFAULT_RELEASE_TAG_PATTERN = "{projectName}@{version}";
2346
+ var DEFAULT_RELEASE_GROUP_CONFIG = {
2347
+ projectsRelationship: "independent",
2348
+ changelog: {
2349
+ createRelease: "github",
2350
+ entryWhenNoChanges: false,
2351
+ file: false,
2352
+ renderOptions: {
2353
+ authors: false,
2354
+ commitReferences: true,
2355
+ versionTitleDate: true
2356
+ }
2357
+ },
2358
+ version: {
2359
+ currentVersionResolver: "git-tag",
2360
+ specifierSource: "conventional-commits",
2361
+ groupPreVersionCommand: "pnpm build"
2362
+ },
2363
+ releaseTag: { pattern: DEFAULT_RELEASE_TAG_PATTERN }
2364
+ };
2365
+ var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
2366
+ ...DEFAULT_RELEASE_GROUP_CONFIG,
2367
+ projects: ["packages/*"],
2368
+ version: {
2369
+ ...DEFAULT_RELEASE_GROUP_CONFIG.version,
2370
+ versionActions: "@storm-software/workspace-tools/release/js-version-actions",
2371
+ versionActionsOptions: {
2372
+ currentVersionResolver: "git-tag",
2373
+ specifierSource: "conventional-commits"
2374
+ },
2375
+ manifestRootsToUpdate: [
2376
+ "{projectRoot}",
2377
+ {
2378
+ path: "dist/{projectRoot}",
2379
+ preserveLocalDependencyProtocols: false
2380
+ }
2381
+ ]
2382
+ }
2383
+ };
2384
+ var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
2385
+ ...DEFAULT_RELEASE_GROUP_CONFIG,
2386
+ projects: ["crates/*"],
2387
+ version: {
2388
+ ...DEFAULT_RELEASE_GROUP_CONFIG.version,
2389
+ versionActions: "@storm-software/workspace-tools/release/rust-version-actions",
2390
+ versionActionsOptions: {
2391
+ currentVersionResolver: "git-tag",
2392
+ specifierSource: "conventional-commits"
2393
+ },
2394
+ manifestRootsToUpdate: ["{projectRoot}"]
2395
+ }
2396
+ };
2397
+ var DEFAULT_RELEASE_CONFIG = {
2398
+ conventionalCommits: DEFAULT_CONVENTIONAL_COMMITS_CONFIG2,
2399
+ groups: {
2400
+ packages: DEFAULT_JS_RELEASE_GROUP_CONFIG,
2401
+ crates: DEFAULT_RUST_RELEASE_GROUP_CONFIG
2402
+ },
2403
+ changelog: {
2404
+ automaticFromRef: true,
2405
+ workspaceChangelog: false,
2406
+ projectChangelogs: true
2407
+ },
2408
+ releaseTag: { pattern: DEFAULT_RELEASE_TAG_PATTERN }
2409
+ };
2410
+ function getReleaseGroupConfig(releaseConfig, workspaceConfig) {
2411
+ return !releaseConfig?.groups || Object.keys(releaseConfig.groups).length === 0 ? {} : Object.fromEntries(
2412
+ Object.entries(releaseConfig.groups).map(([name, group]) => {
2413
+ const config = defu__default.default(
2414
+ {
2415
+ ...omit(DEFAULT_RELEASE_GROUP_CONFIG, ["changelog"]),
2416
+ ...group
2417
+ },
2418
+ {
2419
+ changelog: {
2420
+ ...DEFAULT_RELEASE_GROUP_CONFIG.changelog,
2421
+ renderer: StormChangelogRenderer,
2422
+ renderOptions: {
2423
+ ...DEFAULT_RELEASE_GROUP_CONFIG.changelog.renderOptions,
2424
+ workspaceConfig
2425
+ }
2426
+ }
2427
+ }
2428
+ );
2429
+ if (workspaceConfig?.workspaceRoot) {
2430
+ if (config.changelog?.renderer && typeof config.changelog?.renderer === "string" && config.changelog?.renderer?.toString().startsWith("./")) {
2431
+ config.changelog.renderer = joinPaths(
2432
+ workspaceConfig.workspaceRoot,
2433
+ config.changelog.renderer
2434
+ );
2435
+ }
2436
+ if (config.version?.versionActions && config.version.versionActions.startsWith("./")) {
2437
+ config.version.versionActions = joinPaths(
2438
+ workspaceConfig.workspaceRoot,
2439
+ config.version?.versionActions
2440
+ );
2441
+ }
2442
+ }
2443
+ return [name, config];
2444
+ })
2445
+ );
2446
+ }
2447
+
2448
+ exports.DEFAULT_CONVENTIONAL_COMMITS_CONFIG = DEFAULT_CONVENTIONAL_COMMITS_CONFIG2;
2449
+ exports.DEFAULT_JS_RELEASE_GROUP_CONFIG = DEFAULT_JS_RELEASE_GROUP_CONFIG;
2450
+ exports.DEFAULT_RELEASE_CONFIG = DEFAULT_RELEASE_CONFIG;
2451
+ exports.DEFAULT_RELEASE_GROUP_CONFIG = DEFAULT_RELEASE_GROUP_CONFIG;
2452
+ exports.DEFAULT_RELEASE_TAG_PATTERN = DEFAULT_RELEASE_TAG_PATTERN;
2453
+ exports.DEFAULT_RUST_RELEASE_GROUP_CONFIG = DEFAULT_RUST_RELEASE_GROUP_CONFIG;
2454
+ exports.getReleaseGroupConfig = getReleaseGroupConfig;