@storm-software/git-tools 2.131.127 → 2.131.128

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