@storm-software/tsup 0.2.218 → 0.2.220

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -33,16 +33,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
42
42
 
43
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-BYH4XDRH.js
43
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-BYH4XDRH.js
44
44
  var require_chunk_BYH4XDRH = __commonJS({
45
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-BYH4XDRH.js"(exports2) {
45
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-BYH4XDRH.js"(exports2) {
46
46
  "use strict";
47
47
  init_cjs_shims();
48
48
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -51,9 +51,9 @@ var require_chunk_BYH4XDRH = __commonJS({
51
51
  }
52
52
  });
53
53
 
54
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-TWFEYLU4.js
54
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-TWFEYLU4.js
55
55
  var require_chunk_TWFEYLU4 = __commonJS({
56
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-TWFEYLU4.js"(exports2) {
56
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-TWFEYLU4.js"(exports2) {
57
57
  "use strict";
58
58
  init_cjs_shims();
59
59
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -430,9 +430,9 @@ var require_chunk_TWFEYLU4 = __commonJS({
430
430
  }
431
431
  });
432
432
 
433
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-VGC3FXLU.js
433
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-VGC3FXLU.js
434
434
  var require_chunk_VGC3FXLU = __commonJS({
435
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-VGC3FXLU.js"(exports2) {
435
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-VGC3FXLU.js"(exports2) {
436
436
  "use strict";
437
437
  init_cjs_shims();
438
438
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -659,9 +659,9 @@ var require_chunk_VGC3FXLU = __commonJS({
659
659
  }
660
660
  });
661
661
 
662
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-JZ25TPTY.js
662
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-JZ25TPTY.js
663
663
  var require_chunk_JZ25TPTY = __commonJS({
664
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/chunk-JZ25TPTY.js"(exports2) {
664
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/chunk-JZ25TPTY.js"(exports2) {
665
665
  "use strict";
666
666
  init_cjs_shims();
667
667
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -710,9 +710,9 @@ var require_chunk_JZ25TPTY = __commonJS({
710
710
  }
711
711
  });
712
712
 
713
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/commonjs-plugin.js
713
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/commonjs-plugin.js
714
714
  var require_commonjs_plugin = __commonJS({
715
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/commonjs-plugin.js"(exports2, module2) {
715
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/commonjs-plugin.js"(exports2, module2) {
716
716
  "use strict";
717
717
  init_cjs_shims();
718
718
  var __defProp2 = Object.defineProperty;
@@ -1041,9 +1041,9 @@ var require_commonjs_plugin = __commonJS({
1041
1041
  }
1042
1042
  });
1043
1043
 
1044
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/index.js
1044
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/index.js
1045
1045
  var require_dist = __commonJS({
1046
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__224d245c4beea59ebec1ed6c996eeea5/node_modules/tsup/dist/index.js"(exports2) {
1046
+ "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__502c9c9f830169d345413f684c5c8280/node_modules/tsup/dist/index.js"(exports2) {
1047
1047
  "use strict";
1048
1048
  init_cjs_shims();
1049
1049
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -2705,7 +2705,7 @@ init_cjs_shims();
2705
2705
  // ../config-tools/dist/logger/console.js
2706
2706
  init_cjs_shims();
2707
2707
 
2708
- // ../config-tools/dist/chunk-EN32U2DR.js
2708
+ // ../config-tools/dist/chunk-ZG3KCER4.js
2709
2709
  init_cjs_shims();
2710
2710
 
2711
2711
  // ../config-tools/dist/chunk-5DQF4GNF.js
@@ -2749,15 +2749,55 @@ var DEFAULT_COLOR_CONFIG = {
2749
2749
  }
2750
2750
  };
2751
2751
 
2752
- // ../config-tools/dist/chunk-JZAYHDV3.js
2752
+ // ../config-tools/dist/chunk-HVVJHTFS.js
2753
2753
  init_cjs_shims();
2754
- var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
2755
- return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
2754
+ var import_chalk = __toESM(require("chalk"), 1);
2755
+ var chalkDefault = {
2756
+ hex: (_3) => (message) => message,
2757
+ bgHex: (_3) => ({
2758
+ whiteBright: (message) => message,
2759
+ white: (message) => message
2760
+ }),
2761
+ white: (message) => message,
2762
+ whiteBright: (message) => message,
2763
+ gray: (message) => message,
2764
+ bold: {
2765
+ hex: (_3) => (message) => message,
2766
+ bgHex: (_3) => ({
2767
+ whiteBright: (message) => message,
2768
+ white: (message) => message
2769
+ }),
2770
+ whiteBright: (message) => message,
2771
+ white: (message) => message
2772
+ },
2773
+ dim: {
2774
+ hex: (_3) => (message) => message,
2775
+ gray: (message) => message
2776
+ }
2777
+ };
2778
+ var getChalk = () => {
2779
+ let _chalk = import_chalk.default;
2780
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
2781
+ _chalk = chalkDefault;
2782
+ }
2783
+ return _chalk;
2756
2784
  };
2757
2785
 
2758
- // ../config-tools/dist/chunk-SXPH7ILL.js
2786
+ // ../config-tools/dist/chunk-ZFNAUMQS.js
2759
2787
  init_cjs_shims();
2760
2788
 
2789
+ // ../config-tools/dist/chunk-G2MK47WL.js
2790
+ init_cjs_shims();
2791
+ function isUnicodeSupported() {
2792
+ if (process.platform !== "win32") {
2793
+ return process.env.TERM !== "linux";
2794
+ }
2795
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
2796
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
2797
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
2798
+ process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2799
+ }
2800
+
2761
2801
  // ../config-tools/dist/chunk-RALMUN5C.js
2762
2802
  init_cjs_shims();
2763
2803
  var LogLevel = {
@@ -2785,7 +2825,28 @@ var LogLevelLabel = {
2785
2825
  ALL: "all"
2786
2826
  };
2787
2827
 
2828
+ // ../config-tools/dist/chunk-ZFNAUMQS.js
2829
+ var useIcon = (c3, fallback) => isUnicodeSupported() ? c3 : fallback;
2830
+ var CONSOLE_ICONS = {
2831
+ [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
2832
+ [LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
2833
+ [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
2834
+ [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
2835
+ [LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
2836
+ [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
2837
+ [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
2838
+ [LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
2839
+ [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
2840
+ };
2841
+
2842
+ // ../config-tools/dist/chunk-JZAYHDV3.js
2843
+ init_cjs_shims();
2844
+ var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
2845
+ return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
2846
+ };
2847
+
2788
2848
  // ../config-tools/dist/chunk-SXPH7ILL.js
2849
+ init_cjs_shims();
2789
2850
  var getLogLevel = (label) => {
2790
2851
  switch (label) {
2791
2852
  case "all":
@@ -2841,70 +2902,7 @@ var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
2841
2902
  return LogLevelLabel.INFO;
2842
2903
  };
2843
2904
 
2844
- // ../config-tools/dist/chunk-HVVJHTFS.js
2845
- init_cjs_shims();
2846
- var import_chalk = __toESM(require("chalk"), 1);
2847
- var chalkDefault = {
2848
- hex: (_3) => (message) => message,
2849
- bgHex: (_3) => ({
2850
- whiteBright: (message) => message,
2851
- white: (message) => message
2852
- }),
2853
- white: (message) => message,
2854
- whiteBright: (message) => message,
2855
- gray: (message) => message,
2856
- bold: {
2857
- hex: (_3) => (message) => message,
2858
- bgHex: (_3) => ({
2859
- whiteBright: (message) => message,
2860
- white: (message) => message
2861
- }),
2862
- whiteBright: (message) => message,
2863
- white: (message) => message
2864
- },
2865
- dim: {
2866
- hex: (_3) => (message) => message,
2867
- gray: (message) => message
2868
- }
2869
- };
2870
- var getChalk = () => {
2871
- let _chalk = import_chalk.default;
2872
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
2873
- _chalk = chalkDefault;
2874
- }
2875
- return _chalk;
2876
- };
2877
-
2878
- // ../config-tools/dist/chunk-ZFNAUMQS.js
2879
- init_cjs_shims();
2880
-
2881
- // ../config-tools/dist/chunk-G2MK47WL.js
2882
- init_cjs_shims();
2883
- function isUnicodeSupported() {
2884
- if (process.platform !== "win32") {
2885
- return process.env.TERM !== "linux";
2886
- }
2887
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
2888
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
2889
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
2890
- process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2891
- }
2892
-
2893
- // ../config-tools/dist/chunk-ZFNAUMQS.js
2894
- var useIcon = (c3, fallback) => isUnicodeSupported() ? c3 : fallback;
2895
- var CONSOLE_ICONS = {
2896
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
2897
- [LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
2898
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
2899
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
2900
- [LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
2901
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
2902
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
2903
- [LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
2904
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
2905
- };
2906
-
2907
- // ../config-tools/dist/chunk-EN32U2DR.js
2905
+ // ../config-tools/dist/chunk-ZG3KCER4.js
2908
2906
  var daysInYear = 365.2425;
2909
2907
  var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
2910
2908
  var minTime = -maxTime;
@@ -4543,15 +4541,41 @@ var import_path = require("path");
4543
4541
  // ../config-tools/dist/get-config.js
4544
4542
  init_cjs_shims();
4545
4543
 
4546
- // ../config-tools/dist/chunk-L6MSRILP.js
4544
+ // ../config-tools/dist/chunk-RL5DRDS6.js
4547
4545
  init_cjs_shims();
4548
4546
 
4549
- // ../config-tools/dist/chunk-IASBTY6Z.js
4547
+ // ../config-tools/dist/chunk-6VD3CYGA.js
4550
4548
  init_cjs_shims();
4551
4549
 
4552
- // ../config-tools/dist/chunk-SDSQ2HHF.js
4550
+ // ../config-tools/dist/chunk-KVJGV2WN.js
4551
+ init_cjs_shims();
4552
+
4553
+ // ../config-tools/dist/chunk-LF3SAK2O.js
4553
4554
  init_cjs_shims();
4554
4555
 
4556
+ // ../config-tools/dist/chunk-RUKM6FCF.js
4557
+ init_cjs_shims();
4558
+ var import_node_fs7 = require("fs");
4559
+ var import_node_path4 = require("path");
4560
+ var MAX_PATH_SEARCH_DEPTH = 30;
4561
+ var depth = 0;
4562
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
4563
+ const _startPath = startPath ?? process.cwd();
4564
+ if (endDirectoryNames.some(
4565
+ (endDirName) => (0, import_node_fs7.existsSync)((0, import_node_path4.join)(_startPath, endDirName))
4566
+ )) {
4567
+ return _startPath;
4568
+ }
4569
+ if (endFileNames.some((endFileName) => (0, import_node_fs7.existsSync)((0, import_node_path4.join)(_startPath, endFileName)))) {
4570
+ return _startPath;
4571
+ }
4572
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
4573
+ const parent = (0, import_node_path4.join)(_startPath, "..");
4574
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
4575
+ }
4576
+ return void 0;
4577
+ }
4578
+
4555
4579
  // ../config-tools/dist/chunk-V3GMJ4TX.js
4556
4580
  init_cjs_shims();
4557
4581
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
@@ -4678,388 +4702,156 @@ var isAbsolute = function(p3) {
4678
4702
  return _IS_ABSOLUTE_RE.test(p3);
4679
4703
  };
4680
4704
 
4681
- // ../config-tools/dist/chunk-SDSQ2HHF.js
4682
- var setExtensionEnv = (extensionName, extension) => {
4683
- for (const key of Object.keys(extension ?? {})) {
4684
- if (extension[key]) {
4685
- const result = key?.replace(
4686
- /([A-Z])+/g,
4687
- (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
4688
- ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
4689
- let extensionKey;
4690
- if (result.length === 0) {
4691
- return;
4692
- }
4693
- if (result.length === 1) {
4694
- extensionKey = result[0]?.toUpperCase() ?? "";
4695
- } else {
4696
- extensionKey = result.reduce((ret, part) => {
4697
- return `${ret}_${part.toLowerCase()}`;
4698
- });
4699
- }
4700
- process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
4701
- }
4702
- }
4703
- };
4704
- var setConfigEnv = (config) => {
4705
- const prefix = "STORM_";
4706
- if (config.extends) {
4707
- process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
4705
+ // ../config-tools/dist/chunk-LF3SAK2O.js
4706
+ var rootFiles = [
4707
+ "storm-workspace.json",
4708
+ "storm-workspace.yaml",
4709
+ "storm-workspace.yml",
4710
+ "storm-workspace.js",
4711
+ "storm-workspace.ts",
4712
+ ".storm-workspace.json",
4713
+ ".storm-workspace.yaml",
4714
+ ".storm-workspace.yml",
4715
+ ".storm-workspace.js",
4716
+ ".storm-workspace.ts",
4717
+ "lerna.json",
4718
+ "nx.json",
4719
+ "turbo.json",
4720
+ "npm-workspace.json",
4721
+ "yarn-workspace.json",
4722
+ "pnpm-workspace.json",
4723
+ "npm-workspace.yaml",
4724
+ "yarn-workspace.yaml",
4725
+ "pnpm-workspace.yaml",
4726
+ "npm-workspace.yml",
4727
+ "yarn-workspace.yml",
4728
+ "pnpm-workspace.yml",
4729
+ "npm-lock.json",
4730
+ "yarn-lock.json",
4731
+ "pnpm-lock.json",
4732
+ "npm-lock.yaml",
4733
+ "yarn-lock.yaml",
4734
+ "pnpm-lock.yaml",
4735
+ "npm-lock.yml",
4736
+ "yarn-lock.yml",
4737
+ "pnpm-lock.yml",
4738
+ "bun.lockb"
4739
+ ];
4740
+ var rootDirectories = [
4741
+ ".storm-workspace",
4742
+ ".nx",
4743
+ ".git",
4744
+ ".github",
4745
+ ".vscode",
4746
+ ".verdaccio"
4747
+ ];
4748
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
4749
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
4750
+ return correctPaths2(
4751
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
4752
+ );
4708
4753
  }
4709
- if (config.name) {
4710
- process.env[`${prefix}NAME`] = config.name;
4754
+ return correctPaths2(
4755
+ findFolderUp(
4756
+ pathInsideMonorepo ?? process.cwd(),
4757
+ rootFiles,
4758
+ rootDirectories
4759
+ )
4760
+ );
4761
+ }
4762
+ function findWorkspaceRoot2(pathInsideMonorepo) {
4763
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
4764
+ if (!result) {
4765
+ throw new Error(
4766
+ `Cannot find workspace root upwards from known path. Files search list includes:
4767
+ ${rootFiles.join(
4768
+ "\n"
4769
+ )}
4770
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
4771
+ );
4711
4772
  }
4712
- if (config.variant) {
4713
- process.env[`${prefix}VARIANT`] = config.variant;
4714
- }
4715
- if (config.namespace) {
4716
- process.env[`${prefix}NAMESPACE`] = config.namespace;
4717
- }
4718
- if (config.owner) {
4719
- process.env[`${prefix}OWNER`] = config.owner;
4720
- }
4721
- if (config.bot) {
4722
- process.env[`${prefix}BOT_NAME`] = config.bot.name;
4723
- process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
4724
- }
4725
- if (config.error) {
4726
- process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
4727
- process.env[`${prefix}ERROR_URL`] = config.error.url;
4728
- }
4729
- if (config.release) {
4730
- if (config.release.banner) {
4731
- if (typeof config.release.banner === "string") {
4732
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
4733
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
4734
- } else {
4735
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
4736
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
4737
- process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
4738
- }
4739
- }
4740
- process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
4741
- process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
4742
- }
4743
- if (config.socials) {
4744
- if (config.socials.twitter) {
4745
- process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
4746
- }
4747
- if (config.socials.discord) {
4748
- process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
4749
- }
4750
- if (config.socials.telegram) {
4751
- process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
4752
- }
4753
- if (config.socials.slack) {
4754
- process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
4755
- }
4756
- if (config.socials.medium) {
4757
- process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
4758
- }
4759
- if (config.socials.github) {
4760
- process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
4761
- }
4762
- }
4763
- if (config.organization) {
4764
- if (typeof config.organization === "string") {
4765
- process.env[`${prefix}ORG`] = config.organization;
4766
- process.env[`${prefix}ORG_NAME`] = config.organization;
4767
- process.env[`${prefix}ORGANIZATION`] = config.organization;
4768
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
4769
- } else {
4770
- process.env[`${prefix}ORG`] = config.organization.name;
4771
- process.env[`${prefix}ORG_NAME`] = config.organization.name;
4772
- process.env[`${prefix}ORGANIZATION`] = config.organization.name;
4773
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
4774
- if (config.organization.url) {
4775
- process.env[`${prefix}ORG_URL`] = config.organization.url;
4776
- process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
4777
- }
4778
- if (config.organization.description) {
4779
- process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
4780
- process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
4781
- }
4782
- if (config.organization.logo) {
4783
- process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
4784
- process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
4785
- }
4786
- if (config.organization.icon) {
4787
- process.env[`${prefix}ORG_ICON`] = config.organization.icon;
4788
- process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
4773
+ return result;
4774
+ }
4775
+
4776
+ // ../config-tools/dist/chunk-KVJGV2WN.js
4777
+ var import_c122 = require("c12");
4778
+ var import_defu3 = __toESM(require("defu"), 1);
4779
+ var getConfigFileByName = async (fileName, filePath, options2 = {}) => {
4780
+ const workspacePath = filePath || findWorkspaceRoot2(filePath);
4781
+ const configs = await Promise.all([
4782
+ (0, import_c122.loadConfig)({
4783
+ cwd: workspacePath,
4784
+ packageJson: true,
4785
+ name: fileName,
4786
+ envName: fileName?.toUpperCase(),
4787
+ jitiOptions: {
4788
+ debug: false,
4789
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
4790
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
4791
+ "jiti"
4792
+ )
4793
+ },
4794
+ ...options2
4795
+ }),
4796
+ (0, import_c122.loadConfig)({
4797
+ cwd: workspacePath,
4798
+ packageJson: true,
4799
+ name: fileName,
4800
+ envName: fileName?.toUpperCase(),
4801
+ jitiOptions: {
4802
+ debug: false,
4803
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
4804
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
4805
+ "jiti"
4806
+ )
4807
+ },
4808
+ configFile: fileName,
4809
+ ...options2
4810
+ })
4811
+ ]);
4812
+ return (0, import_defu3.default)(configs[0] ?? {}, configs[1] ?? {});
4813
+ };
4814
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
4815
+ const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
4816
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
4817
+ let config = result.config;
4818
+ const configFile = result.configFile;
4819
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
4820
+ writeTrace(
4821
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
4822
+ {
4823
+ logLevel: "all"
4789
4824
  }
4790
- }
4791
- }
4792
- if (config.packageManager) {
4793
- process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
4794
- }
4795
- if (config.license) {
4796
- process.env[`${prefix}LICENSE`] = config.license;
4797
- }
4798
- if (config.homepage) {
4799
- process.env[`${prefix}HOMEPAGE`] = config.homepage;
4800
- }
4801
- if (config.docs) {
4802
- process.env[`${prefix}DOCS`] = config.docs;
4803
- }
4804
- if (config.portal) {
4805
- process.env[`${prefix}PORTAL`] = config.portal;
4806
- }
4807
- if (config.licensing) {
4808
- process.env[`${prefix}LICENSING`] = config.licensing;
4809
- }
4810
- if (config.contact) {
4811
- process.env[`${prefix}CONTACT`] = config.contact;
4812
- }
4813
- if (config.support) {
4814
- process.env[`${prefix}SUPPORT`] = config.support;
4815
- }
4816
- if (config.timezone) {
4817
- process.env[`${prefix}TIMEZONE`] = config.timezone;
4818
- process.env.TZ = config.timezone;
4819
- process.env.DEFAULT_TIMEZONE = config.timezone;
4820
- process.env.TIMEZONE = config.timezone;
4821
- }
4822
- if (config.locale) {
4823
- process.env[`${prefix}LOCALE`] = config.locale;
4824
- process.env.DEFAULT_LOCALE = config.locale;
4825
- process.env.LOCALE = config.locale;
4826
- process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
4827
- }
4828
- if (config.configFile) {
4829
- process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths2(
4830
- config.configFile
4831
- );
4832
- }
4833
- if (config.workspaceRoot) {
4834
- process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths2(config.workspaceRoot);
4835
- process.env.NX_WORKSPACE_ROOT = correctPaths2(config.workspaceRoot);
4836
- process.env.NX_WORKSPACE_ROOT_PATH = correctPaths2(config.workspaceRoot);
4837
- }
4838
- if (config.directories) {
4839
- if (!config.skipCache && config.directories.cache) {
4840
- process.env[`${prefix}CACHE_DIR`] = correctPaths2(
4841
- config.directories.cache
4842
- );
4843
- process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
4844
- }
4845
- if (config.directories.data) {
4846
- process.env[`${prefix}DATA_DIR`] = correctPaths2(config.directories.data);
4847
- process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
4848
- }
4849
- if (config.directories.config) {
4850
- process.env[`${prefix}CONFIG_DIR`] = correctPaths2(
4851
- config.directories.config
4852
- );
4853
- process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
4854
- }
4855
- if (config.directories.temp) {
4856
- process.env[`${prefix}TEMP_DIR`] = correctPaths2(config.directories.temp);
4857
- process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
4858
- }
4859
- if (config.directories.log) {
4860
- process.env[`${prefix}LOG_DIR`] = correctPaths2(config.directories.log);
4861
- process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
4862
- }
4863
- if (config.directories.build) {
4864
- process.env[`${prefix}BUILD_DIR`] = correctPaths2(
4865
- config.directories.build
4866
- );
4867
- process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
4868
- }
4869
- }
4870
- if (config.skipCache !== void 0) {
4871
- process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
4872
- if (config.skipCache) {
4873
- process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
4874
- process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
4875
- }
4876
- }
4877
- if (config.mode) {
4878
- process.env[`${prefix}MODE`] = config.mode;
4879
- process.env.NODE_ENV = config.mode;
4880
- process.env.ENVIRONMENT = config.mode;
4881
- }
4882
- if (config.colors?.base?.light || config.colors?.base?.dark) {
4883
- for (const key of Object.keys(config.colors)) {
4884
- setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
4885
- }
4886
- } else {
4887
- setThemeColorsEnv(
4888
- `${prefix}COLOR_`,
4889
- config.colors
4890
- );
4891
- }
4892
- if (config.repository) {
4893
- process.env[`${prefix}REPOSITORY`] = config.repository;
4894
- }
4895
- if (config.branch) {
4896
- process.env[`${prefix}BRANCH`] = config.branch;
4897
- }
4898
- if (config.preid) {
4899
- process.env[`${prefix}PRE_ID`] = String(config.preid);
4900
- }
4901
- if (config.registry) {
4902
- if (config.registry.github) {
4903
- process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
4904
- }
4905
- if (config.registry.npm) {
4906
- process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
4907
- }
4908
- if (config.registry.cargo) {
4909
- process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
4910
- }
4911
- if (config.registry.cyclone) {
4912
- process.env[`${prefix}REGISTRY_CYCLONE`] = String(
4913
- config.registry.cyclone
4914
- );
4915
- }
4916
- if (config.registry.container) {
4917
- process.env[`${prefix}REGISTRY_CONTAINER`] = String(
4918
- config.registry.container
4919
- );
4920
- }
4921
- }
4922
- if (config.logLevel) {
4923
- process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
4924
- process.env.LOG_LEVEL = String(config.logLevel);
4925
- process.env.NX_VERBOSE_LOGGING = String(
4926
- getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
4927
4825
  );
4928
- process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
4929
4826
  }
4930
- if (config.skipConfigLogging !== void 0) {
4931
- process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
4932
- config.skipConfigLogging
4827
+ if (additionalFileNames && additionalFileNames.length > 0) {
4828
+ const results = await Promise.all(
4829
+ additionalFileNames.map(
4830
+ (fileName) => getConfigFileByName(fileName, workspacePath)
4831
+ )
4933
4832
  );
4934
- }
4935
- process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
4936
- for (const key of Object.keys(config.extensions ?? {})) {
4937
- if (config.extensions[key] && Object.keys(config.extensions[key])) {
4938
- setExtensionEnv(key, config.extensions[key]);
4939
- }
4940
- }
4941
- };
4942
- var setThemeColorsEnv = (prefix, config) => {
4943
- return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
4944
- };
4945
- var setSingleThemeColorsEnv = (prefix, config) => {
4946
- if (config.dark) {
4947
- process.env[`${prefix}DARK`] = config.dark;
4948
- }
4949
- if (config.light) {
4950
- process.env[`${prefix}LIGHT`] = config.light;
4951
- }
4952
- if (config.brand) {
4953
- process.env[`${prefix}BRAND`] = config.brand;
4954
- }
4955
- if (config.alternate) {
4956
- process.env[`${prefix}ALTERNATE`] = config.alternate;
4957
- }
4958
- if (config.accent) {
4959
- process.env[`${prefix}ACCENT`] = config.accent;
4960
- }
4961
- if (config.link) {
4962
- process.env[`${prefix}LINK`] = config.link;
4963
- }
4964
- if (config.help) {
4965
- process.env[`${prefix}HELP`] = config.help;
4966
- }
4967
- if (config.success) {
4968
- process.env[`${prefix}SUCCESS`] = config.success;
4969
- }
4970
- if (config.info) {
4971
- process.env[`${prefix}INFO`] = config.info;
4972
- }
4973
- if (config.debug) {
4974
- process.env[`${prefix}DEBUG`] = config.debug;
4975
- }
4976
- if (config.warning) {
4977
- process.env[`${prefix}WARNING`] = config.warning;
4978
- }
4979
- if (config.danger) {
4980
- process.env[`${prefix}DANGER`] = config.danger;
4981
- }
4982
- if (config.fatal) {
4983
- process.env[`${prefix}FATAL`] = config.fatal;
4984
- }
4985
- if (config.performance) {
4986
- process.env[`${prefix}PERFORMANCE`] = config.performance;
4987
- }
4988
- if (config.positive) {
4989
- process.env[`${prefix}POSITIVE`] = config.positive;
4990
- }
4991
- if (config.negative) {
4992
- process.env[`${prefix}NEGATIVE`] = config.negative;
4993
- }
4994
- if (config.gradient) {
4995
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
4996
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
4833
+ for (const result2 of results) {
4834
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
4835
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
4836
+ writeTrace(
4837
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
4838
+ {
4839
+ logLevel: "all"
4840
+ }
4841
+ );
4842
+ }
4843
+ config = (0, import_defu3.default)(result2.config ?? {}, config ?? {});
4844
+ }
4997
4845
  }
4998
4846
  }
4999
- };
5000
- var setMultiThemeColorsEnv = (prefix, config) => {
5001
- return {
5002
- light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
5003
- dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
5004
- };
5005
- };
5006
- var setBaseThemeColorsEnv = (prefix, config) => {
5007
- if (config.foreground) {
5008
- process.env[`${prefix}FOREGROUND`] = config.foreground;
5009
- }
5010
- if (config.background) {
5011
- process.env[`${prefix}BACKGROUND`] = config.background;
5012
- }
5013
- if (config.brand) {
5014
- process.env[`${prefix}BRAND`] = config.brand;
5015
- }
5016
- if (config.alternate) {
5017
- process.env[`${prefix}ALTERNATE`] = config.alternate;
5018
- }
5019
- if (config.accent) {
5020
- process.env[`${prefix}ACCENT`] = config.accent;
5021
- }
5022
- if (config.link) {
5023
- process.env[`${prefix}LINK`] = config.link;
5024
- }
5025
- if (config.help) {
5026
- process.env[`${prefix}HELP`] = config.help;
5027
- }
5028
- if (config.success) {
5029
- process.env[`${prefix}SUCCESS`] = config.success;
5030
- }
5031
- if (config.info) {
5032
- process.env[`${prefix}INFO`] = config.info;
5033
- }
5034
- if (config.debug) {
5035
- process.env[`${prefix}DEBUG`] = config.debug;
5036
- }
5037
- if (config.warning) {
5038
- process.env[`${prefix}WARNING`] = config.warning;
5039
- }
5040
- if (config.danger) {
5041
- process.env[`${prefix}DANGER`] = config.danger;
5042
- }
5043
- if (config.fatal) {
5044
- process.env[`${prefix}FATAL`] = config.fatal;
5045
- }
5046
- if (config.performance) {
5047
- process.env[`${prefix}PERFORMANCE`] = config.performance;
5048
- }
5049
- if (config.positive) {
5050
- process.env[`${prefix}POSITIVE`] = config.positive;
5051
- }
5052
- if (config.negative) {
5053
- process.env[`${prefix}NEGATIVE`] = config.negative;
5054
- }
5055
- if (config.gradient) {
5056
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
5057
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
5058
- }
4847
+ if (!config || Object.keys(config).length === 0) {
4848
+ return void 0;
5059
4849
  }
4850
+ config.configFile = configFile;
4851
+ return config;
5060
4852
  };
5061
4853
 
5062
- // ../config-tools/dist/chunk-A5JXMY6X.js
4854
+ // ../config-tools/dist/chunk-RGET2UQV.js
5063
4855
  init_cjs_shims();
5064
4856
 
5065
4857
  // ../config/dist/index.js
@@ -5262,496 +5054,700 @@ o2.add(x, { description: "Configuration of each used extension" });
5262
5054
  var Ne = e2.object({ $schema: se, extends: _, name: ne, variant: K, namespace: de, organization: pe, repository: he, license: le, homepage: me, docs: ze, portal: ge, licensing: fe, contact: ue, support: ke, branch: we, preid: Se, owner: be, bot: A2, release: N, socials: J, error: ee, mode: xe, workspaceRoot: Te, skipCache: ve, directories: q, packageManager: ye, timezone: Ce, locale: _e, logLevel: Le, skipConfigLogging: je, registry: y, configFile: Ae, colors: e2.union([b, C]), extensions: x });
5263
5055
  o2.add(x, { 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." });
5264
5056
 
5265
- // ../config/dist/chunk-YKRE3MWC.js
5057
+ // ../config/dist/chunk-YKRE3MWC.js
5058
+ init_cjs_shims();
5059
+ var e3 = ["dark", "light", "base", "brand", "alternate", "accent", "link", "success", "help", "info", "warning", "danger", "fatal", "performance", "positive", "negative"];
5060
+
5061
+ // ../config-tools/dist/chunk-RGET2UQV.js
5062
+ var import_node_fs8 = require("fs");
5063
+ var import_promises5 = require("fs/promises");
5064
+ var import_node_path5 = require("path");
5065
+ async function getPackageJsonConfig(root) {
5066
+ let license = i;
5067
+ let homepage = void 0;
5068
+ let support = void 0;
5069
+ let name = void 0;
5070
+ let namespace = void 0;
5071
+ let repository = void 0;
5072
+ const workspaceRoot = findWorkspaceRoot2(root);
5073
+ if ((0, import_node_fs8.existsSync)((0, import_node_path5.join)(workspaceRoot, "package.json"))) {
5074
+ const file = await (0, import_promises5.readFile)(
5075
+ joinPaths2(workspaceRoot, "package.json"),
5076
+ "utf8"
5077
+ );
5078
+ if (file) {
5079
+ const packageJson = JSON.parse(file);
5080
+ if (packageJson.name) {
5081
+ name = packageJson.name;
5082
+ }
5083
+ if (packageJson.namespace) {
5084
+ namespace = packageJson.namespace;
5085
+ }
5086
+ if (packageJson.repository) {
5087
+ if (typeof packageJson.repository === "string") {
5088
+ repository = packageJson.repository;
5089
+ } else if (packageJson.repository.url) {
5090
+ repository = packageJson.repository.url;
5091
+ }
5092
+ }
5093
+ if (packageJson.license) {
5094
+ license = packageJson.license;
5095
+ }
5096
+ if (packageJson.homepage) {
5097
+ homepage = packageJson.homepage;
5098
+ }
5099
+ if (packageJson.bugs) {
5100
+ if (typeof packageJson.bugs === "string") {
5101
+ support = packageJson.bugs;
5102
+ } else if (packageJson.bugs.url) {
5103
+ support = packageJson.bugs.url;
5104
+ }
5105
+ }
5106
+ }
5107
+ }
5108
+ return {
5109
+ workspaceRoot,
5110
+ name,
5111
+ namespace,
5112
+ repository,
5113
+ license,
5114
+ homepage,
5115
+ support
5116
+ };
5117
+ }
5118
+ function applyDefaultConfig(config) {
5119
+ if (!config.support && config.contact) {
5120
+ config.support = config.contact;
5121
+ }
5122
+ if (!config.contact && config.support) {
5123
+ config.contact = config.support;
5124
+ }
5125
+ if (config.homepage) {
5126
+ if (!config.docs) {
5127
+ config.docs = `${config.homepage}/docs`;
5128
+ }
5129
+ if (!config.license) {
5130
+ config.license = `${config.homepage}/license`;
5131
+ }
5132
+ if (!config.support) {
5133
+ config.support = `${config.homepage}/support`;
5134
+ }
5135
+ if (!config.contact) {
5136
+ config.contact = `${config.homepage}/contact`;
5137
+ }
5138
+ if (!config.error?.codesFile || !config?.error?.url) {
5139
+ config.error ??= { codesFile: S };
5140
+ if (config.homepage) {
5141
+ config.error.url ??= `${config.homepage}/errors`;
5142
+ }
5143
+ }
5144
+ }
5145
+ return config;
5146
+ }
5147
+
5148
+ // ../config-tools/dist/chunk-SDSQ2HHF.js
5266
5149
  init_cjs_shims();
5267
- var e3 = ["dark", "light", "base", "brand", "alternate", "accent", "link", "success", "help", "info", "warning", "danger", "fatal", "performance", "positive", "negative"];
5268
-
5269
- // ../config-tools/dist/chunk-A5JXMY6X.js
5270
- var getExtensionEnv = (extensionName) => {
5271
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
5272
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
5273
- const name = key.replace(prefix, "").split("_").map(
5274
- (i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
5275
- ).join("");
5276
- if (name) {
5277
- ret[name] = process.env[key];
5150
+ var setExtensionEnv = (extensionName, extension) => {
5151
+ for (const key of Object.keys(extension ?? {})) {
5152
+ if (extension[key]) {
5153
+ const result = key?.replace(
5154
+ /([A-Z])+/g,
5155
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
5156
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
5157
+ let extensionKey;
5158
+ if (result.length === 0) {
5159
+ return;
5160
+ }
5161
+ if (result.length === 1) {
5162
+ extensionKey = result[0]?.toUpperCase() ?? "";
5163
+ } else {
5164
+ extensionKey = result.reduce((ret, part) => {
5165
+ return `${ret}_${part.toLowerCase()}`;
5166
+ });
5167
+ }
5168
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
5278
5169
  }
5279
- return ret;
5280
- }, {});
5170
+ }
5281
5171
  };
5282
- var getConfigEnv = () => {
5172
+ var setConfigEnv = (config) => {
5283
5173
  const prefix = "STORM_";
5284
- let config = {
5285
- extends: process.env[`${prefix}EXTENDS`] || void 0,
5286
- name: process.env[`${prefix}NAME`] || void 0,
5287
- variant: process.env[`${prefix}VARIANT`] || void 0,
5288
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
5289
- owner: process.env[`${prefix}OWNER`] || void 0,
5290
- bot: {
5291
- name: process.env[`${prefix}BOT_NAME`] || void 0,
5292
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
5293
- },
5294
- release: {
5295
- banner: {
5296
- url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
5297
- alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
5298
- },
5299
- header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
5300
- footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
5301
- },
5302
- error: {
5303
- codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
5304
- url: process.env[`${prefix}ERROR_URL`] || void 0
5305
- },
5306
- socials: {
5307
- twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
5308
- discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
5309
- telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
5310
- slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
5311
- medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
5312
- github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
5313
- },
5314
- 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`] ? {
5315
- name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
5316
- description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
5317
- url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
5318
- logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
5319
- icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
5320
- } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
5321
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
5322
- license: process.env[`${prefix}LICENSE`] || void 0,
5323
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
5324
- docs: process.env[`${prefix}DOCS`] || void 0,
5325
- portal: process.env[`${prefix}PORTAL`] || void 0,
5326
- licensing: process.env[`${prefix}LICENSING`] || void 0,
5327
- contact: process.env[`${prefix}CONTACT`] || void 0,
5328
- support: process.env[`${prefix}SUPPORT`] || void 0,
5329
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
5330
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
5331
- configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
5332
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
5333
- directories: {
5334
- cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths2(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths2(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
5335
- data: process.env[`${prefix}DATA_DIR`] ? correctPaths2(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths2(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
5336
- config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths2(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths2(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
5337
- temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths2(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths2(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
5338
- log: process.env[`${prefix}LOG_DIR`] ? correctPaths2(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths2(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
5339
- build: process.env[`${prefix}BUILD_DIR`] ? correctPaths2(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths2(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
5340
- },
5341
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
5342
- mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
5343
- // ci:
5344
- // process.env[`${prefix}CI`] !== undefined
5345
- // ? Boolean(
5346
- // process.env[`${prefix}CI`] ??
5347
- // process.env.CI ??
5348
- // process.env.CONTINUOUS_INTEGRATION
5349
- // )
5350
- // : undefined,
5351
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
5352
- branch: process.env[`${prefix}BRANCH`] || void 0,
5353
- preid: process.env[`${prefix}PRE_ID`] || void 0,
5354
- registry: {
5355
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
5356
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
5357
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
5358
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
5359
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
5360
- },
5361
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
5362
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
5363
- ) ? getLogLevelLabel(
5364
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
5365
- ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
5366
- skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
5367
- };
5368
- const themeNames = Object.keys(process.env).filter(
5369
- (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
5370
- (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
5371
- )
5372
- );
5373
- config.colors = themeNames.length > 0 ? themeNames.reduce(
5374
- (ret, themeName) => {
5375
- ret[themeName] = getThemeColorsEnv(prefix, themeName);
5376
- return ret;
5377
- },
5378
- {}
5379
- ) : getThemeColorsEnv(prefix);
5380
- if (config.docs === s) {
5381
- if (config.homepage === r) {
5382
- config.docs = `${r}/projects/${config.name}/docs`;
5174
+ if (config.extends) {
5175
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
5176
+ }
5177
+ if (config.name) {
5178
+ process.env[`${prefix}NAME`] = config.name;
5179
+ }
5180
+ if (config.variant) {
5181
+ process.env[`${prefix}VARIANT`] = config.variant;
5182
+ }
5183
+ if (config.namespace) {
5184
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
5185
+ }
5186
+ if (config.owner) {
5187
+ process.env[`${prefix}OWNER`] = config.owner;
5188
+ }
5189
+ if (config.bot) {
5190
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
5191
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
5192
+ }
5193
+ if (config.error) {
5194
+ process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
5195
+ process.env[`${prefix}ERROR_URL`] = config.error.url;
5196
+ }
5197
+ if (config.release) {
5198
+ if (config.release.banner) {
5199
+ if (typeof config.release.banner === "string") {
5200
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
5201
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
5202
+ } else {
5203
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
5204
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
5205
+ process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
5206
+ }
5207
+ }
5208
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
5209
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
5210
+ }
5211
+ if (config.socials) {
5212
+ if (config.socials.twitter) {
5213
+ process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
5214
+ }
5215
+ if (config.socials.discord) {
5216
+ process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
5217
+ }
5218
+ if (config.socials.telegram) {
5219
+ process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
5220
+ }
5221
+ if (config.socials.slack) {
5222
+ process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
5223
+ }
5224
+ if (config.socials.medium) {
5225
+ process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
5226
+ }
5227
+ if (config.socials.github) {
5228
+ process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
5229
+ }
5230
+ }
5231
+ if (config.organization) {
5232
+ if (typeof config.organization === "string") {
5233
+ process.env[`${prefix}ORG`] = config.organization;
5234
+ process.env[`${prefix}ORG_NAME`] = config.organization;
5235
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
5236
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
5383
5237
  } else {
5384
- config.docs = `${config.homepage}/docs`;
5238
+ process.env[`${prefix}ORG`] = config.organization.name;
5239
+ process.env[`${prefix}ORG_NAME`] = config.organization.name;
5240
+ process.env[`${prefix}ORGANIZATION`] = config.organization.name;
5241
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
5242
+ if (config.organization.url) {
5243
+ process.env[`${prefix}ORG_URL`] = config.organization.url;
5244
+ process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
5245
+ }
5246
+ if (config.organization.description) {
5247
+ process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
5248
+ process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
5249
+ }
5250
+ if (config.organization.logo) {
5251
+ process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
5252
+ process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
5253
+ }
5254
+ if (config.organization.icon) {
5255
+ process.env[`${prefix}ORG_ICON`] = config.organization.icon;
5256
+ process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
5257
+ }
5258
+ }
5259
+ }
5260
+ if (config.packageManager) {
5261
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
5262
+ }
5263
+ if (config.license) {
5264
+ process.env[`${prefix}LICENSE`] = config.license;
5265
+ }
5266
+ if (config.homepage) {
5267
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
5268
+ }
5269
+ if (config.docs) {
5270
+ process.env[`${prefix}DOCS`] = config.docs;
5271
+ }
5272
+ if (config.portal) {
5273
+ process.env[`${prefix}PORTAL`] = config.portal;
5274
+ }
5275
+ if (config.licensing) {
5276
+ process.env[`${prefix}LICENSING`] = config.licensing;
5277
+ }
5278
+ if (config.contact) {
5279
+ process.env[`${prefix}CONTACT`] = config.contact;
5280
+ }
5281
+ if (config.support) {
5282
+ process.env[`${prefix}SUPPORT`] = config.support;
5283
+ }
5284
+ if (config.timezone) {
5285
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
5286
+ process.env.TZ = config.timezone;
5287
+ process.env.DEFAULT_TIMEZONE = config.timezone;
5288
+ process.env.TIMEZONE = config.timezone;
5289
+ }
5290
+ if (config.locale) {
5291
+ process.env[`${prefix}LOCALE`] = config.locale;
5292
+ process.env.DEFAULT_LOCALE = config.locale;
5293
+ process.env.LOCALE = config.locale;
5294
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
5295
+ }
5296
+ if (config.configFile) {
5297
+ process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths2(
5298
+ config.configFile
5299
+ );
5300
+ }
5301
+ if (config.workspaceRoot) {
5302
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths2(config.workspaceRoot);
5303
+ process.env.NX_WORKSPACE_ROOT = correctPaths2(config.workspaceRoot);
5304
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths2(config.workspaceRoot);
5305
+ }
5306
+ if (config.directories) {
5307
+ if (!config.skipCache && config.directories.cache) {
5308
+ process.env[`${prefix}CACHE_DIR`] = correctPaths2(
5309
+ config.directories.cache
5310
+ );
5311
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
5312
+ }
5313
+ if (config.directories.data) {
5314
+ process.env[`${prefix}DATA_DIR`] = correctPaths2(config.directories.data);
5315
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
5316
+ }
5317
+ if (config.directories.config) {
5318
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths2(
5319
+ config.directories.config
5320
+ );
5321
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
5322
+ }
5323
+ if (config.directories.temp) {
5324
+ process.env[`${prefix}TEMP_DIR`] = correctPaths2(config.directories.temp);
5325
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
5326
+ }
5327
+ if (config.directories.log) {
5328
+ process.env[`${prefix}LOG_DIR`] = correctPaths2(config.directories.log);
5329
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
5330
+ }
5331
+ if (config.directories.build) {
5332
+ process.env[`${prefix}BUILD_DIR`] = correctPaths2(
5333
+ config.directories.build
5334
+ );
5335
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
5385
5336
  }
5386
5337
  }
5387
- if (config.licensing === a) {
5388
- if (config.homepage === r) {
5389
- config.licensing = `${r}/projects/${config.name}/licensing`;
5390
- } else {
5391
- config.licensing = `${config.homepage}/docs`;
5338
+ if (config.skipCache !== void 0) {
5339
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
5340
+ if (config.skipCache) {
5341
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
5342
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
5392
5343
  }
5393
5344
  }
5394
- const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
5395
- if (serializedConfig) {
5396
- const parsed = JSON.parse(serializedConfig);
5397
- config = {
5398
- ...config,
5399
- ...parsed,
5400
- colors: { ...config.colors, ...parsed.colors },
5401
- extensions: { ...config.extensions, ...parsed.extensions }
5402
- };
5345
+ if (config.mode) {
5346
+ process.env[`${prefix}MODE`] = config.mode;
5347
+ process.env.NODE_ENV = config.mode;
5348
+ process.env.ENVIRONMENT = config.mode;
5403
5349
  }
5404
- return config;
5405
- };
5406
- var getThemeColorsEnv = (prefix, theme) => {
5407
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
5408
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
5409
- };
5410
- var getSingleThemeColorsEnv = (prefix) => {
5411
- const gradient = [];
5412
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
5413
- gradient.push(
5414
- process.env[`${prefix}GRADIENT_START`],
5415
- process.env[`${prefix}GRADIENT_END`]
5350
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
5351
+ for (const key of Object.keys(config.colors)) {
5352
+ setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
5353
+ }
5354
+ } else {
5355
+ setThemeColorsEnv(
5356
+ `${prefix}COLOR_`,
5357
+ config.colors
5416
5358
  );
5417
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
5418
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
5419
- while (process.env[`${prefix}GRADIENT_${index}`]) {
5420
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
5421
- index++;
5359
+ }
5360
+ if (config.repository) {
5361
+ process.env[`${prefix}REPOSITORY`] = config.repository;
5362
+ }
5363
+ if (config.branch) {
5364
+ process.env[`${prefix}BRANCH`] = config.branch;
5365
+ }
5366
+ if (config.preid) {
5367
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
5368
+ }
5369
+ if (config.registry) {
5370
+ if (config.registry.github) {
5371
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
5372
+ }
5373
+ if (config.registry.npm) {
5374
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
5375
+ }
5376
+ if (config.registry.cargo) {
5377
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
5378
+ }
5379
+ if (config.registry.cyclone) {
5380
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
5381
+ config.registry.cyclone
5382
+ );
5383
+ }
5384
+ if (config.registry.container) {
5385
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
5386
+ config.registry.container
5387
+ );
5422
5388
  }
5423
5389
  }
5424
- return {
5425
- dark: process.env[`${prefix}DARK`],
5426
- light: process.env[`${prefix}LIGHT`],
5427
- brand: process.env[`${prefix}BRAND`],
5428
- alternate: process.env[`${prefix}ALTERNATE`],
5429
- accent: process.env[`${prefix}ACCENT`],
5430
- link: process.env[`${prefix}LINK`],
5431
- help: process.env[`${prefix}HELP`],
5432
- success: process.env[`${prefix}SUCCESS`],
5433
- info: process.env[`${prefix}INFO`],
5434
- debug: process.env[`${prefix}DEBUG`],
5435
- warning: process.env[`${prefix}WARNING`],
5436
- danger: process.env[`${prefix}DANGER`],
5437
- fatal: process.env[`${prefix}FATAL`],
5438
- performance: process.env[`${prefix}PERFORMANCE`],
5439
- positive: process.env[`${prefix}POSITIVE`],
5440
- negative: process.env[`${prefix}NEGATIVE`],
5441
- gradient
5442
- };
5443
- };
5444
- var getMultiThemeColorsEnv = (prefix) => {
5445
- return {
5446
- light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
5447
- dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
5448
- };
5449
- };
5450
- var getBaseThemeColorsEnv = (prefix) => {
5451
- const gradient = [];
5452
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
5453
- gradient.push(
5454
- process.env[`${prefix}GRADIENT_START`],
5455
- process.env[`${prefix}GRADIENT_END`]
5390
+ if (config.logLevel) {
5391
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
5392
+ process.env.LOG_LEVEL = String(config.logLevel);
5393
+ process.env.NX_VERBOSE_LOGGING = String(
5394
+ getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
5456
5395
  );
5457
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
5458
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
5459
- while (process.env[`${prefix}GRADIENT_${index}`]) {
5460
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
5461
- index++;
5396
+ process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
5397
+ }
5398
+ if (config.skipConfigLogging !== void 0) {
5399
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
5400
+ config.skipConfigLogging
5401
+ );
5402
+ }
5403
+ process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
5404
+ for (const key of Object.keys(config.extensions ?? {})) {
5405
+ if (config.extensions[key] && Object.keys(config.extensions[key])) {
5406
+ setExtensionEnv(key, config.extensions[key]);
5462
5407
  }
5463
5408
  }
5464
- return {
5465
- foreground: process.env[`${prefix}FOREGROUND`],
5466
- background: process.env[`${prefix}BACKGROUND`],
5467
- brand: process.env[`${prefix}BRAND`],
5468
- alternate: process.env[`${prefix}ALTERNATE`],
5469
- accent: process.env[`${prefix}ACCENT`],
5470
- link: process.env[`${prefix}LINK`],
5471
- help: process.env[`${prefix}HELP`],
5472
- success: process.env[`${prefix}SUCCESS`],
5473
- info: process.env[`${prefix}INFO`],
5474
- debug: process.env[`${prefix}DEBUG`],
5475
- warning: process.env[`${prefix}WARNING`],
5476
- danger: process.env[`${prefix}DANGER`],
5477
- fatal: process.env[`${prefix}FATAL`],
5478
- performance: process.env[`${prefix}PERFORMANCE`],
5479
- positive: process.env[`${prefix}POSITIVE`],
5480
- negative: process.env[`${prefix}NEGATIVE`],
5481
- gradient
5409
+ };
5410
+ var setThemeColorsEnv = (prefix, config) => {
5411
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
5412
+ };
5413
+ var setSingleThemeColorsEnv = (prefix, config) => {
5414
+ if (config.dark) {
5415
+ process.env[`${prefix}DARK`] = config.dark;
5416
+ }
5417
+ if (config.light) {
5418
+ process.env[`${prefix}LIGHT`] = config.light;
5419
+ }
5420
+ if (config.brand) {
5421
+ process.env[`${prefix}BRAND`] = config.brand;
5422
+ }
5423
+ if (config.alternate) {
5424
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
5425
+ }
5426
+ if (config.accent) {
5427
+ process.env[`${prefix}ACCENT`] = config.accent;
5428
+ }
5429
+ if (config.link) {
5430
+ process.env[`${prefix}LINK`] = config.link;
5431
+ }
5432
+ if (config.help) {
5433
+ process.env[`${prefix}HELP`] = config.help;
5434
+ }
5435
+ if (config.success) {
5436
+ process.env[`${prefix}SUCCESS`] = config.success;
5437
+ }
5438
+ if (config.info) {
5439
+ process.env[`${prefix}INFO`] = config.info;
5440
+ }
5441
+ if (config.debug) {
5442
+ process.env[`${prefix}DEBUG`] = config.debug;
5443
+ }
5444
+ if (config.warning) {
5445
+ process.env[`${prefix}WARNING`] = config.warning;
5446
+ }
5447
+ if (config.danger) {
5448
+ process.env[`${prefix}DANGER`] = config.danger;
5449
+ }
5450
+ if (config.fatal) {
5451
+ process.env[`${prefix}FATAL`] = config.fatal;
5452
+ }
5453
+ if (config.performance) {
5454
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
5455
+ }
5456
+ if (config.positive) {
5457
+ process.env[`${prefix}POSITIVE`] = config.positive;
5458
+ }
5459
+ if (config.negative) {
5460
+ process.env[`${prefix}NEGATIVE`] = config.negative;
5461
+ }
5462
+ if (config.gradient) {
5463
+ for (let i3 = 0; i3 < config.gradient.length; i3++) {
5464
+ process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
5465
+ }
5466
+ }
5467
+ };
5468
+ var setMultiThemeColorsEnv = (prefix, config) => {
5469
+ return {
5470
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
5471
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
5482
5472
  };
5483
5473
  };
5484
-
5485
- // ../config-tools/dist/chunk-7UEOVCKZ.js
5486
- init_cjs_shims();
5487
-
5488
- // ../config-tools/dist/chunk-LF3SAK2O.js
5489
- init_cjs_shims();
5490
-
5491
- // ../config-tools/dist/chunk-RUKM6FCF.js
5492
- init_cjs_shims();
5493
- var import_node_fs7 = require("fs");
5494
- var import_node_path4 = require("path");
5495
- var MAX_PATH_SEARCH_DEPTH = 30;
5496
- var depth = 0;
5497
- function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
5498
- const _startPath = startPath ?? process.cwd();
5499
- if (endDirectoryNames.some(
5500
- (endDirName) => (0, import_node_fs7.existsSync)((0, import_node_path4.join)(_startPath, endDirName))
5501
- )) {
5502
- return _startPath;
5474
+ var setBaseThemeColorsEnv = (prefix, config) => {
5475
+ if (config.foreground) {
5476
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
5503
5477
  }
5504
- if (endFileNames.some((endFileName) => (0, import_node_fs7.existsSync)((0, import_node_path4.join)(_startPath, endFileName)))) {
5505
- return _startPath;
5478
+ if (config.background) {
5479
+ process.env[`${prefix}BACKGROUND`] = config.background;
5506
5480
  }
5507
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
5508
- const parent = (0, import_node_path4.join)(_startPath, "..");
5509
- return findFolderUp(parent, endFileNames, endDirectoryNames);
5481
+ if (config.brand) {
5482
+ process.env[`${prefix}BRAND`] = config.brand;
5510
5483
  }
5511
- return void 0;
5512
- }
5513
-
5514
- // ../config-tools/dist/chunk-LF3SAK2O.js
5515
- var rootFiles = [
5516
- "storm-workspace.json",
5517
- "storm-workspace.yaml",
5518
- "storm-workspace.yml",
5519
- "storm-workspace.js",
5520
- "storm-workspace.ts",
5521
- ".storm-workspace.json",
5522
- ".storm-workspace.yaml",
5523
- ".storm-workspace.yml",
5524
- ".storm-workspace.js",
5525
- ".storm-workspace.ts",
5526
- "lerna.json",
5527
- "nx.json",
5528
- "turbo.json",
5529
- "npm-workspace.json",
5530
- "yarn-workspace.json",
5531
- "pnpm-workspace.json",
5532
- "npm-workspace.yaml",
5533
- "yarn-workspace.yaml",
5534
- "pnpm-workspace.yaml",
5535
- "npm-workspace.yml",
5536
- "yarn-workspace.yml",
5537
- "pnpm-workspace.yml",
5538
- "npm-lock.json",
5539
- "yarn-lock.json",
5540
- "pnpm-lock.json",
5541
- "npm-lock.yaml",
5542
- "yarn-lock.yaml",
5543
- "pnpm-lock.yaml",
5544
- "npm-lock.yml",
5545
- "yarn-lock.yml",
5546
- "pnpm-lock.yml",
5547
- "bun.lockb"
5548
- ];
5549
- var rootDirectories = [
5550
- ".storm-workspace",
5551
- ".nx",
5552
- ".git",
5553
- ".github",
5554
- ".vscode",
5555
- ".verdaccio"
5556
- ];
5557
- function findWorkspaceRootSafe(pathInsideMonorepo) {
5558
- if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
5559
- return correctPaths2(
5560
- process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
5561
- );
5484
+ if (config.alternate) {
5485
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
5562
5486
  }
5563
- return correctPaths2(
5564
- findFolderUp(
5565
- pathInsideMonorepo ?? process.cwd(),
5566
- rootFiles,
5567
- rootDirectories
5568
- )
5569
- );
5570
- }
5571
- function findWorkspaceRoot2(pathInsideMonorepo) {
5572
- const result = findWorkspaceRootSafe(pathInsideMonorepo);
5573
- if (!result) {
5574
- throw new Error(
5575
- `Cannot find workspace root upwards from known path. Files search list includes:
5576
- ${rootFiles.join(
5577
- "\n"
5578
- )}
5579
- Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
5580
- );
5487
+ if (config.accent) {
5488
+ process.env[`${prefix}ACCENT`] = config.accent;
5581
5489
  }
5582
- return result;
5583
- }
5490
+ if (config.link) {
5491
+ process.env[`${prefix}LINK`] = config.link;
5492
+ }
5493
+ if (config.help) {
5494
+ process.env[`${prefix}HELP`] = config.help;
5495
+ }
5496
+ if (config.success) {
5497
+ process.env[`${prefix}SUCCESS`] = config.success;
5498
+ }
5499
+ if (config.info) {
5500
+ process.env[`${prefix}INFO`] = config.info;
5501
+ }
5502
+ if (config.debug) {
5503
+ process.env[`${prefix}DEBUG`] = config.debug;
5504
+ }
5505
+ if (config.warning) {
5506
+ process.env[`${prefix}WARNING`] = config.warning;
5507
+ }
5508
+ if (config.danger) {
5509
+ process.env[`${prefix}DANGER`] = config.danger;
5510
+ }
5511
+ if (config.fatal) {
5512
+ process.env[`${prefix}FATAL`] = config.fatal;
5513
+ }
5514
+ if (config.performance) {
5515
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
5516
+ }
5517
+ if (config.positive) {
5518
+ process.env[`${prefix}POSITIVE`] = config.positive;
5519
+ }
5520
+ if (config.negative) {
5521
+ process.env[`${prefix}NEGATIVE`] = config.negative;
5522
+ }
5523
+ if (config.gradient) {
5524
+ for (let i3 = 0; i3 < config.gradient.length; i3++) {
5525
+ process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
5526
+ }
5527
+ }
5528
+ };
5584
5529
 
5585
- // ../config-tools/dist/chunk-7UEOVCKZ.js
5586
- var import_c122 = require("c12");
5587
- var import_defu3 = __toESM(require("defu"), 1);
5588
- var getConfigFileByName = async (fileName, filePath, options2 = {}) => {
5589
- const workspacePath = filePath || findWorkspaceRoot2(filePath);
5590
- const configs = await Promise.all([
5591
- (0, import_c122.loadConfig)({
5592
- cwd: workspacePath,
5593
- packageJson: true,
5594
- name: fileName,
5595
- envName: fileName?.toUpperCase(),
5596
- jitiOptions: {
5597
- debug: false,
5598
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
5599
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
5600
- "jiti"
5601
- )
5602
- },
5603
- ...options2
5604
- }),
5605
- (0, import_c122.loadConfig)({
5606
- cwd: workspacePath,
5607
- packageJson: true,
5608
- name: fileName,
5609
- envName: fileName?.toUpperCase(),
5610
- jitiOptions: {
5611
- debug: false,
5612
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
5613
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
5614
- "jiti"
5615
- )
5616
- },
5617
- configFile: fileName,
5618
- ...options2
5619
- })
5620
- ]);
5621
- return (0, import_defu3.default)(configs[0] ?? {}, configs[1] ?? {});
5530
+ // ../config-tools/dist/chunk-A5JXMY6X.js
5531
+ init_cjs_shims();
5532
+ var getExtensionEnv = (extensionName) => {
5533
+ const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
5534
+ return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
5535
+ const name = key.replace(prefix, "").split("_").map(
5536
+ (i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
5537
+ ).join("");
5538
+ if (name) {
5539
+ ret[name] = process.env[key];
5540
+ }
5541
+ return ret;
5542
+ }, {});
5622
5543
  };
5623
- var getConfigFile = async (filePath, additionalFileNames = []) => {
5624
- const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
5625
- const result = await getConfigFileByName("storm-workspace", workspacePath);
5626
- let config = result.config;
5627
- const configFile = result.configFile;
5628
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
5629
- writeTrace(
5630
- `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
5631
- {
5632
- logLevel: "all"
5633
- }
5634
- );
5544
+ var getConfigEnv = () => {
5545
+ const prefix = "STORM_";
5546
+ let config = {
5547
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
5548
+ name: process.env[`${prefix}NAME`] || void 0,
5549
+ variant: process.env[`${prefix}VARIANT`] || void 0,
5550
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
5551
+ owner: process.env[`${prefix}OWNER`] || void 0,
5552
+ bot: {
5553
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
5554
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
5555
+ },
5556
+ release: {
5557
+ banner: {
5558
+ url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
5559
+ alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
5560
+ },
5561
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
5562
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
5563
+ },
5564
+ error: {
5565
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
5566
+ url: process.env[`${prefix}ERROR_URL`] || void 0
5567
+ },
5568
+ socials: {
5569
+ twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
5570
+ discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
5571
+ telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
5572
+ slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
5573
+ medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
5574
+ github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
5575
+ },
5576
+ 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`] ? {
5577
+ name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
5578
+ description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
5579
+ url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
5580
+ logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
5581
+ icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
5582
+ } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
5583
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
5584
+ license: process.env[`${prefix}LICENSE`] || void 0,
5585
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
5586
+ docs: process.env[`${prefix}DOCS`] || void 0,
5587
+ portal: process.env[`${prefix}PORTAL`] || void 0,
5588
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
5589
+ contact: process.env[`${prefix}CONTACT`] || void 0,
5590
+ support: process.env[`${prefix}SUPPORT`] || void 0,
5591
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
5592
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
5593
+ configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
5594
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
5595
+ directories: {
5596
+ cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths2(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths2(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
5597
+ data: process.env[`${prefix}DATA_DIR`] ? correctPaths2(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths2(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
5598
+ config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths2(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths2(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
5599
+ temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths2(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths2(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
5600
+ log: process.env[`${prefix}LOG_DIR`] ? correctPaths2(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths2(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
5601
+ build: process.env[`${prefix}BUILD_DIR`] ? correctPaths2(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths2(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
5602
+ },
5603
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
5604
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
5605
+ // ci:
5606
+ // process.env[`${prefix}CI`] !== undefined
5607
+ // ? Boolean(
5608
+ // process.env[`${prefix}CI`] ??
5609
+ // process.env.CI ??
5610
+ // process.env.CONTINUOUS_INTEGRATION
5611
+ // )
5612
+ // : undefined,
5613
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
5614
+ branch: process.env[`${prefix}BRANCH`] || void 0,
5615
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
5616
+ registry: {
5617
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
5618
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
5619
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
5620
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
5621
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
5622
+ },
5623
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
5624
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
5625
+ ) ? getLogLevelLabel(
5626
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
5627
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
5628
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
5629
+ };
5630
+ const themeNames = Object.keys(process.env).filter(
5631
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
5632
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
5633
+ )
5634
+ );
5635
+ config.colors = themeNames.length > 0 ? themeNames.reduce(
5636
+ (ret, themeName) => {
5637
+ ret[themeName] = getThemeColorsEnv(prefix, themeName);
5638
+ return ret;
5639
+ },
5640
+ {}
5641
+ ) : getThemeColorsEnv(prefix);
5642
+ if (config.docs === s) {
5643
+ if (config.homepage === r) {
5644
+ config.docs = `${r}/projects/${config.name}/docs`;
5645
+ } else {
5646
+ config.docs = `${config.homepage}/docs`;
5647
+ }
5635
5648
  }
5636
- if (additionalFileNames && additionalFileNames.length > 0) {
5637
- const results = await Promise.all(
5638
- additionalFileNames.map(
5639
- (fileName) => getConfigFileByName(fileName, workspacePath)
5640
- )
5641
- );
5642
- for (const result2 of results) {
5643
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
5644
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
5645
- writeTrace(
5646
- `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
5647
- {
5648
- logLevel: "all"
5649
- }
5650
- );
5651
- }
5652
- config = (0, import_defu3.default)(result2.config ?? {}, config ?? {});
5653
- }
5649
+ if (config.licensing === a) {
5650
+ if (config.homepage === r) {
5651
+ config.licensing = `${r}/projects/${config.name}/licensing`;
5652
+ } else {
5653
+ config.licensing = `${config.homepage}/docs`;
5654
5654
  }
5655
5655
  }
5656
- if (!config || Object.keys(config).length === 0) {
5657
- return void 0;
5656
+ const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
5657
+ if (serializedConfig) {
5658
+ const parsed = JSON.parse(serializedConfig);
5659
+ config = {
5660
+ ...config,
5661
+ ...parsed,
5662
+ colors: { ...config.colors, ...parsed.colors },
5663
+ extensions: { ...config.extensions, ...parsed.extensions }
5664
+ };
5658
5665
  }
5659
- config.configFile = configFile;
5660
5666
  return config;
5661
5667
  };
5662
-
5663
- // ../config-tools/dist/chunk-RGET2UQV.js
5664
- init_cjs_shims();
5665
- var import_node_fs8 = require("fs");
5666
- var import_promises5 = require("fs/promises");
5667
- var import_node_path5 = require("path");
5668
- async function getPackageJsonConfig(root) {
5669
- let license = i;
5670
- let homepage = void 0;
5671
- let support = void 0;
5672
- let name = void 0;
5673
- let namespace = void 0;
5674
- let repository = void 0;
5675
- const workspaceRoot = findWorkspaceRoot2(root);
5676
- if ((0, import_node_fs8.existsSync)((0, import_node_path5.join)(workspaceRoot, "package.json"))) {
5677
- const file = await (0, import_promises5.readFile)(
5678
- joinPaths2(workspaceRoot, "package.json"),
5679
- "utf8"
5668
+ var getThemeColorsEnv = (prefix, theme) => {
5669
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
5670
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
5671
+ };
5672
+ var getSingleThemeColorsEnv = (prefix) => {
5673
+ const gradient = [];
5674
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
5675
+ gradient.push(
5676
+ process.env[`${prefix}GRADIENT_START`],
5677
+ process.env[`${prefix}GRADIENT_END`]
5680
5678
  );
5681
- if (file) {
5682
- const packageJson = JSON.parse(file);
5683
- if (packageJson.name) {
5684
- name = packageJson.name;
5685
- }
5686
- if (packageJson.namespace) {
5687
- namespace = packageJson.namespace;
5688
- }
5689
- if (packageJson.repository) {
5690
- if (typeof packageJson.repository === "string") {
5691
- repository = packageJson.repository;
5692
- } else if (packageJson.repository.url) {
5693
- repository = packageJson.repository.url;
5694
- }
5695
- }
5696
- if (packageJson.license) {
5697
- license = packageJson.license;
5698
- }
5699
- if (packageJson.homepage) {
5700
- homepage = packageJson.homepage;
5701
- }
5702
- if (packageJson.bugs) {
5703
- if (typeof packageJson.bugs === "string") {
5704
- support = packageJson.bugs;
5705
- } else if (packageJson.bugs.url) {
5706
- support = packageJson.bugs.url;
5707
- }
5708
- }
5679
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
5680
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
5681
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
5682
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
5683
+ index++;
5709
5684
  }
5710
5685
  }
5711
5686
  return {
5712
- workspaceRoot,
5713
- name,
5714
- namespace,
5715
- repository,
5716
- license,
5717
- homepage,
5718
- support
5687
+ dark: process.env[`${prefix}DARK`],
5688
+ light: process.env[`${prefix}LIGHT`],
5689
+ brand: process.env[`${prefix}BRAND`],
5690
+ alternate: process.env[`${prefix}ALTERNATE`],
5691
+ accent: process.env[`${prefix}ACCENT`],
5692
+ link: process.env[`${prefix}LINK`],
5693
+ help: process.env[`${prefix}HELP`],
5694
+ success: process.env[`${prefix}SUCCESS`],
5695
+ info: process.env[`${prefix}INFO`],
5696
+ debug: process.env[`${prefix}DEBUG`],
5697
+ warning: process.env[`${prefix}WARNING`],
5698
+ danger: process.env[`${prefix}DANGER`],
5699
+ fatal: process.env[`${prefix}FATAL`],
5700
+ performance: process.env[`${prefix}PERFORMANCE`],
5701
+ positive: process.env[`${prefix}POSITIVE`],
5702
+ negative: process.env[`${prefix}NEGATIVE`],
5703
+ gradient
5719
5704
  };
5720
- }
5721
- function applyDefaultConfig(config) {
5722
- if (!config.support && config.contact) {
5723
- config.support = config.contact;
5724
- }
5725
- if (!config.contact && config.support) {
5726
- config.contact = config.support;
5727
- }
5728
- if (config.homepage) {
5729
- if (!config.docs) {
5730
- config.docs = `${config.homepage}/docs`;
5731
- }
5732
- if (!config.license) {
5733
- config.license = `${config.homepage}/license`;
5734
- }
5735
- if (!config.support) {
5736
- config.support = `${config.homepage}/support`;
5737
- }
5738
- if (!config.contact) {
5739
- config.contact = `${config.homepage}/contact`;
5740
- }
5741
- if (!config.error?.codesFile || !config?.error?.url) {
5742
- config.error ??= { codesFile: S };
5743
- if (config.homepage) {
5744
- config.error.url ??= `${config.homepage}/errors`;
5745
- }
5705
+ };
5706
+ var getMultiThemeColorsEnv = (prefix) => {
5707
+ return {
5708
+ light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
5709
+ dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
5710
+ };
5711
+ };
5712
+ var getBaseThemeColorsEnv = (prefix) => {
5713
+ const gradient = [];
5714
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
5715
+ gradient.push(
5716
+ process.env[`${prefix}GRADIENT_START`],
5717
+ process.env[`${prefix}GRADIENT_END`]
5718
+ );
5719
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
5720
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
5721
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
5722
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
5723
+ index++;
5746
5724
  }
5747
5725
  }
5748
- return config;
5749
- }
5726
+ return {
5727
+ foreground: process.env[`${prefix}FOREGROUND`],
5728
+ background: process.env[`${prefix}BACKGROUND`],
5729
+ brand: process.env[`${prefix}BRAND`],
5730
+ alternate: process.env[`${prefix}ALTERNATE`],
5731
+ accent: process.env[`${prefix}ACCENT`],
5732
+ link: process.env[`${prefix}LINK`],
5733
+ help: process.env[`${prefix}HELP`],
5734
+ success: process.env[`${prefix}SUCCESS`],
5735
+ info: process.env[`${prefix}INFO`],
5736
+ debug: process.env[`${prefix}DEBUG`],
5737
+ warning: process.env[`${prefix}WARNING`],
5738
+ danger: process.env[`${prefix}DANGER`],
5739
+ fatal: process.env[`${prefix}FATAL`],
5740
+ performance: process.env[`${prefix}PERFORMANCE`],
5741
+ positive: process.env[`${prefix}POSITIVE`],
5742
+ negative: process.env[`${prefix}NEGATIVE`],
5743
+ gradient
5744
+ };
5745
+ };
5750
5746
 
5751
5747
  // ../config/dist/schema.js
5752
5748
  init_cjs_shims();
5753
5749
 
5754
- // ../config-tools/dist/chunk-IASBTY6Z.js
5750
+ // ../config-tools/dist/chunk-6VD3CYGA.js
5755
5751
  var import_defu4 = __toESM(require("defu"), 1);
5756
5752
  var import_node_fs9 = require("fs");
5757
5753
  var _extension_cache = /* @__PURE__ */ new WeakMap();
@@ -5852,7 +5848,7 @@ ${formatLogMessage(config)}`,
5852
5848
  return config;
5853
5849
  };
5854
5850
 
5855
- // ../config-tools/dist/chunk-L6MSRILP.js
5851
+ // ../config-tools/dist/chunk-RL5DRDS6.js
5856
5852
  function getConfig(workspaceRoot, skipLogs = false) {
5857
5853
  return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
5858
5854
  }