@storm-software/git-tools 2.131.127 → 2.131.129

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 (80) hide show
  1. package/README.md +1 -1
  2. package/bin/{chunk-NNIW4L2Q.js → chunk-4PYFQEVV.js} +3 -3
  3. package/bin/{chunk-NNIW4L2Q.js.map → chunk-4PYFQEVV.js.map} +1 -1
  4. package/bin/chunk-5N5WKPFP.cjs +2116 -0
  5. package/bin/chunk-5N5WKPFP.cjs.map +1 -0
  6. package/bin/{chunk-VIFL2F7H.js → chunk-6QIXTOH3.js} +3 -3
  7. package/bin/{chunk-VIFL2F7H.js.map → chunk-6QIXTOH3.js.map} +1 -1
  8. package/bin/{chunk-MSQDEBW3.js → chunk-7QTKVCXH.js} +3 -3
  9. package/bin/{chunk-MSQDEBW3.js.map → chunk-7QTKVCXH.js.map} +1 -1
  10. package/bin/chunk-BB4W6BYT.js +2073 -0
  11. package/bin/chunk-BB4W6BYT.js.map +1 -0
  12. package/bin/{chunk-GAHICIOD.js → chunk-CTZZFGE5.js} +3 -3
  13. package/bin/{chunk-GAHICIOD.js.map → chunk-CTZZFGE5.js.map} +1 -1
  14. package/bin/{chunk-B5CZCP2Y.cjs → chunk-GVDRZBZ6.cjs} +4 -4
  15. package/bin/{chunk-B5CZCP2Y.cjs.map → chunk-GVDRZBZ6.cjs.map} +1 -1
  16. package/bin/{chunk-ZBZINLOA.js → chunk-IAPT5G4H.js} +3 -3
  17. package/bin/{chunk-ZBZINLOA.js.map → chunk-IAPT5G4H.js.map} +1 -1
  18. package/bin/{chunk-SASCLX6I.js → chunk-NMEHIDW7.js} +3 -3
  19. package/bin/{chunk-SASCLX6I.js.map → chunk-NMEHIDW7.js.map} +1 -1
  20. package/bin/{chunk-IXUKWNVT.cjs → chunk-NPQDZF7C.cjs} +4 -4
  21. package/bin/{chunk-IXUKWNVT.cjs.map → chunk-NPQDZF7C.cjs.map} +1 -1
  22. package/bin/{chunk-NZ4HDNJ7.cjs → chunk-Q5KDQ5YL.cjs} +4 -4
  23. package/bin/{chunk-NZ4HDNJ7.cjs.map → chunk-Q5KDQ5YL.cjs.map} +1 -1
  24. package/bin/{chunk-MUNEGKNC.cjs → chunk-RMBYK2PG.cjs} +5 -5
  25. package/bin/{chunk-MUNEGKNC.cjs.map → chunk-RMBYK2PG.cjs.map} +1 -1
  26. package/bin/{chunk-KJMWPKRH.cjs → chunk-TTSXYT7W.cjs} +4 -4
  27. package/bin/{chunk-KJMWPKRH.cjs.map → chunk-TTSXYT7W.cjs.map} +1 -1
  28. package/bin/{chunk-ZL2JPPJF.cjs → chunk-U3US7IBH.cjs} +4 -4
  29. package/bin/{chunk-ZL2JPPJF.cjs.map → chunk-U3US7IBH.cjs.map} +1 -1
  30. package/bin/{chunk-2NTFR3EF.cjs → chunk-XVVRI3DK.cjs} +6 -6
  31. package/bin/{chunk-2NTFR3EF.cjs.map → chunk-XVVRI3DK.cjs.map} +1 -1
  32. package/bin/{chunk-KFRB3UCF.js → chunk-ZPPKYVIH.js} +3 -3
  33. package/bin/{chunk-KFRB3UCF.js.map → chunk-ZPPKYVIH.js.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-5AHFCU2Z.js +2412 -0
  55. package/dist/{chunk-OMWWQPRY.js → chunk-F22OVP2A.js} +2 -2
  56. package/dist/{chunk-RIPABM45.cjs → chunk-GFCNZUMY.cjs} +9 -9
  57. package/dist/chunk-TEL5N7KI.cjs +2454 -0
  58. package/dist/commit/minimal.cjs +4 -4
  59. package/dist/commit/minimal.js +2 -2
  60. package/dist/commit/monorepo.cjs +5 -5
  61. package/dist/commit/monorepo.js +3 -3
  62. package/dist/index.cjs +39 -39
  63. package/dist/index.js +10 -10
  64. package/dist/release/config.cjs +21 -21
  65. package/dist/release/config.js +4 -4
  66. package/package.json +20 -24
  67. package/bin/chunk-DGRFGD2R.cjs +0 -3578
  68. package/bin/chunk-DGRFGD2R.cjs.map +0 -1
  69. package/bin/chunk-ZW42VDY5.js +0 -3554
  70. package/bin/chunk-ZW42VDY5.js.map +0 -1
  71. package/dist/chunk-IVBFLZSL.cjs +0 -3863
  72. package/dist/chunk-J5FHPMMG.js +0 -3840
  73. package/dist/{chunk-XS6PFVQQ.js → chunk-2YWPEDFN.js} +1 -1
  74. package/dist/{chunk-OABXW2AI.js → chunk-5GF6UCF2.js} +1 -1
  75. package/dist/{chunk-LXXJEGUX.cjs → chunk-5UUCFSHA.cjs} +1 -1
  76. package/dist/{chunk-PBGCSXPL.js → chunk-7IP42CZC.js} +1 -1
  77. package/dist/{chunk-WRSI3KUJ.cjs → chunk-HBZTKU5M.cjs} +1 -1
  78. package/dist/{chunk-NPCVH6FC.js → chunk-HEEBBIWA.js} +1 -1
  79. package/dist/{chunk-SHNYRICK.cjs → chunk-J6OZPTPD.cjs} +1 -1
  80. package/dist/{chunk-ZYMWVRAL.cjs → chunk-RWLJU2S2.cjs} +1 -1
@@ -0,0 +1,2454 @@
1
+ 'use strict';
2
+
3
+ var chunkGFCNZUMY_cjs = require('./chunk-GFCNZUMY.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 z = require('zod/v4/mini');
13
+ var promises = require('fs/promises');
14
+ var axios2 = require('axios');
15
+ var DefaultChangelogRenderer = require('nx/release/changelog-renderer');
16
+ var conventionalCommits = require('nx/src/command-line/release/config/conventional-commits');
17
+ var semver = require('semver');
18
+ require('@nx/devkit');
19
+ require('chalk');
20
+ require('nx/src/command-line/release/utils/print-changes');
21
+ require('nx/src/command-line/release/utils/shared');
22
+ require('nx/src/tasks-runner/utils');
23
+ require('prettier');
24
+ require('child_process');
25
+ require('os');
26
+ require('nx/src/command-line/release/utils/remote-release-clients/github');
27
+ require('yaml');
28
+ require('nx/src/command-line/release/utils/exec-command');
29
+ require('nx/src/command-line/release/utils/git');
30
+
31
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
32
+
33
+ function _interopNamespace(e) {
34
+ if (e && e.__esModule) return e;
35
+ var n = Object.create(null);
36
+ if (e) {
37
+ Object.keys(e).forEach(function (k) {
38
+ if (k !== 'default') {
39
+ var d = Object.getOwnPropertyDescriptor(e, k);
40
+ Object.defineProperty(n, k, d.get ? d : {
41
+ enumerable: true,
42
+ get: function () { return e[k]; }
43
+ });
44
+ }
45
+ });
46
+ }
47
+ n.default = e;
48
+ return Object.freeze(n);
49
+ }
50
+
51
+ var defu3__default = /*#__PURE__*/_interopDefault(defu3);
52
+ var z__namespace = /*#__PURE__*/_interopNamespace(z);
53
+ var axios2__default = /*#__PURE__*/_interopDefault(axios2);
54
+ var DefaultChangelogRenderer__default = /*#__PURE__*/_interopDefault(DefaultChangelogRenderer);
55
+
56
+ // ../config-tools/src/utilities/correct-paths.ts
57
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
58
+ function normalizeWindowsPath(input = "") {
59
+ if (!input) {
60
+ return input;
61
+ }
62
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
63
+ }
64
+ var _UNC_REGEX = /^[/\\]{2}/;
65
+ var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
66
+ var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
67
+ var correctPaths = function(path) {
68
+ if (!path || path.length === 0) {
69
+ return ".";
70
+ }
71
+ path = normalizeWindowsPath(path);
72
+ const isUNCPath = path?.match(_UNC_REGEX);
73
+ const isPathAbsolute = isAbsolute(path);
74
+ const trailingSeparator = path[path.length - 1] === "/";
75
+ path = normalizeString(path, !isPathAbsolute);
76
+ if (path.length === 0) {
77
+ if (isPathAbsolute) {
78
+ return "/";
79
+ }
80
+ return trailingSeparator ? "./" : ".";
81
+ }
82
+ if (trailingSeparator) {
83
+ path += "/";
84
+ }
85
+ if (_DRIVE_LETTER_RE.test(path)) {
86
+ path += "/";
87
+ }
88
+ if (isUNCPath) {
89
+ if (!isPathAbsolute) {
90
+ return `//./${path}`;
91
+ }
92
+ return `//${path}`;
93
+ }
94
+ return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
95
+ };
96
+ var joinPaths = function(...segments) {
97
+ let path = "";
98
+ for (const seg of segments) {
99
+ if (!seg) {
100
+ continue;
101
+ }
102
+ if (path.length > 0) {
103
+ const pathTrailing = path[path.length - 1] === "/";
104
+ const segLeading = seg[0] === "/";
105
+ const both = pathTrailing && segLeading;
106
+ if (both) {
107
+ path += seg.slice(1);
108
+ } else {
109
+ path += pathTrailing || segLeading ? seg : `/${seg}`;
110
+ }
111
+ } else {
112
+ path += seg;
113
+ }
114
+ }
115
+ return correctPaths(path);
116
+ };
117
+ function normalizeString(path, allowAboveRoot) {
118
+ let res = "";
119
+ let lastSegmentLength = 0;
120
+ let lastSlash = -1;
121
+ let dots = 0;
122
+ let char = null;
123
+ for (let index = 0; index <= path.length; ++index) {
124
+ if (index < path.length) {
125
+ char = path[index];
126
+ } else if (char === "/") {
127
+ break;
128
+ } else {
129
+ char = "/";
130
+ }
131
+ if (char === "/") {
132
+ if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
133
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
134
+ if (res.length > 2) {
135
+ const lastSlashIndex = res.lastIndexOf("/");
136
+ if (lastSlashIndex === -1) {
137
+ res = "";
138
+ lastSegmentLength = 0;
139
+ } else {
140
+ res = res.slice(0, lastSlashIndex);
141
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
142
+ }
143
+ lastSlash = index;
144
+ dots = 0;
145
+ continue;
146
+ } else if (res.length > 0) {
147
+ res = "";
148
+ lastSegmentLength = 0;
149
+ lastSlash = index;
150
+ dots = 0;
151
+ continue;
152
+ }
153
+ }
154
+ if (allowAboveRoot) {
155
+ res += res.length > 0 ? "/.." : "..";
156
+ lastSegmentLength = 2;
157
+ }
158
+ } else {
159
+ if (res.length > 0) {
160
+ res += `/${path.slice(lastSlash + 1, index)}`;
161
+ } else {
162
+ res = path.slice(lastSlash + 1, index);
163
+ }
164
+ lastSegmentLength = index - lastSlash - 1;
165
+ }
166
+ lastSlash = index;
167
+ dots = 0;
168
+ } else if (char === "." && dots !== -1) {
169
+ ++dots;
170
+ } else {
171
+ dots = -1;
172
+ }
173
+ }
174
+ return res;
175
+ }
176
+ var isAbsolute = function(p) {
177
+ return _IS_ABSOLUTE_RE.test(p);
178
+ };
179
+
180
+ // ../package-constants/src/tags.ts
181
+ var ProjectTagConstants = {
182
+ Language: {
183
+ TAG_ID: "language",
184
+ TYPESCRIPT: "typescript",
185
+ RUST: "rust"
186
+ }};
187
+ var formatProjectTag = (variant, value) => {
188
+ return `${variant}:${value}`;
189
+ };
190
+ var hasProjectTag = (project, variant) => {
191
+ project.tags = project.tags ?? [];
192
+ const prefix = formatProjectTag(variant, "");
193
+ return project.tags.some(
194
+ (tag) => tag.startsWith(prefix) && tag.length > prefix.length
195
+ );
196
+ };
197
+ var getProjectTag = (project, variant) => {
198
+ if (!hasProjectTag(project, variant)) {
199
+ return void 0;
200
+ }
201
+ project.tags = project.tags ?? [];
202
+ const prefix = formatProjectTag(variant, "");
203
+ const tag = project.tags.find((tag2) => tag2.startsWith(prefix));
204
+ return tag?.replace(prefix, "");
205
+ };
206
+ var isEqualProjectTag = (project, variant, value) => {
207
+ const tag = getProjectTag(project, variant);
208
+ return !!(tag && tag?.toUpperCase() === value.toUpperCase());
209
+ };
210
+
211
+ // src/utilities/omit.ts
212
+ function omit(obj, keys) {
213
+ const result = { ...obj };
214
+ for (let i = 0; i < keys.length; i++) {
215
+ const key = keys[i];
216
+ if (key && key in result) {
217
+ delete result[key];
218
+ }
219
+ }
220
+ return result;
221
+ }
222
+ var MAX_PATH_SEARCH_DEPTH = 30;
223
+ var depth = 0;
224
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
225
+ const _startPath = startPath ?? process.cwd();
226
+ if (endDirectoryNames.some(
227
+ (endDirName) => fs.existsSync(path.join(_startPath, endDirName))
228
+ )) {
229
+ return _startPath;
230
+ }
231
+ if (endFileNames.some((endFileName) => fs.existsSync(path.join(_startPath, endFileName)))) {
232
+ return _startPath;
233
+ }
234
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
235
+ const parent = path.join(_startPath, "..");
236
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
237
+ }
238
+ return void 0;
239
+ }
240
+
241
+ // ../config-tools/src/utilities/find-workspace-root.ts
242
+ var rootFiles = [
243
+ "storm-workspace.json",
244
+ "storm-workspace.yaml",
245
+ "storm-workspace.yml",
246
+ "storm-workspace.js",
247
+ "storm-workspace.ts",
248
+ ".storm-workspace.json",
249
+ ".storm-workspace.yaml",
250
+ ".storm-workspace.yml",
251
+ ".storm-workspace.js",
252
+ ".storm-workspace.ts",
253
+ "lerna.json",
254
+ "nx.json",
255
+ "turbo.json",
256
+ "npm-workspace.json",
257
+ "yarn-workspace.json",
258
+ "pnpm-workspace.json",
259
+ "npm-workspace.yaml",
260
+ "yarn-workspace.yaml",
261
+ "pnpm-workspace.yaml",
262
+ "npm-workspace.yml",
263
+ "yarn-workspace.yml",
264
+ "pnpm-workspace.yml",
265
+ "npm-lock.json",
266
+ "yarn-lock.json",
267
+ "pnpm-lock.json",
268
+ "npm-lock.yaml",
269
+ "yarn-lock.yaml",
270
+ "pnpm-lock.yaml",
271
+ "npm-lock.yml",
272
+ "yarn-lock.yml",
273
+ "pnpm-lock.yml",
274
+ "bun.lockb",
275
+ "bun.lock",
276
+ "bunfig.toml"
277
+ ];
278
+ var rootDirectories = [
279
+ ".storm-workspace",
280
+ ".nx",
281
+ ".git",
282
+ ".github",
283
+ ".vscode",
284
+ ".verdaccio"
285
+ ];
286
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
287
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
288
+ return correctPaths(
289
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
290
+ );
291
+ }
292
+ return correctPaths(
293
+ findFolderUp(
294
+ pathInsideMonorepo ?? process.cwd(),
295
+ rootFiles,
296
+ rootDirectories
297
+ )
298
+ );
299
+ }
300
+ function findWorkspaceRoot(pathInsideMonorepo) {
301
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
302
+ if (!result) {
303
+ throw new Error(
304
+ `Cannot find workspace root upwards from known path. Files search list includes:
305
+ ${rootFiles.join(
306
+ "\n"
307
+ )}
308
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
309
+ );
310
+ }
311
+ return result;
312
+ }
313
+
314
+ // ../config/src/constants.ts
315
+ var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
316
+ var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
317
+ var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
318
+ var STORM_DEFAULT_LICENSE = "Apache-2.0";
319
+ var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
320
+ var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
321
+ var COLOR_KEYS = [
322
+ "dark",
323
+ "light",
324
+ "base",
325
+ "brand",
326
+ "alternate",
327
+ "accent",
328
+ "link",
329
+ "success",
330
+ "discovery",
331
+ "info",
332
+ "warning",
333
+ "danger",
334
+ "fatal",
335
+ "performance",
336
+ "positive",
337
+ "negative"
338
+ ];
339
+ var schemaRegistry = z__namespace.registry();
340
+ var colorSchema = z__namespace.string().check(
341
+ z__namespace.length(7),
342
+ z__namespace.toLowerCase(),
343
+ z__namespace.regex(/^#([0-9a-f]{3}){1,2}$/i),
344
+ z__namespace.trim()
345
+ );
346
+ schemaRegistry.add(colorSchema, {
347
+ description: "A base schema for describing the format of colors"
348
+ });
349
+ var darkColorSchema = z__namespace._default(colorSchema, "#1e2124");
350
+ schemaRegistry.add(darkColorSchema, {
351
+ description: "The dark background color of the workspace"
352
+ });
353
+ var lightColorSchema = z__namespace._default(colorSchema, "#cbd5e1");
354
+ schemaRegistry.add(lightColorSchema, {
355
+ description: "The light background color of the workspace"
356
+ });
357
+ var brandColorSchema = z__namespace._default(colorSchema, "#1fb2a6");
358
+ schemaRegistry.add(brandColorSchema, {
359
+ description: "The primary brand specific color of the workspace"
360
+ });
361
+ var alternateColorSchema = z__namespace.optional(colorSchema);
362
+ schemaRegistry.add(alternateColorSchema, {
363
+ description: "The alternate brand specific color of the workspace"
364
+ });
365
+ var accentColorSchema = z__namespace.optional(colorSchema);
366
+ schemaRegistry.add(accentColorSchema, {
367
+ description: "The secondary brand specific color of the workspace"
368
+ });
369
+ var linkColorSchema = z__namespace._default(colorSchema, "#3fa6ff");
370
+ schemaRegistry.add(linkColorSchema, {
371
+ description: "The color used to display hyperlink text"
372
+ });
373
+ var discoveryColorSchema = z__namespace._default(colorSchema, "#818cf8");
374
+ schemaRegistry.add(discoveryColorSchema, {
375
+ description: "The second brand specific color of the workspace"
376
+ });
377
+ var successColorSchema = z__namespace._default(colorSchema, "#45b27e");
378
+ schemaRegistry.add(successColorSchema, {
379
+ description: "The success color of the workspace"
380
+ });
381
+ var infoColorSchema = z__namespace._default(colorSchema, "#38bdf8");
382
+ schemaRegistry.add(infoColorSchema, {
383
+ description: "The informational color of the workspace"
384
+ });
385
+ var debugColorSchema = z__namespace._default(colorSchema, "#8afafc");
386
+ schemaRegistry.add(debugColorSchema, {
387
+ description: "The debug color of the workspace"
388
+ });
389
+ var warningColorSchema = z__namespace._default(colorSchema, "#f3d371");
390
+ schemaRegistry.add(warningColorSchema, {
391
+ description: "The warning color of the workspace"
392
+ });
393
+ var dangerColorSchema = z__namespace._default(colorSchema, "#d8314a");
394
+ schemaRegistry.add(dangerColorSchema, {
395
+ description: "The danger color of the workspace"
396
+ });
397
+ var fatalColorSchema = z__namespace.optional(colorSchema);
398
+ schemaRegistry.add(fatalColorSchema, {
399
+ description: "The fatal color of the workspace"
400
+ });
401
+ var performanceColorSchema = z__namespace._default(colorSchema, "#80fd74");
402
+ schemaRegistry.add(performanceColorSchema, {
403
+ description: "The performance color of the workspace"
404
+ });
405
+ var positiveColorSchema = z__namespace._default(colorSchema, "#4ade80");
406
+ schemaRegistry.add(positiveColorSchema, {
407
+ description: "The positive number color of the workspace"
408
+ });
409
+ var negativeColorSchema = z__namespace._default(colorSchema, "#ef4444");
410
+ schemaRegistry.add(negativeColorSchema, {
411
+ description: "The negative number color of the workspace"
412
+ });
413
+ var gradientStopsSchema = z__namespace.optional(z__namespace.array(colorSchema));
414
+ schemaRegistry.add(gradientStopsSchema, {
415
+ description: "The color stops for the base gradient color pattern used in the workspace"
416
+ });
417
+ var darkColorsSchema = z__namespace.object({
418
+ foreground: lightColorSchema,
419
+ background: darkColorSchema,
420
+ brand: brandColorSchema,
421
+ alternate: alternateColorSchema,
422
+ accent: accentColorSchema,
423
+ link: linkColorSchema,
424
+ discovery: discoveryColorSchema,
425
+ success: successColorSchema,
426
+ info: infoColorSchema,
427
+ debug: debugColorSchema,
428
+ warning: warningColorSchema,
429
+ danger: dangerColorSchema,
430
+ fatal: fatalColorSchema,
431
+ performance: performanceColorSchema,
432
+ positive: positiveColorSchema,
433
+ negative: negativeColorSchema,
434
+ gradient: gradientStopsSchema
435
+ });
436
+ var lightColorsSchema = z__namespace.object({
437
+ foreground: darkColorSchema,
438
+ background: lightColorSchema,
439
+ brand: brandColorSchema,
440
+ alternate: alternateColorSchema,
441
+ accent: accentColorSchema,
442
+ link: linkColorSchema,
443
+ discovery: discoveryColorSchema,
444
+ success: successColorSchema,
445
+ info: infoColorSchema,
446
+ debug: debugColorSchema,
447
+ warning: warningColorSchema,
448
+ danger: dangerColorSchema,
449
+ fatal: fatalColorSchema,
450
+ performance: performanceColorSchema,
451
+ positive: positiveColorSchema,
452
+ negative: negativeColorSchema,
453
+ gradient: gradientStopsSchema
454
+ });
455
+ var multiColorsSchema = z__namespace.object({
456
+ dark: darkColorsSchema,
457
+ light: lightColorsSchema
458
+ });
459
+ var singleColorsSchema = z__namespace.object({
460
+ dark: darkColorSchema,
461
+ light: lightColorSchema,
462
+ brand: brandColorSchema,
463
+ alternate: alternateColorSchema,
464
+ accent: accentColorSchema,
465
+ link: linkColorSchema,
466
+ discovery: discoveryColorSchema,
467
+ success: successColorSchema,
468
+ info: infoColorSchema,
469
+ debug: debugColorSchema,
470
+ warning: warningColorSchema,
471
+ danger: dangerColorSchema,
472
+ fatal: fatalColorSchema,
473
+ performance: performanceColorSchema,
474
+ positive: positiveColorSchema,
475
+ negative: negativeColorSchema,
476
+ gradient: gradientStopsSchema
477
+ });
478
+ var registryUrlConfigSchema = z__namespace.optional(z__namespace.url());
479
+ schemaRegistry.add(registryUrlConfigSchema, {
480
+ description: "A remote registry URL used to publish distributable packages"
481
+ });
482
+ var registrySchema = z__namespace._default(
483
+ z__namespace.object({
484
+ github: registryUrlConfigSchema,
485
+ npm: registryUrlConfigSchema,
486
+ cargo: registryUrlConfigSchema,
487
+ cyclone: registryUrlConfigSchema,
488
+ container: registryUrlConfigSchema
489
+ }),
490
+ {}
491
+ );
492
+ schemaRegistry.add(registrySchema, {
493
+ description: "A list of remote registry URLs used by Storm Software"
494
+ });
495
+ var colorsSchema = z__namespace.union([singleColorsSchema, multiColorsSchema]);
496
+ schemaRegistry.add(colorsSchema, {
497
+ description: "Colors used for various workspace elements"
498
+ });
499
+ var themeColorsSchema = z__namespace.record(
500
+ z__namespace.union([z__namespace.union([z__namespace.literal("base"), z__namespace.string()]), z__namespace.string()]),
501
+ colorsSchema
502
+ );
503
+ schemaRegistry.add(themeColorsSchema, {
504
+ description: "Storm theme config values used for styling various package elements"
505
+ });
506
+ var extendsSchema = z__namespace.optional(
507
+ z__namespace.union([z__namespace.string().check(z__namespace.trim()), z__namespace.array(z__namespace.string().check(z__namespace.trim()))])
508
+ );
509
+ schemaRegistry.add(extendsSchema, {
510
+ 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."
511
+ });
512
+ var workspaceBotNameSchema = z__namespace.string().check(z__namespace.trim());
513
+ schemaRegistry.add(workspaceBotNameSchema, {
514
+ description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
515
+ });
516
+ var workspaceBotEmailSchema = z__namespace.string().check(z__namespace.trim());
517
+ schemaRegistry.add(workspaceBotEmailSchema, {
518
+ description: "The email of the workspace bot"
519
+ });
520
+ var workspaceBotSchema = z__namespace.object({
521
+ name: workspaceBotNameSchema,
522
+ email: workspaceBotEmailSchema
523
+ });
524
+ schemaRegistry.add(workspaceBotSchema, {
525
+ description: "The workspace's bot user's config used to automated various operations tasks"
526
+ });
527
+ var workspaceReleaseBannerUrlSchema = z__namespace.optional(
528
+ z__namespace.string().check(z__namespace.trim(), z__namespace.url())
529
+ );
530
+ schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
531
+ description: "A URL to a banner image used to display the workspace's release"
532
+ });
533
+ var workspaceReleaseBannerAltSchema = z__namespace._default(
534
+ z__namespace.string().check(z__namespace.trim()),
535
+ STORM_DEFAULT_BANNER_ALT
536
+ );
537
+ schemaRegistry.add(workspaceReleaseBannerAltSchema, {
538
+ description: "The alt text for the workspace's release banner image"
539
+ });
540
+ var workspaceReleaseBannerSchema = z__namespace.object({
541
+ url: workspaceReleaseBannerUrlSchema,
542
+ alt: workspaceReleaseBannerAltSchema
543
+ });
544
+ schemaRegistry.add(workspaceReleaseBannerSchema, {
545
+ description: "The workspace's banner image used during the release process"
546
+ });
547
+ var workspaceReleaseHeaderSchema = z__namespace.optional(
548
+ z__namespace.string().check(z__namespace.trim())
549
+ );
550
+ schemaRegistry.add(workspaceReleaseHeaderSchema, {
551
+ description: "A header message appended to the start of the workspace's release notes"
552
+ });
553
+ var workspaceReleaseFooterSchema = z__namespace.optional(
554
+ z__namespace.string().check(z__namespace.trim())
555
+ );
556
+ schemaRegistry.add(workspaceReleaseFooterSchema, {
557
+ description: "A footer message appended to the end of the workspace's release notes"
558
+ });
559
+ var workspaceReleaseSchema = z__namespace.object({
560
+ banner: z__namespace.union([
561
+ workspaceReleaseBannerSchema,
562
+ z__namespace.string().check(z__namespace.trim(), z__namespace.url())
563
+ ]),
564
+ header: workspaceReleaseHeaderSchema,
565
+ footer: workspaceReleaseFooterSchema
566
+ });
567
+ schemaRegistry.add(workspaceReleaseSchema, {
568
+ description: "The workspace's release config used during the release process"
569
+ });
570
+ var workspaceSocialsTwitterSchema = z__namespace.optional(
571
+ z__namespace.string().check(z__namespace.trim())
572
+ );
573
+ schemaRegistry.add(workspaceSocialsTwitterSchema, {
574
+ description: "A Twitter/X account associated with the organization/project"
575
+ });
576
+ var workspaceSocialsDiscordSchema = z__namespace.optional(
577
+ z__namespace.string().check(z__namespace.trim())
578
+ );
579
+ schemaRegistry.add(workspaceSocialsDiscordSchema, {
580
+ description: "A Discord account associated with the organization/project"
581
+ });
582
+ var workspaceSocialsTelegramSchema = z__namespace.optional(
583
+ z__namespace.string().check(z__namespace.trim())
584
+ );
585
+ schemaRegistry.add(workspaceSocialsTelegramSchema, {
586
+ description: "A Telegram account associated with the organization/project"
587
+ });
588
+ var workspaceSocialsSlackSchema = z__namespace.optional(
589
+ z__namespace.string().check(z__namespace.trim())
590
+ );
591
+ schemaRegistry.add(workspaceSocialsSlackSchema, {
592
+ description: "A Slack account associated with the organization/project"
593
+ });
594
+ var workspaceSocialsMediumSchema = z__namespace.optional(
595
+ z__namespace.string().check(z__namespace.trim())
596
+ );
597
+ schemaRegistry.add(workspaceSocialsMediumSchema, {
598
+ description: "A Medium account associated with the organization/project"
599
+ });
600
+ var workspaceSocialsGithubSchema = z__namespace.optional(
601
+ z__namespace.string().check(z__namespace.trim())
602
+ );
603
+ schemaRegistry.add(workspaceSocialsGithubSchema, {
604
+ description: "A GitHub account associated with the organization/project"
605
+ });
606
+ var workspaceSocialsSchema = z__namespace.object({
607
+ twitter: workspaceSocialsTwitterSchema,
608
+ discord: workspaceSocialsDiscordSchema,
609
+ telegram: workspaceSocialsTelegramSchema,
610
+ slack: workspaceSocialsSlackSchema,
611
+ medium: workspaceSocialsMediumSchema,
612
+ github: workspaceSocialsGithubSchema
613
+ });
614
+ schemaRegistry.add(workspaceSocialsSchema, {
615
+ description: "The workspace's account config used to store various social media links"
616
+ });
617
+ var workspaceDirectoryCacheSchema = z__namespace.optional(
618
+ z__namespace.string().check(z__namespace.trim())
619
+ );
620
+ schemaRegistry.add(workspaceDirectoryCacheSchema, {
621
+ description: "The directory used to store the environment's cached file data"
622
+ });
623
+ var workspaceDirectoryDataSchema = z__namespace.optional(
624
+ z__namespace.string().check(z__namespace.trim())
625
+ );
626
+ schemaRegistry.add(workspaceDirectoryDataSchema, {
627
+ description: "The directory used to store the environment's data files"
628
+ });
629
+ var workspaceDirectoryConfigSchema = z__namespace.optional(
630
+ z__namespace.string().check(z__namespace.trim())
631
+ );
632
+ schemaRegistry.add(workspaceDirectoryConfigSchema, {
633
+ description: "The directory used to store the environment's configuration files"
634
+ });
635
+ var workspaceDirectoryTempSchema = z__namespace.optional(
636
+ z__namespace.string().check(z__namespace.trim())
637
+ );
638
+ schemaRegistry.add(workspaceDirectoryTempSchema, {
639
+ description: "The directory used to store the environment's temp files"
640
+ });
641
+ var workspaceDirectoryLogSchema = z__namespace.optional(
642
+ z__namespace.string().check(z__namespace.trim())
643
+ );
644
+ schemaRegistry.add(workspaceDirectoryLogSchema, {
645
+ description: "The directory used to store the environment's log files"
646
+ });
647
+ var workspaceDirectoryBuildSchema = z__namespace._default(
648
+ z__namespace.string().check(z__namespace.trim()),
649
+ "dist"
650
+ );
651
+ schemaRegistry.add(workspaceDirectoryBuildSchema, {
652
+ description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
653
+ });
654
+ var workspaceDirectorySchema = z__namespace.object({
655
+ cache: workspaceDirectoryCacheSchema,
656
+ data: workspaceDirectoryDataSchema,
657
+ config: workspaceDirectoryConfigSchema,
658
+ temp: workspaceDirectoryTempSchema,
659
+ log: workspaceDirectoryLogSchema,
660
+ build: workspaceDirectoryBuildSchema
661
+ });
662
+ schemaRegistry.add(workspaceDirectorySchema, {
663
+ description: "Various directories used by the workspace to store data, cache, and configuration files"
664
+ });
665
+ var variantSchema = z__namespace._default(
666
+ z__namespace.enum(["minimal", "monorepo"]),
667
+ "monorepo"
668
+ );
669
+ schemaRegistry.add(variantSchema, {
670
+ description: "The variant of the workspace. This can be used to enable or disable certain features or configurations."
671
+ });
672
+ var errorCodesFileSchema = z__namespace._default(
673
+ z__namespace.string().check(z__namespace.trim()),
674
+ STORM_DEFAULT_ERROR_CODES_FILE
675
+ );
676
+ schemaRegistry.add(errorCodesFileSchema, {
677
+ description: "The path to the workspace's error codes JSON file"
678
+ });
679
+ var errorUrlSchema = z__namespace.optional(z__namespace.url());
680
+ schemaRegistry.add(errorUrlSchema, {
681
+ description: "A URL to a page that looks up the workspace's error messages given a specific error code"
682
+ });
683
+ var errorSchema = z__namespace.object({
684
+ codesFile: errorCodesFileSchema,
685
+ url: errorUrlSchema
686
+ });
687
+ schemaRegistry.add(errorSchema, {
688
+ description: "The workspace's error config used when creating error details during a system error"
689
+ });
690
+ var organizationNameSchema = z__namespace.optional(
691
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
692
+ );
693
+ schemaRegistry.add(organizationNameSchema, {
694
+ description: "The name of the organization"
695
+ });
696
+ var organizationDescriptionSchema = z__namespace.optional(
697
+ z__namespace.string().check(z__namespace.trim())
698
+ );
699
+ schemaRegistry.add(organizationDescriptionSchema, {
700
+ description: "A description of the organization"
701
+ });
702
+ var organizationLogoSchema = z__namespace.optional(z__namespace.url());
703
+ schemaRegistry.add(organizationLogoSchema, {
704
+ description: "A URL to the organization's logo image"
705
+ });
706
+ var organizationIconSchema = z__namespace.optional(z__namespace.url());
707
+ schemaRegistry.add(organizationIconSchema, {
708
+ description: "A URL to the organization's icon image"
709
+ });
710
+ var organizationUrlSchema = z__namespace.optional(z__namespace.url());
711
+ schemaRegistry.add(organizationUrlSchema, {
712
+ description: "A URL to a page that provides more information about the organization"
713
+ });
714
+ var organizationSchema = z__namespace.object({
715
+ name: organizationNameSchema,
716
+ description: organizationDescriptionSchema,
717
+ logo: organizationLogoSchema,
718
+ icon: organizationIconSchema,
719
+ url: organizationUrlSchema
720
+ });
721
+ schemaRegistry.add(organizationSchema, {
722
+ description: "The workspace's organization details"
723
+ });
724
+ var schemaNameSchema = z__namespace._default(
725
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase()),
726
+ "https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
727
+ );
728
+ schemaRegistry.add(schemaNameSchema, {
729
+ description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
730
+ });
731
+ var nameSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
732
+ schemaRegistry.add(nameSchema, {
733
+ description: "The name of the workspace/project/service/package/scope using this configuration"
734
+ });
735
+ var namespaceSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
736
+ schemaRegistry.add(namespaceSchema, {
737
+ description: "The namespace of the workspace/project/service/package/scope using this configuration"
738
+ });
739
+ var orgSchema = z__namespace.union([
740
+ organizationSchema,
741
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
742
+ ]);
743
+ schemaRegistry.add(orgSchema, {
744
+ description: "The organization of the workspace. This can be a string or an object containing the organization's details"
745
+ });
746
+ var repositorySchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
747
+ schemaRegistry.add(repositorySchema, {
748
+ description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
749
+ });
750
+ var licenseSchema = z__namespace._default(
751
+ z__namespace.string().check(z__namespace.trim()),
752
+ "Apache-2.0"
753
+ );
754
+ schemaRegistry.add(licenseSchema, {
755
+ description: "The license type of the package"
756
+ });
757
+ var homepageSchema = z__namespace.optional(z__namespace.url());
758
+ schemaRegistry.add(homepageSchema, {
759
+ description: "The homepage of the workspace"
760
+ });
761
+ var docsSchema = z__namespace.optional(z__namespace.url());
762
+ schemaRegistry.add(docsSchema, {
763
+ description: "The documentation site for the workspace"
764
+ });
765
+ var portalSchema = z__namespace.optional(z__namespace.url());
766
+ schemaRegistry.add(portalSchema, {
767
+ description: "The development portal site for the workspace"
768
+ });
769
+ var licensingSchema = z__namespace.optional(z__namespace.url());
770
+ schemaRegistry.add(licensingSchema, {
771
+ description: "The licensing site for the workspace"
772
+ });
773
+ var contactSchema = z__namespace.optional(z__namespace.url());
774
+ schemaRegistry.add(contactSchema, {
775
+ description: "The contact site for the workspace"
776
+ });
777
+ var supportSchema = z__namespace.optional(z__namespace.url());
778
+ schemaRegistry.add(supportSchema, {
779
+ description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
780
+ });
781
+ var branchSchema = z__namespace._default(
782
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase()),
783
+ "main"
784
+ );
785
+ schemaRegistry.add(branchSchema, {
786
+ description: "The branch of the workspace"
787
+ });
788
+ var preidSchema = z__namespace.optional(
789
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
790
+ );
791
+ schemaRegistry.add(preidSchema, {
792
+ description: "A tag specifying the version pre-release identifier"
793
+ });
794
+ var ownerSchema = z__namespace.optional(
795
+ z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase())
796
+ );
797
+ schemaRegistry.add(ownerSchema, {
798
+ description: "The owner of the package"
799
+ });
800
+ var modeSchema = z__namespace._default(
801
+ z__namespace.enum(["development", "test", "production"]).check(z__namespace.trim(), z__namespace.toLowerCase()),
802
+ "production"
803
+ );
804
+ schemaRegistry.add(modeSchema, {
805
+ description: "The current runtime environment mode for the package"
806
+ });
807
+ var workspaceRootSchema = z__namespace.string().check(z__namespace.trim(), z__namespace.toLowerCase());
808
+ schemaRegistry.add(workspaceRootSchema, {
809
+ description: "The root directory of the workspace"
810
+ });
811
+ var skipCacheSchema = z__namespace._default(z__namespace.boolean(), false);
812
+ schemaRegistry.add(skipCacheSchema, {
813
+ description: "Should all known types of workspace caching be skipped?"
814
+ });
815
+ var packageManagerSchema = z__namespace._default(
816
+ z__namespace.enum(["npm", "yarn", "pnpm", "bun"]),
817
+ "npm"
818
+ );
819
+ schemaRegistry.add(packageManagerSchema, {
820
+ description: "The JavaScript/TypeScript package manager used by the repository"
821
+ });
822
+ var timezoneSchema = z__namespace._default(
823
+ z__namespace.string().check(z__namespace.trim()),
824
+ "America/New_York"
825
+ );
826
+ schemaRegistry.add(timezoneSchema, {
827
+ description: "The default timezone of the workspace"
828
+ });
829
+ var localeSchema = z__namespace._default(z__namespace.string().check(z__namespace.trim()), "en-US");
830
+ schemaRegistry.add(localeSchema, {
831
+ description: "The default locale of the workspace"
832
+ });
833
+ var logLevelSchema = z__namespace._default(
834
+ z__namespace.enum([
835
+ "silent",
836
+ "fatal",
837
+ "error",
838
+ "warn",
839
+ "success",
840
+ "info",
841
+ "performance",
842
+ "debug",
843
+ "trace",
844
+ "all"
845
+ ]),
846
+ "info"
847
+ );
848
+ schemaRegistry.add(logLevelSchema, {
849
+ 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`)."
850
+ });
851
+ var skipConfigLoggingSchema = z__namespace._default(z__namespace.boolean(), true);
852
+ schemaRegistry.add(skipConfigLoggingSchema, {
853
+ description: "Should the logging of the current Storm Workspace configuration be skipped?"
854
+ });
855
+ var configFileSchema = z__namespace._default(
856
+ z__namespace.nullable(z__namespace.string().check(z__namespace.trim())),
857
+ null
858
+ );
859
+ schemaRegistry.add(configFileSchema, {
860
+ description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
861
+ });
862
+ var extensionsSchema = z__namespace._default(z__namespace.record(z__namespace.string(), z__namespace.any()), {});
863
+ schemaRegistry.add(extensionsSchema, {
864
+ description: "Configuration of each used extension"
865
+ });
866
+ var workspaceConfigSchema = z__namespace.object({
867
+ $schema: schemaNameSchema,
868
+ extends: extendsSchema,
869
+ name: nameSchema,
870
+ variant: variantSchema,
871
+ namespace: namespaceSchema,
872
+ organization: orgSchema,
873
+ repository: repositorySchema,
874
+ license: licenseSchema,
875
+ homepage: homepageSchema,
876
+ docs: docsSchema,
877
+ portal: portalSchema,
878
+ licensing: licensingSchema,
879
+ contact: contactSchema,
880
+ support: supportSchema,
881
+ branch: branchSchema,
882
+ preid: preidSchema,
883
+ owner: ownerSchema,
884
+ bot: workspaceBotSchema,
885
+ release: workspaceReleaseSchema,
886
+ socials: workspaceSocialsSchema,
887
+ error: errorSchema,
888
+ mode: modeSchema,
889
+ workspaceRoot: workspaceRootSchema,
890
+ skipCache: skipCacheSchema,
891
+ directories: workspaceDirectorySchema,
892
+ packageManager: packageManagerSchema,
893
+ timezone: timezoneSchema,
894
+ locale: localeSchema,
895
+ logLevel: logLevelSchema,
896
+ skipConfigLogging: skipConfigLoggingSchema,
897
+ registry: registrySchema,
898
+ configFile: configFileSchema,
899
+ colors: z__namespace.union([colorsSchema, themeColorsSchema]),
900
+ extensions: extensionsSchema
901
+ });
902
+ schemaRegistry.add(extensionsSchema, {
903
+ 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."
904
+ });
905
+ async function getPackageJsonConfig(root) {
906
+ let license = STORM_DEFAULT_LICENSE;
907
+ let homepage = void 0;
908
+ let support = void 0;
909
+ let name = void 0;
910
+ let namespace = void 0;
911
+ let repository = void 0;
912
+ const workspaceRoot = findWorkspaceRoot(root);
913
+ if (fs.existsSync(path.join(workspaceRoot, "package.json"))) {
914
+ const file = await promises.readFile(
915
+ joinPaths(workspaceRoot, "package.json"),
916
+ "utf8"
917
+ );
918
+ if (file) {
919
+ const packageJson = JSON.parse(file);
920
+ if (packageJson.name) {
921
+ name = packageJson.name;
922
+ }
923
+ if (packageJson.namespace) {
924
+ namespace = packageJson.namespace;
925
+ }
926
+ if (packageJson.repository) {
927
+ if (typeof packageJson.repository === "string") {
928
+ repository = packageJson.repository;
929
+ } else if (packageJson.repository.url) {
930
+ repository = packageJson.repository.url;
931
+ }
932
+ }
933
+ if (packageJson.license) {
934
+ license = packageJson.license;
935
+ }
936
+ if (packageJson.homepage) {
937
+ homepage = packageJson.homepage;
938
+ }
939
+ if (packageJson.bugs) {
940
+ if (typeof packageJson.bugs === "string") {
941
+ support = packageJson.bugs;
942
+ } else if (packageJson.bugs.url) {
943
+ support = packageJson.bugs.url;
944
+ }
945
+ }
946
+ }
947
+ }
948
+ return {
949
+ workspaceRoot,
950
+ name,
951
+ namespace,
952
+ repository,
953
+ license,
954
+ homepage,
955
+ support
956
+ };
957
+ }
958
+ function applyDefaultConfig(config) {
959
+ if (!config.support && config.contact) {
960
+ config.support = config.contact;
961
+ }
962
+ if (!config.contact && config.support) {
963
+ config.contact = config.support;
964
+ }
965
+ if (config.homepage) {
966
+ if (!config.docs) {
967
+ config.docs = `${config.homepage}/docs`;
968
+ }
969
+ if (!config.license) {
970
+ config.license = `${config.homepage}/license`;
971
+ }
972
+ if (!config.support) {
973
+ config.support = `${config.homepage}/support`;
974
+ }
975
+ if (!config.contact) {
976
+ config.contact = `${config.homepage}/contact`;
977
+ }
978
+ if (!config.error?.codesFile || !config?.error?.url) {
979
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
980
+ if (config.homepage) {
981
+ config.error.url ??= `${config.homepage}/errors`;
982
+ }
983
+ }
984
+ }
985
+ return config;
986
+ }
987
+
988
+ // ../config-tools/src/config-file/get-config-file.ts
989
+ var getConfigFileByName = async (fileName, filePath, options = {}) => {
990
+ const workspacePath = filePath || findWorkspaceRoot(filePath);
991
+ const configs = await Promise.all([
992
+ c12.loadConfig({
993
+ cwd: workspacePath,
994
+ packageJson: true,
995
+ name: fileName,
996
+ envName: fileName?.toUpperCase(),
997
+ jitiOptions: {
998
+ debug: false,
999
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
1000
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1001
+ "jiti"
1002
+ )
1003
+ },
1004
+ ...options
1005
+ }),
1006
+ c12.loadConfig({
1007
+ cwd: workspacePath,
1008
+ packageJson: true,
1009
+ name: fileName,
1010
+ envName: fileName?.toUpperCase(),
1011
+ jitiOptions: {
1012
+ debug: false,
1013
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
1014
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1015
+ "jiti"
1016
+ )
1017
+ },
1018
+ configFile: fileName,
1019
+ ...options
1020
+ })
1021
+ ]);
1022
+ return defu3__default.default(configs[0] ?? {}, configs[1] ?? {});
1023
+ };
1024
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
1025
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
1026
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
1027
+ let config = result.config;
1028
+ const configFile = result.configFile;
1029
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
1030
+ chunk7LF2JPA5_cjs.writeTrace(
1031
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
1032
+ {
1033
+ logLevel: "all"
1034
+ }
1035
+ );
1036
+ }
1037
+ if (additionalFileNames && additionalFileNames.length > 0) {
1038
+ const results = await Promise.all(
1039
+ additionalFileNames.map(
1040
+ (fileName) => getConfigFileByName(fileName, workspacePath)
1041
+ )
1042
+ );
1043
+ for (const result2 of results) {
1044
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
1045
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
1046
+ chunk7LF2JPA5_cjs.writeTrace(
1047
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
1048
+ {
1049
+ logLevel: "all"
1050
+ }
1051
+ );
1052
+ }
1053
+ config = defu3__default.default(result2.config ?? {}, config ?? {});
1054
+ }
1055
+ }
1056
+ }
1057
+ if (!config || Object.keys(config).length === 0) {
1058
+ return void 0;
1059
+ }
1060
+ config.configFile = configFile;
1061
+ return config;
1062
+ };
1063
+ var getConfigEnv = () => {
1064
+ const prefix = "STORM_";
1065
+ let config = {
1066
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
1067
+ name: process.env[`${prefix}NAME`] || void 0,
1068
+ variant: process.env[`${prefix}VARIANT`] || void 0,
1069
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
1070
+ owner: process.env[`${prefix}OWNER`] || void 0,
1071
+ bot: {
1072
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
1073
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
1074
+ },
1075
+ release: {
1076
+ banner: {
1077
+ url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
1078
+ alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
1079
+ },
1080
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
1081
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
1082
+ },
1083
+ error: {
1084
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
1085
+ url: process.env[`${prefix}ERROR_URL`] || void 0
1086
+ },
1087
+ socials: {
1088
+ twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
1089
+ discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
1090
+ telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
1091
+ slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
1092
+ medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
1093
+ github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
1094
+ },
1095
+ 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`] ? {
1096
+ name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
1097
+ description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
1098
+ url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
1099
+ logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
1100
+ icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
1101
+ } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
1102
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
1103
+ license: process.env[`${prefix}LICENSE`] || void 0,
1104
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
1105
+ docs: process.env[`${prefix}DOCS`] || void 0,
1106
+ portal: process.env[`${prefix}PORTAL`] || void 0,
1107
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
1108
+ contact: process.env[`${prefix}CONTACT`] || void 0,
1109
+ support: process.env[`${prefix}SUPPORT`] || void 0,
1110
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
1111
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
1112
+ configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
1113
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
1114
+ directories: {
1115
+ 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,
1116
+ 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,
1117
+ 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,
1118
+ 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,
1119
+ 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,
1120
+ 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
1121
+ },
1122
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
1123
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
1124
+ // ci:
1125
+ // process.env[`${prefix}CI`] !== undefined
1126
+ // ? Boolean(
1127
+ // process.env[`${prefix}CI`] ??
1128
+ // process.env.CI ??
1129
+ // process.env.CONTINUOUS_INTEGRATION
1130
+ // )
1131
+ // : undefined,
1132
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
1133
+ branch: process.env[`${prefix}BRANCH`] || void 0,
1134
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
1135
+ registry: {
1136
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
1137
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
1138
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
1139
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
1140
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
1141
+ },
1142
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
1143
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1144
+ ) ? chunk7LF2JPA5_cjs.getLogLevelLabel(
1145
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1146
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
1147
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
1148
+ };
1149
+ const themeNames = Object.keys(process.env).filter(
1150
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
1151
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
1152
+ )
1153
+ );
1154
+ config.colors = themeNames.length > 0 ? themeNames.reduce(
1155
+ (ret, themeName) => {
1156
+ ret[themeName] = getThemeColorsEnv(prefix, themeName);
1157
+ return ret;
1158
+ },
1159
+ {}
1160
+ ) : getThemeColorsEnv(prefix);
1161
+ if (config.docs === STORM_DEFAULT_DOCS) {
1162
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
1163
+ config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
1164
+ } else {
1165
+ config.docs = `${config.homepage}/docs`;
1166
+ }
1167
+ }
1168
+ if (config.licensing === STORM_DEFAULT_LICENSING) {
1169
+ if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
1170
+ config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
1171
+ } else {
1172
+ config.licensing = `${config.homepage}/docs`;
1173
+ }
1174
+ }
1175
+ const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
1176
+ if (serializedConfig) {
1177
+ const parsed = JSON.parse(serializedConfig);
1178
+ config = {
1179
+ ...config,
1180
+ ...parsed,
1181
+ colors: { ...config.colors, ...parsed.colors },
1182
+ extensions: { ...config.extensions, ...parsed.extensions }
1183
+ };
1184
+ }
1185
+ return config;
1186
+ };
1187
+ var getThemeColorsEnv = (prefix, theme) => {
1188
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
1189
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
1190
+ };
1191
+ var getSingleThemeColorsEnv = (prefix) => {
1192
+ const gradient = [];
1193
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1194
+ gradient.push(
1195
+ process.env[`${prefix}GRADIENT_START`],
1196
+ process.env[`${prefix}GRADIENT_END`]
1197
+ );
1198
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1199
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1200
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1201
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1202
+ index++;
1203
+ }
1204
+ }
1205
+ return {
1206
+ dark: process.env[`${prefix}DARK`],
1207
+ light: process.env[`${prefix}LIGHT`],
1208
+ brand: process.env[`${prefix}BRAND`],
1209
+ alternate: process.env[`${prefix}ALTERNATE`],
1210
+ accent: process.env[`${prefix}ACCENT`],
1211
+ link: process.env[`${prefix}LINK`],
1212
+ discovery: process.env[`${prefix}DISCOVERY`],
1213
+ success: process.env[`${prefix}SUCCESS`],
1214
+ info: process.env[`${prefix}INFO`],
1215
+ debug: process.env[`${prefix}DEBUG`],
1216
+ warning: process.env[`${prefix}WARNING`],
1217
+ danger: process.env[`${prefix}DANGER`],
1218
+ fatal: process.env[`${prefix}FATAL`],
1219
+ performance: process.env[`${prefix}PERFORMANCE`],
1220
+ positive: process.env[`${prefix}POSITIVE`],
1221
+ negative: process.env[`${prefix}NEGATIVE`],
1222
+ gradient
1223
+ };
1224
+ };
1225
+ var getMultiThemeColorsEnv = (prefix) => {
1226
+ return {
1227
+ light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
1228
+ dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
1229
+ };
1230
+ };
1231
+ var getBaseThemeColorsEnv = (prefix) => {
1232
+ const gradient = [];
1233
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1234
+ gradient.push(
1235
+ process.env[`${prefix}GRADIENT_START`],
1236
+ process.env[`${prefix}GRADIENT_END`]
1237
+ );
1238
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1239
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1240
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1241
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1242
+ index++;
1243
+ }
1244
+ }
1245
+ return {
1246
+ foreground: process.env[`${prefix}FOREGROUND`],
1247
+ background: process.env[`${prefix}BACKGROUND`],
1248
+ brand: process.env[`${prefix}BRAND`],
1249
+ alternate: process.env[`${prefix}ALTERNATE`],
1250
+ accent: process.env[`${prefix}ACCENT`],
1251
+ link: process.env[`${prefix}LINK`],
1252
+ discovery: process.env[`${prefix}DISCOVERY`],
1253
+ success: process.env[`${prefix}SUCCESS`],
1254
+ info: process.env[`${prefix}INFO`],
1255
+ debug: process.env[`${prefix}DEBUG`],
1256
+ warning: process.env[`${prefix}WARNING`],
1257
+ danger: process.env[`${prefix}DANGER`],
1258
+ fatal: process.env[`${prefix}FATAL`],
1259
+ performance: process.env[`${prefix}PERFORMANCE`],
1260
+ positive: process.env[`${prefix}POSITIVE`],
1261
+ negative: process.env[`${prefix}NEGATIVE`],
1262
+ gradient
1263
+ };
1264
+ };
1265
+
1266
+ // ../config-tools/src/env/set-env.ts
1267
+ var setExtensionEnv = (extensionName, extension) => {
1268
+ for (const key of Object.keys(extension ?? {})) {
1269
+ if (extension[key]) {
1270
+ const result = key?.replace(
1271
+ /([A-Z])+/g,
1272
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
1273
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
1274
+ let extensionKey;
1275
+ if (result.length === 0) {
1276
+ return;
1277
+ }
1278
+ if (result.length === 1) {
1279
+ extensionKey = result[0]?.toUpperCase() ?? "";
1280
+ } else {
1281
+ extensionKey = result.reduce((ret, part) => {
1282
+ return `${ret}_${part.toLowerCase()}`;
1283
+ });
1284
+ }
1285
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
1286
+ }
1287
+ }
1288
+ };
1289
+ var setConfigEnv = (config) => {
1290
+ const prefix = "STORM_";
1291
+ if (config.extends) {
1292
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
1293
+ }
1294
+ if (config.name) {
1295
+ process.env[`${prefix}NAME`] = config.name;
1296
+ }
1297
+ if (config.variant) {
1298
+ process.env[`${prefix}VARIANT`] = config.variant;
1299
+ }
1300
+ if (config.namespace) {
1301
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
1302
+ }
1303
+ if (config.owner) {
1304
+ process.env[`${prefix}OWNER`] = config.owner;
1305
+ }
1306
+ if (config.bot) {
1307
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
1308
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
1309
+ }
1310
+ if (config.error) {
1311
+ process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
1312
+ process.env[`${prefix}ERROR_URL`] = config.error.url;
1313
+ }
1314
+ if (config.release) {
1315
+ if (config.release.banner) {
1316
+ if (typeof config.release.banner === "string") {
1317
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
1318
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
1319
+ } else {
1320
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
1321
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
1322
+ process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
1323
+ }
1324
+ }
1325
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
1326
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1327
+ }
1328
+ if (config.socials) {
1329
+ if (config.socials.twitter) {
1330
+ process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
1331
+ }
1332
+ if (config.socials.discord) {
1333
+ process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
1334
+ }
1335
+ if (config.socials.telegram) {
1336
+ process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
1337
+ }
1338
+ if (config.socials.slack) {
1339
+ process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
1340
+ }
1341
+ if (config.socials.medium) {
1342
+ process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
1343
+ }
1344
+ if (config.socials.github) {
1345
+ process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
1346
+ }
1347
+ }
1348
+ if (config.organization) {
1349
+ if (typeof config.organization === "string") {
1350
+ process.env[`${prefix}ORG`] = config.organization;
1351
+ process.env[`${prefix}ORG_NAME`] = config.organization;
1352
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
1353
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
1354
+ } else {
1355
+ process.env[`${prefix}ORG`] = config.organization.name;
1356
+ process.env[`${prefix}ORG_NAME`] = config.organization.name;
1357
+ process.env[`${prefix}ORGANIZATION`] = config.organization.name;
1358
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
1359
+ if (config.organization.url) {
1360
+ process.env[`${prefix}ORG_URL`] = config.organization.url;
1361
+ process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
1362
+ }
1363
+ if (config.organization.description) {
1364
+ process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
1365
+ process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
1366
+ }
1367
+ if (config.organization.logo) {
1368
+ process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
1369
+ process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
1370
+ }
1371
+ if (config.organization.icon) {
1372
+ process.env[`${prefix}ORG_ICON`] = config.organization.icon;
1373
+ process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
1374
+ }
1375
+ }
1376
+ }
1377
+ if (config.packageManager) {
1378
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
1379
+ }
1380
+ if (config.license) {
1381
+ process.env[`${prefix}LICENSE`] = config.license;
1382
+ }
1383
+ if (config.homepage) {
1384
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
1385
+ }
1386
+ if (config.docs) {
1387
+ process.env[`${prefix}DOCS`] = config.docs;
1388
+ }
1389
+ if (config.portal) {
1390
+ process.env[`${prefix}PORTAL`] = config.portal;
1391
+ }
1392
+ if (config.licensing) {
1393
+ process.env[`${prefix}LICENSING`] = config.licensing;
1394
+ }
1395
+ if (config.contact) {
1396
+ process.env[`${prefix}CONTACT`] = config.contact;
1397
+ }
1398
+ if (config.support) {
1399
+ process.env[`${prefix}SUPPORT`] = config.support;
1400
+ }
1401
+ if (config.timezone) {
1402
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
1403
+ process.env.TZ = config.timezone;
1404
+ process.env.DEFAULT_TIMEZONE = config.timezone;
1405
+ process.env.TIMEZONE = config.timezone;
1406
+ }
1407
+ if (config.locale) {
1408
+ process.env[`${prefix}LOCALE`] = config.locale;
1409
+ process.env.DEFAULT_LOCALE = config.locale;
1410
+ process.env.LOCALE = config.locale;
1411
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1412
+ }
1413
+ if (config.configFile) {
1414
+ process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
1415
+ config.configFile
1416
+ );
1417
+ }
1418
+ if (config.workspaceRoot) {
1419
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
1420
+ process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
1421
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
1422
+ }
1423
+ if (config.directories) {
1424
+ if (!config.skipCache && config.directories.cache) {
1425
+ process.env[`${prefix}CACHE_DIR`] = correctPaths(
1426
+ config.directories.cache
1427
+ );
1428
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1429
+ }
1430
+ if (config.directories.data) {
1431
+ process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
1432
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1433
+ }
1434
+ if (config.directories.config) {
1435
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths(
1436
+ config.directories.config
1437
+ );
1438
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1439
+ }
1440
+ if (config.directories.temp) {
1441
+ process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
1442
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1443
+ }
1444
+ if (config.directories.log) {
1445
+ process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
1446
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1447
+ }
1448
+ if (config.directories.build) {
1449
+ process.env[`${prefix}BUILD_DIR`] = correctPaths(
1450
+ config.directories.build
1451
+ );
1452
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1453
+ }
1454
+ }
1455
+ if (config.skipCache !== void 0) {
1456
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
1457
+ if (config.skipCache) {
1458
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
1459
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
1460
+ }
1461
+ }
1462
+ if (config.mode) {
1463
+ process.env[`${prefix}MODE`] = config.mode;
1464
+ process.env.NODE_ENV = config.mode;
1465
+ process.env.ENVIRONMENT = config.mode;
1466
+ }
1467
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
1468
+ for (const key of Object.keys(config.colors)) {
1469
+ setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
1470
+ }
1471
+ } else {
1472
+ setThemeColorsEnv(
1473
+ `${prefix}COLOR_`,
1474
+ config.colors
1475
+ );
1476
+ }
1477
+ if (config.repository) {
1478
+ process.env[`${prefix}REPOSITORY`] = config.repository;
1479
+ }
1480
+ if (config.branch) {
1481
+ process.env[`${prefix}BRANCH`] = config.branch;
1482
+ }
1483
+ if (config.preid) {
1484
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
1485
+ }
1486
+ if (config.registry) {
1487
+ if (config.registry.github) {
1488
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
1489
+ }
1490
+ if (config.registry.npm) {
1491
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
1492
+ }
1493
+ if (config.registry.cargo) {
1494
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
1495
+ }
1496
+ if (config.registry.cyclone) {
1497
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
1498
+ config.registry.cyclone
1499
+ );
1500
+ }
1501
+ if (config.registry.container) {
1502
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
1503
+ config.registry.container
1504
+ );
1505
+ }
1506
+ }
1507
+ if (config.logLevel) {
1508
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
1509
+ process.env.LOG_LEVEL = String(config.logLevel);
1510
+ process.env.NX_VERBOSE_LOGGING = String(
1511
+ chunk7LF2JPA5_cjs.getLogLevel(config.logLevel) >= chunk7LF2JPA5_cjs.LogLevel.DEBUG ? true : false
1512
+ );
1513
+ process.env.RUST_BACKTRACE = chunk7LF2JPA5_cjs.getLogLevel(config.logLevel) >= chunk7LF2JPA5_cjs.LogLevel.DEBUG ? "full" : "none";
1514
+ }
1515
+ if (config.skipConfigLogging !== void 0) {
1516
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
1517
+ config.skipConfigLogging
1518
+ );
1519
+ }
1520
+ process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
1521
+ for (const key of Object.keys(config.extensions ?? {})) {
1522
+ if (config.extensions[key] && Object.keys(config.extensions[key])) {
1523
+ setExtensionEnv(key, config.extensions[key]);
1524
+ }
1525
+ }
1526
+ };
1527
+ var setThemeColorsEnv = (prefix, config) => {
1528
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1529
+ };
1530
+ var setSingleThemeColorsEnv = (prefix, config) => {
1531
+ if (config.dark) {
1532
+ process.env[`${prefix}DARK`] = config.dark;
1533
+ }
1534
+ if (config.light) {
1535
+ process.env[`${prefix}LIGHT`] = config.light;
1536
+ }
1537
+ if (config.brand) {
1538
+ process.env[`${prefix}BRAND`] = config.brand;
1539
+ }
1540
+ if (config.alternate) {
1541
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1542
+ }
1543
+ if (config.accent) {
1544
+ process.env[`${prefix}ACCENT`] = config.accent;
1545
+ }
1546
+ if (config.link) {
1547
+ process.env[`${prefix}LINK`] = config.link;
1548
+ }
1549
+ if (config.discovery) {
1550
+ process.env[`${prefix}DISCOVERY`] = config.discovery;
1551
+ }
1552
+ if (config.success) {
1553
+ process.env[`${prefix}SUCCESS`] = config.success;
1554
+ }
1555
+ if (config.info) {
1556
+ process.env[`${prefix}INFO`] = config.info;
1557
+ }
1558
+ if (config.debug) {
1559
+ process.env[`${prefix}DEBUG`] = config.debug;
1560
+ }
1561
+ if (config.warning) {
1562
+ process.env[`${prefix}WARNING`] = config.warning;
1563
+ }
1564
+ if (config.danger) {
1565
+ process.env[`${prefix}DANGER`] = config.danger;
1566
+ }
1567
+ if (config.fatal) {
1568
+ process.env[`${prefix}FATAL`] = config.fatal;
1569
+ }
1570
+ if (config.performance) {
1571
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1572
+ }
1573
+ if (config.positive) {
1574
+ process.env[`${prefix}POSITIVE`] = config.positive;
1575
+ }
1576
+ if (config.negative) {
1577
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1578
+ }
1579
+ if (config.gradient) {
1580
+ for (let i = 0; i < config.gradient.length; i++) {
1581
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1582
+ }
1583
+ }
1584
+ };
1585
+ var setMultiThemeColorsEnv = (prefix, config) => {
1586
+ return {
1587
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
1588
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
1589
+ };
1590
+ };
1591
+ var setBaseThemeColorsEnv = (prefix, config) => {
1592
+ if (config.foreground) {
1593
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
1594
+ }
1595
+ if (config.background) {
1596
+ process.env[`${prefix}BACKGROUND`] = config.background;
1597
+ }
1598
+ if (config.brand) {
1599
+ process.env[`${prefix}BRAND`] = config.brand;
1600
+ }
1601
+ if (config.alternate) {
1602
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1603
+ }
1604
+ if (config.accent) {
1605
+ process.env[`${prefix}ACCENT`] = config.accent;
1606
+ }
1607
+ if (config.link) {
1608
+ process.env[`${prefix}LINK`] = config.link;
1609
+ }
1610
+ if (config.discovery) {
1611
+ process.env[`${prefix}DISCOVERY`] = config.discovery;
1612
+ }
1613
+ if (config.success) {
1614
+ process.env[`${prefix}SUCCESS`] = config.success;
1615
+ }
1616
+ if (config.info) {
1617
+ process.env[`${prefix}INFO`] = config.info;
1618
+ }
1619
+ if (config.debug) {
1620
+ process.env[`${prefix}DEBUG`] = config.debug;
1621
+ }
1622
+ if (config.warning) {
1623
+ process.env[`${prefix}WARNING`] = config.warning;
1624
+ }
1625
+ if (config.danger) {
1626
+ process.env[`${prefix}DANGER`] = config.danger;
1627
+ }
1628
+ if (config.fatal) {
1629
+ process.env[`${prefix}FATAL`] = config.fatal;
1630
+ }
1631
+ if (config.performance) {
1632
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1633
+ }
1634
+ if (config.positive) {
1635
+ process.env[`${prefix}POSITIVE`] = config.positive;
1636
+ }
1637
+ if (config.negative) {
1638
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1639
+ }
1640
+ if (config.gradient) {
1641
+ for (let i = 0; i < config.gradient.length; i++) {
1642
+ process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
1643
+ }
1644
+ }
1645
+ };
1646
+ var _static_cache = void 0;
1647
+ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
1648
+ let result;
1649
+ if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
1650
+ let _workspaceRoot = workspaceRoot;
1651
+ if (!_workspaceRoot) {
1652
+ _workspaceRoot = findWorkspaceRoot();
1653
+ }
1654
+ const configEnv = getConfigEnv();
1655
+ const configFile = await getConfigFile(_workspaceRoot);
1656
+ if (!configFile) {
1657
+ if (!skipLogs) {
1658
+ chunk7LF2JPA5_cjs.writeWarning(
1659
+ "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",
1660
+ { logLevel: "all" }
1661
+ );
1662
+ }
1663
+ if (useDefault === false) {
1664
+ return void 0;
1665
+ }
1666
+ }
1667
+ const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
1668
+ const configInput = defu3__default.default(
1669
+ configEnv,
1670
+ configFile,
1671
+ defaultConfig
1672
+ );
1673
+ if (!configInput.variant) {
1674
+ 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";
1675
+ }
1676
+ try {
1677
+ const parseResult = await Promise.resolve(
1678
+ workspaceConfigSchema._zod.parse(
1679
+ { value: configInput, issues: [] },
1680
+ { async: true }
1681
+ )
1682
+ );
1683
+ result = applyDefaultConfig(parseResult.value);
1684
+ result.workspaceRoot ??= _workspaceRoot;
1685
+ } catch (error) {
1686
+ throw new Error(
1687
+ `Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
1688
+
1689
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${chunk7LF2JPA5_cjs.formatLogMessage(
1690
+ configInput
1691
+ )}`,
1692
+ {
1693
+ cause: error
1694
+ }
1695
+ );
1696
+ }
1697
+ } else {
1698
+ result = _static_cache.data;
1699
+ }
1700
+ _static_cache = {
1701
+ timestamp: Date.now(),
1702
+ data: result
1703
+ };
1704
+ return result;
1705
+ };
1706
+ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
1707
+ const config = await createStormWorkspaceConfig(
1708
+ void 0,
1709
+ void 0,
1710
+ workspaceRoot,
1711
+ skipLogs,
1712
+ true
1713
+ );
1714
+ setConfigEnv(config);
1715
+ if (!skipLogs && !config.skipConfigLogging) {
1716
+ chunk7LF2JPA5_cjs.writeTrace(
1717
+ `\u2699\uFE0F Using Storm Workspace configuration:
1718
+ ${chunk7LF2JPA5_cjs.formatLogMessage(config)}`,
1719
+ config
1720
+ );
1721
+ }
1722
+ return config;
1723
+ };
1724
+
1725
+ // ../config-tools/src/get-config.ts
1726
+ function getConfig(workspaceRoot, skipLogs = false) {
1727
+ return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
1728
+ }
1729
+ function getWorkspaceConfig(skipLogs = true, options = {}) {
1730
+ let workspaceRoot = options.workspaceRoot;
1731
+ if (!workspaceRoot) {
1732
+ workspaceRoot = findWorkspaceRoot(options.cwd);
1733
+ }
1734
+ return getConfig(workspaceRoot, skipLogs);
1735
+ }
1736
+
1737
+ // src/utilities/title-case.ts
1738
+ var ACRONYMS = [
1739
+ "3D",
1740
+ "4D",
1741
+ "5G",
1742
+ "6G",
1743
+ "7G",
1744
+ "8G",
1745
+ "ACID",
1746
+ "AES",
1747
+ "AI",
1748
+ "AJAX",
1749
+ "API",
1750
+ "AR",
1751
+ "ASCII",
1752
+ "B2B",
1753
+ "B2C",
1754
+ "BFF",
1755
+ "BI",
1756
+ "BIOS",
1757
+ "BGP",
1758
+ "BOM",
1759
+ "BYOD",
1760
+ "C2C",
1761
+ "CAGR",
1762
+ "CAPTCHA",
1763
+ "CD",
1764
+ "CDN",
1765
+ "CDP",
1766
+ "CI",
1767
+ "CI/CD",
1768
+ "CIAM",
1769
+ "CICD",
1770
+ "CLI",
1771
+ "CMDB",
1772
+ "CORS",
1773
+ "CPU",
1774
+ "CRUD",
1775
+ "CSR",
1776
+ "CSS",
1777
+ "CX",
1778
+ "DAG",
1779
+ "DBMS",
1780
+ "DDoS",
1781
+ "DNS",
1782
+ "DNSSEC",
1783
+ "DOM",
1784
+ "DR",
1785
+ "DRM",
1786
+ "DWH",
1787
+ "E2E",
1788
+ "EAI",
1789
+ "EKS",
1790
+ "EOF",
1791
+ "EOD",
1792
+ "ETC",
1793
+ "ETL",
1794
+ "EULA",
1795
+ "FIDO",
1796
+ "FQDN",
1797
+ "FTP",
1798
+ "FaaS",
1799
+ "GDPR",
1800
+ "GCP",
1801
+ "GPU",
1802
+ "GUID",
1803
+ "GUI",
1804
+ "GZIP",
1805
+ "HCI",
1806
+ "HDD",
1807
+ "HDFS",
1808
+ "HIPAA",
1809
+ "HMAC",
1810
+ "HOTP",
1811
+ "HSM",
1812
+ "HTML",
1813
+ "HTTP",
1814
+ "HTTP/2",
1815
+ "HTTP/2.0",
1816
+ "HTTP/3",
1817
+ "HTTP/3.0",
1818
+ "HTTP2",
1819
+ "HTTPS",
1820
+ "HTTPS/2",
1821
+ "HTTPS/3",
1822
+ "HTTPS3",
1823
+ "IAM",
1824
+ "IAMM",
1825
+ "IAMT",
1826
+ "IaaS",
1827
+ "ID",
1828
+ "IMAP",
1829
+ "IP",
1830
+ "IPFS",
1831
+ "IoT",
1832
+ "JSON",
1833
+ "JSONP",
1834
+ "JWT",
1835
+ "K8s",
1836
+ "KMS",
1837
+ "KPI",
1838
+ "LAN",
1839
+ "LHS",
1840
+ "LXC",
1841
+ "MFA",
1842
+ "ML",
1843
+ "MLOps",
1844
+ "MVC",
1845
+ "MVP",
1846
+ "NAS",
1847
+ "NAT",
1848
+ "NDA",
1849
+ "NFS",
1850
+ "NIST",
1851
+ "NLP",
1852
+ "NPS",
1853
+ "OCR",
1854
+ "OEM",
1855
+ "OKR",
1856
+ "OLAP",
1857
+ "OLTP",
1858
+ "OOP",
1859
+ "ORM",
1860
+ "OS",
1861
+ "OTP",
1862
+ "P2P",
1863
+ "PDP",
1864
+ "PaaS",
1865
+ "PCI",
1866
+ "PKI",
1867
+ "PP",
1868
+ "PWA",
1869
+ "PX",
1870
+ "QA",
1871
+ "RAID",
1872
+ "RAM",
1873
+ "RDS",
1874
+ "REST",
1875
+ "RHS",
1876
+ "RPC",
1877
+ "RPA",
1878
+ "RUM",
1879
+ "RSS",
1880
+ "SAN",
1881
+ "SASE",
1882
+ "SDLC",
1883
+ "SDK",
1884
+ "SEO",
1885
+ "SFTP",
1886
+ "SIEM",
1887
+ "SLA",
1888
+ "SMB",
1889
+ "SMTP",
1890
+ "SOAP",
1891
+ "SOC",
1892
+ "SOA",
1893
+ "SPDY",
1894
+ "SPF",
1895
+ "SQL",
1896
+ "SRV",
1897
+ "SRE",
1898
+ "SSH",
1899
+ "SSDL",
1900
+ "SSO",
1901
+ "SSL",
1902
+ "SSR",
1903
+ "TDD",
1904
+ "TLD",
1905
+ "TLS",
1906
+ "TLS1.3",
1907
+ "TOTP",
1908
+ "TRPC",
1909
+ "TTL",
1910
+ "UDP",
1911
+ "UI",
1912
+ "UID",
1913
+ "URI",
1914
+ "URL",
1915
+ "UTF",
1916
+ "UUID",
1917
+ "UX",
1918
+ "VM",
1919
+ "VLAN",
1920
+ "VPN",
1921
+ "VR",
1922
+ "WAF",
1923
+ "WAN",
1924
+ "WLAN",
1925
+ "WPA",
1926
+ "XACML",
1927
+ "XML",
1928
+ "XSRF",
1929
+ "XSS",
1930
+ "XR",
1931
+ "YAML",
1932
+ "ZTA"
1933
+ ];
1934
+ ACRONYMS.reduce(
1935
+ (ret, acronym) => {
1936
+ ret[acronym.toLowerCase()] = acronym;
1937
+ return ret;
1938
+ },
1939
+ {
1940
+ cspell: "CSpell",
1941
+ eslint: "ESLint",
1942
+ nx: "Nx"
1943
+ }
1944
+ );
1945
+
1946
+ // src/utilities/changelog-utils.ts
1947
+ function generateChangelogTitle(version, project, workspaceConfig) {
1948
+ if (!workspaceConfig?.name || !project) {
1949
+ return version;
1950
+ }
1951
+ return `[${version}](https://github.com/${typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization?.name}/${workspaceConfig.name}/releases/tag/${project}%40${version}) (${(/* @__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()})`;
1952
+ }
1953
+
1954
+ // src/release/changelog-renderer.ts
1955
+ var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.default {
1956
+ /**
1957
+ * The Storm workspace configuration object, which is loaded from the storm-workspace.json file.
1958
+ */
1959
+ workspaceConfig;
1960
+ /**
1961
+ * 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).
1962
+ *
1963
+ * @param config - The configuration object for the ChangelogRenderer
1964
+ */
1965
+ constructor(config) {
1966
+ const resolvedConfig = {
1967
+ entryWhenNoChanges: false,
1968
+ conventionalCommitsConfig: conventionalCommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG,
1969
+ ...config
1970
+ };
1971
+ super(resolvedConfig);
1972
+ this.workspaceConfig = config.workspaceConfig;
1973
+ this.remoteReleaseClient = resolvedConfig.remoteReleaseClient;
1974
+ }
1975
+ async render() {
1976
+ if (!this.workspaceConfig) {
1977
+ this.workspaceConfig = await getWorkspaceConfig();
1978
+ }
1979
+ return super.render();
1980
+ }
1981
+ preprocessChanges() {
1982
+ this.relevantChanges = [...this.changes];
1983
+ this.breakingChanges = [];
1984
+ this.additionalChangesForAuthorsSection = [];
1985
+ for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
1986
+ const change = this.relevantChanges[i];
1987
+ if (change && change.type === "revert" && change.revertedHashes) {
1988
+ for (const revertedHash of change.revertedHashes) {
1989
+ const revertedCommitIndex = this.relevantChanges.findIndex(
1990
+ (c) => c.shortHash && revertedHash.startsWith(c.shortHash)
1991
+ );
1992
+ if (revertedCommitIndex !== -1) {
1993
+ this.relevantChanges.splice(revertedCommitIndex, 1);
1994
+ this.relevantChanges.splice(i, 1);
1995
+ i--;
1996
+ break;
1997
+ }
1998
+ }
1999
+ }
2000
+ }
2001
+ if (this.isVersionPlans) {
2002
+ this.conventionalCommitsConfig = {
2003
+ useCommitScope: this.workspaceConfig?.variant === "monorepo",
2004
+ types: {
2005
+ feat: conventionalCommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.feat,
2006
+ fix: conventionalCommits.DEFAULT_CONVENTIONAL_COMMITS_CONFIG.types.fix
2007
+ }
2008
+ };
2009
+ for (let i = this.relevantChanges.length - 1; i >= 0; i--) {
2010
+ if (this.relevantChanges[i]?.isBreaking) {
2011
+ const change = this.relevantChanges[i];
2012
+ if (change) {
2013
+ this.additionalChangesForAuthorsSection.push(change);
2014
+ const line = this.formatChange(change);
2015
+ this.breakingChanges.push(line);
2016
+ this.relevantChanges.splice(i, 1);
2017
+ }
2018
+ }
2019
+ }
2020
+ } else {
2021
+ for (const change of this.relevantChanges) {
2022
+ if (change.isBreaking) {
2023
+ const breakingChangeExplanation = change.body ? this.extractBreakingChangeExplanation(change.body) : "";
2024
+ this.breakingChanges.push(
2025
+ breakingChangeExplanation ? `- ${change.scope ? `**${change.scope.trim()}:** ` : ""}${breakingChangeExplanation}` : this.formatChange(change)
2026
+ );
2027
+ }
2028
+ }
2029
+ }
2030
+ }
2031
+ /**
2032
+ * 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.
2033
+ */
2034
+ // protected override shouldRenderEmptyEntry(): boolean {
2035
+ // return true;
2036
+ // }
2037
+ renderVersionTitle() {
2038
+ const isMajorVersion = `${semver.major(this.changelogEntryVersion)}.0.0` === this.changelogEntryVersion.replace(/^v/, "");
2039
+ return isMajorVersion ? `# ${generateChangelogTitle(
2040
+ this.changelogEntryVersion,
2041
+ this.project,
2042
+ this.workspaceConfig
2043
+ )}` : `## ${generateChangelogTitle(
2044
+ this.changelogEntryVersion,
2045
+ this.project,
2046
+ this.workspaceConfig
2047
+ )}`;
2048
+ }
2049
+ renderBreakingChanges() {
2050
+ return [
2051
+ "### Breaking Changes",
2052
+ "",
2053
+ ...Array.from(new Set(this.breakingChanges))
2054
+ ];
2055
+ }
2056
+ renderDependencyBumps() {
2057
+ const markdownLines = ["", "### Updated Dependencies", ""];
2058
+ this.dependencyBumps?.forEach(({ dependencyName, newVersion }) => {
2059
+ const markdownLine = `- Updated **${dependencyName}** to **v${newVersion}**`;
2060
+ if (!markdownLines.includes(markdownLine)) {
2061
+ markdownLines.push(markdownLine);
2062
+ }
2063
+ });
2064
+ return markdownLines;
2065
+ }
2066
+ async renderAuthors() {
2067
+ const markdownLines = [];
2068
+ const _authors = /* @__PURE__ */ new Map();
2069
+ for (const change of [
2070
+ ...this.relevantChanges,
2071
+ ...this.additionalChangesForAuthorsSection
2072
+ ]) {
2073
+ if (!change.authors) {
2074
+ continue;
2075
+ }
2076
+ for (const author of change.authors) {
2077
+ const name = this.formatName(author.name);
2078
+ if (!name || name.includes("[bot]") || name === this.workspaceConfig?.bot.name) {
2079
+ continue;
2080
+ }
2081
+ if (_authors.has(name)) {
2082
+ const entry = _authors.get(name);
2083
+ entry?.email.add(author.email);
2084
+ } else {
2085
+ _authors.set(name, { email: /* @__PURE__ */ new Set([author.email]) });
2086
+ }
2087
+ }
2088
+ }
2089
+ if (this.changelogRenderOptions.mapAuthorsToGitHubUsernames) {
2090
+ await Promise.all(
2091
+ [..._authors.keys()].map(async (authorName) => {
2092
+ const meta = _authors.get(authorName);
2093
+ if (!meta) {
2094
+ return;
2095
+ }
2096
+ for (const email of meta.email) {
2097
+ if (email?.endsWith("@users.noreply.github.com")) {
2098
+ const match = email?.match(
2099
+ /^(\d+\+)?([^@]+)@users\.noreply\.github\.com$/
2100
+ );
2101
+ if (match && match[2]) {
2102
+ meta.github = match[2];
2103
+ break;
2104
+ }
2105
+ }
2106
+ const { data } = await axios2__default.default.get(`https://ungh.cc/users/find/${email}`).catch(() => ({ data: { user: null } }));
2107
+ if (data?.user) {
2108
+ meta.github = data.user.username;
2109
+ break;
2110
+ }
2111
+ }
2112
+ })
2113
+ );
2114
+ }
2115
+ const authors = [..._authors.entries()].map((e) => ({
2116
+ name: e[0],
2117
+ ...e[1]
2118
+ }));
2119
+ if (authors.length > 0) {
2120
+ markdownLines.push(
2121
+ "",
2122
+ "### \u2764\uFE0F Thank You",
2123
+ "",
2124
+ ...authors.sort((a, b) => a.name.localeCompare(b.name)).map((i) => {
2125
+ const github = i.github ? ` @${i.github}` : "";
2126
+ return `- ${i.name}${github}`;
2127
+ })
2128
+ );
2129
+ }
2130
+ return markdownLines;
2131
+ }
2132
+ formatChange(change) {
2133
+ let description = change.description || "";
2134
+ let extraLines = [];
2135
+ let extraLinesStr = "";
2136
+ if (description.includes("\n")) {
2137
+ const lines = description.split("\n");
2138
+ if (lines.length > 1) {
2139
+ description = lines[0];
2140
+ extraLines = lines.slice(1);
2141
+ }
2142
+ const indentation = " ";
2143
+ extraLinesStr = extraLines.filter((l) => l.trim().length > 0).map((l) => `${indentation}${l}`).join("\n");
2144
+ }
2145
+ let changeLine = "- " + (!this.isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : "") + description;
2146
+ if (change.githubReferences) {
2147
+ changeLine += this.remoteReleaseClient.formatReferences(
2148
+ change.githubReferences
2149
+ );
2150
+ }
2151
+ if (extraLinesStr) {
2152
+ changeLine += "\n\n" + extraLinesStr;
2153
+ }
2154
+ return changeLine;
2155
+ }
2156
+ };
2157
+
2158
+ // src/release/config.ts
2159
+ var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
2160
+ useCommitScope: true,
2161
+ questions: chunkGFCNZUMY_cjs.DEFAULT_MONOREPO_COMMIT_QUESTIONS,
2162
+ types: chunk5TXHP6RI_cjs.DEFAULT_COMMIT_TYPES
2163
+ };
2164
+ var DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN = "{projectName}@{version}";
2165
+ var DEFAULT_FIXED_RELEASE_TAG_PATTERN = "{releaseGroupName}@{version}";
2166
+ var DEFAULT_COMMIT_MESSAGE = "release(monorepo): Publish release updates";
2167
+ var DEFAULT_RELEASE_GROUP_GIT_CONFIG = {
2168
+ commit: false,
2169
+ commitMessage: DEFAULT_COMMIT_MESSAGE,
2170
+ commitArgs: "",
2171
+ tag: false,
2172
+ tagMessage: "",
2173
+ tagArgs: "",
2174
+ stageChanges: false,
2175
+ pushArgs: ""
2176
+ };
2177
+ var DEFAULT_VERSION_RELEASE_CONFIG = {
2178
+ currentVersionResolver: "git-tag",
2179
+ fallbackCurrentVersionResolver: "disk",
2180
+ specifierSource: "conventional-commits",
2181
+ groupPreVersionCommand: "pnpm build",
2182
+ preserveLocalDependencyProtocols: true,
2183
+ preserveMatchingDependencyRanges: true,
2184
+ logUnchangedProjects: true,
2185
+ updateDependents: "always",
2186
+ git: {
2187
+ ...DEFAULT_RELEASE_GROUP_GIT_CONFIG,
2188
+ stageChanges: true
2189
+ }
2190
+ };
2191
+ var DEFAULT_CHANGELOG_RELEASE_CONFIG = {
2192
+ createRelease: "github",
2193
+ renderOptions: {
2194
+ authors: false,
2195
+ commitReferences: true,
2196
+ versionTitleDate: true
2197
+ },
2198
+ git: {
2199
+ ...DEFAULT_RELEASE_GROUP_GIT_CONFIG,
2200
+ commit: true,
2201
+ tag: true,
2202
+ push: true
2203
+ }
2204
+ };
2205
+ var DEFAULT_RELEASE_GROUP_CONFIG = {
2206
+ changelog: {
2207
+ ...DEFAULT_CHANGELOG_RELEASE_CONFIG
2208
+ },
2209
+ version: {
2210
+ ...DEFAULT_VERSION_RELEASE_CONFIG
2211
+ },
2212
+ versionPlans: false
2213
+ };
2214
+ var DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG = {
2215
+ projectsRelationship: "independent",
2216
+ releaseTag: {
2217
+ pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN
2218
+ }
2219
+ };
2220
+ var DEFAULT_FIXED_RELEASE_GROUP_CONFIG = {
2221
+ projectsRelationship: "fixed",
2222
+ releaseTag: {
2223
+ pattern: DEFAULT_FIXED_RELEASE_TAG_PATTERN
2224
+ }
2225
+ };
2226
+ var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
2227
+ version: {
2228
+ versionActions: "@storm-software/workspace-tools/release/js-version-actions",
2229
+ versionActionsOptions: {
2230
+ currentVersionResolver: "git-tag",
2231
+ specifierSource: "conventional-commits"
2232
+ },
2233
+ manifestRootsToUpdate: [
2234
+ "{projectRoot}",
2235
+ {
2236
+ path: "dist/{projectRoot}",
2237
+ preserveLocalDependencyProtocols: false
2238
+ }
2239
+ ]
2240
+ }
2241
+ };
2242
+ var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
2243
+ version: {
2244
+ versionActions: "@storm-software/workspace-tools/release/rust-version-actions",
2245
+ versionActionsOptions: {
2246
+ currentVersionResolver: "git-tag",
2247
+ specifierSource: "conventional-commits"
2248
+ },
2249
+ manifestRootsToUpdate: ["{projectRoot}"]
2250
+ }
2251
+ };
2252
+ var DEFAULT_RELEASE_CONFIG = {
2253
+ conventionalCommits: DEFAULT_CONVENTIONAL_COMMITS_CONFIG2,
2254
+ groups: {
2255
+ packages: defu3__default.default(
2256
+ {
2257
+ projects: ["packages/*"]
2258
+ },
2259
+ DEFAULT_JS_RELEASE_GROUP_CONFIG,
2260
+ DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG,
2261
+ DEFAULT_RELEASE_GROUP_CONFIG
2262
+ ),
2263
+ crates: defu3__default.default(
2264
+ {
2265
+ projects: ["crates/*"]
2266
+ },
2267
+ DEFAULT_RUST_RELEASE_GROUP_CONFIG,
2268
+ DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG,
2269
+ DEFAULT_RELEASE_GROUP_CONFIG
2270
+ )
2271
+ },
2272
+ changelog: {
2273
+ ...DEFAULT_CHANGELOG_RELEASE_CONFIG,
2274
+ automaticFromRef: true,
2275
+ workspaceChangelog: false,
2276
+ projectChangelogs: true
2277
+ },
2278
+ releaseTag: {
2279
+ pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN
2280
+ },
2281
+ version: {
2282
+ ...DEFAULT_VERSION_RELEASE_CONFIG
2283
+ }
2284
+ };
2285
+ function mergeReleaseGroupConfig(config, defaultConfig, workspaceConfig) {
2286
+ return defu3__default.default(
2287
+ {
2288
+ ...omit(defaultConfig, ["changelog", "version"]),
2289
+ ...config
2290
+ },
2291
+ {
2292
+ version: {
2293
+ ...defaultConfig.version
2294
+ }
2295
+ },
2296
+ {
2297
+ changelog: {
2298
+ ...typeof defaultConfig.changelog === "object" ? defaultConfig.changelog : {},
2299
+ renderer: StormChangelogRenderer,
2300
+ renderOptions: {
2301
+ ...typeof defaultConfig.changelog === "object" && defaultConfig.changelog.renderOptions || {},
2302
+ workspaceConfig
2303
+ }
2304
+ }
2305
+ }
2306
+ );
2307
+ }
2308
+ function getReleaseGroupConfig(projectGraph, releaseConfig, workspaceConfig) {
2309
+ const alreadyMatchedProjects = /* @__PURE__ */ new Set();
2310
+ return !releaseConfig?.groups || Object.keys(releaseConfig.groups).length === 0 ? {} : Object.fromEntries(
2311
+ Object.entries(releaseConfig.groups).map(([name, group]) => {
2312
+ const matchingProjects = findMatchingProjects.findMatchingProjects(
2313
+ typeof group.projects === "string" ? [group.projects] : group.projects,
2314
+ projectGraph.nodes
2315
+ );
2316
+ if (!matchingProjects.length) {
2317
+ chunk7LF2JPA5_cjs.writeWarning(
2318
+ `Release group "${name}" does not have any matching projects.`
2319
+ );
2320
+ return void 0;
2321
+ }
2322
+ for (const project of matchingProjects) {
2323
+ if (alreadyMatchedProjects.has(project)) {
2324
+ throw new Error(
2325
+ `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.`
2326
+ );
2327
+ }
2328
+ alreadyMatchedProjects.add(project);
2329
+ }
2330
+ let defaultConfig = {};
2331
+ if (matchingProjects.every(
2332
+ (project) => projectGraph.nodes[project]?.data && (projectGraph.nodes[project]?.data.metadata?.js || isEqualProjectTag(
2333
+ projectGraph.nodes[project]?.data,
2334
+ ProjectTagConstants.Language.TAG_ID,
2335
+ ProjectTagConstants.Language.TYPESCRIPT
2336
+ ) || projectGraph.nodes[project]?.data.metadata?.root && fs.existsSync(
2337
+ joinPaths(
2338
+ projectGraph.nodes[project]?.data.metadata?.root,
2339
+ "package.json"
2340
+ )
2341
+ ))
2342
+ )) {
2343
+ defaultConfig = defu3__default.default(
2344
+ group.projectsRelationship === "fixed" ? DEFAULT_FIXED_RELEASE_GROUP_CONFIG : DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG,
2345
+ DEFAULT_JS_RELEASE_GROUP_CONFIG,
2346
+ DEFAULT_RELEASE_GROUP_CONFIG
2347
+ );
2348
+ } else if (matchingProjects.every(
2349
+ (project) => projectGraph.nodes[project]?.data && (projectGraph.nodes[project]?.data.metadata?.rust || projectGraph.nodes[project]?.data.metadata?.cargo || isEqualProjectTag(
2350
+ projectGraph.nodes[project]?.data,
2351
+ ProjectTagConstants.Language.TAG_ID,
2352
+ ProjectTagConstants.Language.RUST
2353
+ ) || projectGraph.nodes[project]?.data.metadata?.root && fs.existsSync(
2354
+ joinPaths(
2355
+ projectGraph.nodes[project]?.data.metadata?.root,
2356
+ "Cargo.toml"
2357
+ )
2358
+ ))
2359
+ )) {
2360
+ defaultConfig = defu3__default.default(
2361
+ group.projectsRelationship === "fixed" ? DEFAULT_FIXED_RELEASE_GROUP_CONFIG : DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG,
2362
+ DEFAULT_RUST_RELEASE_GROUP_CONFIG,
2363
+ DEFAULT_RELEASE_GROUP_CONFIG
2364
+ );
2365
+ }
2366
+ const config = mergeReleaseGroupConfig(
2367
+ group,
2368
+ defaultConfig,
2369
+ workspaceConfig
2370
+ );
2371
+ config.projects = matchingProjects;
2372
+ if (workspaceConfig?.workspaceRoot) {
2373
+ if (config.changelog?.renderer && typeof config.changelog?.renderer === "string" && config.changelog?.renderer?.toString().startsWith("./")) {
2374
+ config.changelog.renderer = joinPaths(
2375
+ workspaceConfig.workspaceRoot,
2376
+ config.changelog.renderer
2377
+ );
2378
+ }
2379
+ if (config.version?.versionActions && config.version.versionActions.startsWith("./")) {
2380
+ config.version.versionActions = joinPaths(
2381
+ workspaceConfig.workspaceRoot,
2382
+ config.version?.versionActions
2383
+ );
2384
+ }
2385
+ }
2386
+ return [name, config];
2387
+ }).filter(Boolean)
2388
+ );
2389
+ }
2390
+ function getReleaseConfig(projectGraph, releaseConfig, workspaceConfig, ignoreNxJsonConfig = false) {
2391
+ let nxJson$1 = {};
2392
+ if (!ignoreNxJsonConfig && fs.existsSync(joinPaths(workspaceConfig.workspaceRoot, "nx.json"))) {
2393
+ nxJson$1 = nxJson.readNxJson();
2394
+ }
2395
+ const baseConfig = defu3__default.default(
2396
+ {
2397
+ changelog: {
2398
+ renderOptions: {
2399
+ workspaceConfig
2400
+ }
2401
+ },
2402
+ groups: {}
2403
+ },
2404
+ omit(releaseConfig, ["groups"]),
2405
+ nxJson$1.release ? omit(nxJson$1.release, ["groups"]) : {},
2406
+ omit(DEFAULT_RELEASE_CONFIG, ["groups"])
2407
+ );
2408
+ let groups = {};
2409
+ if (releaseConfig?.groups && Object.keys(releaseConfig.groups).length > 0) {
2410
+ groups = releaseConfig.groups;
2411
+ if (nxJson$1.release?.groups && Object.keys(nxJson$1.release.groups).length > 0) {
2412
+ groups = defu3__default.default(
2413
+ groups,
2414
+ nxJson$1.release.groups
2415
+ );
2416
+ }
2417
+ } else if (nxJson$1.release?.groups && Object.keys(nxJson$1.release.groups).length > 0) {
2418
+ groups = nxJson$1.release.groups;
2419
+ } else {
2420
+ groups = DEFAULT_RELEASE_CONFIG.groups;
2421
+ }
2422
+ return {
2423
+ ...baseConfig,
2424
+ groups: getReleaseGroupConfig(
2425
+ projectGraph,
2426
+ { ...baseConfig, groups },
2427
+ workspaceConfig
2428
+ )
2429
+ };
2430
+ }
2431
+ function formatConfigLog(config) {
2432
+ return chunk7LF2JPA5_cjs.formatLogMessage(config, {
2433
+ sort: true,
2434
+ skip: ["workspaceConfig", "conventionalCommits"]
2435
+ });
2436
+ }
2437
+
2438
+ exports.DEFAULT_CHANGELOG_RELEASE_CONFIG = DEFAULT_CHANGELOG_RELEASE_CONFIG;
2439
+ exports.DEFAULT_COMMIT_MESSAGE = DEFAULT_COMMIT_MESSAGE;
2440
+ exports.DEFAULT_CONVENTIONAL_COMMITS_CONFIG = DEFAULT_CONVENTIONAL_COMMITS_CONFIG2;
2441
+ exports.DEFAULT_FIXED_RELEASE_GROUP_CONFIG = DEFAULT_FIXED_RELEASE_GROUP_CONFIG;
2442
+ exports.DEFAULT_FIXED_RELEASE_TAG_PATTERN = DEFAULT_FIXED_RELEASE_TAG_PATTERN;
2443
+ exports.DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG = DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG;
2444
+ exports.DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN = DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN;
2445
+ exports.DEFAULT_JS_RELEASE_GROUP_CONFIG = DEFAULT_JS_RELEASE_GROUP_CONFIG;
2446
+ exports.DEFAULT_RELEASE_CONFIG = DEFAULT_RELEASE_CONFIG;
2447
+ exports.DEFAULT_RELEASE_GROUP_CONFIG = DEFAULT_RELEASE_GROUP_CONFIG;
2448
+ exports.DEFAULT_RELEASE_GROUP_GIT_CONFIG = DEFAULT_RELEASE_GROUP_GIT_CONFIG;
2449
+ exports.DEFAULT_RUST_RELEASE_GROUP_CONFIG = DEFAULT_RUST_RELEASE_GROUP_CONFIG;
2450
+ exports.DEFAULT_VERSION_RELEASE_CONFIG = DEFAULT_VERSION_RELEASE_CONFIG;
2451
+ exports.formatConfigLog = formatConfigLog;
2452
+ exports.getReleaseConfig = getReleaseConfig;
2453
+ exports.getReleaseGroupConfig = getReleaseGroupConfig;
2454
+ exports.mergeReleaseGroupConfig = mergeReleaseGroupConfig;