@storm-software/git-tools 2.124.65 → 2.124.67
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/dist/chunk-56CSIOQW.cjs +4287 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/chunk-JEIQJXD6.js +4272 -0
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/commit/minimal.cjs +1 -0
- package/dist/commit/minimal.js +1 -0
- package/dist/commit/monorepo.cjs +1 -0
- package/dist/commit/monorepo.js +1 -0
- package/dist/commitlint/minimal.cjs +1 -0
- package/dist/commitlint/minimal.js +1 -0
- package/dist/commitlint/monorepo.cjs +1 -0
- package/dist/commitlint/monorepo.js +1 -0
- package/dist/index.cjs +9 -8
- package/dist/index.js +2 -1
- package/dist/release/config.cjs +9 -8
- package/dist/release/config.js +2 -1
- package/dist/types.cjs +1 -0
- package/dist/types.js +1 -0
- package/package.json +5 -5
- package/dist/chunk-7W6KKQAE.cjs +0 -2506
- package/dist/chunk-LCKUTJW7.js +0 -2472
|
@@ -0,0 +1,4272 @@
|
|
|
1
|
+
import { DEFAULT_MONOREPO_COMMIT_QUESTIONS } from './chunk-JCEVFJCA.js';
|
|
2
|
+
import { DEFAULT_COMMIT_TYPES } from './chunk-3GGWHKRP.js';
|
|
3
|
+
import { __export } from './chunk-MLKGABMK.js';
|
|
4
|
+
import defu from 'defu';
|
|
5
|
+
import { loadConfig } from 'c12';
|
|
6
|
+
import 'date-fns/formatDistanceToNow';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import { readFile } from 'node:fs/promises';
|
|
11
|
+
import axios2 from 'axios';
|
|
12
|
+
import DefaultChangelogRenderer from 'nx/release/changelog-renderer';
|
|
13
|
+
import { DEFAULT_CONVENTIONAL_COMMITS_CONFIG } from 'nx/src/command-line/release/config/conventional-commits';
|
|
14
|
+
import { major } from 'semver';
|
|
15
|
+
import '@nx/devkit';
|
|
16
|
+
import 'nx/src/command-line/release/utils/print-changes';
|
|
17
|
+
import 'nx/src/command-line/release/utils/shared';
|
|
18
|
+
import 'nx/src/tasks-runner/utils';
|
|
19
|
+
import 'prettier';
|
|
20
|
+
import 'node:child_process';
|
|
21
|
+
import 'node:os';
|
|
22
|
+
import 'nx/src/command-line/release/utils/remote-release-clients/github';
|
|
23
|
+
import 'yaml';
|
|
24
|
+
import 'nx/src/command-line/release/utils/exec-command.js';
|
|
25
|
+
import 'nx/src/command-line/release/utils/git';
|
|
26
|
+
|
|
27
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
28
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
29
|
+
function normalizeWindowsPath(input = "") {
|
|
30
|
+
if (!input) {
|
|
31
|
+
return input;
|
|
32
|
+
}
|
|
33
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
34
|
+
}
|
|
35
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
36
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
37
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
38
|
+
var correctPaths = function(path) {
|
|
39
|
+
if (!path || path.length === 0) {
|
|
40
|
+
return ".";
|
|
41
|
+
}
|
|
42
|
+
path = normalizeWindowsPath(path);
|
|
43
|
+
const isUNCPath = path?.match(_UNC_REGEX);
|
|
44
|
+
const isPathAbsolute = isAbsolute(path);
|
|
45
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
46
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
47
|
+
if (path.length === 0) {
|
|
48
|
+
if (isPathAbsolute) {
|
|
49
|
+
return "/";
|
|
50
|
+
}
|
|
51
|
+
return trailingSeparator ? "./" : ".";
|
|
52
|
+
}
|
|
53
|
+
if (trailingSeparator) {
|
|
54
|
+
path += "/";
|
|
55
|
+
}
|
|
56
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
57
|
+
path += "/";
|
|
58
|
+
}
|
|
59
|
+
if (isUNCPath) {
|
|
60
|
+
if (!isPathAbsolute) {
|
|
61
|
+
return `//./${path}`;
|
|
62
|
+
}
|
|
63
|
+
return `//${path}`;
|
|
64
|
+
}
|
|
65
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
66
|
+
};
|
|
67
|
+
var joinPaths = function(...segments) {
|
|
68
|
+
let path = "";
|
|
69
|
+
for (const seg of segments) {
|
|
70
|
+
if (!seg) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (path.length > 0) {
|
|
74
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
75
|
+
const segLeading = seg[0] === "/";
|
|
76
|
+
const both = pathTrailing && segLeading;
|
|
77
|
+
if (both) {
|
|
78
|
+
path += seg.slice(1);
|
|
79
|
+
} else {
|
|
80
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
path += seg;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return correctPaths(path);
|
|
87
|
+
};
|
|
88
|
+
function normalizeString(path, allowAboveRoot) {
|
|
89
|
+
let res = "";
|
|
90
|
+
let lastSegmentLength = 0;
|
|
91
|
+
let lastSlash = -1;
|
|
92
|
+
let dots = 0;
|
|
93
|
+
let char = null;
|
|
94
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
95
|
+
if (index < path.length) {
|
|
96
|
+
char = path[index];
|
|
97
|
+
} else if (char === "/") {
|
|
98
|
+
break;
|
|
99
|
+
} else {
|
|
100
|
+
char = "/";
|
|
101
|
+
}
|
|
102
|
+
if (char === "/") {
|
|
103
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
104
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
105
|
+
if (res.length > 2) {
|
|
106
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
107
|
+
if (lastSlashIndex === -1) {
|
|
108
|
+
res = "";
|
|
109
|
+
lastSegmentLength = 0;
|
|
110
|
+
} else {
|
|
111
|
+
res = res.slice(0, lastSlashIndex);
|
|
112
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
113
|
+
}
|
|
114
|
+
lastSlash = index;
|
|
115
|
+
dots = 0;
|
|
116
|
+
continue;
|
|
117
|
+
} else if (res.length > 0) {
|
|
118
|
+
res = "";
|
|
119
|
+
lastSegmentLength = 0;
|
|
120
|
+
lastSlash = index;
|
|
121
|
+
dots = 0;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (allowAboveRoot) {
|
|
126
|
+
res += res.length > 0 ? "/.." : "..";
|
|
127
|
+
lastSegmentLength = 2;
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
if (res.length > 0) {
|
|
131
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
132
|
+
} else {
|
|
133
|
+
res = path.slice(lastSlash + 1, index);
|
|
134
|
+
}
|
|
135
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
136
|
+
}
|
|
137
|
+
lastSlash = index;
|
|
138
|
+
dots = 0;
|
|
139
|
+
} else if (char === "." && dots !== -1) {
|
|
140
|
+
++dots;
|
|
141
|
+
} else {
|
|
142
|
+
dots = -1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return res;
|
|
146
|
+
}
|
|
147
|
+
var isAbsolute = function(p) {
|
|
148
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// src/utilities/omit.ts
|
|
152
|
+
function omit(obj, keys) {
|
|
153
|
+
const result = { ...obj };
|
|
154
|
+
for (let i = 0; i < keys.length; i++) {
|
|
155
|
+
const key = keys[i];
|
|
156
|
+
if (key && key in result) {
|
|
157
|
+
delete result[key];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ../config-tools/src/types.ts
|
|
164
|
+
var LogLevel = {
|
|
165
|
+
SILENT: 0,
|
|
166
|
+
FATAL: 10,
|
|
167
|
+
ERROR: 20,
|
|
168
|
+
WARN: 30,
|
|
169
|
+
SUCCESS: 35,
|
|
170
|
+
INFO: 40,
|
|
171
|
+
DEBUG: 60,
|
|
172
|
+
TRACE: 70,
|
|
173
|
+
ALL: 100
|
|
174
|
+
};
|
|
175
|
+
var LogLevelLabel = {
|
|
176
|
+
SILENT: "silent",
|
|
177
|
+
FATAL: "fatal",
|
|
178
|
+
ERROR: "error",
|
|
179
|
+
WARN: "warn",
|
|
180
|
+
SUCCESS: "success",
|
|
181
|
+
INFO: "info",
|
|
182
|
+
DEBUG: "debug",
|
|
183
|
+
TRACE: "trace",
|
|
184
|
+
ALL: "all"
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// ../config-tools/src/utilities/colors.ts
|
|
188
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
189
|
+
dark: {
|
|
190
|
+
brand: "#2dd4bf",
|
|
191
|
+
success: "#10b981",
|
|
192
|
+
info: "#58a6ff",
|
|
193
|
+
debug: "#8afafc",
|
|
194
|
+
warning: "#f3d371",
|
|
195
|
+
danger: "#D8314A",
|
|
196
|
+
fatal: "#a40e26"}
|
|
197
|
+
};
|
|
198
|
+
var chalkDefault = {
|
|
199
|
+
hex: (_) => (message) => message,
|
|
200
|
+
bgHex: (_) => ({
|
|
201
|
+
whiteBright: (message) => message,
|
|
202
|
+
white: (message) => message
|
|
203
|
+
}),
|
|
204
|
+
white: (message) => message,
|
|
205
|
+
whiteBright: (message) => message,
|
|
206
|
+
gray: (message) => message,
|
|
207
|
+
bold: {
|
|
208
|
+
hex: (_) => (message) => message,
|
|
209
|
+
bgHex: (_) => ({
|
|
210
|
+
whiteBright: (message) => message,
|
|
211
|
+
white: (message) => message
|
|
212
|
+
}),
|
|
213
|
+
whiteBright: (message) => message,
|
|
214
|
+
white: (message) => message
|
|
215
|
+
},
|
|
216
|
+
dim: {
|
|
217
|
+
hex: (_) => (message) => message,
|
|
218
|
+
gray: (message) => message
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
var getChalk = () => {
|
|
222
|
+
let _chalk = chalk;
|
|
223
|
+
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
224
|
+
_chalk = chalkDefault;
|
|
225
|
+
}
|
|
226
|
+
return _chalk;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
230
|
+
function isUnicodeSupported() {
|
|
231
|
+
if (process.platform !== "win32") {
|
|
232
|
+
return process.env.TERM !== "linux";
|
|
233
|
+
}
|
|
234
|
+
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
235
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
236
|
+
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
237
|
+
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";
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
241
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
242
|
+
var CONSOLE_ICONS = {
|
|
243
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
244
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
|
|
245
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
246
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
247
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
248
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
249
|
+
[LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
|
|
250
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
254
|
+
var formatTimestamp = (date2 = /* @__PURE__ */ new Date()) => {
|
|
255
|
+
return `${date2.toLocaleDateString()} ${date2.toLocaleTimeString()}`;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
259
|
+
var getLogLevel = (label) => {
|
|
260
|
+
switch (label) {
|
|
261
|
+
case "all":
|
|
262
|
+
return LogLevel.ALL;
|
|
263
|
+
case "trace":
|
|
264
|
+
return LogLevel.TRACE;
|
|
265
|
+
case "debug":
|
|
266
|
+
return LogLevel.DEBUG;
|
|
267
|
+
case "info":
|
|
268
|
+
return LogLevel.INFO;
|
|
269
|
+
case "warn":
|
|
270
|
+
return LogLevel.WARN;
|
|
271
|
+
case "error":
|
|
272
|
+
return LogLevel.ERROR;
|
|
273
|
+
case "fatal":
|
|
274
|
+
return LogLevel.FATAL;
|
|
275
|
+
case "silent":
|
|
276
|
+
return LogLevel.SILENT;
|
|
277
|
+
default:
|
|
278
|
+
return LogLevel.INFO;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
282
|
+
if (logLevel >= LogLevel.ALL) {
|
|
283
|
+
return LogLevelLabel.ALL;
|
|
284
|
+
}
|
|
285
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
286
|
+
return LogLevelLabel.TRACE;
|
|
287
|
+
}
|
|
288
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
289
|
+
return LogLevelLabel.DEBUG;
|
|
290
|
+
}
|
|
291
|
+
if (logLevel >= LogLevel.INFO) {
|
|
292
|
+
return LogLevelLabel.INFO;
|
|
293
|
+
}
|
|
294
|
+
if (logLevel >= LogLevel.WARN) {
|
|
295
|
+
return LogLevelLabel.WARN;
|
|
296
|
+
}
|
|
297
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
298
|
+
return LogLevelLabel.ERROR;
|
|
299
|
+
}
|
|
300
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
301
|
+
return LogLevelLabel.FATAL;
|
|
302
|
+
}
|
|
303
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
304
|
+
return LogLevelLabel.SILENT;
|
|
305
|
+
}
|
|
306
|
+
return LogLevelLabel.INFO;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// ../config-tools/src/logger/console.ts
|
|
310
|
+
var getLogFn = (logLevel = LogLevel.INFO, config2 = {}, _chalk = getChalk()) => {
|
|
311
|
+
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;
|
|
312
|
+
const configLogLevel = config2.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
313
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
314
|
+
return (_) => {
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
318
|
+
return (message) => {
|
|
319
|
+
console.error(
|
|
320
|
+
`
|
|
321
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
322
|
+
colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal
|
|
323
|
+
)(
|
|
324
|
+
`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
|
|
325
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
326
|
+
`
|
|
327
|
+
);
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
331
|
+
return (message) => {
|
|
332
|
+
console.error(
|
|
333
|
+
`
|
|
334
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
335
|
+
colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger
|
|
336
|
+
)(
|
|
337
|
+
`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
|
|
338
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
339
|
+
`
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
344
|
+
return (message) => {
|
|
345
|
+
console.warn(
|
|
346
|
+
`
|
|
347
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
348
|
+
colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning
|
|
349
|
+
)(
|
|
350
|
+
`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
|
|
351
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
352
|
+
`
|
|
353
|
+
);
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
357
|
+
return (message) => {
|
|
358
|
+
console.info(
|
|
359
|
+
`
|
|
360
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
361
|
+
colors.success ?? DEFAULT_COLOR_CONFIG.dark.success
|
|
362
|
+
)(
|
|
363
|
+
`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
|
|
364
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
365
|
+
`
|
|
366
|
+
);
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
370
|
+
return (message) => {
|
|
371
|
+
console.info(
|
|
372
|
+
`
|
|
373
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
374
|
+
colors.info ?? DEFAULT_COLOR_CONFIG.dark.info
|
|
375
|
+
)(
|
|
376
|
+
`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
|
|
377
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
378
|
+
`
|
|
379
|
+
);
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
383
|
+
return (message) => {
|
|
384
|
+
console.debug(
|
|
385
|
+
`
|
|
386
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
387
|
+
colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug
|
|
388
|
+
)(
|
|
389
|
+
`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
|
|
390
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
391
|
+
`
|
|
392
|
+
);
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
396
|
+
return (message) => {
|
|
397
|
+
console.debug(
|
|
398
|
+
`
|
|
399
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
|
|
400
|
+
`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
|
|
401
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
402
|
+
`
|
|
403
|
+
);
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
return (message) => {
|
|
407
|
+
console.log(
|
|
408
|
+
`
|
|
409
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
410
|
+
colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand
|
|
411
|
+
)(
|
|
412
|
+
`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
|
|
413
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
414
|
+
`
|
|
415
|
+
);
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
var writeWarning = (message, config2) => getLogFn(LogLevel.WARN, config2)(message);
|
|
419
|
+
var writeTrace = (message, config2) => getLogFn(LogLevel.TRACE, config2)(message);
|
|
420
|
+
var MAX_DEPTH = 6;
|
|
421
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
422
|
+
if (depth2 > MAX_DEPTH) {
|
|
423
|
+
return "<max depth>";
|
|
424
|
+
}
|
|
425
|
+
const prefix = options.prefix ?? "-";
|
|
426
|
+
const skip = options.skip ?? [];
|
|
427
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
428
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
429
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
430
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
431
|
+
message[key],
|
|
432
|
+
{ prefix: `${prefix}-`, skip },
|
|
433
|
+
depth2 + 1
|
|
434
|
+
) : message[key]}`
|
|
435
|
+
).join("\n")}` : message;
|
|
436
|
+
};
|
|
437
|
+
var _isFunction = (value) => {
|
|
438
|
+
try {
|
|
439
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
440
|
+
} catch {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
445
|
+
var depth = 0;
|
|
446
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
447
|
+
const _startPath = startPath ?? process.cwd();
|
|
448
|
+
if (endDirectoryNames.some(
|
|
449
|
+
(endDirName) => existsSync(join(_startPath, endDirName))
|
|
450
|
+
)) {
|
|
451
|
+
return _startPath;
|
|
452
|
+
}
|
|
453
|
+
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
454
|
+
return _startPath;
|
|
455
|
+
}
|
|
456
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
457
|
+
const parent = join(_startPath, "..");
|
|
458
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
459
|
+
}
|
|
460
|
+
return void 0;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
464
|
+
var rootFiles = [
|
|
465
|
+
"storm-workspace.json",
|
|
466
|
+
"storm-workspace.yaml",
|
|
467
|
+
"storm-workspace.yml",
|
|
468
|
+
"storm-workspace.js",
|
|
469
|
+
"storm-workspace.ts",
|
|
470
|
+
".storm-workspace.json",
|
|
471
|
+
".storm-workspace.yaml",
|
|
472
|
+
".storm-workspace.yml",
|
|
473
|
+
".storm-workspace.js",
|
|
474
|
+
".storm-workspace.ts",
|
|
475
|
+
"lerna.json",
|
|
476
|
+
"nx.json",
|
|
477
|
+
"turbo.json",
|
|
478
|
+
"npm-workspace.json",
|
|
479
|
+
"yarn-workspace.json",
|
|
480
|
+
"pnpm-workspace.json",
|
|
481
|
+
"npm-workspace.yaml",
|
|
482
|
+
"yarn-workspace.yaml",
|
|
483
|
+
"pnpm-workspace.yaml",
|
|
484
|
+
"npm-workspace.yml",
|
|
485
|
+
"yarn-workspace.yml",
|
|
486
|
+
"pnpm-workspace.yml",
|
|
487
|
+
"npm-lock.json",
|
|
488
|
+
"yarn-lock.json",
|
|
489
|
+
"pnpm-lock.json",
|
|
490
|
+
"npm-lock.yaml",
|
|
491
|
+
"yarn-lock.yaml",
|
|
492
|
+
"pnpm-lock.yaml",
|
|
493
|
+
"npm-lock.yml",
|
|
494
|
+
"yarn-lock.yml",
|
|
495
|
+
"pnpm-lock.yml",
|
|
496
|
+
"bun.lockb"
|
|
497
|
+
];
|
|
498
|
+
var rootDirectories = [
|
|
499
|
+
".storm-workspace",
|
|
500
|
+
".nx",
|
|
501
|
+
".git",
|
|
502
|
+
".github",
|
|
503
|
+
".vscode",
|
|
504
|
+
".verdaccio"
|
|
505
|
+
];
|
|
506
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
507
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
508
|
+
return correctPaths(
|
|
509
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
return correctPaths(
|
|
513
|
+
findFolderUp(
|
|
514
|
+
pathInsideMonorepo ?? process.cwd(),
|
|
515
|
+
rootFiles,
|
|
516
|
+
rootDirectories
|
|
517
|
+
)
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
521
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
522
|
+
if (!result) {
|
|
523
|
+
throw new Error(
|
|
524
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
525
|
+
${rootFiles.join(
|
|
526
|
+
"\n"
|
|
527
|
+
)}
|
|
528
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
return result;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// ../config/src/constants.ts
|
|
535
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
536
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
537
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
538
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
539
|
+
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
540
|
+
var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
|
|
541
|
+
// @__NO_SIDE_EFFECTS__
|
|
542
|
+
function $constructor(name, initializer2, params) {
|
|
543
|
+
function init(inst, def) {
|
|
544
|
+
if (!inst._zod) {
|
|
545
|
+
Object.defineProperty(inst, "_zod", {
|
|
546
|
+
value: {
|
|
547
|
+
def,
|
|
548
|
+
constr: _,
|
|
549
|
+
traits: /* @__PURE__ */ new Set()
|
|
550
|
+
},
|
|
551
|
+
enumerable: false
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
if (inst._zod.traits.has(name)) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
inst._zod.traits.add(name);
|
|
558
|
+
initializer2(inst, def);
|
|
559
|
+
const proto = _.prototype;
|
|
560
|
+
const keys = Object.keys(proto);
|
|
561
|
+
for (let i = 0; i < keys.length; i++) {
|
|
562
|
+
const k = keys[i];
|
|
563
|
+
if (!(k in inst)) {
|
|
564
|
+
inst[k] = proto[k].bind(inst);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
const Parent = params?.Parent ?? Object;
|
|
569
|
+
class Definition extends Parent {
|
|
570
|
+
}
|
|
571
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
572
|
+
function _(def) {
|
|
573
|
+
var _a2;
|
|
574
|
+
const inst = params?.Parent ? new Definition() : this;
|
|
575
|
+
init(inst, def);
|
|
576
|
+
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
577
|
+
for (const fn of inst._zod.deferred) {
|
|
578
|
+
fn();
|
|
579
|
+
}
|
|
580
|
+
return inst;
|
|
581
|
+
}
|
|
582
|
+
Object.defineProperty(_, "init", { value: init });
|
|
583
|
+
Object.defineProperty(_, Symbol.hasInstance, {
|
|
584
|
+
value: (inst) => {
|
|
585
|
+
if (params?.Parent && inst instanceof params.Parent)
|
|
586
|
+
return true;
|
|
587
|
+
return inst?._zod?.traits?.has(name);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
Object.defineProperty(_, "name", { value: name });
|
|
591
|
+
return _;
|
|
592
|
+
}
|
|
593
|
+
var $ZodAsyncError = class extends Error {
|
|
594
|
+
constructor() {
|
|
595
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
var globalConfig = {};
|
|
599
|
+
function config(newConfig) {
|
|
600
|
+
return globalConfig;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/util.js
|
|
604
|
+
var util_exports = {};
|
|
605
|
+
__export(util_exports, {
|
|
606
|
+
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
607
|
+
Class: () => Class,
|
|
608
|
+
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
609
|
+
aborted: () => aborted,
|
|
610
|
+
allowsEval: () => allowsEval,
|
|
611
|
+
assert: () => assert,
|
|
612
|
+
assertEqual: () => assertEqual,
|
|
613
|
+
assertIs: () => assertIs,
|
|
614
|
+
assertNever: () => assertNever,
|
|
615
|
+
assertNotEqual: () => assertNotEqual,
|
|
616
|
+
assignProp: () => assignProp,
|
|
617
|
+
base64ToUint8Array: () => base64ToUint8Array,
|
|
618
|
+
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
619
|
+
cached: () => cached,
|
|
620
|
+
captureStackTrace: () => captureStackTrace,
|
|
621
|
+
cleanEnum: () => cleanEnum,
|
|
622
|
+
cleanRegex: () => cleanRegex,
|
|
623
|
+
clone: () => clone,
|
|
624
|
+
cloneDef: () => cloneDef,
|
|
625
|
+
createTransparentProxy: () => createTransparentProxy,
|
|
626
|
+
defineLazy: () => defineLazy,
|
|
627
|
+
esc: () => esc,
|
|
628
|
+
escapeRegex: () => escapeRegex,
|
|
629
|
+
extend: () => extend,
|
|
630
|
+
finalizeIssue: () => finalizeIssue,
|
|
631
|
+
floatSafeRemainder: () => floatSafeRemainder,
|
|
632
|
+
getElementAtPath: () => getElementAtPath,
|
|
633
|
+
getEnumValues: () => getEnumValues,
|
|
634
|
+
getLengthableOrigin: () => getLengthableOrigin,
|
|
635
|
+
getParsedType: () => getParsedType,
|
|
636
|
+
getSizableOrigin: () => getSizableOrigin,
|
|
637
|
+
hexToUint8Array: () => hexToUint8Array,
|
|
638
|
+
isObject: () => isObject,
|
|
639
|
+
isPlainObject: () => isPlainObject,
|
|
640
|
+
issue: () => issue,
|
|
641
|
+
joinValues: () => joinValues,
|
|
642
|
+
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
643
|
+
merge: () => merge,
|
|
644
|
+
mergeDefs: () => mergeDefs,
|
|
645
|
+
normalizeParams: () => normalizeParams,
|
|
646
|
+
nullish: () => nullish,
|
|
647
|
+
numKeys: () => numKeys,
|
|
648
|
+
objectClone: () => objectClone,
|
|
649
|
+
omit: () => omit2,
|
|
650
|
+
optionalKeys: () => optionalKeys,
|
|
651
|
+
partial: () => partial,
|
|
652
|
+
pick: () => pick,
|
|
653
|
+
prefixIssues: () => prefixIssues,
|
|
654
|
+
primitiveTypes: () => primitiveTypes,
|
|
655
|
+
promiseAllObject: () => promiseAllObject,
|
|
656
|
+
propertyKeyTypes: () => propertyKeyTypes,
|
|
657
|
+
randomString: () => randomString,
|
|
658
|
+
required: () => required,
|
|
659
|
+
safeExtend: () => safeExtend,
|
|
660
|
+
shallowClone: () => shallowClone,
|
|
661
|
+
slugify: () => slugify,
|
|
662
|
+
stringifyPrimitive: () => stringifyPrimitive,
|
|
663
|
+
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
664
|
+
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
665
|
+
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
666
|
+
unwrapMessage: () => unwrapMessage
|
|
667
|
+
});
|
|
668
|
+
function assertEqual(val) {
|
|
669
|
+
return val;
|
|
670
|
+
}
|
|
671
|
+
function assertNotEqual(val) {
|
|
672
|
+
return val;
|
|
673
|
+
}
|
|
674
|
+
function assertIs(_arg) {
|
|
675
|
+
}
|
|
676
|
+
function assertNever(_x) {
|
|
677
|
+
throw new Error("Unexpected value in exhaustive check");
|
|
678
|
+
}
|
|
679
|
+
function assert(_) {
|
|
680
|
+
}
|
|
681
|
+
function getEnumValues(entries) {
|
|
682
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
683
|
+
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
684
|
+
return values;
|
|
685
|
+
}
|
|
686
|
+
function joinValues(array2, separator = "|") {
|
|
687
|
+
return array2.map((val) => stringifyPrimitive(val)).join(separator);
|
|
688
|
+
}
|
|
689
|
+
function jsonStringifyReplacer(_, value) {
|
|
690
|
+
if (typeof value === "bigint")
|
|
691
|
+
return value.toString();
|
|
692
|
+
return value;
|
|
693
|
+
}
|
|
694
|
+
function cached(getter) {
|
|
695
|
+
return {
|
|
696
|
+
get value() {
|
|
697
|
+
{
|
|
698
|
+
const value = getter();
|
|
699
|
+
Object.defineProperty(this, "value", { value });
|
|
700
|
+
return value;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
function nullish(input) {
|
|
706
|
+
return input === null || input === void 0;
|
|
707
|
+
}
|
|
708
|
+
function cleanRegex(source) {
|
|
709
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
710
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
711
|
+
return source.slice(start, end);
|
|
712
|
+
}
|
|
713
|
+
function floatSafeRemainder(val, step) {
|
|
714
|
+
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
715
|
+
const stepString = step.toString();
|
|
716
|
+
let stepDecCount = (stepString.split(".")[1] || "").length;
|
|
717
|
+
if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
|
|
718
|
+
const match = stepString.match(/\d?e-(\d?)/);
|
|
719
|
+
if (match?.[1]) {
|
|
720
|
+
stepDecCount = Number.parseInt(match[1]);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
724
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
725
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
726
|
+
return valInt % stepInt / 10 ** decCount;
|
|
727
|
+
}
|
|
728
|
+
var EVALUATING = Symbol("evaluating");
|
|
729
|
+
function defineLazy(object2, key, getter) {
|
|
730
|
+
let value = void 0;
|
|
731
|
+
Object.defineProperty(object2, key, {
|
|
732
|
+
get() {
|
|
733
|
+
if (value === EVALUATING) {
|
|
734
|
+
return void 0;
|
|
735
|
+
}
|
|
736
|
+
if (value === void 0) {
|
|
737
|
+
value = EVALUATING;
|
|
738
|
+
value = getter();
|
|
739
|
+
}
|
|
740
|
+
return value;
|
|
741
|
+
},
|
|
742
|
+
set(v) {
|
|
743
|
+
Object.defineProperty(object2, key, {
|
|
744
|
+
value: v
|
|
745
|
+
// configurable: true,
|
|
746
|
+
});
|
|
747
|
+
},
|
|
748
|
+
configurable: true
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
function objectClone(obj) {
|
|
752
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
753
|
+
}
|
|
754
|
+
function assignProp(target, prop, value) {
|
|
755
|
+
Object.defineProperty(target, prop, {
|
|
756
|
+
value,
|
|
757
|
+
writable: true,
|
|
758
|
+
enumerable: true,
|
|
759
|
+
configurable: true
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
function mergeDefs(...defs) {
|
|
763
|
+
const mergedDescriptors = {};
|
|
764
|
+
for (const def of defs) {
|
|
765
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
766
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
767
|
+
}
|
|
768
|
+
return Object.defineProperties({}, mergedDescriptors);
|
|
769
|
+
}
|
|
770
|
+
function cloneDef(schema) {
|
|
771
|
+
return mergeDefs(schema._zod.def);
|
|
772
|
+
}
|
|
773
|
+
function getElementAtPath(obj, path) {
|
|
774
|
+
if (!path)
|
|
775
|
+
return obj;
|
|
776
|
+
return path.reduce((acc, key) => acc?.[key], obj);
|
|
777
|
+
}
|
|
778
|
+
function promiseAllObject(promisesObj) {
|
|
779
|
+
const keys = Object.keys(promisesObj);
|
|
780
|
+
const promises = keys.map((key) => promisesObj[key]);
|
|
781
|
+
return Promise.all(promises).then((results) => {
|
|
782
|
+
const resolvedObj = {};
|
|
783
|
+
for (let i = 0; i < keys.length; i++) {
|
|
784
|
+
resolvedObj[keys[i]] = results[i];
|
|
785
|
+
}
|
|
786
|
+
return resolvedObj;
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
function randomString(length = 10) {
|
|
790
|
+
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
791
|
+
let str = "";
|
|
792
|
+
for (let i = 0; i < length; i++) {
|
|
793
|
+
str += chars[Math.floor(Math.random() * chars.length)];
|
|
794
|
+
}
|
|
795
|
+
return str;
|
|
796
|
+
}
|
|
797
|
+
function esc(str) {
|
|
798
|
+
return JSON.stringify(str);
|
|
799
|
+
}
|
|
800
|
+
function slugify(input) {
|
|
801
|
+
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
802
|
+
}
|
|
803
|
+
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
804
|
+
};
|
|
805
|
+
function isObject(data) {
|
|
806
|
+
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
807
|
+
}
|
|
808
|
+
var allowsEval = cached(() => {
|
|
809
|
+
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
810
|
+
return false;
|
|
811
|
+
}
|
|
812
|
+
try {
|
|
813
|
+
const F = Function;
|
|
814
|
+
new F("");
|
|
815
|
+
return true;
|
|
816
|
+
} catch (_) {
|
|
817
|
+
return false;
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
function isPlainObject(o) {
|
|
821
|
+
if (isObject(o) === false)
|
|
822
|
+
return false;
|
|
823
|
+
const ctor = o.constructor;
|
|
824
|
+
if (ctor === void 0)
|
|
825
|
+
return true;
|
|
826
|
+
if (typeof ctor !== "function")
|
|
827
|
+
return true;
|
|
828
|
+
const prot = ctor.prototype;
|
|
829
|
+
if (isObject(prot) === false)
|
|
830
|
+
return false;
|
|
831
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
832
|
+
return false;
|
|
833
|
+
}
|
|
834
|
+
return true;
|
|
835
|
+
}
|
|
836
|
+
function shallowClone(o) {
|
|
837
|
+
if (isPlainObject(o))
|
|
838
|
+
return { ...o };
|
|
839
|
+
if (Array.isArray(o))
|
|
840
|
+
return [...o];
|
|
841
|
+
return o;
|
|
842
|
+
}
|
|
843
|
+
function numKeys(data) {
|
|
844
|
+
let keyCount = 0;
|
|
845
|
+
for (const key in data) {
|
|
846
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
847
|
+
keyCount++;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return keyCount;
|
|
851
|
+
}
|
|
852
|
+
var getParsedType = (data) => {
|
|
853
|
+
const t = typeof data;
|
|
854
|
+
switch (t) {
|
|
855
|
+
case "undefined":
|
|
856
|
+
return "undefined";
|
|
857
|
+
case "string":
|
|
858
|
+
return "string";
|
|
859
|
+
case "number":
|
|
860
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
861
|
+
case "boolean":
|
|
862
|
+
return "boolean";
|
|
863
|
+
case "function":
|
|
864
|
+
return "function";
|
|
865
|
+
case "bigint":
|
|
866
|
+
return "bigint";
|
|
867
|
+
case "symbol":
|
|
868
|
+
return "symbol";
|
|
869
|
+
case "object":
|
|
870
|
+
if (Array.isArray(data)) {
|
|
871
|
+
return "array";
|
|
872
|
+
}
|
|
873
|
+
if (data === null) {
|
|
874
|
+
return "null";
|
|
875
|
+
}
|
|
876
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
877
|
+
return "promise";
|
|
878
|
+
}
|
|
879
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
880
|
+
return "map";
|
|
881
|
+
}
|
|
882
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
883
|
+
return "set";
|
|
884
|
+
}
|
|
885
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
886
|
+
return "date";
|
|
887
|
+
}
|
|
888
|
+
if (typeof File !== "undefined" && data instanceof File) {
|
|
889
|
+
return "file";
|
|
890
|
+
}
|
|
891
|
+
return "object";
|
|
892
|
+
default:
|
|
893
|
+
throw new Error(`Unknown data type: ${t}`);
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
897
|
+
var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
|
|
898
|
+
function escapeRegex(str) {
|
|
899
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
900
|
+
}
|
|
901
|
+
function clone(inst, def, params) {
|
|
902
|
+
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
903
|
+
if (!def || params?.parent)
|
|
904
|
+
cl._zod.parent = inst;
|
|
905
|
+
return cl;
|
|
906
|
+
}
|
|
907
|
+
function normalizeParams(_params) {
|
|
908
|
+
const params = _params;
|
|
909
|
+
if (!params)
|
|
910
|
+
return {};
|
|
911
|
+
if (typeof params === "string")
|
|
912
|
+
return { error: () => params };
|
|
913
|
+
if (params?.message !== void 0) {
|
|
914
|
+
if (params?.error !== void 0)
|
|
915
|
+
throw new Error("Cannot specify both `message` and `error` params");
|
|
916
|
+
params.error = params.message;
|
|
917
|
+
}
|
|
918
|
+
delete params.message;
|
|
919
|
+
if (typeof params.error === "string")
|
|
920
|
+
return { ...params, error: () => params.error };
|
|
921
|
+
return params;
|
|
922
|
+
}
|
|
923
|
+
function createTransparentProxy(getter) {
|
|
924
|
+
let target;
|
|
925
|
+
return new Proxy({}, {
|
|
926
|
+
get(_, prop, receiver) {
|
|
927
|
+
target ?? (target = getter());
|
|
928
|
+
return Reflect.get(target, prop, receiver);
|
|
929
|
+
},
|
|
930
|
+
set(_, prop, value, receiver) {
|
|
931
|
+
target ?? (target = getter());
|
|
932
|
+
return Reflect.set(target, prop, value, receiver);
|
|
933
|
+
},
|
|
934
|
+
has(_, prop) {
|
|
935
|
+
target ?? (target = getter());
|
|
936
|
+
return Reflect.has(target, prop);
|
|
937
|
+
},
|
|
938
|
+
deleteProperty(_, prop) {
|
|
939
|
+
target ?? (target = getter());
|
|
940
|
+
return Reflect.deleteProperty(target, prop);
|
|
941
|
+
},
|
|
942
|
+
ownKeys(_) {
|
|
943
|
+
target ?? (target = getter());
|
|
944
|
+
return Reflect.ownKeys(target);
|
|
945
|
+
},
|
|
946
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
947
|
+
target ?? (target = getter());
|
|
948
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
949
|
+
},
|
|
950
|
+
defineProperty(_, prop, descriptor) {
|
|
951
|
+
target ?? (target = getter());
|
|
952
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
function stringifyPrimitive(value) {
|
|
957
|
+
if (typeof value === "bigint")
|
|
958
|
+
return value.toString() + "n";
|
|
959
|
+
if (typeof value === "string")
|
|
960
|
+
return `"${value}"`;
|
|
961
|
+
return `${value}`;
|
|
962
|
+
}
|
|
963
|
+
function optionalKeys(shape) {
|
|
964
|
+
return Object.keys(shape).filter((k) => {
|
|
965
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
var NUMBER_FORMAT_RANGES = {
|
|
969
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
970
|
+
int32: [-2147483648, 2147483647],
|
|
971
|
+
uint32: [0, 4294967295],
|
|
972
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
973
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
974
|
+
};
|
|
975
|
+
var BIGINT_FORMAT_RANGES = {
|
|
976
|
+
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
977
|
+
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
978
|
+
};
|
|
979
|
+
function pick(schema, mask) {
|
|
980
|
+
const currDef = schema._zod.def;
|
|
981
|
+
const def = mergeDefs(schema._zod.def, {
|
|
982
|
+
get shape() {
|
|
983
|
+
const newShape = {};
|
|
984
|
+
for (const key in mask) {
|
|
985
|
+
if (!(key in currDef.shape)) {
|
|
986
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
987
|
+
}
|
|
988
|
+
if (!mask[key])
|
|
989
|
+
continue;
|
|
990
|
+
newShape[key] = currDef.shape[key];
|
|
991
|
+
}
|
|
992
|
+
assignProp(this, "shape", newShape);
|
|
993
|
+
return newShape;
|
|
994
|
+
},
|
|
995
|
+
checks: []
|
|
996
|
+
});
|
|
997
|
+
return clone(schema, def);
|
|
998
|
+
}
|
|
999
|
+
function omit2(schema, mask) {
|
|
1000
|
+
const currDef = schema._zod.def;
|
|
1001
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1002
|
+
get shape() {
|
|
1003
|
+
const newShape = { ...schema._zod.def.shape };
|
|
1004
|
+
for (const key in mask) {
|
|
1005
|
+
if (!(key in currDef.shape)) {
|
|
1006
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1007
|
+
}
|
|
1008
|
+
if (!mask[key])
|
|
1009
|
+
continue;
|
|
1010
|
+
delete newShape[key];
|
|
1011
|
+
}
|
|
1012
|
+
assignProp(this, "shape", newShape);
|
|
1013
|
+
return newShape;
|
|
1014
|
+
},
|
|
1015
|
+
checks: []
|
|
1016
|
+
});
|
|
1017
|
+
return clone(schema, def);
|
|
1018
|
+
}
|
|
1019
|
+
function extend(schema, shape) {
|
|
1020
|
+
if (!isPlainObject(shape)) {
|
|
1021
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
1022
|
+
}
|
|
1023
|
+
const checks = schema._zod.def.checks;
|
|
1024
|
+
const hasChecks = checks && checks.length > 0;
|
|
1025
|
+
if (hasChecks) {
|
|
1026
|
+
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
1027
|
+
}
|
|
1028
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1029
|
+
get shape() {
|
|
1030
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1031
|
+
assignProp(this, "shape", _shape);
|
|
1032
|
+
return _shape;
|
|
1033
|
+
},
|
|
1034
|
+
checks: []
|
|
1035
|
+
});
|
|
1036
|
+
return clone(schema, def);
|
|
1037
|
+
}
|
|
1038
|
+
function safeExtend(schema, shape) {
|
|
1039
|
+
if (!isPlainObject(shape)) {
|
|
1040
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
1041
|
+
}
|
|
1042
|
+
const def = {
|
|
1043
|
+
...schema._zod.def,
|
|
1044
|
+
get shape() {
|
|
1045
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
1046
|
+
assignProp(this, "shape", _shape);
|
|
1047
|
+
return _shape;
|
|
1048
|
+
},
|
|
1049
|
+
checks: schema._zod.def.checks
|
|
1050
|
+
};
|
|
1051
|
+
return clone(schema, def);
|
|
1052
|
+
}
|
|
1053
|
+
function merge(a, b) {
|
|
1054
|
+
const def = mergeDefs(a._zod.def, {
|
|
1055
|
+
get shape() {
|
|
1056
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
1057
|
+
assignProp(this, "shape", _shape);
|
|
1058
|
+
return _shape;
|
|
1059
|
+
},
|
|
1060
|
+
get catchall() {
|
|
1061
|
+
return b._zod.def.catchall;
|
|
1062
|
+
},
|
|
1063
|
+
checks: []
|
|
1064
|
+
// delete existing checks
|
|
1065
|
+
});
|
|
1066
|
+
return clone(a, def);
|
|
1067
|
+
}
|
|
1068
|
+
function partial(Class2, schema, mask) {
|
|
1069
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1070
|
+
get shape() {
|
|
1071
|
+
const oldShape = schema._zod.def.shape;
|
|
1072
|
+
const shape = { ...oldShape };
|
|
1073
|
+
if (mask) {
|
|
1074
|
+
for (const key in mask) {
|
|
1075
|
+
if (!(key in oldShape)) {
|
|
1076
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1077
|
+
}
|
|
1078
|
+
if (!mask[key])
|
|
1079
|
+
continue;
|
|
1080
|
+
shape[key] = Class2 ? new Class2({
|
|
1081
|
+
type: "optional",
|
|
1082
|
+
innerType: oldShape[key]
|
|
1083
|
+
}) : oldShape[key];
|
|
1084
|
+
}
|
|
1085
|
+
} else {
|
|
1086
|
+
for (const key in oldShape) {
|
|
1087
|
+
shape[key] = Class2 ? new Class2({
|
|
1088
|
+
type: "optional",
|
|
1089
|
+
innerType: oldShape[key]
|
|
1090
|
+
}) : oldShape[key];
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
assignProp(this, "shape", shape);
|
|
1094
|
+
return shape;
|
|
1095
|
+
},
|
|
1096
|
+
checks: []
|
|
1097
|
+
});
|
|
1098
|
+
return clone(schema, def);
|
|
1099
|
+
}
|
|
1100
|
+
function required(Class2, schema, mask) {
|
|
1101
|
+
const def = mergeDefs(schema._zod.def, {
|
|
1102
|
+
get shape() {
|
|
1103
|
+
const oldShape = schema._zod.def.shape;
|
|
1104
|
+
const shape = { ...oldShape };
|
|
1105
|
+
if (mask) {
|
|
1106
|
+
for (const key in mask) {
|
|
1107
|
+
if (!(key in shape)) {
|
|
1108
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
1109
|
+
}
|
|
1110
|
+
if (!mask[key])
|
|
1111
|
+
continue;
|
|
1112
|
+
shape[key] = new Class2({
|
|
1113
|
+
type: "nonoptional",
|
|
1114
|
+
innerType: oldShape[key]
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
} else {
|
|
1118
|
+
for (const key in oldShape) {
|
|
1119
|
+
shape[key] = new Class2({
|
|
1120
|
+
type: "nonoptional",
|
|
1121
|
+
innerType: oldShape[key]
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
assignProp(this, "shape", shape);
|
|
1126
|
+
return shape;
|
|
1127
|
+
},
|
|
1128
|
+
checks: []
|
|
1129
|
+
});
|
|
1130
|
+
return clone(schema, def);
|
|
1131
|
+
}
|
|
1132
|
+
function aborted(x, startIndex = 0) {
|
|
1133
|
+
if (x.aborted === true)
|
|
1134
|
+
return true;
|
|
1135
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
1136
|
+
if (x.issues[i]?.continue !== true) {
|
|
1137
|
+
return true;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return false;
|
|
1141
|
+
}
|
|
1142
|
+
function prefixIssues(path, issues) {
|
|
1143
|
+
return issues.map((iss) => {
|
|
1144
|
+
var _a2;
|
|
1145
|
+
(_a2 = iss).path ?? (_a2.path = []);
|
|
1146
|
+
iss.path.unshift(path);
|
|
1147
|
+
return iss;
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
function unwrapMessage(message) {
|
|
1151
|
+
return typeof message === "string" ? message : message?.message;
|
|
1152
|
+
}
|
|
1153
|
+
function finalizeIssue(iss, ctx, config2) {
|
|
1154
|
+
const full = { ...iss, path: iss.path ?? [] };
|
|
1155
|
+
if (!iss.message) {
|
|
1156
|
+
const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
1157
|
+
full.message = message;
|
|
1158
|
+
}
|
|
1159
|
+
delete full.inst;
|
|
1160
|
+
delete full.continue;
|
|
1161
|
+
if (!ctx?.reportInput) {
|
|
1162
|
+
delete full.input;
|
|
1163
|
+
}
|
|
1164
|
+
return full;
|
|
1165
|
+
}
|
|
1166
|
+
function getSizableOrigin(input) {
|
|
1167
|
+
if (input instanceof Set)
|
|
1168
|
+
return "set";
|
|
1169
|
+
if (input instanceof Map)
|
|
1170
|
+
return "map";
|
|
1171
|
+
if (input instanceof File)
|
|
1172
|
+
return "file";
|
|
1173
|
+
return "unknown";
|
|
1174
|
+
}
|
|
1175
|
+
function getLengthableOrigin(input) {
|
|
1176
|
+
if (Array.isArray(input))
|
|
1177
|
+
return "array";
|
|
1178
|
+
if (typeof input === "string")
|
|
1179
|
+
return "string";
|
|
1180
|
+
return "unknown";
|
|
1181
|
+
}
|
|
1182
|
+
function issue(...args) {
|
|
1183
|
+
const [iss, input, inst] = args;
|
|
1184
|
+
if (typeof iss === "string") {
|
|
1185
|
+
return {
|
|
1186
|
+
message: iss,
|
|
1187
|
+
code: "custom",
|
|
1188
|
+
input,
|
|
1189
|
+
inst
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
return { ...iss };
|
|
1193
|
+
}
|
|
1194
|
+
function cleanEnum(obj) {
|
|
1195
|
+
return Object.entries(obj).filter(([k, _]) => {
|
|
1196
|
+
return Number.isNaN(Number.parseInt(k, 10));
|
|
1197
|
+
}).map((el) => el[1]);
|
|
1198
|
+
}
|
|
1199
|
+
function base64ToUint8Array(base642) {
|
|
1200
|
+
const binaryString = atob(base642);
|
|
1201
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
1202
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
1203
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
1204
|
+
}
|
|
1205
|
+
return bytes;
|
|
1206
|
+
}
|
|
1207
|
+
function uint8ArrayToBase64(bytes) {
|
|
1208
|
+
let binaryString = "";
|
|
1209
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1210
|
+
binaryString += String.fromCharCode(bytes[i]);
|
|
1211
|
+
}
|
|
1212
|
+
return btoa(binaryString);
|
|
1213
|
+
}
|
|
1214
|
+
function base64urlToUint8Array(base64url2) {
|
|
1215
|
+
const base642 = base64url2.replace(/-/g, "+").replace(/_/g, "/");
|
|
1216
|
+
const padding = "=".repeat((4 - base642.length % 4) % 4);
|
|
1217
|
+
return base64ToUint8Array(base642 + padding);
|
|
1218
|
+
}
|
|
1219
|
+
function uint8ArrayToBase64url(bytes) {
|
|
1220
|
+
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1221
|
+
}
|
|
1222
|
+
function hexToUint8Array(hex) {
|
|
1223
|
+
const cleanHex = hex.replace(/^0x/, "");
|
|
1224
|
+
if (cleanHex.length % 2 !== 0) {
|
|
1225
|
+
throw new Error("Invalid hex string length");
|
|
1226
|
+
}
|
|
1227
|
+
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
1228
|
+
for (let i = 0; i < cleanHex.length; i += 2) {
|
|
1229
|
+
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
1230
|
+
}
|
|
1231
|
+
return bytes;
|
|
1232
|
+
}
|
|
1233
|
+
function uint8ArrayToHex(bytes) {
|
|
1234
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1235
|
+
}
|
|
1236
|
+
var Class = class {
|
|
1237
|
+
constructor(..._args) {
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/errors.js
|
|
1242
|
+
var initializer = (inst, def) => {
|
|
1243
|
+
inst.name = "$ZodError";
|
|
1244
|
+
Object.defineProperty(inst, "_zod", {
|
|
1245
|
+
value: inst._zod,
|
|
1246
|
+
enumerable: false
|
|
1247
|
+
});
|
|
1248
|
+
Object.defineProperty(inst, "issues", {
|
|
1249
|
+
value: def,
|
|
1250
|
+
enumerable: false
|
|
1251
|
+
});
|
|
1252
|
+
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
1253
|
+
Object.defineProperty(inst, "toString", {
|
|
1254
|
+
value: () => inst.message,
|
|
1255
|
+
enumerable: false
|
|
1256
|
+
});
|
|
1257
|
+
};
|
|
1258
|
+
var $ZodError = $constructor("$ZodError", initializer);
|
|
1259
|
+
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
1260
|
+
|
|
1261
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/parse.js
|
|
1262
|
+
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
1263
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
1264
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1265
|
+
if (result instanceof Promise) {
|
|
1266
|
+
throw new $ZodAsyncError();
|
|
1267
|
+
}
|
|
1268
|
+
if (result.issues.length) {
|
|
1269
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1270
|
+
captureStackTrace(e, _params?.callee);
|
|
1271
|
+
throw e;
|
|
1272
|
+
}
|
|
1273
|
+
return result.value;
|
|
1274
|
+
};
|
|
1275
|
+
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
1276
|
+
var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
1277
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
1278
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1279
|
+
if (result instanceof Promise)
|
|
1280
|
+
result = await result;
|
|
1281
|
+
if (result.issues.length) {
|
|
1282
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
1283
|
+
captureStackTrace(e, params?.callee);
|
|
1284
|
+
throw e;
|
|
1285
|
+
}
|
|
1286
|
+
return result.value;
|
|
1287
|
+
};
|
|
1288
|
+
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
1289
|
+
var _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
1290
|
+
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
1291
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1292
|
+
if (result instanceof Promise) {
|
|
1293
|
+
throw new $ZodAsyncError();
|
|
1294
|
+
}
|
|
1295
|
+
return result.issues.length ? {
|
|
1296
|
+
success: false,
|
|
1297
|
+
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1298
|
+
} : { success: true, data: result.value };
|
|
1299
|
+
};
|
|
1300
|
+
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
1301
|
+
var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1302
|
+
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
1303
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
1304
|
+
if (result instanceof Promise)
|
|
1305
|
+
result = await result;
|
|
1306
|
+
return result.issues.length ? {
|
|
1307
|
+
success: false,
|
|
1308
|
+
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1309
|
+
} : { success: true, data: result.value };
|
|
1310
|
+
};
|
|
1311
|
+
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
1312
|
+
var string = (params) => {
|
|
1313
|
+
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
1314
|
+
return new RegExp(`^${regex}$`);
|
|
1315
|
+
};
|
|
1316
|
+
var boolean = /^(?:true|false)$/i;
|
|
1317
|
+
|
|
1318
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/checks.js
|
|
1319
|
+
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1320
|
+
var _a2;
|
|
1321
|
+
inst._zod ?? (inst._zod = {});
|
|
1322
|
+
inst._zod.def = def;
|
|
1323
|
+
(_a2 = inst._zod).onattach ?? (_a2.onattach = []);
|
|
1324
|
+
});
|
|
1325
|
+
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
1326
|
+
var _a2;
|
|
1327
|
+
$ZodCheck.init(inst, def);
|
|
1328
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
1329
|
+
const val = payload.value;
|
|
1330
|
+
return !nullish(val) && val.length !== void 0;
|
|
1331
|
+
});
|
|
1332
|
+
inst._zod.onattach.push((inst2) => {
|
|
1333
|
+
const bag = inst2._zod.bag;
|
|
1334
|
+
bag.minimum = def.length;
|
|
1335
|
+
bag.maximum = def.length;
|
|
1336
|
+
bag.length = def.length;
|
|
1337
|
+
});
|
|
1338
|
+
inst._zod.check = (payload) => {
|
|
1339
|
+
const input = payload.value;
|
|
1340
|
+
const length = input.length;
|
|
1341
|
+
if (length === def.length)
|
|
1342
|
+
return;
|
|
1343
|
+
const origin = getLengthableOrigin(input);
|
|
1344
|
+
const tooBig = length > def.length;
|
|
1345
|
+
payload.issues.push({
|
|
1346
|
+
origin,
|
|
1347
|
+
...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
|
|
1348
|
+
inclusive: true,
|
|
1349
|
+
exact: true,
|
|
1350
|
+
input: payload.value,
|
|
1351
|
+
inst,
|
|
1352
|
+
continue: !def.abort
|
|
1353
|
+
});
|
|
1354
|
+
};
|
|
1355
|
+
});
|
|
1356
|
+
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1357
|
+
var _a2, _b;
|
|
1358
|
+
$ZodCheck.init(inst, def);
|
|
1359
|
+
inst._zod.onattach.push((inst2) => {
|
|
1360
|
+
const bag = inst2._zod.bag;
|
|
1361
|
+
bag.format = def.format;
|
|
1362
|
+
if (def.pattern) {
|
|
1363
|
+
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1364
|
+
bag.patterns.add(def.pattern);
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
if (def.pattern)
|
|
1368
|
+
(_a2 = inst._zod).check ?? (_a2.check = (payload) => {
|
|
1369
|
+
def.pattern.lastIndex = 0;
|
|
1370
|
+
if (def.pattern.test(payload.value))
|
|
1371
|
+
return;
|
|
1372
|
+
payload.issues.push({
|
|
1373
|
+
origin: "string",
|
|
1374
|
+
code: "invalid_format",
|
|
1375
|
+
format: def.format,
|
|
1376
|
+
input: payload.value,
|
|
1377
|
+
...def.pattern ? { pattern: def.pattern.toString() } : {},
|
|
1378
|
+
inst,
|
|
1379
|
+
continue: !def.abort
|
|
1380
|
+
});
|
|
1381
|
+
});
|
|
1382
|
+
else
|
|
1383
|
+
(_b = inst._zod).check ?? (_b.check = () => {
|
|
1384
|
+
});
|
|
1385
|
+
});
|
|
1386
|
+
var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
1387
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
1388
|
+
inst._zod.check = (payload) => {
|
|
1389
|
+
def.pattern.lastIndex = 0;
|
|
1390
|
+
if (def.pattern.test(payload.value))
|
|
1391
|
+
return;
|
|
1392
|
+
payload.issues.push({
|
|
1393
|
+
origin: "string",
|
|
1394
|
+
code: "invalid_format",
|
|
1395
|
+
format: "regex",
|
|
1396
|
+
input: payload.value,
|
|
1397
|
+
pattern: def.pattern.toString(),
|
|
1398
|
+
inst,
|
|
1399
|
+
continue: !def.abort
|
|
1400
|
+
});
|
|
1401
|
+
};
|
|
1402
|
+
});
|
|
1403
|
+
var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
1404
|
+
$ZodCheck.init(inst, def);
|
|
1405
|
+
inst._zod.check = (payload) => {
|
|
1406
|
+
payload.value = def.tx(payload.value);
|
|
1407
|
+
};
|
|
1408
|
+
});
|
|
1409
|
+
|
|
1410
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/versions.js
|
|
1411
|
+
var version = {
|
|
1412
|
+
major: 4,
|
|
1413
|
+
minor: 2,
|
|
1414
|
+
patch: 1
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/schemas.js
|
|
1418
|
+
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1419
|
+
var _a2;
|
|
1420
|
+
inst ?? (inst = {});
|
|
1421
|
+
inst._zod.def = def;
|
|
1422
|
+
inst._zod.bag = inst._zod.bag || {};
|
|
1423
|
+
inst._zod.version = version;
|
|
1424
|
+
const checks = [...inst._zod.def.checks ?? []];
|
|
1425
|
+
if (inst._zod.traits.has("$ZodCheck")) {
|
|
1426
|
+
checks.unshift(inst);
|
|
1427
|
+
}
|
|
1428
|
+
for (const ch of checks) {
|
|
1429
|
+
for (const fn of ch._zod.onattach) {
|
|
1430
|
+
fn(inst);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
if (checks.length === 0) {
|
|
1434
|
+
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
1435
|
+
inst._zod.deferred?.push(() => {
|
|
1436
|
+
inst._zod.run = inst._zod.parse;
|
|
1437
|
+
});
|
|
1438
|
+
} else {
|
|
1439
|
+
const runChecks = (payload, checks2, ctx) => {
|
|
1440
|
+
let isAborted = aborted(payload);
|
|
1441
|
+
let asyncResult;
|
|
1442
|
+
for (const ch of checks2) {
|
|
1443
|
+
if (ch._zod.def.when) {
|
|
1444
|
+
const shouldRun = ch._zod.def.when(payload);
|
|
1445
|
+
if (!shouldRun)
|
|
1446
|
+
continue;
|
|
1447
|
+
} else if (isAborted) {
|
|
1448
|
+
continue;
|
|
1449
|
+
}
|
|
1450
|
+
const currLen = payload.issues.length;
|
|
1451
|
+
const _ = ch._zod.check(payload);
|
|
1452
|
+
if (_ instanceof Promise && ctx?.async === false) {
|
|
1453
|
+
throw new $ZodAsyncError();
|
|
1454
|
+
}
|
|
1455
|
+
if (asyncResult || _ instanceof Promise) {
|
|
1456
|
+
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
1457
|
+
await _;
|
|
1458
|
+
const nextLen = payload.issues.length;
|
|
1459
|
+
if (nextLen === currLen)
|
|
1460
|
+
return;
|
|
1461
|
+
if (!isAborted)
|
|
1462
|
+
isAborted = aborted(payload, currLen);
|
|
1463
|
+
});
|
|
1464
|
+
} else {
|
|
1465
|
+
const nextLen = payload.issues.length;
|
|
1466
|
+
if (nextLen === currLen)
|
|
1467
|
+
continue;
|
|
1468
|
+
if (!isAborted)
|
|
1469
|
+
isAborted = aborted(payload, currLen);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
if (asyncResult) {
|
|
1473
|
+
return asyncResult.then(() => {
|
|
1474
|
+
return payload;
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
return payload;
|
|
1478
|
+
};
|
|
1479
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
1480
|
+
if (aborted(canary)) {
|
|
1481
|
+
canary.aborted = true;
|
|
1482
|
+
return canary;
|
|
1483
|
+
}
|
|
1484
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
1485
|
+
if (checkResult instanceof Promise) {
|
|
1486
|
+
if (ctx.async === false)
|
|
1487
|
+
throw new $ZodAsyncError();
|
|
1488
|
+
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
1489
|
+
}
|
|
1490
|
+
return inst._zod.parse(checkResult, ctx);
|
|
1491
|
+
};
|
|
1492
|
+
inst._zod.run = (payload, ctx) => {
|
|
1493
|
+
if (ctx.skipChecks) {
|
|
1494
|
+
return inst._zod.parse(payload, ctx);
|
|
1495
|
+
}
|
|
1496
|
+
if (ctx.direction === "backward") {
|
|
1497
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
1498
|
+
if (canary instanceof Promise) {
|
|
1499
|
+
return canary.then((canary2) => {
|
|
1500
|
+
return handleCanaryResult(canary2, payload, ctx);
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
1504
|
+
}
|
|
1505
|
+
const result = inst._zod.parse(payload, ctx);
|
|
1506
|
+
if (result instanceof Promise) {
|
|
1507
|
+
if (ctx.async === false)
|
|
1508
|
+
throw new $ZodAsyncError();
|
|
1509
|
+
return result.then((result2) => runChecks(result2, checks, ctx));
|
|
1510
|
+
}
|
|
1511
|
+
return runChecks(result, checks, ctx);
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
inst["~standard"] = {
|
|
1515
|
+
validate: (value) => {
|
|
1516
|
+
try {
|
|
1517
|
+
const r = safeParse(inst, value);
|
|
1518
|
+
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
1519
|
+
} catch (_) {
|
|
1520
|
+
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
1521
|
+
}
|
|
1522
|
+
},
|
|
1523
|
+
vendor: "zod",
|
|
1524
|
+
version: 1
|
|
1525
|
+
};
|
|
1526
|
+
});
|
|
1527
|
+
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
1528
|
+
$ZodType.init(inst, def);
|
|
1529
|
+
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
|
|
1530
|
+
inst._zod.parse = (payload, _) => {
|
|
1531
|
+
if (def.coerce)
|
|
1532
|
+
try {
|
|
1533
|
+
payload.value = String(payload.value);
|
|
1534
|
+
} catch (_2) {
|
|
1535
|
+
}
|
|
1536
|
+
if (typeof payload.value === "string")
|
|
1537
|
+
return payload;
|
|
1538
|
+
payload.issues.push({
|
|
1539
|
+
expected: "string",
|
|
1540
|
+
code: "invalid_type",
|
|
1541
|
+
input: payload.value,
|
|
1542
|
+
inst
|
|
1543
|
+
});
|
|
1544
|
+
return payload;
|
|
1545
|
+
};
|
|
1546
|
+
});
|
|
1547
|
+
var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
|
|
1548
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
1549
|
+
$ZodString.init(inst, def);
|
|
1550
|
+
});
|
|
1551
|
+
var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
1552
|
+
$ZodStringFormat.init(inst, def);
|
|
1553
|
+
inst._zod.check = (payload) => {
|
|
1554
|
+
try {
|
|
1555
|
+
const trimmed = payload.value.trim();
|
|
1556
|
+
const url2 = new URL(trimmed);
|
|
1557
|
+
if (def.hostname) {
|
|
1558
|
+
def.hostname.lastIndex = 0;
|
|
1559
|
+
if (!def.hostname.test(url2.hostname)) {
|
|
1560
|
+
payload.issues.push({
|
|
1561
|
+
code: "invalid_format",
|
|
1562
|
+
format: "url",
|
|
1563
|
+
note: "Invalid hostname",
|
|
1564
|
+
pattern: def.hostname.source,
|
|
1565
|
+
input: payload.value,
|
|
1566
|
+
inst,
|
|
1567
|
+
continue: !def.abort
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
if (def.protocol) {
|
|
1572
|
+
def.protocol.lastIndex = 0;
|
|
1573
|
+
if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) {
|
|
1574
|
+
payload.issues.push({
|
|
1575
|
+
code: "invalid_format",
|
|
1576
|
+
format: "url",
|
|
1577
|
+
note: "Invalid protocol",
|
|
1578
|
+
pattern: def.protocol.source,
|
|
1579
|
+
input: payload.value,
|
|
1580
|
+
inst,
|
|
1581
|
+
continue: !def.abort
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
if (def.normalize) {
|
|
1586
|
+
payload.value = url2.href;
|
|
1587
|
+
} else {
|
|
1588
|
+
payload.value = trimmed;
|
|
1589
|
+
}
|
|
1590
|
+
return;
|
|
1591
|
+
} catch (_) {
|
|
1592
|
+
payload.issues.push({
|
|
1593
|
+
code: "invalid_format",
|
|
1594
|
+
format: "url",
|
|
1595
|
+
input: payload.value,
|
|
1596
|
+
inst,
|
|
1597
|
+
continue: !def.abort
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
});
|
|
1602
|
+
var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
1603
|
+
$ZodType.init(inst, def);
|
|
1604
|
+
inst._zod.pattern = boolean;
|
|
1605
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1606
|
+
if (def.coerce)
|
|
1607
|
+
try {
|
|
1608
|
+
payload.value = Boolean(payload.value);
|
|
1609
|
+
} catch (_) {
|
|
1610
|
+
}
|
|
1611
|
+
const input = payload.value;
|
|
1612
|
+
if (typeof input === "boolean")
|
|
1613
|
+
return payload;
|
|
1614
|
+
payload.issues.push({
|
|
1615
|
+
expected: "boolean",
|
|
1616
|
+
code: "invalid_type",
|
|
1617
|
+
input,
|
|
1618
|
+
inst
|
|
1619
|
+
});
|
|
1620
|
+
return payload;
|
|
1621
|
+
};
|
|
1622
|
+
});
|
|
1623
|
+
var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
|
|
1624
|
+
$ZodType.init(inst, def);
|
|
1625
|
+
inst._zod.parse = (payload) => payload;
|
|
1626
|
+
});
|
|
1627
|
+
function handleArrayResult(result, final, index) {
|
|
1628
|
+
if (result.issues.length) {
|
|
1629
|
+
final.issues.push(...prefixIssues(index, result.issues));
|
|
1630
|
+
}
|
|
1631
|
+
final.value[index] = result.value;
|
|
1632
|
+
}
|
|
1633
|
+
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
1634
|
+
$ZodType.init(inst, def);
|
|
1635
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1636
|
+
const input = payload.value;
|
|
1637
|
+
if (!Array.isArray(input)) {
|
|
1638
|
+
payload.issues.push({
|
|
1639
|
+
expected: "array",
|
|
1640
|
+
code: "invalid_type",
|
|
1641
|
+
input,
|
|
1642
|
+
inst
|
|
1643
|
+
});
|
|
1644
|
+
return payload;
|
|
1645
|
+
}
|
|
1646
|
+
payload.value = Array(input.length);
|
|
1647
|
+
const proms = [];
|
|
1648
|
+
for (let i = 0; i < input.length; i++) {
|
|
1649
|
+
const item = input[i];
|
|
1650
|
+
const result = def.element._zod.run({
|
|
1651
|
+
value: item,
|
|
1652
|
+
issues: []
|
|
1653
|
+
}, ctx);
|
|
1654
|
+
if (result instanceof Promise) {
|
|
1655
|
+
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
1656
|
+
} else {
|
|
1657
|
+
handleArrayResult(result, payload, i);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
if (proms.length) {
|
|
1661
|
+
return Promise.all(proms).then(() => payload);
|
|
1662
|
+
}
|
|
1663
|
+
return payload;
|
|
1664
|
+
};
|
|
1665
|
+
});
|
|
1666
|
+
function handlePropertyResult(result, final, key, input) {
|
|
1667
|
+
if (result.issues.length) {
|
|
1668
|
+
final.issues.push(...prefixIssues(key, result.issues));
|
|
1669
|
+
}
|
|
1670
|
+
if (result.value === void 0) {
|
|
1671
|
+
if (key in input) {
|
|
1672
|
+
final.value[key] = void 0;
|
|
1673
|
+
}
|
|
1674
|
+
} else {
|
|
1675
|
+
final.value[key] = result.value;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
function normalizeDef(def) {
|
|
1679
|
+
const keys = Object.keys(def.shape);
|
|
1680
|
+
for (const k of keys) {
|
|
1681
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
1682
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
const okeys = optionalKeys(def.shape);
|
|
1686
|
+
return {
|
|
1687
|
+
...def,
|
|
1688
|
+
keys,
|
|
1689
|
+
keySet: new Set(keys),
|
|
1690
|
+
numKeys: keys.length,
|
|
1691
|
+
optionalKeys: new Set(okeys)
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1695
|
+
const unrecognized = [];
|
|
1696
|
+
const keySet = def.keySet;
|
|
1697
|
+
const _catchall = def.catchall._zod;
|
|
1698
|
+
const t = _catchall.def.type;
|
|
1699
|
+
for (const key in input) {
|
|
1700
|
+
if (keySet.has(key))
|
|
1701
|
+
continue;
|
|
1702
|
+
if (t === "never") {
|
|
1703
|
+
unrecognized.push(key);
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1707
|
+
if (r instanceof Promise) {
|
|
1708
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
1709
|
+
} else {
|
|
1710
|
+
handlePropertyResult(r, payload, key, input);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
if (unrecognized.length) {
|
|
1714
|
+
payload.issues.push({
|
|
1715
|
+
code: "unrecognized_keys",
|
|
1716
|
+
keys: unrecognized,
|
|
1717
|
+
input,
|
|
1718
|
+
inst
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
if (!proms.length)
|
|
1722
|
+
return payload;
|
|
1723
|
+
return Promise.all(proms).then(() => {
|
|
1724
|
+
return payload;
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
1728
|
+
$ZodType.init(inst, def);
|
|
1729
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1730
|
+
if (!desc?.get) {
|
|
1731
|
+
const sh = def.shape;
|
|
1732
|
+
Object.defineProperty(def, "shape", {
|
|
1733
|
+
get: () => {
|
|
1734
|
+
const newSh = { ...sh };
|
|
1735
|
+
Object.defineProperty(def, "shape", {
|
|
1736
|
+
value: newSh
|
|
1737
|
+
});
|
|
1738
|
+
return newSh;
|
|
1739
|
+
}
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
1743
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
1744
|
+
const shape = def.shape;
|
|
1745
|
+
const propValues = {};
|
|
1746
|
+
for (const key in shape) {
|
|
1747
|
+
const field = shape[key]._zod;
|
|
1748
|
+
if (field.values) {
|
|
1749
|
+
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
1750
|
+
for (const v of field.values)
|
|
1751
|
+
propValues[key].add(v);
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
return propValues;
|
|
1755
|
+
});
|
|
1756
|
+
const isObject2 = isObject;
|
|
1757
|
+
const catchall = def.catchall;
|
|
1758
|
+
let value;
|
|
1759
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1760
|
+
value ?? (value = _normalized.value);
|
|
1761
|
+
const input = payload.value;
|
|
1762
|
+
if (!isObject2(input)) {
|
|
1763
|
+
payload.issues.push({
|
|
1764
|
+
expected: "object",
|
|
1765
|
+
code: "invalid_type",
|
|
1766
|
+
input,
|
|
1767
|
+
inst
|
|
1768
|
+
});
|
|
1769
|
+
return payload;
|
|
1770
|
+
}
|
|
1771
|
+
payload.value = {};
|
|
1772
|
+
const proms = [];
|
|
1773
|
+
const shape = value.shape;
|
|
1774
|
+
for (const key of value.keys) {
|
|
1775
|
+
const el = shape[key];
|
|
1776
|
+
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1777
|
+
if (r instanceof Promise) {
|
|
1778
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
1779
|
+
} else {
|
|
1780
|
+
handlePropertyResult(r, payload, key, input);
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
if (!catchall) {
|
|
1784
|
+
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1785
|
+
}
|
|
1786
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1787
|
+
};
|
|
1788
|
+
});
|
|
1789
|
+
function handleUnionResults(results, final, inst, ctx) {
|
|
1790
|
+
for (const result of results) {
|
|
1791
|
+
if (result.issues.length === 0) {
|
|
1792
|
+
final.value = result.value;
|
|
1793
|
+
return final;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
const nonaborted = results.filter((r) => !aborted(r));
|
|
1797
|
+
if (nonaborted.length === 1) {
|
|
1798
|
+
final.value = nonaborted[0].value;
|
|
1799
|
+
return nonaborted[0];
|
|
1800
|
+
}
|
|
1801
|
+
final.issues.push({
|
|
1802
|
+
code: "invalid_union",
|
|
1803
|
+
input: final.value,
|
|
1804
|
+
inst,
|
|
1805
|
+
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1806
|
+
});
|
|
1807
|
+
return final;
|
|
1808
|
+
}
|
|
1809
|
+
var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
1810
|
+
$ZodType.init(inst, def);
|
|
1811
|
+
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
1812
|
+
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
1813
|
+
defineLazy(inst._zod, "values", () => {
|
|
1814
|
+
if (def.options.every((o) => o._zod.values)) {
|
|
1815
|
+
return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1816
|
+
}
|
|
1817
|
+
return void 0;
|
|
1818
|
+
});
|
|
1819
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
1820
|
+
if (def.options.every((o) => o._zod.pattern)) {
|
|
1821
|
+
const patterns = def.options.map((o) => o._zod.pattern);
|
|
1822
|
+
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
1823
|
+
}
|
|
1824
|
+
return void 0;
|
|
1825
|
+
});
|
|
1826
|
+
const single = def.options.length === 1;
|
|
1827
|
+
const first = def.options[0]._zod.run;
|
|
1828
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1829
|
+
if (single) {
|
|
1830
|
+
return first(payload, ctx);
|
|
1831
|
+
}
|
|
1832
|
+
let async = false;
|
|
1833
|
+
const results = [];
|
|
1834
|
+
for (const option of def.options) {
|
|
1835
|
+
const result = option._zod.run({
|
|
1836
|
+
value: payload.value,
|
|
1837
|
+
issues: []
|
|
1838
|
+
}, ctx);
|
|
1839
|
+
if (result instanceof Promise) {
|
|
1840
|
+
results.push(result);
|
|
1841
|
+
async = true;
|
|
1842
|
+
} else {
|
|
1843
|
+
if (result.issues.length === 0)
|
|
1844
|
+
return result;
|
|
1845
|
+
results.push(result);
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
if (!async)
|
|
1849
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
1850
|
+
return Promise.all(results).then((results2) => {
|
|
1851
|
+
return handleUnionResults(results2, payload, inst, ctx);
|
|
1852
|
+
});
|
|
1853
|
+
};
|
|
1854
|
+
});
|
|
1855
|
+
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
1856
|
+
$ZodType.init(inst, def);
|
|
1857
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1858
|
+
const input = payload.value;
|
|
1859
|
+
if (!isPlainObject(input)) {
|
|
1860
|
+
payload.issues.push({
|
|
1861
|
+
expected: "record",
|
|
1862
|
+
code: "invalid_type",
|
|
1863
|
+
input,
|
|
1864
|
+
inst
|
|
1865
|
+
});
|
|
1866
|
+
return payload;
|
|
1867
|
+
}
|
|
1868
|
+
const proms = [];
|
|
1869
|
+
const values = def.keyType._zod.values;
|
|
1870
|
+
if (values) {
|
|
1871
|
+
payload.value = {};
|
|
1872
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
1873
|
+
for (const key of values) {
|
|
1874
|
+
if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
1875
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
1876
|
+
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1877
|
+
if (result instanceof Promise) {
|
|
1878
|
+
proms.push(result.then((result2) => {
|
|
1879
|
+
if (result2.issues.length) {
|
|
1880
|
+
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
1881
|
+
}
|
|
1882
|
+
payload.value[key] = result2.value;
|
|
1883
|
+
}));
|
|
1884
|
+
} else {
|
|
1885
|
+
if (result.issues.length) {
|
|
1886
|
+
payload.issues.push(...prefixIssues(key, result.issues));
|
|
1887
|
+
}
|
|
1888
|
+
payload.value[key] = result.value;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
let unrecognized;
|
|
1893
|
+
for (const key in input) {
|
|
1894
|
+
if (!recordKeys.has(key)) {
|
|
1895
|
+
unrecognized = unrecognized ?? [];
|
|
1896
|
+
unrecognized.push(key);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
if (unrecognized && unrecognized.length > 0) {
|
|
1900
|
+
payload.issues.push({
|
|
1901
|
+
code: "unrecognized_keys",
|
|
1902
|
+
input,
|
|
1903
|
+
inst,
|
|
1904
|
+
keys: unrecognized
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
} else {
|
|
1908
|
+
payload.value = {};
|
|
1909
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
1910
|
+
if (key === "__proto__")
|
|
1911
|
+
continue;
|
|
1912
|
+
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
1913
|
+
if (keyResult instanceof Promise) {
|
|
1914
|
+
throw new Error("Async schemas not supported in object keys currently");
|
|
1915
|
+
}
|
|
1916
|
+
if (keyResult.issues.length) {
|
|
1917
|
+
if (def.mode === "loose") {
|
|
1918
|
+
payload.value[key] = input[key];
|
|
1919
|
+
} else {
|
|
1920
|
+
payload.issues.push({
|
|
1921
|
+
code: "invalid_key",
|
|
1922
|
+
origin: "record",
|
|
1923
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
1924
|
+
input: key,
|
|
1925
|
+
path: [key],
|
|
1926
|
+
inst
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
continue;
|
|
1930
|
+
}
|
|
1931
|
+
const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1932
|
+
if (result instanceof Promise) {
|
|
1933
|
+
proms.push(result.then((result2) => {
|
|
1934
|
+
if (result2.issues.length) {
|
|
1935
|
+
payload.issues.push(...prefixIssues(key, result2.issues));
|
|
1936
|
+
}
|
|
1937
|
+
payload.value[keyResult.value] = result2.value;
|
|
1938
|
+
}));
|
|
1939
|
+
} else {
|
|
1940
|
+
if (result.issues.length) {
|
|
1941
|
+
payload.issues.push(...prefixIssues(key, result.issues));
|
|
1942
|
+
}
|
|
1943
|
+
payload.value[keyResult.value] = result.value;
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
if (proms.length) {
|
|
1948
|
+
return Promise.all(proms).then(() => payload);
|
|
1949
|
+
}
|
|
1950
|
+
return payload;
|
|
1951
|
+
};
|
|
1952
|
+
});
|
|
1953
|
+
var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
1954
|
+
$ZodType.init(inst, def);
|
|
1955
|
+
const values = getEnumValues(def.entries);
|
|
1956
|
+
const valuesSet = new Set(values);
|
|
1957
|
+
inst._zod.values = valuesSet;
|
|
1958
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
1959
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1960
|
+
const input = payload.value;
|
|
1961
|
+
if (valuesSet.has(input)) {
|
|
1962
|
+
return payload;
|
|
1963
|
+
}
|
|
1964
|
+
payload.issues.push({
|
|
1965
|
+
code: "invalid_value",
|
|
1966
|
+
values,
|
|
1967
|
+
input,
|
|
1968
|
+
inst
|
|
1969
|
+
});
|
|
1970
|
+
return payload;
|
|
1971
|
+
};
|
|
1972
|
+
});
|
|
1973
|
+
var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
1974
|
+
$ZodType.init(inst, def);
|
|
1975
|
+
if (def.values.length === 0) {
|
|
1976
|
+
throw new Error("Cannot create literal schema with no valid values");
|
|
1977
|
+
}
|
|
1978
|
+
const values = new Set(def.values);
|
|
1979
|
+
inst._zod.values = values;
|
|
1980
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
1981
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1982
|
+
const input = payload.value;
|
|
1983
|
+
if (values.has(input)) {
|
|
1984
|
+
return payload;
|
|
1985
|
+
}
|
|
1986
|
+
payload.issues.push({
|
|
1987
|
+
code: "invalid_value",
|
|
1988
|
+
values: def.values,
|
|
1989
|
+
input,
|
|
1990
|
+
inst
|
|
1991
|
+
});
|
|
1992
|
+
return payload;
|
|
1993
|
+
};
|
|
1994
|
+
});
|
|
1995
|
+
function handleOptionalResult(result, input) {
|
|
1996
|
+
if (result.issues.length && input === void 0) {
|
|
1997
|
+
return { issues: [], value: void 0 };
|
|
1998
|
+
}
|
|
1999
|
+
return result;
|
|
2000
|
+
}
|
|
2001
|
+
var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
2002
|
+
$ZodType.init(inst, def);
|
|
2003
|
+
inst._zod.optin = "optional";
|
|
2004
|
+
inst._zod.optout = "optional";
|
|
2005
|
+
defineLazy(inst._zod, "values", () => {
|
|
2006
|
+
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
2007
|
+
});
|
|
2008
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
2009
|
+
const pattern = def.innerType._zod.pattern;
|
|
2010
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
2011
|
+
});
|
|
2012
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2013
|
+
if (def.innerType._zod.optin === "optional") {
|
|
2014
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2015
|
+
if (result instanceof Promise)
|
|
2016
|
+
return result.then((r) => handleOptionalResult(r, payload.value));
|
|
2017
|
+
return handleOptionalResult(result, payload.value);
|
|
2018
|
+
}
|
|
2019
|
+
if (payload.value === void 0) {
|
|
2020
|
+
return payload;
|
|
2021
|
+
}
|
|
2022
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2023
|
+
};
|
|
2024
|
+
});
|
|
2025
|
+
var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
2026
|
+
$ZodType.init(inst, def);
|
|
2027
|
+
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
2028
|
+
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
2029
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
2030
|
+
const pattern = def.innerType._zod.pattern;
|
|
2031
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
2032
|
+
});
|
|
2033
|
+
defineLazy(inst._zod, "values", () => {
|
|
2034
|
+
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
2035
|
+
});
|
|
2036
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2037
|
+
if (payload.value === null)
|
|
2038
|
+
return payload;
|
|
2039
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2040
|
+
};
|
|
2041
|
+
});
|
|
2042
|
+
var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
2043
|
+
$ZodType.init(inst, def);
|
|
2044
|
+
inst._zod.optin = "optional";
|
|
2045
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2046
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2047
|
+
if (ctx.direction === "backward") {
|
|
2048
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2049
|
+
}
|
|
2050
|
+
if (payload.value === void 0) {
|
|
2051
|
+
payload.value = def.defaultValue;
|
|
2052
|
+
return payload;
|
|
2053
|
+
}
|
|
2054
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2055
|
+
if (result instanceof Promise) {
|
|
2056
|
+
return result.then((result2) => handleDefaultResult(result2, def));
|
|
2057
|
+
}
|
|
2058
|
+
return handleDefaultResult(result, def);
|
|
2059
|
+
};
|
|
2060
|
+
});
|
|
2061
|
+
function handleDefaultResult(payload, def) {
|
|
2062
|
+
if (payload.value === void 0) {
|
|
2063
|
+
payload.value = def.defaultValue;
|
|
2064
|
+
}
|
|
2065
|
+
return payload;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/registries.js
|
|
2069
|
+
var _a;
|
|
2070
|
+
var $ZodRegistry = class {
|
|
2071
|
+
constructor() {
|
|
2072
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
2073
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
2074
|
+
}
|
|
2075
|
+
add(schema, ..._meta) {
|
|
2076
|
+
const meta2 = _meta[0];
|
|
2077
|
+
this._map.set(schema, meta2);
|
|
2078
|
+
if (meta2 && typeof meta2 === "object" && "id" in meta2) {
|
|
2079
|
+
if (this._idmap.has(meta2.id)) {
|
|
2080
|
+
throw new Error(`ID ${meta2.id} already exists in the registry`);
|
|
2081
|
+
}
|
|
2082
|
+
this._idmap.set(meta2.id, schema);
|
|
2083
|
+
}
|
|
2084
|
+
return this;
|
|
2085
|
+
}
|
|
2086
|
+
clear() {
|
|
2087
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
2088
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
2089
|
+
return this;
|
|
2090
|
+
}
|
|
2091
|
+
remove(schema) {
|
|
2092
|
+
const meta2 = this._map.get(schema);
|
|
2093
|
+
if (meta2 && typeof meta2 === "object" && "id" in meta2) {
|
|
2094
|
+
this._idmap.delete(meta2.id);
|
|
2095
|
+
}
|
|
2096
|
+
this._map.delete(schema);
|
|
2097
|
+
return this;
|
|
2098
|
+
}
|
|
2099
|
+
get(schema) {
|
|
2100
|
+
const p = schema._zod.parent;
|
|
2101
|
+
if (p) {
|
|
2102
|
+
const pm = { ...this.get(p) ?? {} };
|
|
2103
|
+
delete pm.id;
|
|
2104
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
2105
|
+
return Object.keys(f).length ? f : void 0;
|
|
2106
|
+
}
|
|
2107
|
+
return this._map.get(schema);
|
|
2108
|
+
}
|
|
2109
|
+
has(schema) {
|
|
2110
|
+
return this._map.has(schema);
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
function registry() {
|
|
2114
|
+
return new $ZodRegistry();
|
|
2115
|
+
}
|
|
2116
|
+
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
2117
|
+
|
|
2118
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/core/api.js
|
|
2119
|
+
function _string(Class2, params) {
|
|
2120
|
+
return new Class2({
|
|
2121
|
+
type: "string",
|
|
2122
|
+
...normalizeParams(params)
|
|
2123
|
+
});
|
|
2124
|
+
}
|
|
2125
|
+
function _url(Class2, params) {
|
|
2126
|
+
return new Class2({
|
|
2127
|
+
type: "string",
|
|
2128
|
+
format: "url",
|
|
2129
|
+
check: "string_format",
|
|
2130
|
+
abort: false,
|
|
2131
|
+
...normalizeParams(params)
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
function _boolean(Class2, params) {
|
|
2135
|
+
return new Class2({
|
|
2136
|
+
type: "boolean",
|
|
2137
|
+
...normalizeParams(params)
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
function _any(Class2) {
|
|
2141
|
+
return new Class2({
|
|
2142
|
+
type: "any"
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
function _length(length, params) {
|
|
2146
|
+
return new $ZodCheckLengthEquals({
|
|
2147
|
+
check: "length_equals",
|
|
2148
|
+
...normalizeParams(params),
|
|
2149
|
+
length
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
function _regex(pattern, params) {
|
|
2153
|
+
return new $ZodCheckRegex({
|
|
2154
|
+
check: "string_format",
|
|
2155
|
+
format: "regex",
|
|
2156
|
+
...normalizeParams(params),
|
|
2157
|
+
pattern
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
function _overwrite(tx) {
|
|
2161
|
+
return new $ZodCheckOverwrite({
|
|
2162
|
+
check: "overwrite",
|
|
2163
|
+
tx
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
function _trim() {
|
|
2167
|
+
return _overwrite((input) => input.trim());
|
|
2168
|
+
}
|
|
2169
|
+
function _toLowerCase() {
|
|
2170
|
+
return _overwrite((input) => input.toLowerCase());
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
// ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/mini/schemas.js
|
|
2174
|
+
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
2175
|
+
if (!inst._zod)
|
|
2176
|
+
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
2177
|
+
$ZodType.init(inst, def);
|
|
2178
|
+
inst.def = def;
|
|
2179
|
+
inst.type = def.type;
|
|
2180
|
+
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
2181
|
+
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
2182
|
+
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
2183
|
+
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
2184
|
+
inst.check = (...checks) => {
|
|
2185
|
+
return inst.clone(
|
|
2186
|
+
{
|
|
2187
|
+
...def,
|
|
2188
|
+
checks: [
|
|
2189
|
+
...def.checks ?? [],
|
|
2190
|
+
...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
2191
|
+
]
|
|
2192
|
+
}
|
|
2193
|
+
// { parent: true }
|
|
2194
|
+
);
|
|
2195
|
+
};
|
|
2196
|
+
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
2197
|
+
inst.brand = () => inst;
|
|
2198
|
+
inst.register = ((reg, meta2) => {
|
|
2199
|
+
reg.add(inst, meta2);
|
|
2200
|
+
return inst;
|
|
2201
|
+
});
|
|
2202
|
+
});
|
|
2203
|
+
var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
2204
|
+
$ZodString.init(inst, def);
|
|
2205
|
+
ZodMiniType.init(inst, def);
|
|
2206
|
+
});
|
|
2207
|
+
function string2(params) {
|
|
2208
|
+
return _string(ZodMiniString, params);
|
|
2209
|
+
}
|
|
2210
|
+
var ZodMiniStringFormat = /* @__PURE__ */ $constructor("ZodMiniStringFormat", (inst, def) => {
|
|
2211
|
+
$ZodStringFormat.init(inst, def);
|
|
2212
|
+
ZodMiniString.init(inst, def);
|
|
2213
|
+
});
|
|
2214
|
+
var ZodMiniURL = /* @__PURE__ */ $constructor("ZodMiniURL", (inst, def) => {
|
|
2215
|
+
$ZodURL.init(inst, def);
|
|
2216
|
+
ZodMiniStringFormat.init(inst, def);
|
|
2217
|
+
});
|
|
2218
|
+
function url(params) {
|
|
2219
|
+
return _url(ZodMiniURL, params);
|
|
2220
|
+
}
|
|
2221
|
+
var ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
2222
|
+
$ZodBoolean.init(inst, def);
|
|
2223
|
+
ZodMiniType.init(inst, def);
|
|
2224
|
+
});
|
|
2225
|
+
function boolean2(params) {
|
|
2226
|
+
return _boolean(ZodMiniBoolean, params);
|
|
2227
|
+
}
|
|
2228
|
+
var ZodMiniAny = /* @__PURE__ */ $constructor("ZodMiniAny", (inst, def) => {
|
|
2229
|
+
$ZodAny.init(inst, def);
|
|
2230
|
+
ZodMiniType.init(inst, def);
|
|
2231
|
+
});
|
|
2232
|
+
function any() {
|
|
2233
|
+
return _any(ZodMiniAny);
|
|
2234
|
+
}
|
|
2235
|
+
var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
2236
|
+
$ZodArray.init(inst, def);
|
|
2237
|
+
ZodMiniType.init(inst, def);
|
|
2238
|
+
});
|
|
2239
|
+
function array(element, params) {
|
|
2240
|
+
return new ZodMiniArray({
|
|
2241
|
+
type: "array",
|
|
2242
|
+
element,
|
|
2243
|
+
...util_exports.normalizeParams(params)
|
|
2244
|
+
});
|
|
2245
|
+
}
|
|
2246
|
+
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
2247
|
+
$ZodObject.init(inst, def);
|
|
2248
|
+
ZodMiniType.init(inst, def);
|
|
2249
|
+
util_exports.defineLazy(inst, "shape", () => def.shape);
|
|
2250
|
+
});
|
|
2251
|
+
function object(shape, params) {
|
|
2252
|
+
const def = {
|
|
2253
|
+
type: "object",
|
|
2254
|
+
shape: shape ?? {},
|
|
2255
|
+
...util_exports.normalizeParams(params)
|
|
2256
|
+
};
|
|
2257
|
+
return new ZodMiniObject(def);
|
|
2258
|
+
}
|
|
2259
|
+
var ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
2260
|
+
$ZodUnion.init(inst, def);
|
|
2261
|
+
ZodMiniType.init(inst, def);
|
|
2262
|
+
});
|
|
2263
|
+
function union(options, params) {
|
|
2264
|
+
return new ZodMiniUnion({
|
|
2265
|
+
type: "union",
|
|
2266
|
+
options,
|
|
2267
|
+
...util_exports.normalizeParams(params)
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
var ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
2271
|
+
$ZodRecord.init(inst, def);
|
|
2272
|
+
ZodMiniType.init(inst, def);
|
|
2273
|
+
});
|
|
2274
|
+
function record(keyType, valueType, params) {
|
|
2275
|
+
return new ZodMiniRecord({
|
|
2276
|
+
type: "record",
|
|
2277
|
+
keyType,
|
|
2278
|
+
valueType,
|
|
2279
|
+
...util_exports.normalizeParams(params)
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
2283
|
+
$ZodEnum.init(inst, def);
|
|
2284
|
+
ZodMiniType.init(inst, def);
|
|
2285
|
+
inst.options = Object.values(def.entries);
|
|
2286
|
+
});
|
|
2287
|
+
function _enum(values, params) {
|
|
2288
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
2289
|
+
return new ZodMiniEnum({
|
|
2290
|
+
type: "enum",
|
|
2291
|
+
entries,
|
|
2292
|
+
...util_exports.normalizeParams(params)
|
|
2293
|
+
});
|
|
2294
|
+
}
|
|
2295
|
+
var ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
2296
|
+
$ZodLiteral.init(inst, def);
|
|
2297
|
+
ZodMiniType.init(inst, def);
|
|
2298
|
+
});
|
|
2299
|
+
function literal(value, params) {
|
|
2300
|
+
return new ZodMiniLiteral({
|
|
2301
|
+
type: "literal",
|
|
2302
|
+
values: Array.isArray(value) ? value : [value],
|
|
2303
|
+
...util_exports.normalizeParams(params)
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
var ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
2307
|
+
$ZodOptional.init(inst, def);
|
|
2308
|
+
ZodMiniType.init(inst, def);
|
|
2309
|
+
});
|
|
2310
|
+
function optional(innerType) {
|
|
2311
|
+
return new ZodMiniOptional({
|
|
2312
|
+
type: "optional",
|
|
2313
|
+
innerType
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
var ZodMiniNullable = /* @__PURE__ */ $constructor("ZodMiniNullable", (inst, def) => {
|
|
2317
|
+
$ZodNullable.init(inst, def);
|
|
2318
|
+
ZodMiniType.init(inst, def);
|
|
2319
|
+
});
|
|
2320
|
+
function nullable(innerType) {
|
|
2321
|
+
return new ZodMiniNullable({
|
|
2322
|
+
type: "nullable",
|
|
2323
|
+
innerType
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2326
|
+
var ZodMiniDefault = /* @__PURE__ */ $constructor("ZodMiniDefault", (inst, def) => {
|
|
2327
|
+
$ZodDefault.init(inst, def);
|
|
2328
|
+
ZodMiniType.init(inst, def);
|
|
2329
|
+
});
|
|
2330
|
+
function _default(innerType, defaultValue) {
|
|
2331
|
+
return new ZodMiniDefault({
|
|
2332
|
+
type: "default",
|
|
2333
|
+
innerType,
|
|
2334
|
+
get defaultValue() {
|
|
2335
|
+
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
// ../config/src/schema.ts
|
|
2341
|
+
var schemaRegistry = registry();
|
|
2342
|
+
var colorSchema = string2().check(
|
|
2343
|
+
_length(7),
|
|
2344
|
+
_toLowerCase(),
|
|
2345
|
+
_regex(/^#([0-9a-f]{3}){1,2}$/i),
|
|
2346
|
+
_trim()
|
|
2347
|
+
);
|
|
2348
|
+
schemaRegistry.add(colorSchema, {
|
|
2349
|
+
description: "A base schema for describing the format of colors"
|
|
2350
|
+
});
|
|
2351
|
+
var darkColorSchema = _default(colorSchema, "#151718");
|
|
2352
|
+
schemaRegistry.add(darkColorSchema, {
|
|
2353
|
+
description: "The dark background color of the workspace"
|
|
2354
|
+
});
|
|
2355
|
+
var lightColorSchema = _default(colorSchema, "#cbd5e1");
|
|
2356
|
+
schemaRegistry.add(lightColorSchema, {
|
|
2357
|
+
description: "The light background color of the workspace"
|
|
2358
|
+
});
|
|
2359
|
+
var brandColorSchema = _default(colorSchema, "#1fb2a6");
|
|
2360
|
+
schemaRegistry.add(brandColorSchema, {
|
|
2361
|
+
description: "The primary brand specific color of the workspace"
|
|
2362
|
+
});
|
|
2363
|
+
var alternateColorSchema = optional(colorSchema);
|
|
2364
|
+
schemaRegistry.add(alternateColorSchema, {
|
|
2365
|
+
description: "The alternate brand specific color of the workspace"
|
|
2366
|
+
});
|
|
2367
|
+
var accentColorSchema = optional(colorSchema);
|
|
2368
|
+
schemaRegistry.add(accentColorSchema, {
|
|
2369
|
+
description: "The secondary brand specific color of the workspace"
|
|
2370
|
+
});
|
|
2371
|
+
var linkColorSchema = _default(colorSchema, "#3fa6ff");
|
|
2372
|
+
schemaRegistry.add(linkColorSchema, {
|
|
2373
|
+
description: "The color used to display hyperlink text"
|
|
2374
|
+
});
|
|
2375
|
+
var helpColorSchema = _default(colorSchema, "#818cf8");
|
|
2376
|
+
schemaRegistry.add(helpColorSchema, {
|
|
2377
|
+
description: "The second brand specific color of the workspace"
|
|
2378
|
+
});
|
|
2379
|
+
var successColorSchema = _default(colorSchema, "#45b27e");
|
|
2380
|
+
schemaRegistry.add(successColorSchema, {
|
|
2381
|
+
description: "The success color of the workspace"
|
|
2382
|
+
});
|
|
2383
|
+
var infoColorSchema = _default(colorSchema, "#38bdf8");
|
|
2384
|
+
schemaRegistry.add(infoColorSchema, {
|
|
2385
|
+
description: "The informational color of the workspace"
|
|
2386
|
+
});
|
|
2387
|
+
var debugColorSchema = _default(colorSchema, "#8afafc");
|
|
2388
|
+
schemaRegistry.add(debugColorSchema, {
|
|
2389
|
+
description: "The debug color of the workspace"
|
|
2390
|
+
});
|
|
2391
|
+
var warningColorSchema = _default(colorSchema, "#f3d371");
|
|
2392
|
+
schemaRegistry.add(warningColorSchema, {
|
|
2393
|
+
description: "The warning color of the workspace"
|
|
2394
|
+
});
|
|
2395
|
+
var dangerColorSchema = _default(colorSchema, "#d8314a");
|
|
2396
|
+
schemaRegistry.add(dangerColorSchema, {
|
|
2397
|
+
description: "The danger color of the workspace"
|
|
2398
|
+
});
|
|
2399
|
+
var fatalColorSchema = optional(colorSchema);
|
|
2400
|
+
schemaRegistry.add(fatalColorSchema, {
|
|
2401
|
+
description: "The fatal color of the workspace"
|
|
2402
|
+
});
|
|
2403
|
+
var positiveColorSchema = _default(colorSchema, "#4ade80");
|
|
2404
|
+
schemaRegistry.add(positiveColorSchema, {
|
|
2405
|
+
description: "The positive number color of the workspace"
|
|
2406
|
+
});
|
|
2407
|
+
var negativeColorSchema = _default(colorSchema, "#ef4444");
|
|
2408
|
+
schemaRegistry.add(negativeColorSchema, {
|
|
2409
|
+
description: "The negative number color of the workspace"
|
|
2410
|
+
});
|
|
2411
|
+
var gradientStopsSchema = optional(array(colorSchema));
|
|
2412
|
+
schemaRegistry.add(gradientStopsSchema, {
|
|
2413
|
+
description: "The color stops for the base gradient color pattern used in the workspace"
|
|
2414
|
+
});
|
|
2415
|
+
var darkColorsSchema = object({
|
|
2416
|
+
foreground: lightColorSchema,
|
|
2417
|
+
background: darkColorSchema,
|
|
2418
|
+
brand: brandColorSchema,
|
|
2419
|
+
alternate: alternateColorSchema,
|
|
2420
|
+
accent: accentColorSchema,
|
|
2421
|
+
link: linkColorSchema,
|
|
2422
|
+
help: helpColorSchema,
|
|
2423
|
+
success: successColorSchema,
|
|
2424
|
+
info: infoColorSchema,
|
|
2425
|
+
debug: debugColorSchema,
|
|
2426
|
+
warning: warningColorSchema,
|
|
2427
|
+
danger: dangerColorSchema,
|
|
2428
|
+
fatal: fatalColorSchema,
|
|
2429
|
+
positive: positiveColorSchema,
|
|
2430
|
+
negative: negativeColorSchema,
|
|
2431
|
+
gradient: gradientStopsSchema
|
|
2432
|
+
});
|
|
2433
|
+
var lightColorsSchema = object({
|
|
2434
|
+
foreground: darkColorSchema,
|
|
2435
|
+
background: lightColorSchema,
|
|
2436
|
+
brand: brandColorSchema,
|
|
2437
|
+
alternate: alternateColorSchema,
|
|
2438
|
+
accent: accentColorSchema,
|
|
2439
|
+
link: linkColorSchema,
|
|
2440
|
+
help: helpColorSchema,
|
|
2441
|
+
success: successColorSchema,
|
|
2442
|
+
info: infoColorSchema,
|
|
2443
|
+
debug: debugColorSchema,
|
|
2444
|
+
warning: warningColorSchema,
|
|
2445
|
+
danger: dangerColorSchema,
|
|
2446
|
+
fatal: fatalColorSchema,
|
|
2447
|
+
positive: positiveColorSchema,
|
|
2448
|
+
negative: negativeColorSchema,
|
|
2449
|
+
gradient: gradientStopsSchema
|
|
2450
|
+
});
|
|
2451
|
+
var multiColorsSchema = object({
|
|
2452
|
+
dark: darkColorsSchema,
|
|
2453
|
+
light: lightColorsSchema
|
|
2454
|
+
});
|
|
2455
|
+
var singleColorsSchema = object({
|
|
2456
|
+
dark: darkColorSchema,
|
|
2457
|
+
light: lightColorSchema,
|
|
2458
|
+
brand: brandColorSchema,
|
|
2459
|
+
alternate: alternateColorSchema,
|
|
2460
|
+
accent: accentColorSchema,
|
|
2461
|
+
link: linkColorSchema,
|
|
2462
|
+
help: helpColorSchema,
|
|
2463
|
+
success: successColorSchema,
|
|
2464
|
+
info: infoColorSchema,
|
|
2465
|
+
debug: debugColorSchema,
|
|
2466
|
+
warning: warningColorSchema,
|
|
2467
|
+
danger: dangerColorSchema,
|
|
2468
|
+
fatal: fatalColorSchema,
|
|
2469
|
+
positive: positiveColorSchema,
|
|
2470
|
+
negative: negativeColorSchema,
|
|
2471
|
+
gradient: gradientStopsSchema
|
|
2472
|
+
});
|
|
2473
|
+
var registryUrlConfigSchema = optional(url());
|
|
2474
|
+
schemaRegistry.add(registryUrlConfigSchema, {
|
|
2475
|
+
description: "A remote registry URL used to publish distributable packages"
|
|
2476
|
+
});
|
|
2477
|
+
var registrySchema = _default(
|
|
2478
|
+
object({
|
|
2479
|
+
github: registryUrlConfigSchema,
|
|
2480
|
+
npm: registryUrlConfigSchema,
|
|
2481
|
+
cargo: registryUrlConfigSchema,
|
|
2482
|
+
cyclone: registryUrlConfigSchema,
|
|
2483
|
+
container: registryUrlConfigSchema
|
|
2484
|
+
}),
|
|
2485
|
+
{}
|
|
2486
|
+
);
|
|
2487
|
+
schemaRegistry.add(registrySchema, {
|
|
2488
|
+
description: "A list of remote registry URLs used by Storm Software"
|
|
2489
|
+
});
|
|
2490
|
+
var colorsSchema = union([singleColorsSchema, multiColorsSchema]);
|
|
2491
|
+
schemaRegistry.add(colorsSchema, {
|
|
2492
|
+
description: "Colors used for various workspace elements"
|
|
2493
|
+
});
|
|
2494
|
+
var themeColorsSchema = record(
|
|
2495
|
+
union([union([literal("base"), string2()]), string2()]),
|
|
2496
|
+
colorsSchema
|
|
2497
|
+
);
|
|
2498
|
+
schemaRegistry.add(themeColorsSchema, {
|
|
2499
|
+
description: "Storm theme config values used for styling various package elements"
|
|
2500
|
+
});
|
|
2501
|
+
var extendsSchema = optional(
|
|
2502
|
+
union([string2().check(_trim()), array(string2().check(_trim()))])
|
|
2503
|
+
);
|
|
2504
|
+
schemaRegistry.add(extendsSchema, {
|
|
2505
|
+
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."
|
|
2506
|
+
});
|
|
2507
|
+
var workspaceBotNameSchema = string2().check(_trim());
|
|
2508
|
+
schemaRegistry.add(workspaceBotNameSchema, {
|
|
2509
|
+
description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
2510
|
+
});
|
|
2511
|
+
var workspaceBotEmailSchema = string2().check(_trim());
|
|
2512
|
+
schemaRegistry.add(workspaceBotEmailSchema, {
|
|
2513
|
+
description: "The email of the workspace bot"
|
|
2514
|
+
});
|
|
2515
|
+
var workspaceBotSchema = object({
|
|
2516
|
+
name: workspaceBotNameSchema,
|
|
2517
|
+
email: workspaceBotEmailSchema
|
|
2518
|
+
});
|
|
2519
|
+
schemaRegistry.add(workspaceBotSchema, {
|
|
2520
|
+
description: "The workspace's bot user's config used to automated various operations tasks"
|
|
2521
|
+
});
|
|
2522
|
+
var workspaceReleaseBannerUrlSchema = optional(
|
|
2523
|
+
string2().check(_trim(), url())
|
|
2524
|
+
);
|
|
2525
|
+
schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
|
|
2526
|
+
description: "A URL to a banner image used to display the workspace's release"
|
|
2527
|
+
});
|
|
2528
|
+
var workspaceReleaseBannerAltSchema = _default(
|
|
2529
|
+
string2().check(_trim()),
|
|
2530
|
+
STORM_DEFAULT_BANNER_ALT
|
|
2531
|
+
);
|
|
2532
|
+
schemaRegistry.add(workspaceReleaseBannerAltSchema, {
|
|
2533
|
+
description: "The alt text for the workspace's release banner image"
|
|
2534
|
+
});
|
|
2535
|
+
var workspaceReleaseBannerSchema = object({
|
|
2536
|
+
url: workspaceReleaseBannerUrlSchema,
|
|
2537
|
+
alt: workspaceReleaseBannerAltSchema
|
|
2538
|
+
});
|
|
2539
|
+
schemaRegistry.add(workspaceReleaseBannerSchema, {
|
|
2540
|
+
description: "The workspace's banner image used during the release process"
|
|
2541
|
+
});
|
|
2542
|
+
var workspaceReleaseHeaderSchema = optional(
|
|
2543
|
+
string2().check(_trim())
|
|
2544
|
+
);
|
|
2545
|
+
schemaRegistry.add(workspaceReleaseHeaderSchema, {
|
|
2546
|
+
description: "A header message appended to the start of the workspace's release notes"
|
|
2547
|
+
});
|
|
2548
|
+
var workspaceReleaseFooterSchema = optional(
|
|
2549
|
+
string2().check(_trim())
|
|
2550
|
+
);
|
|
2551
|
+
schemaRegistry.add(workspaceReleaseFooterSchema, {
|
|
2552
|
+
description: "A footer message appended to the end of the workspace's release notes"
|
|
2553
|
+
});
|
|
2554
|
+
var workspaceReleaseSchema = object({
|
|
2555
|
+
banner: union([
|
|
2556
|
+
workspaceReleaseBannerSchema,
|
|
2557
|
+
string2().check(_trim(), url())
|
|
2558
|
+
]),
|
|
2559
|
+
header: workspaceReleaseHeaderSchema,
|
|
2560
|
+
footer: workspaceReleaseFooterSchema
|
|
2561
|
+
});
|
|
2562
|
+
schemaRegistry.add(workspaceReleaseSchema, {
|
|
2563
|
+
description: "The workspace's release config used during the release process"
|
|
2564
|
+
});
|
|
2565
|
+
var workspaceSocialsTwitterSchema = optional(
|
|
2566
|
+
string2().check(_trim())
|
|
2567
|
+
);
|
|
2568
|
+
schemaRegistry.add(workspaceSocialsTwitterSchema, {
|
|
2569
|
+
description: "A Twitter/X account associated with the organization/project"
|
|
2570
|
+
});
|
|
2571
|
+
var workspaceSocialsDiscordSchema = optional(
|
|
2572
|
+
string2().check(_trim())
|
|
2573
|
+
);
|
|
2574
|
+
schemaRegistry.add(workspaceSocialsDiscordSchema, {
|
|
2575
|
+
description: "A Discord account associated with the organization/project"
|
|
2576
|
+
});
|
|
2577
|
+
var workspaceSocialsTelegramSchema = optional(
|
|
2578
|
+
string2().check(_trim())
|
|
2579
|
+
);
|
|
2580
|
+
schemaRegistry.add(workspaceSocialsTelegramSchema, {
|
|
2581
|
+
description: "A Telegram account associated with the organization/project"
|
|
2582
|
+
});
|
|
2583
|
+
var workspaceSocialsSlackSchema = optional(
|
|
2584
|
+
string2().check(_trim())
|
|
2585
|
+
);
|
|
2586
|
+
schemaRegistry.add(workspaceSocialsSlackSchema, {
|
|
2587
|
+
description: "A Slack account associated with the organization/project"
|
|
2588
|
+
});
|
|
2589
|
+
var workspaceSocialsMediumSchema = optional(
|
|
2590
|
+
string2().check(_trim())
|
|
2591
|
+
);
|
|
2592
|
+
schemaRegistry.add(workspaceSocialsMediumSchema, {
|
|
2593
|
+
description: "A Medium account associated with the organization/project"
|
|
2594
|
+
});
|
|
2595
|
+
var workspaceSocialsGithubSchema = optional(
|
|
2596
|
+
string2().check(_trim())
|
|
2597
|
+
);
|
|
2598
|
+
schemaRegistry.add(workspaceSocialsGithubSchema, {
|
|
2599
|
+
description: "A GitHub account associated with the organization/project"
|
|
2600
|
+
});
|
|
2601
|
+
var workspaceSocialsSchema = object({
|
|
2602
|
+
twitter: workspaceSocialsTwitterSchema,
|
|
2603
|
+
discord: workspaceSocialsDiscordSchema,
|
|
2604
|
+
telegram: workspaceSocialsTelegramSchema,
|
|
2605
|
+
slack: workspaceSocialsSlackSchema,
|
|
2606
|
+
medium: workspaceSocialsMediumSchema,
|
|
2607
|
+
github: workspaceSocialsGithubSchema
|
|
2608
|
+
});
|
|
2609
|
+
schemaRegistry.add(workspaceSocialsSchema, {
|
|
2610
|
+
description: "The workspace's account config used to store various social media links"
|
|
2611
|
+
});
|
|
2612
|
+
var workspaceDirectoryCacheSchema = optional(
|
|
2613
|
+
string2().check(_trim())
|
|
2614
|
+
);
|
|
2615
|
+
schemaRegistry.add(workspaceDirectoryCacheSchema, {
|
|
2616
|
+
description: "The directory used to store the environment's cached file data"
|
|
2617
|
+
});
|
|
2618
|
+
var workspaceDirectoryDataSchema = optional(
|
|
2619
|
+
string2().check(_trim())
|
|
2620
|
+
);
|
|
2621
|
+
schemaRegistry.add(workspaceDirectoryDataSchema, {
|
|
2622
|
+
description: "The directory used to store the environment's data files"
|
|
2623
|
+
});
|
|
2624
|
+
var workspaceDirectoryConfigSchema = optional(
|
|
2625
|
+
string2().check(_trim())
|
|
2626
|
+
);
|
|
2627
|
+
schemaRegistry.add(workspaceDirectoryConfigSchema, {
|
|
2628
|
+
description: "The directory used to store the environment's configuration files"
|
|
2629
|
+
});
|
|
2630
|
+
var workspaceDirectoryTempSchema = optional(
|
|
2631
|
+
string2().check(_trim())
|
|
2632
|
+
);
|
|
2633
|
+
schemaRegistry.add(workspaceDirectoryTempSchema, {
|
|
2634
|
+
description: "The directory used to store the environment's temp files"
|
|
2635
|
+
});
|
|
2636
|
+
var workspaceDirectoryLogSchema = optional(
|
|
2637
|
+
string2().check(_trim())
|
|
2638
|
+
);
|
|
2639
|
+
schemaRegistry.add(workspaceDirectoryLogSchema, {
|
|
2640
|
+
description: "The directory used to store the environment's log files"
|
|
2641
|
+
});
|
|
2642
|
+
var workspaceDirectoryBuildSchema = _default(
|
|
2643
|
+
string2().check(_trim()),
|
|
2644
|
+
"dist"
|
|
2645
|
+
);
|
|
2646
|
+
schemaRegistry.add(workspaceDirectoryBuildSchema, {
|
|
2647
|
+
description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
2648
|
+
});
|
|
2649
|
+
var workspaceDirectorySchema = object({
|
|
2650
|
+
cache: workspaceDirectoryCacheSchema,
|
|
2651
|
+
data: workspaceDirectoryDataSchema,
|
|
2652
|
+
config: workspaceDirectoryConfigSchema,
|
|
2653
|
+
temp: workspaceDirectoryTempSchema,
|
|
2654
|
+
log: workspaceDirectoryLogSchema,
|
|
2655
|
+
build: workspaceDirectoryBuildSchema
|
|
2656
|
+
});
|
|
2657
|
+
schemaRegistry.add(workspaceDirectorySchema, {
|
|
2658
|
+
description: "Various directories used by the workspace to store data, cache, and configuration files"
|
|
2659
|
+
});
|
|
2660
|
+
var variantSchema = _default(
|
|
2661
|
+
_enum(["minimal", "monorepo"]),
|
|
2662
|
+
"monorepo"
|
|
2663
|
+
);
|
|
2664
|
+
schemaRegistry.add(variantSchema, {
|
|
2665
|
+
description: "The variant of the workspace. This can be used to enable or disable certain features or configurations."
|
|
2666
|
+
});
|
|
2667
|
+
var errorCodesFileSchema = _default(
|
|
2668
|
+
string2().check(_trim()),
|
|
2669
|
+
STORM_DEFAULT_ERROR_CODES_FILE
|
|
2670
|
+
);
|
|
2671
|
+
schemaRegistry.add(errorCodesFileSchema, {
|
|
2672
|
+
description: "The path to the workspace's error codes JSON file"
|
|
2673
|
+
});
|
|
2674
|
+
var errorUrlSchema = optional(url());
|
|
2675
|
+
schemaRegistry.add(errorUrlSchema, {
|
|
2676
|
+
description: "A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
2677
|
+
});
|
|
2678
|
+
var errorSchema = object({
|
|
2679
|
+
codesFile: errorCodesFileSchema,
|
|
2680
|
+
url: errorUrlSchema
|
|
2681
|
+
});
|
|
2682
|
+
schemaRegistry.add(errorSchema, {
|
|
2683
|
+
description: "The workspace's error config used when creating error details during a system error"
|
|
2684
|
+
});
|
|
2685
|
+
var organizationNameSchema = optional(
|
|
2686
|
+
string2().check(_trim(), _toLowerCase())
|
|
2687
|
+
);
|
|
2688
|
+
schemaRegistry.add(organizationNameSchema, {
|
|
2689
|
+
description: "The name of the organization"
|
|
2690
|
+
});
|
|
2691
|
+
var organizationDescriptionSchema = optional(
|
|
2692
|
+
string2().check(_trim())
|
|
2693
|
+
);
|
|
2694
|
+
schemaRegistry.add(organizationDescriptionSchema, {
|
|
2695
|
+
description: "A description of the organization"
|
|
2696
|
+
});
|
|
2697
|
+
var organizationLogoSchema = optional(url());
|
|
2698
|
+
schemaRegistry.add(organizationLogoSchema, {
|
|
2699
|
+
description: "A URL to the organization's logo image"
|
|
2700
|
+
});
|
|
2701
|
+
var organizationIconSchema = optional(url());
|
|
2702
|
+
schemaRegistry.add(organizationIconSchema, {
|
|
2703
|
+
description: "A URL to the organization's icon image"
|
|
2704
|
+
});
|
|
2705
|
+
var organizationUrlSchema = optional(url());
|
|
2706
|
+
schemaRegistry.add(organizationUrlSchema, {
|
|
2707
|
+
description: "A URL to a page that provides more information about the organization"
|
|
2708
|
+
});
|
|
2709
|
+
var organizationSchema = object({
|
|
2710
|
+
name: organizationNameSchema,
|
|
2711
|
+
description: organizationDescriptionSchema,
|
|
2712
|
+
logo: organizationLogoSchema,
|
|
2713
|
+
icon: organizationIconSchema,
|
|
2714
|
+
url: organizationUrlSchema
|
|
2715
|
+
});
|
|
2716
|
+
schemaRegistry.add(organizationSchema, {
|
|
2717
|
+
description: "The workspace's organization details"
|
|
2718
|
+
});
|
|
2719
|
+
var schemaNameSchema = _default(
|
|
2720
|
+
string2().check(_trim(), _toLowerCase()),
|
|
2721
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
2722
|
+
);
|
|
2723
|
+
schemaRegistry.add(schemaNameSchema, {
|
|
2724
|
+
description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
2725
|
+
});
|
|
2726
|
+
var nameSchema = string2().check(_trim(), _toLowerCase());
|
|
2727
|
+
schemaRegistry.add(nameSchema, {
|
|
2728
|
+
description: "The name of the workspace/project/service/package/scope using this configuration"
|
|
2729
|
+
});
|
|
2730
|
+
var namespaceSchema = string2().check(_trim(), _toLowerCase());
|
|
2731
|
+
schemaRegistry.add(namespaceSchema, {
|
|
2732
|
+
description: "The namespace of the workspace/project/service/package/scope using this configuration"
|
|
2733
|
+
});
|
|
2734
|
+
var orgSchema = union([
|
|
2735
|
+
organizationSchema,
|
|
2736
|
+
string2().check(_trim(), _toLowerCase())
|
|
2737
|
+
]);
|
|
2738
|
+
schemaRegistry.add(orgSchema, {
|
|
2739
|
+
description: "The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
2740
|
+
});
|
|
2741
|
+
var repositorySchema = string2().check(_trim(), _toLowerCase());
|
|
2742
|
+
schemaRegistry.add(repositorySchema, {
|
|
2743
|
+
description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
|
|
2744
|
+
});
|
|
2745
|
+
var licenseSchema = _default(
|
|
2746
|
+
string2().check(_trim()),
|
|
2747
|
+
"Apache-2.0"
|
|
2748
|
+
);
|
|
2749
|
+
schemaRegistry.add(licenseSchema, {
|
|
2750
|
+
description: "The license type of the package"
|
|
2751
|
+
});
|
|
2752
|
+
var homepageSchema = optional(url());
|
|
2753
|
+
schemaRegistry.add(homepageSchema, {
|
|
2754
|
+
description: "The homepage of the workspace"
|
|
2755
|
+
});
|
|
2756
|
+
var docsSchema = optional(url());
|
|
2757
|
+
schemaRegistry.add(docsSchema, {
|
|
2758
|
+
description: "The documentation site for the workspace"
|
|
2759
|
+
});
|
|
2760
|
+
var portalSchema = optional(url());
|
|
2761
|
+
schemaRegistry.add(portalSchema, {
|
|
2762
|
+
description: "The development portal site for the workspace"
|
|
2763
|
+
});
|
|
2764
|
+
var licensingSchema = optional(url());
|
|
2765
|
+
schemaRegistry.add(licensingSchema, {
|
|
2766
|
+
description: "The licensing site for the workspace"
|
|
2767
|
+
});
|
|
2768
|
+
var contactSchema = optional(url());
|
|
2769
|
+
schemaRegistry.add(contactSchema, {
|
|
2770
|
+
description: "The contact site for the workspace"
|
|
2771
|
+
});
|
|
2772
|
+
var supportSchema = optional(url());
|
|
2773
|
+
schemaRegistry.add(supportSchema, {
|
|
2774
|
+
description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
2775
|
+
});
|
|
2776
|
+
var branchSchema = _default(
|
|
2777
|
+
string2().check(_trim(), _toLowerCase()),
|
|
2778
|
+
"main"
|
|
2779
|
+
);
|
|
2780
|
+
schemaRegistry.add(branchSchema, {
|
|
2781
|
+
description: "The branch of the workspace"
|
|
2782
|
+
});
|
|
2783
|
+
var preidSchema = optional(
|
|
2784
|
+
string2().check(_trim(), _toLowerCase())
|
|
2785
|
+
);
|
|
2786
|
+
schemaRegistry.add(preidSchema, {
|
|
2787
|
+
description: "A tag specifying the version pre-release identifier"
|
|
2788
|
+
});
|
|
2789
|
+
var ownerSchema = optional(
|
|
2790
|
+
string2().check(_trim(), _toLowerCase())
|
|
2791
|
+
);
|
|
2792
|
+
schemaRegistry.add(ownerSchema, {
|
|
2793
|
+
description: "The owner of the package"
|
|
2794
|
+
});
|
|
2795
|
+
var modeSchema = _default(
|
|
2796
|
+
_enum(["development", "test", "production"]).check(_trim(), _toLowerCase()),
|
|
2797
|
+
"production"
|
|
2798
|
+
);
|
|
2799
|
+
schemaRegistry.add(modeSchema, {
|
|
2800
|
+
description: "The current runtime environment mode for the package"
|
|
2801
|
+
});
|
|
2802
|
+
var workspaceRootSchema = string2().check(_trim(), _toLowerCase());
|
|
2803
|
+
schemaRegistry.add(workspaceRootSchema, {
|
|
2804
|
+
description: "The root directory of the workspace"
|
|
2805
|
+
});
|
|
2806
|
+
var skipCacheSchema = _default(boolean2(), false);
|
|
2807
|
+
schemaRegistry.add(skipCacheSchema, {
|
|
2808
|
+
description: "Should all known types of workspace caching be skipped?"
|
|
2809
|
+
});
|
|
2810
|
+
var packageManagerSchema = _default(
|
|
2811
|
+
_enum(["npm", "yarn", "pnpm", "bun"]),
|
|
2812
|
+
"npm"
|
|
2813
|
+
);
|
|
2814
|
+
schemaRegistry.add(packageManagerSchema, {
|
|
2815
|
+
description: "The JavaScript/TypeScript package manager used by the repository"
|
|
2816
|
+
});
|
|
2817
|
+
var timezoneSchema = _default(
|
|
2818
|
+
string2().check(_trim()),
|
|
2819
|
+
"America/New_York"
|
|
2820
|
+
);
|
|
2821
|
+
schemaRegistry.add(timezoneSchema, {
|
|
2822
|
+
description: "The default timezone of the workspace"
|
|
2823
|
+
});
|
|
2824
|
+
var localeSchema = _default(string2().check(_trim()), "en-US");
|
|
2825
|
+
schemaRegistry.add(localeSchema, {
|
|
2826
|
+
description: "The default locale of the workspace"
|
|
2827
|
+
});
|
|
2828
|
+
var logLevelSchema = _default(
|
|
2829
|
+
_enum([
|
|
2830
|
+
"silent",
|
|
2831
|
+
"fatal",
|
|
2832
|
+
"error",
|
|
2833
|
+
"warn",
|
|
2834
|
+
"success",
|
|
2835
|
+
"info",
|
|
2836
|
+
"debug",
|
|
2837
|
+
"trace",
|
|
2838
|
+
"all"
|
|
2839
|
+
]),
|
|
2840
|
+
"info"
|
|
2841
|
+
);
|
|
2842
|
+
schemaRegistry.add(logLevelSchema, {
|
|
2843
|
+
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`)."
|
|
2844
|
+
});
|
|
2845
|
+
var skipConfigLoggingSchema = _default(boolean2(), true);
|
|
2846
|
+
schemaRegistry.add(skipConfigLoggingSchema, {
|
|
2847
|
+
description: "Should the logging of the current Storm Workspace configuration be skipped?"
|
|
2848
|
+
});
|
|
2849
|
+
var configFileSchema = _default(
|
|
2850
|
+
nullable(string2().check(_trim())),
|
|
2851
|
+
null
|
|
2852
|
+
);
|
|
2853
|
+
schemaRegistry.add(configFileSchema, {
|
|
2854
|
+
description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
2855
|
+
});
|
|
2856
|
+
var extensionsSchema = _default(record(string2(), any()), {});
|
|
2857
|
+
schemaRegistry.add(extensionsSchema, {
|
|
2858
|
+
description: "Configuration of each used extension"
|
|
2859
|
+
});
|
|
2860
|
+
var workspaceConfigSchema = object({
|
|
2861
|
+
$schema: schemaNameSchema,
|
|
2862
|
+
extends: extendsSchema,
|
|
2863
|
+
name: nameSchema,
|
|
2864
|
+
variant: variantSchema,
|
|
2865
|
+
namespace: namespaceSchema,
|
|
2866
|
+
organization: orgSchema,
|
|
2867
|
+
repository: repositorySchema,
|
|
2868
|
+
license: licenseSchema,
|
|
2869
|
+
homepage: homepageSchema,
|
|
2870
|
+
docs: docsSchema,
|
|
2871
|
+
portal: portalSchema,
|
|
2872
|
+
licensing: licensingSchema,
|
|
2873
|
+
contact: contactSchema,
|
|
2874
|
+
support: supportSchema,
|
|
2875
|
+
branch: branchSchema,
|
|
2876
|
+
preid: preidSchema,
|
|
2877
|
+
owner: ownerSchema,
|
|
2878
|
+
bot: workspaceBotSchema,
|
|
2879
|
+
release: workspaceReleaseSchema,
|
|
2880
|
+
socials: workspaceSocialsSchema,
|
|
2881
|
+
error: errorSchema,
|
|
2882
|
+
mode: modeSchema,
|
|
2883
|
+
workspaceRoot: workspaceRootSchema,
|
|
2884
|
+
skipCache: skipCacheSchema,
|
|
2885
|
+
directories: workspaceDirectorySchema,
|
|
2886
|
+
packageManager: packageManagerSchema,
|
|
2887
|
+
timezone: timezoneSchema,
|
|
2888
|
+
locale: localeSchema,
|
|
2889
|
+
logLevel: logLevelSchema,
|
|
2890
|
+
skipConfigLogging: skipConfigLoggingSchema,
|
|
2891
|
+
registry: registrySchema,
|
|
2892
|
+
configFile: configFileSchema,
|
|
2893
|
+
colors: union([colorsSchema, themeColorsSchema]),
|
|
2894
|
+
extensions: extensionsSchema
|
|
2895
|
+
});
|
|
2896
|
+
schemaRegistry.add(extensionsSchema, {
|
|
2897
|
+
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."
|
|
2898
|
+
});
|
|
2899
|
+
|
|
2900
|
+
// ../config/src/types.ts
|
|
2901
|
+
var COLOR_KEYS = [
|
|
2902
|
+
"dark",
|
|
2903
|
+
"light",
|
|
2904
|
+
"base",
|
|
2905
|
+
"brand",
|
|
2906
|
+
"alternate",
|
|
2907
|
+
"accent",
|
|
2908
|
+
"link",
|
|
2909
|
+
"success",
|
|
2910
|
+
"help",
|
|
2911
|
+
"info",
|
|
2912
|
+
"warning",
|
|
2913
|
+
"danger",
|
|
2914
|
+
"fatal",
|
|
2915
|
+
"positive",
|
|
2916
|
+
"negative"
|
|
2917
|
+
];
|
|
2918
|
+
async function getPackageJsonConfig(root) {
|
|
2919
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
2920
|
+
let homepage = void 0;
|
|
2921
|
+
let support = void 0;
|
|
2922
|
+
let name = void 0;
|
|
2923
|
+
let namespace = void 0;
|
|
2924
|
+
let repository = void 0;
|
|
2925
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
2926
|
+
if (existsSync(join(workspaceRoot, "package.json"))) {
|
|
2927
|
+
const file = await readFile(
|
|
2928
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
2929
|
+
"utf8"
|
|
2930
|
+
);
|
|
2931
|
+
if (file) {
|
|
2932
|
+
const packageJson = JSON.parse(file);
|
|
2933
|
+
if (packageJson.name) {
|
|
2934
|
+
name = packageJson.name;
|
|
2935
|
+
}
|
|
2936
|
+
if (packageJson.namespace) {
|
|
2937
|
+
namespace = packageJson.namespace;
|
|
2938
|
+
}
|
|
2939
|
+
if (packageJson.repository) {
|
|
2940
|
+
if (typeof packageJson.repository === "string") {
|
|
2941
|
+
repository = packageJson.repository;
|
|
2942
|
+
} else if (packageJson.repository.url) {
|
|
2943
|
+
repository = packageJson.repository.url;
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
if (packageJson.license) {
|
|
2947
|
+
license = packageJson.license;
|
|
2948
|
+
}
|
|
2949
|
+
if (packageJson.homepage) {
|
|
2950
|
+
homepage = packageJson.homepage;
|
|
2951
|
+
}
|
|
2952
|
+
if (packageJson.bugs) {
|
|
2953
|
+
if (typeof packageJson.bugs === "string") {
|
|
2954
|
+
support = packageJson.bugs;
|
|
2955
|
+
} else if (packageJson.bugs.url) {
|
|
2956
|
+
support = packageJson.bugs.url;
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
return {
|
|
2962
|
+
workspaceRoot,
|
|
2963
|
+
name,
|
|
2964
|
+
namespace,
|
|
2965
|
+
repository,
|
|
2966
|
+
license,
|
|
2967
|
+
homepage,
|
|
2968
|
+
support
|
|
2969
|
+
};
|
|
2970
|
+
}
|
|
2971
|
+
function applyDefaultConfig(config2) {
|
|
2972
|
+
if (!config2.support && config2.contact) {
|
|
2973
|
+
config2.support = config2.contact;
|
|
2974
|
+
}
|
|
2975
|
+
if (!config2.contact && config2.support) {
|
|
2976
|
+
config2.contact = config2.support;
|
|
2977
|
+
}
|
|
2978
|
+
if (config2.homepage) {
|
|
2979
|
+
if (!config2.docs) {
|
|
2980
|
+
config2.docs = `${config2.homepage}/docs`;
|
|
2981
|
+
}
|
|
2982
|
+
if (!config2.license) {
|
|
2983
|
+
config2.license = `${config2.homepage}/license`;
|
|
2984
|
+
}
|
|
2985
|
+
if (!config2.support) {
|
|
2986
|
+
config2.support = `${config2.homepage}/support`;
|
|
2987
|
+
}
|
|
2988
|
+
if (!config2.contact) {
|
|
2989
|
+
config2.contact = `${config2.homepage}/contact`;
|
|
2990
|
+
}
|
|
2991
|
+
if (!config2.error?.codesFile || !config2?.error?.url) {
|
|
2992
|
+
config2.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
2993
|
+
if (config2.homepage) {
|
|
2994
|
+
config2.error.url ??= `${config2.homepage}/errors`;
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
return config2;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
3002
|
+
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
3003
|
+
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
3004
|
+
const configs = await Promise.all([
|
|
3005
|
+
loadConfig({
|
|
3006
|
+
cwd: workspacePath,
|
|
3007
|
+
packageJson: true,
|
|
3008
|
+
name: fileName,
|
|
3009
|
+
envName: fileName?.toUpperCase(),
|
|
3010
|
+
jitiOptions: {
|
|
3011
|
+
debug: false,
|
|
3012
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
3013
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
3014
|
+
"jiti"
|
|
3015
|
+
)
|
|
3016
|
+
},
|
|
3017
|
+
...options
|
|
3018
|
+
}),
|
|
3019
|
+
loadConfig({
|
|
3020
|
+
cwd: workspacePath,
|
|
3021
|
+
packageJson: true,
|
|
3022
|
+
name: fileName,
|
|
3023
|
+
envName: fileName?.toUpperCase(),
|
|
3024
|
+
jitiOptions: {
|
|
3025
|
+
debug: false,
|
|
3026
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
3027
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
3028
|
+
"jiti"
|
|
3029
|
+
)
|
|
3030
|
+
},
|
|
3031
|
+
configFile: fileName,
|
|
3032
|
+
...options
|
|
3033
|
+
})
|
|
3034
|
+
]);
|
|
3035
|
+
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
3036
|
+
};
|
|
3037
|
+
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
3038
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
3039
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
3040
|
+
let config2 = result.config;
|
|
3041
|
+
const configFile = result.configFile;
|
|
3042
|
+
if (config2 && configFile && Object.keys(config2).length > 0 && !config2.skipConfigLogging) {
|
|
3043
|
+
writeTrace(
|
|
3044
|
+
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
3045
|
+
{
|
|
3046
|
+
logLevel: "all"
|
|
3047
|
+
}
|
|
3048
|
+
);
|
|
3049
|
+
}
|
|
3050
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
3051
|
+
const results = await Promise.all(
|
|
3052
|
+
additionalFileNames.map(
|
|
3053
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
3054
|
+
)
|
|
3055
|
+
);
|
|
3056
|
+
for (const result2 of results) {
|
|
3057
|
+
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
3058
|
+
if (!config2.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
3059
|
+
writeTrace(
|
|
3060
|
+
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
3061
|
+
{
|
|
3062
|
+
logLevel: "all"
|
|
3063
|
+
}
|
|
3064
|
+
);
|
|
3065
|
+
}
|
|
3066
|
+
config2 = defu(result2.config ?? {}, config2 ?? {});
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
if (!config2 || Object.keys(config2).length === 0) {
|
|
3071
|
+
return void 0;
|
|
3072
|
+
}
|
|
3073
|
+
config2.configFile = configFile;
|
|
3074
|
+
return config2;
|
|
3075
|
+
};
|
|
3076
|
+
var getConfigEnv = () => {
|
|
3077
|
+
const prefix = "STORM_";
|
|
3078
|
+
let config2 = {
|
|
3079
|
+
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
3080
|
+
name: process.env[`${prefix}NAME`] || void 0,
|
|
3081
|
+
variant: process.env[`${prefix}VARIANT`] || void 0,
|
|
3082
|
+
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
3083
|
+
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
3084
|
+
bot: {
|
|
3085
|
+
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
3086
|
+
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
3087
|
+
},
|
|
3088
|
+
release: {
|
|
3089
|
+
banner: {
|
|
3090
|
+
url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
|
|
3091
|
+
alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
|
|
3092
|
+
},
|
|
3093
|
+
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
|
|
3094
|
+
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
|
|
3095
|
+
},
|
|
3096
|
+
error: {
|
|
3097
|
+
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
|
|
3098
|
+
url: process.env[`${prefix}ERROR_URL`] || void 0
|
|
3099
|
+
},
|
|
3100
|
+
socials: {
|
|
3101
|
+
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
|
|
3102
|
+
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
|
|
3103
|
+
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
|
|
3104
|
+
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
|
|
3105
|
+
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
|
|
3106
|
+
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
|
|
3107
|
+
},
|
|
3108
|
+
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`] ? {
|
|
3109
|
+
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
|
|
3110
|
+
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
|
|
3111
|
+
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
|
|
3112
|
+
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
|
|
3113
|
+
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
|
|
3114
|
+
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
|
|
3115
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
3116
|
+
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
3117
|
+
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
3118
|
+
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
3119
|
+
portal: process.env[`${prefix}PORTAL`] || void 0,
|
|
3120
|
+
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
3121
|
+
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
3122
|
+
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
3123
|
+
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
3124
|
+
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
3125
|
+
configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
|
|
3126
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
3127
|
+
directories: {
|
|
3128
|
+
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,
|
|
3129
|
+
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,
|
|
3130
|
+
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,
|
|
3131
|
+
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,
|
|
3132
|
+
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,
|
|
3133
|
+
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
|
|
3134
|
+
},
|
|
3135
|
+
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
3136
|
+
mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
|
|
3137
|
+
// ci:
|
|
3138
|
+
// process.env[`${prefix}CI`] !== undefined
|
|
3139
|
+
// ? Boolean(
|
|
3140
|
+
// process.env[`${prefix}CI`] ??
|
|
3141
|
+
// process.env.CI ??
|
|
3142
|
+
// process.env.CONTINUOUS_INTEGRATION
|
|
3143
|
+
// )
|
|
3144
|
+
// : undefined,
|
|
3145
|
+
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
3146
|
+
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
3147
|
+
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
3148
|
+
registry: {
|
|
3149
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
3150
|
+
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
3151
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
3152
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
3153
|
+
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
3154
|
+
},
|
|
3155
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
3156
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
3157
|
+
) ? getLogLevelLabel(
|
|
3158
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
3159
|
+
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
3160
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
3161
|
+
};
|
|
3162
|
+
const themeNames = Object.keys(process.env).filter(
|
|
3163
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
3164
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
3165
|
+
)
|
|
3166
|
+
);
|
|
3167
|
+
config2.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
3168
|
+
(ret, themeName) => {
|
|
3169
|
+
ret[themeName] = getThemeColorsEnv(prefix, themeName);
|
|
3170
|
+
return ret;
|
|
3171
|
+
},
|
|
3172
|
+
{}
|
|
3173
|
+
) : getThemeColorsEnv(prefix);
|
|
3174
|
+
if (config2.docs === STORM_DEFAULT_DOCS) {
|
|
3175
|
+
if (config2.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
3176
|
+
config2.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config2.name}/docs`;
|
|
3177
|
+
} else {
|
|
3178
|
+
config2.docs = `${config2.homepage}/docs`;
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
if (config2.licensing === STORM_DEFAULT_LICENSING) {
|
|
3182
|
+
if (config2.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
3183
|
+
config2.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config2.name}/licensing`;
|
|
3184
|
+
} else {
|
|
3185
|
+
config2.licensing = `${config2.homepage}/docs`;
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
|
|
3189
|
+
if (serializedConfig) {
|
|
3190
|
+
const parsed = JSON.parse(serializedConfig);
|
|
3191
|
+
config2 = {
|
|
3192
|
+
...config2,
|
|
3193
|
+
...parsed,
|
|
3194
|
+
colors: { ...config2.colors, ...parsed.colors },
|
|
3195
|
+
extensions: { ...config2.extensions, ...parsed.extensions }
|
|
3196
|
+
};
|
|
3197
|
+
}
|
|
3198
|
+
return config2;
|
|
3199
|
+
};
|
|
3200
|
+
var getThemeColorsEnv = (prefix, theme) => {
|
|
3201
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
3202
|
+
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
|
|
3203
|
+
};
|
|
3204
|
+
var getSingleThemeColorsEnv = (prefix) => {
|
|
3205
|
+
const gradient = [];
|
|
3206
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
3207
|
+
gradient.push(
|
|
3208
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
3209
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
3210
|
+
);
|
|
3211
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
3212
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
3213
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
3214
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
3215
|
+
index++;
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
return {
|
|
3219
|
+
dark: process.env[`${prefix}DARK`],
|
|
3220
|
+
light: process.env[`${prefix}LIGHT`],
|
|
3221
|
+
brand: process.env[`${prefix}BRAND`],
|
|
3222
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
3223
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
3224
|
+
link: process.env[`${prefix}LINK`],
|
|
3225
|
+
help: process.env[`${prefix}HELP`],
|
|
3226
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
3227
|
+
info: process.env[`${prefix}INFO`],
|
|
3228
|
+
debug: process.env[`${prefix}DEBUG`],
|
|
3229
|
+
warning: process.env[`${prefix}WARNING`],
|
|
3230
|
+
danger: process.env[`${prefix}DANGER`],
|
|
3231
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
3232
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
3233
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
3234
|
+
gradient
|
|
3235
|
+
};
|
|
3236
|
+
};
|
|
3237
|
+
var getMultiThemeColorsEnv = (prefix) => {
|
|
3238
|
+
return {
|
|
3239
|
+
light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
|
|
3240
|
+
dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
|
|
3241
|
+
};
|
|
3242
|
+
};
|
|
3243
|
+
var getBaseThemeColorsEnv = (prefix) => {
|
|
3244
|
+
const gradient = [];
|
|
3245
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
3246
|
+
gradient.push(
|
|
3247
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
3248
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
3249
|
+
);
|
|
3250
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
3251
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
3252
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
3253
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
3254
|
+
index++;
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
return {
|
|
3258
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
3259
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
3260
|
+
brand: process.env[`${prefix}BRAND`],
|
|
3261
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
3262
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
3263
|
+
link: process.env[`${prefix}LINK`],
|
|
3264
|
+
help: process.env[`${prefix}HELP`],
|
|
3265
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
3266
|
+
info: process.env[`${prefix}INFO`],
|
|
3267
|
+
debug: process.env[`${prefix}DEBUG`],
|
|
3268
|
+
warning: process.env[`${prefix}WARNING`],
|
|
3269
|
+
danger: process.env[`${prefix}DANGER`],
|
|
3270
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
3271
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
3272
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
3273
|
+
gradient
|
|
3274
|
+
};
|
|
3275
|
+
};
|
|
3276
|
+
|
|
3277
|
+
// ../config-tools/src/env/set-env.ts
|
|
3278
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
3279
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
3280
|
+
if (extension[key]) {
|
|
3281
|
+
const result = key?.replace(
|
|
3282
|
+
/([A-Z])+/g,
|
|
3283
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
3284
|
+
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
3285
|
+
let extensionKey;
|
|
3286
|
+
if (result.length === 0) {
|
|
3287
|
+
return;
|
|
3288
|
+
}
|
|
3289
|
+
if (result.length === 1) {
|
|
3290
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
3291
|
+
} else {
|
|
3292
|
+
extensionKey = result.reduce((ret, part) => {
|
|
3293
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
3294
|
+
});
|
|
3295
|
+
}
|
|
3296
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
3297
|
+
}
|
|
3298
|
+
}
|
|
3299
|
+
};
|
|
3300
|
+
var setConfigEnv = (config2) => {
|
|
3301
|
+
const prefix = "STORM_";
|
|
3302
|
+
if (config2.extends) {
|
|
3303
|
+
process.env[`${prefix}EXTENDS`] = Array.isArray(config2.extends) ? JSON.stringify(config2.extends) : config2.extends;
|
|
3304
|
+
}
|
|
3305
|
+
if (config2.name) {
|
|
3306
|
+
process.env[`${prefix}NAME`] = config2.name;
|
|
3307
|
+
}
|
|
3308
|
+
if (config2.variant) {
|
|
3309
|
+
process.env[`${prefix}VARIANT`] = config2.variant;
|
|
3310
|
+
}
|
|
3311
|
+
if (config2.namespace) {
|
|
3312
|
+
process.env[`${prefix}NAMESPACE`] = config2.namespace;
|
|
3313
|
+
}
|
|
3314
|
+
if (config2.owner) {
|
|
3315
|
+
process.env[`${prefix}OWNER`] = config2.owner;
|
|
3316
|
+
}
|
|
3317
|
+
if (config2.bot) {
|
|
3318
|
+
process.env[`${prefix}BOT_NAME`] = config2.bot.name;
|
|
3319
|
+
process.env[`${prefix}BOT_EMAIL`] = config2.bot.email;
|
|
3320
|
+
}
|
|
3321
|
+
if (config2.error) {
|
|
3322
|
+
process.env[`${prefix}ERROR_CODES_FILE`] = config2.error.codesFile;
|
|
3323
|
+
process.env[`${prefix}ERROR_URL`] = config2.error.url;
|
|
3324
|
+
}
|
|
3325
|
+
if (config2.release) {
|
|
3326
|
+
if (config2.release.banner) {
|
|
3327
|
+
if (typeof config2.release.banner === "string") {
|
|
3328
|
+
process.env[`${prefix}RELEASE_BANNER`] = config2.release.banner;
|
|
3329
|
+
process.env[`${prefix}RELEASE_BANNER_URL`] = config2.release.banner;
|
|
3330
|
+
} else {
|
|
3331
|
+
process.env[`${prefix}RELEASE_BANNER`] = config2.release.banner.url;
|
|
3332
|
+
process.env[`${prefix}RELEASE_BANNER_URL`] = config2.release.banner.url;
|
|
3333
|
+
process.env[`${prefix}RELEASE_BANNER_ALT`] = config2.release.banner.alt;
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
process.env[`${prefix}RELEASE_HEADER`] = config2.release.header;
|
|
3337
|
+
process.env[`${prefix}RELEASE_FOOTER`] = config2.release.footer;
|
|
3338
|
+
}
|
|
3339
|
+
if (config2.socials) {
|
|
3340
|
+
if (config2.socials.twitter) {
|
|
3341
|
+
process.env[`${prefix}SOCIAL_TWITTER`] = config2.socials.twitter;
|
|
3342
|
+
}
|
|
3343
|
+
if (config2.socials.discord) {
|
|
3344
|
+
process.env[`${prefix}SOCIAL_DISCORD`] = config2.socials.discord;
|
|
3345
|
+
}
|
|
3346
|
+
if (config2.socials.telegram) {
|
|
3347
|
+
process.env[`${prefix}SOCIAL_TELEGRAM`] = config2.socials.telegram;
|
|
3348
|
+
}
|
|
3349
|
+
if (config2.socials.slack) {
|
|
3350
|
+
process.env[`${prefix}SOCIAL_SLACK`] = config2.socials.slack;
|
|
3351
|
+
}
|
|
3352
|
+
if (config2.socials.medium) {
|
|
3353
|
+
process.env[`${prefix}SOCIAL_MEDIUM`] = config2.socials.medium;
|
|
3354
|
+
}
|
|
3355
|
+
if (config2.socials.github) {
|
|
3356
|
+
process.env[`${prefix}SOCIAL_GITHUB`] = config2.socials.github;
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
if (config2.organization) {
|
|
3360
|
+
if (typeof config2.organization === "string") {
|
|
3361
|
+
process.env[`${prefix}ORG`] = config2.organization;
|
|
3362
|
+
process.env[`${prefix}ORG_NAME`] = config2.organization;
|
|
3363
|
+
process.env[`${prefix}ORGANIZATION`] = config2.organization;
|
|
3364
|
+
process.env[`${prefix}ORGANIZATION_NAME`] = config2.organization;
|
|
3365
|
+
} else {
|
|
3366
|
+
process.env[`${prefix}ORG`] = config2.organization.name;
|
|
3367
|
+
process.env[`${prefix}ORG_NAME`] = config2.organization.name;
|
|
3368
|
+
process.env[`${prefix}ORGANIZATION`] = config2.organization.name;
|
|
3369
|
+
process.env[`${prefix}ORGANIZATION_NAME`] = config2.organization.name;
|
|
3370
|
+
if (config2.organization.url) {
|
|
3371
|
+
process.env[`${prefix}ORG_URL`] = config2.organization.url;
|
|
3372
|
+
process.env[`${prefix}ORGANIZATION_URL`] = config2.organization.url;
|
|
3373
|
+
}
|
|
3374
|
+
if (config2.organization.description) {
|
|
3375
|
+
process.env[`${prefix}ORG_DESCRIPTION`] = config2.organization.description;
|
|
3376
|
+
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config2.organization.description;
|
|
3377
|
+
}
|
|
3378
|
+
if (config2.organization.logo) {
|
|
3379
|
+
process.env[`${prefix}ORG_LOGO`] = config2.organization.logo;
|
|
3380
|
+
process.env[`${prefix}ORGANIZATION_LOGO`] = config2.organization.logo;
|
|
3381
|
+
}
|
|
3382
|
+
if (config2.organization.icon) {
|
|
3383
|
+
process.env[`${prefix}ORG_ICON`] = config2.organization.icon;
|
|
3384
|
+
process.env[`${prefix}ORGANIZATION_ICON`] = config2.organization.icon;
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
if (config2.packageManager) {
|
|
3389
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config2.packageManager;
|
|
3390
|
+
}
|
|
3391
|
+
if (config2.license) {
|
|
3392
|
+
process.env[`${prefix}LICENSE`] = config2.license;
|
|
3393
|
+
}
|
|
3394
|
+
if (config2.homepage) {
|
|
3395
|
+
process.env[`${prefix}HOMEPAGE`] = config2.homepage;
|
|
3396
|
+
}
|
|
3397
|
+
if (config2.docs) {
|
|
3398
|
+
process.env[`${prefix}DOCS`] = config2.docs;
|
|
3399
|
+
}
|
|
3400
|
+
if (config2.portal) {
|
|
3401
|
+
process.env[`${prefix}PORTAL`] = config2.portal;
|
|
3402
|
+
}
|
|
3403
|
+
if (config2.licensing) {
|
|
3404
|
+
process.env[`${prefix}LICENSING`] = config2.licensing;
|
|
3405
|
+
}
|
|
3406
|
+
if (config2.contact) {
|
|
3407
|
+
process.env[`${prefix}CONTACT`] = config2.contact;
|
|
3408
|
+
}
|
|
3409
|
+
if (config2.support) {
|
|
3410
|
+
process.env[`${prefix}SUPPORT`] = config2.support;
|
|
3411
|
+
}
|
|
3412
|
+
if (config2.timezone) {
|
|
3413
|
+
process.env[`${prefix}TIMEZONE`] = config2.timezone;
|
|
3414
|
+
process.env.TZ = config2.timezone;
|
|
3415
|
+
process.env.DEFAULT_TIMEZONE = config2.timezone;
|
|
3416
|
+
process.env.TIMEZONE = config2.timezone;
|
|
3417
|
+
}
|
|
3418
|
+
if (config2.locale) {
|
|
3419
|
+
process.env[`${prefix}LOCALE`] = config2.locale;
|
|
3420
|
+
process.env.DEFAULT_LOCALE = config2.locale;
|
|
3421
|
+
process.env.LOCALE = config2.locale;
|
|
3422
|
+
process.env.LANG = config2.locale ? `${config2.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
3423
|
+
}
|
|
3424
|
+
if (config2.configFile) {
|
|
3425
|
+
process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
|
|
3426
|
+
config2.configFile
|
|
3427
|
+
);
|
|
3428
|
+
}
|
|
3429
|
+
if (config2.workspaceRoot) {
|
|
3430
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config2.workspaceRoot);
|
|
3431
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config2.workspaceRoot);
|
|
3432
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config2.workspaceRoot);
|
|
3433
|
+
}
|
|
3434
|
+
if (config2.directories) {
|
|
3435
|
+
if (!config2.skipCache && config2.directories.cache) {
|
|
3436
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
3437
|
+
config2.directories.cache
|
|
3438
|
+
);
|
|
3439
|
+
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
3440
|
+
}
|
|
3441
|
+
if (config2.directories.data) {
|
|
3442
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config2.directories.data);
|
|
3443
|
+
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
3444
|
+
}
|
|
3445
|
+
if (config2.directories.config) {
|
|
3446
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
3447
|
+
config2.directories.config
|
|
3448
|
+
);
|
|
3449
|
+
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
3450
|
+
}
|
|
3451
|
+
if (config2.directories.temp) {
|
|
3452
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config2.directories.temp);
|
|
3453
|
+
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
3454
|
+
}
|
|
3455
|
+
if (config2.directories.log) {
|
|
3456
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config2.directories.log);
|
|
3457
|
+
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
3458
|
+
}
|
|
3459
|
+
if (config2.directories.build) {
|
|
3460
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
3461
|
+
config2.directories.build
|
|
3462
|
+
);
|
|
3463
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
if (config2.skipCache !== void 0) {
|
|
3467
|
+
process.env[`${prefix}SKIP_CACHE`] = String(config2.skipCache);
|
|
3468
|
+
if (config2.skipCache) {
|
|
3469
|
+
process.env.NX_SKIP_NX_CACHE ??= String(config2.skipCache);
|
|
3470
|
+
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config2.skipCache);
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
if (config2.mode) {
|
|
3474
|
+
process.env[`${prefix}MODE`] = config2.mode;
|
|
3475
|
+
process.env.NODE_ENV = config2.mode;
|
|
3476
|
+
process.env.ENVIRONMENT = config2.mode;
|
|
3477
|
+
}
|
|
3478
|
+
if (config2.colors?.base?.light || config2.colors?.base?.dark) {
|
|
3479
|
+
for (const key of Object.keys(config2.colors)) {
|
|
3480
|
+
setThemeColorsEnv(`${prefix}COLOR_${key}_`, config2.colors[key]);
|
|
3481
|
+
}
|
|
3482
|
+
} else {
|
|
3483
|
+
setThemeColorsEnv(
|
|
3484
|
+
`${prefix}COLOR_`,
|
|
3485
|
+
config2.colors
|
|
3486
|
+
);
|
|
3487
|
+
}
|
|
3488
|
+
if (config2.repository) {
|
|
3489
|
+
process.env[`${prefix}REPOSITORY`] = config2.repository;
|
|
3490
|
+
}
|
|
3491
|
+
if (config2.branch) {
|
|
3492
|
+
process.env[`${prefix}BRANCH`] = config2.branch;
|
|
3493
|
+
}
|
|
3494
|
+
if (config2.preid) {
|
|
3495
|
+
process.env[`${prefix}PRE_ID`] = String(config2.preid);
|
|
3496
|
+
}
|
|
3497
|
+
if (config2.registry) {
|
|
3498
|
+
if (config2.registry.github) {
|
|
3499
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config2.registry.github);
|
|
3500
|
+
}
|
|
3501
|
+
if (config2.registry.npm) {
|
|
3502
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config2.registry.npm);
|
|
3503
|
+
}
|
|
3504
|
+
if (config2.registry.cargo) {
|
|
3505
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config2.registry.cargo);
|
|
3506
|
+
}
|
|
3507
|
+
if (config2.registry.cyclone) {
|
|
3508
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
3509
|
+
config2.registry.cyclone
|
|
3510
|
+
);
|
|
3511
|
+
}
|
|
3512
|
+
if (config2.registry.container) {
|
|
3513
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
3514
|
+
config2.registry.container
|
|
3515
|
+
);
|
|
3516
|
+
}
|
|
3517
|
+
}
|
|
3518
|
+
if (config2.logLevel) {
|
|
3519
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config2.logLevel);
|
|
3520
|
+
process.env.LOG_LEVEL = String(config2.logLevel);
|
|
3521
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
3522
|
+
getLogLevel(config2.logLevel) >= LogLevel.DEBUG ? true : false
|
|
3523
|
+
);
|
|
3524
|
+
process.env.RUST_BACKTRACE = getLogLevel(config2.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
3525
|
+
}
|
|
3526
|
+
if (config2.skipConfigLogging !== void 0) {
|
|
3527
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
3528
|
+
config2.skipConfigLogging
|
|
3529
|
+
);
|
|
3530
|
+
}
|
|
3531
|
+
process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config2);
|
|
3532
|
+
for (const key of Object.keys(config2.extensions ?? {})) {
|
|
3533
|
+
if (config2.extensions[key] && Object.keys(config2.extensions[key])) {
|
|
3534
|
+
setExtensionEnv(key, config2.extensions[key]);
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
};
|
|
3538
|
+
var setThemeColorsEnv = (prefix, config2) => {
|
|
3539
|
+
return config2?.light?.brand || config2?.dark?.brand ? setMultiThemeColorsEnv(prefix, config2) : setSingleThemeColorsEnv(prefix, config2);
|
|
3540
|
+
};
|
|
3541
|
+
var setSingleThemeColorsEnv = (prefix, config2) => {
|
|
3542
|
+
if (config2.dark) {
|
|
3543
|
+
process.env[`${prefix}DARK`] = config2.dark;
|
|
3544
|
+
}
|
|
3545
|
+
if (config2.light) {
|
|
3546
|
+
process.env[`${prefix}LIGHT`] = config2.light;
|
|
3547
|
+
}
|
|
3548
|
+
if (config2.brand) {
|
|
3549
|
+
process.env[`${prefix}BRAND`] = config2.brand;
|
|
3550
|
+
}
|
|
3551
|
+
if (config2.alternate) {
|
|
3552
|
+
process.env[`${prefix}ALTERNATE`] = config2.alternate;
|
|
3553
|
+
}
|
|
3554
|
+
if (config2.accent) {
|
|
3555
|
+
process.env[`${prefix}ACCENT`] = config2.accent;
|
|
3556
|
+
}
|
|
3557
|
+
if (config2.link) {
|
|
3558
|
+
process.env[`${prefix}LINK`] = config2.link;
|
|
3559
|
+
}
|
|
3560
|
+
if (config2.help) {
|
|
3561
|
+
process.env[`${prefix}HELP`] = config2.help;
|
|
3562
|
+
}
|
|
3563
|
+
if (config2.success) {
|
|
3564
|
+
process.env[`${prefix}SUCCESS`] = config2.success;
|
|
3565
|
+
}
|
|
3566
|
+
if (config2.info) {
|
|
3567
|
+
process.env[`${prefix}INFO`] = config2.info;
|
|
3568
|
+
}
|
|
3569
|
+
if (config2.debug) {
|
|
3570
|
+
process.env[`${prefix}DEBUG`] = config2.debug;
|
|
3571
|
+
}
|
|
3572
|
+
if (config2.warning) {
|
|
3573
|
+
process.env[`${prefix}WARNING`] = config2.warning;
|
|
3574
|
+
}
|
|
3575
|
+
if (config2.danger) {
|
|
3576
|
+
process.env[`${prefix}DANGER`] = config2.danger;
|
|
3577
|
+
}
|
|
3578
|
+
if (config2.fatal) {
|
|
3579
|
+
process.env[`${prefix}FATAL`] = config2.fatal;
|
|
3580
|
+
}
|
|
3581
|
+
if (config2.positive) {
|
|
3582
|
+
process.env[`${prefix}POSITIVE`] = config2.positive;
|
|
3583
|
+
}
|
|
3584
|
+
if (config2.negative) {
|
|
3585
|
+
process.env[`${prefix}NEGATIVE`] = config2.negative;
|
|
3586
|
+
}
|
|
3587
|
+
if (config2.gradient) {
|
|
3588
|
+
for (let i = 0; i < config2.gradient.length; i++) {
|
|
3589
|
+
process.env[`${prefix}GRADIENT_${i}`] = config2.gradient[i];
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3592
|
+
};
|
|
3593
|
+
var setMultiThemeColorsEnv = (prefix, config2) => {
|
|
3594
|
+
return {
|
|
3595
|
+
light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config2.light),
|
|
3596
|
+
dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config2.dark)
|
|
3597
|
+
};
|
|
3598
|
+
};
|
|
3599
|
+
var setBaseThemeColorsEnv = (prefix, config2) => {
|
|
3600
|
+
if (config2.foreground) {
|
|
3601
|
+
process.env[`${prefix}FOREGROUND`] = config2.foreground;
|
|
3602
|
+
}
|
|
3603
|
+
if (config2.background) {
|
|
3604
|
+
process.env[`${prefix}BACKGROUND`] = config2.background;
|
|
3605
|
+
}
|
|
3606
|
+
if (config2.brand) {
|
|
3607
|
+
process.env[`${prefix}BRAND`] = config2.brand;
|
|
3608
|
+
}
|
|
3609
|
+
if (config2.alternate) {
|
|
3610
|
+
process.env[`${prefix}ALTERNATE`] = config2.alternate;
|
|
3611
|
+
}
|
|
3612
|
+
if (config2.accent) {
|
|
3613
|
+
process.env[`${prefix}ACCENT`] = config2.accent;
|
|
3614
|
+
}
|
|
3615
|
+
if (config2.link) {
|
|
3616
|
+
process.env[`${prefix}LINK`] = config2.link;
|
|
3617
|
+
}
|
|
3618
|
+
if (config2.help) {
|
|
3619
|
+
process.env[`${prefix}HELP`] = config2.help;
|
|
3620
|
+
}
|
|
3621
|
+
if (config2.success) {
|
|
3622
|
+
process.env[`${prefix}SUCCESS`] = config2.success;
|
|
3623
|
+
}
|
|
3624
|
+
if (config2.info) {
|
|
3625
|
+
process.env[`${prefix}INFO`] = config2.info;
|
|
3626
|
+
}
|
|
3627
|
+
if (config2.debug) {
|
|
3628
|
+
process.env[`${prefix}DEBUG`] = config2.debug;
|
|
3629
|
+
}
|
|
3630
|
+
if (config2.warning) {
|
|
3631
|
+
process.env[`${prefix}WARNING`] = config2.warning;
|
|
3632
|
+
}
|
|
3633
|
+
if (config2.danger) {
|
|
3634
|
+
process.env[`${prefix}DANGER`] = config2.danger;
|
|
3635
|
+
}
|
|
3636
|
+
if (config2.fatal) {
|
|
3637
|
+
process.env[`${prefix}FATAL`] = config2.fatal;
|
|
3638
|
+
}
|
|
3639
|
+
if (config2.positive) {
|
|
3640
|
+
process.env[`${prefix}POSITIVE`] = config2.positive;
|
|
3641
|
+
}
|
|
3642
|
+
if (config2.negative) {
|
|
3643
|
+
process.env[`${prefix}NEGATIVE`] = config2.negative;
|
|
3644
|
+
}
|
|
3645
|
+
if (config2.gradient) {
|
|
3646
|
+
for (let i = 0; i < config2.gradient.length; i++) {
|
|
3647
|
+
process.env[`${prefix}GRADIENT_${i}`] = config2.gradient[i];
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
};
|
|
3651
|
+
var _static_cache = void 0;
|
|
3652
|
+
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
3653
|
+
let result;
|
|
3654
|
+
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
3655
|
+
let _workspaceRoot = workspaceRoot;
|
|
3656
|
+
if (!_workspaceRoot) {
|
|
3657
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
3658
|
+
}
|
|
3659
|
+
const configEnv = getConfigEnv();
|
|
3660
|
+
const configFile = await getConfigFile(_workspaceRoot);
|
|
3661
|
+
if (!configFile) {
|
|
3662
|
+
if (!skipLogs) {
|
|
3663
|
+
writeWarning(
|
|
3664
|
+
"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",
|
|
3665
|
+
{ logLevel: "all" }
|
|
3666
|
+
);
|
|
3667
|
+
}
|
|
3668
|
+
if (useDefault === false) {
|
|
3669
|
+
return void 0;
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
|
|
3673
|
+
const configInput = defu(
|
|
3674
|
+
configEnv,
|
|
3675
|
+
configFile,
|
|
3676
|
+
defaultConfig
|
|
3677
|
+
);
|
|
3678
|
+
if (!configInput.variant) {
|
|
3679
|
+
configInput.variant = existsSync(joinPaths(_workspaceRoot, "nx.json")) || existsSync(joinPaths(_workspaceRoot, ".nx")) || existsSync(joinPaths(_workspaceRoot, "lerna.json")) || existsSync(joinPaths(_workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
|
|
3680
|
+
}
|
|
3681
|
+
try {
|
|
3682
|
+
result = applyDefaultConfig(
|
|
3683
|
+
await workspaceConfigSchema.parseAsync(configInput)
|
|
3684
|
+
);
|
|
3685
|
+
result.workspaceRoot ??= _workspaceRoot;
|
|
3686
|
+
} catch (error) {
|
|
3687
|
+
throw new Error(
|
|
3688
|
+
`Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
|
|
3689
|
+
|
|
3690
|
+
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${formatLogMessage(
|
|
3691
|
+
configInput
|
|
3692
|
+
)}`,
|
|
3693
|
+
{
|
|
3694
|
+
cause: error
|
|
3695
|
+
}
|
|
3696
|
+
);
|
|
3697
|
+
}
|
|
3698
|
+
} else {
|
|
3699
|
+
result = _static_cache.data;
|
|
3700
|
+
}
|
|
3701
|
+
_static_cache = {
|
|
3702
|
+
timestamp: Date.now(),
|
|
3703
|
+
data: result
|
|
3704
|
+
};
|
|
3705
|
+
return result;
|
|
3706
|
+
};
|
|
3707
|
+
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
3708
|
+
const config2 = await createStormWorkspaceConfig(
|
|
3709
|
+
void 0,
|
|
3710
|
+
void 0,
|
|
3711
|
+
workspaceRoot,
|
|
3712
|
+
skipLogs,
|
|
3713
|
+
true
|
|
3714
|
+
);
|
|
3715
|
+
setConfigEnv(config2);
|
|
3716
|
+
if (!skipLogs && !config2.skipConfigLogging) {
|
|
3717
|
+
writeTrace(
|
|
3718
|
+
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
3719
|
+
${formatLogMessage(config2)}`,
|
|
3720
|
+
config2
|
|
3721
|
+
);
|
|
3722
|
+
}
|
|
3723
|
+
return config2;
|
|
3724
|
+
};
|
|
3725
|
+
|
|
3726
|
+
// ../config-tools/src/get-config.ts
|
|
3727
|
+
function getConfig(workspaceRoot, skipLogs = false) {
|
|
3728
|
+
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
3729
|
+
}
|
|
3730
|
+
function getWorkspaceConfig(skipLogs = true, options = {}) {
|
|
3731
|
+
let workspaceRoot = options.workspaceRoot;
|
|
3732
|
+
if (!workspaceRoot) {
|
|
3733
|
+
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
3734
|
+
}
|
|
3735
|
+
return getConfig(workspaceRoot, skipLogs);
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
// src/utilities/title-case.ts
|
|
3739
|
+
var ACRONYMS = [
|
|
3740
|
+
"3D",
|
|
3741
|
+
"4D",
|
|
3742
|
+
"5G",
|
|
3743
|
+
"6G",
|
|
3744
|
+
"7G",
|
|
3745
|
+
"8G",
|
|
3746
|
+
"ACID",
|
|
3747
|
+
"AES",
|
|
3748
|
+
"AI",
|
|
3749
|
+
"AJAX",
|
|
3750
|
+
"API",
|
|
3751
|
+
"AR",
|
|
3752
|
+
"ASCII",
|
|
3753
|
+
"B2B",
|
|
3754
|
+
"B2C",
|
|
3755
|
+
"BFF",
|
|
3756
|
+
"BI",
|
|
3757
|
+
"BIOS",
|
|
3758
|
+
"BGP",
|
|
3759
|
+
"BOM",
|
|
3760
|
+
"BYOD",
|
|
3761
|
+
"C2C",
|
|
3762
|
+
"CAGR",
|
|
3763
|
+
"CAPTCHA",
|
|
3764
|
+
"CD",
|
|
3765
|
+
"CDN",
|
|
3766
|
+
"CDP",
|
|
3767
|
+
"CI",
|
|
3768
|
+
"CI/CD",
|
|
3769
|
+
"CIAM",
|
|
3770
|
+
"CICD",
|
|
3771
|
+
"CLI",
|
|
3772
|
+
"CMDB",
|
|
3773
|
+
"CORS",
|
|
3774
|
+
"CPU",
|
|
3775
|
+
"CRUD",
|
|
3776
|
+
"CSR",
|
|
3777
|
+
"CSS",
|
|
3778
|
+
"CX",
|
|
3779
|
+
"DAG",
|
|
3780
|
+
"DBMS",
|
|
3781
|
+
"DDoS",
|
|
3782
|
+
"DNS",
|
|
3783
|
+
"DNSSEC",
|
|
3784
|
+
"DOM",
|
|
3785
|
+
"DR",
|
|
3786
|
+
"DRM",
|
|
3787
|
+
"DWH",
|
|
3788
|
+
"E2E",
|
|
3789
|
+
"EAI",
|
|
3790
|
+
"EKS",
|
|
3791
|
+
"EOF",
|
|
3792
|
+
"EOD",
|
|
3793
|
+
"ETC",
|
|
3794
|
+
"ETL",
|
|
3795
|
+
"EULA",
|
|
3796
|
+
"FIDO",
|
|
3797
|
+
"FQDN",
|
|
3798
|
+
"FTP",
|
|
3799
|
+
"FaaS",
|
|
3800
|
+
"GDPR",
|
|
3801
|
+
"GCP",
|
|
3802
|
+
"GPU",
|
|
3803
|
+
"GUID",
|
|
3804
|
+
"GUI",
|
|
3805
|
+
"GZIP",
|
|
3806
|
+
"HCI",
|
|
3807
|
+
"HDD",
|
|
3808
|
+
"HDFS",
|
|
3809
|
+
"HIPAA",
|
|
3810
|
+
"HMAC",
|
|
3811
|
+
"HOTP",
|
|
3812
|
+
"HSM",
|
|
3813
|
+
"HTML",
|
|
3814
|
+
"HTTP",
|
|
3815
|
+
"HTTP/2",
|
|
3816
|
+
"HTTP/2.0",
|
|
3817
|
+
"HTTP/3",
|
|
3818
|
+
"HTTP/3.0",
|
|
3819
|
+
"HTTP2",
|
|
3820
|
+
"HTTPS",
|
|
3821
|
+
"HTTPS/2",
|
|
3822
|
+
"HTTPS/3",
|
|
3823
|
+
"HTTPS3",
|
|
3824
|
+
"IAM",
|
|
3825
|
+
"IAMM",
|
|
3826
|
+
"IAMT",
|
|
3827
|
+
"IaaS",
|
|
3828
|
+
"ID",
|
|
3829
|
+
"IMAP",
|
|
3830
|
+
"IP",
|
|
3831
|
+
"IPFS",
|
|
3832
|
+
"IoT",
|
|
3833
|
+
"JSON",
|
|
3834
|
+
"JSONP",
|
|
3835
|
+
"JWT",
|
|
3836
|
+
"K8s",
|
|
3837
|
+
"KMS",
|
|
3838
|
+
"KPI",
|
|
3839
|
+
"LAN",
|
|
3840
|
+
"LHS",
|
|
3841
|
+
"LXC",
|
|
3842
|
+
"MFA",
|
|
3843
|
+
"ML",
|
|
3844
|
+
"MLOps",
|
|
3845
|
+
"MVC",
|
|
3846
|
+
"MVP",
|
|
3847
|
+
"NAS",
|
|
3848
|
+
"NAT",
|
|
3849
|
+
"NDA",
|
|
3850
|
+
"NFS",
|
|
3851
|
+
"NIST",
|
|
3852
|
+
"NLP",
|
|
3853
|
+
"NPS",
|
|
3854
|
+
"OCR",
|
|
3855
|
+
"OEM",
|
|
3856
|
+
"OKR",
|
|
3857
|
+
"OLAP",
|
|
3858
|
+
"OLTP",
|
|
3859
|
+
"OOP",
|
|
3860
|
+
"ORM",
|
|
3861
|
+
"OS",
|
|
3862
|
+
"OTP",
|
|
3863
|
+
"P2P",
|
|
3864
|
+
"PDP",
|
|
3865
|
+
"PaaS",
|
|
3866
|
+
"PCI",
|
|
3867
|
+
"PKI",
|
|
3868
|
+
"PP",
|
|
3869
|
+
"PWA",
|
|
3870
|
+
"PX",
|
|
3871
|
+
"QA",
|
|
3872
|
+
"RAID",
|
|
3873
|
+
"RAM",
|
|
3874
|
+
"RDS",
|
|
3875
|
+
"REST",
|
|
3876
|
+
"RHS",
|
|
3877
|
+
"RPC",
|
|
3878
|
+
"RPA",
|
|
3879
|
+
"RUM",
|
|
3880
|
+
"RSS",
|
|
3881
|
+
"SAN",
|
|
3882
|
+
"SASE",
|
|
3883
|
+
"SDLC",
|
|
3884
|
+
"SDK",
|
|
3885
|
+
"SEO",
|
|
3886
|
+
"SFTP",
|
|
3887
|
+
"SIEM",
|
|
3888
|
+
"SLA",
|
|
3889
|
+
"SMB",
|
|
3890
|
+
"SMTP",
|
|
3891
|
+
"SOAP",
|
|
3892
|
+
"SOC",
|
|
3893
|
+
"SOA",
|
|
3894
|
+
"SPDY",
|
|
3895
|
+
"SPF",
|
|
3896
|
+
"SQL",
|
|
3897
|
+
"SRV",
|
|
3898
|
+
"SRE",
|
|
3899
|
+
"SSH",
|
|
3900
|
+
"SSDL",
|
|
3901
|
+
"SSO",
|
|
3902
|
+
"SSL",
|
|
3903
|
+
"SSR",
|
|
3904
|
+
"TDD",
|
|
3905
|
+
"TLD",
|
|
3906
|
+
"TLS",
|
|
3907
|
+
"TLS1.3",
|
|
3908
|
+
"TOTP",
|
|
3909
|
+
"TRPC",
|
|
3910
|
+
"TTL",
|
|
3911
|
+
"UDP",
|
|
3912
|
+
"UI",
|
|
3913
|
+
"UID",
|
|
3914
|
+
"URI",
|
|
3915
|
+
"URL",
|
|
3916
|
+
"UTF",
|
|
3917
|
+
"UUID",
|
|
3918
|
+
"UX",
|
|
3919
|
+
"VM",
|
|
3920
|
+
"VLAN",
|
|
3921
|
+
"VPN",
|
|
3922
|
+
"VR",
|
|
3923
|
+
"WAF",
|
|
3924
|
+
"WAN",
|
|
3925
|
+
"WLAN",
|
|
3926
|
+
"WPA",
|
|
3927
|
+
"XACML",
|
|
3928
|
+
"XML",
|
|
3929
|
+
"XSRF",
|
|
3930
|
+
"XSS",
|
|
3931
|
+
"XR",
|
|
3932
|
+
"YAML",
|
|
3933
|
+
"ZTA"
|
|
3934
|
+
];
|
|
3935
|
+
ACRONYMS.reduce(
|
|
3936
|
+
(ret, acronym) => {
|
|
3937
|
+
ret[acronym.toLowerCase()] = acronym;
|
|
3938
|
+
return ret;
|
|
3939
|
+
},
|
|
3940
|
+
{
|
|
3941
|
+
cspell: "CSpell",
|
|
3942
|
+
eslint: "ESLint",
|
|
3943
|
+
nx: "Nx"
|
|
3944
|
+
}
|
|
3945
|
+
);
|
|
3946
|
+
|
|
3947
|
+
// src/utilities/changelog-utils.ts
|
|
3948
|
+
function generateChangelogTitle(version2, project, workspaceConfig) {
|
|
3949
|
+
if (!workspaceConfig?.name || !project) {
|
|
3950
|
+
return version2;
|
|
3951
|
+
}
|
|
3952
|
+
return `[${version2}](https://github.com/${typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization?.name}/${workspaceConfig.name}/releases/tag/${project}%40${version2}) (${(/* @__PURE__ */ new Date()).getMonth() + 1 < 10 ? `0${(/* @__PURE__ */ new Date()).getMonth() + 1}` : (/* @__PURE__ */ new Date()).getMonth() + 1}/${(/* @__PURE__ */ new Date()).getDate() < 10 ? `0${(/* @__PURE__ */ new Date()).getDate()}` : (/* @__PURE__ */ new Date()).getDate()}/${(/* @__PURE__ */ new Date()).getFullYear()})`;
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
// src/release/changelog-renderer.ts
|
|
3956
|
+
var StormChangelogRenderer = class extends DefaultChangelogRenderer {
|
|
3957
|
+
/**
|
|
3958
|
+
* The Storm workspace configuration object, which is loaded from the storm-workspace.json file.
|
|
3959
|
+
*/
|
|
3960
|
+
workspaceConfig;
|
|
3961
|
+
/**
|
|
3962
|
+
* A ChangelogRenderer class takes in the determined changes and other relevant metadata and returns a string, or a Promise of a string of changelog contents (usually markdown).
|
|
3963
|
+
*
|
|
3964
|
+
* @param config - The configuration object for the ChangelogRenderer
|
|
3965
|
+
*/
|
|
3966
|
+
constructor(config2) {
|
|
3967
|
+
const resolvedConfig = {
|
|
3968
|
+
entryWhenNoChanges: false,
|
|
3969
|
+
conventionalCommitsConfig: DEFAULT_CONVENTIONAL_COMMITS_CONFIG,
|
|
3970
|
+
...config2
|
|
3971
|
+
};
|
|
3972
|
+
super(resolvedConfig);
|
|
3973
|
+
this.workspaceConfig = config2.workspaceConfig;
|
|
3974
|
+
this.remoteReleaseClient = resolvedConfig.remoteReleaseClient;
|
|
3975
|
+
}
|
|
3976
|
+
async render() {
|
|
3977
|
+
if (!this.workspaceConfig) {
|
|
3978
|
+
this.workspaceConfig = await getWorkspaceConfig();
|
|
3979
|
+
}
|
|
3980
|
+
return super.render();
|
|
3981
|
+
}
|
|
3982
|
+
preprocessChanges() {
|
|
3983
|
+
this.relevantChanges = [...this.changes];
|
|
3984
|
+
this.breakingChanges = [];
|
|
3985
|
+
this.additionalChangesForAuthorsSection = [];
|
|
3986
|
+
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
3987
|
+
const change = this.relevantChanges[i];
|
|
3988
|
+
if (change && change.type === "revert" && change.revertedHashes) {
|
|
3989
|
+
for (const revertedHash of change.revertedHashes) {
|
|
3990
|
+
const revertedCommitIndex = this.relevantChanges.findIndex(
|
|
3991
|
+
(c) => c.shortHash && revertedHash.startsWith(c.shortHash)
|
|
3992
|
+
);
|
|
3993
|
+
if (revertedCommitIndex !== -1) {
|
|
3994
|
+
this.relevantChanges.splice(revertedCommitIndex, 1);
|
|
3995
|
+
this.relevantChanges.splice(i, 1);
|
|
3996
|
+
i--;
|
|
3997
|
+
break;
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
if (this.isVersionPlans) {
|
|
4003
|
+
this.conventionalCommitsConfig = {
|
|
4004
|
+
types: {
|
|
4005
|
+
feat: DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.feat,
|
|
4006
|
+
fix: DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.fix
|
|
4007
|
+
}
|
|
4008
|
+
};
|
|
4009
|
+
for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
|
|
4010
|
+
if (this.relevantChanges[i]?.isBreaking) {
|
|
4011
|
+
const change = this.relevantChanges[i];
|
|
4012
|
+
if (change) {
|
|
4013
|
+
this.additionalChangesForAuthorsSection.push(change);
|
|
4014
|
+
const line = this.formatChange(change);
|
|
4015
|
+
this.breakingChanges.push(line);
|
|
4016
|
+
this.relevantChanges.splice(i, 1);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
} else {
|
|
4021
|
+
for (const change of this.relevantChanges) {
|
|
4022
|
+
if (change.isBreaking) {
|
|
4023
|
+
const breakingChangeExplanation = change.body ? this.extractBreakingChangeExplanation(change.body) : "";
|
|
4024
|
+
this.breakingChanges.push(
|
|
4025
|
+
breakingChangeExplanation ? `- ${change.scope ? `**${change.scope.trim()}:** ` : ""}${breakingChangeExplanation}` : this.formatChange(change)
|
|
4026
|
+
);
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
}
|
|
4030
|
+
}
|
|
4031
|
+
/**
|
|
4032
|
+
* Determines if the changelog entry should be rendered as empty. This is the case when there are no relevant changes, breaking changes, or dependency bumps.
|
|
4033
|
+
*/
|
|
4034
|
+
// protected override shouldRenderEmptyEntry(): boolean {
|
|
4035
|
+
// return true;
|
|
4036
|
+
// }
|
|
4037
|
+
renderVersionTitle() {
|
|
4038
|
+
const isMajorVersion = `${major(this.changelogEntryVersion)}.0.0` === this.changelogEntryVersion.replace(/^v/, "");
|
|
4039
|
+
return isMajorVersion ? `# ${generateChangelogTitle(
|
|
4040
|
+
this.changelogEntryVersion,
|
|
4041
|
+
this.project,
|
|
4042
|
+
this.workspaceConfig
|
|
4043
|
+
)}` : `## ${generateChangelogTitle(
|
|
4044
|
+
this.changelogEntryVersion,
|
|
4045
|
+
this.project,
|
|
4046
|
+
this.workspaceConfig
|
|
4047
|
+
)}`;
|
|
4048
|
+
}
|
|
4049
|
+
renderBreakingChanges() {
|
|
4050
|
+
return [
|
|
4051
|
+
"### Breaking Changes",
|
|
4052
|
+
"",
|
|
4053
|
+
...Array.from(new Set(this.breakingChanges))
|
|
4054
|
+
];
|
|
4055
|
+
}
|
|
4056
|
+
renderDependencyBumps() {
|
|
4057
|
+
const markdownLines = ["", "### Updated Dependencies", ""];
|
|
4058
|
+
this.dependencyBumps?.forEach(({ dependencyName, newVersion }) => {
|
|
4059
|
+
const markdownLine = `- Updated **${dependencyName}** to **v${newVersion}**`;
|
|
4060
|
+
if (!markdownLines.includes(markdownLine)) {
|
|
4061
|
+
markdownLines.push(markdownLine);
|
|
4062
|
+
}
|
|
4063
|
+
});
|
|
4064
|
+
return markdownLines;
|
|
4065
|
+
}
|
|
4066
|
+
async renderAuthors() {
|
|
4067
|
+
const markdownLines = [];
|
|
4068
|
+
const _authors = /* @__PURE__ */ new Map();
|
|
4069
|
+
for (const change of [
|
|
4070
|
+
...this.relevantChanges,
|
|
4071
|
+
...this.additionalChangesForAuthorsSection
|
|
4072
|
+
]) {
|
|
4073
|
+
if (!change.authors) {
|
|
4074
|
+
continue;
|
|
4075
|
+
}
|
|
4076
|
+
for (const author of change.authors) {
|
|
4077
|
+
const name = this.formatName(author.name);
|
|
4078
|
+
if (!name || name.includes("[bot]") || name === this.workspaceConfig?.bot.name) {
|
|
4079
|
+
continue;
|
|
4080
|
+
}
|
|
4081
|
+
if (_authors.has(name)) {
|
|
4082
|
+
const entry = _authors.get(name);
|
|
4083
|
+
entry?.email.add(author.email);
|
|
4084
|
+
} else {
|
|
4085
|
+
_authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
if (this.changelogRenderOptions.mapAuthorsToGitHubUsernames) {
|
|
4090
|
+
await Promise.all(
|
|
4091
|
+
[..._authors.keys()].map(async (authorName) => {
|
|
4092
|
+
const meta2 = _authors.get(authorName);
|
|
4093
|
+
if (!meta2) {
|
|
4094
|
+
return;
|
|
4095
|
+
}
|
|
4096
|
+
for (const email2 of meta2.email) {
|
|
4097
|
+
if (email2?.endsWith("@users.noreply.github.com")) {
|
|
4098
|
+
const match = email2?.match(
|
|
4099
|
+
/^(\d+\+)?([^@]+)@users\.noreply\.github\.com$/
|
|
4100
|
+
);
|
|
4101
|
+
if (match && match[2]) {
|
|
4102
|
+
meta2.github = match[2];
|
|
4103
|
+
break;
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4106
|
+
const { data } = await axios2.get(`https://ungh.cc/users/find/${email2}`).catch(() => ({ data: { user: null } }));
|
|
4107
|
+
if (data?.user) {
|
|
4108
|
+
meta2.github = data.user.username;
|
|
4109
|
+
break;
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
})
|
|
4113
|
+
);
|
|
4114
|
+
}
|
|
4115
|
+
const authors = [..._authors.entries()].map((e) => ({
|
|
4116
|
+
name: e[0],
|
|
4117
|
+
...e[1]
|
|
4118
|
+
}));
|
|
4119
|
+
if (authors.length > 0) {
|
|
4120
|
+
markdownLines.push(
|
|
4121
|
+
"",
|
|
4122
|
+
"### \u2764\uFE0F Thank You",
|
|
4123
|
+
"",
|
|
4124
|
+
...authors.sort((a, b) => a.name.localeCompare(b.name)).map((i) => {
|
|
4125
|
+
const github = i.github ? ` @${i.github}` : "";
|
|
4126
|
+
return `- ${i.name}${github}`;
|
|
4127
|
+
})
|
|
4128
|
+
);
|
|
4129
|
+
}
|
|
4130
|
+
return markdownLines;
|
|
4131
|
+
}
|
|
4132
|
+
formatChange(change) {
|
|
4133
|
+
let description = change.description || "";
|
|
4134
|
+
let extraLines = [];
|
|
4135
|
+
let extraLinesStr = "";
|
|
4136
|
+
if (description.includes("\n")) {
|
|
4137
|
+
const lines = description.split("\n");
|
|
4138
|
+
if (lines.length > 1) {
|
|
4139
|
+
description = lines[0];
|
|
4140
|
+
extraLines = lines.slice(1);
|
|
4141
|
+
}
|
|
4142
|
+
const indentation = " ";
|
|
4143
|
+
extraLinesStr = extraLines.filter((l) => l.trim().length > 0).map((l) => `${indentation}${l}`).join("\n");
|
|
4144
|
+
}
|
|
4145
|
+
let changeLine = "- " + (!this.isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : "") + description;
|
|
4146
|
+
if (change.githubReferences) {
|
|
4147
|
+
changeLine += this.remoteReleaseClient.formatReferences(
|
|
4148
|
+
change.githubReferences
|
|
4149
|
+
);
|
|
4150
|
+
}
|
|
4151
|
+
if (extraLinesStr) {
|
|
4152
|
+
changeLine += "\n\n" + extraLinesStr;
|
|
4153
|
+
}
|
|
4154
|
+
return changeLine;
|
|
4155
|
+
}
|
|
4156
|
+
};
|
|
4157
|
+
|
|
4158
|
+
// src/release/config.ts
|
|
4159
|
+
var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
|
|
4160
|
+
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
4161
|
+
types: DEFAULT_COMMIT_TYPES
|
|
4162
|
+
};
|
|
4163
|
+
var DEFAULT_RELEASE_TAG_PATTERN = "{projectName}@{version}";
|
|
4164
|
+
var DEFAULT_RELEASE_GROUP_CONFIG = {
|
|
4165
|
+
projectsRelationship: "independent",
|
|
4166
|
+
changelog: {
|
|
4167
|
+
createRelease: "github",
|
|
4168
|
+
entryWhenNoChanges: false,
|
|
4169
|
+
file: false,
|
|
4170
|
+
renderOptions: {
|
|
4171
|
+
authors: false,
|
|
4172
|
+
commitReferences: true,
|
|
4173
|
+
versionTitleDate: true
|
|
4174
|
+
}
|
|
4175
|
+
},
|
|
4176
|
+
version: {
|
|
4177
|
+
currentVersionResolver: "git-tag",
|
|
4178
|
+
fallbackCurrentVersionResolver: "disk",
|
|
4179
|
+
specifierSource: "conventional-commits",
|
|
4180
|
+
groupPreVersionCommand: "pnpm build"
|
|
4181
|
+
},
|
|
4182
|
+
releaseTag: { pattern: DEFAULT_RELEASE_TAG_PATTERN }
|
|
4183
|
+
};
|
|
4184
|
+
var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
|
|
4185
|
+
...DEFAULT_RELEASE_GROUP_CONFIG,
|
|
4186
|
+
projects: ["packages/*"],
|
|
4187
|
+
version: {
|
|
4188
|
+
...DEFAULT_RELEASE_GROUP_CONFIG.version,
|
|
4189
|
+
versionActions: "@storm-software/workspace-tools/release/js-version-actions",
|
|
4190
|
+
versionActionsOptions: {
|
|
4191
|
+
currentVersionResolver: "git-tag",
|
|
4192
|
+
specifierSource: "conventional-commits"
|
|
4193
|
+
},
|
|
4194
|
+
manifestRootsToUpdate: [
|
|
4195
|
+
"{projectRoot}",
|
|
4196
|
+
{
|
|
4197
|
+
path: "dist/{projectRoot}",
|
|
4198
|
+
preserveLocalDependencyProtocols: false
|
|
4199
|
+
}
|
|
4200
|
+
]
|
|
4201
|
+
}
|
|
4202
|
+
};
|
|
4203
|
+
var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
|
|
4204
|
+
...DEFAULT_RELEASE_GROUP_CONFIG,
|
|
4205
|
+
projects: ["crates/*"],
|
|
4206
|
+
version: {
|
|
4207
|
+
...DEFAULT_RELEASE_GROUP_CONFIG.version,
|
|
4208
|
+
versionActions: "@storm-software/workspace-tools/release/rust-version-actions",
|
|
4209
|
+
versionActionsOptions: {
|
|
4210
|
+
currentVersionResolver: "git-tag",
|
|
4211
|
+
specifierSource: "conventional-commits"
|
|
4212
|
+
},
|
|
4213
|
+
manifestRootsToUpdate: ["{projectRoot}"]
|
|
4214
|
+
}
|
|
4215
|
+
};
|
|
4216
|
+
var DEFAULT_RELEASE_CONFIG = {
|
|
4217
|
+
conventionalCommits: DEFAULT_CONVENTIONAL_COMMITS_CONFIG2,
|
|
4218
|
+
groups: {
|
|
4219
|
+
packages: DEFAULT_JS_RELEASE_GROUP_CONFIG,
|
|
4220
|
+
crates: DEFAULT_RUST_RELEASE_GROUP_CONFIG
|
|
4221
|
+
},
|
|
4222
|
+
changelog: {
|
|
4223
|
+
automaticFromRef: true,
|
|
4224
|
+
workspaceChangelog: false,
|
|
4225
|
+
projectChangelogs: true
|
|
4226
|
+
},
|
|
4227
|
+
releaseTag: { pattern: DEFAULT_RELEASE_TAG_PATTERN }
|
|
4228
|
+
};
|
|
4229
|
+
function getReleaseGroupConfig(releaseConfig, workspaceConfig) {
|
|
4230
|
+
return !releaseConfig?.groups || Object.keys(releaseConfig.groups).length === 0 ? {} : Object.fromEntries(
|
|
4231
|
+
Object.entries(releaseConfig.groups).map(([name, group]) => {
|
|
4232
|
+
const config2 = defu(
|
|
4233
|
+
{
|
|
4234
|
+
...omit(DEFAULT_RELEASE_GROUP_CONFIG, ["changelog", "version"]),
|
|
4235
|
+
...group
|
|
4236
|
+
},
|
|
4237
|
+
{
|
|
4238
|
+
version: {
|
|
4239
|
+
...DEFAULT_RELEASE_GROUP_CONFIG.version
|
|
4240
|
+
}
|
|
4241
|
+
},
|
|
4242
|
+
{
|
|
4243
|
+
changelog: {
|
|
4244
|
+
...DEFAULT_RELEASE_GROUP_CONFIG.changelog,
|
|
4245
|
+
renderer: StormChangelogRenderer,
|
|
4246
|
+
renderOptions: {
|
|
4247
|
+
...DEFAULT_RELEASE_GROUP_CONFIG.changelog.renderOptions,
|
|
4248
|
+
workspaceConfig
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
);
|
|
4253
|
+
if (workspaceConfig?.workspaceRoot) {
|
|
4254
|
+
if (config2.changelog?.renderer && typeof config2.changelog?.renderer === "string" && config2.changelog?.renderer?.toString().startsWith("./")) {
|
|
4255
|
+
config2.changelog.renderer = joinPaths(
|
|
4256
|
+
workspaceConfig.workspaceRoot,
|
|
4257
|
+
config2.changelog.renderer
|
|
4258
|
+
);
|
|
4259
|
+
}
|
|
4260
|
+
if (config2.version?.versionActions && config2.version.versionActions.startsWith("./")) {
|
|
4261
|
+
config2.version.versionActions = joinPaths(
|
|
4262
|
+
workspaceConfig.workspaceRoot,
|
|
4263
|
+
config2.version?.versionActions
|
|
4264
|
+
);
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
return [name, config2];
|
|
4268
|
+
})
|
|
4269
|
+
);
|
|
4270
|
+
}
|
|
4271
|
+
|
|
4272
|
+
export { DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 as DEFAULT_CONVENTIONAL_COMMITS_CONFIG, DEFAULT_JS_RELEASE_GROUP_CONFIG, DEFAULT_RELEASE_CONFIG, DEFAULT_RELEASE_GROUP_CONFIG, DEFAULT_RELEASE_TAG_PATTERN, DEFAULT_RUST_RELEASE_GROUP_CONFIG, getReleaseGroupConfig };
|