@storm-software/git-tools 2.131.127 → 2.131.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/{chunk-GAHICIOD.js → chunk-A5X7CY3W.js} +3 -3
- package/bin/{chunk-GAHICIOD.js.map → chunk-A5X7CY3W.js.map} +1 -1
- package/bin/{chunk-ZBZINLOA.js → chunk-AOZSGQGA.js} +3 -3
- package/bin/{chunk-ZBZINLOA.js.map → chunk-AOZSGQGA.js.map} +1 -1
- package/bin/chunk-FOMBLMLH.js +2073 -0
- package/bin/chunk-FOMBLMLH.js.map +1 -0
- package/bin/{chunk-B5CZCP2Y.cjs → chunk-GT7HITVF.cjs} +4 -4
- package/bin/{chunk-B5CZCP2Y.cjs.map → chunk-GT7HITVF.cjs.map} +1 -1
- package/bin/{chunk-ZL2JPPJF.cjs → chunk-IHDSESSE.cjs} +4 -4
- package/bin/{chunk-ZL2JPPJF.cjs.map → chunk-IHDSESSE.cjs.map} +1 -1
- package/bin/{chunk-SASCLX6I.js → chunk-IIH7F7OZ.js} +3 -3
- package/bin/{chunk-SASCLX6I.js.map → chunk-IIH7F7OZ.js.map} +1 -1
- package/bin/{chunk-KFRB3UCF.js → chunk-JBHMFR7F.js} +3 -3
- package/bin/{chunk-KFRB3UCF.js.map → chunk-JBHMFR7F.js.map} +1 -1
- package/bin/{chunk-KJMWPKRH.cjs → chunk-JYYYVLIU.cjs} +4 -4
- package/bin/{chunk-KJMWPKRH.cjs.map → chunk-JYYYVLIU.cjs.map} +1 -1
- package/bin/{chunk-MUNEGKNC.cjs → chunk-ML5MZIGJ.cjs} +5 -5
- package/bin/{chunk-MUNEGKNC.cjs.map → chunk-ML5MZIGJ.cjs.map} +1 -1
- package/bin/{chunk-NNIW4L2Q.js → chunk-NG23E43K.js} +3 -3
- package/bin/{chunk-NNIW4L2Q.js.map → chunk-NG23E43K.js.map} +1 -1
- package/bin/{chunk-2NTFR3EF.cjs → chunk-QBI7KQ6A.cjs} +6 -6
- package/bin/{chunk-2NTFR3EF.cjs.map → chunk-QBI7KQ6A.cjs.map} +1 -1
- package/bin/{chunk-VIFL2F7H.js → chunk-SHH572XU.js} +3 -3
- package/bin/{chunk-VIFL2F7H.js.map → chunk-SHH572XU.js.map} +1 -1
- package/bin/{chunk-NZ4HDNJ7.cjs → chunk-SZFP3TKI.cjs} +4 -4
- package/bin/{chunk-NZ4HDNJ7.cjs.map → chunk-SZFP3TKI.cjs.map} +1 -1
- package/bin/chunk-TOLGVHZM.cjs +2116 -0
- package/bin/chunk-TOLGVHZM.cjs.map +1 -0
- package/bin/{chunk-MSQDEBW3.js → chunk-WUN4N3D7.js} +3 -3
- package/bin/{chunk-MSQDEBW3.js.map → chunk-WUN4N3D7.js.map} +1 -1
- package/bin/{chunk-IXUKWNVT.cjs → chunk-ZJN2D7NE.cjs} +4 -4
- package/bin/{chunk-IXUKWNVT.cjs.map → chunk-ZJN2D7NE.cjs.map} +1 -1
- package/bin/git.cjs +185 -195
- package/bin/git.cjs.map +1 -1
- package/bin/git.js +46 -54
- package/bin/git.js.map +1 -1
- package/bin/post-checkout.cjs +7 -7
- package/bin/post-checkout.js +2 -2
- package/bin/post-commit.cjs +7 -7
- package/bin/post-commit.js +2 -2
- package/bin/post-merge.cjs +7 -7
- package/bin/post-merge.js +2 -2
- package/bin/pre-commit.cjs +7 -7
- package/bin/pre-commit.js +2 -2
- package/bin/pre-install.cjs +7 -7
- package/bin/pre-install.js +2 -2
- package/bin/pre-push.cjs +7 -7
- package/bin/pre-push.js +2 -2
- package/bin/prepare.cjs +7 -7
- package/bin/prepare.js +2 -2
- package/bin/version-warning.cjs +5 -5
- package/bin/version-warning.js +1 -1
- package/dist/chunk-52Z6PKZI.js +2412 -0
- package/dist/chunk-U5IGP2SZ.cjs +2454 -0
- package/dist/index.cjs +18 -18
- package/dist/index.js +1 -1
- package/dist/release/config.cjs +18 -18
- package/dist/release/config.js +1 -1
- package/package.json +10 -14
- package/bin/chunk-DGRFGD2R.cjs +0 -3578
- package/bin/chunk-DGRFGD2R.cjs.map +0 -1
- package/bin/chunk-ZW42VDY5.js +0 -3554
- package/bin/chunk-ZW42VDY5.js.map +0 -1
- package/dist/chunk-IVBFLZSL.cjs +0 -3863
- package/dist/chunk-J5FHPMMG.js +0 -3840
package/bin/chunk-DGRFGD2R.cjs
DELETED
|
@@ -1,3578 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('date-fns/formatDistanceToNow');
|
|
4
|
-
var chalk = require('chalk');
|
|
5
|
-
var fs = require('fs');
|
|
6
|
-
var c12 = require('c12');
|
|
7
|
-
var path = require('path');
|
|
8
|
-
var promises = require('fs/promises');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
13
|
-
|
|
14
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
15
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
16
|
-
}) : x)(function(x) {
|
|
17
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
18
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// ../config-tools/src/types.ts
|
|
22
|
-
var LogLevel = {
|
|
23
|
-
SILENT: 0,
|
|
24
|
-
FATAL: 10,
|
|
25
|
-
ERROR: 20,
|
|
26
|
-
WARN: 30,
|
|
27
|
-
SUCCESS: 35,
|
|
28
|
-
INFO: 40,
|
|
29
|
-
PERFORMANCE: 50,
|
|
30
|
-
DEBUG: 60,
|
|
31
|
-
TRACE: 70,
|
|
32
|
-
ALL: 100
|
|
33
|
-
};
|
|
34
|
-
var LogLevelLabel = {
|
|
35
|
-
SILENT: "silent",
|
|
36
|
-
FATAL: "fatal",
|
|
37
|
-
ERROR: "error",
|
|
38
|
-
WARN: "warn",
|
|
39
|
-
SUCCESS: "success",
|
|
40
|
-
INFO: "info",
|
|
41
|
-
PERFORMANCE: "performance",
|
|
42
|
-
DEBUG: "debug",
|
|
43
|
-
TRACE: "trace",
|
|
44
|
-
ALL: "all"
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// ../config-tools/src/utilities/colors.ts
|
|
48
|
-
var DEFAULT_COLOR_CONFIG = {
|
|
49
|
-
light: {
|
|
50
|
-
background: "#fafafa",
|
|
51
|
-
foreground: "#1d1e22",
|
|
52
|
-
brand: "#1fb2a6",
|
|
53
|
-
alternate: "#db2777",
|
|
54
|
-
discovery: "#5C4EE5",
|
|
55
|
-
success: "#087f5b",
|
|
56
|
-
info: "#0550ae",
|
|
57
|
-
debug: "#8afafc",
|
|
58
|
-
warning: "#e3b341",
|
|
59
|
-
danger: "#D8314A",
|
|
60
|
-
fatal: "#51070f",
|
|
61
|
-
performance: "#13c302",
|
|
62
|
-
link: "#3fa6ff",
|
|
63
|
-
positive: "#22c55e",
|
|
64
|
-
negative: "#dc2626",
|
|
65
|
-
gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
|
|
66
|
-
},
|
|
67
|
-
dark: {
|
|
68
|
-
background: "#1e2124",
|
|
69
|
-
foreground: "#cbd5e1",
|
|
70
|
-
brand: "#2dd4bf",
|
|
71
|
-
alternate: "#db2777",
|
|
72
|
-
discovery: "#818cf8",
|
|
73
|
-
success: "#10b981",
|
|
74
|
-
info: "#58a6ff",
|
|
75
|
-
debug: "#8afafc",
|
|
76
|
-
warning: "#f3d371",
|
|
77
|
-
danger: "#D8314A",
|
|
78
|
-
fatal: "#a40e26",
|
|
79
|
-
performance: "#80fd74",
|
|
80
|
-
link: "#3fa6ff",
|
|
81
|
-
positive: "#22c55e",
|
|
82
|
-
negative: "#dc2626",
|
|
83
|
-
gradient: ["#1fb2a6", "#db2777", "#818cf8"]
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
function getColors(config2) {
|
|
87
|
-
if (!config2?.colors || typeof config2.colors !== "object" || !config2.colors["dark"] && (!config2.colors["base"] || typeof config2.colors !== "object" || !config2.colors["base"]?.["dark"])) {
|
|
88
|
-
return DEFAULT_COLOR_CONFIG;
|
|
89
|
-
}
|
|
90
|
-
if (config2.colors["base"]) {
|
|
91
|
-
if (typeof config2.colors["base"]["dark"] === "object") {
|
|
92
|
-
return config2.colors["base"]["dark"];
|
|
93
|
-
} else if (config2.colors["base"]["dark"] === "string") {
|
|
94
|
-
return config2.colors["base"];
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (typeof config2.colors["dark"] === "object") {
|
|
98
|
-
return config2.colors["dark"];
|
|
99
|
-
}
|
|
100
|
-
return config2.colors ?? DEFAULT_COLOR_CONFIG;
|
|
101
|
-
}
|
|
102
|
-
function getColor(key, config2) {
|
|
103
|
-
const colors = getColors(config2);
|
|
104
|
-
const result = (typeof colors["dark"] === "object" ? colors["dark"][key] : colors[key]) || DEFAULT_COLOR_CONFIG["dark"][key] || DEFAULT_COLOR_CONFIG[key];
|
|
105
|
-
if (result) {
|
|
106
|
-
return result;
|
|
107
|
-
}
|
|
108
|
-
return getColor("brand", config2);
|
|
109
|
-
}
|
|
110
|
-
var chalkDefault = {
|
|
111
|
-
hex: (_) => (message) => message,
|
|
112
|
-
bgHex: (_) => ({
|
|
113
|
-
whiteBright: (message) => message,
|
|
114
|
-
white: (message) => message
|
|
115
|
-
}),
|
|
116
|
-
white: (message) => message,
|
|
117
|
-
whiteBright: (message) => message,
|
|
118
|
-
gray: (message) => message,
|
|
119
|
-
bold: {
|
|
120
|
-
hex: (_) => (message) => message,
|
|
121
|
-
bgHex: (_) => ({
|
|
122
|
-
whiteBright: (message) => message,
|
|
123
|
-
white: (message) => message
|
|
124
|
-
}),
|
|
125
|
-
whiteBright: (message) => message,
|
|
126
|
-
white: (message) => message
|
|
127
|
-
},
|
|
128
|
-
dim: {
|
|
129
|
-
hex: (_) => (message) => message,
|
|
130
|
-
gray: (message) => message
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
var getChalk = () => {
|
|
134
|
-
let _chalk = chalk__default.default;
|
|
135
|
-
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
136
|
-
_chalk = chalkDefault;
|
|
137
|
-
}
|
|
138
|
-
return _chalk;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
142
|
-
function isUnicodeSupported() {
|
|
143
|
-
if (process.platform !== "win32") {
|
|
144
|
-
return process.env.TERM !== "linux";
|
|
145
|
-
}
|
|
146
|
-
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
147
|
-
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
148
|
-
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
149
|
-
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";
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// ../config-tools/src/logger/console-icons.ts
|
|
153
|
-
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
154
|
-
var CONSOLE_ICONS = {
|
|
155
|
-
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
156
|
-
[LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
|
|
157
|
-
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
158
|
-
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
159
|
-
[LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
|
|
160
|
-
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
161
|
-
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
162
|
-
[LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
|
|
163
|
-
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// ../config-tools/src/logger/format-timestamp.ts
|
|
167
|
-
var formatTimestamp = (fullDateTime = false, date2 = /* @__PURE__ */ new Date()) => {
|
|
168
|
-
return fullDateTime ? `${date2.toLocaleDateString()} ${date2.toLocaleTimeString()}` : `${date2.toLocaleTimeString()}`;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
// ../config-tools/src/logger/get-log-level.ts
|
|
172
|
-
var getLogLevel = (label) => {
|
|
173
|
-
switch (label) {
|
|
174
|
-
case "all":
|
|
175
|
-
return LogLevel.ALL;
|
|
176
|
-
case "trace":
|
|
177
|
-
return LogLevel.TRACE;
|
|
178
|
-
case "debug":
|
|
179
|
-
return LogLevel.DEBUG;
|
|
180
|
-
case "performance":
|
|
181
|
-
return LogLevel.PERFORMANCE;
|
|
182
|
-
case "info":
|
|
183
|
-
return LogLevel.INFO;
|
|
184
|
-
case "warn":
|
|
185
|
-
return LogLevel.WARN;
|
|
186
|
-
case "error":
|
|
187
|
-
return LogLevel.ERROR;
|
|
188
|
-
case "fatal":
|
|
189
|
-
return LogLevel.FATAL;
|
|
190
|
-
case "silent":
|
|
191
|
-
return LogLevel.SILENT;
|
|
192
|
-
default:
|
|
193
|
-
return LogLevel.INFO;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
197
|
-
if (logLevel >= LogLevel.ALL) {
|
|
198
|
-
return LogLevelLabel.ALL;
|
|
199
|
-
}
|
|
200
|
-
if (logLevel >= LogLevel.TRACE) {
|
|
201
|
-
return LogLevelLabel.TRACE;
|
|
202
|
-
}
|
|
203
|
-
if (logLevel >= LogLevel.DEBUG) {
|
|
204
|
-
return LogLevelLabel.DEBUG;
|
|
205
|
-
}
|
|
206
|
-
if (logLevel >= LogLevel.PERFORMANCE) {
|
|
207
|
-
return LogLevelLabel.PERFORMANCE;
|
|
208
|
-
}
|
|
209
|
-
if (logLevel >= LogLevel.INFO) {
|
|
210
|
-
return LogLevelLabel.INFO;
|
|
211
|
-
}
|
|
212
|
-
if (logLevel >= LogLevel.WARN) {
|
|
213
|
-
return LogLevelLabel.WARN;
|
|
214
|
-
}
|
|
215
|
-
if (logLevel >= LogLevel.ERROR) {
|
|
216
|
-
return LogLevelLabel.ERROR;
|
|
217
|
-
}
|
|
218
|
-
if (logLevel >= LogLevel.FATAL) {
|
|
219
|
-
return LogLevelLabel.FATAL;
|
|
220
|
-
}
|
|
221
|
-
if (logLevel <= LogLevel.SILENT) {
|
|
222
|
-
return LogLevelLabel.SILENT;
|
|
223
|
-
}
|
|
224
|
-
return LogLevelLabel.INFO;
|
|
225
|
-
};
|
|
226
|
-
var isVerbose = (label = LogLevelLabel.SILENT) => {
|
|
227
|
-
const logLevel = typeof label === "string" ? getLogLevel(label) : label;
|
|
228
|
-
return logLevel >= LogLevel.DEBUG;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
// ../config-tools/src/logger/console.ts
|
|
232
|
-
var getLogFn = (logLevel = LogLevel.INFO, config2 = {}, options = {}) => {
|
|
233
|
-
const {
|
|
234
|
-
chalk: _chalk = getChalk(),
|
|
235
|
-
fullDateTime = false,
|
|
236
|
-
hideDateTime = false
|
|
237
|
-
} = options;
|
|
238
|
-
const colors = !config2.colors?.dark && !config2.colors?.["base"] && !config2.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config2.colors?.dark && typeof config2.colors.dark === "string" ? config2.colors : config2.colors?.["base"]?.dark && typeof config2.colors["base"].dark === "string" ? config2.colors["base"].dark : config2.colors?.["base"] ? config2.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
239
|
-
const configLogLevel = config2.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
240
|
-
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
241
|
-
return (_) => {
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
245
|
-
return (message) => {
|
|
246
|
-
console.error(
|
|
247
|
-
`
|
|
248
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
|
|
249
|
-
`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
|
|
250
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
251
|
-
`
|
|
252
|
-
);
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
256
|
-
return (message) => {
|
|
257
|
-
console.error(
|
|
258
|
-
`
|
|
259
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
|
|
260
|
-
`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
|
|
261
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
262
|
-
`
|
|
263
|
-
);
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
267
|
-
return (message) => {
|
|
268
|
-
console.warn(
|
|
269
|
-
`
|
|
270
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
|
|
271
|
-
`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
|
|
272
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
273
|
-
`
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
278
|
-
return (message) => {
|
|
279
|
-
console.info(
|
|
280
|
-
`
|
|
281
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
|
|
282
|
-
`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
|
|
283
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
284
|
-
`
|
|
285
|
-
);
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
289
|
-
return (message) => {
|
|
290
|
-
console.info(
|
|
291
|
-
`
|
|
292
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
|
|
293
|
-
`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
|
|
294
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
295
|
-
`
|
|
296
|
-
);
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
if (typeof logLevel === "number" && LogLevel.PERFORMANCE >= logLevel) {
|
|
300
|
-
return (message) => {
|
|
301
|
-
console.debug(
|
|
302
|
-
`
|
|
303
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
|
|
304
|
-
`[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
|
|
305
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
306
|
-
`
|
|
307
|
-
);
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
311
|
-
return (message) => {
|
|
312
|
-
console.debug(
|
|
313
|
-
`
|
|
314
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
|
|
315
|
-
`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
|
|
316
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
317
|
-
`
|
|
318
|
-
);
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
322
|
-
return (message) => {
|
|
323
|
-
console.debug(
|
|
324
|
-
`
|
|
325
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
|
|
326
|
-
`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
|
|
327
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
328
|
-
`
|
|
329
|
-
);
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
return (message) => {
|
|
333
|
-
console.log(
|
|
334
|
-
`
|
|
335
|
-
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
|
|
336
|
-
`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
|
|
337
|
-
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
338
|
-
`
|
|
339
|
-
);
|
|
340
|
-
};
|
|
341
|
-
};
|
|
342
|
-
var writeFatal = (message, config2) => getLogFn(LogLevel.FATAL, config2)(message);
|
|
343
|
-
var writeError = (message, config2) => getLogFn(LogLevel.ERROR, config2)(message);
|
|
344
|
-
var writeWarning = (message, config2) => getLogFn(LogLevel.WARN, config2)(message);
|
|
345
|
-
var writeInfo = (message, config2) => getLogFn(LogLevel.INFO, config2)(message);
|
|
346
|
-
var writeSuccess = (message, config2) => getLogFn(LogLevel.SUCCESS, config2)(message);
|
|
347
|
-
var writeDebug = (message, config2) => getLogFn(LogLevel.DEBUG, config2)(message);
|
|
348
|
-
var writeTrace = (message, config2) => getLogFn(LogLevel.TRACE, config2)(message);
|
|
349
|
-
var MAX_DEPTH = 10;
|
|
350
|
-
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
351
|
-
if (depth2 > MAX_DEPTH) {
|
|
352
|
-
return "<max depth>";
|
|
353
|
-
}
|
|
354
|
-
const prefix = options.prefix ?? "";
|
|
355
|
-
const skip = options.skip ?? [];
|
|
356
|
-
const sort = options.sort ?? true;
|
|
357
|
-
return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
|
|
358
|
-
${message.sort(
|
|
359
|
-
sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
|
|
360
|
-
).map(
|
|
361
|
-
(item, index) => ` ${prefix}> #${index} = ${formatLogMessage(
|
|
362
|
-
item,
|
|
363
|
-
{ prefix: `${prefix}--`, skip, sort },
|
|
364
|
-
depth2 + 1
|
|
365
|
-
)}`
|
|
366
|
-
).join("\n")}` : typeof message === "object" && message ? `
|
|
367
|
-
${Object.keys(message).filter(
|
|
368
|
-
(key) => typeof key !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key.toLowerCase().trim())
|
|
369
|
-
).sort(
|
|
370
|
-
sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
|
|
371
|
-
).map(
|
|
372
|
-
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" && message[key] ? Object.keys(message[key]).filter(
|
|
373
|
-
(key2) => typeof key2 !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key2.toLowerCase().trim())
|
|
374
|
-
).length === 0 ? "{}" : formatLogMessage(
|
|
375
|
-
message[key],
|
|
376
|
-
{ prefix: `${prefix}--`, skip, sort },
|
|
377
|
-
depth2 + 1
|
|
378
|
-
) : message[key]}`
|
|
379
|
-
).join("\n")}` : String(message);
|
|
380
|
-
};
|
|
381
|
-
var _isFunction = (value) => {
|
|
382
|
-
try {
|
|
383
|
-
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
384
|
-
} catch {
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
var brandIcon = (config2 = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config2))("\u{1F5F2}");
|
|
389
|
-
|
|
390
|
-
// ../config-tools/src/utilities/process-handler.ts
|
|
391
|
-
var exitWithError = (config2) => {
|
|
392
|
-
writeFatal("Exiting script with an error status...", config2);
|
|
393
|
-
process.exit(1);
|
|
394
|
-
};
|
|
395
|
-
var exitWithSuccess = (config2) => {
|
|
396
|
-
writeSuccess("Script completed successfully. Exiting...", config2);
|
|
397
|
-
process.exit(0);
|
|
398
|
-
};
|
|
399
|
-
var handleProcess = (config2) => {
|
|
400
|
-
writeTrace(
|
|
401
|
-
`Using the following arguments to process the script: ${process.argv.join(", ")}`,
|
|
402
|
-
config2
|
|
403
|
-
);
|
|
404
|
-
process.on("unhandledRejection", (error) => {
|
|
405
|
-
writeError(
|
|
406
|
-
`An Unhandled Rejection occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"}
|
|
407
|
-
Stacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`,
|
|
408
|
-
config2
|
|
409
|
-
);
|
|
410
|
-
exitWithError(config2);
|
|
411
|
-
});
|
|
412
|
-
process.on("uncaughtException", (error) => {
|
|
413
|
-
writeError(
|
|
414
|
-
`An Uncaught Exception occurred while running the program: ${error && typeof error === "object" && "message" in error && error?.message ? error.message : typeof error === "string" ? error : "Unknown error"}
|
|
415
|
-
Stacktrace: ${error && typeof error === "object" && "stack" in error && error?.stack ? error.stack : ""}`,
|
|
416
|
-
config2
|
|
417
|
-
);
|
|
418
|
-
exitWithError(config2);
|
|
419
|
-
});
|
|
420
|
-
process.on("SIGTERM", (signal) => {
|
|
421
|
-
writeError(`The program terminated with signal code: ${signal}`, config2);
|
|
422
|
-
exitWithError(config2);
|
|
423
|
-
});
|
|
424
|
-
process.on("SIGINT", (signal) => {
|
|
425
|
-
writeError(`The program terminated with signal code: ${signal}`, config2);
|
|
426
|
-
exitWithError(config2);
|
|
427
|
-
});
|
|
428
|
-
process.on("SIGHUP", (signal) => {
|
|
429
|
-
writeError(`The program terminated with signal code: ${signal}`, config2);
|
|
430
|
-
exitWithError(config2);
|
|
431
|
-
});
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
435
|
-
var _a;
|
|
436
|
-
// @__NO_SIDE_EFFECTS__
|
|
437
|
-
function $constructor(name, initializer2, params) {
|
|
438
|
-
function init(inst, def) {
|
|
439
|
-
if (!inst._zod) {
|
|
440
|
-
Object.defineProperty(inst, "_zod", {
|
|
441
|
-
value: {
|
|
442
|
-
def,
|
|
443
|
-
constr: _,
|
|
444
|
-
traits: /* @__PURE__ */ new Set()
|
|
445
|
-
},
|
|
446
|
-
enumerable: false
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
if (inst._zod.traits.has(name)) {
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
inst._zod.traits.add(name);
|
|
453
|
-
initializer2(inst, def);
|
|
454
|
-
const proto = _.prototype;
|
|
455
|
-
const keys = Object.keys(proto);
|
|
456
|
-
for (let i = 0; i < keys.length; i++) {
|
|
457
|
-
const k = keys[i];
|
|
458
|
-
if (!(k in inst)) {
|
|
459
|
-
inst[k] = proto[k].bind(inst);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
const Parent = params?.Parent ?? Object;
|
|
464
|
-
class Definition extends Parent {
|
|
465
|
-
}
|
|
466
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
467
|
-
function _(def) {
|
|
468
|
-
var _a3;
|
|
469
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
470
|
-
init(inst, def);
|
|
471
|
-
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
472
|
-
for (const fn of inst._zod.deferred) {
|
|
473
|
-
fn();
|
|
474
|
-
}
|
|
475
|
-
return inst;
|
|
476
|
-
}
|
|
477
|
-
Object.defineProperty(_, "init", { value: init });
|
|
478
|
-
Object.defineProperty(_, Symbol.hasInstance, {
|
|
479
|
-
value: (inst) => {
|
|
480
|
-
if (params?.Parent && inst instanceof params.Parent)
|
|
481
|
-
return true;
|
|
482
|
-
return inst?._zod?.traits?.has(name);
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
Object.defineProperty(_, "name", { value: name });
|
|
486
|
-
return _;
|
|
487
|
-
}
|
|
488
|
-
var $ZodAsyncError = class extends Error {
|
|
489
|
-
constructor() {
|
|
490
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
|
|
494
|
-
var globalConfig = globalThis.__zod_globalConfig;
|
|
495
|
-
function config(newConfig) {
|
|
496
|
-
return globalConfig;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
500
|
-
function getEnumValues(entries) {
|
|
501
|
-
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
502
|
-
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
503
|
-
return values;
|
|
504
|
-
}
|
|
505
|
-
function jsonStringifyReplacer(_, value) {
|
|
506
|
-
if (typeof value === "bigint")
|
|
507
|
-
return value.toString();
|
|
508
|
-
return value;
|
|
509
|
-
}
|
|
510
|
-
function cached(getter) {
|
|
511
|
-
return {
|
|
512
|
-
get value() {
|
|
513
|
-
{
|
|
514
|
-
const value = getter();
|
|
515
|
-
Object.defineProperty(this, "value", { value });
|
|
516
|
-
return value;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
function nullish(input) {
|
|
522
|
-
return input === null || input === void 0;
|
|
523
|
-
}
|
|
524
|
-
function cleanRegex(source) {
|
|
525
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
526
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
527
|
-
return source.slice(start, end);
|
|
528
|
-
}
|
|
529
|
-
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
530
|
-
function defineLazy(object2, key, getter) {
|
|
531
|
-
let value = void 0;
|
|
532
|
-
Object.defineProperty(object2, key, {
|
|
533
|
-
get() {
|
|
534
|
-
if (value === EVALUATING) {
|
|
535
|
-
return void 0;
|
|
536
|
-
}
|
|
537
|
-
if (value === void 0) {
|
|
538
|
-
value = EVALUATING;
|
|
539
|
-
value = getter();
|
|
540
|
-
}
|
|
541
|
-
return value;
|
|
542
|
-
},
|
|
543
|
-
set(v) {
|
|
544
|
-
Object.defineProperty(object2, key, {
|
|
545
|
-
value: v
|
|
546
|
-
// configurable: true,
|
|
547
|
-
});
|
|
548
|
-
},
|
|
549
|
-
configurable: true
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
553
|
-
};
|
|
554
|
-
function isObject(data) {
|
|
555
|
-
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
556
|
-
}
|
|
557
|
-
function isPlainObject(o) {
|
|
558
|
-
if (isObject(o) === false)
|
|
559
|
-
return false;
|
|
560
|
-
const ctor = o.constructor;
|
|
561
|
-
if (ctor === void 0)
|
|
562
|
-
return true;
|
|
563
|
-
if (typeof ctor !== "function")
|
|
564
|
-
return true;
|
|
565
|
-
const prot = ctor.prototype;
|
|
566
|
-
if (isObject(prot) === false)
|
|
567
|
-
return false;
|
|
568
|
-
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
569
|
-
return false;
|
|
570
|
-
}
|
|
571
|
-
return true;
|
|
572
|
-
}
|
|
573
|
-
function shallowClone(o) {
|
|
574
|
-
if (isPlainObject(o))
|
|
575
|
-
return { ...o };
|
|
576
|
-
if (Array.isArray(o))
|
|
577
|
-
return [...o];
|
|
578
|
-
if (o instanceof Map)
|
|
579
|
-
return new Map(o);
|
|
580
|
-
if (o instanceof Set)
|
|
581
|
-
return new Set(o);
|
|
582
|
-
return o;
|
|
583
|
-
}
|
|
584
|
-
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
585
|
-
function escapeRegex(str) {
|
|
586
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
587
|
-
}
|
|
588
|
-
function clone(inst, def, params) {
|
|
589
|
-
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
590
|
-
if (!def || params?.parent)
|
|
591
|
-
cl._zod.parent = inst;
|
|
592
|
-
return cl;
|
|
593
|
-
}
|
|
594
|
-
function normalizeParams(_params) {
|
|
595
|
-
const params = _params;
|
|
596
|
-
if (!params)
|
|
597
|
-
return {};
|
|
598
|
-
if (typeof params === "string")
|
|
599
|
-
return { error: () => params };
|
|
600
|
-
if (params?.message !== void 0) {
|
|
601
|
-
if (params?.error !== void 0)
|
|
602
|
-
throw new Error("Cannot specify both `message` and `error` params");
|
|
603
|
-
params.error = params.message;
|
|
604
|
-
}
|
|
605
|
-
delete params.message;
|
|
606
|
-
if (typeof params.error === "string")
|
|
607
|
-
return { ...params, error: () => params.error };
|
|
608
|
-
return params;
|
|
609
|
-
}
|
|
610
|
-
function optionalKeys(shape) {
|
|
611
|
-
return Object.keys(shape).filter((k) => {
|
|
612
|
-
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
function aborted(x, startIndex = 0) {
|
|
616
|
-
if (x.aborted === true)
|
|
617
|
-
return true;
|
|
618
|
-
for (let i = startIndex; i < x.issues.length; i++) {
|
|
619
|
-
if (x.issues[i]?.continue !== true) {
|
|
620
|
-
return true;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
return false;
|
|
624
|
-
}
|
|
625
|
-
function explicitlyAborted(x, startIndex = 0) {
|
|
626
|
-
if (x.aborted === true)
|
|
627
|
-
return true;
|
|
628
|
-
for (let i = startIndex; i < x.issues.length; i++) {
|
|
629
|
-
if (x.issues[i]?.continue === false) {
|
|
630
|
-
return true;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
return false;
|
|
634
|
-
}
|
|
635
|
-
function prefixIssues(path, issues) {
|
|
636
|
-
return issues.map((iss) => {
|
|
637
|
-
var _a3;
|
|
638
|
-
(_a3 = iss).path ?? (_a3.path = []);
|
|
639
|
-
iss.path.unshift(path);
|
|
640
|
-
return iss;
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
function unwrapMessage(message) {
|
|
644
|
-
return typeof message === "string" ? message : message?.message;
|
|
645
|
-
}
|
|
646
|
-
function finalizeIssue(iss, ctx, config2) {
|
|
647
|
-
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
648
|
-
const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
|
|
649
|
-
rest.path ?? (rest.path = []);
|
|
650
|
-
rest.message = message;
|
|
651
|
-
if (ctx?.reportInput) {
|
|
652
|
-
rest.input = _input;
|
|
653
|
-
}
|
|
654
|
-
return rest;
|
|
655
|
-
}
|
|
656
|
-
function getLengthableOrigin(input) {
|
|
657
|
-
if (Array.isArray(input))
|
|
658
|
-
return "array";
|
|
659
|
-
if (typeof input === "string")
|
|
660
|
-
return "string";
|
|
661
|
-
return "unknown";
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
665
|
-
var initializer = (inst, def) => {
|
|
666
|
-
inst.name = "$ZodError";
|
|
667
|
-
Object.defineProperty(inst, "_zod", {
|
|
668
|
-
value: inst._zod,
|
|
669
|
-
enumerable: false
|
|
670
|
-
});
|
|
671
|
-
Object.defineProperty(inst, "issues", {
|
|
672
|
-
value: def,
|
|
673
|
-
enumerable: false
|
|
674
|
-
});
|
|
675
|
-
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
676
|
-
Object.defineProperty(inst, "toString", {
|
|
677
|
-
value: () => inst.message,
|
|
678
|
-
enumerable: false
|
|
679
|
-
});
|
|
680
|
-
};
|
|
681
|
-
var $ZodError = $constructor("$ZodError", initializer);
|
|
682
|
-
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
683
|
-
|
|
684
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
685
|
-
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
686
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
687
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
688
|
-
if (result instanceof Promise) {
|
|
689
|
-
throw new $ZodAsyncError();
|
|
690
|
-
}
|
|
691
|
-
if (result.issues.length) {
|
|
692
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
693
|
-
captureStackTrace(e, _params?.callee);
|
|
694
|
-
throw e;
|
|
695
|
-
}
|
|
696
|
-
return result.value;
|
|
697
|
-
};
|
|
698
|
-
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
699
|
-
var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
700
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
701
|
-
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
702
|
-
if (result instanceof Promise)
|
|
703
|
-
result = await result;
|
|
704
|
-
if (result.issues.length) {
|
|
705
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
706
|
-
captureStackTrace(e, params?.callee);
|
|
707
|
-
throw e;
|
|
708
|
-
}
|
|
709
|
-
return result.value;
|
|
710
|
-
};
|
|
711
|
-
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
712
|
-
var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
713
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
714
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
715
|
-
if (result instanceof Promise) {
|
|
716
|
-
throw new $ZodAsyncError();
|
|
717
|
-
}
|
|
718
|
-
return result.issues.length ? {
|
|
719
|
-
success: false,
|
|
720
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
721
|
-
} : { success: true, data: result.value };
|
|
722
|
-
};
|
|
723
|
-
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
724
|
-
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
725
|
-
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
726
|
-
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
727
|
-
if (result instanceof Promise)
|
|
728
|
-
result = await result;
|
|
729
|
-
return result.issues.length ? {
|
|
730
|
-
success: false,
|
|
731
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
732
|
-
} : { success: true, data: result.value };
|
|
733
|
-
};
|
|
734
|
-
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
735
|
-
|
|
736
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
|
|
737
|
-
var httpProtocol = /^https?$/;
|
|
738
|
-
var string = (params) => {
|
|
739
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
740
|
-
return new RegExp(`^${regex}$`);
|
|
741
|
-
};
|
|
742
|
-
var number = /^-?\d+(?:\.\d+)?$/;
|
|
743
|
-
var boolean = /^(?:true|false)$/i;
|
|
744
|
-
|
|
745
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
|
|
746
|
-
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
747
|
-
var _a3;
|
|
748
|
-
inst._zod ?? (inst._zod = {});
|
|
749
|
-
inst._zod.def = def;
|
|
750
|
-
(_a3 = inst._zod).onattach ?? (_a3.onattach = []);
|
|
751
|
-
});
|
|
752
|
-
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
753
|
-
var _a3;
|
|
754
|
-
$ZodCheck.init(inst, def);
|
|
755
|
-
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
756
|
-
const val = payload.value;
|
|
757
|
-
return !nullish(val) && val.length !== void 0;
|
|
758
|
-
});
|
|
759
|
-
inst._zod.onattach.push((inst2) => {
|
|
760
|
-
const bag = inst2._zod.bag;
|
|
761
|
-
bag.minimum = def.length;
|
|
762
|
-
bag.maximum = def.length;
|
|
763
|
-
bag.length = def.length;
|
|
764
|
-
});
|
|
765
|
-
inst._zod.check = (payload) => {
|
|
766
|
-
const input = payload.value;
|
|
767
|
-
const length = input.length;
|
|
768
|
-
if (length === def.length)
|
|
769
|
-
return;
|
|
770
|
-
const origin = getLengthableOrigin(input);
|
|
771
|
-
const tooBig = length > def.length;
|
|
772
|
-
payload.issues.push({
|
|
773
|
-
origin,
|
|
774
|
-
...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
|
|
775
|
-
inclusive: true,
|
|
776
|
-
exact: true,
|
|
777
|
-
input: payload.value,
|
|
778
|
-
inst,
|
|
779
|
-
continue: !def.abort
|
|
780
|
-
});
|
|
781
|
-
};
|
|
782
|
-
});
|
|
783
|
-
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
784
|
-
var _a3, _b;
|
|
785
|
-
$ZodCheck.init(inst, def);
|
|
786
|
-
inst._zod.onattach.push((inst2) => {
|
|
787
|
-
const bag = inst2._zod.bag;
|
|
788
|
-
bag.format = def.format;
|
|
789
|
-
if (def.pattern) {
|
|
790
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
791
|
-
bag.patterns.add(def.pattern);
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
if (def.pattern)
|
|
795
|
-
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
796
|
-
def.pattern.lastIndex = 0;
|
|
797
|
-
if (def.pattern.test(payload.value))
|
|
798
|
-
return;
|
|
799
|
-
payload.issues.push({
|
|
800
|
-
origin: "string",
|
|
801
|
-
code: "invalid_format",
|
|
802
|
-
format: def.format,
|
|
803
|
-
input: payload.value,
|
|
804
|
-
...def.pattern ? { pattern: def.pattern.toString() } : {},
|
|
805
|
-
inst,
|
|
806
|
-
continue: !def.abort
|
|
807
|
-
});
|
|
808
|
-
});
|
|
809
|
-
else
|
|
810
|
-
(_b = inst._zod).check ?? (_b.check = () => {
|
|
811
|
-
});
|
|
812
|
-
});
|
|
813
|
-
var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
814
|
-
$ZodCheckStringFormat.init(inst, def);
|
|
815
|
-
inst._zod.check = (payload) => {
|
|
816
|
-
def.pattern.lastIndex = 0;
|
|
817
|
-
if (def.pattern.test(payload.value))
|
|
818
|
-
return;
|
|
819
|
-
payload.issues.push({
|
|
820
|
-
origin: "string",
|
|
821
|
-
code: "invalid_format",
|
|
822
|
-
format: "regex",
|
|
823
|
-
input: payload.value,
|
|
824
|
-
pattern: def.pattern.toString(),
|
|
825
|
-
inst,
|
|
826
|
-
continue: !def.abort
|
|
827
|
-
});
|
|
828
|
-
};
|
|
829
|
-
});
|
|
830
|
-
var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
831
|
-
$ZodCheck.init(inst, def);
|
|
832
|
-
inst._zod.check = (payload) => {
|
|
833
|
-
payload.value = def.tx(payload.value);
|
|
834
|
-
};
|
|
835
|
-
});
|
|
836
|
-
|
|
837
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
|
|
838
|
-
var version = {
|
|
839
|
-
major: 4,
|
|
840
|
-
minor: 4,
|
|
841
|
-
patch: 3
|
|
842
|
-
};
|
|
843
|
-
|
|
844
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
|
|
845
|
-
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
846
|
-
var _a3;
|
|
847
|
-
inst ?? (inst = {});
|
|
848
|
-
inst._zod.def = def;
|
|
849
|
-
inst._zod.bag = inst._zod.bag || {};
|
|
850
|
-
inst._zod.version = version;
|
|
851
|
-
const checks = [...inst._zod.def.checks ?? []];
|
|
852
|
-
if (inst._zod.traits.has("$ZodCheck")) {
|
|
853
|
-
checks.unshift(inst);
|
|
854
|
-
}
|
|
855
|
-
for (const ch of checks) {
|
|
856
|
-
for (const fn of ch._zod.onattach) {
|
|
857
|
-
fn(inst);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
if (checks.length === 0) {
|
|
861
|
-
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
862
|
-
inst._zod.deferred?.push(() => {
|
|
863
|
-
inst._zod.run = inst._zod.parse;
|
|
864
|
-
});
|
|
865
|
-
} else {
|
|
866
|
-
const runChecks = (payload, checks2, ctx) => {
|
|
867
|
-
let isAborted = aborted(payload);
|
|
868
|
-
let asyncResult;
|
|
869
|
-
for (const ch of checks2) {
|
|
870
|
-
if (ch._zod.def.when) {
|
|
871
|
-
if (explicitlyAborted(payload))
|
|
872
|
-
continue;
|
|
873
|
-
const shouldRun = ch._zod.def.when(payload);
|
|
874
|
-
if (!shouldRun)
|
|
875
|
-
continue;
|
|
876
|
-
} else if (isAborted) {
|
|
877
|
-
continue;
|
|
878
|
-
}
|
|
879
|
-
const currLen = payload.issues.length;
|
|
880
|
-
const _ = ch._zod.check(payload);
|
|
881
|
-
if (_ instanceof Promise && ctx?.async === false) {
|
|
882
|
-
throw new $ZodAsyncError();
|
|
883
|
-
}
|
|
884
|
-
if (asyncResult || _ instanceof Promise) {
|
|
885
|
-
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
886
|
-
await _;
|
|
887
|
-
const nextLen = payload.issues.length;
|
|
888
|
-
if (nextLen === currLen)
|
|
889
|
-
return;
|
|
890
|
-
if (!isAborted)
|
|
891
|
-
isAborted = aborted(payload, currLen);
|
|
892
|
-
});
|
|
893
|
-
} else {
|
|
894
|
-
const nextLen = payload.issues.length;
|
|
895
|
-
if (nextLen === currLen)
|
|
896
|
-
continue;
|
|
897
|
-
if (!isAborted)
|
|
898
|
-
isAborted = aborted(payload, currLen);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
if (asyncResult) {
|
|
902
|
-
return asyncResult.then(() => {
|
|
903
|
-
return payload;
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
return payload;
|
|
907
|
-
};
|
|
908
|
-
const handleCanaryResult = (canary, payload, ctx) => {
|
|
909
|
-
if (aborted(canary)) {
|
|
910
|
-
canary.aborted = true;
|
|
911
|
-
return canary;
|
|
912
|
-
}
|
|
913
|
-
const checkResult = runChecks(payload, checks, ctx);
|
|
914
|
-
if (checkResult instanceof Promise) {
|
|
915
|
-
if (ctx.async === false)
|
|
916
|
-
throw new $ZodAsyncError();
|
|
917
|
-
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
918
|
-
}
|
|
919
|
-
return inst._zod.parse(checkResult, ctx);
|
|
920
|
-
};
|
|
921
|
-
inst._zod.run = (payload, ctx) => {
|
|
922
|
-
if (ctx.skipChecks) {
|
|
923
|
-
return inst._zod.parse(payload, ctx);
|
|
924
|
-
}
|
|
925
|
-
if (ctx.direction === "backward") {
|
|
926
|
-
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
927
|
-
if (canary instanceof Promise) {
|
|
928
|
-
return canary.then((canary2) => {
|
|
929
|
-
return handleCanaryResult(canary2, payload, ctx);
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
933
|
-
}
|
|
934
|
-
const result = inst._zod.parse(payload, ctx);
|
|
935
|
-
if (result instanceof Promise) {
|
|
936
|
-
if (ctx.async === false)
|
|
937
|
-
throw new $ZodAsyncError();
|
|
938
|
-
return result.then((result2) => runChecks(result2, checks, ctx));
|
|
939
|
-
}
|
|
940
|
-
return runChecks(result, checks, ctx);
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
defineLazy(inst, "~standard", () => ({
|
|
944
|
-
validate: (value) => {
|
|
945
|
-
try {
|
|
946
|
-
const r = safeParse(inst, value);
|
|
947
|
-
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
948
|
-
} catch (_) {
|
|
949
|
-
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
950
|
-
}
|
|
951
|
-
},
|
|
952
|
-
vendor: "zod",
|
|
953
|
-
version: 1
|
|
954
|
-
}));
|
|
955
|
-
});
|
|
956
|
-
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
957
|
-
$ZodType.init(inst, def);
|
|
958
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
|
|
959
|
-
inst._zod.parse = (payload, _) => {
|
|
960
|
-
if (def.coerce)
|
|
961
|
-
try {
|
|
962
|
-
payload.value = String(payload.value);
|
|
963
|
-
} catch (_2) {
|
|
964
|
-
}
|
|
965
|
-
if (typeof payload.value === "string")
|
|
966
|
-
return payload;
|
|
967
|
-
payload.issues.push({
|
|
968
|
-
expected: "string",
|
|
969
|
-
code: "invalid_type",
|
|
970
|
-
input: payload.value,
|
|
971
|
-
inst
|
|
972
|
-
});
|
|
973
|
-
return payload;
|
|
974
|
-
};
|
|
975
|
-
});
|
|
976
|
-
var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
|
|
977
|
-
$ZodCheckStringFormat.init(inst, def);
|
|
978
|
-
$ZodString.init(inst, def);
|
|
979
|
-
});
|
|
980
|
-
var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
981
|
-
$ZodStringFormat.init(inst, def);
|
|
982
|
-
inst._zod.check = (payload) => {
|
|
983
|
-
try {
|
|
984
|
-
const trimmed = payload.value.trim();
|
|
985
|
-
if (!def.normalize && def.protocol?.source === httpProtocol.source) {
|
|
986
|
-
if (!/^https?:\/\//i.test(trimmed)) {
|
|
987
|
-
payload.issues.push({
|
|
988
|
-
code: "invalid_format",
|
|
989
|
-
format: "url",
|
|
990
|
-
note: "Invalid URL format",
|
|
991
|
-
input: payload.value,
|
|
992
|
-
inst,
|
|
993
|
-
continue: !def.abort
|
|
994
|
-
});
|
|
995
|
-
return;
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
const url2 = new URL(trimmed);
|
|
999
|
-
if (def.hostname) {
|
|
1000
|
-
def.hostname.lastIndex = 0;
|
|
1001
|
-
if (!def.hostname.test(url2.hostname)) {
|
|
1002
|
-
payload.issues.push({
|
|
1003
|
-
code: "invalid_format",
|
|
1004
|
-
format: "url",
|
|
1005
|
-
note: "Invalid hostname",
|
|
1006
|
-
pattern: def.hostname.source,
|
|
1007
|
-
input: payload.value,
|
|
1008
|
-
inst,
|
|
1009
|
-
continue: !def.abort
|
|
1010
|
-
});
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
if (def.protocol) {
|
|
1014
|
-
def.protocol.lastIndex = 0;
|
|
1015
|
-
if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) {
|
|
1016
|
-
payload.issues.push({
|
|
1017
|
-
code: "invalid_format",
|
|
1018
|
-
format: "url",
|
|
1019
|
-
note: "Invalid protocol",
|
|
1020
|
-
pattern: def.protocol.source,
|
|
1021
|
-
input: payload.value,
|
|
1022
|
-
inst,
|
|
1023
|
-
continue: !def.abort
|
|
1024
|
-
});
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
if (def.normalize) {
|
|
1028
|
-
payload.value = url2.href;
|
|
1029
|
-
} else {
|
|
1030
|
-
payload.value = trimmed;
|
|
1031
|
-
}
|
|
1032
|
-
return;
|
|
1033
|
-
} catch (_) {
|
|
1034
|
-
payload.issues.push({
|
|
1035
|
-
code: "invalid_format",
|
|
1036
|
-
format: "url",
|
|
1037
|
-
input: payload.value,
|
|
1038
|
-
inst,
|
|
1039
|
-
continue: !def.abort
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
};
|
|
1043
|
-
});
|
|
1044
|
-
var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
1045
|
-
$ZodType.init(inst, def);
|
|
1046
|
-
inst._zod.pattern = boolean;
|
|
1047
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1048
|
-
if (def.coerce)
|
|
1049
|
-
try {
|
|
1050
|
-
payload.value = Boolean(payload.value);
|
|
1051
|
-
} catch (_) {
|
|
1052
|
-
}
|
|
1053
|
-
const input = payload.value;
|
|
1054
|
-
if (typeof input === "boolean")
|
|
1055
|
-
return payload;
|
|
1056
|
-
payload.issues.push({
|
|
1057
|
-
expected: "boolean",
|
|
1058
|
-
code: "invalid_type",
|
|
1059
|
-
input,
|
|
1060
|
-
inst
|
|
1061
|
-
});
|
|
1062
|
-
return payload;
|
|
1063
|
-
};
|
|
1064
|
-
});
|
|
1065
|
-
var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
|
|
1066
|
-
$ZodType.init(inst, def);
|
|
1067
|
-
inst._zod.parse = (payload) => payload;
|
|
1068
|
-
});
|
|
1069
|
-
function handleArrayResult(result, final, index) {
|
|
1070
|
-
if (result.issues.length) {
|
|
1071
|
-
final.issues.push(...prefixIssues(index, result.issues));
|
|
1072
|
-
}
|
|
1073
|
-
final.value[index] = result.value;
|
|
1074
|
-
}
|
|
1075
|
-
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
1076
|
-
$ZodType.init(inst, def);
|
|
1077
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1078
|
-
const input = payload.value;
|
|
1079
|
-
if (!Array.isArray(input)) {
|
|
1080
|
-
payload.issues.push({
|
|
1081
|
-
expected: "array",
|
|
1082
|
-
code: "invalid_type",
|
|
1083
|
-
input,
|
|
1084
|
-
inst
|
|
1085
|
-
});
|
|
1086
|
-
return payload;
|
|
1087
|
-
}
|
|
1088
|
-
payload.value = Array(input.length);
|
|
1089
|
-
const proms = [];
|
|
1090
|
-
for (let i = 0; i < input.length; i++) {
|
|
1091
|
-
const item = input[i];
|
|
1092
|
-
const result = def.element._zod.run({
|
|
1093
|
-
value: item,
|
|
1094
|
-
issues: []
|
|
1095
|
-
}, ctx);
|
|
1096
|
-
if (result instanceof Promise) {
|
|
1097
|
-
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
1098
|
-
} else {
|
|
1099
|
-
handleArrayResult(result, payload, i);
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
if (proms.length) {
|
|
1103
|
-
return Promise.all(proms).then(() => payload);
|
|
1104
|
-
}
|
|
1105
|
-
return payload;
|
|
1106
|
-
};
|
|
1107
|
-
});
|
|
1108
|
-
function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
|
|
1109
|
-
const isPresent = key in input;
|
|
1110
|
-
if (result.issues.length) {
|
|
1111
|
-
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
1112
|
-
return;
|
|
1113
|
-
}
|
|
1114
|
-
final.issues.push(...prefixIssues(key, result.issues));
|
|
1115
|
-
}
|
|
1116
|
-
if (!isPresent && !isOptionalIn) {
|
|
1117
|
-
if (!result.issues.length) {
|
|
1118
|
-
final.issues.push({
|
|
1119
|
-
code: "invalid_type",
|
|
1120
|
-
expected: "nonoptional",
|
|
1121
|
-
input: void 0,
|
|
1122
|
-
path: [key]
|
|
1123
|
-
});
|
|
1124
|
-
}
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
if (result.value === void 0) {
|
|
1128
|
-
if (isPresent) {
|
|
1129
|
-
final.value[key] = void 0;
|
|
1130
|
-
}
|
|
1131
|
-
} else {
|
|
1132
|
-
final.value[key] = result.value;
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
function normalizeDef(def) {
|
|
1136
|
-
const keys = Object.keys(def.shape);
|
|
1137
|
-
for (const k of keys) {
|
|
1138
|
-
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
1139
|
-
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
const okeys = optionalKeys(def.shape);
|
|
1143
|
-
return {
|
|
1144
|
-
...def,
|
|
1145
|
-
keys,
|
|
1146
|
-
keySet: new Set(keys),
|
|
1147
|
-
numKeys: keys.length,
|
|
1148
|
-
optionalKeys: new Set(okeys)
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1152
|
-
const unrecognized = [];
|
|
1153
|
-
const keySet = def.keySet;
|
|
1154
|
-
const _catchall = def.catchall._zod;
|
|
1155
|
-
const t = _catchall.def.type;
|
|
1156
|
-
const isOptionalIn = _catchall.optin === "optional";
|
|
1157
|
-
const isOptionalOut = _catchall.optout === "optional";
|
|
1158
|
-
for (const key in input) {
|
|
1159
|
-
if (key === "__proto__")
|
|
1160
|
-
continue;
|
|
1161
|
-
if (keySet.has(key))
|
|
1162
|
-
continue;
|
|
1163
|
-
if (t === "never") {
|
|
1164
|
-
unrecognized.push(key);
|
|
1165
|
-
continue;
|
|
1166
|
-
}
|
|
1167
|
-
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1168
|
-
if (r instanceof Promise) {
|
|
1169
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
|
|
1170
|
-
} else {
|
|
1171
|
-
handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
if (unrecognized.length) {
|
|
1175
|
-
payload.issues.push({
|
|
1176
|
-
code: "unrecognized_keys",
|
|
1177
|
-
keys: unrecognized,
|
|
1178
|
-
input,
|
|
1179
|
-
inst
|
|
1180
|
-
});
|
|
1181
|
-
}
|
|
1182
|
-
if (!proms.length)
|
|
1183
|
-
return payload;
|
|
1184
|
-
return Promise.all(proms).then(() => {
|
|
1185
|
-
return payload;
|
|
1186
|
-
});
|
|
1187
|
-
}
|
|
1188
|
-
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
1189
|
-
$ZodType.init(inst, def);
|
|
1190
|
-
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1191
|
-
if (!desc?.get) {
|
|
1192
|
-
const sh = def.shape;
|
|
1193
|
-
Object.defineProperty(def, "shape", {
|
|
1194
|
-
get: () => {
|
|
1195
|
-
const newSh = { ...sh };
|
|
1196
|
-
Object.defineProperty(def, "shape", {
|
|
1197
|
-
value: newSh
|
|
1198
|
-
});
|
|
1199
|
-
return newSh;
|
|
1200
|
-
}
|
|
1201
|
-
});
|
|
1202
|
-
}
|
|
1203
|
-
const _normalized = cached(() => normalizeDef(def));
|
|
1204
|
-
defineLazy(inst._zod, "propValues", () => {
|
|
1205
|
-
const shape = def.shape;
|
|
1206
|
-
const propValues = {};
|
|
1207
|
-
for (const key in shape) {
|
|
1208
|
-
const field = shape[key]._zod;
|
|
1209
|
-
if (field.values) {
|
|
1210
|
-
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
1211
|
-
for (const v of field.values)
|
|
1212
|
-
propValues[key].add(v);
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
return propValues;
|
|
1216
|
-
});
|
|
1217
|
-
const isObject2 = isObject;
|
|
1218
|
-
const catchall = def.catchall;
|
|
1219
|
-
let value;
|
|
1220
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1221
|
-
value ?? (value = _normalized.value);
|
|
1222
|
-
const input = payload.value;
|
|
1223
|
-
if (!isObject2(input)) {
|
|
1224
|
-
payload.issues.push({
|
|
1225
|
-
expected: "object",
|
|
1226
|
-
code: "invalid_type",
|
|
1227
|
-
input,
|
|
1228
|
-
inst
|
|
1229
|
-
});
|
|
1230
|
-
return payload;
|
|
1231
|
-
}
|
|
1232
|
-
payload.value = {};
|
|
1233
|
-
const proms = [];
|
|
1234
|
-
const shape = value.shape;
|
|
1235
|
-
for (const key of value.keys) {
|
|
1236
|
-
const el = shape[key];
|
|
1237
|
-
const isOptionalIn = el._zod.optin === "optional";
|
|
1238
|
-
const isOptionalOut = el._zod.optout === "optional";
|
|
1239
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1240
|
-
if (r instanceof Promise) {
|
|
1241
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
|
|
1242
|
-
} else {
|
|
1243
|
-
handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
if (!catchall) {
|
|
1247
|
-
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1248
|
-
}
|
|
1249
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1250
|
-
};
|
|
1251
|
-
});
|
|
1252
|
-
function handleUnionResults(results, final, inst, ctx) {
|
|
1253
|
-
for (const result of results) {
|
|
1254
|
-
if (result.issues.length === 0) {
|
|
1255
|
-
final.value = result.value;
|
|
1256
|
-
return final;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
const nonaborted = results.filter((r) => !aborted(r));
|
|
1260
|
-
if (nonaborted.length === 1) {
|
|
1261
|
-
final.value = nonaborted[0].value;
|
|
1262
|
-
return nonaborted[0];
|
|
1263
|
-
}
|
|
1264
|
-
final.issues.push({
|
|
1265
|
-
code: "invalid_union",
|
|
1266
|
-
input: final.value,
|
|
1267
|
-
inst,
|
|
1268
|
-
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1269
|
-
});
|
|
1270
|
-
return final;
|
|
1271
|
-
}
|
|
1272
|
-
var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
1273
|
-
$ZodType.init(inst, def);
|
|
1274
|
-
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
1275
|
-
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
1276
|
-
defineLazy(inst._zod, "values", () => {
|
|
1277
|
-
if (def.options.every((o) => o._zod.values)) {
|
|
1278
|
-
return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1279
|
-
}
|
|
1280
|
-
return void 0;
|
|
1281
|
-
});
|
|
1282
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1283
|
-
if (def.options.every((o) => o._zod.pattern)) {
|
|
1284
|
-
const patterns = def.options.map((o) => o._zod.pattern);
|
|
1285
|
-
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
1286
|
-
}
|
|
1287
|
-
return void 0;
|
|
1288
|
-
});
|
|
1289
|
-
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
1290
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1291
|
-
if (first) {
|
|
1292
|
-
return first(payload, ctx);
|
|
1293
|
-
}
|
|
1294
|
-
let async = false;
|
|
1295
|
-
const results = [];
|
|
1296
|
-
for (const option of def.options) {
|
|
1297
|
-
const result = option._zod.run({
|
|
1298
|
-
value: payload.value,
|
|
1299
|
-
issues: []
|
|
1300
|
-
}, ctx);
|
|
1301
|
-
if (result instanceof Promise) {
|
|
1302
|
-
results.push(result);
|
|
1303
|
-
async = true;
|
|
1304
|
-
} else {
|
|
1305
|
-
if (result.issues.length === 0)
|
|
1306
|
-
return result;
|
|
1307
|
-
results.push(result);
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
if (!async)
|
|
1311
|
-
return handleUnionResults(results, payload, inst, ctx);
|
|
1312
|
-
return Promise.all(results).then((results2) => {
|
|
1313
|
-
return handleUnionResults(results2, payload, inst, ctx);
|
|
1314
|
-
});
|
|
1315
|
-
};
|
|
1316
|
-
});
|
|
1317
|
-
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
1318
|
-
$ZodType.init(inst, def);
|
|
1319
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1320
|
-
const input = payload.value;
|
|
1321
|
-
if (!isPlainObject(input)) {
|
|
1322
|
-
payload.issues.push({
|
|
1323
|
-
expected: "record",
|
|
1324
|
-
code: "invalid_type",
|
|
1325
|
-
input,
|
|
1326
|
-
inst
|
|
1327
|
-
});
|
|
1328
|
-
return payload;
|
|
1329
|
-
}
|
|
1330
|
-
const proms = [];
|
|
1331
|
-
const values = def.keyType._zod.values;
|
|
1332
|
-
if (values) {
|
|
1333
|
-
payload.value = {};
|
|
1334
|
-
const recordKeys = /* @__PURE__ */ new Set();
|
|
1335
|
-
for (const key of values) {
|
|
1336
|
-
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
1337
|
-
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
1338
|
-
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1339
|
-
if (keyResult instanceof Promise) {
|
|
1340
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1341
|
-
}
|
|
1342
|
-
if (keyResult.issues.length) {
|
|
1343
|
-
payload.issues.push({
|
|
1344
|
-
code: "invalid_key",
|
|
1345
|
-
origin: "record",
|
|
1346
|
-
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
1347
|
-
input: key,
|
|
1348
|
-
path: [key],
|
|
1349
|
-
inst
|
|
1350
|
-
});
|
|
1351
|
-
continue;
|
|
1352
|
-
}
|
|
1353
|
-
const outKey = keyResult.value;
|
|
1354
|
-
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1355
|
-
if (result instanceof Promise) {
|
|
1356
|
-
proms.push(result.then((result2) => {
|
|
1357
|
-
if (result2.issues.length) {
|
|
1358
|
-
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
1359
|
-
}
|
|
1360
|
-
payload.value[outKey] = result2.value;
|
|
1361
|
-
}));
|
|
1362
|
-
} else {
|
|
1363
|
-
if (result.issues.length) {
|
|
1364
|
-
payload.issues.push(...prefixIssues(key, result.issues));
|
|
1365
|
-
}
|
|
1366
|
-
payload.value[outKey] = result.value;
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
let unrecognized;
|
|
1371
|
-
for (const key in input) {
|
|
1372
|
-
if (!recordKeys.has(key)) {
|
|
1373
|
-
unrecognized = unrecognized ?? [];
|
|
1374
|
-
unrecognized.push(key);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
if (unrecognized && unrecognized.length > 0) {
|
|
1378
|
-
payload.issues.push({
|
|
1379
|
-
code: "unrecognized_keys",
|
|
1380
|
-
input,
|
|
1381
|
-
inst,
|
|
1382
|
-
keys: unrecognized
|
|
1383
|
-
});
|
|
1384
|
-
}
|
|
1385
|
-
} else {
|
|
1386
|
-
payload.value = {};
|
|
1387
|
-
for (const key of Reflect.ownKeys(input)) {
|
|
1388
|
-
if (key === "__proto__")
|
|
1389
|
-
continue;
|
|
1390
|
-
if (!Object.prototype.propertyIsEnumerable.call(input, key))
|
|
1391
|
-
continue;
|
|
1392
|
-
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1393
|
-
if (keyResult instanceof Promise) {
|
|
1394
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1395
|
-
}
|
|
1396
|
-
const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
|
|
1397
|
-
if (checkNumericKey) {
|
|
1398
|
-
const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
|
|
1399
|
-
if (retryResult instanceof Promise) {
|
|
1400
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
1401
|
-
}
|
|
1402
|
-
if (retryResult.issues.length === 0) {
|
|
1403
|
-
keyResult = retryResult;
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
if (keyResult.issues.length) {
|
|
1407
|
-
if (def.mode === "loose") {
|
|
1408
|
-
payload.value[key] = input[key];
|
|
1409
|
-
} else {
|
|
1410
|
-
payload.issues.push({
|
|
1411
|
-
code: "invalid_key",
|
|
1412
|
-
origin: "record",
|
|
1413
|
-
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
1414
|
-
input: key,
|
|
1415
|
-
path: [key],
|
|
1416
|
-
inst
|
|
1417
|
-
});
|
|
1418
|
-
}
|
|
1419
|
-
continue;
|
|
1420
|
-
}
|
|
1421
|
-
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1422
|
-
if (result instanceof Promise) {
|
|
1423
|
-
proms.push(result.then((result2) => {
|
|
1424
|
-
if (result2.issues.length) {
|
|
1425
|
-
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
1426
|
-
}
|
|
1427
|
-
payload.value[keyResult.value] = result2.value;
|
|
1428
|
-
}));
|
|
1429
|
-
} else {
|
|
1430
|
-
if (result.issues.length) {
|
|
1431
|
-
payload.issues.push(...prefixIssues(key, result.issues));
|
|
1432
|
-
}
|
|
1433
|
-
payload.value[keyResult.value] = result.value;
|
|
1434
|
-
}
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
if (proms.length) {
|
|
1438
|
-
return Promise.all(proms).then(() => payload);
|
|
1439
|
-
}
|
|
1440
|
-
return payload;
|
|
1441
|
-
};
|
|
1442
|
-
});
|
|
1443
|
-
var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
1444
|
-
$ZodType.init(inst, def);
|
|
1445
|
-
const values = getEnumValues(def.entries);
|
|
1446
|
-
const valuesSet = new Set(values);
|
|
1447
|
-
inst._zod.values = valuesSet;
|
|
1448
|
-
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
1449
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1450
|
-
const input = payload.value;
|
|
1451
|
-
if (valuesSet.has(input)) {
|
|
1452
|
-
return payload;
|
|
1453
|
-
}
|
|
1454
|
-
payload.issues.push({
|
|
1455
|
-
code: "invalid_value",
|
|
1456
|
-
values,
|
|
1457
|
-
input,
|
|
1458
|
-
inst
|
|
1459
|
-
});
|
|
1460
|
-
return payload;
|
|
1461
|
-
};
|
|
1462
|
-
});
|
|
1463
|
-
var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
1464
|
-
$ZodType.init(inst, def);
|
|
1465
|
-
if (def.values.length === 0) {
|
|
1466
|
-
throw new Error("Cannot create literal schema with no valid values");
|
|
1467
|
-
}
|
|
1468
|
-
const values = new Set(def.values);
|
|
1469
|
-
inst._zod.values = values;
|
|
1470
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
1471
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1472
|
-
const input = payload.value;
|
|
1473
|
-
if (values.has(input)) {
|
|
1474
|
-
return payload;
|
|
1475
|
-
}
|
|
1476
|
-
payload.issues.push({
|
|
1477
|
-
code: "invalid_value",
|
|
1478
|
-
values: def.values,
|
|
1479
|
-
input,
|
|
1480
|
-
inst
|
|
1481
|
-
});
|
|
1482
|
-
return payload;
|
|
1483
|
-
};
|
|
1484
|
-
});
|
|
1485
|
-
function handleOptionalResult(result, input) {
|
|
1486
|
-
if (input === void 0 && (result.issues.length || result.fallback)) {
|
|
1487
|
-
return { issues: [], value: void 0 };
|
|
1488
|
-
}
|
|
1489
|
-
return result;
|
|
1490
|
-
}
|
|
1491
|
-
var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
1492
|
-
$ZodType.init(inst, def);
|
|
1493
|
-
inst._zod.optin = "optional";
|
|
1494
|
-
inst._zod.optout = "optional";
|
|
1495
|
-
defineLazy(inst._zod, "values", () => {
|
|
1496
|
-
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
1497
|
-
});
|
|
1498
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1499
|
-
const pattern = def.innerType._zod.pattern;
|
|
1500
|
-
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
1501
|
-
});
|
|
1502
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1503
|
-
if (def.innerType._zod.optin === "optional") {
|
|
1504
|
-
const input = payload.value;
|
|
1505
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
1506
|
-
if (result instanceof Promise)
|
|
1507
|
-
return result.then((r) => handleOptionalResult(r, input));
|
|
1508
|
-
return handleOptionalResult(result, input);
|
|
1509
|
-
}
|
|
1510
|
-
if (payload.value === void 0) {
|
|
1511
|
-
return payload;
|
|
1512
|
-
}
|
|
1513
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1514
|
-
};
|
|
1515
|
-
});
|
|
1516
|
-
var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
1517
|
-
$ZodType.init(inst, def);
|
|
1518
|
-
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
1519
|
-
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
1520
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1521
|
-
const pattern = def.innerType._zod.pattern;
|
|
1522
|
-
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
1523
|
-
});
|
|
1524
|
-
defineLazy(inst._zod, "values", () => {
|
|
1525
|
-
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
1526
|
-
});
|
|
1527
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1528
|
-
if (payload.value === null)
|
|
1529
|
-
return payload;
|
|
1530
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1531
|
-
};
|
|
1532
|
-
});
|
|
1533
|
-
var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
1534
|
-
$ZodType.init(inst, def);
|
|
1535
|
-
inst._zod.optin = "optional";
|
|
1536
|
-
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
1537
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1538
|
-
if (ctx.direction === "backward") {
|
|
1539
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1540
|
-
}
|
|
1541
|
-
if (payload.value === void 0) {
|
|
1542
|
-
payload.value = def.defaultValue;
|
|
1543
|
-
return payload;
|
|
1544
|
-
}
|
|
1545
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
1546
|
-
if (result instanceof Promise) {
|
|
1547
|
-
return result.then((result2) => handleDefaultResult(result2, def));
|
|
1548
|
-
}
|
|
1549
|
-
return handleDefaultResult(result, def);
|
|
1550
|
-
};
|
|
1551
|
-
});
|
|
1552
|
-
function handleDefaultResult(payload, def) {
|
|
1553
|
-
if (payload.value === void 0) {
|
|
1554
|
-
payload.value = def.defaultValue;
|
|
1555
|
-
}
|
|
1556
|
-
return payload;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
1560
|
-
var _a2;
|
|
1561
|
-
var $ZodRegistry = class {
|
|
1562
|
-
constructor() {
|
|
1563
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
1564
|
-
this._idmap = /* @__PURE__ */ new Map();
|
|
1565
|
-
}
|
|
1566
|
-
add(schema, ..._meta) {
|
|
1567
|
-
const meta2 = _meta[0];
|
|
1568
|
-
this._map.set(schema, meta2);
|
|
1569
|
-
if (meta2 && typeof meta2 === "object" && "id" in meta2) {
|
|
1570
|
-
this._idmap.set(meta2.id, schema);
|
|
1571
|
-
}
|
|
1572
|
-
return this;
|
|
1573
|
-
}
|
|
1574
|
-
clear() {
|
|
1575
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
1576
|
-
this._idmap = /* @__PURE__ */ new Map();
|
|
1577
|
-
return this;
|
|
1578
|
-
}
|
|
1579
|
-
remove(schema) {
|
|
1580
|
-
const meta2 = this._map.get(schema);
|
|
1581
|
-
if (meta2 && typeof meta2 === "object" && "id" in meta2) {
|
|
1582
|
-
this._idmap.delete(meta2.id);
|
|
1583
|
-
}
|
|
1584
|
-
this._map.delete(schema);
|
|
1585
|
-
return this;
|
|
1586
|
-
}
|
|
1587
|
-
get(schema) {
|
|
1588
|
-
const p = schema._zod.parent;
|
|
1589
|
-
if (p) {
|
|
1590
|
-
const pm = { ...this.get(p) ?? {} };
|
|
1591
|
-
delete pm.id;
|
|
1592
|
-
const f = { ...pm, ...this._map.get(schema) };
|
|
1593
|
-
return Object.keys(f).length ? f : void 0;
|
|
1594
|
-
}
|
|
1595
|
-
return this._map.get(schema);
|
|
1596
|
-
}
|
|
1597
|
-
has(schema) {
|
|
1598
|
-
return this._map.has(schema);
|
|
1599
|
-
}
|
|
1600
|
-
};
|
|
1601
|
-
function registry() {
|
|
1602
|
-
return new $ZodRegistry();
|
|
1603
|
-
}
|
|
1604
|
-
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
1605
|
-
|
|
1606
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
1607
|
-
// @__NO_SIDE_EFFECTS__
|
|
1608
|
-
function _string(Class, params) {
|
|
1609
|
-
return new Class({
|
|
1610
|
-
type: "string",
|
|
1611
|
-
...normalizeParams(params)
|
|
1612
|
-
});
|
|
1613
|
-
}
|
|
1614
|
-
// @__NO_SIDE_EFFECTS__
|
|
1615
|
-
function _url(Class, params) {
|
|
1616
|
-
return new Class({
|
|
1617
|
-
type: "string",
|
|
1618
|
-
format: "url",
|
|
1619
|
-
check: "string_format",
|
|
1620
|
-
abort: false,
|
|
1621
|
-
...normalizeParams(params)
|
|
1622
|
-
});
|
|
1623
|
-
}
|
|
1624
|
-
// @__NO_SIDE_EFFECTS__
|
|
1625
|
-
function _boolean(Class, params) {
|
|
1626
|
-
return new Class({
|
|
1627
|
-
type: "boolean",
|
|
1628
|
-
...normalizeParams(params)
|
|
1629
|
-
});
|
|
1630
|
-
}
|
|
1631
|
-
// @__NO_SIDE_EFFECTS__
|
|
1632
|
-
function _any(Class) {
|
|
1633
|
-
return new Class({
|
|
1634
|
-
type: "any"
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
// @__NO_SIDE_EFFECTS__
|
|
1638
|
-
function _length(length, params) {
|
|
1639
|
-
return new $ZodCheckLengthEquals({
|
|
1640
|
-
check: "length_equals",
|
|
1641
|
-
...normalizeParams(params),
|
|
1642
|
-
length
|
|
1643
|
-
});
|
|
1644
|
-
}
|
|
1645
|
-
// @__NO_SIDE_EFFECTS__
|
|
1646
|
-
function _regex(pattern, params) {
|
|
1647
|
-
return new $ZodCheckRegex({
|
|
1648
|
-
check: "string_format",
|
|
1649
|
-
format: "regex",
|
|
1650
|
-
...normalizeParams(params),
|
|
1651
|
-
pattern
|
|
1652
|
-
});
|
|
1653
|
-
}
|
|
1654
|
-
// @__NO_SIDE_EFFECTS__
|
|
1655
|
-
function _overwrite(tx) {
|
|
1656
|
-
return new $ZodCheckOverwrite({
|
|
1657
|
-
check: "overwrite",
|
|
1658
|
-
tx
|
|
1659
|
-
});
|
|
1660
|
-
}
|
|
1661
|
-
// @__NO_SIDE_EFFECTS__
|
|
1662
|
-
function _trim() {
|
|
1663
|
-
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
1664
|
-
}
|
|
1665
|
-
// @__NO_SIDE_EFFECTS__
|
|
1666
|
-
function _toLowerCase() {
|
|
1667
|
-
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
|
|
1671
|
-
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
1672
|
-
if (!inst._zod)
|
|
1673
|
-
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1674
|
-
$ZodType.init(inst, def);
|
|
1675
|
-
inst.def = def;
|
|
1676
|
-
inst.type = def.type;
|
|
1677
|
-
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
1678
|
-
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
1679
|
-
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
1680
|
-
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
1681
|
-
inst.check = (...checks) => {
|
|
1682
|
-
return inst.clone({
|
|
1683
|
-
...def,
|
|
1684
|
-
checks: [
|
|
1685
|
-
...def.checks ?? [],
|
|
1686
|
-
...checks.map((ch) => typeof ch === "function" ? {
|
|
1687
|
-
_zod: { check: ch, def: { check: "custom" }, onattach: [] }
|
|
1688
|
-
} : ch)
|
|
1689
|
-
]
|
|
1690
|
-
}, { parent: true });
|
|
1691
|
-
};
|
|
1692
|
-
inst.with = inst.check;
|
|
1693
|
-
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
1694
|
-
inst.brand = () => inst;
|
|
1695
|
-
inst.register = ((reg, meta2) => {
|
|
1696
|
-
reg.add(inst, meta2);
|
|
1697
|
-
return inst;
|
|
1698
|
-
});
|
|
1699
|
-
inst.apply = (fn) => fn(inst);
|
|
1700
|
-
});
|
|
1701
|
-
var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
1702
|
-
$ZodString.init(inst, def);
|
|
1703
|
-
ZodMiniType.init(inst, def);
|
|
1704
|
-
});
|
|
1705
|
-
// @__NO_SIDE_EFFECTS__
|
|
1706
|
-
function string2(params) {
|
|
1707
|
-
return _string(ZodMiniString, params);
|
|
1708
|
-
}
|
|
1709
|
-
var ZodMiniStringFormat = /* @__PURE__ */ $constructor("ZodMiniStringFormat", (inst, def) => {
|
|
1710
|
-
$ZodStringFormat.init(inst, def);
|
|
1711
|
-
ZodMiniString.init(inst, def);
|
|
1712
|
-
});
|
|
1713
|
-
var ZodMiniURL = /* @__PURE__ */ $constructor("ZodMiniURL", (inst, def) => {
|
|
1714
|
-
$ZodURL.init(inst, def);
|
|
1715
|
-
ZodMiniStringFormat.init(inst, def);
|
|
1716
|
-
});
|
|
1717
|
-
// @__NO_SIDE_EFFECTS__
|
|
1718
|
-
function url(params) {
|
|
1719
|
-
return _url(ZodMiniURL, params);
|
|
1720
|
-
}
|
|
1721
|
-
var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
1722
|
-
$ZodBoolean.init(inst, def);
|
|
1723
|
-
ZodMiniType.init(inst, def);
|
|
1724
|
-
});
|
|
1725
|
-
// @__NO_SIDE_EFFECTS__
|
|
1726
|
-
function boolean2(params) {
|
|
1727
|
-
return _boolean(ZodMiniBoolean, params);
|
|
1728
|
-
}
|
|
1729
|
-
var ZodMiniAny = /* @__PURE__ */ $constructor("ZodMiniAny", (inst, def) => {
|
|
1730
|
-
$ZodAny.init(inst, def);
|
|
1731
|
-
ZodMiniType.init(inst, def);
|
|
1732
|
-
});
|
|
1733
|
-
// @__NO_SIDE_EFFECTS__
|
|
1734
|
-
function any() {
|
|
1735
|
-
return _any(ZodMiniAny);
|
|
1736
|
-
}
|
|
1737
|
-
var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
1738
|
-
$ZodArray.init(inst, def);
|
|
1739
|
-
ZodMiniType.init(inst, def);
|
|
1740
|
-
});
|
|
1741
|
-
// @__NO_SIDE_EFFECTS__
|
|
1742
|
-
function array(element, params) {
|
|
1743
|
-
return new ZodMiniArray({
|
|
1744
|
-
type: "array",
|
|
1745
|
-
element,
|
|
1746
|
-
...normalizeParams(params)
|
|
1747
|
-
});
|
|
1748
|
-
}
|
|
1749
|
-
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
1750
|
-
$ZodObject.init(inst, def);
|
|
1751
|
-
ZodMiniType.init(inst, def);
|
|
1752
|
-
defineLazy(inst, "shape", () => def.shape);
|
|
1753
|
-
});
|
|
1754
|
-
// @__NO_SIDE_EFFECTS__
|
|
1755
|
-
function object(shape, params) {
|
|
1756
|
-
const def = {
|
|
1757
|
-
type: "object",
|
|
1758
|
-
shape: shape ?? {},
|
|
1759
|
-
...normalizeParams(params)
|
|
1760
|
-
};
|
|
1761
|
-
return new ZodMiniObject(def);
|
|
1762
|
-
}
|
|
1763
|
-
var ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
1764
|
-
$ZodUnion.init(inst, def);
|
|
1765
|
-
ZodMiniType.init(inst, def);
|
|
1766
|
-
});
|
|
1767
|
-
// @__NO_SIDE_EFFECTS__
|
|
1768
|
-
function union(options, params) {
|
|
1769
|
-
return new ZodMiniUnion({
|
|
1770
|
-
type: "union",
|
|
1771
|
-
options,
|
|
1772
|
-
...normalizeParams(params)
|
|
1773
|
-
});
|
|
1774
|
-
}
|
|
1775
|
-
var ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
1776
|
-
$ZodRecord.init(inst, def);
|
|
1777
|
-
ZodMiniType.init(inst, def);
|
|
1778
|
-
});
|
|
1779
|
-
// @__NO_SIDE_EFFECTS__
|
|
1780
|
-
function record(keyType, valueType, params) {
|
|
1781
|
-
if (!valueType || !valueType._zod) {
|
|
1782
|
-
return new ZodMiniRecord({
|
|
1783
|
-
type: "record",
|
|
1784
|
-
keyType: /* @__PURE__ */ string2(),
|
|
1785
|
-
valueType: keyType,
|
|
1786
|
-
...normalizeParams(valueType)
|
|
1787
|
-
});
|
|
1788
|
-
}
|
|
1789
|
-
return new ZodMiniRecord({
|
|
1790
|
-
type: "record",
|
|
1791
|
-
keyType,
|
|
1792
|
-
valueType,
|
|
1793
|
-
...normalizeParams(params)
|
|
1794
|
-
});
|
|
1795
|
-
}
|
|
1796
|
-
var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
1797
|
-
$ZodEnum.init(inst, def);
|
|
1798
|
-
ZodMiniType.init(inst, def);
|
|
1799
|
-
inst.options = Object.values(def.entries);
|
|
1800
|
-
});
|
|
1801
|
-
// @__NO_SIDE_EFFECTS__
|
|
1802
|
-
function _enum(values, params) {
|
|
1803
|
-
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
1804
|
-
return new ZodMiniEnum({
|
|
1805
|
-
type: "enum",
|
|
1806
|
-
entries,
|
|
1807
|
-
...normalizeParams(params)
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
var ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
1811
|
-
$ZodLiteral.init(inst, def);
|
|
1812
|
-
ZodMiniType.init(inst, def);
|
|
1813
|
-
});
|
|
1814
|
-
// @__NO_SIDE_EFFECTS__
|
|
1815
|
-
function literal(value, params) {
|
|
1816
|
-
return new ZodMiniLiteral({
|
|
1817
|
-
type: "literal",
|
|
1818
|
-
values: Array.isArray(value) ? value : [value],
|
|
1819
|
-
...normalizeParams(params)
|
|
1820
|
-
});
|
|
1821
|
-
}
|
|
1822
|
-
var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
1823
|
-
$ZodOptional.init(inst, def);
|
|
1824
|
-
ZodMiniType.init(inst, def);
|
|
1825
|
-
});
|
|
1826
|
-
// @__NO_SIDE_EFFECTS__
|
|
1827
|
-
function optional(innerType) {
|
|
1828
|
-
return new ZodMiniOptional({
|
|
1829
|
-
type: "optional",
|
|
1830
|
-
innerType
|
|
1831
|
-
});
|
|
1832
|
-
}
|
|
1833
|
-
var ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
1834
|
-
$ZodNullable.init(inst, def);
|
|
1835
|
-
ZodMiniType.init(inst, def);
|
|
1836
|
-
});
|
|
1837
|
-
// @__NO_SIDE_EFFECTS__
|
|
1838
|
-
function nullable(innerType) {
|
|
1839
|
-
return new ZodMiniNullable({
|
|
1840
|
-
type: "nullable",
|
|
1841
|
-
innerType
|
|
1842
|
-
});
|
|
1843
|
-
}
|
|
1844
|
-
var ZodMiniDefault = /* @__PURE__ */ $constructor("ZodMiniDefault", (inst, def) => {
|
|
1845
|
-
$ZodDefault.init(inst, def);
|
|
1846
|
-
ZodMiniType.init(inst, def);
|
|
1847
|
-
});
|
|
1848
|
-
// @__NO_SIDE_EFFECTS__
|
|
1849
|
-
function _default(innerType, defaultValue) {
|
|
1850
|
-
return new ZodMiniDefault({
|
|
1851
|
-
type: "default",
|
|
1852
|
-
innerType,
|
|
1853
|
-
get defaultValue() {
|
|
1854
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
1855
|
-
}
|
|
1856
|
-
});
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
// ../config/src/constants.ts
|
|
1860
|
-
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
1861
|
-
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
1862
|
-
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
1863
|
-
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
1864
|
-
var STORM_DEFAULT_RELEASE_BANNER = "https://public.storm-cdn.com/storm-software/media/banner-1280x320.gif";
|
|
1865
|
-
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
1866
|
-
var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
|
|
1867
|
-
|
|
1868
|
-
// ../config/src/schema.ts
|
|
1869
|
-
var schemaRegistry = registry();
|
|
1870
|
-
var colorSchema = string2().check(
|
|
1871
|
-
_length(7),
|
|
1872
|
-
_toLowerCase(),
|
|
1873
|
-
_regex(/^#([0-9a-f]{3}){1,2}$/i),
|
|
1874
|
-
_trim()
|
|
1875
|
-
);
|
|
1876
|
-
schemaRegistry.add(colorSchema, {
|
|
1877
|
-
description: "A base schema for describing the format of colors"
|
|
1878
|
-
});
|
|
1879
|
-
var darkColorSchema = _default(colorSchema, "#1e2124");
|
|
1880
|
-
schemaRegistry.add(darkColorSchema, {
|
|
1881
|
-
description: "The dark background color of the workspace"
|
|
1882
|
-
});
|
|
1883
|
-
var lightColorSchema = _default(colorSchema, "#cbd5e1");
|
|
1884
|
-
schemaRegistry.add(lightColorSchema, {
|
|
1885
|
-
description: "The light background color of the workspace"
|
|
1886
|
-
});
|
|
1887
|
-
var brandColorSchema = _default(colorSchema, "#1fb2a6");
|
|
1888
|
-
schemaRegistry.add(brandColorSchema, {
|
|
1889
|
-
description: "The primary brand specific color of the workspace"
|
|
1890
|
-
});
|
|
1891
|
-
var alternateColorSchema = optional(colorSchema);
|
|
1892
|
-
schemaRegistry.add(alternateColorSchema, {
|
|
1893
|
-
description: "The alternate brand specific color of the workspace"
|
|
1894
|
-
});
|
|
1895
|
-
var accentColorSchema = optional(colorSchema);
|
|
1896
|
-
schemaRegistry.add(accentColorSchema, {
|
|
1897
|
-
description: "The secondary brand specific color of the workspace"
|
|
1898
|
-
});
|
|
1899
|
-
var linkColorSchema = _default(colorSchema, "#3fa6ff");
|
|
1900
|
-
schemaRegistry.add(linkColorSchema, {
|
|
1901
|
-
description: "The color used to display hyperlink text"
|
|
1902
|
-
});
|
|
1903
|
-
var discoveryColorSchema = _default(colorSchema, "#818cf8");
|
|
1904
|
-
schemaRegistry.add(discoveryColorSchema, {
|
|
1905
|
-
description: "The second brand specific color of the workspace"
|
|
1906
|
-
});
|
|
1907
|
-
var successColorSchema = _default(colorSchema, "#45b27e");
|
|
1908
|
-
schemaRegistry.add(successColorSchema, {
|
|
1909
|
-
description: "The success color of the workspace"
|
|
1910
|
-
});
|
|
1911
|
-
var infoColorSchema = _default(colorSchema, "#38bdf8");
|
|
1912
|
-
schemaRegistry.add(infoColorSchema, {
|
|
1913
|
-
description: "The informational color of the workspace"
|
|
1914
|
-
});
|
|
1915
|
-
var debugColorSchema = _default(colorSchema, "#8afafc");
|
|
1916
|
-
schemaRegistry.add(debugColorSchema, {
|
|
1917
|
-
description: "The debug color of the workspace"
|
|
1918
|
-
});
|
|
1919
|
-
var warningColorSchema = _default(colorSchema, "#f3d371");
|
|
1920
|
-
schemaRegistry.add(warningColorSchema, {
|
|
1921
|
-
description: "The warning color of the workspace"
|
|
1922
|
-
});
|
|
1923
|
-
var dangerColorSchema = _default(colorSchema, "#d8314a");
|
|
1924
|
-
schemaRegistry.add(dangerColorSchema, {
|
|
1925
|
-
description: "The danger color of the workspace"
|
|
1926
|
-
});
|
|
1927
|
-
var fatalColorSchema = optional(colorSchema);
|
|
1928
|
-
schemaRegistry.add(fatalColorSchema, {
|
|
1929
|
-
description: "The fatal color of the workspace"
|
|
1930
|
-
});
|
|
1931
|
-
var performanceColorSchema = _default(colorSchema, "#80fd74");
|
|
1932
|
-
schemaRegistry.add(performanceColorSchema, {
|
|
1933
|
-
description: "The performance color of the workspace"
|
|
1934
|
-
});
|
|
1935
|
-
var positiveColorSchema = _default(colorSchema, "#4ade80");
|
|
1936
|
-
schemaRegistry.add(positiveColorSchema, {
|
|
1937
|
-
description: "The positive number color of the workspace"
|
|
1938
|
-
});
|
|
1939
|
-
var negativeColorSchema = _default(colorSchema, "#ef4444");
|
|
1940
|
-
schemaRegistry.add(negativeColorSchema, {
|
|
1941
|
-
description: "The negative number color of the workspace"
|
|
1942
|
-
});
|
|
1943
|
-
var gradientStopsSchema = optional(array(colorSchema));
|
|
1944
|
-
schemaRegistry.add(gradientStopsSchema, {
|
|
1945
|
-
description: "The color stops for the base gradient color pattern used in the workspace"
|
|
1946
|
-
});
|
|
1947
|
-
var darkColorsSchema = object({
|
|
1948
|
-
foreground: lightColorSchema,
|
|
1949
|
-
background: darkColorSchema,
|
|
1950
|
-
brand: brandColorSchema,
|
|
1951
|
-
alternate: alternateColorSchema,
|
|
1952
|
-
accent: accentColorSchema,
|
|
1953
|
-
link: linkColorSchema,
|
|
1954
|
-
discovery: discoveryColorSchema,
|
|
1955
|
-
success: successColorSchema,
|
|
1956
|
-
info: infoColorSchema,
|
|
1957
|
-
debug: debugColorSchema,
|
|
1958
|
-
warning: warningColorSchema,
|
|
1959
|
-
danger: dangerColorSchema,
|
|
1960
|
-
fatal: fatalColorSchema,
|
|
1961
|
-
performance: performanceColorSchema,
|
|
1962
|
-
positive: positiveColorSchema,
|
|
1963
|
-
negative: negativeColorSchema,
|
|
1964
|
-
gradient: gradientStopsSchema
|
|
1965
|
-
});
|
|
1966
|
-
var lightColorsSchema = object({
|
|
1967
|
-
foreground: darkColorSchema,
|
|
1968
|
-
background: lightColorSchema,
|
|
1969
|
-
brand: brandColorSchema,
|
|
1970
|
-
alternate: alternateColorSchema,
|
|
1971
|
-
accent: accentColorSchema,
|
|
1972
|
-
link: linkColorSchema,
|
|
1973
|
-
discovery: discoveryColorSchema,
|
|
1974
|
-
success: successColorSchema,
|
|
1975
|
-
info: infoColorSchema,
|
|
1976
|
-
debug: debugColorSchema,
|
|
1977
|
-
warning: warningColorSchema,
|
|
1978
|
-
danger: dangerColorSchema,
|
|
1979
|
-
fatal: fatalColorSchema,
|
|
1980
|
-
performance: performanceColorSchema,
|
|
1981
|
-
positive: positiveColorSchema,
|
|
1982
|
-
negative: negativeColorSchema,
|
|
1983
|
-
gradient: gradientStopsSchema
|
|
1984
|
-
});
|
|
1985
|
-
var multiColorsSchema = object({
|
|
1986
|
-
dark: darkColorsSchema,
|
|
1987
|
-
light: lightColorsSchema
|
|
1988
|
-
});
|
|
1989
|
-
var singleColorsSchema = object({
|
|
1990
|
-
dark: darkColorSchema,
|
|
1991
|
-
light: lightColorSchema,
|
|
1992
|
-
brand: brandColorSchema,
|
|
1993
|
-
alternate: alternateColorSchema,
|
|
1994
|
-
accent: accentColorSchema,
|
|
1995
|
-
link: linkColorSchema,
|
|
1996
|
-
discovery: discoveryColorSchema,
|
|
1997
|
-
success: successColorSchema,
|
|
1998
|
-
info: infoColorSchema,
|
|
1999
|
-
debug: debugColorSchema,
|
|
2000
|
-
warning: warningColorSchema,
|
|
2001
|
-
danger: dangerColorSchema,
|
|
2002
|
-
fatal: fatalColorSchema,
|
|
2003
|
-
performance: performanceColorSchema,
|
|
2004
|
-
positive: positiveColorSchema,
|
|
2005
|
-
negative: negativeColorSchema,
|
|
2006
|
-
gradient: gradientStopsSchema
|
|
2007
|
-
});
|
|
2008
|
-
var registryUrlConfigSchema = optional(url());
|
|
2009
|
-
schemaRegistry.add(registryUrlConfigSchema, {
|
|
2010
|
-
description: "A remote registry URL used to publish distributable packages"
|
|
2011
|
-
});
|
|
2012
|
-
var registrySchema = _default(
|
|
2013
|
-
object({
|
|
2014
|
-
github: registryUrlConfigSchema,
|
|
2015
|
-
npm: registryUrlConfigSchema,
|
|
2016
|
-
cargo: registryUrlConfigSchema,
|
|
2017
|
-
cyclone: registryUrlConfigSchema,
|
|
2018
|
-
container: registryUrlConfigSchema
|
|
2019
|
-
}),
|
|
2020
|
-
{}
|
|
2021
|
-
);
|
|
2022
|
-
schemaRegistry.add(registrySchema, {
|
|
2023
|
-
description: "A list of remote registry URLs used by Storm Software"
|
|
2024
|
-
});
|
|
2025
|
-
var colorsSchema = union([singleColorsSchema, multiColorsSchema]);
|
|
2026
|
-
schemaRegistry.add(colorsSchema, {
|
|
2027
|
-
description: "Colors used for various workspace elements"
|
|
2028
|
-
});
|
|
2029
|
-
var themeColorsSchema = record(
|
|
2030
|
-
union([union([literal("base"), string2()]), string2()]),
|
|
2031
|
-
colorsSchema
|
|
2032
|
-
);
|
|
2033
|
-
schemaRegistry.add(themeColorsSchema, {
|
|
2034
|
-
description: "Storm theme config values used for styling various package elements"
|
|
2035
|
-
});
|
|
2036
|
-
var extendsSchema = optional(
|
|
2037
|
-
union([string2().check(_trim()), array(string2().check(_trim()))])
|
|
2038
|
-
);
|
|
2039
|
-
schemaRegistry.add(extendsSchema, {
|
|
2040
|
-
description: "The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
2041
|
-
});
|
|
2042
|
-
var workspaceBotNameSchema = string2().check(_trim());
|
|
2043
|
-
schemaRegistry.add(workspaceBotNameSchema, {
|
|
2044
|
-
description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
2045
|
-
});
|
|
2046
|
-
var workspaceBotEmailSchema = string2().check(_trim());
|
|
2047
|
-
schemaRegistry.add(workspaceBotEmailSchema, {
|
|
2048
|
-
description: "The email of the workspace bot"
|
|
2049
|
-
});
|
|
2050
|
-
var workspaceBotSchema = object({
|
|
2051
|
-
name: workspaceBotNameSchema,
|
|
2052
|
-
email: workspaceBotEmailSchema
|
|
2053
|
-
});
|
|
2054
|
-
schemaRegistry.add(workspaceBotSchema, {
|
|
2055
|
-
description: "The workspace's bot user's config used to automated various operations tasks"
|
|
2056
|
-
});
|
|
2057
|
-
var workspaceReleaseBannerUrlSchema = optional(
|
|
2058
|
-
string2().check(_trim(), url())
|
|
2059
|
-
);
|
|
2060
|
-
schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
|
|
2061
|
-
description: "A URL to a banner image used to display the workspace's release"
|
|
2062
|
-
});
|
|
2063
|
-
var workspaceReleaseBannerAltSchema = _default(
|
|
2064
|
-
string2().check(_trim()),
|
|
2065
|
-
STORM_DEFAULT_BANNER_ALT
|
|
2066
|
-
);
|
|
2067
|
-
schemaRegistry.add(workspaceReleaseBannerAltSchema, {
|
|
2068
|
-
description: "The alt text for the workspace's release banner image"
|
|
2069
|
-
});
|
|
2070
|
-
var workspaceReleaseBannerSchema = object({
|
|
2071
|
-
url: workspaceReleaseBannerUrlSchema,
|
|
2072
|
-
alt: workspaceReleaseBannerAltSchema
|
|
2073
|
-
});
|
|
2074
|
-
schemaRegistry.add(workspaceReleaseBannerSchema, {
|
|
2075
|
-
description: "The workspace's banner image used during the release process"
|
|
2076
|
-
});
|
|
2077
|
-
var workspaceReleaseHeaderSchema = optional(
|
|
2078
|
-
string2().check(_trim())
|
|
2079
|
-
);
|
|
2080
|
-
schemaRegistry.add(workspaceReleaseHeaderSchema, {
|
|
2081
|
-
description: "A header message appended to the start of the workspace's release notes"
|
|
2082
|
-
});
|
|
2083
|
-
var workspaceReleaseFooterSchema = optional(
|
|
2084
|
-
string2().check(_trim())
|
|
2085
|
-
);
|
|
2086
|
-
schemaRegistry.add(workspaceReleaseFooterSchema, {
|
|
2087
|
-
description: "A footer message appended to the end of the workspace's release notes"
|
|
2088
|
-
});
|
|
2089
|
-
var workspaceReleaseSchema = object({
|
|
2090
|
-
banner: union([
|
|
2091
|
-
workspaceReleaseBannerSchema,
|
|
2092
|
-
string2().check(_trim(), url())
|
|
2093
|
-
]),
|
|
2094
|
-
header: workspaceReleaseHeaderSchema,
|
|
2095
|
-
footer: workspaceReleaseFooterSchema
|
|
2096
|
-
});
|
|
2097
|
-
schemaRegistry.add(workspaceReleaseSchema, {
|
|
2098
|
-
description: "The workspace's release config used during the release process"
|
|
2099
|
-
});
|
|
2100
|
-
var workspaceSocialsTwitterSchema = optional(
|
|
2101
|
-
string2().check(_trim())
|
|
2102
|
-
);
|
|
2103
|
-
schemaRegistry.add(workspaceSocialsTwitterSchema, {
|
|
2104
|
-
description: "A Twitter/X account associated with the organization/project"
|
|
2105
|
-
});
|
|
2106
|
-
var workspaceSocialsDiscordSchema = optional(
|
|
2107
|
-
string2().check(_trim())
|
|
2108
|
-
);
|
|
2109
|
-
schemaRegistry.add(workspaceSocialsDiscordSchema, {
|
|
2110
|
-
description: "A Discord account associated with the organization/project"
|
|
2111
|
-
});
|
|
2112
|
-
var workspaceSocialsTelegramSchema = optional(
|
|
2113
|
-
string2().check(_trim())
|
|
2114
|
-
);
|
|
2115
|
-
schemaRegistry.add(workspaceSocialsTelegramSchema, {
|
|
2116
|
-
description: "A Telegram account associated with the organization/project"
|
|
2117
|
-
});
|
|
2118
|
-
var workspaceSocialsSlackSchema = optional(
|
|
2119
|
-
string2().check(_trim())
|
|
2120
|
-
);
|
|
2121
|
-
schemaRegistry.add(workspaceSocialsSlackSchema, {
|
|
2122
|
-
description: "A Slack account associated with the organization/project"
|
|
2123
|
-
});
|
|
2124
|
-
var workspaceSocialsMediumSchema = optional(
|
|
2125
|
-
string2().check(_trim())
|
|
2126
|
-
);
|
|
2127
|
-
schemaRegistry.add(workspaceSocialsMediumSchema, {
|
|
2128
|
-
description: "A Medium account associated with the organization/project"
|
|
2129
|
-
});
|
|
2130
|
-
var workspaceSocialsGithubSchema = optional(
|
|
2131
|
-
string2().check(_trim())
|
|
2132
|
-
);
|
|
2133
|
-
schemaRegistry.add(workspaceSocialsGithubSchema, {
|
|
2134
|
-
description: "A GitHub account associated with the organization/project"
|
|
2135
|
-
});
|
|
2136
|
-
var workspaceSocialsSchema = object({
|
|
2137
|
-
twitter: workspaceSocialsTwitterSchema,
|
|
2138
|
-
discord: workspaceSocialsDiscordSchema,
|
|
2139
|
-
telegram: workspaceSocialsTelegramSchema,
|
|
2140
|
-
slack: workspaceSocialsSlackSchema,
|
|
2141
|
-
medium: workspaceSocialsMediumSchema,
|
|
2142
|
-
github: workspaceSocialsGithubSchema
|
|
2143
|
-
});
|
|
2144
|
-
schemaRegistry.add(workspaceSocialsSchema, {
|
|
2145
|
-
description: "The workspace's account config used to store various social media links"
|
|
2146
|
-
});
|
|
2147
|
-
var workspaceDirectoryCacheSchema = optional(
|
|
2148
|
-
string2().check(_trim())
|
|
2149
|
-
);
|
|
2150
|
-
schemaRegistry.add(workspaceDirectoryCacheSchema, {
|
|
2151
|
-
description: "The directory used to store the environment's cached file data"
|
|
2152
|
-
});
|
|
2153
|
-
var workspaceDirectoryDataSchema = optional(
|
|
2154
|
-
string2().check(_trim())
|
|
2155
|
-
);
|
|
2156
|
-
schemaRegistry.add(workspaceDirectoryDataSchema, {
|
|
2157
|
-
description: "The directory used to store the environment's data files"
|
|
2158
|
-
});
|
|
2159
|
-
var workspaceDirectoryConfigSchema = optional(
|
|
2160
|
-
string2().check(_trim())
|
|
2161
|
-
);
|
|
2162
|
-
schemaRegistry.add(workspaceDirectoryConfigSchema, {
|
|
2163
|
-
description: "The directory used to store the environment's configuration files"
|
|
2164
|
-
});
|
|
2165
|
-
var workspaceDirectoryTempSchema = optional(
|
|
2166
|
-
string2().check(_trim())
|
|
2167
|
-
);
|
|
2168
|
-
schemaRegistry.add(workspaceDirectoryTempSchema, {
|
|
2169
|
-
description: "The directory used to store the environment's temp files"
|
|
2170
|
-
});
|
|
2171
|
-
var workspaceDirectoryLogSchema = optional(
|
|
2172
|
-
string2().check(_trim())
|
|
2173
|
-
);
|
|
2174
|
-
schemaRegistry.add(workspaceDirectoryLogSchema, {
|
|
2175
|
-
description: "The directory used to store the environment's log files"
|
|
2176
|
-
});
|
|
2177
|
-
var workspaceDirectoryBuildSchema = _default(
|
|
2178
|
-
string2().check(_trim()),
|
|
2179
|
-
"dist"
|
|
2180
|
-
);
|
|
2181
|
-
schemaRegistry.add(workspaceDirectoryBuildSchema, {
|
|
2182
|
-
description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
2183
|
-
});
|
|
2184
|
-
var workspaceDirectorySchema = object({
|
|
2185
|
-
cache: workspaceDirectoryCacheSchema,
|
|
2186
|
-
data: workspaceDirectoryDataSchema,
|
|
2187
|
-
config: workspaceDirectoryConfigSchema,
|
|
2188
|
-
temp: workspaceDirectoryTempSchema,
|
|
2189
|
-
log: workspaceDirectoryLogSchema,
|
|
2190
|
-
build: workspaceDirectoryBuildSchema
|
|
2191
|
-
});
|
|
2192
|
-
schemaRegistry.add(workspaceDirectorySchema, {
|
|
2193
|
-
description: "Various directories used by the workspace to store data, cache, and configuration files"
|
|
2194
|
-
});
|
|
2195
|
-
var variantSchema = _default(
|
|
2196
|
-
_enum(["minimal", "monorepo"]),
|
|
2197
|
-
"monorepo"
|
|
2198
|
-
);
|
|
2199
|
-
schemaRegistry.add(variantSchema, {
|
|
2200
|
-
description: "The variant of the workspace. This can be used to enable or disable certain features or configurations."
|
|
2201
|
-
});
|
|
2202
|
-
var errorCodesFileSchema = _default(
|
|
2203
|
-
string2().check(_trim()),
|
|
2204
|
-
STORM_DEFAULT_ERROR_CODES_FILE
|
|
2205
|
-
);
|
|
2206
|
-
schemaRegistry.add(errorCodesFileSchema, {
|
|
2207
|
-
description: "The path to the workspace's error codes JSON file"
|
|
2208
|
-
});
|
|
2209
|
-
var errorUrlSchema = optional(url());
|
|
2210
|
-
schemaRegistry.add(errorUrlSchema, {
|
|
2211
|
-
description: "A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
2212
|
-
});
|
|
2213
|
-
var errorSchema = object({
|
|
2214
|
-
codesFile: errorCodesFileSchema,
|
|
2215
|
-
url: errorUrlSchema
|
|
2216
|
-
});
|
|
2217
|
-
schemaRegistry.add(errorSchema, {
|
|
2218
|
-
description: "The workspace's error config used when creating error details during a system error"
|
|
2219
|
-
});
|
|
2220
|
-
var organizationNameSchema = optional(
|
|
2221
|
-
string2().check(_trim(), _toLowerCase())
|
|
2222
|
-
);
|
|
2223
|
-
schemaRegistry.add(organizationNameSchema, {
|
|
2224
|
-
description: "The name of the organization"
|
|
2225
|
-
});
|
|
2226
|
-
var organizationDescriptionSchema = optional(
|
|
2227
|
-
string2().check(_trim())
|
|
2228
|
-
);
|
|
2229
|
-
schemaRegistry.add(organizationDescriptionSchema, {
|
|
2230
|
-
description: "A description of the organization"
|
|
2231
|
-
});
|
|
2232
|
-
var organizationLogoSchema = optional(url());
|
|
2233
|
-
schemaRegistry.add(organizationLogoSchema, {
|
|
2234
|
-
description: "A URL to the organization's logo image"
|
|
2235
|
-
});
|
|
2236
|
-
var organizationIconSchema = optional(url());
|
|
2237
|
-
schemaRegistry.add(organizationIconSchema, {
|
|
2238
|
-
description: "A URL to the organization's icon image"
|
|
2239
|
-
});
|
|
2240
|
-
var organizationUrlSchema = optional(url());
|
|
2241
|
-
schemaRegistry.add(organizationUrlSchema, {
|
|
2242
|
-
description: "A URL to a page that provides more information about the organization"
|
|
2243
|
-
});
|
|
2244
|
-
var organizationSchema = object({
|
|
2245
|
-
name: organizationNameSchema,
|
|
2246
|
-
description: organizationDescriptionSchema,
|
|
2247
|
-
logo: organizationLogoSchema,
|
|
2248
|
-
icon: organizationIconSchema,
|
|
2249
|
-
url: organizationUrlSchema
|
|
2250
|
-
});
|
|
2251
|
-
schemaRegistry.add(organizationSchema, {
|
|
2252
|
-
description: "The workspace's organization details"
|
|
2253
|
-
});
|
|
2254
|
-
var schemaNameSchema = _default(
|
|
2255
|
-
string2().check(_trim(), _toLowerCase()),
|
|
2256
|
-
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
2257
|
-
);
|
|
2258
|
-
schemaRegistry.add(schemaNameSchema, {
|
|
2259
|
-
description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
2260
|
-
});
|
|
2261
|
-
var nameSchema = string2().check(_trim(), _toLowerCase());
|
|
2262
|
-
schemaRegistry.add(nameSchema, {
|
|
2263
|
-
description: "The name of the workspace/project/service/package/scope using this configuration"
|
|
2264
|
-
});
|
|
2265
|
-
var namespaceSchema = string2().check(_trim(), _toLowerCase());
|
|
2266
|
-
schemaRegistry.add(namespaceSchema, {
|
|
2267
|
-
description: "The namespace of the workspace/project/service/package/scope using this configuration"
|
|
2268
|
-
});
|
|
2269
|
-
var orgSchema = union([
|
|
2270
|
-
organizationSchema,
|
|
2271
|
-
string2().check(_trim(), _toLowerCase())
|
|
2272
|
-
]);
|
|
2273
|
-
schemaRegistry.add(orgSchema, {
|
|
2274
|
-
description: "The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
2275
|
-
});
|
|
2276
|
-
var repositorySchema = string2().check(_trim(), _toLowerCase());
|
|
2277
|
-
schemaRegistry.add(repositorySchema, {
|
|
2278
|
-
description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
|
|
2279
|
-
});
|
|
2280
|
-
var licenseSchema = _default(
|
|
2281
|
-
string2().check(_trim()),
|
|
2282
|
-
"Apache-2.0"
|
|
2283
|
-
);
|
|
2284
|
-
schemaRegistry.add(licenseSchema, {
|
|
2285
|
-
description: "The license type of the package"
|
|
2286
|
-
});
|
|
2287
|
-
var homepageSchema = optional(url());
|
|
2288
|
-
schemaRegistry.add(homepageSchema, {
|
|
2289
|
-
description: "The homepage of the workspace"
|
|
2290
|
-
});
|
|
2291
|
-
var docsSchema = optional(url());
|
|
2292
|
-
schemaRegistry.add(docsSchema, {
|
|
2293
|
-
description: "The documentation site for the workspace"
|
|
2294
|
-
});
|
|
2295
|
-
var portalSchema = optional(url());
|
|
2296
|
-
schemaRegistry.add(portalSchema, {
|
|
2297
|
-
description: "The development portal site for the workspace"
|
|
2298
|
-
});
|
|
2299
|
-
var licensingSchema = optional(url());
|
|
2300
|
-
schemaRegistry.add(licensingSchema, {
|
|
2301
|
-
description: "The licensing site for the workspace"
|
|
2302
|
-
});
|
|
2303
|
-
var contactSchema = optional(url());
|
|
2304
|
-
schemaRegistry.add(contactSchema, {
|
|
2305
|
-
description: "The contact site for the workspace"
|
|
2306
|
-
});
|
|
2307
|
-
var supportSchema = optional(url());
|
|
2308
|
-
schemaRegistry.add(supportSchema, {
|
|
2309
|
-
description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
2310
|
-
});
|
|
2311
|
-
var branchSchema = _default(
|
|
2312
|
-
string2().check(_trim(), _toLowerCase()),
|
|
2313
|
-
"main"
|
|
2314
|
-
);
|
|
2315
|
-
schemaRegistry.add(branchSchema, {
|
|
2316
|
-
description: "The branch of the workspace"
|
|
2317
|
-
});
|
|
2318
|
-
var preidSchema = optional(
|
|
2319
|
-
string2().check(_trim(), _toLowerCase())
|
|
2320
|
-
);
|
|
2321
|
-
schemaRegistry.add(preidSchema, {
|
|
2322
|
-
description: "A tag specifying the version pre-release identifier"
|
|
2323
|
-
});
|
|
2324
|
-
var ownerSchema = optional(
|
|
2325
|
-
string2().check(_trim(), _toLowerCase())
|
|
2326
|
-
);
|
|
2327
|
-
schemaRegistry.add(ownerSchema, {
|
|
2328
|
-
description: "The owner of the package"
|
|
2329
|
-
});
|
|
2330
|
-
var modeSchema = _default(
|
|
2331
|
-
_enum(["development", "test", "production"]).check(_trim(), _toLowerCase()),
|
|
2332
|
-
"production"
|
|
2333
|
-
);
|
|
2334
|
-
schemaRegistry.add(modeSchema, {
|
|
2335
|
-
description: "The current runtime environment mode for the package"
|
|
2336
|
-
});
|
|
2337
|
-
var workspaceRootSchema = string2().check(_trim(), _toLowerCase());
|
|
2338
|
-
schemaRegistry.add(workspaceRootSchema, {
|
|
2339
|
-
description: "The root directory of the workspace"
|
|
2340
|
-
});
|
|
2341
|
-
var skipCacheSchema = _default(boolean2(), false);
|
|
2342
|
-
schemaRegistry.add(skipCacheSchema, {
|
|
2343
|
-
description: "Should all known types of workspace caching be skipped?"
|
|
2344
|
-
});
|
|
2345
|
-
var packageManagerSchema = _default(
|
|
2346
|
-
_enum(["npm", "yarn", "pnpm", "bun"]),
|
|
2347
|
-
"npm"
|
|
2348
|
-
);
|
|
2349
|
-
schemaRegistry.add(packageManagerSchema, {
|
|
2350
|
-
description: "The JavaScript/TypeScript package manager used by the repository"
|
|
2351
|
-
});
|
|
2352
|
-
var timezoneSchema = _default(
|
|
2353
|
-
string2().check(_trim()),
|
|
2354
|
-
"America/New_York"
|
|
2355
|
-
);
|
|
2356
|
-
schemaRegistry.add(timezoneSchema, {
|
|
2357
|
-
description: "The default timezone of the workspace"
|
|
2358
|
-
});
|
|
2359
|
-
var localeSchema = _default(string2().check(_trim()), "en-US");
|
|
2360
|
-
schemaRegistry.add(localeSchema, {
|
|
2361
|
-
description: "The default locale of the workspace"
|
|
2362
|
-
});
|
|
2363
|
-
var logLevelSchema = _default(
|
|
2364
|
-
_enum([
|
|
2365
|
-
"silent",
|
|
2366
|
-
"fatal",
|
|
2367
|
-
"error",
|
|
2368
|
-
"warn",
|
|
2369
|
-
"success",
|
|
2370
|
-
"info",
|
|
2371
|
-
"performance",
|
|
2372
|
-
"debug",
|
|
2373
|
-
"trace",
|
|
2374
|
-
"all"
|
|
2375
|
-
]),
|
|
2376
|
-
"info"
|
|
2377
|
-
);
|
|
2378
|
-
schemaRegistry.add(logLevelSchema, {
|
|
2379
|
-
description: "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
|
|
2380
|
-
});
|
|
2381
|
-
var skipConfigLoggingSchema = _default(boolean2(), true);
|
|
2382
|
-
schemaRegistry.add(skipConfigLoggingSchema, {
|
|
2383
|
-
description: "Should the logging of the current Storm Workspace configuration be skipped?"
|
|
2384
|
-
});
|
|
2385
|
-
var configFileSchema = _default(
|
|
2386
|
-
nullable(string2().check(_trim())),
|
|
2387
|
-
null
|
|
2388
|
-
);
|
|
2389
|
-
schemaRegistry.add(configFileSchema, {
|
|
2390
|
-
description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
2391
|
-
});
|
|
2392
|
-
var extensionsSchema = _default(record(string2(), any()), {});
|
|
2393
|
-
schemaRegistry.add(extensionsSchema, {
|
|
2394
|
-
description: "Configuration of each used extension"
|
|
2395
|
-
});
|
|
2396
|
-
var workspaceConfigSchema = object({
|
|
2397
|
-
$schema: schemaNameSchema,
|
|
2398
|
-
extends: extendsSchema,
|
|
2399
|
-
name: nameSchema,
|
|
2400
|
-
variant: variantSchema,
|
|
2401
|
-
namespace: namespaceSchema,
|
|
2402
|
-
organization: orgSchema,
|
|
2403
|
-
repository: repositorySchema,
|
|
2404
|
-
license: licenseSchema,
|
|
2405
|
-
homepage: homepageSchema,
|
|
2406
|
-
docs: docsSchema,
|
|
2407
|
-
portal: portalSchema,
|
|
2408
|
-
licensing: licensingSchema,
|
|
2409
|
-
contact: contactSchema,
|
|
2410
|
-
support: supportSchema,
|
|
2411
|
-
branch: branchSchema,
|
|
2412
|
-
preid: preidSchema,
|
|
2413
|
-
owner: ownerSchema,
|
|
2414
|
-
bot: workspaceBotSchema,
|
|
2415
|
-
release: workspaceReleaseSchema,
|
|
2416
|
-
socials: workspaceSocialsSchema,
|
|
2417
|
-
error: errorSchema,
|
|
2418
|
-
mode: modeSchema,
|
|
2419
|
-
workspaceRoot: workspaceRootSchema,
|
|
2420
|
-
skipCache: skipCacheSchema,
|
|
2421
|
-
directories: workspaceDirectorySchema,
|
|
2422
|
-
packageManager: packageManagerSchema,
|
|
2423
|
-
timezone: timezoneSchema,
|
|
2424
|
-
locale: localeSchema,
|
|
2425
|
-
logLevel: logLevelSchema,
|
|
2426
|
-
skipConfigLogging: skipConfigLoggingSchema,
|
|
2427
|
-
registry: registrySchema,
|
|
2428
|
-
configFile: configFileSchema,
|
|
2429
|
-
colors: union([colorsSchema, themeColorsSchema]),
|
|
2430
|
-
extensions: extensionsSchema
|
|
2431
|
-
});
|
|
2432
|
-
schemaRegistry.add(extensionsSchema, {
|
|
2433
|
-
description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
|
|
2434
|
-
});
|
|
2435
|
-
|
|
2436
|
-
// ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
2437
|
-
function isPlainObject2(value) {
|
|
2438
|
-
if (value === null || typeof value !== "object") {
|
|
2439
|
-
return false;
|
|
2440
|
-
}
|
|
2441
|
-
const prototype = Object.getPrototypeOf(value);
|
|
2442
|
-
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
2443
|
-
return false;
|
|
2444
|
-
}
|
|
2445
|
-
if (Symbol.iterator in value) {
|
|
2446
|
-
return false;
|
|
2447
|
-
}
|
|
2448
|
-
if (Symbol.toStringTag in value) {
|
|
2449
|
-
return Object.prototype.toString.call(value) === "[object Module]";
|
|
2450
|
-
}
|
|
2451
|
-
return true;
|
|
2452
|
-
}
|
|
2453
|
-
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
2454
|
-
if (!isPlainObject2(defaults)) {
|
|
2455
|
-
return _defu(baseObject, {}, namespace, merger);
|
|
2456
|
-
}
|
|
2457
|
-
const object2 = { ...defaults };
|
|
2458
|
-
for (const key of Object.keys(baseObject)) {
|
|
2459
|
-
if (key === "__proto__" || key === "constructor") {
|
|
2460
|
-
continue;
|
|
2461
|
-
}
|
|
2462
|
-
const value = baseObject[key];
|
|
2463
|
-
if (value === null || value === void 0) {
|
|
2464
|
-
continue;
|
|
2465
|
-
}
|
|
2466
|
-
if (merger && merger(object2, key, value, namespace)) {
|
|
2467
|
-
continue;
|
|
2468
|
-
}
|
|
2469
|
-
if (Array.isArray(value) && Array.isArray(object2[key])) {
|
|
2470
|
-
object2[key] = [...value, ...object2[key]];
|
|
2471
|
-
} else if (isPlainObject2(value) && isPlainObject2(object2[key])) {
|
|
2472
|
-
object2[key] = _defu(
|
|
2473
|
-
value,
|
|
2474
|
-
object2[key],
|
|
2475
|
-
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
2476
|
-
merger
|
|
2477
|
-
);
|
|
2478
|
-
} else {
|
|
2479
|
-
object2[key] = value;
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
return object2;
|
|
2483
|
-
}
|
|
2484
|
-
function createDefu(merger) {
|
|
2485
|
-
return (...arguments_) => (
|
|
2486
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
2487
|
-
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
2488
|
-
);
|
|
2489
|
-
}
|
|
2490
|
-
var defu = createDefu();
|
|
2491
|
-
|
|
2492
|
-
// ../config-tools/src/utilities/correct-paths.ts
|
|
2493
|
-
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2494
|
-
function normalizeWindowsPath(input = "") {
|
|
2495
|
-
if (!input) {
|
|
2496
|
-
return input;
|
|
2497
|
-
}
|
|
2498
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
2499
|
-
}
|
|
2500
|
-
var _UNC_REGEX = /^[/\\]{2}/;
|
|
2501
|
-
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
2502
|
-
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
2503
|
-
var correctPaths = function(path) {
|
|
2504
|
-
if (!path || path.length === 0) {
|
|
2505
|
-
return ".";
|
|
2506
|
-
}
|
|
2507
|
-
path = normalizeWindowsPath(path);
|
|
2508
|
-
const isUNCPath = path?.match(_UNC_REGEX);
|
|
2509
|
-
const isPathAbsolute = isAbsolute(path);
|
|
2510
|
-
const trailingSeparator = path[path.length - 1] === "/";
|
|
2511
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
2512
|
-
if (path.length === 0) {
|
|
2513
|
-
if (isPathAbsolute) {
|
|
2514
|
-
return "/";
|
|
2515
|
-
}
|
|
2516
|
-
return trailingSeparator ? "./" : ".";
|
|
2517
|
-
}
|
|
2518
|
-
if (trailingSeparator) {
|
|
2519
|
-
path += "/";
|
|
2520
|
-
}
|
|
2521
|
-
if (_DRIVE_LETTER_RE.test(path)) {
|
|
2522
|
-
path += "/";
|
|
2523
|
-
}
|
|
2524
|
-
if (isUNCPath) {
|
|
2525
|
-
if (!isPathAbsolute) {
|
|
2526
|
-
return `//./${path}`;
|
|
2527
|
-
}
|
|
2528
|
-
return `//${path}`;
|
|
2529
|
-
}
|
|
2530
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
2531
|
-
};
|
|
2532
|
-
var joinPaths = function(...segments) {
|
|
2533
|
-
let path = "";
|
|
2534
|
-
for (const seg of segments) {
|
|
2535
|
-
if (!seg) {
|
|
2536
|
-
continue;
|
|
2537
|
-
}
|
|
2538
|
-
if (path.length > 0) {
|
|
2539
|
-
const pathTrailing = path[path.length - 1] === "/";
|
|
2540
|
-
const segLeading = seg[0] === "/";
|
|
2541
|
-
const both = pathTrailing && segLeading;
|
|
2542
|
-
if (both) {
|
|
2543
|
-
path += seg.slice(1);
|
|
2544
|
-
} else {
|
|
2545
|
-
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
2546
|
-
}
|
|
2547
|
-
} else {
|
|
2548
|
-
path += seg;
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
return correctPaths(path);
|
|
2552
|
-
};
|
|
2553
|
-
function normalizeString(path, allowAboveRoot) {
|
|
2554
|
-
let res = "";
|
|
2555
|
-
let lastSegmentLength = 0;
|
|
2556
|
-
let lastSlash = -1;
|
|
2557
|
-
let dots = 0;
|
|
2558
|
-
let char = null;
|
|
2559
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
2560
|
-
if (index < path.length) {
|
|
2561
|
-
char = path[index];
|
|
2562
|
-
} else if (char === "/") {
|
|
2563
|
-
break;
|
|
2564
|
-
} else {
|
|
2565
|
-
char = "/";
|
|
2566
|
-
}
|
|
2567
|
-
if (char === "/") {
|
|
2568
|
-
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
2569
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
2570
|
-
if (res.length > 2) {
|
|
2571
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
2572
|
-
if (lastSlashIndex === -1) {
|
|
2573
|
-
res = "";
|
|
2574
|
-
lastSegmentLength = 0;
|
|
2575
|
-
} else {
|
|
2576
|
-
res = res.slice(0, lastSlashIndex);
|
|
2577
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
2578
|
-
}
|
|
2579
|
-
lastSlash = index;
|
|
2580
|
-
dots = 0;
|
|
2581
|
-
continue;
|
|
2582
|
-
} else if (res.length > 0) {
|
|
2583
|
-
res = "";
|
|
2584
|
-
lastSegmentLength = 0;
|
|
2585
|
-
lastSlash = index;
|
|
2586
|
-
dots = 0;
|
|
2587
|
-
continue;
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
if (allowAboveRoot) {
|
|
2591
|
-
res += res.length > 0 ? "/.." : "..";
|
|
2592
|
-
lastSegmentLength = 2;
|
|
2593
|
-
}
|
|
2594
|
-
} else {
|
|
2595
|
-
if (res.length > 0) {
|
|
2596
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
2597
|
-
} else {
|
|
2598
|
-
res = path.slice(lastSlash + 1, index);
|
|
2599
|
-
}
|
|
2600
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
2601
|
-
}
|
|
2602
|
-
lastSlash = index;
|
|
2603
|
-
dots = 0;
|
|
2604
|
-
} else if (char === "." && dots !== -1) {
|
|
2605
|
-
++dots;
|
|
2606
|
-
} else {
|
|
2607
|
-
dots = -1;
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
return res;
|
|
2611
|
-
}
|
|
2612
|
-
var isAbsolute = function(p) {
|
|
2613
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
2614
|
-
};
|
|
2615
|
-
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
2616
|
-
var depth = 0;
|
|
2617
|
-
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
2618
|
-
const _startPath = startPath ?? process.cwd();
|
|
2619
|
-
if (endDirectoryNames.some(
|
|
2620
|
-
(endDirName) => fs.existsSync(path.join(_startPath, endDirName))
|
|
2621
|
-
)) {
|
|
2622
|
-
return _startPath;
|
|
2623
|
-
}
|
|
2624
|
-
if (endFileNames.some((endFileName) => fs.existsSync(path.join(_startPath, endFileName)))) {
|
|
2625
|
-
return _startPath;
|
|
2626
|
-
}
|
|
2627
|
-
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
2628
|
-
const parent = path.join(_startPath, "..");
|
|
2629
|
-
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
2630
|
-
}
|
|
2631
|
-
return void 0;
|
|
2632
|
-
}
|
|
2633
|
-
|
|
2634
|
-
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
2635
|
-
var rootFiles = [
|
|
2636
|
-
"storm-workspace.json",
|
|
2637
|
-
"storm-workspace.yaml",
|
|
2638
|
-
"storm-workspace.yml",
|
|
2639
|
-
"storm-workspace.js",
|
|
2640
|
-
"storm-workspace.ts",
|
|
2641
|
-
".storm-workspace.json",
|
|
2642
|
-
".storm-workspace.yaml",
|
|
2643
|
-
".storm-workspace.yml",
|
|
2644
|
-
".storm-workspace.js",
|
|
2645
|
-
".storm-workspace.ts",
|
|
2646
|
-
"lerna.json",
|
|
2647
|
-
"nx.json",
|
|
2648
|
-
"turbo.json",
|
|
2649
|
-
"npm-workspace.json",
|
|
2650
|
-
"yarn-workspace.json",
|
|
2651
|
-
"pnpm-workspace.json",
|
|
2652
|
-
"npm-workspace.yaml",
|
|
2653
|
-
"yarn-workspace.yaml",
|
|
2654
|
-
"pnpm-workspace.yaml",
|
|
2655
|
-
"npm-workspace.yml",
|
|
2656
|
-
"yarn-workspace.yml",
|
|
2657
|
-
"pnpm-workspace.yml",
|
|
2658
|
-
"npm-lock.json",
|
|
2659
|
-
"yarn-lock.json",
|
|
2660
|
-
"pnpm-lock.json",
|
|
2661
|
-
"npm-lock.yaml",
|
|
2662
|
-
"yarn-lock.yaml",
|
|
2663
|
-
"pnpm-lock.yaml",
|
|
2664
|
-
"npm-lock.yml",
|
|
2665
|
-
"yarn-lock.yml",
|
|
2666
|
-
"pnpm-lock.yml",
|
|
2667
|
-
"bun.lockb",
|
|
2668
|
-
"bun.lock",
|
|
2669
|
-
"bunfig.toml"
|
|
2670
|
-
];
|
|
2671
|
-
var rootDirectories = [
|
|
2672
|
-
".storm-workspace",
|
|
2673
|
-
".nx",
|
|
2674
|
-
".git",
|
|
2675
|
-
".github",
|
|
2676
|
-
".vscode",
|
|
2677
|
-
".verdaccio"
|
|
2678
|
-
];
|
|
2679
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
2680
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
2681
|
-
return correctPaths(
|
|
2682
|
-
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
2683
|
-
);
|
|
2684
|
-
}
|
|
2685
|
-
return correctPaths(
|
|
2686
|
-
findFolderUp(
|
|
2687
|
-
pathInsideMonorepo ?? process.cwd(),
|
|
2688
|
-
rootFiles,
|
|
2689
|
-
rootDirectories
|
|
2690
|
-
)
|
|
2691
|
-
);
|
|
2692
|
-
}
|
|
2693
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
2694
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
2695
|
-
if (!result) {
|
|
2696
|
-
throw new Error(
|
|
2697
|
-
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
2698
|
-
${rootFiles.join(
|
|
2699
|
-
"\n"
|
|
2700
|
-
)}
|
|
2701
|
-
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
2702
|
-
);
|
|
2703
|
-
}
|
|
2704
|
-
return result;
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
|
-
// ../config/src/types.ts
|
|
2708
|
-
var COLOR_KEYS = [
|
|
2709
|
-
"dark",
|
|
2710
|
-
"light",
|
|
2711
|
-
"base",
|
|
2712
|
-
"brand",
|
|
2713
|
-
"alternate",
|
|
2714
|
-
"accent",
|
|
2715
|
-
"link",
|
|
2716
|
-
"success",
|
|
2717
|
-
"discovery",
|
|
2718
|
-
"info",
|
|
2719
|
-
"warning",
|
|
2720
|
-
"danger",
|
|
2721
|
-
"fatal",
|
|
2722
|
-
"performance",
|
|
2723
|
-
"positive",
|
|
2724
|
-
"negative"
|
|
2725
|
-
];
|
|
2726
|
-
async function getPackageJsonConfig(root) {
|
|
2727
|
-
let license = STORM_DEFAULT_LICENSE;
|
|
2728
|
-
let homepage = void 0;
|
|
2729
|
-
let support = void 0;
|
|
2730
|
-
let name = void 0;
|
|
2731
|
-
let namespace = void 0;
|
|
2732
|
-
let repository = void 0;
|
|
2733
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
2734
|
-
if (fs.existsSync(path.join(workspaceRoot, "package.json"))) {
|
|
2735
|
-
const file = await promises.readFile(
|
|
2736
|
-
joinPaths(workspaceRoot, "package.json"),
|
|
2737
|
-
"utf8"
|
|
2738
|
-
);
|
|
2739
|
-
if (file) {
|
|
2740
|
-
const packageJson = JSON.parse(file);
|
|
2741
|
-
if (packageJson.name) {
|
|
2742
|
-
name = packageJson.name;
|
|
2743
|
-
}
|
|
2744
|
-
if (packageJson.namespace) {
|
|
2745
|
-
namespace = packageJson.namespace;
|
|
2746
|
-
}
|
|
2747
|
-
if (packageJson.repository) {
|
|
2748
|
-
if (typeof packageJson.repository === "string") {
|
|
2749
|
-
repository = packageJson.repository;
|
|
2750
|
-
} else if (packageJson.repository.url) {
|
|
2751
|
-
repository = packageJson.repository.url;
|
|
2752
|
-
}
|
|
2753
|
-
}
|
|
2754
|
-
if (packageJson.license) {
|
|
2755
|
-
license = packageJson.license;
|
|
2756
|
-
}
|
|
2757
|
-
if (packageJson.homepage) {
|
|
2758
|
-
homepage = packageJson.homepage;
|
|
2759
|
-
}
|
|
2760
|
-
if (packageJson.bugs) {
|
|
2761
|
-
if (typeof packageJson.bugs === "string") {
|
|
2762
|
-
support = packageJson.bugs;
|
|
2763
|
-
} else if (packageJson.bugs.url) {
|
|
2764
|
-
support = packageJson.bugs.url;
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
return {
|
|
2770
|
-
workspaceRoot,
|
|
2771
|
-
name,
|
|
2772
|
-
namespace,
|
|
2773
|
-
repository,
|
|
2774
|
-
license,
|
|
2775
|
-
homepage,
|
|
2776
|
-
support
|
|
2777
|
-
};
|
|
2778
|
-
}
|
|
2779
|
-
function applyDefaultConfig(config2) {
|
|
2780
|
-
if (!config2.support && config2.contact) {
|
|
2781
|
-
config2.support = config2.contact;
|
|
2782
|
-
}
|
|
2783
|
-
if (!config2.contact && config2.support) {
|
|
2784
|
-
config2.contact = config2.support;
|
|
2785
|
-
}
|
|
2786
|
-
if (config2.homepage) {
|
|
2787
|
-
if (!config2.docs) {
|
|
2788
|
-
config2.docs = `${config2.homepage}/docs`;
|
|
2789
|
-
}
|
|
2790
|
-
if (!config2.license) {
|
|
2791
|
-
config2.license = `${config2.homepage}/license`;
|
|
2792
|
-
}
|
|
2793
|
-
if (!config2.support) {
|
|
2794
|
-
config2.support = `${config2.homepage}/support`;
|
|
2795
|
-
}
|
|
2796
|
-
if (!config2.contact) {
|
|
2797
|
-
config2.contact = `${config2.homepage}/contact`;
|
|
2798
|
-
}
|
|
2799
|
-
if (!config2.error?.codesFile || !config2?.error?.url) {
|
|
2800
|
-
config2.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
2801
|
-
if (config2.homepage) {
|
|
2802
|
-
config2.error.url ??= `${config2.homepage}/errors`;
|
|
2803
|
-
}
|
|
2804
|
-
}
|
|
2805
|
-
}
|
|
2806
|
-
return config2;
|
|
2807
|
-
}
|
|
2808
|
-
|
|
2809
|
-
// ../config-tools/src/config-file/get-config-file.ts
|
|
2810
|
-
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
2811
|
-
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
2812
|
-
const configs = await Promise.all([
|
|
2813
|
-
c12.loadConfig({
|
|
2814
|
-
cwd: workspacePath,
|
|
2815
|
-
packageJson: true,
|
|
2816
|
-
name: fileName,
|
|
2817
|
-
envName: fileName?.toUpperCase(),
|
|
2818
|
-
jitiOptions: {
|
|
2819
|
-
debug: false,
|
|
2820
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
2821
|
-
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
2822
|
-
"jiti"
|
|
2823
|
-
)
|
|
2824
|
-
},
|
|
2825
|
-
...options
|
|
2826
|
-
}),
|
|
2827
|
-
c12.loadConfig({
|
|
2828
|
-
cwd: workspacePath,
|
|
2829
|
-
packageJson: true,
|
|
2830
|
-
name: fileName,
|
|
2831
|
-
envName: fileName?.toUpperCase(),
|
|
2832
|
-
jitiOptions: {
|
|
2833
|
-
debug: false,
|
|
2834
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
2835
|
-
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
2836
|
-
"jiti"
|
|
2837
|
-
)
|
|
2838
|
-
},
|
|
2839
|
-
configFile: fileName,
|
|
2840
|
-
...options
|
|
2841
|
-
})
|
|
2842
|
-
]);
|
|
2843
|
-
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
2844
|
-
};
|
|
2845
|
-
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
2846
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
2847
|
-
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
2848
|
-
let config2 = result.config;
|
|
2849
|
-
const configFile = result.configFile;
|
|
2850
|
-
if (config2 && configFile && Object.keys(config2).length > 0 && !config2.skipConfigLogging) {
|
|
2851
|
-
writeTrace(
|
|
2852
|
-
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
2853
|
-
{
|
|
2854
|
-
logLevel: "all"
|
|
2855
|
-
}
|
|
2856
|
-
);
|
|
2857
|
-
}
|
|
2858
|
-
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
2859
|
-
const results = await Promise.all(
|
|
2860
|
-
additionalFileNames.map(
|
|
2861
|
-
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
2862
|
-
)
|
|
2863
|
-
);
|
|
2864
|
-
for (const result2 of results) {
|
|
2865
|
-
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
2866
|
-
if (!config2.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
2867
|
-
writeTrace(
|
|
2868
|
-
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
2869
|
-
{
|
|
2870
|
-
logLevel: "all"
|
|
2871
|
-
}
|
|
2872
|
-
);
|
|
2873
|
-
}
|
|
2874
|
-
config2 = defu(result2.config ?? {}, config2 ?? {});
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
if (!config2 || Object.keys(config2).length === 0) {
|
|
2879
|
-
return void 0;
|
|
2880
|
-
}
|
|
2881
|
-
config2.configFile = configFile;
|
|
2882
|
-
return config2;
|
|
2883
|
-
};
|
|
2884
|
-
var getConfigEnv = () => {
|
|
2885
|
-
const prefix = "STORM_";
|
|
2886
|
-
let config2 = {
|
|
2887
|
-
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
2888
|
-
name: process.env[`${prefix}NAME`] || void 0,
|
|
2889
|
-
variant: process.env[`${prefix}VARIANT`] || void 0,
|
|
2890
|
-
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
2891
|
-
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
2892
|
-
bot: {
|
|
2893
|
-
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
2894
|
-
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
2895
|
-
},
|
|
2896
|
-
release: {
|
|
2897
|
-
banner: {
|
|
2898
|
-
url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
|
|
2899
|
-
alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
|
|
2900
|
-
},
|
|
2901
|
-
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
|
|
2902
|
-
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
|
|
2903
|
-
},
|
|
2904
|
-
error: {
|
|
2905
|
-
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
|
|
2906
|
-
url: process.env[`${prefix}ERROR_URL`] || void 0
|
|
2907
|
-
},
|
|
2908
|
-
socials: {
|
|
2909
|
-
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
|
|
2910
|
-
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
|
|
2911
|
-
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
|
|
2912
|
-
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
|
|
2913
|
-
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
|
|
2914
|
-
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
|
|
2915
|
-
},
|
|
2916
|
-
organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
|
|
2917
|
-
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
|
|
2918
|
-
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
|
|
2919
|
-
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
|
|
2920
|
-
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
|
|
2921
|
-
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
|
|
2922
|
-
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
|
|
2923
|
-
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
2924
|
-
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
2925
|
-
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
2926
|
-
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
2927
|
-
portal: process.env[`${prefix}PORTAL`] || void 0,
|
|
2928
|
-
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
2929
|
-
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
2930
|
-
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
2931
|
-
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
2932
|
-
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
2933
|
-
configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
|
|
2934
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
2935
|
-
directories: {
|
|
2936
|
-
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
2937
|
-
data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
2938
|
-
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
2939
|
-
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
2940
|
-
log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
2941
|
-
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
2942
|
-
},
|
|
2943
|
-
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
2944
|
-
mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
|
|
2945
|
-
// ci:
|
|
2946
|
-
// process.env[`${prefix}CI`] !== undefined
|
|
2947
|
-
// ? Boolean(
|
|
2948
|
-
// process.env[`${prefix}CI`] ??
|
|
2949
|
-
// process.env.CI ??
|
|
2950
|
-
// process.env.CONTINUOUS_INTEGRATION
|
|
2951
|
-
// )
|
|
2952
|
-
// : undefined,
|
|
2953
|
-
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
2954
|
-
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
2955
|
-
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
2956
|
-
registry: {
|
|
2957
|
-
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
2958
|
-
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
2959
|
-
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
2960
|
-
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
2961
|
-
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
2962
|
-
},
|
|
2963
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
2964
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
2965
|
-
) ? getLogLevelLabel(
|
|
2966
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
2967
|
-
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
2968
|
-
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
2969
|
-
};
|
|
2970
|
-
const themeNames = Object.keys(process.env).filter(
|
|
2971
|
-
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
2972
|
-
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
2973
|
-
)
|
|
2974
|
-
);
|
|
2975
|
-
config2.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
2976
|
-
(ret, themeName) => {
|
|
2977
|
-
ret[themeName] = getThemeColorsEnv(prefix, themeName);
|
|
2978
|
-
return ret;
|
|
2979
|
-
},
|
|
2980
|
-
{}
|
|
2981
|
-
) : getThemeColorsEnv(prefix);
|
|
2982
|
-
if (config2.docs === STORM_DEFAULT_DOCS) {
|
|
2983
|
-
if (config2.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
2984
|
-
config2.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config2.name}/docs`;
|
|
2985
|
-
} else {
|
|
2986
|
-
config2.docs = `${config2.homepage}/docs`;
|
|
2987
|
-
}
|
|
2988
|
-
}
|
|
2989
|
-
if (config2.licensing === STORM_DEFAULT_LICENSING) {
|
|
2990
|
-
if (config2.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
2991
|
-
config2.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config2.name}/licensing`;
|
|
2992
|
-
} else {
|
|
2993
|
-
config2.licensing = `${config2.homepage}/docs`;
|
|
2994
|
-
}
|
|
2995
|
-
}
|
|
2996
|
-
const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
|
|
2997
|
-
if (serializedConfig) {
|
|
2998
|
-
const parsed = JSON.parse(serializedConfig);
|
|
2999
|
-
config2 = {
|
|
3000
|
-
...config2,
|
|
3001
|
-
...parsed,
|
|
3002
|
-
colors: { ...config2.colors, ...parsed.colors },
|
|
3003
|
-
extensions: { ...config2.extensions, ...parsed.extensions }
|
|
3004
|
-
};
|
|
3005
|
-
}
|
|
3006
|
-
return config2;
|
|
3007
|
-
};
|
|
3008
|
-
var getThemeColorsEnv = (prefix, theme) => {
|
|
3009
|
-
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
3010
|
-
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
|
|
3011
|
-
};
|
|
3012
|
-
var getSingleThemeColorsEnv = (prefix) => {
|
|
3013
|
-
const gradient = [];
|
|
3014
|
-
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
3015
|
-
gradient.push(
|
|
3016
|
-
process.env[`${prefix}GRADIENT_START`],
|
|
3017
|
-
process.env[`${prefix}GRADIENT_END`]
|
|
3018
|
-
);
|
|
3019
|
-
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
3020
|
-
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
3021
|
-
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
3022
|
-
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
3023
|
-
index++;
|
|
3024
|
-
}
|
|
3025
|
-
}
|
|
3026
|
-
return {
|
|
3027
|
-
dark: process.env[`${prefix}DARK`],
|
|
3028
|
-
light: process.env[`${prefix}LIGHT`],
|
|
3029
|
-
brand: process.env[`${prefix}BRAND`],
|
|
3030
|
-
alternate: process.env[`${prefix}ALTERNATE`],
|
|
3031
|
-
accent: process.env[`${prefix}ACCENT`],
|
|
3032
|
-
link: process.env[`${prefix}LINK`],
|
|
3033
|
-
discovery: process.env[`${prefix}DISCOVERY`],
|
|
3034
|
-
success: process.env[`${prefix}SUCCESS`],
|
|
3035
|
-
info: process.env[`${prefix}INFO`],
|
|
3036
|
-
debug: process.env[`${prefix}DEBUG`],
|
|
3037
|
-
warning: process.env[`${prefix}WARNING`],
|
|
3038
|
-
danger: process.env[`${prefix}DANGER`],
|
|
3039
|
-
fatal: process.env[`${prefix}FATAL`],
|
|
3040
|
-
performance: process.env[`${prefix}PERFORMANCE`],
|
|
3041
|
-
positive: process.env[`${prefix}POSITIVE`],
|
|
3042
|
-
negative: process.env[`${prefix}NEGATIVE`],
|
|
3043
|
-
gradient
|
|
3044
|
-
};
|
|
3045
|
-
};
|
|
3046
|
-
var getMultiThemeColorsEnv = (prefix) => {
|
|
3047
|
-
return {
|
|
3048
|
-
light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
|
|
3049
|
-
dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
|
|
3050
|
-
};
|
|
3051
|
-
};
|
|
3052
|
-
var getBaseThemeColorsEnv = (prefix) => {
|
|
3053
|
-
const gradient = [];
|
|
3054
|
-
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
3055
|
-
gradient.push(
|
|
3056
|
-
process.env[`${prefix}GRADIENT_START`],
|
|
3057
|
-
process.env[`${prefix}GRADIENT_END`]
|
|
3058
|
-
);
|
|
3059
|
-
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
3060
|
-
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
3061
|
-
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
3062
|
-
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
3063
|
-
index++;
|
|
3064
|
-
}
|
|
3065
|
-
}
|
|
3066
|
-
return {
|
|
3067
|
-
foreground: process.env[`${prefix}FOREGROUND`],
|
|
3068
|
-
background: process.env[`${prefix}BACKGROUND`],
|
|
3069
|
-
brand: process.env[`${prefix}BRAND`],
|
|
3070
|
-
alternate: process.env[`${prefix}ALTERNATE`],
|
|
3071
|
-
accent: process.env[`${prefix}ACCENT`],
|
|
3072
|
-
link: process.env[`${prefix}LINK`],
|
|
3073
|
-
discovery: process.env[`${prefix}DISCOVERY`],
|
|
3074
|
-
success: process.env[`${prefix}SUCCESS`],
|
|
3075
|
-
info: process.env[`${prefix}INFO`],
|
|
3076
|
-
debug: process.env[`${prefix}DEBUG`],
|
|
3077
|
-
warning: process.env[`${prefix}WARNING`],
|
|
3078
|
-
danger: process.env[`${prefix}DANGER`],
|
|
3079
|
-
fatal: process.env[`${prefix}FATAL`],
|
|
3080
|
-
performance: process.env[`${prefix}PERFORMANCE`],
|
|
3081
|
-
positive: process.env[`${prefix}POSITIVE`],
|
|
3082
|
-
negative: process.env[`${prefix}NEGATIVE`],
|
|
3083
|
-
gradient
|
|
3084
|
-
};
|
|
3085
|
-
};
|
|
3086
|
-
|
|
3087
|
-
// ../config-tools/src/env/set-env.ts
|
|
3088
|
-
var setExtensionEnv = (extensionName, extension) => {
|
|
3089
|
-
for (const key of Object.keys(extension ?? {})) {
|
|
3090
|
-
if (extension[key]) {
|
|
3091
|
-
const result = key?.replace(
|
|
3092
|
-
/([A-Z])+/g,
|
|
3093
|
-
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
3094
|
-
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
3095
|
-
let extensionKey;
|
|
3096
|
-
if (result.length === 0) {
|
|
3097
|
-
return;
|
|
3098
|
-
}
|
|
3099
|
-
if (result.length === 1) {
|
|
3100
|
-
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
3101
|
-
} else {
|
|
3102
|
-
extensionKey = result.reduce((ret, part) => {
|
|
3103
|
-
return `${ret}_${part.toLowerCase()}`;
|
|
3104
|
-
});
|
|
3105
|
-
}
|
|
3106
|
-
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
3107
|
-
}
|
|
3108
|
-
}
|
|
3109
|
-
};
|
|
3110
|
-
var setConfigEnv = (config2) => {
|
|
3111
|
-
const prefix = "STORM_";
|
|
3112
|
-
if (config2.extends) {
|
|
3113
|
-
process.env[`${prefix}EXTENDS`] = Array.isArray(config2.extends) ? JSON.stringify(config2.extends) : config2.extends;
|
|
3114
|
-
}
|
|
3115
|
-
if (config2.name) {
|
|
3116
|
-
process.env[`${prefix}NAME`] = config2.name;
|
|
3117
|
-
}
|
|
3118
|
-
if (config2.variant) {
|
|
3119
|
-
process.env[`${prefix}VARIANT`] = config2.variant;
|
|
3120
|
-
}
|
|
3121
|
-
if (config2.namespace) {
|
|
3122
|
-
process.env[`${prefix}NAMESPACE`] = config2.namespace;
|
|
3123
|
-
}
|
|
3124
|
-
if (config2.owner) {
|
|
3125
|
-
process.env[`${prefix}OWNER`] = config2.owner;
|
|
3126
|
-
}
|
|
3127
|
-
if (config2.bot) {
|
|
3128
|
-
process.env[`${prefix}BOT_NAME`] = config2.bot.name;
|
|
3129
|
-
process.env[`${prefix}BOT_EMAIL`] = config2.bot.email;
|
|
3130
|
-
}
|
|
3131
|
-
if (config2.error) {
|
|
3132
|
-
process.env[`${prefix}ERROR_CODES_FILE`] = config2.error.codesFile;
|
|
3133
|
-
process.env[`${prefix}ERROR_URL`] = config2.error.url;
|
|
3134
|
-
}
|
|
3135
|
-
if (config2.release) {
|
|
3136
|
-
if (config2.release.banner) {
|
|
3137
|
-
if (typeof config2.release.banner === "string") {
|
|
3138
|
-
process.env[`${prefix}RELEASE_BANNER`] = config2.release.banner;
|
|
3139
|
-
process.env[`${prefix}RELEASE_BANNER_URL`] = config2.release.banner;
|
|
3140
|
-
} else {
|
|
3141
|
-
process.env[`${prefix}RELEASE_BANNER`] = config2.release.banner.url;
|
|
3142
|
-
process.env[`${prefix}RELEASE_BANNER_URL`] = config2.release.banner.url;
|
|
3143
|
-
process.env[`${prefix}RELEASE_BANNER_ALT`] = config2.release.banner.alt;
|
|
3144
|
-
}
|
|
3145
|
-
}
|
|
3146
|
-
process.env[`${prefix}RELEASE_HEADER`] = config2.release.header;
|
|
3147
|
-
process.env[`${prefix}RELEASE_FOOTER`] = config2.release.footer;
|
|
3148
|
-
}
|
|
3149
|
-
if (config2.socials) {
|
|
3150
|
-
if (config2.socials.twitter) {
|
|
3151
|
-
process.env[`${prefix}SOCIAL_TWITTER`] = config2.socials.twitter;
|
|
3152
|
-
}
|
|
3153
|
-
if (config2.socials.discord) {
|
|
3154
|
-
process.env[`${prefix}SOCIAL_DISCORD`] = config2.socials.discord;
|
|
3155
|
-
}
|
|
3156
|
-
if (config2.socials.telegram) {
|
|
3157
|
-
process.env[`${prefix}SOCIAL_TELEGRAM`] = config2.socials.telegram;
|
|
3158
|
-
}
|
|
3159
|
-
if (config2.socials.slack) {
|
|
3160
|
-
process.env[`${prefix}SOCIAL_SLACK`] = config2.socials.slack;
|
|
3161
|
-
}
|
|
3162
|
-
if (config2.socials.medium) {
|
|
3163
|
-
process.env[`${prefix}SOCIAL_MEDIUM`] = config2.socials.medium;
|
|
3164
|
-
}
|
|
3165
|
-
if (config2.socials.github) {
|
|
3166
|
-
process.env[`${prefix}SOCIAL_GITHUB`] = config2.socials.github;
|
|
3167
|
-
}
|
|
3168
|
-
}
|
|
3169
|
-
if (config2.organization) {
|
|
3170
|
-
if (typeof config2.organization === "string") {
|
|
3171
|
-
process.env[`${prefix}ORG`] = config2.organization;
|
|
3172
|
-
process.env[`${prefix}ORG_NAME`] = config2.organization;
|
|
3173
|
-
process.env[`${prefix}ORGANIZATION`] = config2.organization;
|
|
3174
|
-
process.env[`${prefix}ORGANIZATION_NAME`] = config2.organization;
|
|
3175
|
-
} else {
|
|
3176
|
-
process.env[`${prefix}ORG`] = config2.organization.name;
|
|
3177
|
-
process.env[`${prefix}ORG_NAME`] = config2.organization.name;
|
|
3178
|
-
process.env[`${prefix}ORGANIZATION`] = config2.organization.name;
|
|
3179
|
-
process.env[`${prefix}ORGANIZATION_NAME`] = config2.organization.name;
|
|
3180
|
-
if (config2.organization.url) {
|
|
3181
|
-
process.env[`${prefix}ORG_URL`] = config2.organization.url;
|
|
3182
|
-
process.env[`${prefix}ORGANIZATION_URL`] = config2.organization.url;
|
|
3183
|
-
}
|
|
3184
|
-
if (config2.organization.description) {
|
|
3185
|
-
process.env[`${prefix}ORG_DESCRIPTION`] = config2.organization.description;
|
|
3186
|
-
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config2.organization.description;
|
|
3187
|
-
}
|
|
3188
|
-
if (config2.organization.logo) {
|
|
3189
|
-
process.env[`${prefix}ORG_LOGO`] = config2.organization.logo;
|
|
3190
|
-
process.env[`${prefix}ORGANIZATION_LOGO`] = config2.organization.logo;
|
|
3191
|
-
}
|
|
3192
|
-
if (config2.organization.icon) {
|
|
3193
|
-
process.env[`${prefix}ORG_ICON`] = config2.organization.icon;
|
|
3194
|
-
process.env[`${prefix}ORGANIZATION_ICON`] = config2.organization.icon;
|
|
3195
|
-
}
|
|
3196
|
-
}
|
|
3197
|
-
}
|
|
3198
|
-
if (config2.packageManager) {
|
|
3199
|
-
process.env[`${prefix}PACKAGE_MANAGER`] = config2.packageManager;
|
|
3200
|
-
}
|
|
3201
|
-
if (config2.license) {
|
|
3202
|
-
process.env[`${prefix}LICENSE`] = config2.license;
|
|
3203
|
-
}
|
|
3204
|
-
if (config2.homepage) {
|
|
3205
|
-
process.env[`${prefix}HOMEPAGE`] = config2.homepage;
|
|
3206
|
-
}
|
|
3207
|
-
if (config2.docs) {
|
|
3208
|
-
process.env[`${prefix}DOCS`] = config2.docs;
|
|
3209
|
-
}
|
|
3210
|
-
if (config2.portal) {
|
|
3211
|
-
process.env[`${prefix}PORTAL`] = config2.portal;
|
|
3212
|
-
}
|
|
3213
|
-
if (config2.licensing) {
|
|
3214
|
-
process.env[`${prefix}LICENSING`] = config2.licensing;
|
|
3215
|
-
}
|
|
3216
|
-
if (config2.contact) {
|
|
3217
|
-
process.env[`${prefix}CONTACT`] = config2.contact;
|
|
3218
|
-
}
|
|
3219
|
-
if (config2.support) {
|
|
3220
|
-
process.env[`${prefix}SUPPORT`] = config2.support;
|
|
3221
|
-
}
|
|
3222
|
-
if (config2.timezone) {
|
|
3223
|
-
process.env[`${prefix}TIMEZONE`] = config2.timezone;
|
|
3224
|
-
process.env.TZ = config2.timezone;
|
|
3225
|
-
process.env.DEFAULT_TIMEZONE = config2.timezone;
|
|
3226
|
-
process.env.TIMEZONE = config2.timezone;
|
|
3227
|
-
}
|
|
3228
|
-
if (config2.locale) {
|
|
3229
|
-
process.env[`${prefix}LOCALE`] = config2.locale;
|
|
3230
|
-
process.env.DEFAULT_LOCALE = config2.locale;
|
|
3231
|
-
process.env.LOCALE = config2.locale;
|
|
3232
|
-
process.env.LANG = config2.locale ? `${config2.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
3233
|
-
}
|
|
3234
|
-
if (config2.configFile) {
|
|
3235
|
-
process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
|
|
3236
|
-
config2.configFile
|
|
3237
|
-
);
|
|
3238
|
-
}
|
|
3239
|
-
if (config2.workspaceRoot) {
|
|
3240
|
-
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config2.workspaceRoot);
|
|
3241
|
-
process.env.NX_WORKSPACE_ROOT = correctPaths(config2.workspaceRoot);
|
|
3242
|
-
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config2.workspaceRoot);
|
|
3243
|
-
}
|
|
3244
|
-
if (config2.directories) {
|
|
3245
|
-
if (!config2.skipCache && config2.directories.cache) {
|
|
3246
|
-
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
3247
|
-
config2.directories.cache
|
|
3248
|
-
);
|
|
3249
|
-
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
3250
|
-
}
|
|
3251
|
-
if (config2.directories.data) {
|
|
3252
|
-
process.env[`${prefix}DATA_DIR`] = correctPaths(config2.directories.data);
|
|
3253
|
-
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
3254
|
-
}
|
|
3255
|
-
if (config2.directories.config) {
|
|
3256
|
-
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
3257
|
-
config2.directories.config
|
|
3258
|
-
);
|
|
3259
|
-
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
3260
|
-
}
|
|
3261
|
-
if (config2.directories.temp) {
|
|
3262
|
-
process.env[`${prefix}TEMP_DIR`] = correctPaths(config2.directories.temp);
|
|
3263
|
-
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
3264
|
-
}
|
|
3265
|
-
if (config2.directories.log) {
|
|
3266
|
-
process.env[`${prefix}LOG_DIR`] = correctPaths(config2.directories.log);
|
|
3267
|
-
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
3268
|
-
}
|
|
3269
|
-
if (config2.directories.build) {
|
|
3270
|
-
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
3271
|
-
config2.directories.build
|
|
3272
|
-
);
|
|
3273
|
-
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
3274
|
-
}
|
|
3275
|
-
}
|
|
3276
|
-
if (config2.skipCache !== void 0) {
|
|
3277
|
-
process.env[`${prefix}SKIP_CACHE`] = String(config2.skipCache);
|
|
3278
|
-
if (config2.skipCache) {
|
|
3279
|
-
process.env.NX_SKIP_NX_CACHE ??= String(config2.skipCache);
|
|
3280
|
-
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config2.skipCache);
|
|
3281
|
-
}
|
|
3282
|
-
}
|
|
3283
|
-
if (config2.mode) {
|
|
3284
|
-
process.env[`${prefix}MODE`] = config2.mode;
|
|
3285
|
-
process.env.NODE_ENV = config2.mode;
|
|
3286
|
-
process.env.ENVIRONMENT = config2.mode;
|
|
3287
|
-
}
|
|
3288
|
-
if (config2.colors?.base?.light || config2.colors?.base?.dark) {
|
|
3289
|
-
for (const key of Object.keys(config2.colors)) {
|
|
3290
|
-
setThemeColorsEnv(`${prefix}COLOR_${key}_`, config2.colors[key]);
|
|
3291
|
-
}
|
|
3292
|
-
} else {
|
|
3293
|
-
setThemeColorsEnv(
|
|
3294
|
-
`${prefix}COLOR_`,
|
|
3295
|
-
config2.colors
|
|
3296
|
-
);
|
|
3297
|
-
}
|
|
3298
|
-
if (config2.repository) {
|
|
3299
|
-
process.env[`${prefix}REPOSITORY`] = config2.repository;
|
|
3300
|
-
}
|
|
3301
|
-
if (config2.branch) {
|
|
3302
|
-
process.env[`${prefix}BRANCH`] = config2.branch;
|
|
3303
|
-
}
|
|
3304
|
-
if (config2.preid) {
|
|
3305
|
-
process.env[`${prefix}PRE_ID`] = String(config2.preid);
|
|
3306
|
-
}
|
|
3307
|
-
if (config2.registry) {
|
|
3308
|
-
if (config2.registry.github) {
|
|
3309
|
-
process.env[`${prefix}REGISTRY_GITHUB`] = String(config2.registry.github);
|
|
3310
|
-
}
|
|
3311
|
-
if (config2.registry.npm) {
|
|
3312
|
-
process.env[`${prefix}REGISTRY_NPM`] = String(config2.registry.npm);
|
|
3313
|
-
}
|
|
3314
|
-
if (config2.registry.cargo) {
|
|
3315
|
-
process.env[`${prefix}REGISTRY_CARGO`] = String(config2.registry.cargo);
|
|
3316
|
-
}
|
|
3317
|
-
if (config2.registry.cyclone) {
|
|
3318
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
3319
|
-
config2.registry.cyclone
|
|
3320
|
-
);
|
|
3321
|
-
}
|
|
3322
|
-
if (config2.registry.container) {
|
|
3323
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
3324
|
-
config2.registry.container
|
|
3325
|
-
);
|
|
3326
|
-
}
|
|
3327
|
-
}
|
|
3328
|
-
if (config2.logLevel) {
|
|
3329
|
-
process.env[`${prefix}LOG_LEVEL`] = String(config2.logLevel);
|
|
3330
|
-
process.env.LOG_LEVEL = String(config2.logLevel);
|
|
3331
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
3332
|
-
getLogLevel(config2.logLevel) >= LogLevel.DEBUG ? true : false
|
|
3333
|
-
);
|
|
3334
|
-
process.env.RUST_BACKTRACE = getLogLevel(config2.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
3335
|
-
}
|
|
3336
|
-
if (config2.skipConfigLogging !== void 0) {
|
|
3337
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
3338
|
-
config2.skipConfigLogging
|
|
3339
|
-
);
|
|
3340
|
-
}
|
|
3341
|
-
process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config2);
|
|
3342
|
-
for (const key of Object.keys(config2.extensions ?? {})) {
|
|
3343
|
-
if (config2.extensions[key] && Object.keys(config2.extensions[key])) {
|
|
3344
|
-
setExtensionEnv(key, config2.extensions[key]);
|
|
3345
|
-
}
|
|
3346
|
-
}
|
|
3347
|
-
};
|
|
3348
|
-
var setThemeColorsEnv = (prefix, config2) => {
|
|
3349
|
-
return config2?.light?.brand || config2?.dark?.brand ? setMultiThemeColorsEnv(prefix, config2) : setSingleThemeColorsEnv(prefix, config2);
|
|
3350
|
-
};
|
|
3351
|
-
var setSingleThemeColorsEnv = (prefix, config2) => {
|
|
3352
|
-
if (config2.dark) {
|
|
3353
|
-
process.env[`${prefix}DARK`] = config2.dark;
|
|
3354
|
-
}
|
|
3355
|
-
if (config2.light) {
|
|
3356
|
-
process.env[`${prefix}LIGHT`] = config2.light;
|
|
3357
|
-
}
|
|
3358
|
-
if (config2.brand) {
|
|
3359
|
-
process.env[`${prefix}BRAND`] = config2.brand;
|
|
3360
|
-
}
|
|
3361
|
-
if (config2.alternate) {
|
|
3362
|
-
process.env[`${prefix}ALTERNATE`] = config2.alternate;
|
|
3363
|
-
}
|
|
3364
|
-
if (config2.accent) {
|
|
3365
|
-
process.env[`${prefix}ACCENT`] = config2.accent;
|
|
3366
|
-
}
|
|
3367
|
-
if (config2.link) {
|
|
3368
|
-
process.env[`${prefix}LINK`] = config2.link;
|
|
3369
|
-
}
|
|
3370
|
-
if (config2.discovery) {
|
|
3371
|
-
process.env[`${prefix}DISCOVERY`] = config2.discovery;
|
|
3372
|
-
}
|
|
3373
|
-
if (config2.success) {
|
|
3374
|
-
process.env[`${prefix}SUCCESS`] = config2.success;
|
|
3375
|
-
}
|
|
3376
|
-
if (config2.info) {
|
|
3377
|
-
process.env[`${prefix}INFO`] = config2.info;
|
|
3378
|
-
}
|
|
3379
|
-
if (config2.debug) {
|
|
3380
|
-
process.env[`${prefix}DEBUG`] = config2.debug;
|
|
3381
|
-
}
|
|
3382
|
-
if (config2.warning) {
|
|
3383
|
-
process.env[`${prefix}WARNING`] = config2.warning;
|
|
3384
|
-
}
|
|
3385
|
-
if (config2.danger) {
|
|
3386
|
-
process.env[`${prefix}DANGER`] = config2.danger;
|
|
3387
|
-
}
|
|
3388
|
-
if (config2.fatal) {
|
|
3389
|
-
process.env[`${prefix}FATAL`] = config2.fatal;
|
|
3390
|
-
}
|
|
3391
|
-
if (config2.performance) {
|
|
3392
|
-
process.env[`${prefix}PERFORMANCE`] = config2.performance;
|
|
3393
|
-
}
|
|
3394
|
-
if (config2.positive) {
|
|
3395
|
-
process.env[`${prefix}POSITIVE`] = config2.positive;
|
|
3396
|
-
}
|
|
3397
|
-
if (config2.negative) {
|
|
3398
|
-
process.env[`${prefix}NEGATIVE`] = config2.negative;
|
|
3399
|
-
}
|
|
3400
|
-
if (config2.gradient) {
|
|
3401
|
-
for (let i = 0; i < config2.gradient.length; i++) {
|
|
3402
|
-
process.env[`${prefix}GRADIENT_${i}`] = config2.gradient[i];
|
|
3403
|
-
}
|
|
3404
|
-
}
|
|
3405
|
-
};
|
|
3406
|
-
var setMultiThemeColorsEnv = (prefix, config2) => {
|
|
3407
|
-
return {
|
|
3408
|
-
light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config2.light),
|
|
3409
|
-
dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config2.dark)
|
|
3410
|
-
};
|
|
3411
|
-
};
|
|
3412
|
-
var setBaseThemeColorsEnv = (prefix, config2) => {
|
|
3413
|
-
if (config2.foreground) {
|
|
3414
|
-
process.env[`${prefix}FOREGROUND`] = config2.foreground;
|
|
3415
|
-
}
|
|
3416
|
-
if (config2.background) {
|
|
3417
|
-
process.env[`${prefix}BACKGROUND`] = config2.background;
|
|
3418
|
-
}
|
|
3419
|
-
if (config2.brand) {
|
|
3420
|
-
process.env[`${prefix}BRAND`] = config2.brand;
|
|
3421
|
-
}
|
|
3422
|
-
if (config2.alternate) {
|
|
3423
|
-
process.env[`${prefix}ALTERNATE`] = config2.alternate;
|
|
3424
|
-
}
|
|
3425
|
-
if (config2.accent) {
|
|
3426
|
-
process.env[`${prefix}ACCENT`] = config2.accent;
|
|
3427
|
-
}
|
|
3428
|
-
if (config2.link) {
|
|
3429
|
-
process.env[`${prefix}LINK`] = config2.link;
|
|
3430
|
-
}
|
|
3431
|
-
if (config2.discovery) {
|
|
3432
|
-
process.env[`${prefix}DISCOVERY`] = config2.discovery;
|
|
3433
|
-
}
|
|
3434
|
-
if (config2.success) {
|
|
3435
|
-
process.env[`${prefix}SUCCESS`] = config2.success;
|
|
3436
|
-
}
|
|
3437
|
-
if (config2.info) {
|
|
3438
|
-
process.env[`${prefix}INFO`] = config2.info;
|
|
3439
|
-
}
|
|
3440
|
-
if (config2.debug) {
|
|
3441
|
-
process.env[`${prefix}DEBUG`] = config2.debug;
|
|
3442
|
-
}
|
|
3443
|
-
if (config2.warning) {
|
|
3444
|
-
process.env[`${prefix}WARNING`] = config2.warning;
|
|
3445
|
-
}
|
|
3446
|
-
if (config2.danger) {
|
|
3447
|
-
process.env[`${prefix}DANGER`] = config2.danger;
|
|
3448
|
-
}
|
|
3449
|
-
if (config2.fatal) {
|
|
3450
|
-
process.env[`${prefix}FATAL`] = config2.fatal;
|
|
3451
|
-
}
|
|
3452
|
-
if (config2.performance) {
|
|
3453
|
-
process.env[`${prefix}PERFORMANCE`] = config2.performance;
|
|
3454
|
-
}
|
|
3455
|
-
if (config2.positive) {
|
|
3456
|
-
process.env[`${prefix}POSITIVE`] = config2.positive;
|
|
3457
|
-
}
|
|
3458
|
-
if (config2.negative) {
|
|
3459
|
-
process.env[`${prefix}NEGATIVE`] = config2.negative;
|
|
3460
|
-
}
|
|
3461
|
-
if (config2.gradient) {
|
|
3462
|
-
for (let i = 0; i < config2.gradient.length; i++) {
|
|
3463
|
-
process.env[`${prefix}GRADIENT_${i}`] = config2.gradient[i];
|
|
3464
|
-
}
|
|
3465
|
-
}
|
|
3466
|
-
};
|
|
3467
|
-
var _static_cache = void 0;
|
|
3468
|
-
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
3469
|
-
let result;
|
|
3470
|
-
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
3471
|
-
let _workspaceRoot = workspaceRoot;
|
|
3472
|
-
if (!_workspaceRoot) {
|
|
3473
|
-
_workspaceRoot = findWorkspaceRoot();
|
|
3474
|
-
}
|
|
3475
|
-
const configEnv = getConfigEnv();
|
|
3476
|
-
const configFile = await getConfigFile(_workspaceRoot);
|
|
3477
|
-
if (!configFile) {
|
|
3478
|
-
if (!skipLogs) {
|
|
3479
|
-
writeWarning(
|
|
3480
|
-
"No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
|
|
3481
|
-
{ logLevel: "all" }
|
|
3482
|
-
);
|
|
3483
|
-
}
|
|
3484
|
-
if (useDefault === false) {
|
|
3485
|
-
return void 0;
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
|
|
3489
|
-
const configInput = defu(
|
|
3490
|
-
configEnv,
|
|
3491
|
-
configFile,
|
|
3492
|
-
defaultConfig
|
|
3493
|
-
);
|
|
3494
|
-
if (!configInput.variant) {
|
|
3495
|
-
configInput.variant = fs.existsSync(joinPaths(_workspaceRoot, "nx.json")) || fs.existsSync(joinPaths(_workspaceRoot, ".nx")) || fs.existsSync(joinPaths(_workspaceRoot, "lerna.json")) || fs.existsSync(joinPaths(_workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
|
|
3496
|
-
}
|
|
3497
|
-
try {
|
|
3498
|
-
const parseResult = await Promise.resolve(
|
|
3499
|
-
workspaceConfigSchema._zod.parse(
|
|
3500
|
-
{ value: configInput, issues: [] },
|
|
3501
|
-
{ async: true }
|
|
3502
|
-
)
|
|
3503
|
-
);
|
|
3504
|
-
result = applyDefaultConfig(parseResult.value);
|
|
3505
|
-
result.workspaceRoot ??= _workspaceRoot;
|
|
3506
|
-
} catch (error) {
|
|
3507
|
-
throw new Error(
|
|
3508
|
-
`Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
|
|
3509
|
-
|
|
3510
|
-
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${formatLogMessage(
|
|
3511
|
-
configInput
|
|
3512
|
-
)}`,
|
|
3513
|
-
{
|
|
3514
|
-
cause: error
|
|
3515
|
-
}
|
|
3516
|
-
);
|
|
3517
|
-
}
|
|
3518
|
-
} else {
|
|
3519
|
-
result = _static_cache.data;
|
|
3520
|
-
}
|
|
3521
|
-
_static_cache = {
|
|
3522
|
-
timestamp: Date.now(),
|
|
3523
|
-
data: result
|
|
3524
|
-
};
|
|
3525
|
-
return result;
|
|
3526
|
-
};
|
|
3527
|
-
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
3528
|
-
const config2 = await createStormWorkspaceConfig(
|
|
3529
|
-
void 0,
|
|
3530
|
-
void 0,
|
|
3531
|
-
workspaceRoot,
|
|
3532
|
-
skipLogs,
|
|
3533
|
-
true
|
|
3534
|
-
);
|
|
3535
|
-
setConfigEnv(config2);
|
|
3536
|
-
if (!skipLogs && !config2.skipConfigLogging) {
|
|
3537
|
-
writeTrace(
|
|
3538
|
-
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
3539
|
-
${formatLogMessage(config2)}`,
|
|
3540
|
-
config2
|
|
3541
|
-
);
|
|
3542
|
-
}
|
|
3543
|
-
return config2;
|
|
3544
|
-
};
|
|
3545
|
-
|
|
3546
|
-
// ../config-tools/src/get-config.ts
|
|
3547
|
-
function getConfig(workspaceRoot, skipLogs = false) {
|
|
3548
|
-
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
3549
|
-
}
|
|
3550
|
-
function getWorkspaceConfig(skipLogs = true, options = {}) {
|
|
3551
|
-
let workspaceRoot = options.workspaceRoot;
|
|
3552
|
-
if (!workspaceRoot) {
|
|
3553
|
-
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
3554
|
-
}
|
|
3555
|
-
return getConfig(workspaceRoot, skipLogs);
|
|
3556
|
-
}
|
|
3557
|
-
|
|
3558
|
-
exports.STORM_DEFAULT_RELEASE_BANNER = STORM_DEFAULT_RELEASE_BANNER;
|
|
3559
|
-
exports.__require = __require;
|
|
3560
|
-
exports.brandIcon = brandIcon;
|
|
3561
|
-
exports.defu = defu;
|
|
3562
|
-
exports.exitWithError = exitWithError;
|
|
3563
|
-
exports.exitWithSuccess = exitWithSuccess;
|
|
3564
|
-
exports.findWorkspaceRootSafe = findWorkspaceRootSafe;
|
|
3565
|
-
exports.formatLogMessage = formatLogMessage;
|
|
3566
|
-
exports.getConfig = getConfig;
|
|
3567
|
-
exports.getWorkspaceConfig = getWorkspaceConfig;
|
|
3568
|
-
exports.handleProcess = handleProcess;
|
|
3569
|
-
exports.isVerbose = isVerbose;
|
|
3570
|
-
exports.joinPaths = joinPaths;
|
|
3571
|
-
exports.writeDebug = writeDebug;
|
|
3572
|
-
exports.writeFatal = writeFatal;
|
|
3573
|
-
exports.writeInfo = writeInfo;
|
|
3574
|
-
exports.writeSuccess = writeSuccess;
|
|
3575
|
-
exports.writeTrace = writeTrace;
|
|
3576
|
-
exports.writeWarning = writeWarning;
|
|
3577
|
-
//# sourceMappingURL=chunk-DGRFGD2R.cjs.map
|
|
3578
|
-
//# sourceMappingURL=chunk-DGRFGD2R.cjs.map
|