@storm-software/unbuild 0.49.58 → 0.49.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/unbuild.cjs CHANGED
@@ -47,20 +47,52 @@ If this sounds interesting, and you would like to help us in creating the next g
47
47
  var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
48
48
 
49
49
  // ../config/src/schema.ts
50
- var DarkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d1e22").describe("The dark background color of the workspace");
51
- var LightColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
52
- var BrandColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary brand specific color of the workspace");
53
- var AlternateColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The alternate brand specific color of the workspace");
54
- var AccentColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The secondary brand specific color of the workspace");
55
- var LinkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The color used to display hyperlink text");
56
- var HelpColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#8256D0").describe("The second brand specific color of the workspace");
57
- var SuccessColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#12B66A").describe("The success color of the workspace");
58
- var InfoColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0070E0").describe("The informational color of the workspace");
59
- var WarningColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
60
- var DangerColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#D8314A").describe("The danger color of the workspace");
61
- var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
62
- var PositiveColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#4ade80").describe("The positive number color of the workspace");
63
- var NegativeColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ef4444").describe("The negative number color of the workspace");
50
+ var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
51
+ var DarkColorSchema = ColorSchema.default("#151718").describe(
52
+ "The dark background color of the workspace"
53
+ );
54
+ var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
55
+ "The light background color of the workspace"
56
+ );
57
+ var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
58
+ "The primary brand specific color of the workspace"
59
+ );
60
+ var AlternateColorSchema = ColorSchema.optional().describe(
61
+ "The alternate brand specific color of the workspace"
62
+ );
63
+ var AccentColorSchema = ColorSchema.optional().describe(
64
+ "The secondary brand specific color of the workspace"
65
+ );
66
+ var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
67
+ "The color used to display hyperlink text"
68
+ );
69
+ var HelpColorSchema = ColorSchema.default("#818cf8").describe(
70
+ "The second brand specific color of the workspace"
71
+ );
72
+ var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
73
+ "The success color of the workspace"
74
+ );
75
+ var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
76
+ "The informational color of the workspace"
77
+ );
78
+ var WarningColorSchema = ColorSchema.default("#f3d371").describe(
79
+ "The warning color of the workspace"
80
+ );
81
+ var DangerColorSchema = ColorSchema.default("#d8314a").describe(
82
+ "The danger color of the workspace"
83
+ );
84
+ var FatalColorSchema = ColorSchema.optional().describe(
85
+ "The fatal color of the workspace"
86
+ );
87
+ var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
88
+ "The positive number color of the workspace"
89
+ );
90
+ var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
91
+ "The negative number color of the workspace"
92
+ );
93
+ var GradientStopsSchema = z.array(ColorSchema).optional().describe(
94
+ "The color stops for the base gradient color pattern used in the workspace"
95
+ );
64
96
  var DarkThemeColorConfigSchema = z.object({
65
97
  foreground: LightColorSchema,
66
98
  background: DarkColorSchema,
@@ -75,7 +107,8 @@ var DarkThemeColorConfigSchema = z.object({
75
107
  danger: DangerColorSchema,
76
108
  fatal: FatalColorSchema,
77
109
  positive: PositiveColorSchema,
78
- negative: NegativeColorSchema
110
+ negative: NegativeColorSchema,
111
+ gradient: GradientStopsSchema
79
112
  });
80
113
  var LightThemeColorConfigSchema = z.object({
81
114
  foreground: DarkColorSchema,
@@ -91,7 +124,8 @@ var LightThemeColorConfigSchema = z.object({
91
124
  danger: DangerColorSchema,
92
125
  fatal: FatalColorSchema,
93
126
  positive: PositiveColorSchema,
94
- negative: NegativeColorSchema
127
+ negative: NegativeColorSchema,
128
+ gradient: GradientStopsSchema
95
129
  });
96
130
  var MultiThemeColorConfigSchema = z.object({
97
131
  dark: DarkThemeColorConfigSchema,
@@ -111,7 +145,8 @@ var SingleThemeColorConfigSchema = z.object({
111
145
  danger: DangerColorSchema,
112
146
  fatal: FatalColorSchema,
113
147
  positive: PositiveColorSchema,
114
- negative: NegativeColorSchema
148
+ negative: NegativeColorSchema,
149
+ gradient: GradientStopsSchema
115
150
  });
116
151
  var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
117
152
  var RegistryConfigSchema = z.object({
@@ -295,29 +330,282 @@ var LogLevelLabel = {
295
330
  ALL: "all"
296
331
  };
297
332
 
298
- // ../config/src/types.ts
299
- var COLOR_KEYS = [
300
- "dark",
301
- "light",
302
- "base",
303
- "brand",
304
- "alternate",
305
- "accent",
306
- "link",
307
- "success",
308
- "help",
309
- "info",
310
- "warning",
311
- "danger",
312
- "fatal",
313
- "positive",
314
- "negative"
315
- ];
333
+ // ../config-tools/src/utilities/colors.ts
334
+ var DEFAULT_COLOR_CONFIG = {
335
+ light: {
336
+ background: "#fafafa",
337
+ foreground: "#1d1e22",
338
+ brand: "#1fb2a6",
339
+ alternate: "#db2777",
340
+ help: "#5C4EE5",
341
+ success: "#087f5b",
342
+ info: "#0550ae",
343
+ warning: "#e3b341",
344
+ danger: "#D8314A",
345
+ fatal: "#51070f",
346
+ link: "#3fa6ff",
347
+ positive: "#22c55e",
348
+ negative: "#dc2626",
349
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
350
+ },
351
+ dark: {
352
+ background: "#1d1e22",
353
+ foreground: "#cbd5e1",
354
+ brand: "#2dd4bf",
355
+ alternate: "#db2777",
356
+ help: "#818cf8",
357
+ success: "#10b981",
358
+ info: "#58a6ff",
359
+ warning: "#f3d371",
360
+ danger: "#D8314A",
361
+ fatal: "#a40e26",
362
+ link: "#3fa6ff",
363
+ positive: "#22c55e",
364
+ negative: "#dc2626",
365
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
366
+ }
367
+ };
316
368
 
317
- // ../config-tools/src/utilities/get-default-config.ts
318
- var import_node_fs2 = require("fs");
319
- var import_promises = require("fs/promises");
320
- var import_node_path2 = require("path");
369
+ // ../config-tools/src/logger/chalk.ts
370
+ var import_chalk = __toESM(require("chalk"), 1);
371
+ var chalkDefault = {
372
+ hex: (_) => (message) => message,
373
+ bgHex: (_) => ({
374
+ whiteBright: (message) => message,
375
+ white: (message) => message
376
+ }),
377
+ white: (message) => message,
378
+ whiteBright: (message) => message,
379
+ gray: (message) => message,
380
+ bold: {
381
+ hex: (_) => (message) => message,
382
+ bgHex: (_) => ({
383
+ whiteBright: (message) => message,
384
+ white: (message) => message
385
+ }),
386
+ whiteBright: (message) => message,
387
+ white: (message) => message
388
+ },
389
+ dim: {
390
+ hex: (_) => (message) => message,
391
+ gray: (message) => message
392
+ }
393
+ };
394
+ var getChalk = () => {
395
+ let _chalk = import_chalk.default;
396
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
397
+ _chalk = chalkDefault;
398
+ }
399
+ return _chalk;
400
+ };
401
+
402
+ // ../config-tools/src/logger/is-unicode-supported.ts
403
+ function isUnicodeSupported() {
404
+ if (process.platform !== "win32") {
405
+ return process.env.TERM !== "linux";
406
+ }
407
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
408
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
409
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
410
+ 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";
411
+ }
412
+
413
+ // ../config-tools/src/logger/console-icons.ts
414
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
415
+ var CONSOLE_ICONS = {
416
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
417
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
418
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
419
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
420
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
421
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
422
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
423
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
424
+ };
425
+
426
+ // ../config-tools/src/logger/format-timestamp.ts
427
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
428
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
429
+ };
430
+
431
+ // ../config-tools/src/logger/get-log-level.ts
432
+ var getLogLevel = (label) => {
433
+ switch (label) {
434
+ case "all":
435
+ return LogLevel.ALL;
436
+ case "trace":
437
+ return LogLevel.TRACE;
438
+ case "debug":
439
+ return LogLevel.DEBUG;
440
+ case "info":
441
+ return LogLevel.INFO;
442
+ case "warn":
443
+ return LogLevel.WARN;
444
+ case "error":
445
+ return LogLevel.ERROR;
446
+ case "fatal":
447
+ return LogLevel.FATAL;
448
+ case "silent":
449
+ return LogLevel.SILENT;
450
+ default:
451
+ return LogLevel.INFO;
452
+ }
453
+ };
454
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
455
+ if (logLevel >= LogLevel.ALL) {
456
+ return LogLevelLabel.ALL;
457
+ }
458
+ if (logLevel >= LogLevel.TRACE) {
459
+ return LogLevelLabel.TRACE;
460
+ }
461
+ if (logLevel >= LogLevel.DEBUG) {
462
+ return LogLevelLabel.DEBUG;
463
+ }
464
+ if (logLevel >= LogLevel.INFO) {
465
+ return LogLevelLabel.INFO;
466
+ }
467
+ if (logLevel >= LogLevel.WARN) {
468
+ return LogLevelLabel.WARN;
469
+ }
470
+ if (logLevel >= LogLevel.ERROR) {
471
+ return LogLevelLabel.ERROR;
472
+ }
473
+ if (logLevel >= LogLevel.FATAL) {
474
+ return LogLevelLabel.FATAL;
475
+ }
476
+ if (logLevel <= LogLevel.SILENT) {
477
+ return LogLevelLabel.SILENT;
478
+ }
479
+ return LogLevelLabel.INFO;
480
+ };
481
+ var isVerbose = (label = LogLevelLabel.SILENT) => {
482
+ const logLevel = typeof label === "string" ? getLogLevel(label) : label;
483
+ return logLevel >= LogLevel.DEBUG;
484
+ };
485
+
486
+ // ../config-tools/src/logger/console.ts
487
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
488
+ 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;
489
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
490
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
491
+ return (_) => {
492
+ };
493
+ }
494
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
495
+ return (message) => {
496
+ console.error(
497
+ `
498
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
499
+ `
500
+ );
501
+ };
502
+ }
503
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
504
+ return (message) => {
505
+ console.error(
506
+ `
507
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
508
+ `
509
+ );
510
+ };
511
+ }
512
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
513
+ return (message) => {
514
+ console.warn(
515
+ `
516
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
517
+ `
518
+ );
519
+ };
520
+ }
521
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
522
+ return (message) => {
523
+ console.info(
524
+ `
525
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
526
+ `
527
+ );
528
+ };
529
+ }
530
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
531
+ return (message) => {
532
+ console.info(
533
+ `
534
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
535
+ `
536
+ );
537
+ };
538
+ }
539
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
540
+ return (message) => {
541
+ console.debug(
542
+ `
543
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
544
+ `
545
+ );
546
+ };
547
+ }
548
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
549
+ return (message) => {
550
+ console.debug(
551
+ `
552
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
553
+ `
554
+ );
555
+ };
556
+ }
557
+ return (message) => {
558
+ console.log(
559
+ `
560
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
561
+ `
562
+ );
563
+ };
564
+ };
565
+ var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
566
+ var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
567
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
568
+ var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
569
+ var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
570
+ var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
571
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
572
+ var getStopwatch = (name) => {
573
+ const start = process.hrtime();
574
+ return () => {
575
+ const end = process.hrtime(start);
576
+ console.info(
577
+ `
578
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
579
+ end[0] * 1e3 + end[1] / 1e6
580
+ )}ms to complete
581
+ `
582
+ );
583
+ };
584
+ };
585
+ var MAX_DEPTH = 4;
586
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
587
+ if (depth2 > MAX_DEPTH) {
588
+ return "<max depth>";
589
+ }
590
+ const prefix = options.prefix ?? "-";
591
+ const skip = options.skip ?? [];
592
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
593
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
594
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
595
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
596
+ message[key],
597
+ { prefix: `${prefix}-`, skip },
598
+ depth2 + 1
599
+ ) : message[key]}`
600
+ ).join("\n")}` : message;
601
+ };
602
+ var _isFunction = (value) => {
603
+ try {
604
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
605
+ } catch {
606
+ return false;
607
+ }
608
+ };
321
609
 
322
610
  // ../config-tools/src/utilities/correct-paths.ts
323
611
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
@@ -470,7 +758,6 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
470
758
 
471
759
  // ../config-tools/src/utilities/find-workspace-root.ts
472
760
  var rootFiles = [
473
- "storm-workspace.json",
474
761
  "storm-workspace.json",
475
762
  "storm-workspace.yaml",
476
763
  "storm-workspace.yml",
@@ -539,35 +826,29 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
539
826
  return result;
540
827
  }
541
828
 
542
- // ../config-tools/src/utilities/get-default-config.ts
543
- var DEFAULT_COLOR_CONFIG = {
544
- light: {
545
- background: "#fafafa",
546
- foreground: "#1d1e22",
547
- brand: "#1fb2a6",
548
- alternate: "#db2777",
549
- help: "#5C4EE5",
550
- success: "#087f5b",
551
- info: "#0550ae",
552
- warning: "#e3b341",
553
- danger: "#D8314A",
554
- positive: "#22c55e",
555
- negative: "#dc2626"
556
- },
557
- dark: {
558
- background: "#1d1e22",
559
- foreground: "#cbd5e1",
560
- brand: "#2dd4bf",
561
- alternate: "#db2777",
562
- help: "#818cf8",
563
- success: "#10b981",
564
- info: "#58a6ff",
565
- warning: "#f3d371",
566
- danger: "#D8314A",
567
- positive: "#22c55e",
568
- negative: "#dc2626"
569
- }
570
- };
829
+ // ../config/src/types.ts
830
+ var COLOR_KEYS = [
831
+ "dark",
832
+ "light",
833
+ "base",
834
+ "brand",
835
+ "alternate",
836
+ "accent",
837
+ "link",
838
+ "success",
839
+ "help",
840
+ "info",
841
+ "warning",
842
+ "danger",
843
+ "fatal",
844
+ "positive",
845
+ "negative"
846
+ ];
847
+
848
+ // ../config-tools/src/utilities/get-default-config.ts
849
+ var import_node_fs2 = require("fs");
850
+ var import_promises = require("fs/promises");
851
+ var import_node_path2 = require("path");
571
852
  async function getPackageJsonConfig(root) {
572
853
  let license = STORM_DEFAULT_LICENSE;
573
854
  let homepage = void 0;
@@ -651,247 +932,6 @@ function applyDefaultConfig(config) {
651
932
  return config;
652
933
  }
653
934
 
654
- // ../config-tools/src/logger/chalk.ts
655
- var import_chalk = __toESM(require("chalk"), 1);
656
- var chalkDefault = {
657
- hex: (_) => (message) => message,
658
- bgHex: (_) => ({
659
- whiteBright: (message) => message,
660
- white: (message) => message
661
- }),
662
- white: (message) => message,
663
- whiteBright: (message) => message,
664
- gray: (message) => message,
665
- bold: {
666
- hex: (_) => (message) => message,
667
- bgHex: (_) => ({
668
- whiteBright: (message) => message,
669
- white: (message) => message
670
- }),
671
- whiteBright: (message) => message,
672
- white: (message) => message
673
- },
674
- dim: {
675
- hex: (_) => (message) => message,
676
- gray: (message) => message
677
- }
678
- };
679
- var getChalk = () => {
680
- let _chalk = import_chalk.default;
681
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
682
- _chalk = chalkDefault;
683
- }
684
- return _chalk;
685
- };
686
-
687
- // ../config-tools/src/logger/is-unicode-supported.ts
688
- function isUnicodeSupported() {
689
- if (process.platform !== "win32") {
690
- return process.env.TERM !== "linux";
691
- }
692
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
693
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
694
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
695
- 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";
696
- }
697
-
698
- // ../config-tools/src/logger/console-icons.ts
699
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
700
- var CONSOLE_ICONS = {
701
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
702
- [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
703
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
704
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
705
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
706
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
707
- [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
708
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
709
- };
710
-
711
- // ../config-tools/src/logger/format-timestamp.ts
712
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
713
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
714
- };
715
-
716
- // ../config-tools/src/logger/get-log-level.ts
717
- var getLogLevel = (label) => {
718
- switch (label) {
719
- case "all":
720
- return LogLevel.ALL;
721
- case "trace":
722
- return LogLevel.TRACE;
723
- case "debug":
724
- return LogLevel.DEBUG;
725
- case "info":
726
- return LogLevel.INFO;
727
- case "warn":
728
- return LogLevel.WARN;
729
- case "error":
730
- return LogLevel.ERROR;
731
- case "fatal":
732
- return LogLevel.FATAL;
733
- case "silent":
734
- return LogLevel.SILENT;
735
- default:
736
- return LogLevel.INFO;
737
- }
738
- };
739
- var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
740
- if (logLevel >= LogLevel.ALL) {
741
- return LogLevelLabel.ALL;
742
- }
743
- if (logLevel >= LogLevel.TRACE) {
744
- return LogLevelLabel.TRACE;
745
- }
746
- if (logLevel >= LogLevel.DEBUG) {
747
- return LogLevelLabel.DEBUG;
748
- }
749
- if (logLevel >= LogLevel.INFO) {
750
- return LogLevelLabel.INFO;
751
- }
752
- if (logLevel >= LogLevel.WARN) {
753
- return LogLevelLabel.WARN;
754
- }
755
- if (logLevel >= LogLevel.ERROR) {
756
- return LogLevelLabel.ERROR;
757
- }
758
- if (logLevel >= LogLevel.FATAL) {
759
- return LogLevelLabel.FATAL;
760
- }
761
- if (logLevel <= LogLevel.SILENT) {
762
- return LogLevelLabel.SILENT;
763
- }
764
- return LogLevelLabel.INFO;
765
- };
766
- var isVerbose = (label = LogLevelLabel.SILENT) => {
767
- const logLevel = typeof label === "string" ? getLogLevel(label) : label;
768
- return logLevel >= LogLevel.DEBUG;
769
- };
770
-
771
- // ../config-tools/src/logger/console.ts
772
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
773
- 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;
774
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
775
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
776
- return (_) => {
777
- };
778
- }
779
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
780
- return (message) => {
781
- console.error(
782
- `
783
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
784
- `
785
- );
786
- };
787
- }
788
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
789
- return (message) => {
790
- console.error(
791
- `
792
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
793
- `
794
- );
795
- };
796
- }
797
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
798
- return (message) => {
799
- console.warn(
800
- `
801
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
802
- `
803
- );
804
- };
805
- }
806
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
807
- return (message) => {
808
- console.info(
809
- `
810
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
811
- `
812
- );
813
- };
814
- }
815
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
816
- return (message) => {
817
- console.info(
818
- `
819
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
820
- `
821
- );
822
- };
823
- }
824
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
825
- return (message) => {
826
- console.debug(
827
- `
828
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#3e9eff")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
829
- `
830
- );
831
- };
832
- }
833
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
834
- return (message) => {
835
- console.debug(
836
- `
837
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0070E0")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
838
- `
839
- );
840
- };
841
- }
842
- return (message) => {
843
- console.log(
844
- `
845
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0356a8")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
846
- `
847
- );
848
- };
849
- };
850
- var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
851
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
852
- var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
853
- var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
854
- var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
855
- var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
856
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
857
- var getStopwatch = (name) => {
858
- const start = process.hrtime();
859
- return () => {
860
- const end = process.hrtime(start);
861
- console.info(
862
- `
863
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
864
- end[0] * 1e3 + end[1] / 1e6
865
- )}ms to complete
866
- `
867
- );
868
- };
869
- };
870
- var MAX_DEPTH = 4;
871
- var formatLogMessage = (message, options = {}, depth2 = 0) => {
872
- if (depth2 > MAX_DEPTH) {
873
- return "<max depth>";
874
- }
875
- const prefix = options.prefix ?? "-";
876
- const skip = options.skip ?? [];
877
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
878
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
879
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
880
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
881
- message[key],
882
- { prefix: `${prefix}-`, skip },
883
- depth2 + 1
884
- ) : message[key]}`
885
- ).join("\n")}` : message;
886
- };
887
- var _isFunction = (value) => {
888
- try {
889
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
890
- } catch (e) {
891
- return false;
892
- }
893
- };
894
-
895
935
  // ../config-tools/src/utilities/process-handler.ts
896
936
  var exitWithError = (config) => {
897
937
  writeFatal("Exiting script with an error status...", config);
@@ -1149,6 +1189,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
1149
1189
  return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
1150
1190
  };
1151
1191
  var getSingleThemeColorConfigEnv = (prefix) => {
1192
+ const gradient = [];
1193
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1194
+ gradient.push(
1195
+ process.env[`${prefix}GRADIENT_START`],
1196
+ process.env[`${prefix}GRADIENT_END`]
1197
+ );
1198
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1199
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1200
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1201
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1202
+ index++;
1203
+ }
1204
+ }
1152
1205
  return {
1153
1206
  dark: process.env[`${prefix}DARK`],
1154
1207
  light: process.env[`${prefix}LIGHT`],
@@ -1163,7 +1216,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
1163
1216
  danger: process.env[`${prefix}DANGER`],
1164
1217
  fatal: process.env[`${prefix}FATAL`],
1165
1218
  positive: process.env[`${prefix}POSITIVE`],
1166
- negative: process.env[`${prefix}NEGATIVE`]
1219
+ negative: process.env[`${prefix}NEGATIVE`],
1220
+ gradient
1167
1221
  };
1168
1222
  };
1169
1223
  var getMultiThemeColorConfigEnv = (prefix) => {
@@ -1175,6 +1229,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
1175
1229
  };
1176
1230
  };
1177
1231
  var getBaseThemeColorConfigEnv = (prefix) => {
1232
+ const gradient = [];
1233
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1234
+ gradient.push(
1235
+ process.env[`${prefix}GRADIENT_START`],
1236
+ process.env[`${prefix}GRADIENT_END`]
1237
+ );
1238
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1239
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1240
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1241
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1242
+ index++;
1243
+ }
1244
+ }
1178
1245
  return {
1179
1246
  foreground: process.env[`${prefix}FOREGROUND`],
1180
1247
  background: process.env[`${prefix}BACKGROUND`],
@@ -1189,7 +1256,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
1189
1256
  danger: process.env[`${prefix}DANGER`],
1190
1257
  fatal: process.env[`${prefix}FATAL`],
1191
1258
  positive: process.env[`${prefix}POSITIVE`],
1192
- negative: process.env[`${prefix}NEGATIVE`]
1259
+ negative: process.env[`${prefix}NEGATIVE`],
1260
+ gradient
1193
1261
  };
1194
1262
  };
1195
1263
 
@@ -1320,11 +1388,12 @@ var setConfigEnv = (config) => {
1320
1388
  process.env[`${prefix}TIMEZONE`] = config.timezone;
1321
1389
  process.env.TZ = config.timezone;
1322
1390
  process.env.DEFAULT_TIMEZONE = config.timezone;
1391
+ process.env.TIMEZONE = config.timezone;
1323
1392
  }
1324
1393
  if (config.locale) {
1325
1394
  process.env[`${prefix}LOCALE`] = config.locale;
1326
- process.env.LOCALE = config.locale;
1327
1395
  process.env.DEFAULT_LOCALE = config.locale;
1396
+ process.env.LOCALE = config.locale;
1328
1397
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1329
1398
  }
1330
1399
  if (config.configFile) {
@@ -1485,6 +1554,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
1485
1554
  if (config.negative) {
1486
1555
  process.env[`${prefix}NEGATIVE`] = config.negative;
1487
1556
  }
1557
+ if (config.gradient) {
1558
+ for (let i = 0; i < config.gradient.length; i++) {
1559
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1560
+ }
1561
+ }
1488
1562
  };
1489
1563
  var setMultiThemeColorConfigEnv = (prefix, config) => {
1490
1564
  return {
@@ -1535,6 +1609,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
1535
1609
  if (config.negative) {
1536
1610
  process.env[`${prefix}NEGATIVE`] = config.negative;
1537
1611
  }
1612
+ if (config.gradient) {
1613
+ for (let i = 0; i < config.gradient.length; i++) {
1614
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1615
+ }
1616
+ }
1538
1617
  };
1539
1618
 
1540
1619
  // ../config-tools/src/create-storm-config.ts