@storm-software/unbuild 0.49.59 → 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]:\//;
@@ -538,35 +826,29 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
538
826
  return result;
539
827
  }
540
828
 
541
- // ../config-tools/src/utilities/get-default-config.ts
542
- var DEFAULT_COLOR_CONFIG = {
543
- light: {
544
- background: "#fafafa",
545
- foreground: "#1d1e22",
546
- brand: "#1fb2a6",
547
- alternate: "#db2777",
548
- help: "#5C4EE5",
549
- success: "#087f5b",
550
- info: "#0550ae",
551
- warning: "#e3b341",
552
- danger: "#D8314A",
553
- positive: "#22c55e",
554
- negative: "#dc2626"
555
- },
556
- dark: {
557
- background: "#1d1e22",
558
- foreground: "#cbd5e1",
559
- brand: "#2dd4bf",
560
- alternate: "#db2777",
561
- help: "#818cf8",
562
- success: "#10b981",
563
- info: "#58a6ff",
564
- warning: "#f3d371",
565
- danger: "#D8314A",
566
- positive: "#22c55e",
567
- negative: "#dc2626"
568
- }
569
- };
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");
570
852
  async function getPackageJsonConfig(root) {
571
853
  let license = STORM_DEFAULT_LICENSE;
572
854
  let homepage = void 0;
@@ -650,247 +932,6 @@ function applyDefaultConfig(config) {
650
932
  return config;
651
933
  }
652
934
 
653
- // ../config-tools/src/logger/chalk.ts
654
- var import_chalk = __toESM(require("chalk"), 1);
655
- var chalkDefault = {
656
- hex: (_) => (message) => message,
657
- bgHex: (_) => ({
658
- whiteBright: (message) => message,
659
- white: (message) => message
660
- }),
661
- white: (message) => message,
662
- whiteBright: (message) => message,
663
- gray: (message) => message,
664
- bold: {
665
- hex: (_) => (message) => message,
666
- bgHex: (_) => ({
667
- whiteBright: (message) => message,
668
- white: (message) => message
669
- }),
670
- whiteBright: (message) => message,
671
- white: (message) => message
672
- },
673
- dim: {
674
- hex: (_) => (message) => message,
675
- gray: (message) => message
676
- }
677
- };
678
- var getChalk = () => {
679
- let _chalk = import_chalk.default;
680
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
681
- _chalk = chalkDefault;
682
- }
683
- return _chalk;
684
- };
685
-
686
- // ../config-tools/src/logger/is-unicode-supported.ts
687
- function isUnicodeSupported() {
688
- if (process.platform !== "win32") {
689
- return process.env.TERM !== "linux";
690
- }
691
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
692
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
693
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
694
- 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";
695
- }
696
-
697
- // ../config-tools/src/logger/console-icons.ts
698
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
699
- var CONSOLE_ICONS = {
700
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
701
- [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
702
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
703
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
704
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
705
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
706
- [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
707
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
708
- };
709
-
710
- // ../config-tools/src/logger/format-timestamp.ts
711
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
712
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
713
- };
714
-
715
- // ../config-tools/src/logger/get-log-level.ts
716
- var getLogLevel = (label) => {
717
- switch (label) {
718
- case "all":
719
- return LogLevel.ALL;
720
- case "trace":
721
- return LogLevel.TRACE;
722
- case "debug":
723
- return LogLevel.DEBUG;
724
- case "info":
725
- return LogLevel.INFO;
726
- case "warn":
727
- return LogLevel.WARN;
728
- case "error":
729
- return LogLevel.ERROR;
730
- case "fatal":
731
- return LogLevel.FATAL;
732
- case "silent":
733
- return LogLevel.SILENT;
734
- default:
735
- return LogLevel.INFO;
736
- }
737
- };
738
- var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
739
- if (logLevel >= LogLevel.ALL) {
740
- return LogLevelLabel.ALL;
741
- }
742
- if (logLevel >= LogLevel.TRACE) {
743
- return LogLevelLabel.TRACE;
744
- }
745
- if (logLevel >= LogLevel.DEBUG) {
746
- return LogLevelLabel.DEBUG;
747
- }
748
- if (logLevel >= LogLevel.INFO) {
749
- return LogLevelLabel.INFO;
750
- }
751
- if (logLevel >= LogLevel.WARN) {
752
- return LogLevelLabel.WARN;
753
- }
754
- if (logLevel >= LogLevel.ERROR) {
755
- return LogLevelLabel.ERROR;
756
- }
757
- if (logLevel >= LogLevel.FATAL) {
758
- return LogLevelLabel.FATAL;
759
- }
760
- if (logLevel <= LogLevel.SILENT) {
761
- return LogLevelLabel.SILENT;
762
- }
763
- return LogLevelLabel.INFO;
764
- };
765
- var isVerbose = (label = LogLevelLabel.SILENT) => {
766
- const logLevel = typeof label === "string" ? getLogLevel(label) : label;
767
- return logLevel >= LogLevel.DEBUG;
768
- };
769
-
770
- // ../config-tools/src/logger/console.ts
771
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
772
- 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;
773
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
774
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
775
- return (_) => {
776
- };
777
- }
778
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
779
- return (message) => {
780
- console.error(
781
- `
782
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
783
- `
784
- );
785
- };
786
- }
787
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
788
- return (message) => {
789
- console.error(
790
- `
791
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
792
- `
793
- );
794
- };
795
- }
796
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
797
- return (message) => {
798
- console.warn(
799
- `
800
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
801
- `
802
- );
803
- };
804
- }
805
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
806
- return (message) => {
807
- console.info(
808
- `
809
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
810
- `
811
- );
812
- };
813
- }
814
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
815
- return (message) => {
816
- console.info(
817
- `
818
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
819
- `
820
- );
821
- };
822
- }
823
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
824
- return (message) => {
825
- console.debug(
826
- `
827
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#3e9eff")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
828
- `
829
- );
830
- };
831
- }
832
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
833
- return (message) => {
834
- console.debug(
835
- `
836
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0070E0")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
837
- `
838
- );
839
- };
840
- }
841
- return (message) => {
842
- console.log(
843
- `
844
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0356a8")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
845
- `
846
- );
847
- };
848
- };
849
- var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
850
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
851
- var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
852
- var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
853
- var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
854
- var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
855
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
856
- var getStopwatch = (name) => {
857
- const start = process.hrtime();
858
- return () => {
859
- const end = process.hrtime(start);
860
- console.info(
861
- `
862
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
863
- end[0] * 1e3 + end[1] / 1e6
864
- )}ms to complete
865
- `
866
- );
867
- };
868
- };
869
- var MAX_DEPTH = 4;
870
- var formatLogMessage = (message, options = {}, depth2 = 0) => {
871
- if (depth2 > MAX_DEPTH) {
872
- return "<max depth>";
873
- }
874
- const prefix = options.prefix ?? "-";
875
- const skip = options.skip ?? [];
876
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
877
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
878
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
879
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
880
- message[key],
881
- { prefix: `${prefix}-`, skip },
882
- depth2 + 1
883
- ) : message[key]}`
884
- ).join("\n")}` : message;
885
- };
886
- var _isFunction = (value) => {
887
- try {
888
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
889
- } catch (e) {
890
- return false;
891
- }
892
- };
893
-
894
935
  // ../config-tools/src/utilities/process-handler.ts
895
936
  var exitWithError = (config) => {
896
937
  writeFatal("Exiting script with an error status...", config);
@@ -1148,6 +1189,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
1148
1189
  return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
1149
1190
  };
1150
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
+ }
1151
1205
  return {
1152
1206
  dark: process.env[`${prefix}DARK`],
1153
1207
  light: process.env[`${prefix}LIGHT`],
@@ -1162,7 +1216,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
1162
1216
  danger: process.env[`${prefix}DANGER`],
1163
1217
  fatal: process.env[`${prefix}FATAL`],
1164
1218
  positive: process.env[`${prefix}POSITIVE`],
1165
- negative: process.env[`${prefix}NEGATIVE`]
1219
+ negative: process.env[`${prefix}NEGATIVE`],
1220
+ gradient
1166
1221
  };
1167
1222
  };
1168
1223
  var getMultiThemeColorConfigEnv = (prefix) => {
@@ -1174,6 +1229,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
1174
1229
  };
1175
1230
  };
1176
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
+ }
1177
1245
  return {
1178
1246
  foreground: process.env[`${prefix}FOREGROUND`],
1179
1247
  background: process.env[`${prefix}BACKGROUND`],
@@ -1188,7 +1256,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
1188
1256
  danger: process.env[`${prefix}DANGER`],
1189
1257
  fatal: process.env[`${prefix}FATAL`],
1190
1258
  positive: process.env[`${prefix}POSITIVE`],
1191
- negative: process.env[`${prefix}NEGATIVE`]
1259
+ negative: process.env[`${prefix}NEGATIVE`],
1260
+ gradient
1192
1261
  };
1193
1262
  };
1194
1263
 
@@ -1319,11 +1388,12 @@ var setConfigEnv = (config) => {
1319
1388
  process.env[`${prefix}TIMEZONE`] = config.timezone;
1320
1389
  process.env.TZ = config.timezone;
1321
1390
  process.env.DEFAULT_TIMEZONE = config.timezone;
1391
+ process.env.TIMEZONE = config.timezone;
1322
1392
  }
1323
1393
  if (config.locale) {
1324
1394
  process.env[`${prefix}LOCALE`] = config.locale;
1325
- process.env.LOCALE = config.locale;
1326
1395
  process.env.DEFAULT_LOCALE = config.locale;
1396
+ process.env.LOCALE = config.locale;
1327
1397
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1328
1398
  }
1329
1399
  if (config.configFile) {
@@ -1484,6 +1554,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
1484
1554
  if (config.negative) {
1485
1555
  process.env[`${prefix}NEGATIVE`] = config.negative;
1486
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
+ }
1487
1562
  };
1488
1563
  var setMultiThemeColorConfigEnv = (prefix, config) => {
1489
1564
  return {
@@ -1534,6 +1609,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
1534
1609
  if (config.negative) {
1535
1610
  process.env[`${prefix}NEGATIVE`] = config.negative;
1536
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
+ }
1537
1617
  };
1538
1618
 
1539
1619
  // ../config-tools/src/create-storm-config.ts