@storm-software/k8s-tools 0.33.59 → 0.33.66

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 (35) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-ESROKLMQ.mjs → chunk-3FCME2FS.mjs} +410 -324
  4. package/dist/{chunk-BNUR5JDC.js → chunk-7CVGLDYX.js} +25 -25
  5. package/dist/{chunk-HQOB4ZEM.js → chunk-AH4F7JLD.js} +416 -330
  6. package/dist/{chunk-XFA2ZPOU.mjs → chunk-BF225HO4.mjs} +2 -2
  7. package/dist/{chunk-XNXDBQ76.js → chunk-BHZBTBM6.js} +4 -4
  8. package/dist/{chunk-OR3NZKIZ.mjs → chunk-CH5LNYVN.mjs} +2 -2
  9. package/dist/{chunk-Z5723CRV.mjs → chunk-DB4FPULK.mjs} +1 -1
  10. package/dist/{chunk-NJOOIB77.js → chunk-DU26E6TO.js} +2 -2
  11. package/dist/{chunk-TTFNSLD5.mjs → chunk-FR7P26YN.mjs} +1 -1
  12. package/dist/{chunk-ROPT2MIP.js → chunk-KU6MH4UF.js} +3 -3
  13. package/dist/{chunk-2OINMNCM.mjs → chunk-NOK6AZUO.mjs} +2 -2
  14. package/dist/{chunk-KHWQATS3.js → chunk-QDXEIRJV.js} +6 -6
  15. package/dist/{chunk-X2KAFZBZ.js → chunk-QO6CAV2A.js} +19 -19
  16. package/dist/{chunk-KYK3XKBK.mjs → chunk-XQ6ELAFS.mjs} +2 -2
  17. package/dist/{chunk-B4QVWV65.js → chunk-YFYE4UFJ.js} +4 -4
  18. package/dist/{chunk-OHIZIZL5.mjs → chunk-YQ5GWKM5.mjs} +2 -2
  19. package/dist/executors.js +5 -5
  20. package/dist/executors.mjs +4 -4
  21. package/dist/generators.js +6 -6
  22. package/dist/generators.mjs +5 -5
  23. package/dist/index.js +9 -9
  24. package/dist/index.mjs +8 -8
  25. package/dist/src/executors/container-publish/executor.js +4 -4
  26. package/dist/src/executors/container-publish/executor.mjs +3 -3
  27. package/dist/src/executors/helm-package/executor.js +4 -4
  28. package/dist/src/executors/helm-package/executor.mjs +3 -3
  29. package/dist/src/generators/helm-chart/generator.js +5 -5
  30. package/dist/src/generators/helm-chart/generator.mjs +4 -4
  31. package/dist/src/generators/helm-dependency/generator.js +5 -5
  32. package/dist/src/generators/helm-dependency/generator.mjs +4 -4
  33. package/dist/src/plugins/docker/index.js +3 -3
  34. package/dist/src/plugins/docker/index.mjs +2 -2
  35. package/package.json +5 -5
@@ -1,3 +1,300 @@
1
+ // ../config-tools/src/types.ts
2
+ var LogLevel = {
3
+ SILENT: 0,
4
+ FATAL: 10,
5
+ ERROR: 20,
6
+ WARN: 30,
7
+ SUCCESS: 35,
8
+ INFO: 40,
9
+ DEBUG: 60,
10
+ TRACE: 70,
11
+ ALL: 100
12
+ };
13
+ var LogLevelLabel = {
14
+ SILENT: "silent",
15
+ FATAL: "fatal",
16
+ ERROR: "error",
17
+ WARN: "warn",
18
+ SUCCESS: "success",
19
+ INFO: "info",
20
+ DEBUG: "debug",
21
+ TRACE: "trace",
22
+ ALL: "all"
23
+ };
24
+
25
+ // ../config-tools/src/utilities/colors.ts
26
+ var DEFAULT_COLOR_CONFIG = {
27
+ light: {
28
+ background: "#fafafa",
29
+ foreground: "#1d1e22",
30
+ brand: "#1fb2a6",
31
+ alternate: "#db2777",
32
+ help: "#5C4EE5",
33
+ success: "#087f5b",
34
+ info: "#0550ae",
35
+ warning: "#e3b341",
36
+ danger: "#D8314A",
37
+ fatal: "#51070f",
38
+ link: "#3fa6ff",
39
+ positive: "#22c55e",
40
+ negative: "#dc2626",
41
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
42
+ },
43
+ dark: {
44
+ background: "#1d1e22",
45
+ foreground: "#cbd5e1",
46
+ brand: "#2dd4bf",
47
+ alternate: "#db2777",
48
+ help: "#818cf8",
49
+ success: "#10b981",
50
+ info: "#58a6ff",
51
+ warning: "#f3d371",
52
+ danger: "#D8314A",
53
+ fatal: "#a40e26",
54
+ link: "#3fa6ff",
55
+ positive: "#22c55e",
56
+ negative: "#dc2626",
57
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
58
+ }
59
+ };
60
+
61
+ // ../config-tools/src/logger/chalk.ts
62
+ import chalk from "chalk";
63
+ var chalkDefault = {
64
+ hex: (_) => (message) => message,
65
+ bgHex: (_) => ({
66
+ whiteBright: (message) => message,
67
+ white: (message) => message
68
+ }),
69
+ white: (message) => message,
70
+ whiteBright: (message) => message,
71
+ gray: (message) => message,
72
+ bold: {
73
+ hex: (_) => (message) => message,
74
+ bgHex: (_) => ({
75
+ whiteBright: (message) => message,
76
+ white: (message) => message
77
+ }),
78
+ whiteBright: (message) => message,
79
+ white: (message) => message
80
+ },
81
+ dim: {
82
+ hex: (_) => (message) => message,
83
+ gray: (message) => message
84
+ }
85
+ };
86
+ var getChalk = () => {
87
+ let _chalk = chalk;
88
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
89
+ _chalk = chalkDefault;
90
+ }
91
+ return _chalk;
92
+ };
93
+
94
+ // ../config-tools/src/logger/is-unicode-supported.ts
95
+ function isUnicodeSupported() {
96
+ if (process.platform !== "win32") {
97
+ return process.env.TERM !== "linux";
98
+ }
99
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
100
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
101
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
102
+ 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";
103
+ }
104
+
105
+ // ../config-tools/src/logger/console-icons.ts
106
+ var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
107
+ var CONSOLE_ICONS = {
108
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
109
+ [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
110
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
111
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
112
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
113
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
114
+ [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
115
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
116
+ };
117
+
118
+ // ../config-tools/src/logger/format-timestamp.ts
119
+ var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
120
+ return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
121
+ };
122
+
123
+ // ../config-tools/src/logger/get-log-level.ts
124
+ var getLogLevel = (label) => {
125
+ switch (label) {
126
+ case "all":
127
+ return LogLevel.ALL;
128
+ case "trace":
129
+ return LogLevel.TRACE;
130
+ case "debug":
131
+ return LogLevel.DEBUG;
132
+ case "info":
133
+ return LogLevel.INFO;
134
+ case "warn":
135
+ return LogLevel.WARN;
136
+ case "error":
137
+ return LogLevel.ERROR;
138
+ case "fatal":
139
+ return LogLevel.FATAL;
140
+ case "silent":
141
+ return LogLevel.SILENT;
142
+ default:
143
+ return LogLevel.INFO;
144
+ }
145
+ };
146
+ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
147
+ if (logLevel >= LogLevel.ALL) {
148
+ return LogLevelLabel.ALL;
149
+ }
150
+ if (logLevel >= LogLevel.TRACE) {
151
+ return LogLevelLabel.TRACE;
152
+ }
153
+ if (logLevel >= LogLevel.DEBUG) {
154
+ return LogLevelLabel.DEBUG;
155
+ }
156
+ if (logLevel >= LogLevel.INFO) {
157
+ return LogLevelLabel.INFO;
158
+ }
159
+ if (logLevel >= LogLevel.WARN) {
160
+ return LogLevelLabel.WARN;
161
+ }
162
+ if (logLevel >= LogLevel.ERROR) {
163
+ return LogLevelLabel.ERROR;
164
+ }
165
+ if (logLevel >= LogLevel.FATAL) {
166
+ return LogLevelLabel.FATAL;
167
+ }
168
+ if (logLevel <= LogLevel.SILENT) {
169
+ return LogLevelLabel.SILENT;
170
+ }
171
+ return LogLevelLabel.INFO;
172
+ };
173
+
174
+ // ../config-tools/src/logger/console.ts
175
+ var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
176
+ 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;
177
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
178
+ if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
179
+ return (_) => {
180
+ };
181
+ }
182
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
183
+ return (message) => {
184
+ console.error(
185
+ `
186
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
187
+ `
188
+ );
189
+ };
190
+ }
191
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
192
+ return (message) => {
193
+ console.error(
194
+ `
195
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
196
+ `
197
+ );
198
+ };
199
+ }
200
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
201
+ return (message) => {
202
+ console.warn(
203
+ `
204
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
205
+ `
206
+ );
207
+ };
208
+ }
209
+ if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
210
+ return (message) => {
211
+ console.info(
212
+ `
213
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
214
+ `
215
+ );
216
+ };
217
+ }
218
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
219
+ return (message) => {
220
+ console.info(
221
+ `
222
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
223
+ `
224
+ );
225
+ };
226
+ }
227
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
228
+ return (message) => {
229
+ console.debug(
230
+ `
231
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
232
+ `
233
+ );
234
+ };
235
+ }
236
+ if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
237
+ return (message) => {
238
+ console.debug(
239
+ `
240
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
241
+ `
242
+ );
243
+ };
244
+ }
245
+ return (message) => {
246
+ console.log(
247
+ `
248
+ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
249
+ `
250
+ );
251
+ };
252
+ };
253
+ var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
254
+ var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
255
+ var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
256
+ var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
257
+ var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
258
+ var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
259
+ var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
260
+ var getStopwatch = (name) => {
261
+ const start = process.hrtime();
262
+ return () => {
263
+ const end = process.hrtime(start);
264
+ console.info(
265
+ `
266
+ > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
267
+ end[0] * 1e3 + end[1] / 1e6
268
+ )}ms to complete
269
+ `
270
+ );
271
+ };
272
+ };
273
+ var MAX_DEPTH = 4;
274
+ var formatLogMessage = (message, options = {}, depth2 = 0) => {
275
+ if (depth2 > MAX_DEPTH) {
276
+ return "<max depth>";
277
+ }
278
+ const prefix = options.prefix ?? "-";
279
+ const skip = options.skip ?? [];
280
+ return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
281
+ ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
282
+ ${Object.keys(message).filter((key) => !skip.includes(key)).map(
283
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
284
+ message[key],
285
+ { prefix: `${prefix}-`, skip },
286
+ depth2 + 1
287
+ ) : message[key]}`
288
+ ).join("\n")}` : message;
289
+ };
290
+ var _isFunction = (value) => {
291
+ try {
292
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
293
+ } catch {
294
+ return false;
295
+ }
296
+ };
297
+
1
298
  // ../config-tools/src/utilities/correct-paths.ts
2
299
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
300
  function normalizeWindowsPath(input = "") {
@@ -217,29 +514,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
217
514
  return result;
218
515
  }
219
516
 
220
- // ../config-tools/src/types.ts
221
- var LogLevel = {
222
- SILENT: 0,
223
- FATAL: 10,
224
- ERROR: 20,
225
- WARN: 30,
226
- SUCCESS: 35,
227
- INFO: 40,
228
- DEBUG: 60,
229
- TRACE: 70,
230
- ALL: 100
231
- };
232
- var LogLevelLabel = {
233
- SILENT: "silent",
234
- FATAL: "fatal",
235
- ERROR: "error",
236
- WARN: "warn",
237
- SUCCESS: "success",
238
- INFO: "info",
239
- DEBUG: "debug",
240
- TRACE: "trace",
241
- ALL: "all"
242
- };
517
+ // ../config/src/schema.ts
518
+ import * as z from "zod";
243
519
 
244
520
  // ../config/src/constants.ts
245
521
  var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
@@ -263,21 +539,52 @@ If this sounds interesting, and you would like to help us in creating the next g
263
539
  var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
264
540
 
265
541
  // ../config/src/schema.ts
266
- import * as z from "zod";
267
- 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");
268
- 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");
269
- 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");
270
- 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");
271
- 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");
272
- 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");
273
- 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");
274
- 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");
275
- 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");
276
- 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");
277
- 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");
278
- var FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).optional().describe("The fatal color of the workspace");
279
- 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");
280
- 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");
542
+ var ColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7);
543
+ var DarkColorSchema = ColorSchema.default("#151718").describe(
544
+ "The dark background color of the workspace"
545
+ );
546
+ var LightColorSchema = ColorSchema.default("#cbd5e1").describe(
547
+ "The light background color of the workspace"
548
+ );
549
+ var BrandColorSchema = ColorSchema.default("#1fb2a6").describe(
550
+ "The primary brand specific color of the workspace"
551
+ );
552
+ var AlternateColorSchema = ColorSchema.optional().describe(
553
+ "The alternate brand specific color of the workspace"
554
+ );
555
+ var AccentColorSchema = ColorSchema.optional().describe(
556
+ "The secondary brand specific color of the workspace"
557
+ );
558
+ var LinkColorSchema = ColorSchema.default("#3fa6ff").describe(
559
+ "The color used to display hyperlink text"
560
+ );
561
+ var HelpColorSchema = ColorSchema.default("#818cf8").describe(
562
+ "The second brand specific color of the workspace"
563
+ );
564
+ var SuccessColorSchema = ColorSchema.default("#45b27e").describe(
565
+ "The success color of the workspace"
566
+ );
567
+ var InfoColorSchema = ColorSchema.default("#38bdf8").describe(
568
+ "The informational color of the workspace"
569
+ );
570
+ var WarningColorSchema = ColorSchema.default("#f3d371").describe(
571
+ "The warning color of the workspace"
572
+ );
573
+ var DangerColorSchema = ColorSchema.default("#d8314a").describe(
574
+ "The danger color of the workspace"
575
+ );
576
+ var FatalColorSchema = ColorSchema.optional().describe(
577
+ "The fatal color of the workspace"
578
+ );
579
+ var PositiveColorSchema = ColorSchema.default("#4ade80").describe(
580
+ "The positive number color of the workspace"
581
+ );
582
+ var NegativeColorSchema = ColorSchema.default("#ef4444").describe(
583
+ "The negative number color of the workspace"
584
+ );
585
+ var GradientStopsSchema = z.array(ColorSchema).optional().describe(
586
+ "The color stops for the base gradient color pattern used in the workspace"
587
+ );
281
588
  var DarkThemeColorConfigSchema = z.object({
282
589
  foreground: LightColorSchema,
283
590
  background: DarkColorSchema,
@@ -292,7 +599,8 @@ var DarkThemeColorConfigSchema = z.object({
292
599
  danger: DangerColorSchema,
293
600
  fatal: FatalColorSchema,
294
601
  positive: PositiveColorSchema,
295
- negative: NegativeColorSchema
602
+ negative: NegativeColorSchema,
603
+ gradient: GradientStopsSchema
296
604
  });
297
605
  var LightThemeColorConfigSchema = z.object({
298
606
  foreground: DarkColorSchema,
@@ -308,7 +616,8 @@ var LightThemeColorConfigSchema = z.object({
308
616
  danger: DangerColorSchema,
309
617
  fatal: FatalColorSchema,
310
618
  positive: PositiveColorSchema,
311
- negative: NegativeColorSchema
619
+ negative: NegativeColorSchema,
620
+ gradient: GradientStopsSchema
312
621
  });
313
622
  var MultiThemeColorConfigSchema = z.object({
314
623
  dark: DarkThemeColorConfigSchema,
@@ -328,7 +637,8 @@ var SingleThemeColorConfigSchema = z.object({
328
637
  danger: DangerColorSchema,
329
638
  fatal: FatalColorSchema,
330
639
  positive: PositiveColorSchema,
331
- negative: NegativeColorSchema
640
+ negative: NegativeColorSchema,
641
+ gradient: GradientStopsSchema
332
642
  });
333
643
  var RegistryUrlConfigSchema = z.url().optional().describe("A remote registry URL used to publish distributable packages");
334
644
  var RegistryConfigSchema = z.object({
@@ -481,6 +791,13 @@ var stormWorkspaceConfigSchema = z.object({
481
791
  "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."
482
792
  );
483
793
 
794
+ // ../config-tools/src/create-storm-config.ts
795
+ import defu2 from "defu";
796
+
797
+ // ../config-tools/src/config-file/get-config-file.ts
798
+ import { loadConfig } from "c12";
799
+ import defu from "defu";
800
+
484
801
  // ../config/src/types.ts
485
802
  var COLOR_KEYS = [
486
803
  "dark",
@@ -495,43 +812,15 @@ var COLOR_KEYS = [
495
812
  "info",
496
813
  "warning",
497
814
  "danger",
498
- "fatal",
499
- "positive",
500
- "negative"
501
- ];
502
-
503
- // ../config-tools/src/utilities/get-default-config.ts
504
- import { existsSync as existsSync2 } from "node:fs";
505
- import { readFile } from "node:fs/promises";
506
- import { join as join2 } from "node:path";
507
- var DEFAULT_COLOR_CONFIG = {
508
- light: {
509
- background: "#fafafa",
510
- foreground: "#1d1e22",
511
- brand: "#1fb2a6",
512
- alternate: "#db2777",
513
- help: "#5C4EE5",
514
- success: "#087f5b",
515
- info: "#0550ae",
516
- warning: "#e3b341",
517
- danger: "#D8314A",
518
- positive: "#22c55e",
519
- negative: "#dc2626"
520
- },
521
- dark: {
522
- background: "#1d1e22",
523
- foreground: "#cbd5e1",
524
- brand: "#2dd4bf",
525
- alternate: "#db2777",
526
- help: "#818cf8",
527
- success: "#10b981",
528
- info: "#58a6ff",
529
- warning: "#f3d371",
530
- danger: "#D8314A",
531
- positive: "#22c55e",
532
- negative: "#dc2626"
533
- }
534
- };
815
+ "fatal",
816
+ "positive",
817
+ "negative"
818
+ ];
819
+
820
+ // ../config-tools/src/utilities/get-default-config.ts
821
+ import { existsSync as existsSync2 } from "node:fs";
822
+ import { readFile } from "node:fs/promises";
823
+ import { join as join2 } from "node:path";
535
824
  async function getPackageJsonConfig(root) {
536
825
  let license = STORM_DEFAULT_LICENSE;
537
826
  let homepage = void 0;
@@ -615,249 +904,7 @@ function applyDefaultConfig(config) {
615
904
  return config;
616
905
  }
617
906
 
618
- // ../config-tools/src/logger/chalk.ts
619
- import chalk from "chalk";
620
- var chalkDefault = {
621
- hex: (_) => (message) => message,
622
- bgHex: (_) => ({
623
- whiteBright: (message) => message,
624
- white: (message) => message
625
- }),
626
- white: (message) => message,
627
- whiteBright: (message) => message,
628
- gray: (message) => message,
629
- bold: {
630
- hex: (_) => (message) => message,
631
- bgHex: (_) => ({
632
- whiteBright: (message) => message,
633
- white: (message) => message
634
- }),
635
- whiteBright: (message) => message,
636
- white: (message) => message
637
- },
638
- dim: {
639
- hex: (_) => (message) => message,
640
- gray: (message) => message
641
- }
642
- };
643
- var getChalk = () => {
644
- let _chalk = chalk;
645
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
646
- _chalk = chalkDefault;
647
- }
648
- return _chalk;
649
- };
650
-
651
- // ../config-tools/src/logger/is-unicode-supported.ts
652
- function isUnicodeSupported() {
653
- if (process.platform !== "win32") {
654
- return process.env.TERM !== "linux";
655
- }
656
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
657
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
658
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
659
- 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";
660
- }
661
-
662
- // ../config-tools/src/logger/console-icons.ts
663
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
664
- var CONSOLE_ICONS = {
665
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
666
- [LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
667
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
668
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
669
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
670
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
671
- [LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
672
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
673
- };
674
-
675
- // ../config-tools/src/logger/format-timestamp.ts
676
- var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
677
- return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
678
- };
679
-
680
- // ../config-tools/src/logger/get-log-level.ts
681
- var getLogLevel = (label) => {
682
- switch (label) {
683
- case "all":
684
- return LogLevel.ALL;
685
- case "trace":
686
- return LogLevel.TRACE;
687
- case "debug":
688
- return LogLevel.DEBUG;
689
- case "info":
690
- return LogLevel.INFO;
691
- case "warn":
692
- return LogLevel.WARN;
693
- case "error":
694
- return LogLevel.ERROR;
695
- case "fatal":
696
- return LogLevel.FATAL;
697
- case "silent":
698
- return LogLevel.SILENT;
699
- default:
700
- return LogLevel.INFO;
701
- }
702
- };
703
- var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
704
- if (logLevel >= LogLevel.ALL) {
705
- return LogLevelLabel.ALL;
706
- }
707
- if (logLevel >= LogLevel.TRACE) {
708
- return LogLevelLabel.TRACE;
709
- }
710
- if (logLevel >= LogLevel.DEBUG) {
711
- return LogLevelLabel.DEBUG;
712
- }
713
- if (logLevel >= LogLevel.INFO) {
714
- return LogLevelLabel.INFO;
715
- }
716
- if (logLevel >= LogLevel.WARN) {
717
- return LogLevelLabel.WARN;
718
- }
719
- if (logLevel >= LogLevel.ERROR) {
720
- return LogLevelLabel.ERROR;
721
- }
722
- if (logLevel >= LogLevel.FATAL) {
723
- return LogLevelLabel.FATAL;
724
- }
725
- if (logLevel <= LogLevel.SILENT) {
726
- return LogLevelLabel.SILENT;
727
- }
728
- return LogLevelLabel.INFO;
729
- };
730
-
731
- // ../config-tools/src/logger/console.ts
732
- var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
733
- 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;
734
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
735
- if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
736
- return (_) => {
737
- };
738
- }
739
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
740
- return (message) => {
741
- console.error(
742
- `
743
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
744
- `
745
- );
746
- };
747
- }
748
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
749
- return (message) => {
750
- console.error(
751
- `
752
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
753
- `
754
- );
755
- };
756
- }
757
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
758
- return (message) => {
759
- console.warn(
760
- `
761
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
762
- `
763
- );
764
- };
765
- }
766
- if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
767
- return (message) => {
768
- console.info(
769
- `
770
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
771
- `
772
- );
773
- };
774
- }
775
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
776
- return (message) => {
777
- console.info(
778
- `
779
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
780
- `
781
- );
782
- };
783
- }
784
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
785
- return (message) => {
786
- console.debug(
787
- `
788
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#3e9eff")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
789
- `
790
- );
791
- };
792
- }
793
- if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
794
- return (message) => {
795
- console.debug(
796
- `
797
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0070E0")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
798
- `
799
- );
800
- };
801
- }
802
- return (message) => {
803
- console.log(
804
- `
805
- ${_chalk.gray(formatTimestamp())} ${_chalk.hex("#0356a8")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
806
- `
807
- );
808
- };
809
- };
810
- var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
811
- var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
812
- var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
813
- var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
814
- var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
815
- var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
816
- var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
817
- var getStopwatch = (name) => {
818
- const start = process.hrtime();
819
- return () => {
820
- const end = process.hrtime(start);
821
- console.info(
822
- `
823
- > \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
824
- end[0] * 1e3 + end[1] / 1e6
825
- )}ms to complete
826
- `
827
- );
828
- };
829
- };
830
- var MAX_DEPTH = 4;
831
- var formatLogMessage = (message, options = {}, depth2 = 0) => {
832
- if (depth2 > MAX_DEPTH) {
833
- return "<max depth>";
834
- }
835
- const prefix = options.prefix ?? "-";
836
- const skip = options.skip ?? [];
837
- return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
838
- ${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
839
- ${Object.keys(message).filter((key) => !skip.includes(key)).map(
840
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
841
- message[key],
842
- { prefix: `${prefix}-`, skip },
843
- depth2 + 1
844
- ) : message[key]}`
845
- ).join("\n")}` : message;
846
- };
847
- var _isFunction = (value) => {
848
- try {
849
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
850
- } catch (e) {
851
- return false;
852
- }
853
- };
854
-
855
- // ../config-tools/src/create-storm-config.ts
856
- import defu2 from "defu";
857
-
858
907
  // ../config-tools/src/config-file/get-config-file.ts
859
- import { loadConfig } from "c12";
860
- import defu from "defu";
861
908
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
862
909
  const workspacePath = filePath || findWorkspaceRoot(filePath);
863
910
  const configs = await Promise.all([
@@ -1071,6 +1118,19 @@ var getThemeColorConfigEnv = (prefix, theme) => {
1071
1118
  return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
1072
1119
  };
1073
1120
  var getSingleThemeColorConfigEnv = (prefix) => {
1121
+ const gradient = [];
1122
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1123
+ gradient.push(
1124
+ process.env[`${prefix}GRADIENT_START`],
1125
+ process.env[`${prefix}GRADIENT_END`]
1126
+ );
1127
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1128
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1129
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1130
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1131
+ index++;
1132
+ }
1133
+ }
1074
1134
  return {
1075
1135
  dark: process.env[`${prefix}DARK`],
1076
1136
  light: process.env[`${prefix}LIGHT`],
@@ -1085,7 +1145,8 @@ var getSingleThemeColorConfigEnv = (prefix) => {
1085
1145
  danger: process.env[`${prefix}DANGER`],
1086
1146
  fatal: process.env[`${prefix}FATAL`],
1087
1147
  positive: process.env[`${prefix}POSITIVE`],
1088
- negative: process.env[`${prefix}NEGATIVE`]
1148
+ negative: process.env[`${prefix}NEGATIVE`],
1149
+ gradient
1089
1150
  };
1090
1151
  };
1091
1152
  var getMultiThemeColorConfigEnv = (prefix) => {
@@ -1097,6 +1158,19 @@ var getMultiThemeColorConfigEnv = (prefix) => {
1097
1158
  };
1098
1159
  };
1099
1160
  var getBaseThemeColorConfigEnv = (prefix) => {
1161
+ const gradient = [];
1162
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1163
+ gradient.push(
1164
+ process.env[`${prefix}GRADIENT_START`],
1165
+ process.env[`${prefix}GRADIENT_END`]
1166
+ );
1167
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1168
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1169
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1170
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1171
+ index++;
1172
+ }
1173
+ }
1100
1174
  return {
1101
1175
  foreground: process.env[`${prefix}FOREGROUND`],
1102
1176
  background: process.env[`${prefix}BACKGROUND`],
@@ -1111,7 +1185,8 @@ var getBaseThemeColorConfigEnv = (prefix) => {
1111
1185
  danger: process.env[`${prefix}DANGER`],
1112
1186
  fatal: process.env[`${prefix}FATAL`],
1113
1187
  positive: process.env[`${prefix}POSITIVE`],
1114
- negative: process.env[`${prefix}NEGATIVE`]
1188
+ negative: process.env[`${prefix}NEGATIVE`],
1189
+ gradient
1115
1190
  };
1116
1191
  };
1117
1192
 
@@ -1242,11 +1317,12 @@ var setConfigEnv = (config) => {
1242
1317
  process.env[`${prefix}TIMEZONE`] = config.timezone;
1243
1318
  process.env.TZ = config.timezone;
1244
1319
  process.env.DEFAULT_TIMEZONE = config.timezone;
1320
+ process.env.TIMEZONE = config.timezone;
1245
1321
  }
1246
1322
  if (config.locale) {
1247
1323
  process.env[`${prefix}LOCALE`] = config.locale;
1248
- process.env.LOCALE = config.locale;
1249
1324
  process.env.DEFAULT_LOCALE = config.locale;
1325
+ process.env.LOCALE = config.locale;
1250
1326
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1251
1327
  }
1252
1328
  if (config.configFile) {
@@ -1407,6 +1483,11 @@ var setSingleThemeColorConfigEnv = (prefix, config) => {
1407
1483
  if (config.negative) {
1408
1484
  process.env[`${prefix}NEGATIVE`] = config.negative;
1409
1485
  }
1486
+ if (config.gradient) {
1487
+ for (let i = 0; i < config.gradient.length; i++) {
1488
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1489
+ }
1490
+ }
1410
1491
  };
1411
1492
  var setMultiThemeColorConfigEnv = (prefix, config) => {
1412
1493
  return {
@@ -1457,6 +1538,11 @@ var setBaseThemeColorConfigEnv = (prefix, config) => {
1457
1538
  if (config.negative) {
1458
1539
  process.env[`${prefix}NEGATIVE`] = config.negative;
1459
1540
  }
1541
+ if (config.gradient) {
1542
+ for (let i = 0; i < config.gradient.length; i++) {
1543
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1544
+ }
1545
+ }
1460
1546
  };
1461
1547
 
1462
1548
  // ../config-tools/src/create-storm-config.ts
@@ -1557,7 +1643,6 @@ var getConfig = (workspaceRoot, skipLogs = false) => {
1557
1643
  };
1558
1644
 
1559
1645
  export {
1560
- findWorkspaceRoot,
1561
1646
  writeFatal,
1562
1647
  writeError,
1563
1648
  writeWarning,
@@ -1567,5 +1652,6 @@ export {
1567
1652
  writeTrace,
1568
1653
  getStopwatch,
1569
1654
  formatLogMessage,
1655
+ findWorkspaceRoot,
1570
1656
  getConfig
1571
1657
  };