@storm-software/tsup 0.2.178 → 0.2.179

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.
@@ -2,10 +2,10 @@ import {
2
2
  DEFAULT_BUILD_OPTIONS,
3
3
  DEFAULT_ENVIRONMENT,
4
4
  DEFAULT_ORGANIZATION
5
- } from "./chunk-GKLMXIYG.js";
5
+ } from "./chunk-MOFBIADV.js";
6
6
  import {
7
7
  init_esm_shims
8
- } from "./chunk-HG5YW62K.js";
8
+ } from "./chunk-P25ZON45.js";
9
9
 
10
10
  // src/options.ts
11
11
  init_esm_shims();
@@ -16,7 +16,7 @@ init_esm_shims();
16
16
  // ../build-tools/dist/chunk-KVP3YMX6.mjs
17
17
  init_esm_shims();
18
18
 
19
- // ../build-tools/dist/chunk-4U27MI7T.mjs
19
+ // ../build-tools/dist/chunk-ZU4PGT6D.mjs
20
20
  init_esm_shims();
21
21
 
22
22
  // ../build-tools/dist/chunk-B4H42WDA.mjs
@@ -29,7 +29,7 @@ init_esm_shims();
29
29
  import { existsSync } from "node:fs";
30
30
  import { join } from "node:path";
31
31
 
32
- // ../build-tools/dist/chunk-FFREG5NA.mjs
32
+ // ../build-tools/dist/chunk-2D2G26KB.mjs
33
33
  init_esm_shims();
34
34
  import { formatDistanceToNow } from "date-fns/formatDistanceToNow";
35
35
  import chalk from "chalk";
@@ -67,7 +67,7 @@ var CONSOLE_ICONS = {
67
67
  [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
68
68
  };
69
69
 
70
- // ../build-tools/dist/chunk-4U27MI7T.mjs
70
+ // ../build-tools/dist/chunk-ZU4PGT6D.mjs
71
71
  import { loadConfig } from "c12";
72
72
  import defu from "defu";
73
73
  import * as z from "zod/v4/mini";
@@ -664,13 +664,13 @@ import {
664
664
  mapTargetDefaultsToDependencies
665
665
  } from "nx/src/tasks-runner/create-task-graph";
666
666
 
667
- // ../build-tools/dist/chunk-QBCNSYKY.mjs
667
+ // ../build-tools/dist/chunk-O5JLRHXY.mjs
668
668
  init_esm_shims();
669
669
  import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
670
670
  import { glob } from "glob";
671
671
  import { readFile as readFile3, writeFile } from "node:fs/promises";
672
672
 
673
- // ../build-tools/dist/chunk-VP2S4MW2.mjs
673
+ // ../build-tools/dist/chunk-MD22HLYQ.mjs
674
674
  init_esm_shims();
675
675
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
676
676
  import { Glob } from "glob";
@@ -682,7 +682,7 @@ import {
682
682
  readProjectsConfigurationFromProjectGraph
683
683
  } from "nx/src/project-graph/project-graph";
684
684
 
685
- // ../build-tools/dist/chunk-XE4VFTNB.mjs
685
+ // ../build-tools/dist/chunk-J4SM55F4.mjs
686
686
  init_esm_shims();
687
687
  import { glob as glob2 } from "glob";
688
688
 
@@ -716,14 +716,14 @@ init_esm_shims();
716
716
  // ../build-tools/dist/chunk-UN3B7LBV.mjs
717
717
  init_esm_shims();
718
718
 
719
- // ../build-tools/dist/chunk-KITEVNAN.mjs
719
+ // ../build-tools/dist/chunk-V6F5CGPN.mjs
720
720
  init_esm_shims();
721
721
 
722
722
  // ../build-tools/dist/chunk-7YKXR5JJ.mjs
723
723
  init_esm_shims();
724
724
  import { transform } from "@swc/core";
725
725
 
726
- // ../build-tools/dist/chunk-XFYY45GO.mjs
726
+ // ../build-tools/dist/chunk-MT2TKIIG.mjs
727
727
  init_esm_shims();
728
728
  import fs from "node:fs";
729
729
  import { builtinModules } from "node:module";
@@ -738,40 +738,14 @@ import { relative } from "path";
738
738
  // ../config-tools/dist/get-config.js
739
739
  init_esm_shims();
740
740
 
741
- // ../config-tools/dist/chunk-EBVZQPBC.js
741
+ // ../config-tools/dist/chunk-KKF5NXBI.js
742
742
  init_esm_shims();
743
743
 
744
- // ../config-tools/dist/chunk-K2ESWZ47.js
744
+ // ../config-tools/dist/chunk-DW5363CG.js
745
745
  init_esm_shims();
746
746
 
747
- // ../config-tools/dist/chunk-RT5536G5.js
748
- init_esm_shims();
749
-
750
- // ../config-tools/dist/chunk-LF3SAK2O.js
751
- init_esm_shims();
752
-
753
- // ../config-tools/dist/chunk-RUKM6FCF.js
747
+ // ../config-tools/dist/chunk-SDSQ2HHF.js
754
748
  init_esm_shims();
755
- import { existsSync as existsSync5 } from "node:fs";
756
- import { join as join3 } from "node:path";
757
- var MAX_PATH_SEARCH_DEPTH = 30;
758
- var depth = 0;
759
- function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
760
- const _startPath = startPath ?? process.cwd();
761
- if (endDirectoryNames.some(
762
- (endDirName) => existsSync5(join3(_startPath, endDirName))
763
- )) {
764
- return _startPath;
765
- }
766
- if (endFileNames.some((endFileName) => existsSync5(join3(_startPath, endFileName)))) {
767
- return _startPath;
768
- }
769
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
770
- const parent = join3(_startPath, "..");
771
- return findFolderUp(parent, endFileNames, endDirectoryNames);
772
- }
773
- return void 0;
774
- }
775
749
 
776
750
  // ../config-tools/dist/chunk-V3GMJ4TX.js
777
751
  init_esm_shims();
@@ -899,169 +873,8 @@ var isAbsolute = function(p3) {
899
873
  return _IS_ABSOLUTE_RE.test(p3);
900
874
  };
901
875
 
902
- // ../config-tools/dist/chunk-LF3SAK2O.js
903
- var rootFiles = [
904
- "storm-workspace.json",
905
- "storm-workspace.yaml",
906
- "storm-workspace.yml",
907
- "storm-workspace.js",
908
- "storm-workspace.ts",
909
- ".storm-workspace.json",
910
- ".storm-workspace.yaml",
911
- ".storm-workspace.yml",
912
- ".storm-workspace.js",
913
- ".storm-workspace.ts",
914
- "lerna.json",
915
- "nx.json",
916
- "turbo.json",
917
- "npm-workspace.json",
918
- "yarn-workspace.json",
919
- "pnpm-workspace.json",
920
- "npm-workspace.yaml",
921
- "yarn-workspace.yaml",
922
- "pnpm-workspace.yaml",
923
- "npm-workspace.yml",
924
- "yarn-workspace.yml",
925
- "pnpm-workspace.yml",
926
- "npm-lock.json",
927
- "yarn-lock.json",
928
- "pnpm-lock.json",
929
- "npm-lock.yaml",
930
- "yarn-lock.yaml",
931
- "pnpm-lock.yaml",
932
- "npm-lock.yml",
933
- "yarn-lock.yml",
934
- "pnpm-lock.yml",
935
- "bun.lockb"
936
- ];
937
- var rootDirectories = [
938
- ".storm-workspace",
939
- ".nx",
940
- ".git",
941
- ".github",
942
- ".vscode",
943
- ".verdaccio"
944
- ];
945
- function findWorkspaceRootSafe(pathInsideMonorepo) {
946
- if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
947
- return correctPaths2(
948
- process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
949
- );
950
- }
951
- return correctPaths2(
952
- findFolderUp(
953
- pathInsideMonorepo ?? process.cwd(),
954
- rootFiles,
955
- rootDirectories
956
- )
957
- );
958
- }
959
- function findWorkspaceRoot2(pathInsideMonorepo) {
960
- const result = findWorkspaceRootSafe(pathInsideMonorepo);
961
- if (!result) {
962
- throw new Error(
963
- `Cannot find workspace root upwards from known path. Files search list includes:
964
- ${rootFiles.join(
965
- "\n"
966
- )}
967
- Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
968
- );
969
- }
970
- return result;
971
- }
972
-
973
- // ../config-tools/dist/chunk-U4N3RX22.js
974
- init_esm_shims();
975
-
976
- // ../config-tools/dist/chunk-5DQF4GNF.js
977
- init_esm_shims();
978
- var DEFAULT_COLOR_CONFIG = {
979
- light: {
980
- background: "#fafafa",
981
- foreground: "#1d1e22",
982
- brand: "#1fb2a6",
983
- alternate: "#db2777",
984
- help: "#5C4EE5",
985
- success: "#087f5b",
986
- info: "#0550ae",
987
- debug: "#8afafc",
988
- warning: "#e3b341",
989
- danger: "#D8314A",
990
- fatal: "#51070f",
991
- performance: "#13c302",
992
- link: "#3fa6ff",
993
- positive: "#22c55e",
994
- negative: "#dc2626",
995
- gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
996
- },
997
- dark: {
998
- background: "#1d1e22",
999
- foreground: "#cbd5e1",
1000
- brand: "#2dd4bf",
1001
- alternate: "#db2777",
1002
- help: "#818cf8",
1003
- success: "#10b981",
1004
- info: "#58a6ff",
1005
- debug: "#8afafc",
1006
- warning: "#f3d371",
1007
- danger: "#D8314A",
1008
- fatal: "#a40e26",
1009
- performance: "#80fd74",
1010
- link: "#3fa6ff",
1011
- positive: "#22c55e",
1012
- negative: "#dc2626",
1013
- gradient: ["#1fb2a6", "#db2777", "#818cf8"]
1014
- }
1015
- };
1016
-
1017
- // ../config-tools/dist/chunk-HVVJHTFS.js
1018
- init_esm_shims();
1019
- import chalk2 from "chalk";
1020
- var chalkDefault = {
1021
- hex: (_3) => (message) => message,
1022
- bgHex: (_3) => ({
1023
- whiteBright: (message) => message,
1024
- white: (message) => message
1025
- }),
1026
- white: (message) => message,
1027
- whiteBright: (message) => message,
1028
- gray: (message) => message,
1029
- bold: {
1030
- hex: (_3) => (message) => message,
1031
- bgHex: (_3) => ({
1032
- whiteBright: (message) => message,
1033
- white: (message) => message
1034
- }),
1035
- whiteBright: (message) => message,
1036
- white: (message) => message
1037
- },
1038
- dim: {
1039
- hex: (_3) => (message) => message,
1040
- gray: (message) => message
1041
- }
1042
- };
1043
- var getChalk = () => {
1044
- let _chalk = chalk2;
1045
- if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
1046
- _chalk = chalkDefault;
1047
- }
1048
- return _chalk;
1049
- };
1050
-
1051
- // ../config-tools/dist/chunk-ZFNAUMQS.js
1052
- init_esm_shims();
1053
-
1054
- // ../config-tools/dist/chunk-G2MK47WL.js
876
+ // ../config-tools/dist/chunk-SXPH7ILL.js
1055
877
  init_esm_shims();
1056
- function isUnicodeSupported2() {
1057
- if (process.platform !== "win32") {
1058
- return process.env.TERM !== "linux";
1059
- }
1060
- return Boolean(process.env.WT_SESSION) || // Windows Terminal
1061
- Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
1062
- process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
1063
- 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";
1064
- }
1065
878
 
1066
879
  // ../config-tools/dist/chunk-RALMUN5C.js
1067
880
  init_esm_shims();
@@ -1090,28 +903,7 @@ var LogLevelLabel2 = {
1090
903
  ALL: "all"
1091
904
  };
1092
905
 
1093
- // ../config-tools/dist/chunk-ZFNAUMQS.js
1094
- var useIcon2 = (c3, fallback) => isUnicodeSupported2() ? c3 : fallback;
1095
- var CONSOLE_ICONS2 = {
1096
- [LogLevelLabel2.ERROR]: useIcon2("\u2718", "\xD7"),
1097
- [LogLevelLabel2.FATAL]: useIcon2("\u{1F571}", "\xD7"),
1098
- [LogLevelLabel2.WARN]: useIcon2("\u26A0", "\u203C"),
1099
- [LogLevelLabel2.INFO]: useIcon2("\u2139", "i"),
1100
- [LogLevelLabel2.PERFORMANCE]: useIcon2("\u23F1", "\u23F1"),
1101
- [LogLevelLabel2.SUCCESS]: useIcon2("\u2714", "\u221A"),
1102
- [LogLevelLabel2.DEBUG]: useIcon2("\u{1F6E0}", "D"),
1103
- [LogLevelLabel2.TRACE]: useIcon2("\u2699", "T"),
1104
- [LogLevelLabel2.ALL]: useIcon2("\u2709", "\u2192")
1105
- };
1106
-
1107
- // ../config-tools/dist/chunk-JZAYHDV3.js
1108
- init_esm_shims();
1109
- var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
1110
- return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
1111
- };
1112
-
1113
906
  // ../config-tools/dist/chunk-SXPH7ILL.js
1114
- init_esm_shims();
1115
907
  var getLogLevel2 = (label) => {
1116
908
  switch (label) {
1117
909
  case "all":
@@ -1167,932 +959,388 @@ var getLogLevelLabel2 = (logLevel = LogLevel2.INFO) => {
1167
959
  return LogLevelLabel2.INFO;
1168
960
  };
1169
961
 
1170
- // ../config-tools/dist/chunk-U4N3RX22.js
1171
- var daysInYear = 365.2425;
1172
- var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
1173
- var minTime = -maxTime;
1174
- var minutesInMonth = 43200;
1175
- var minutesInDay = 1440;
1176
- var secondsInHour = 3600;
1177
- var secondsInDay = secondsInHour * 24;
1178
- var secondsInWeek = secondsInDay * 7;
1179
- var secondsInYear = secondsInDay * daysInYear;
1180
- var secondsInMonth = secondsInYear / 12;
1181
- var secondsInQuarter = secondsInMonth * 3;
1182
- var constructFromSymbol = Symbol.for("constructDateFrom");
1183
- function constructFrom(date, value) {
1184
- if (typeof date === "function") return date(value);
1185
- if (date && typeof date === "object" && constructFromSymbol in date)
1186
- return date[constructFromSymbol](value);
1187
- if (date instanceof Date) return new date.constructor(value);
1188
- return new Date(value);
1189
- }
1190
- function constructNow(date) {
1191
- return constructFrom(date, Date.now());
1192
- }
1193
- var formatDistanceLocale = {
1194
- lessThanXSeconds: {
1195
- one: "less than a second",
1196
- other: "less than {{count}} seconds"
1197
- },
1198
- xSeconds: {
1199
- one: "1 second",
1200
- other: "{{count}} seconds"
1201
- },
1202
- halfAMinute: "half a minute",
1203
- lessThanXMinutes: {
1204
- one: "less than a minute",
1205
- other: "less than {{count}} minutes"
1206
- },
1207
- xMinutes: {
1208
- one: "1 minute",
1209
- other: "{{count}} minutes"
1210
- },
1211
- aboutXHours: {
1212
- one: "about 1 hour",
1213
- other: "about {{count}} hours"
1214
- },
1215
- xHours: {
1216
- one: "1 hour",
1217
- other: "{{count}} hours"
1218
- },
1219
- xDays: {
1220
- one: "1 day",
1221
- other: "{{count}} days"
1222
- },
1223
- aboutXWeeks: {
1224
- one: "about 1 week",
1225
- other: "about {{count}} weeks"
1226
- },
1227
- xWeeks: {
1228
- one: "1 week",
1229
- other: "{{count}} weeks"
1230
- },
1231
- aboutXMonths: {
1232
- one: "about 1 month",
1233
- other: "about {{count}} months"
1234
- },
1235
- xMonths: {
1236
- one: "1 month",
1237
- other: "{{count}} months"
1238
- },
1239
- aboutXYears: {
1240
- one: "about 1 year",
1241
- other: "about {{count}} years"
1242
- },
1243
- xYears: {
1244
- one: "1 year",
1245
- other: "{{count}} years"
1246
- },
1247
- overXYears: {
1248
- one: "over 1 year",
1249
- other: "over {{count}} years"
1250
- },
1251
- almostXYears: {
1252
- one: "almost 1 year",
1253
- other: "almost {{count}} years"
962
+ // ../config-tools/dist/chunk-SDSQ2HHF.js
963
+ var setExtensionEnv = (extensionName, extension) => {
964
+ for (const key of Object.keys(extension ?? {})) {
965
+ if (extension[key]) {
966
+ const result = key?.replace(
967
+ /([A-Z])+/g,
968
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
969
+ ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
970
+ let extensionKey;
971
+ if (result.length === 0) {
972
+ return;
973
+ }
974
+ if (result.length === 1) {
975
+ extensionKey = result[0]?.toUpperCase() ?? "";
976
+ } else {
977
+ extensionKey = result.reduce((ret, part) => {
978
+ return `${ret}_${part.toLowerCase()}`;
979
+ });
980
+ }
981
+ process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
982
+ }
1254
983
  }
1255
984
  };
1256
- var formatDistance = (token, count, options) => {
1257
- let result;
1258
- const tokenValue = formatDistanceLocale[token];
1259
- if (typeof tokenValue === "string") {
1260
- result = tokenValue;
1261
- } else if (count === 1) {
1262
- result = tokenValue.one;
1263
- } else {
1264
- result = tokenValue.other.replace("{{count}}", count.toString());
985
+ var setConfigEnv = (config) => {
986
+ const prefix = "STORM_";
987
+ if (config.extends) {
988
+ process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
1265
989
  }
1266
- if (options?.addSuffix) {
1267
- if (options.comparison && options.comparison > 0) {
1268
- return "in " + result;
1269
- } else {
1270
- return result + " ago";
990
+ if (config.name) {
991
+ process.env[`${prefix}NAME`] = config.name;
992
+ }
993
+ if (config.variant) {
994
+ process.env[`${prefix}VARIANT`] = config.variant;
995
+ }
996
+ if (config.namespace) {
997
+ process.env[`${prefix}NAMESPACE`] = config.namespace;
998
+ }
999
+ if (config.owner) {
1000
+ process.env[`${prefix}OWNER`] = config.owner;
1001
+ }
1002
+ if (config.bot) {
1003
+ process.env[`${prefix}BOT_NAME`] = config.bot.name;
1004
+ process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
1005
+ }
1006
+ if (config.error) {
1007
+ process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
1008
+ process.env[`${prefix}ERROR_URL`] = config.error.url;
1009
+ }
1010
+ if (config.release) {
1011
+ if (config.release.banner) {
1012
+ if (typeof config.release.banner === "string") {
1013
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
1014
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
1015
+ } else {
1016
+ process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
1017
+ process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
1018
+ process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
1019
+ }
1271
1020
  }
1021
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
1022
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1272
1023
  }
1273
- return result;
1274
- };
1275
- function buildFormatLongFn(args) {
1276
- return (options = {}) => {
1277
- const width = options.width ? String(options.width) : args.defaultWidth;
1278
- const format2 = args.formats[width] || args.formats[args.defaultWidth];
1279
- return format2;
1280
- };
1281
- }
1282
- var dateFormats = {
1283
- full: "EEEE, MMMM do, y",
1284
- long: "MMMM do, y",
1285
- medium: "MMM d, y",
1286
- short: "MM/dd/yyyy"
1287
- };
1288
- var timeFormats = {
1289
- full: "h:mm:ss a zzzz",
1290
- long: "h:mm:ss a z",
1291
- medium: "h:mm:ss a",
1292
- short: "h:mm a"
1293
- };
1294
- var dateTimeFormats = {
1295
- full: "{{date}} 'at' {{time}}",
1296
- long: "{{date}} 'at' {{time}}",
1297
- medium: "{{date}}, {{time}}",
1298
- short: "{{date}}, {{time}}"
1299
- };
1300
- var formatLong = {
1301
- date: buildFormatLongFn({
1302
- formats: dateFormats,
1303
- defaultWidth: "full"
1304
- }),
1305
- time: buildFormatLongFn({
1306
- formats: timeFormats,
1307
- defaultWidth: "full"
1308
- }),
1309
- dateTime: buildFormatLongFn({
1310
- formats: dateTimeFormats,
1311
- defaultWidth: "full"
1312
- })
1313
- };
1314
- var formatRelativeLocale = {
1315
- lastWeek: "'last' eeee 'at' p",
1316
- yesterday: "'yesterday at' p",
1317
- today: "'today at' p",
1318
- tomorrow: "'tomorrow at' p",
1319
- nextWeek: "eeee 'at' p",
1320
- other: "P"
1321
- };
1322
- var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
1323
- function buildLocalizeFn(args) {
1324
- return (value, options) => {
1325
- const context = options?.context ? String(options.context) : "standalone";
1326
- let valuesArray;
1327
- if (context === "formatting" && args.formattingValues) {
1328
- const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1329
- const width = options?.width ? String(options.width) : defaultWidth;
1330
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1024
+ if (config.socials) {
1025
+ if (config.socials.twitter) {
1026
+ process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
1027
+ }
1028
+ if (config.socials.discord) {
1029
+ process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
1030
+ }
1031
+ if (config.socials.telegram) {
1032
+ process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
1033
+ }
1034
+ if (config.socials.slack) {
1035
+ process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
1036
+ }
1037
+ if (config.socials.medium) {
1038
+ process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
1039
+ }
1040
+ if (config.socials.github) {
1041
+ process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
1042
+ }
1043
+ }
1044
+ if (config.organization) {
1045
+ if (typeof config.organization === "string") {
1046
+ process.env[`${prefix}ORG`] = config.organization;
1047
+ process.env[`${prefix}ORG_NAME`] = config.organization;
1048
+ process.env[`${prefix}ORGANIZATION`] = config.organization;
1049
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
1331
1050
  } else {
1332
- const defaultWidth = args.defaultWidth;
1333
- const width = options?.width ? String(options.width) : args.defaultWidth;
1334
- valuesArray = args.values[width] || args.values[defaultWidth];
1051
+ process.env[`${prefix}ORG`] = config.organization.name;
1052
+ process.env[`${prefix}ORG_NAME`] = config.organization.name;
1053
+ process.env[`${prefix}ORGANIZATION`] = config.organization.name;
1054
+ process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
1055
+ if (config.organization.url) {
1056
+ process.env[`${prefix}ORG_URL`] = config.organization.url;
1057
+ process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
1058
+ }
1059
+ if (config.organization.description) {
1060
+ process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
1061
+ process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
1062
+ }
1063
+ if (config.organization.logo) {
1064
+ process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
1065
+ process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
1066
+ }
1067
+ if (config.organization.icon) {
1068
+ process.env[`${prefix}ORG_ICON`] = config.organization.icon;
1069
+ process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
1070
+ }
1335
1071
  }
1336
- const index = args.argumentCallback ? args.argumentCallback(value) : value;
1337
- return valuesArray[index];
1338
- };
1339
- }
1340
- var eraValues = {
1341
- narrow: ["B", "A"],
1342
- abbreviated: ["BC", "AD"],
1343
- wide: ["Before Christ", "Anno Domini"]
1344
- };
1345
- var quarterValues = {
1346
- narrow: ["1", "2", "3", "4"],
1347
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1348
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1349
- };
1350
- var monthValues = {
1351
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1352
- abbreviated: [
1353
- "Jan",
1354
- "Feb",
1355
- "Mar",
1356
- "Apr",
1357
- "May",
1358
- "Jun",
1359
- "Jul",
1360
- "Aug",
1361
- "Sep",
1362
- "Oct",
1363
- "Nov",
1364
- "Dec"
1365
- ],
1366
- wide: [
1367
- "January",
1368
- "February",
1369
- "March",
1370
- "April",
1371
- "May",
1372
- "June",
1373
- "July",
1374
- "August",
1375
- "September",
1376
- "October",
1377
- "November",
1378
- "December"
1379
- ]
1380
- };
1381
- var dayValues = {
1382
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
1383
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1384
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1385
- wide: [
1386
- "Sunday",
1387
- "Monday",
1388
- "Tuesday",
1389
- "Wednesday",
1390
- "Thursday",
1391
- "Friday",
1392
- "Saturday"
1393
- ]
1394
- };
1395
- var dayPeriodValues = {
1396
- narrow: {
1397
- am: "a",
1398
- pm: "p",
1399
- midnight: "mi",
1400
- noon: "n",
1401
- morning: "morning",
1402
- afternoon: "afternoon",
1403
- evening: "evening",
1404
- night: "night"
1405
- },
1406
- abbreviated: {
1407
- am: "AM",
1408
- pm: "PM",
1409
- midnight: "midnight",
1410
- noon: "noon",
1411
- morning: "morning",
1412
- afternoon: "afternoon",
1413
- evening: "evening",
1414
- night: "night"
1415
- },
1416
- wide: {
1417
- am: "a.m.",
1418
- pm: "p.m.",
1419
- midnight: "midnight",
1420
- noon: "noon",
1421
- morning: "morning",
1422
- afternoon: "afternoon",
1423
- evening: "evening",
1424
- night: "night"
1425
1072
  }
1426
- };
1427
- var formattingDayPeriodValues = {
1428
- narrow: {
1429
- am: "a",
1430
- pm: "p",
1431
- midnight: "mi",
1432
- noon: "n",
1433
- morning: "in the morning",
1434
- afternoon: "in the afternoon",
1435
- evening: "in the evening",
1436
- night: "at night"
1437
- },
1438
- abbreviated: {
1439
- am: "AM",
1440
- pm: "PM",
1441
- midnight: "midnight",
1442
- noon: "noon",
1443
- morning: "in the morning",
1444
- afternoon: "in the afternoon",
1445
- evening: "in the evening",
1446
- night: "at night"
1447
- },
1448
- wide: {
1449
- am: "a.m.",
1450
- pm: "p.m.",
1451
- midnight: "midnight",
1452
- noon: "noon",
1453
- morning: "in the morning",
1454
- afternoon: "in the afternoon",
1455
- evening: "in the evening",
1456
- night: "at night"
1073
+ if (config.packageManager) {
1074
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
1457
1075
  }
1458
- };
1459
- var ordinalNumber = (dirtyNumber, _options) => {
1460
- const number = Number(dirtyNumber);
1461
- const rem100 = number % 100;
1462
- if (rem100 > 20 || rem100 < 10) {
1463
- switch (rem100 % 10) {
1464
- case 1:
1465
- return number + "st";
1466
- case 2:
1467
- return number + "nd";
1468
- case 3:
1469
- return number + "rd";
1470
- }
1076
+ if (config.license) {
1077
+ process.env[`${prefix}LICENSE`] = config.license;
1471
1078
  }
1472
- return number + "th";
1473
- };
1474
- var localize = {
1475
- ordinalNumber,
1476
- era: buildLocalizeFn({
1477
- values: eraValues,
1478
- defaultWidth: "wide"
1479
- }),
1480
- quarter: buildLocalizeFn({
1481
- values: quarterValues,
1482
- defaultWidth: "wide",
1483
- argumentCallback: (quarter) => quarter - 1
1484
- }),
1485
- month: buildLocalizeFn({
1486
- values: monthValues,
1487
- defaultWidth: "wide"
1488
- }),
1489
- day: buildLocalizeFn({
1490
- values: dayValues,
1491
- defaultWidth: "wide"
1492
- }),
1493
- dayPeriod: buildLocalizeFn({
1494
- values: dayPeriodValues,
1495
- defaultWidth: "wide",
1496
- formattingValues: formattingDayPeriodValues,
1497
- defaultFormattingWidth: "wide"
1498
- })
1499
- };
1500
- function buildMatchFn(args) {
1501
- return (string3, options = {}) => {
1502
- const width = options.width;
1503
- const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1504
- const matchResult = string3.match(matchPattern);
1505
- if (!matchResult) {
1506
- return null;
1507
- }
1508
- const matchedString = matchResult[0];
1509
- const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1510
- const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
1511
- // [TODO] -- I challenge you to fix the type
1512
- findKey(parsePatterns, (pattern) => pattern.test(matchedString))
1079
+ if (config.homepage) {
1080
+ process.env[`${prefix}HOMEPAGE`] = config.homepage;
1081
+ }
1082
+ if (config.docs) {
1083
+ process.env[`${prefix}DOCS`] = config.docs;
1084
+ }
1085
+ if (config.portal) {
1086
+ process.env[`${prefix}PORTAL`] = config.portal;
1087
+ }
1088
+ if (config.licensing) {
1089
+ process.env[`${prefix}LICENSING`] = config.licensing;
1090
+ }
1091
+ if (config.contact) {
1092
+ process.env[`${prefix}CONTACT`] = config.contact;
1093
+ }
1094
+ if (config.support) {
1095
+ process.env[`${prefix}SUPPORT`] = config.support;
1096
+ }
1097
+ if (config.timezone) {
1098
+ process.env[`${prefix}TIMEZONE`] = config.timezone;
1099
+ process.env.TZ = config.timezone;
1100
+ process.env.DEFAULT_TIMEZONE = config.timezone;
1101
+ process.env.TIMEZONE = config.timezone;
1102
+ }
1103
+ if (config.locale) {
1104
+ process.env[`${prefix}LOCALE`] = config.locale;
1105
+ process.env.DEFAULT_LOCALE = config.locale;
1106
+ process.env.LOCALE = config.locale;
1107
+ process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1108
+ }
1109
+ if (config.configFile) {
1110
+ process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths2(
1111
+ config.configFile
1513
1112
  );
1514
- let value;
1515
- value = args.valueCallback ? args.valueCallback(key) : key;
1516
- value = options.valueCallback ? (
1517
- // [TODO] -- I challenge you to fix the type
1518
- options.valueCallback(value)
1519
- ) : value;
1520
- const rest = string3.slice(matchedString.length);
1521
- return { value, rest };
1522
- };
1523
- }
1524
- function findKey(object3, predicate) {
1525
- for (const key in object3) {
1526
- if (Object.prototype.hasOwnProperty.call(object3, key) && predicate(object3[key])) {
1527
- return key;
1113
+ }
1114
+ if (config.workspaceRoot) {
1115
+ process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths2(config.workspaceRoot);
1116
+ process.env.NX_WORKSPACE_ROOT = correctPaths2(config.workspaceRoot);
1117
+ process.env.NX_WORKSPACE_ROOT_PATH = correctPaths2(config.workspaceRoot);
1118
+ }
1119
+ if (config.directories) {
1120
+ if (!config.skipCache && config.directories.cache) {
1121
+ process.env[`${prefix}CACHE_DIR`] = correctPaths2(
1122
+ config.directories.cache
1123
+ );
1124
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1125
+ }
1126
+ if (config.directories.data) {
1127
+ process.env[`${prefix}DATA_DIR`] = correctPaths2(config.directories.data);
1128
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1129
+ }
1130
+ if (config.directories.config) {
1131
+ process.env[`${prefix}CONFIG_DIR`] = correctPaths2(
1132
+ config.directories.config
1133
+ );
1134
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1135
+ }
1136
+ if (config.directories.temp) {
1137
+ process.env[`${prefix}TEMP_DIR`] = correctPaths2(config.directories.temp);
1138
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1139
+ }
1140
+ if (config.directories.log) {
1141
+ process.env[`${prefix}LOG_DIR`] = correctPaths2(config.directories.log);
1142
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1143
+ }
1144
+ if (config.directories.build) {
1145
+ process.env[`${prefix}BUILD_DIR`] = correctPaths2(
1146
+ config.directories.build
1147
+ );
1148
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1528
1149
  }
1529
1150
  }
1530
- return void 0;
1531
- }
1532
- function findIndex(array3, predicate) {
1533
- for (let key = 0; key < array3.length; key++) {
1534
- if (predicate(array3[key])) {
1535
- return key;
1151
+ if (config.skipCache !== void 0) {
1152
+ process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
1153
+ if (config.skipCache) {
1154
+ process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
1155
+ process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
1536
1156
  }
1537
1157
  }
1538
- return void 0;
1539
- }
1540
- function buildMatchPatternFn(args) {
1541
- return (string3, options = {}) => {
1542
- const matchResult = string3.match(args.matchPattern);
1543
- if (!matchResult) return null;
1544
- const matchedString = matchResult[0];
1545
- const parseResult = string3.match(args.parsePattern);
1546
- if (!parseResult) return null;
1547
- let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1548
- value = options.valueCallback ? options.valueCallback(value) : value;
1549
- const rest = string3.slice(matchedString.length);
1550
- return { value, rest };
1551
- };
1552
- }
1553
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1554
- var parseOrdinalNumberPattern = /\d+/i;
1555
- var matchEraPatterns = {
1556
- narrow: /^(b|a)/i,
1557
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1558
- wide: /^(before christ|before common era|anno domini|common era)/i
1559
- };
1560
- var parseEraPatterns = {
1561
- any: [/^b/i, /^(a|c)/i]
1562
- };
1563
- var matchQuarterPatterns = {
1564
- narrow: /^[1234]/i,
1565
- abbreviated: /^q[1234]/i,
1566
- wide: /^[1234](th|st|nd|rd)? quarter/i
1567
- };
1568
- var parseQuarterPatterns = {
1569
- any: [/1/i, /2/i, /3/i, /4/i]
1570
- };
1571
- var matchMonthPatterns = {
1572
- narrow: /^[jfmasond]/i,
1573
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1574
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1575
- };
1576
- var parseMonthPatterns = {
1577
- narrow: [
1578
- /^j/i,
1579
- /^f/i,
1580
- /^m/i,
1581
- /^a/i,
1582
- /^m/i,
1583
- /^j/i,
1584
- /^j/i,
1585
- /^a/i,
1586
- /^s/i,
1587
- /^o/i,
1588
- /^n/i,
1589
- /^d/i
1590
- ],
1591
- any: [
1592
- /^ja/i,
1593
- /^f/i,
1594
- /^mar/i,
1595
- /^ap/i,
1596
- /^may/i,
1597
- /^jun/i,
1598
- /^jul/i,
1599
- /^au/i,
1600
- /^s/i,
1601
- /^o/i,
1602
- /^n/i,
1603
- /^d/i
1604
- ]
1605
- };
1606
- var matchDayPatterns = {
1607
- narrow: /^[smtwf]/i,
1608
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1609
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1610
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1611
- };
1612
- var parseDayPatterns = {
1613
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1614
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1615
- };
1616
- var matchDayPeriodPatterns = {
1617
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1618
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1619
- };
1620
- var parseDayPeriodPatterns = {
1621
- any: {
1622
- am: /^a/i,
1623
- pm: /^p/i,
1624
- midnight: /^mi/i,
1625
- noon: /^no/i,
1626
- morning: /morning/i,
1627
- afternoon: /afternoon/i,
1628
- evening: /evening/i,
1629
- night: /night/i
1158
+ if (config.mode) {
1159
+ process.env[`${prefix}MODE`] = config.mode;
1160
+ process.env.NODE_ENV = config.mode;
1161
+ process.env.ENVIRONMENT = config.mode;
1162
+ }
1163
+ if (config.colors?.base?.light || config.colors?.base?.dark) {
1164
+ for (const key of Object.keys(config.colors)) {
1165
+ setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
1166
+ }
1167
+ } else {
1168
+ setThemeColorsEnv(
1169
+ `${prefix}COLOR_`,
1170
+ config.colors
1171
+ );
1172
+ }
1173
+ if (config.repository) {
1174
+ process.env[`${prefix}REPOSITORY`] = config.repository;
1175
+ }
1176
+ if (config.branch) {
1177
+ process.env[`${prefix}BRANCH`] = config.branch;
1178
+ }
1179
+ if (config.preid) {
1180
+ process.env[`${prefix}PRE_ID`] = String(config.preid);
1181
+ }
1182
+ if (config.registry) {
1183
+ if (config.registry.github) {
1184
+ process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
1185
+ }
1186
+ if (config.registry.npm) {
1187
+ process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
1188
+ }
1189
+ if (config.registry.cargo) {
1190
+ process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
1191
+ }
1192
+ if (config.registry.cyclone) {
1193
+ process.env[`${prefix}REGISTRY_CYCLONE`] = String(
1194
+ config.registry.cyclone
1195
+ );
1196
+ }
1197
+ if (config.registry.container) {
1198
+ process.env[`${prefix}REGISTRY_CONTAINER`] = String(
1199
+ config.registry.container
1200
+ );
1201
+ }
1202
+ }
1203
+ if (config.logLevel) {
1204
+ process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
1205
+ process.env.LOG_LEVEL = String(config.logLevel);
1206
+ process.env.NX_VERBOSE_LOGGING = String(
1207
+ getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? true : false
1208
+ );
1209
+ process.env.RUST_BACKTRACE = getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? "full" : "none";
1210
+ }
1211
+ if (config.skipConfigLogging !== void 0) {
1212
+ process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
1213
+ config.skipConfigLogging
1214
+ );
1215
+ }
1216
+ process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
1217
+ for (const key of Object.keys(config.extensions ?? {})) {
1218
+ if (config.extensions[key] && Object.keys(config.extensions[key])) {
1219
+ setExtensionEnv(key, config.extensions[key]);
1220
+ }
1630
1221
  }
1631
1222
  };
1632
- var match = {
1633
- ordinalNumber: buildMatchPatternFn({
1634
- matchPattern: matchOrdinalNumberPattern,
1635
- parsePattern: parseOrdinalNumberPattern,
1636
- valueCallback: (value) => parseInt(value, 10)
1637
- }),
1638
- era: buildMatchFn({
1639
- matchPatterns: matchEraPatterns,
1640
- defaultMatchWidth: "wide",
1641
- parsePatterns: parseEraPatterns,
1642
- defaultParseWidth: "any"
1643
- }),
1644
- quarter: buildMatchFn({
1645
- matchPatterns: matchQuarterPatterns,
1646
- defaultMatchWidth: "wide",
1647
- parsePatterns: parseQuarterPatterns,
1648
- defaultParseWidth: "any",
1649
- valueCallback: (index) => index + 1
1650
- }),
1651
- month: buildMatchFn({
1652
- matchPatterns: matchMonthPatterns,
1653
- defaultMatchWidth: "wide",
1654
- parsePatterns: parseMonthPatterns,
1655
- defaultParseWidth: "any"
1656
- }),
1657
- day: buildMatchFn({
1658
- matchPatterns: matchDayPatterns,
1659
- defaultMatchWidth: "wide",
1660
- parsePatterns: parseDayPatterns,
1661
- defaultParseWidth: "any"
1662
- }),
1663
- dayPeriod: buildMatchFn({
1664
- matchPatterns: matchDayPeriodPatterns,
1665
- defaultMatchWidth: "any",
1666
- parsePatterns: parseDayPeriodPatterns,
1667
- defaultParseWidth: "any"
1668
- })
1223
+ var setThemeColorsEnv = (prefix, config) => {
1224
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1669
1225
  };
1670
- var enUS = {
1671
- code: "en-US",
1672
- formatDistance,
1673
- formatLong,
1674
- formatRelative,
1675
- localize,
1676
- match,
1677
- options: {
1678
- weekStartsOn: 0,
1679
- firstWeekContainsDate: 1
1226
+ var setSingleThemeColorsEnv = (prefix, config) => {
1227
+ if (config.dark) {
1228
+ process.env[`${prefix}DARK`] = config.dark;
1680
1229
  }
1681
- };
1682
- var defaultOptions = {};
1683
- function getDefaultOptions() {
1684
- return defaultOptions;
1685
- }
1686
- function toDate(argument, context) {
1687
- return constructFrom(context || argument, argument);
1688
- }
1689
- function getTimezoneOffsetInMilliseconds(date) {
1690
- const _date = toDate(date);
1691
- const utcDate = new Date(
1692
- Date.UTC(
1693
- _date.getFullYear(),
1694
- _date.getMonth(),
1695
- _date.getDate(),
1696
- _date.getHours(),
1697
- _date.getMinutes(),
1698
- _date.getSeconds(),
1699
- _date.getMilliseconds()
1700
- )
1701
- );
1702
- utcDate.setUTCFullYear(_date.getFullYear());
1703
- return +date - +utcDate;
1704
- }
1705
- function normalizeDates(context, ...dates) {
1706
- const normalize = constructFrom.bind(
1707
- null,
1708
- context || dates.find((date) => typeof date === "object")
1709
- );
1710
- return dates.map(normalize);
1711
- }
1712
- function compareAsc(dateLeft, dateRight) {
1713
- const diff = +toDate(dateLeft) - +toDate(dateRight);
1714
- if (diff < 0) return -1;
1715
- else if (diff > 0) return 1;
1716
- return diff;
1717
- }
1718
- function differenceInCalendarMonths(laterDate, earlierDate, options) {
1719
- const [laterDate_, earlierDate_] = normalizeDates(
1720
- options?.in,
1721
- laterDate,
1722
- earlierDate
1723
- );
1724
- const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
1725
- const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
1726
- return yearsDiff * 12 + monthsDiff;
1727
- }
1728
- function endOfDay(date, options) {
1729
- const _date = toDate(date, options?.in);
1730
- _date.setHours(23, 59, 59, 999);
1731
- return _date;
1732
- }
1733
- function endOfMonth(date, options) {
1734
- const _date = toDate(date, options?.in);
1735
- const month = _date.getMonth();
1736
- _date.setFullYear(_date.getFullYear(), month + 1, 0);
1737
- _date.setHours(23, 59, 59, 999);
1738
- return _date;
1739
- }
1740
- function isLastDayOfMonth(date, options) {
1741
- const _date = toDate(date, options?.in);
1742
- return +endOfDay(_date, options) === +endOfMonth(_date, options);
1743
- }
1744
- function differenceInMonths(laterDate, earlierDate, options) {
1745
- const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
1746
- options?.in,
1747
- laterDate,
1748
- laterDate,
1749
- earlierDate
1750
- );
1751
- const sign = compareAsc(workingLaterDate, earlierDate_);
1752
- const difference = Math.abs(
1753
- differenceInCalendarMonths(workingLaterDate, earlierDate_)
1754
- );
1755
- if (difference < 1) return 0;
1756
- if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
1757
- workingLaterDate.setDate(30);
1758
- workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
1759
- let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
1760
- if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
1761
- isLastMonthNotFull = false;
1230
+ if (config.light) {
1231
+ process.env[`${prefix}LIGHT`] = config.light;
1762
1232
  }
1763
- const result = sign * (difference - +isLastMonthNotFull);
1764
- return result === 0 ? 0 : result;
1765
- }
1766
- function getRoundingMethod(method) {
1767
- return (number) => {
1768
- const round = method ? Math[method] : Math.trunc;
1769
- const result = round(number);
1770
- return result === 0 ? 0 : result;
1771
- };
1772
- }
1773
- function differenceInMilliseconds(laterDate, earlierDate) {
1774
- return +toDate(laterDate) - +toDate(earlierDate);
1775
- }
1776
- function differenceInSeconds(laterDate, earlierDate, options) {
1777
- const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
1778
- return getRoundingMethod(options?.roundingMethod)(diff);
1779
- }
1780
- function formatDistance2(laterDate, earlierDate, options) {
1781
- const defaultOptions2 = getDefaultOptions();
1782
- const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
1783
- const minutesInAlmostTwoDays = 2520;
1784
- const comparison = compareAsc(laterDate, earlierDate);
1785
- if (isNaN(comparison)) throw new RangeError("Invalid time value");
1786
- const localizeOptions = Object.assign({}, options, {
1787
- addSuffix: options?.addSuffix,
1788
- comparison
1789
- });
1790
- const [laterDate_, earlierDate_] = normalizeDates(
1791
- options?.in,
1792
- ...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
1793
- );
1794
- const seconds = differenceInSeconds(earlierDate_, laterDate_);
1795
- const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1e3;
1796
- const minutes = Math.round((seconds - offsetInSeconds) / 60);
1797
- let months;
1798
- if (minutes < 2) {
1799
- if (options?.includeSeconds) {
1800
- if (seconds < 5) {
1801
- return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
1802
- } else if (seconds < 10) {
1803
- return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
1804
- } else if (seconds < 20) {
1805
- return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
1806
- } else if (seconds < 40) {
1807
- return locale.formatDistance("halfAMinute", 0, localizeOptions);
1808
- } else if (seconds < 60) {
1809
- return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
1810
- } else {
1811
- return locale.formatDistance("xMinutes", 1, localizeOptions);
1812
- }
1813
- } else {
1814
- if (minutes === 0) {
1815
- return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
1816
- } else {
1817
- return locale.formatDistance("xMinutes", minutes, localizeOptions);
1818
- }
1819
- }
1820
- } else if (minutes < 45) {
1821
- return locale.formatDistance("xMinutes", minutes, localizeOptions);
1822
- } else if (minutes < 90) {
1823
- return locale.formatDistance("aboutXHours", 1, localizeOptions);
1824
- } else if (minutes < minutesInDay) {
1825
- const hours = Math.round(minutes / 60);
1826
- return locale.formatDistance("aboutXHours", hours, localizeOptions);
1827
- } else if (minutes < minutesInAlmostTwoDays) {
1828
- return locale.formatDistance("xDays", 1, localizeOptions);
1829
- } else if (minutes < minutesInMonth) {
1830
- const days = Math.round(minutes / minutesInDay);
1831
- return locale.formatDistance("xDays", days, localizeOptions);
1832
- } else if (minutes < minutesInMonth * 2) {
1833
- months = Math.round(minutes / minutesInMonth);
1834
- return locale.formatDistance("aboutXMonths", months, localizeOptions);
1233
+ if (config.brand) {
1234
+ process.env[`${prefix}BRAND`] = config.brand;
1235
+ }
1236
+ if (config.alternate) {
1237
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1835
1238
  }
1836
- months = differenceInMonths(earlierDate_, laterDate_);
1837
- if (months < 12) {
1838
- const nearestMonth = Math.round(minutes / minutesInMonth);
1839
- return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
1840
- } else {
1841
- const monthsSinceStartOfYear = months % 12;
1842
- const years = Math.trunc(months / 12);
1843
- if (monthsSinceStartOfYear < 3) {
1844
- return locale.formatDistance("aboutXYears", years, localizeOptions);
1845
- } else if (monthsSinceStartOfYear < 9) {
1846
- return locale.formatDistance("overXYears", years, localizeOptions);
1847
- } else {
1848
- return locale.formatDistance("almostXYears", years + 1, localizeOptions);
1849
- }
1239
+ if (config.accent) {
1240
+ process.env[`${prefix}ACCENT`] = config.accent;
1850
1241
  }
1851
- }
1852
- function formatDistanceToNow2(date, options) {
1853
- return formatDistance2(date, constructNow(date), options);
1854
- }
1855
- var getLogFn = (logLevel = LogLevel2.INFO, config = {}, options = {}) => {
1856
- const {
1857
- chalk: _chalk = getChalk(),
1858
- fullDateTime = false,
1859
- hideDateTime = false
1860
- } = options;
1861
- const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
1862
- const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel2.INFO;
1863
- if (logLevel > getLogLevel2(configLogLevel) || logLevel <= LogLevel2.SILENT || getLogLevel2(configLogLevel) <= LogLevel2.SILENT) {
1864
- return (_3) => {
1865
- };
1242
+ if (config.link) {
1243
+ process.env[`${prefix}LINK`] = config.link;
1866
1244
  }
1867
- if (typeof logLevel === "number" && LogLevel2.FATAL >= logLevel) {
1868
- return (message) => {
1869
- console.error(
1870
- `
1871
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
1872
- `[${CONSOLE_ICONS2[LogLevelLabel2.FATAL]} Fatal] `
1873
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1874
- `
1875
- );
1876
- };
1245
+ if (config.help) {
1246
+ process.env[`${prefix}HELP`] = config.help;
1877
1247
  }
1878
- if (typeof logLevel === "number" && LogLevel2.ERROR >= logLevel) {
1879
- return (message) => {
1880
- console.error(
1881
- `
1882
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
1883
- `[${CONSOLE_ICONS2[LogLevelLabel2.ERROR]} Error] `
1884
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1885
- `
1886
- );
1887
- };
1248
+ if (config.success) {
1249
+ process.env[`${prefix}SUCCESS`] = config.success;
1888
1250
  }
1889
- if (typeof logLevel === "number" && LogLevel2.WARN >= logLevel) {
1890
- return (message) => {
1891
- console.warn(
1892
- `
1893
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
1894
- `[${CONSOLE_ICONS2[LogLevelLabel2.WARN]} Warn] `
1895
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1896
- `
1897
- );
1898
- };
1251
+ if (config.info) {
1252
+ process.env[`${prefix}INFO`] = config.info;
1899
1253
  }
1900
- if (typeof logLevel === "number" && LogLevel2.SUCCESS >= logLevel) {
1901
- return (message) => {
1902
- console.info(
1903
- `
1904
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
1905
- `[${CONSOLE_ICONS2[LogLevelLabel2.SUCCESS]} Success] `
1906
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1907
- `
1908
- );
1909
- };
1254
+ if (config.debug) {
1255
+ process.env[`${prefix}DEBUG`] = config.debug;
1910
1256
  }
1911
- if (typeof logLevel === "number" && LogLevel2.INFO >= logLevel) {
1912
- return (message) => {
1913
- console.info(
1914
- `
1915
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
1916
- `[${CONSOLE_ICONS2[LogLevelLabel2.INFO]} Info] `
1917
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1918
- `
1919
- );
1920
- };
1257
+ if (config.warning) {
1258
+ process.env[`${prefix}WARNING`] = config.warning;
1921
1259
  }
1922
- if (typeof logLevel === "number" && LogLevel2.PERFORMANCE >= logLevel) {
1923
- return (message) => {
1924
- console.debug(
1925
- `
1926
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
1927
- `[${CONSOLE_ICONS2[LogLevelLabel2.PERFORMANCE]} Performance] `
1928
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1929
- `
1930
- );
1931
- };
1260
+ if (config.danger) {
1261
+ process.env[`${prefix}DANGER`] = config.danger;
1932
1262
  }
1933
- if (typeof logLevel === "number" && LogLevel2.DEBUG >= logLevel) {
1934
- return (message) => {
1935
- console.debug(
1936
- `
1937
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
1938
- `[${CONSOLE_ICONS2[LogLevelLabel2.DEBUG]} Debug] `
1939
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1940
- `
1941
- );
1942
- };
1263
+ if (config.fatal) {
1264
+ process.env[`${prefix}FATAL`] = config.fatal;
1943
1265
  }
1944
- if (typeof logLevel === "number" && LogLevel2.TRACE >= logLevel) {
1945
- return (message) => {
1946
- console.debug(
1947
- `
1948
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
1949
- `[${CONSOLE_ICONS2[LogLevelLabel2.TRACE]} Trace] `
1950
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1951
- `
1952
- );
1953
- };
1266
+ if (config.performance) {
1267
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1268
+ }
1269
+ if (config.positive) {
1270
+ process.env[`${prefix}POSITIVE`] = config.positive;
1271
+ }
1272
+ if (config.negative) {
1273
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1274
+ }
1275
+ if (config.gradient) {
1276
+ for (let i3 = 0; i3 < config.gradient.length; i3++) {
1277
+ process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
1278
+ }
1954
1279
  }
1955
- return (message) => {
1956
- console.log(
1957
- `
1958
- ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
1959
- `[${CONSOLE_ICONS2[LogLevelLabel2.ALL]} System] `
1960
- )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
1961
- `
1962
- );
1963
- };
1964
1280
  };
1965
- var writeWarning2 = (message, config) => getLogFn(LogLevel2.WARN, config)(message);
1966
- var writePerformance = (message, config) => getLogFn(LogLevel2.PERFORMANCE, config)(message);
1967
- var writeDebug2 = (message, config) => getLogFn(LogLevel2.DEBUG, config)(message);
1968
- var writeTrace2 = (message, config) => getLogFn(LogLevel2.TRACE, config)(message);
1969
- var getStopwatch = (name) => {
1970
- const start = /* @__PURE__ */ new Date();
1971
- return () => {
1972
- writePerformance(
1973
- `The${name ? ` ${name}` : ""} process took ${formatDistanceToNow2(start, {
1974
- includeSeconds: true
1975
- })} to complete`
1976
- );
1281
+ var setMultiThemeColorsEnv = (prefix, config) => {
1282
+ return {
1283
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
1284
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
1977
1285
  };
1978
1286
  };
1979
- var MAX_DEPTH = 10;
1980
- var formatLogMessage2 = (message, options = {}, depth2 = 0) => {
1981
- if (depth2 > MAX_DEPTH) {
1982
- return "<max depth>";
1287
+ var setBaseThemeColorsEnv = (prefix, config) => {
1288
+ if (config.foreground) {
1289
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
1983
1290
  }
1984
- const prefix = options.prefix ?? "";
1985
- const skip = options.skip ?? [];
1986
- const sort = options.sort ?? true;
1987
- return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
1988
- ${message.map(
1989
- (item, index) => ` ${prefix}> #${index} = ${formatLogMessage2(
1990
- item,
1991
- { prefix: `${prefix}--`, skip, sort },
1992
- depth2 + 1
1993
- )}`
1994
- ).join("\n")}` : typeof message === "object" ? `
1995
- ${Object.keys(message).filter(
1996
- (key) => !skip.map((k2) => k2.toLowerCase()).includes(typeof key === "string" ? key.toLowerCase() : key)
1997
- ).sort(sort ? (a3, b2) => a3.localeCompare(b2) : void 0).map(
1998
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? Object.keys(message[key]).filter(
1999
- (key2) => !skip.map((k2) => k2.toLowerCase()).includes(
2000
- typeof key2 === "string" ? key2.toLowerCase() : key2
2001
- )
2002
- ).length === 0 ? "{}" : formatLogMessage2(
2003
- message[key],
2004
- { prefix: `${prefix}--`, skip, sort },
2005
- depth2 + 1
2006
- ) : message[key]}`
2007
- ).join("\n")}` : String(message);
2008
- };
2009
- var _isFunction = (value) => {
2010
- try {
2011
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
2012
- } catch {
2013
- return false;
1291
+ if (config.background) {
1292
+ process.env[`${prefix}BACKGROUND`] = config.background;
2014
1293
  }
2015
- };
2016
-
2017
- // ../config-tools/dist/chunk-RT5536G5.js
2018
- import { loadConfig as loadConfig2 } from "c12";
2019
- import defu3 from "defu";
2020
- var getConfigFileByName = async (fileName, filePath, options = {}) => {
2021
- const workspacePath = filePath || findWorkspaceRoot2(filePath);
2022
- const configs = await Promise.all([
2023
- loadConfig2({
2024
- cwd: workspacePath,
2025
- packageJson: true,
2026
- name: fileName,
2027
- envName: fileName?.toUpperCase(),
2028
- jitiOptions: {
2029
- debug: false,
2030
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2031
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2032
- "jiti"
2033
- )
2034
- },
2035
- ...options
2036
- }),
2037
- loadConfig2({
2038
- cwd: workspacePath,
2039
- packageJson: true,
2040
- name: fileName,
2041
- envName: fileName?.toUpperCase(),
2042
- jitiOptions: {
2043
- debug: false,
2044
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2045
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2046
- "jiti"
2047
- )
2048
- },
2049
- configFile: fileName,
2050
- ...options
2051
- })
2052
- ]);
2053
- return defu3(configs[0] ?? {}, configs[1] ?? {});
2054
- };
2055
- var getConfigFile = async (filePath, additionalFileNames = []) => {
2056
- const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
2057
- const result = await getConfigFileByName("storm-workspace", workspacePath);
2058
- let config = result.config;
2059
- const configFile = result.configFile;
2060
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
2061
- writeTrace2(
2062
- `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
2063
- {
2064
- logLevel: "all"
2065
- }
2066
- );
1294
+ if (config.brand) {
1295
+ process.env[`${prefix}BRAND`] = config.brand;
1296
+ }
1297
+ if (config.alternate) {
1298
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
2067
1299
  }
2068
- if (additionalFileNames && additionalFileNames.length > 0) {
2069
- const results = await Promise.all(
2070
- additionalFileNames.map(
2071
- (fileName) => getConfigFileByName(fileName, workspacePath)
2072
- )
2073
- );
2074
- for (const result2 of results) {
2075
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
2076
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
2077
- writeTrace2(
2078
- `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
2079
- {
2080
- logLevel: "all"
2081
- }
2082
- );
2083
- }
2084
- config = defu3(result2.config ?? {}, config ?? {});
2085
- }
2086
- }
1300
+ if (config.accent) {
1301
+ process.env[`${prefix}ACCENT`] = config.accent;
2087
1302
  }
2088
- if (!config || Object.keys(config).length === 0) {
2089
- return void 0;
1303
+ if (config.link) {
1304
+ process.env[`${prefix}LINK`] = config.link;
1305
+ }
1306
+ if (config.help) {
1307
+ process.env[`${prefix}HELP`] = config.help;
1308
+ }
1309
+ if (config.success) {
1310
+ process.env[`${prefix}SUCCESS`] = config.success;
1311
+ }
1312
+ if (config.info) {
1313
+ process.env[`${prefix}INFO`] = config.info;
1314
+ }
1315
+ if (config.debug) {
1316
+ process.env[`${prefix}DEBUG`] = config.debug;
1317
+ }
1318
+ if (config.warning) {
1319
+ process.env[`${prefix}WARNING`] = config.warning;
1320
+ }
1321
+ if (config.danger) {
1322
+ process.env[`${prefix}DANGER`] = config.danger;
1323
+ }
1324
+ if (config.fatal) {
1325
+ process.env[`${prefix}FATAL`] = config.fatal;
1326
+ }
1327
+ if (config.performance) {
1328
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1329
+ }
1330
+ if (config.positive) {
1331
+ process.env[`${prefix}POSITIVE`] = config.positive;
1332
+ }
1333
+ if (config.negative) {
1334
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1335
+ }
1336
+ if (config.gradient) {
1337
+ for (let i3 = 0; i3 < config.gradient.length; i3++) {
1338
+ process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
1339
+ }
2090
1340
  }
2091
- config.configFile = configFile;
2092
- return config;
2093
1341
  };
2094
1342
 
2095
- // ../config-tools/dist/chunk-RGET2UQV.js
1343
+ // ../config-tools/dist/chunk-A5JXMY6X.js
2096
1344
  init_esm_shims();
2097
1345
 
2098
1346
  // ../config/dist/index.js
@@ -2299,696 +1547,1454 @@ o2.add(x, { description: "Storm Workspace config values used during various dev-
2299
1547
  init_esm_shims();
2300
1548
  var e3 = ["dark", "light", "base", "brand", "alternate", "accent", "link", "success", "help", "info", "warning", "danger", "fatal", "performance", "positive", "negative"];
2301
1549
 
2302
- // ../config-tools/dist/chunk-RGET2UQV.js
2303
- import { existsSync as existsSync6 } from "node:fs";
2304
- import { readFile as readFile5 } from "node:fs/promises";
2305
- import { join as join4 } from "node:path";
2306
- async function getPackageJsonConfig(root) {
2307
- let license = i;
2308
- let homepage = void 0;
2309
- let support = void 0;
2310
- let name = void 0;
2311
- let namespace = void 0;
2312
- let repository = void 0;
2313
- const workspaceRoot = findWorkspaceRoot2(root);
2314
- if (existsSync6(join4(workspaceRoot, "package.json"))) {
2315
- const file = await readFile5(
2316
- joinPaths2(workspaceRoot, "package.json"),
2317
- "utf8"
2318
- );
2319
- if (file) {
2320
- const packageJson = JSON.parse(file);
2321
- if (packageJson.name) {
2322
- name = packageJson.name;
2323
- }
2324
- if (packageJson.namespace) {
2325
- namespace = packageJson.namespace;
2326
- }
2327
- if (packageJson.repository) {
2328
- if (typeof packageJson.repository === "string") {
2329
- repository = packageJson.repository;
2330
- } else if (packageJson.repository.url) {
2331
- repository = packageJson.repository.url;
2332
- }
2333
- }
2334
- if (packageJson.license) {
2335
- license = packageJson.license;
2336
- }
2337
- if (packageJson.homepage) {
2338
- homepage = packageJson.homepage;
2339
- }
2340
- if (packageJson.bugs) {
2341
- if (typeof packageJson.bugs === "string") {
2342
- support = packageJson.bugs;
2343
- } else if (packageJson.bugs.url) {
2344
- support = packageJson.bugs.url;
2345
- }
2346
- }
1550
+ // ../config-tools/dist/chunk-A5JXMY6X.js
1551
+ var getExtensionEnv = (extensionName) => {
1552
+ const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
1553
+ return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
1554
+ const name = key.replace(prefix, "").split("_").map(
1555
+ (i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
1556
+ ).join("");
1557
+ if (name) {
1558
+ ret[name] = process.env[key];
2347
1559
  }
2348
- }
2349
- return {
2350
- workspaceRoot,
2351
- name,
2352
- namespace,
2353
- repository,
2354
- license,
2355
- homepage,
2356
- support
1560
+ return ret;
1561
+ }, {});
1562
+ };
1563
+ var getConfigEnv = () => {
1564
+ const prefix = "STORM_";
1565
+ let config = {
1566
+ extends: process.env[`${prefix}EXTENDS`] || void 0,
1567
+ name: process.env[`${prefix}NAME`] || void 0,
1568
+ variant: process.env[`${prefix}VARIANT`] || void 0,
1569
+ namespace: process.env[`${prefix}NAMESPACE`] || void 0,
1570
+ owner: process.env[`${prefix}OWNER`] || void 0,
1571
+ bot: {
1572
+ name: process.env[`${prefix}BOT_NAME`] || void 0,
1573
+ email: process.env[`${prefix}BOT_EMAIL`] || void 0
1574
+ },
1575
+ release: {
1576
+ banner: {
1577
+ url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
1578
+ alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
1579
+ },
1580
+ header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
1581
+ footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
1582
+ },
1583
+ error: {
1584
+ codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
1585
+ url: process.env[`${prefix}ERROR_URL`] || void 0
1586
+ },
1587
+ socials: {
1588
+ twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
1589
+ discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
1590
+ telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
1591
+ slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
1592
+ medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
1593
+ github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
1594
+ },
1595
+ 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`] ? {
1596
+ name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
1597
+ description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
1598
+ url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
1599
+ logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
1600
+ icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
1601
+ } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
1602
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
1603
+ license: process.env[`${prefix}LICENSE`] || void 0,
1604
+ homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
1605
+ docs: process.env[`${prefix}DOCS`] || void 0,
1606
+ portal: process.env[`${prefix}PORTAL`] || void 0,
1607
+ licensing: process.env[`${prefix}LICENSING`] || void 0,
1608
+ contact: process.env[`${prefix}CONTACT`] || void 0,
1609
+ support: process.env[`${prefix}SUPPORT`] || void 0,
1610
+ timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
1611
+ locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
1612
+ configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
1613
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
1614
+ directories: {
1615
+ 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,
1616
+ 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,
1617
+ 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,
1618
+ 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,
1619
+ 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,
1620
+ 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
1621
+ },
1622
+ skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
1623
+ mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
1624
+ // ci:
1625
+ // process.env[`${prefix}CI`] !== undefined
1626
+ // ? Boolean(
1627
+ // process.env[`${prefix}CI`] ??
1628
+ // process.env.CI ??
1629
+ // process.env.CONTINUOUS_INTEGRATION
1630
+ // )
1631
+ // : undefined,
1632
+ repository: process.env[`${prefix}REPOSITORY`] || void 0,
1633
+ branch: process.env[`${prefix}BRANCH`] || void 0,
1634
+ preid: process.env[`${prefix}PRE_ID`] || void 0,
1635
+ registry: {
1636
+ github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
1637
+ npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
1638
+ cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
1639
+ cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
1640
+ container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
1641
+ },
1642
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
1643
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1644
+ ) ? getLogLevelLabel2(
1645
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
1646
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
1647
+ skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
2357
1648
  };
2358
- }
2359
- function applyDefaultConfig(config) {
2360
- if (!config.support && config.contact) {
2361
- config.support = config.contact;
2362
- }
2363
- if (!config.contact && config.support) {
2364
- config.contact = config.support;
2365
- }
2366
- if (config.homepage) {
2367
- if (!config.docs) {
2368
- config.docs = `${config.homepage}/docs`;
2369
- }
2370
- if (!config.license) {
2371
- config.license = `${config.homepage}/license`;
2372
- }
2373
- if (!config.support) {
2374
- config.support = `${config.homepage}/support`;
2375
- }
2376
- if (!config.contact) {
2377
- config.contact = `${config.homepage}/contact`;
2378
- }
2379
- if (!config.error?.codesFile || !config?.error?.url) {
2380
- config.error ??= { codesFile: S };
2381
- if (config.homepage) {
2382
- config.error.url ??= `${config.homepage}/errors`;
2383
- }
1649
+ const themeNames = Object.keys(process.env).filter(
1650
+ (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
1651
+ (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
1652
+ )
1653
+ );
1654
+ config.colors = themeNames.length > 0 ? themeNames.reduce(
1655
+ (ret, themeName) => {
1656
+ ret[themeName] = getThemeColorsEnv(prefix, themeName);
1657
+ return ret;
1658
+ },
1659
+ {}
1660
+ ) : getThemeColorsEnv(prefix);
1661
+ if (config.docs === s) {
1662
+ if (config.homepage === r) {
1663
+ config.docs = `${r}/projects/${config.name}/docs`;
1664
+ } else {
1665
+ config.docs = `${config.homepage}/docs`;
2384
1666
  }
2385
1667
  }
2386
- return config;
2387
- }
2388
-
2389
- // ../config-tools/dist/chunk-SDSQ2HHF.js
2390
- init_esm_shims();
2391
- var setExtensionEnv = (extensionName, extension) => {
2392
- for (const key of Object.keys(extension ?? {})) {
2393
- if (extension[key]) {
2394
- const result = key?.replace(
2395
- /([A-Z])+/g,
2396
- (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
2397
- ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
2398
- let extensionKey;
2399
- if (result.length === 0) {
2400
- return;
2401
- }
2402
- if (result.length === 1) {
2403
- extensionKey = result[0]?.toUpperCase() ?? "";
2404
- } else {
2405
- extensionKey = result.reduce((ret, part) => {
2406
- return `${ret}_${part.toLowerCase()}`;
2407
- });
2408
- }
2409
- process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
1668
+ if (config.licensing === a) {
1669
+ if (config.homepage === r) {
1670
+ config.licensing = `${r}/projects/${config.name}/licensing`;
1671
+ } else {
1672
+ config.licensing = `${config.homepage}/docs`;
2410
1673
  }
2411
1674
  }
2412
- };
2413
- var setConfigEnv = (config) => {
2414
- const prefix = "STORM_";
2415
- if (config.extends) {
2416
- process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
2417
- }
2418
- if (config.name) {
2419
- process.env[`${prefix}NAME`] = config.name;
2420
- }
2421
- if (config.variant) {
2422
- process.env[`${prefix}VARIANT`] = config.variant;
2423
- }
2424
- if (config.namespace) {
2425
- process.env[`${prefix}NAMESPACE`] = config.namespace;
2426
- }
2427
- if (config.owner) {
2428
- process.env[`${prefix}OWNER`] = config.owner;
2429
- }
2430
- if (config.bot) {
2431
- process.env[`${prefix}BOT_NAME`] = config.bot.name;
2432
- process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
2433
- }
2434
- if (config.error) {
2435
- process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
2436
- process.env[`${prefix}ERROR_URL`] = config.error.url;
2437
- }
2438
- if (config.release) {
2439
- if (config.release.banner) {
2440
- if (typeof config.release.banner === "string") {
2441
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
2442
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
2443
- } else {
2444
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
2445
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
2446
- process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
2447
- }
2448
- }
2449
- process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
2450
- process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1675
+ const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
1676
+ if (serializedConfig) {
1677
+ const parsed = JSON.parse(serializedConfig);
1678
+ config = {
1679
+ ...config,
1680
+ ...parsed,
1681
+ colors: { ...config.colors, ...parsed.colors },
1682
+ extensions: { ...config.extensions, ...parsed.extensions }
1683
+ };
2451
1684
  }
2452
- if (config.socials) {
2453
- if (config.socials.twitter) {
2454
- process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
2455
- }
2456
- if (config.socials.discord) {
2457
- process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
2458
- }
2459
- if (config.socials.telegram) {
2460
- process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
2461
- }
2462
- if (config.socials.slack) {
2463
- process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
2464
- }
2465
- if (config.socials.medium) {
2466
- process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
2467
- }
2468
- if (config.socials.github) {
2469
- process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
1685
+ return config;
1686
+ };
1687
+ var getThemeColorsEnv = (prefix, theme) => {
1688
+ const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
1689
+ return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
1690
+ };
1691
+ var getSingleThemeColorsEnv = (prefix) => {
1692
+ const gradient = [];
1693
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1694
+ gradient.push(
1695
+ process.env[`${prefix}GRADIENT_START`],
1696
+ process.env[`${prefix}GRADIENT_END`]
1697
+ );
1698
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1699
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1700
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1701
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1702
+ index++;
2470
1703
  }
2471
1704
  }
2472
- if (config.organization) {
2473
- if (typeof config.organization === "string") {
2474
- process.env[`${prefix}ORG`] = config.organization;
2475
- process.env[`${prefix}ORG_NAME`] = config.organization;
2476
- process.env[`${prefix}ORGANIZATION`] = config.organization;
2477
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
2478
- } else {
2479
- process.env[`${prefix}ORG`] = config.organization.name;
2480
- process.env[`${prefix}ORG_NAME`] = config.organization.name;
2481
- process.env[`${prefix}ORGANIZATION`] = config.organization.name;
2482
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
2483
- if (config.organization.url) {
2484
- process.env[`${prefix}ORG_URL`] = config.organization.url;
2485
- process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
2486
- }
2487
- if (config.organization.description) {
2488
- process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
2489
- process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
2490
- }
2491
- if (config.organization.logo) {
2492
- process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
2493
- process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
2494
- }
2495
- if (config.organization.icon) {
2496
- process.env[`${prefix}ORG_ICON`] = config.organization.icon;
2497
- process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
2498
- }
1705
+ return {
1706
+ dark: process.env[`${prefix}DARK`],
1707
+ light: process.env[`${prefix}LIGHT`],
1708
+ brand: process.env[`${prefix}BRAND`],
1709
+ alternate: process.env[`${prefix}ALTERNATE`],
1710
+ accent: process.env[`${prefix}ACCENT`],
1711
+ link: process.env[`${prefix}LINK`],
1712
+ help: process.env[`${prefix}HELP`],
1713
+ success: process.env[`${prefix}SUCCESS`],
1714
+ info: process.env[`${prefix}INFO`],
1715
+ debug: process.env[`${prefix}DEBUG`],
1716
+ warning: process.env[`${prefix}WARNING`],
1717
+ danger: process.env[`${prefix}DANGER`],
1718
+ fatal: process.env[`${prefix}FATAL`],
1719
+ performance: process.env[`${prefix}PERFORMANCE`],
1720
+ positive: process.env[`${prefix}POSITIVE`],
1721
+ negative: process.env[`${prefix}NEGATIVE`],
1722
+ gradient
1723
+ };
1724
+ };
1725
+ var getMultiThemeColorsEnv = (prefix) => {
1726
+ return {
1727
+ light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
1728
+ dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
1729
+ };
1730
+ };
1731
+ var getBaseThemeColorsEnv = (prefix) => {
1732
+ const gradient = [];
1733
+ if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
1734
+ gradient.push(
1735
+ process.env[`${prefix}GRADIENT_START`],
1736
+ process.env[`${prefix}GRADIENT_END`]
1737
+ );
1738
+ } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
1739
+ let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
1740
+ while (process.env[`${prefix}GRADIENT_${index}`]) {
1741
+ gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
1742
+ index++;
2499
1743
  }
2500
1744
  }
2501
- if (config.packageManager) {
2502
- process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
2503
- }
2504
- if (config.license) {
2505
- process.env[`${prefix}LICENSE`] = config.license;
2506
- }
2507
- if (config.homepage) {
2508
- process.env[`${prefix}HOMEPAGE`] = config.homepage;
1745
+ return {
1746
+ foreground: process.env[`${prefix}FOREGROUND`],
1747
+ background: process.env[`${prefix}BACKGROUND`],
1748
+ brand: process.env[`${prefix}BRAND`],
1749
+ alternate: process.env[`${prefix}ALTERNATE`],
1750
+ accent: process.env[`${prefix}ACCENT`],
1751
+ link: process.env[`${prefix}LINK`],
1752
+ help: process.env[`${prefix}HELP`],
1753
+ success: process.env[`${prefix}SUCCESS`],
1754
+ info: process.env[`${prefix}INFO`],
1755
+ debug: process.env[`${prefix}DEBUG`],
1756
+ warning: process.env[`${prefix}WARNING`],
1757
+ danger: process.env[`${prefix}DANGER`],
1758
+ fatal: process.env[`${prefix}FATAL`],
1759
+ performance: process.env[`${prefix}PERFORMANCE`],
1760
+ positive: process.env[`${prefix}POSITIVE`],
1761
+ negative: process.env[`${prefix}NEGATIVE`],
1762
+ gradient
1763
+ };
1764
+ };
1765
+
1766
+ // ../config-tools/dist/chunk-NT26TB4H.js
1767
+ init_esm_shims();
1768
+
1769
+ // ../config-tools/dist/chunk-LF3SAK2O.js
1770
+ init_esm_shims();
1771
+
1772
+ // ../config-tools/dist/chunk-RUKM6FCF.js
1773
+ init_esm_shims();
1774
+ import { existsSync as existsSync5 } from "node:fs";
1775
+ import { join as join3 } from "node:path";
1776
+ var MAX_PATH_SEARCH_DEPTH = 30;
1777
+ var depth = 0;
1778
+ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
1779
+ const _startPath = startPath ?? process.cwd();
1780
+ if (endDirectoryNames.some(
1781
+ (endDirName) => existsSync5(join3(_startPath, endDirName))
1782
+ )) {
1783
+ return _startPath;
2509
1784
  }
2510
- if (config.docs) {
2511
- process.env[`${prefix}DOCS`] = config.docs;
1785
+ if (endFileNames.some((endFileName) => existsSync5(join3(_startPath, endFileName)))) {
1786
+ return _startPath;
2512
1787
  }
2513
- if (config.portal) {
2514
- process.env[`${prefix}PORTAL`] = config.portal;
1788
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
1789
+ const parent = join3(_startPath, "..");
1790
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
2515
1791
  }
2516
- if (config.licensing) {
2517
- process.env[`${prefix}LICENSING`] = config.licensing;
1792
+ return void 0;
1793
+ }
1794
+
1795
+ // ../config-tools/dist/chunk-LF3SAK2O.js
1796
+ var rootFiles = [
1797
+ "storm-workspace.json",
1798
+ "storm-workspace.yaml",
1799
+ "storm-workspace.yml",
1800
+ "storm-workspace.js",
1801
+ "storm-workspace.ts",
1802
+ ".storm-workspace.json",
1803
+ ".storm-workspace.yaml",
1804
+ ".storm-workspace.yml",
1805
+ ".storm-workspace.js",
1806
+ ".storm-workspace.ts",
1807
+ "lerna.json",
1808
+ "nx.json",
1809
+ "turbo.json",
1810
+ "npm-workspace.json",
1811
+ "yarn-workspace.json",
1812
+ "pnpm-workspace.json",
1813
+ "npm-workspace.yaml",
1814
+ "yarn-workspace.yaml",
1815
+ "pnpm-workspace.yaml",
1816
+ "npm-workspace.yml",
1817
+ "yarn-workspace.yml",
1818
+ "pnpm-workspace.yml",
1819
+ "npm-lock.json",
1820
+ "yarn-lock.json",
1821
+ "pnpm-lock.json",
1822
+ "npm-lock.yaml",
1823
+ "yarn-lock.yaml",
1824
+ "pnpm-lock.yaml",
1825
+ "npm-lock.yml",
1826
+ "yarn-lock.yml",
1827
+ "pnpm-lock.yml",
1828
+ "bun.lockb"
1829
+ ];
1830
+ var rootDirectories = [
1831
+ ".storm-workspace",
1832
+ ".nx",
1833
+ ".git",
1834
+ ".github",
1835
+ ".vscode",
1836
+ ".verdaccio"
1837
+ ];
1838
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
1839
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
1840
+ return correctPaths2(
1841
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
1842
+ );
2518
1843
  }
2519
- if (config.contact) {
2520
- process.env[`${prefix}CONTACT`] = config.contact;
1844
+ return correctPaths2(
1845
+ findFolderUp(
1846
+ pathInsideMonorepo ?? process.cwd(),
1847
+ rootFiles,
1848
+ rootDirectories
1849
+ )
1850
+ );
1851
+ }
1852
+ function findWorkspaceRoot2(pathInsideMonorepo) {
1853
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
1854
+ if (!result) {
1855
+ throw new Error(
1856
+ `Cannot find workspace root upwards from known path. Files search list includes:
1857
+ ${rootFiles.join(
1858
+ "\n"
1859
+ )}
1860
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
1861
+ );
2521
1862
  }
2522
- if (config.support) {
2523
- process.env[`${prefix}SUPPORT`] = config.support;
1863
+ return result;
1864
+ }
1865
+
1866
+ // ../config-tools/dist/chunk-O76J367J.js
1867
+ init_esm_shims();
1868
+
1869
+ // ../config-tools/dist/chunk-5DQF4GNF.js
1870
+ init_esm_shims();
1871
+ var DEFAULT_COLOR_CONFIG = {
1872
+ light: {
1873
+ background: "#fafafa",
1874
+ foreground: "#1d1e22",
1875
+ brand: "#1fb2a6",
1876
+ alternate: "#db2777",
1877
+ help: "#5C4EE5",
1878
+ success: "#087f5b",
1879
+ info: "#0550ae",
1880
+ debug: "#8afafc",
1881
+ warning: "#e3b341",
1882
+ danger: "#D8314A",
1883
+ fatal: "#51070f",
1884
+ performance: "#13c302",
1885
+ link: "#3fa6ff",
1886
+ positive: "#22c55e",
1887
+ negative: "#dc2626",
1888
+ gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
1889
+ },
1890
+ dark: {
1891
+ background: "#1d1e22",
1892
+ foreground: "#cbd5e1",
1893
+ brand: "#2dd4bf",
1894
+ alternate: "#db2777",
1895
+ help: "#818cf8",
1896
+ success: "#10b981",
1897
+ info: "#58a6ff",
1898
+ debug: "#8afafc",
1899
+ warning: "#f3d371",
1900
+ danger: "#D8314A",
1901
+ fatal: "#a40e26",
1902
+ performance: "#80fd74",
1903
+ link: "#3fa6ff",
1904
+ positive: "#22c55e",
1905
+ negative: "#dc2626",
1906
+ gradient: ["#1fb2a6", "#db2777", "#818cf8"]
2524
1907
  }
2525
- if (config.timezone) {
2526
- process.env[`${prefix}TIMEZONE`] = config.timezone;
2527
- process.env.TZ = config.timezone;
2528
- process.env.DEFAULT_TIMEZONE = config.timezone;
2529
- process.env.TIMEZONE = config.timezone;
1908
+ };
1909
+
1910
+ // ../config-tools/dist/chunk-JZAYHDV3.js
1911
+ init_esm_shims();
1912
+ var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
1913
+ return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
1914
+ };
1915
+
1916
+ // ../config-tools/dist/chunk-HVVJHTFS.js
1917
+ init_esm_shims();
1918
+ import chalk2 from "chalk";
1919
+ var chalkDefault = {
1920
+ hex: (_3) => (message) => message,
1921
+ bgHex: (_3) => ({
1922
+ whiteBright: (message) => message,
1923
+ white: (message) => message
1924
+ }),
1925
+ white: (message) => message,
1926
+ whiteBright: (message) => message,
1927
+ gray: (message) => message,
1928
+ bold: {
1929
+ hex: (_3) => (message) => message,
1930
+ bgHex: (_3) => ({
1931
+ whiteBright: (message) => message,
1932
+ white: (message) => message
1933
+ }),
1934
+ whiteBright: (message) => message,
1935
+ white: (message) => message
1936
+ },
1937
+ dim: {
1938
+ hex: (_3) => (message) => message,
1939
+ gray: (message) => message
2530
1940
  }
2531
- if (config.locale) {
2532
- process.env[`${prefix}LOCALE`] = config.locale;
2533
- process.env.DEFAULT_LOCALE = config.locale;
2534
- process.env.LOCALE = config.locale;
2535
- process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
1941
+ };
1942
+ var getChalk = () => {
1943
+ let _chalk = chalk2;
1944
+ if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
1945
+ _chalk = chalkDefault;
2536
1946
  }
2537
- if (config.configFile) {
2538
- process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths2(
2539
- config.configFile
2540
- );
1947
+ return _chalk;
1948
+ };
1949
+
1950
+ // ../config-tools/dist/chunk-ZFNAUMQS.js
1951
+ init_esm_shims();
1952
+
1953
+ // ../config-tools/dist/chunk-G2MK47WL.js
1954
+ init_esm_shims();
1955
+ function isUnicodeSupported2() {
1956
+ if (process.platform !== "win32") {
1957
+ return process.env.TERM !== "linux";
2541
1958
  }
2542
- if (config.workspaceRoot) {
2543
- process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths2(config.workspaceRoot);
2544
- process.env.NX_WORKSPACE_ROOT = correctPaths2(config.workspaceRoot);
2545
- process.env.NX_WORKSPACE_ROOT_PATH = correctPaths2(config.workspaceRoot);
1959
+ return Boolean(process.env.WT_SESSION) || // Windows Terminal
1960
+ Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
1961
+ process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
1962
+ 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";
1963
+ }
1964
+
1965
+ // ../config-tools/dist/chunk-ZFNAUMQS.js
1966
+ var useIcon2 = (c3, fallback) => isUnicodeSupported2() ? c3 : fallback;
1967
+ var CONSOLE_ICONS2 = {
1968
+ [LogLevelLabel2.ERROR]: useIcon2("\u2718", "\xD7"),
1969
+ [LogLevelLabel2.FATAL]: useIcon2("\u{1F571}", "\xD7"),
1970
+ [LogLevelLabel2.WARN]: useIcon2("\u26A0", "\u203C"),
1971
+ [LogLevelLabel2.INFO]: useIcon2("\u2139", "i"),
1972
+ [LogLevelLabel2.PERFORMANCE]: useIcon2("\u23F1", "\u23F1"),
1973
+ [LogLevelLabel2.SUCCESS]: useIcon2("\u2714", "\u221A"),
1974
+ [LogLevelLabel2.DEBUG]: useIcon2("\u{1F6E0}", "D"),
1975
+ [LogLevelLabel2.TRACE]: useIcon2("\u2699", "T"),
1976
+ [LogLevelLabel2.ALL]: useIcon2("\u2709", "\u2192")
1977
+ };
1978
+
1979
+ // ../config-tools/dist/chunk-O76J367J.js
1980
+ var daysInYear = 365.2425;
1981
+ var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
1982
+ var minTime = -maxTime;
1983
+ var minutesInMonth = 43200;
1984
+ var minutesInDay = 1440;
1985
+ var secondsInHour = 3600;
1986
+ var secondsInDay = secondsInHour * 24;
1987
+ var secondsInWeek = secondsInDay * 7;
1988
+ var secondsInYear = secondsInDay * daysInYear;
1989
+ var secondsInMonth = secondsInYear / 12;
1990
+ var secondsInQuarter = secondsInMonth * 3;
1991
+ var constructFromSymbol = Symbol.for("constructDateFrom");
1992
+ function constructFrom(date, value) {
1993
+ if (typeof date === "function") return date(value);
1994
+ if (date && typeof date === "object" && constructFromSymbol in date)
1995
+ return date[constructFromSymbol](value);
1996
+ if (date instanceof Date) return new date.constructor(value);
1997
+ return new Date(value);
1998
+ }
1999
+ function constructNow(date) {
2000
+ return constructFrom(date, Date.now());
2001
+ }
2002
+ var formatDistanceLocale = {
2003
+ lessThanXSeconds: {
2004
+ one: "less than a second",
2005
+ other: "less than {{count}} seconds"
2006
+ },
2007
+ xSeconds: {
2008
+ one: "1 second",
2009
+ other: "{{count}} seconds"
2010
+ },
2011
+ halfAMinute: "half a minute",
2012
+ lessThanXMinutes: {
2013
+ one: "less than a minute",
2014
+ other: "less than {{count}} minutes"
2015
+ },
2016
+ xMinutes: {
2017
+ one: "1 minute",
2018
+ other: "{{count}} minutes"
2019
+ },
2020
+ aboutXHours: {
2021
+ one: "about 1 hour",
2022
+ other: "about {{count}} hours"
2023
+ },
2024
+ xHours: {
2025
+ one: "1 hour",
2026
+ other: "{{count}} hours"
2027
+ },
2028
+ xDays: {
2029
+ one: "1 day",
2030
+ other: "{{count}} days"
2031
+ },
2032
+ aboutXWeeks: {
2033
+ one: "about 1 week",
2034
+ other: "about {{count}} weeks"
2035
+ },
2036
+ xWeeks: {
2037
+ one: "1 week",
2038
+ other: "{{count}} weeks"
2039
+ },
2040
+ aboutXMonths: {
2041
+ one: "about 1 month",
2042
+ other: "about {{count}} months"
2043
+ },
2044
+ xMonths: {
2045
+ one: "1 month",
2046
+ other: "{{count}} months"
2047
+ },
2048
+ aboutXYears: {
2049
+ one: "about 1 year",
2050
+ other: "about {{count}} years"
2051
+ },
2052
+ xYears: {
2053
+ one: "1 year",
2054
+ other: "{{count}} years"
2055
+ },
2056
+ overXYears: {
2057
+ one: "over 1 year",
2058
+ other: "over {{count}} years"
2059
+ },
2060
+ almostXYears: {
2061
+ one: "almost 1 year",
2062
+ other: "almost {{count}} years"
2546
2063
  }
2547
- if (config.directories) {
2548
- if (!config.skipCache && config.directories.cache) {
2549
- process.env[`${prefix}CACHE_DIR`] = correctPaths2(
2550
- config.directories.cache
2551
- );
2552
- process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
2553
- }
2554
- if (config.directories.data) {
2555
- process.env[`${prefix}DATA_DIR`] = correctPaths2(config.directories.data);
2556
- process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
2557
- }
2558
- if (config.directories.config) {
2559
- process.env[`${prefix}CONFIG_DIR`] = correctPaths2(
2560
- config.directories.config
2561
- );
2562
- process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
2563
- }
2564
- if (config.directories.temp) {
2565
- process.env[`${prefix}TEMP_DIR`] = correctPaths2(config.directories.temp);
2566
- process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
2567
- }
2568
- if (config.directories.log) {
2569
- process.env[`${prefix}LOG_DIR`] = correctPaths2(config.directories.log);
2570
- process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
2571
- }
2572
- if (config.directories.build) {
2573
- process.env[`${prefix}BUILD_DIR`] = correctPaths2(
2574
- config.directories.build
2575
- );
2576
- process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
2577
- }
2064
+ };
2065
+ var formatDistance = (token, count, options) => {
2066
+ let result;
2067
+ const tokenValue = formatDistanceLocale[token];
2068
+ if (typeof tokenValue === "string") {
2069
+ result = tokenValue;
2070
+ } else if (count === 1) {
2071
+ result = tokenValue.one;
2072
+ } else {
2073
+ result = tokenValue.other.replace("{{count}}", count.toString());
2578
2074
  }
2579
- if (config.skipCache !== void 0) {
2580
- process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
2581
- if (config.skipCache) {
2582
- process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
2583
- process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
2075
+ if (options?.addSuffix) {
2076
+ if (options.comparison && options.comparison > 0) {
2077
+ return "in " + result;
2078
+ } else {
2079
+ return result + " ago";
2584
2080
  }
2585
2081
  }
2586
- if (config.mode) {
2587
- process.env[`${prefix}MODE`] = config.mode;
2588
- process.env.NODE_ENV = config.mode;
2589
- process.env.ENVIRONMENT = config.mode;
2590
- }
2591
- if (config.colors?.base?.light || config.colors?.base?.dark) {
2592
- for (const key of Object.keys(config.colors)) {
2593
- setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
2082
+ return result;
2083
+ };
2084
+ function buildFormatLongFn(args) {
2085
+ return (options = {}) => {
2086
+ const width = options.width ? String(options.width) : args.defaultWidth;
2087
+ const format2 = args.formats[width] || args.formats[args.defaultWidth];
2088
+ return format2;
2089
+ };
2090
+ }
2091
+ var dateFormats = {
2092
+ full: "EEEE, MMMM do, y",
2093
+ long: "MMMM do, y",
2094
+ medium: "MMM d, y",
2095
+ short: "MM/dd/yyyy"
2096
+ };
2097
+ var timeFormats = {
2098
+ full: "h:mm:ss a zzzz",
2099
+ long: "h:mm:ss a z",
2100
+ medium: "h:mm:ss a",
2101
+ short: "h:mm a"
2102
+ };
2103
+ var dateTimeFormats = {
2104
+ full: "{{date}} 'at' {{time}}",
2105
+ long: "{{date}} 'at' {{time}}",
2106
+ medium: "{{date}}, {{time}}",
2107
+ short: "{{date}}, {{time}}"
2108
+ };
2109
+ var formatLong = {
2110
+ date: buildFormatLongFn({
2111
+ formats: dateFormats,
2112
+ defaultWidth: "full"
2113
+ }),
2114
+ time: buildFormatLongFn({
2115
+ formats: timeFormats,
2116
+ defaultWidth: "full"
2117
+ }),
2118
+ dateTime: buildFormatLongFn({
2119
+ formats: dateTimeFormats,
2120
+ defaultWidth: "full"
2121
+ })
2122
+ };
2123
+ var formatRelativeLocale = {
2124
+ lastWeek: "'last' eeee 'at' p",
2125
+ yesterday: "'yesterday at' p",
2126
+ today: "'today at' p",
2127
+ tomorrow: "'tomorrow at' p",
2128
+ nextWeek: "eeee 'at' p",
2129
+ other: "P"
2130
+ };
2131
+ var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
2132
+ function buildLocalizeFn(args) {
2133
+ return (value, options) => {
2134
+ const context = options?.context ? String(options.context) : "standalone";
2135
+ let valuesArray;
2136
+ if (context === "formatting" && args.formattingValues) {
2137
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
2138
+ const width = options?.width ? String(options.width) : defaultWidth;
2139
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
2140
+ } else {
2141
+ const defaultWidth = args.defaultWidth;
2142
+ const width = options?.width ? String(options.width) : args.defaultWidth;
2143
+ valuesArray = args.values[width] || args.values[defaultWidth];
2594
2144
  }
2595
- } else {
2596
- setThemeColorsEnv(
2597
- `${prefix}COLOR_`,
2598
- config.colors
2599
- );
2600
- }
2601
- if (config.repository) {
2602
- process.env[`${prefix}REPOSITORY`] = config.repository;
2603
- }
2604
- if (config.branch) {
2605
- process.env[`${prefix}BRANCH`] = config.branch;
2145
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
2146
+ return valuesArray[index];
2147
+ };
2148
+ }
2149
+ var eraValues = {
2150
+ narrow: ["B", "A"],
2151
+ abbreviated: ["BC", "AD"],
2152
+ wide: ["Before Christ", "Anno Domini"]
2153
+ };
2154
+ var quarterValues = {
2155
+ narrow: ["1", "2", "3", "4"],
2156
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
2157
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
2158
+ };
2159
+ var monthValues = {
2160
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
2161
+ abbreviated: [
2162
+ "Jan",
2163
+ "Feb",
2164
+ "Mar",
2165
+ "Apr",
2166
+ "May",
2167
+ "Jun",
2168
+ "Jul",
2169
+ "Aug",
2170
+ "Sep",
2171
+ "Oct",
2172
+ "Nov",
2173
+ "Dec"
2174
+ ],
2175
+ wide: [
2176
+ "January",
2177
+ "February",
2178
+ "March",
2179
+ "April",
2180
+ "May",
2181
+ "June",
2182
+ "July",
2183
+ "August",
2184
+ "September",
2185
+ "October",
2186
+ "November",
2187
+ "December"
2188
+ ]
2189
+ };
2190
+ var dayValues = {
2191
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
2192
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
2193
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
2194
+ wide: [
2195
+ "Sunday",
2196
+ "Monday",
2197
+ "Tuesday",
2198
+ "Wednesday",
2199
+ "Thursday",
2200
+ "Friday",
2201
+ "Saturday"
2202
+ ]
2203
+ };
2204
+ var dayPeriodValues = {
2205
+ narrow: {
2206
+ am: "a",
2207
+ pm: "p",
2208
+ midnight: "mi",
2209
+ noon: "n",
2210
+ morning: "morning",
2211
+ afternoon: "afternoon",
2212
+ evening: "evening",
2213
+ night: "night"
2214
+ },
2215
+ abbreviated: {
2216
+ am: "AM",
2217
+ pm: "PM",
2218
+ midnight: "midnight",
2219
+ noon: "noon",
2220
+ morning: "morning",
2221
+ afternoon: "afternoon",
2222
+ evening: "evening",
2223
+ night: "night"
2224
+ },
2225
+ wide: {
2226
+ am: "a.m.",
2227
+ pm: "p.m.",
2228
+ midnight: "midnight",
2229
+ noon: "noon",
2230
+ morning: "morning",
2231
+ afternoon: "afternoon",
2232
+ evening: "evening",
2233
+ night: "night"
2606
2234
  }
2607
- if (config.preid) {
2608
- process.env[`${prefix}PRE_ID`] = String(config.preid);
2235
+ };
2236
+ var formattingDayPeriodValues = {
2237
+ narrow: {
2238
+ am: "a",
2239
+ pm: "p",
2240
+ midnight: "mi",
2241
+ noon: "n",
2242
+ morning: "in the morning",
2243
+ afternoon: "in the afternoon",
2244
+ evening: "in the evening",
2245
+ night: "at night"
2246
+ },
2247
+ abbreviated: {
2248
+ am: "AM",
2249
+ pm: "PM",
2250
+ midnight: "midnight",
2251
+ noon: "noon",
2252
+ morning: "in the morning",
2253
+ afternoon: "in the afternoon",
2254
+ evening: "in the evening",
2255
+ night: "at night"
2256
+ },
2257
+ wide: {
2258
+ am: "a.m.",
2259
+ pm: "p.m.",
2260
+ midnight: "midnight",
2261
+ noon: "noon",
2262
+ morning: "in the morning",
2263
+ afternoon: "in the afternoon",
2264
+ evening: "in the evening",
2265
+ night: "at night"
2609
2266
  }
2610
- if (config.registry) {
2611
- if (config.registry.github) {
2612
- process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
2613
- }
2614
- if (config.registry.npm) {
2615
- process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
2616
- }
2617
- if (config.registry.cargo) {
2618
- process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
2619
- }
2620
- if (config.registry.cyclone) {
2621
- process.env[`${prefix}REGISTRY_CYCLONE`] = String(
2622
- config.registry.cyclone
2623
- );
2624
- }
2625
- if (config.registry.container) {
2626
- process.env[`${prefix}REGISTRY_CONTAINER`] = String(
2627
- config.registry.container
2628
- );
2267
+ };
2268
+ var ordinalNumber = (dirtyNumber, _options) => {
2269
+ const number = Number(dirtyNumber);
2270
+ const rem100 = number % 100;
2271
+ if (rem100 > 20 || rem100 < 10) {
2272
+ switch (rem100 % 10) {
2273
+ case 1:
2274
+ return number + "st";
2275
+ case 2:
2276
+ return number + "nd";
2277
+ case 3:
2278
+ return number + "rd";
2629
2279
  }
2630
2280
  }
2631
- if (config.logLevel) {
2632
- process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
2633
- process.env.LOG_LEVEL = String(config.logLevel);
2634
- process.env.NX_VERBOSE_LOGGING = String(
2635
- getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? true : false
2636
- );
2637
- process.env.RUST_BACKTRACE = getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? "full" : "none";
2638
- }
2639
- if (config.skipConfigLogging !== void 0) {
2640
- process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
2641
- config.skipConfigLogging
2281
+ return number + "th";
2282
+ };
2283
+ var localize = {
2284
+ ordinalNumber,
2285
+ era: buildLocalizeFn({
2286
+ values: eraValues,
2287
+ defaultWidth: "wide"
2288
+ }),
2289
+ quarter: buildLocalizeFn({
2290
+ values: quarterValues,
2291
+ defaultWidth: "wide",
2292
+ argumentCallback: (quarter) => quarter - 1
2293
+ }),
2294
+ month: buildLocalizeFn({
2295
+ values: monthValues,
2296
+ defaultWidth: "wide"
2297
+ }),
2298
+ day: buildLocalizeFn({
2299
+ values: dayValues,
2300
+ defaultWidth: "wide"
2301
+ }),
2302
+ dayPeriod: buildLocalizeFn({
2303
+ values: dayPeriodValues,
2304
+ defaultWidth: "wide",
2305
+ formattingValues: formattingDayPeriodValues,
2306
+ defaultFormattingWidth: "wide"
2307
+ })
2308
+ };
2309
+ function buildMatchFn(args) {
2310
+ return (string3, options = {}) => {
2311
+ const width = options.width;
2312
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
2313
+ const matchResult = string3.match(matchPattern);
2314
+ if (!matchResult) {
2315
+ return null;
2316
+ }
2317
+ const matchedString = matchResult[0];
2318
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
2319
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
2320
+ // [TODO] -- I challenge you to fix the type
2321
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString))
2642
2322
  );
2323
+ let value;
2324
+ value = args.valueCallback ? args.valueCallback(key) : key;
2325
+ value = options.valueCallback ? (
2326
+ // [TODO] -- I challenge you to fix the type
2327
+ options.valueCallback(value)
2328
+ ) : value;
2329
+ const rest = string3.slice(matchedString.length);
2330
+ return { value, rest };
2331
+ };
2332
+ }
2333
+ function findKey(object3, predicate) {
2334
+ for (const key in object3) {
2335
+ if (Object.prototype.hasOwnProperty.call(object3, key) && predicate(object3[key])) {
2336
+ return key;
2337
+ }
2643
2338
  }
2644
- process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
2645
- for (const key of Object.keys(config.extensions ?? {})) {
2646
- if (config.extensions[key] && Object.keys(config.extensions[key])) {
2647
- setExtensionEnv(key, config.extensions[key]);
2339
+ return void 0;
2340
+ }
2341
+ function findIndex(array3, predicate) {
2342
+ for (let key = 0; key < array3.length; key++) {
2343
+ if (predicate(array3[key])) {
2344
+ return key;
2648
2345
  }
2649
2346
  }
2347
+ return void 0;
2348
+ }
2349
+ function buildMatchPatternFn(args) {
2350
+ return (string3, options = {}) => {
2351
+ const matchResult = string3.match(args.matchPattern);
2352
+ if (!matchResult) return null;
2353
+ const matchedString = matchResult[0];
2354
+ const parseResult = string3.match(args.parsePattern);
2355
+ if (!parseResult) return null;
2356
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
2357
+ value = options.valueCallback ? options.valueCallback(value) : value;
2358
+ const rest = string3.slice(matchedString.length);
2359
+ return { value, rest };
2360
+ };
2361
+ }
2362
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
2363
+ var parseOrdinalNumberPattern = /\d+/i;
2364
+ var matchEraPatterns = {
2365
+ narrow: /^(b|a)/i,
2366
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
2367
+ wide: /^(before christ|before common era|anno domini|common era)/i
2650
2368
  };
2651
- var setThemeColorsEnv = (prefix, config) => {
2652
- return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
2369
+ var parseEraPatterns = {
2370
+ any: [/^b/i, /^(a|c)/i]
2653
2371
  };
2654
- var setSingleThemeColorsEnv = (prefix, config) => {
2655
- if (config.dark) {
2656
- process.env[`${prefix}DARK`] = config.dark;
2657
- }
2658
- if (config.light) {
2659
- process.env[`${prefix}LIGHT`] = config.light;
2660
- }
2661
- if (config.brand) {
2662
- process.env[`${prefix}BRAND`] = config.brand;
2663
- }
2664
- if (config.alternate) {
2665
- process.env[`${prefix}ALTERNATE`] = config.alternate;
2666
- }
2667
- if (config.accent) {
2668
- process.env[`${prefix}ACCENT`] = config.accent;
2669
- }
2670
- if (config.link) {
2671
- process.env[`${prefix}LINK`] = config.link;
2672
- }
2673
- if (config.help) {
2674
- process.env[`${prefix}HELP`] = config.help;
2675
- }
2676
- if (config.success) {
2677
- process.env[`${prefix}SUCCESS`] = config.success;
2678
- }
2679
- if (config.info) {
2680
- process.env[`${prefix}INFO`] = config.info;
2681
- }
2682
- if (config.debug) {
2683
- process.env[`${prefix}DEBUG`] = config.debug;
2684
- }
2685
- if (config.warning) {
2686
- process.env[`${prefix}WARNING`] = config.warning;
2687
- }
2688
- if (config.danger) {
2689
- process.env[`${prefix}DANGER`] = config.danger;
2690
- }
2691
- if (config.fatal) {
2692
- process.env[`${prefix}FATAL`] = config.fatal;
2693
- }
2694
- if (config.performance) {
2695
- process.env[`${prefix}PERFORMANCE`] = config.performance;
2696
- }
2697
- if (config.positive) {
2698
- process.env[`${prefix}POSITIVE`] = config.positive;
2699
- }
2700
- if (config.negative) {
2701
- process.env[`${prefix}NEGATIVE`] = config.negative;
2702
- }
2703
- if (config.gradient) {
2704
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
2705
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2706
- }
2372
+ var matchQuarterPatterns = {
2373
+ narrow: /^[1234]/i,
2374
+ abbreviated: /^q[1234]/i,
2375
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2376
+ };
2377
+ var parseQuarterPatterns = {
2378
+ any: [/1/i, /2/i, /3/i, /4/i]
2379
+ };
2380
+ var matchMonthPatterns = {
2381
+ narrow: /^[jfmasond]/i,
2382
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
2383
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
2384
+ };
2385
+ var parseMonthPatterns = {
2386
+ narrow: [
2387
+ /^j/i,
2388
+ /^f/i,
2389
+ /^m/i,
2390
+ /^a/i,
2391
+ /^m/i,
2392
+ /^j/i,
2393
+ /^j/i,
2394
+ /^a/i,
2395
+ /^s/i,
2396
+ /^o/i,
2397
+ /^n/i,
2398
+ /^d/i
2399
+ ],
2400
+ any: [
2401
+ /^ja/i,
2402
+ /^f/i,
2403
+ /^mar/i,
2404
+ /^ap/i,
2405
+ /^may/i,
2406
+ /^jun/i,
2407
+ /^jul/i,
2408
+ /^au/i,
2409
+ /^s/i,
2410
+ /^o/i,
2411
+ /^n/i,
2412
+ /^d/i
2413
+ ]
2414
+ };
2415
+ var matchDayPatterns = {
2416
+ narrow: /^[smtwf]/i,
2417
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
2418
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
2419
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
2420
+ };
2421
+ var parseDayPatterns = {
2422
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
2423
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
2424
+ };
2425
+ var matchDayPeriodPatterns = {
2426
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
2427
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
2428
+ };
2429
+ var parseDayPeriodPatterns = {
2430
+ any: {
2431
+ am: /^a/i,
2432
+ pm: /^p/i,
2433
+ midnight: /^mi/i,
2434
+ noon: /^no/i,
2435
+ morning: /morning/i,
2436
+ afternoon: /afternoon/i,
2437
+ evening: /evening/i,
2438
+ night: /night/i
2707
2439
  }
2708
2440
  };
2709
- var setMultiThemeColorsEnv = (prefix, config) => {
2710
- return {
2711
- light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
2712
- dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
2713
- };
2441
+ var match = {
2442
+ ordinalNumber: buildMatchPatternFn({
2443
+ matchPattern: matchOrdinalNumberPattern,
2444
+ parsePattern: parseOrdinalNumberPattern,
2445
+ valueCallback: (value) => parseInt(value, 10)
2446
+ }),
2447
+ era: buildMatchFn({
2448
+ matchPatterns: matchEraPatterns,
2449
+ defaultMatchWidth: "wide",
2450
+ parsePatterns: parseEraPatterns,
2451
+ defaultParseWidth: "any"
2452
+ }),
2453
+ quarter: buildMatchFn({
2454
+ matchPatterns: matchQuarterPatterns,
2455
+ defaultMatchWidth: "wide",
2456
+ parsePatterns: parseQuarterPatterns,
2457
+ defaultParseWidth: "any",
2458
+ valueCallback: (index) => index + 1
2459
+ }),
2460
+ month: buildMatchFn({
2461
+ matchPatterns: matchMonthPatterns,
2462
+ defaultMatchWidth: "wide",
2463
+ parsePatterns: parseMonthPatterns,
2464
+ defaultParseWidth: "any"
2465
+ }),
2466
+ day: buildMatchFn({
2467
+ matchPatterns: matchDayPatterns,
2468
+ defaultMatchWidth: "wide",
2469
+ parsePatterns: parseDayPatterns,
2470
+ defaultParseWidth: "any"
2471
+ }),
2472
+ dayPeriod: buildMatchFn({
2473
+ matchPatterns: matchDayPeriodPatterns,
2474
+ defaultMatchWidth: "any",
2475
+ parsePatterns: parseDayPeriodPatterns,
2476
+ defaultParseWidth: "any"
2477
+ })
2714
2478
  };
2715
- var setBaseThemeColorsEnv = (prefix, config) => {
2716
- if (config.foreground) {
2717
- process.env[`${prefix}FOREGROUND`] = config.foreground;
2718
- }
2719
- if (config.background) {
2720
- process.env[`${prefix}BACKGROUND`] = config.background;
2721
- }
2722
- if (config.brand) {
2723
- process.env[`${prefix}BRAND`] = config.brand;
2724
- }
2725
- if (config.alternate) {
2726
- process.env[`${prefix}ALTERNATE`] = config.alternate;
2727
- }
2728
- if (config.accent) {
2729
- process.env[`${prefix}ACCENT`] = config.accent;
2479
+ var enUS = {
2480
+ code: "en-US",
2481
+ formatDistance,
2482
+ formatLong,
2483
+ formatRelative,
2484
+ localize,
2485
+ match,
2486
+ options: {
2487
+ weekStartsOn: 0,
2488
+ firstWeekContainsDate: 1
2730
2489
  }
2731
- if (config.link) {
2732
- process.env[`${prefix}LINK`] = config.link;
2490
+ };
2491
+ var defaultOptions = {};
2492
+ function getDefaultOptions() {
2493
+ return defaultOptions;
2494
+ }
2495
+ function toDate(argument, context) {
2496
+ return constructFrom(context || argument, argument);
2497
+ }
2498
+ function getTimezoneOffsetInMilliseconds(date) {
2499
+ const _date = toDate(date);
2500
+ const utcDate = new Date(
2501
+ Date.UTC(
2502
+ _date.getFullYear(),
2503
+ _date.getMonth(),
2504
+ _date.getDate(),
2505
+ _date.getHours(),
2506
+ _date.getMinutes(),
2507
+ _date.getSeconds(),
2508
+ _date.getMilliseconds()
2509
+ )
2510
+ );
2511
+ utcDate.setUTCFullYear(_date.getFullYear());
2512
+ return +date - +utcDate;
2513
+ }
2514
+ function normalizeDates(context, ...dates) {
2515
+ const normalize = constructFrom.bind(
2516
+ null,
2517
+ context || dates.find((date) => typeof date === "object")
2518
+ );
2519
+ return dates.map(normalize);
2520
+ }
2521
+ function compareAsc(dateLeft, dateRight) {
2522
+ const diff = +toDate(dateLeft) - +toDate(dateRight);
2523
+ if (diff < 0) return -1;
2524
+ else if (diff > 0) return 1;
2525
+ return diff;
2526
+ }
2527
+ function differenceInCalendarMonths(laterDate, earlierDate, options) {
2528
+ const [laterDate_, earlierDate_] = normalizeDates(
2529
+ options?.in,
2530
+ laterDate,
2531
+ earlierDate
2532
+ );
2533
+ const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
2534
+ const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
2535
+ return yearsDiff * 12 + monthsDiff;
2536
+ }
2537
+ function endOfDay(date, options) {
2538
+ const _date = toDate(date, options?.in);
2539
+ _date.setHours(23, 59, 59, 999);
2540
+ return _date;
2541
+ }
2542
+ function endOfMonth(date, options) {
2543
+ const _date = toDate(date, options?.in);
2544
+ const month = _date.getMonth();
2545
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
2546
+ _date.setHours(23, 59, 59, 999);
2547
+ return _date;
2548
+ }
2549
+ function isLastDayOfMonth(date, options) {
2550
+ const _date = toDate(date, options?.in);
2551
+ return +endOfDay(_date, options) === +endOfMonth(_date, options);
2552
+ }
2553
+ function differenceInMonths(laterDate, earlierDate, options) {
2554
+ const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
2555
+ options?.in,
2556
+ laterDate,
2557
+ laterDate,
2558
+ earlierDate
2559
+ );
2560
+ const sign = compareAsc(workingLaterDate, earlierDate_);
2561
+ const difference = Math.abs(
2562
+ differenceInCalendarMonths(workingLaterDate, earlierDate_)
2563
+ );
2564
+ if (difference < 1) return 0;
2565
+ if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
2566
+ workingLaterDate.setDate(30);
2567
+ workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
2568
+ let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
2569
+ if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
2570
+ isLastMonthNotFull = false;
2733
2571
  }
2734
- if (config.help) {
2735
- process.env[`${prefix}HELP`] = config.help;
2572
+ const result = sign * (difference - +isLastMonthNotFull);
2573
+ return result === 0 ? 0 : result;
2574
+ }
2575
+ function getRoundingMethod(method) {
2576
+ return (number) => {
2577
+ const round = method ? Math[method] : Math.trunc;
2578
+ const result = round(number);
2579
+ return result === 0 ? 0 : result;
2580
+ };
2581
+ }
2582
+ function differenceInMilliseconds(laterDate, earlierDate) {
2583
+ return +toDate(laterDate) - +toDate(earlierDate);
2584
+ }
2585
+ function differenceInSeconds(laterDate, earlierDate, options) {
2586
+ const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
2587
+ return getRoundingMethod(options?.roundingMethod)(diff);
2588
+ }
2589
+ function formatDistance2(laterDate, earlierDate, options) {
2590
+ const defaultOptions2 = getDefaultOptions();
2591
+ const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
2592
+ const minutesInAlmostTwoDays = 2520;
2593
+ const comparison = compareAsc(laterDate, earlierDate);
2594
+ if (isNaN(comparison)) throw new RangeError("Invalid time value");
2595
+ const localizeOptions = Object.assign({}, options, {
2596
+ addSuffix: options?.addSuffix,
2597
+ comparison
2598
+ });
2599
+ const [laterDate_, earlierDate_] = normalizeDates(
2600
+ options?.in,
2601
+ ...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
2602
+ );
2603
+ const seconds = differenceInSeconds(earlierDate_, laterDate_);
2604
+ const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1e3;
2605
+ const minutes = Math.round((seconds - offsetInSeconds) / 60);
2606
+ let months;
2607
+ if (minutes < 2) {
2608
+ if (options?.includeSeconds) {
2609
+ if (seconds < 5) {
2610
+ return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
2611
+ } else if (seconds < 10) {
2612
+ return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
2613
+ } else if (seconds < 20) {
2614
+ return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
2615
+ } else if (seconds < 40) {
2616
+ return locale.formatDistance("halfAMinute", 0, localizeOptions);
2617
+ } else if (seconds < 60) {
2618
+ return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
2619
+ } else {
2620
+ return locale.formatDistance("xMinutes", 1, localizeOptions);
2621
+ }
2622
+ } else {
2623
+ if (minutes === 0) {
2624
+ return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
2625
+ } else {
2626
+ return locale.formatDistance("xMinutes", minutes, localizeOptions);
2627
+ }
2628
+ }
2629
+ } else if (minutes < 45) {
2630
+ return locale.formatDistance("xMinutes", minutes, localizeOptions);
2631
+ } else if (minutes < 90) {
2632
+ return locale.formatDistance("aboutXHours", 1, localizeOptions);
2633
+ } else if (minutes < minutesInDay) {
2634
+ const hours = Math.round(minutes / 60);
2635
+ return locale.formatDistance("aboutXHours", hours, localizeOptions);
2636
+ } else if (minutes < minutesInAlmostTwoDays) {
2637
+ return locale.formatDistance("xDays", 1, localizeOptions);
2638
+ } else if (minutes < minutesInMonth) {
2639
+ const days = Math.round(minutes / minutesInDay);
2640
+ return locale.formatDistance("xDays", days, localizeOptions);
2641
+ } else if (minutes < minutesInMonth * 2) {
2642
+ months = Math.round(minutes / minutesInMonth);
2643
+ return locale.formatDistance("aboutXMonths", months, localizeOptions);
2736
2644
  }
2737
- if (config.success) {
2738
- process.env[`${prefix}SUCCESS`] = config.success;
2645
+ months = differenceInMonths(earlierDate_, laterDate_);
2646
+ if (months < 12) {
2647
+ const nearestMonth = Math.round(minutes / minutesInMonth);
2648
+ return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
2649
+ } else {
2650
+ const monthsSinceStartOfYear = months % 12;
2651
+ const years = Math.trunc(months / 12);
2652
+ if (monthsSinceStartOfYear < 3) {
2653
+ return locale.formatDistance("aboutXYears", years, localizeOptions);
2654
+ } else if (monthsSinceStartOfYear < 9) {
2655
+ return locale.formatDistance("overXYears", years, localizeOptions);
2656
+ } else {
2657
+ return locale.formatDistance("almostXYears", years + 1, localizeOptions);
2658
+ }
2739
2659
  }
2740
- if (config.info) {
2741
- process.env[`${prefix}INFO`] = config.info;
2660
+ }
2661
+ function formatDistanceToNow2(date, options) {
2662
+ return formatDistance2(date, constructNow(date), options);
2663
+ }
2664
+ var getLogFn = (logLevel = LogLevel2.INFO, config = {}, options = {}) => {
2665
+ const {
2666
+ chalk: _chalk = getChalk(),
2667
+ fullDateTime = false,
2668
+ hideDateTime = false
2669
+ } = options;
2670
+ const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
2671
+ const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel2.INFO;
2672
+ if (logLevel > getLogLevel2(configLogLevel) || logLevel <= LogLevel2.SILENT || getLogLevel2(configLogLevel) <= LogLevel2.SILENT) {
2673
+ return (_3) => {
2674
+ };
2742
2675
  }
2743
- if (config.debug) {
2744
- process.env[`${prefix}DEBUG`] = config.debug;
2676
+ if (typeof logLevel === "number" && LogLevel2.FATAL >= logLevel) {
2677
+ return (message) => {
2678
+ console.error(
2679
+ `
2680
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(
2681
+ `[${CONSOLE_ICONS2[LogLevelLabel2.FATAL]} Fatal] `
2682
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2683
+ `
2684
+ );
2685
+ };
2745
2686
  }
2746
- if (config.warning) {
2747
- process.env[`${prefix}WARNING`] = config.warning;
2687
+ if (typeof logLevel === "number" && LogLevel2.ERROR >= logLevel) {
2688
+ return (message) => {
2689
+ console.error(
2690
+ `
2691
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(
2692
+ `[${CONSOLE_ICONS2[LogLevelLabel2.ERROR]} Error] `
2693
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2694
+ `
2695
+ );
2696
+ };
2748
2697
  }
2749
- if (config.danger) {
2750
- process.env[`${prefix}DANGER`] = config.danger;
2698
+ if (typeof logLevel === "number" && LogLevel2.WARN >= logLevel) {
2699
+ return (message) => {
2700
+ console.warn(
2701
+ `
2702
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(
2703
+ `[${CONSOLE_ICONS2[LogLevelLabel2.WARN]} Warn] `
2704
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2705
+ `
2706
+ );
2707
+ };
2751
2708
  }
2752
- if (config.fatal) {
2753
- process.env[`${prefix}FATAL`] = config.fatal;
2709
+ if (typeof logLevel === "number" && LogLevel2.SUCCESS >= logLevel) {
2710
+ return (message) => {
2711
+ console.info(
2712
+ `
2713
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(
2714
+ `[${CONSOLE_ICONS2[LogLevelLabel2.SUCCESS]} Success] `
2715
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2716
+ `
2717
+ );
2718
+ };
2754
2719
  }
2755
- if (config.performance) {
2756
- process.env[`${prefix}PERFORMANCE`] = config.performance;
2720
+ if (typeof logLevel === "number" && LogLevel2.INFO >= logLevel) {
2721
+ return (message) => {
2722
+ console.info(
2723
+ `
2724
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(
2725
+ `[${CONSOLE_ICONS2[LogLevelLabel2.INFO]} Info] `
2726
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2727
+ `
2728
+ );
2729
+ };
2757
2730
  }
2758
- if (config.positive) {
2759
- process.env[`${prefix}POSITIVE`] = config.positive;
2731
+ if (typeof logLevel === "number" && LogLevel2.PERFORMANCE >= logLevel) {
2732
+ return (message) => {
2733
+ console.debug(
2734
+ `
2735
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(
2736
+ `[${CONSOLE_ICONS2[LogLevelLabel2.PERFORMANCE]} Performance] `
2737
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2738
+ `
2739
+ );
2740
+ };
2760
2741
  }
2761
- if (config.negative) {
2762
- process.env[`${prefix}NEGATIVE`] = config.negative;
2742
+ if (typeof logLevel === "number" && LogLevel2.DEBUG >= logLevel) {
2743
+ return (message) => {
2744
+ console.debug(
2745
+ `
2746
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(
2747
+ `[${CONSOLE_ICONS2[LogLevelLabel2.DEBUG]} Debug] `
2748
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2749
+ `
2750
+ );
2751
+ };
2763
2752
  }
2764
- if (config.gradient) {
2765
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
2766
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2767
- }
2753
+ if (typeof logLevel === "number" && LogLevel2.TRACE >= logLevel) {
2754
+ return (message) => {
2755
+ console.debug(
2756
+ `
2757
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(
2758
+ `[${CONSOLE_ICONS2[LogLevelLabel2.TRACE]} Trace] `
2759
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2760
+ `
2761
+ );
2762
+ };
2768
2763
  }
2764
+ return (message) => {
2765
+ console.log(
2766
+ `
2767
+ ${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(
2768
+ `[${CONSOLE_ICONS2[LogLevelLabel2.ALL]} System] `
2769
+ )}${_chalk.bold.whiteBright(formatLogMessage2(message))}
2770
+ `
2771
+ );
2772
+ };
2769
2773
  };
2770
-
2771
- // ../config-tools/dist/chunk-A5JXMY6X.js
2772
- init_esm_shims();
2773
- var getExtensionEnv = (extensionName) => {
2774
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
2775
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
2776
- const name = key.replace(prefix, "").split("_").map(
2777
- (i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
2778
- ).join("");
2779
- if (name) {
2780
- ret[name] = process.env[key];
2781
- }
2782
- return ret;
2783
- }, {});
2784
- };
2785
- var getConfigEnv = () => {
2786
- const prefix = "STORM_";
2787
- let config = {
2788
- extends: process.env[`${prefix}EXTENDS`] || void 0,
2789
- name: process.env[`${prefix}NAME`] || void 0,
2790
- variant: process.env[`${prefix}VARIANT`] || void 0,
2791
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
2792
- owner: process.env[`${prefix}OWNER`] || void 0,
2793
- bot: {
2794
- name: process.env[`${prefix}BOT_NAME`] || void 0,
2795
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
2796
- },
2797
- release: {
2798
- banner: {
2799
- url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
2800
- alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
2801
- },
2802
- header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
2803
- footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
2804
- },
2805
- error: {
2806
- codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
2807
- url: process.env[`${prefix}ERROR_URL`] || void 0
2808
- },
2809
- socials: {
2810
- twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
2811
- discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
2812
- telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
2813
- slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
2814
- medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
2815
- github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
2816
- },
2817
- 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`] ? {
2818
- name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
2819
- description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
2820
- url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
2821
- logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
2822
- icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
2823
- } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
2824
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
2825
- license: process.env[`${prefix}LICENSE`] || void 0,
2826
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
2827
- docs: process.env[`${prefix}DOCS`] || void 0,
2828
- portal: process.env[`${prefix}PORTAL`] || void 0,
2829
- licensing: process.env[`${prefix}LICENSING`] || void 0,
2830
- contact: process.env[`${prefix}CONTACT`] || void 0,
2831
- support: process.env[`${prefix}SUPPORT`] || void 0,
2832
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
2833
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
2834
- configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
2835
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
2836
- directories: {
2837
- 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,
2838
- 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,
2839
- 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,
2840
- 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,
2841
- 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,
2842
- 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
2843
- },
2844
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
2845
- mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
2846
- // ci:
2847
- // process.env[`${prefix}CI`] !== undefined
2848
- // ? Boolean(
2849
- // process.env[`${prefix}CI`] ??
2850
- // process.env.CI ??
2851
- // process.env.CONTINUOUS_INTEGRATION
2852
- // )
2853
- // : undefined,
2854
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
2855
- branch: process.env[`${prefix}BRANCH`] || void 0,
2856
- preid: process.env[`${prefix}PRE_ID`] || void 0,
2857
- registry: {
2858
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
2859
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
2860
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
2861
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
2862
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
2863
- },
2864
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
2865
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2866
- ) ? getLogLevelLabel2(
2867
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2868
- ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
2869
- skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
2774
+ var writeWarning2 = (message, config) => getLogFn(LogLevel2.WARN, config)(message);
2775
+ var writePerformance = (message, config) => getLogFn(LogLevel2.PERFORMANCE, config)(message);
2776
+ var writeDebug2 = (message, config) => getLogFn(LogLevel2.DEBUG, config)(message);
2777
+ var writeTrace2 = (message, config) => getLogFn(LogLevel2.TRACE, config)(message);
2778
+ var getStopwatch = (name) => {
2779
+ const start = /* @__PURE__ */ new Date();
2780
+ return () => {
2781
+ writePerformance(
2782
+ `The${name ? ` ${name}` : ""} process took ${formatDistanceToNow2(start, {
2783
+ includeSeconds: true
2784
+ })} to complete`
2785
+ );
2870
2786
  };
2871
- const themeNames = Object.keys(process.env).filter(
2872
- (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
2873
- (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
2874
- )
2875
- );
2876
- config.colors = themeNames.length > 0 ? themeNames.reduce(
2877
- (ret, themeName) => {
2878
- ret[themeName] = getThemeColorsEnv(prefix, themeName);
2879
- return ret;
2880
- },
2881
- {}
2882
- ) : getThemeColorsEnv(prefix);
2883
- if (config.docs === s) {
2884
- if (config.homepage === r) {
2885
- config.docs = `${r}/projects/${config.name}/docs`;
2886
- } else {
2887
- config.docs = `${config.homepage}/docs`;
2888
- }
2787
+ };
2788
+ var MAX_DEPTH = 10;
2789
+ var formatLogMessage2 = (message, options = {}, depth2 = 0) => {
2790
+ if (depth2 > MAX_DEPTH) {
2791
+ return "<max depth>";
2792
+ }
2793
+ const prefix = options.prefix ?? "";
2794
+ const skip = options.skip ?? [];
2795
+ const sort = options.sort ?? true;
2796
+ return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
2797
+ ${message.sort(
2798
+ sort ? (a3, b2) => !a3 && !b2 ? 0 : !a3 ? 1 : !b2 ? -1 : String(a3).localeCompare(String(b2)) : void 0
2799
+ ).map(
2800
+ (item, index) => ` ${prefix}> #${index} = ${formatLogMessage2(
2801
+ item,
2802
+ { prefix: `${prefix}--`, skip, sort },
2803
+ depth2 + 1
2804
+ )}`
2805
+ ).join("\n")}` : typeof message === "object" ? `
2806
+ ${Object.keys(message).filter(
2807
+ (key) => typeof key !== "string" || !skip.map((k2) => k2.toLowerCase().trim()).includes(key.toLowerCase().trim())
2808
+ ).sort(
2809
+ sort ? (a3, b2) => !a3 && !b2 ? 0 : !a3 ? 1 : !b2 ? -1 : String(a3).localeCompare(String(b2)) : void 0
2810
+ ).map(
2811
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? Object.keys(message[key]).filter(
2812
+ (key2) => typeof key2 !== "string" || !skip.map((k2) => k2.toLowerCase().trim()).includes(key2.toLowerCase().trim())
2813
+ ).length === 0 ? "{}" : formatLogMessage2(
2814
+ message[key],
2815
+ { prefix: `${prefix}--`, skip, sort },
2816
+ depth2 + 1
2817
+ ) : message[key]}`
2818
+ ).join("\n")}` : String(message);
2819
+ };
2820
+ var _isFunction = (value) => {
2821
+ try {
2822
+ return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
2823
+ } catch {
2824
+ return false;
2889
2825
  }
2890
- if (config.licensing === a) {
2891
- if (config.homepage === r) {
2892
- config.licensing = `${r}/projects/${config.name}/licensing`;
2893
- } else {
2894
- config.licensing = `${config.homepage}/docs`;
2826
+ };
2827
+
2828
+ // ../config-tools/dist/chunk-NT26TB4H.js
2829
+ import { loadConfig as loadConfig2 } from "c12";
2830
+ import defu3 from "defu";
2831
+ var getConfigFileByName = async (fileName, filePath, options = {}) => {
2832
+ const workspacePath = filePath || findWorkspaceRoot2(filePath);
2833
+ const configs = await Promise.all([
2834
+ loadConfig2({
2835
+ cwd: workspacePath,
2836
+ packageJson: true,
2837
+ name: fileName,
2838
+ envName: fileName?.toUpperCase(),
2839
+ jitiOptions: {
2840
+ debug: false,
2841
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2842
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2843
+ "jiti"
2844
+ )
2845
+ },
2846
+ ...options
2847
+ }),
2848
+ loadConfig2({
2849
+ cwd: workspacePath,
2850
+ packageJson: true,
2851
+ name: fileName,
2852
+ envName: fileName?.toUpperCase(),
2853
+ jitiOptions: {
2854
+ debug: false,
2855
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2856
+ process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2857
+ "jiti"
2858
+ )
2859
+ },
2860
+ configFile: fileName,
2861
+ ...options
2862
+ })
2863
+ ]);
2864
+ return defu3(configs[0] ?? {}, configs[1] ?? {});
2865
+ };
2866
+ var getConfigFile = async (filePath, additionalFileNames = []) => {
2867
+ const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
2868
+ const result = await getConfigFileByName("storm-workspace", workspacePath);
2869
+ let config = result.config;
2870
+ const configFile = result.configFile;
2871
+ if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
2872
+ writeTrace2(
2873
+ `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
2874
+ {
2875
+ logLevel: "all"
2876
+ }
2877
+ );
2878
+ }
2879
+ if (additionalFileNames && additionalFileNames.length > 0) {
2880
+ const results = await Promise.all(
2881
+ additionalFileNames.map(
2882
+ (fileName) => getConfigFileByName(fileName, workspacePath)
2883
+ )
2884
+ );
2885
+ for (const result2 of results) {
2886
+ if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
2887
+ if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
2888
+ writeTrace2(
2889
+ `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
2890
+ {
2891
+ logLevel: "all"
2892
+ }
2893
+ );
2894
+ }
2895
+ config = defu3(result2.config ?? {}, config ?? {});
2896
+ }
2895
2897
  }
2896
2898
  }
2897
- const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
2898
- if (serializedConfig) {
2899
- const parsed = JSON.parse(serializedConfig);
2900
- config = {
2901
- ...config,
2902
- ...parsed,
2903
- colors: { ...config.colors, ...parsed.colors },
2904
- extensions: { ...config.extensions, ...parsed.extensions }
2905
- };
2899
+ if (!config || Object.keys(config).length === 0) {
2900
+ return void 0;
2906
2901
  }
2902
+ config.configFile = configFile;
2907
2903
  return config;
2908
2904
  };
2909
- var getThemeColorsEnv = (prefix, theme) => {
2910
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
2911
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
2912
- };
2913
- var getSingleThemeColorsEnv = (prefix) => {
2914
- const gradient = [];
2915
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2916
- gradient.push(
2917
- process.env[`${prefix}GRADIENT_START`],
2918
- process.env[`${prefix}GRADIENT_END`]
2905
+
2906
+ // ../config-tools/dist/chunk-RGET2UQV.js
2907
+ init_esm_shims();
2908
+ import { existsSync as existsSync6 } from "node:fs";
2909
+ import { readFile as readFile5 } from "node:fs/promises";
2910
+ import { join as join4 } from "node:path";
2911
+ async function getPackageJsonConfig(root) {
2912
+ let license = i;
2913
+ let homepage = void 0;
2914
+ let support = void 0;
2915
+ let name = void 0;
2916
+ let namespace = void 0;
2917
+ let repository = void 0;
2918
+ const workspaceRoot = findWorkspaceRoot2(root);
2919
+ if (existsSync6(join4(workspaceRoot, "package.json"))) {
2920
+ const file = await readFile5(
2921
+ joinPaths2(workspaceRoot, "package.json"),
2922
+ "utf8"
2919
2923
  );
2920
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2921
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2922
- while (process.env[`${prefix}GRADIENT_${index}`]) {
2923
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2924
- index++;
2924
+ if (file) {
2925
+ const packageJson = JSON.parse(file);
2926
+ if (packageJson.name) {
2927
+ name = packageJson.name;
2928
+ }
2929
+ if (packageJson.namespace) {
2930
+ namespace = packageJson.namespace;
2931
+ }
2932
+ if (packageJson.repository) {
2933
+ if (typeof packageJson.repository === "string") {
2934
+ repository = packageJson.repository;
2935
+ } else if (packageJson.repository.url) {
2936
+ repository = packageJson.repository.url;
2937
+ }
2938
+ }
2939
+ if (packageJson.license) {
2940
+ license = packageJson.license;
2941
+ }
2942
+ if (packageJson.homepage) {
2943
+ homepage = packageJson.homepage;
2944
+ }
2945
+ if (packageJson.bugs) {
2946
+ if (typeof packageJson.bugs === "string") {
2947
+ support = packageJson.bugs;
2948
+ } else if (packageJson.bugs.url) {
2949
+ support = packageJson.bugs.url;
2950
+ }
2951
+ }
2925
2952
  }
2926
2953
  }
2927
2954
  return {
2928
- dark: process.env[`${prefix}DARK`],
2929
- light: process.env[`${prefix}LIGHT`],
2930
- brand: process.env[`${prefix}BRAND`],
2931
- alternate: process.env[`${prefix}ALTERNATE`],
2932
- accent: process.env[`${prefix}ACCENT`],
2933
- link: process.env[`${prefix}LINK`],
2934
- help: process.env[`${prefix}HELP`],
2935
- success: process.env[`${prefix}SUCCESS`],
2936
- info: process.env[`${prefix}INFO`],
2937
- debug: process.env[`${prefix}DEBUG`],
2938
- warning: process.env[`${prefix}WARNING`],
2939
- danger: process.env[`${prefix}DANGER`],
2940
- fatal: process.env[`${prefix}FATAL`],
2941
- performance: process.env[`${prefix}PERFORMANCE`],
2942
- positive: process.env[`${prefix}POSITIVE`],
2943
- negative: process.env[`${prefix}NEGATIVE`],
2944
- gradient
2945
- };
2946
- };
2947
- var getMultiThemeColorsEnv = (prefix) => {
2948
- return {
2949
- light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
2950
- dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
2955
+ workspaceRoot,
2956
+ name,
2957
+ namespace,
2958
+ repository,
2959
+ license,
2960
+ homepage,
2961
+ support
2951
2962
  };
2952
- };
2953
- var getBaseThemeColorsEnv = (prefix) => {
2954
- const gradient = [];
2955
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2956
- gradient.push(
2957
- process.env[`${prefix}GRADIENT_START`],
2958
- process.env[`${prefix}GRADIENT_END`]
2959
- );
2960
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2961
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2962
- while (process.env[`${prefix}GRADIENT_${index}`]) {
2963
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2964
- index++;
2963
+ }
2964
+ function applyDefaultConfig(config) {
2965
+ if (!config.support && config.contact) {
2966
+ config.support = config.contact;
2967
+ }
2968
+ if (!config.contact && config.support) {
2969
+ config.contact = config.support;
2970
+ }
2971
+ if (config.homepage) {
2972
+ if (!config.docs) {
2973
+ config.docs = `${config.homepage}/docs`;
2974
+ }
2975
+ if (!config.license) {
2976
+ config.license = `${config.homepage}/license`;
2977
+ }
2978
+ if (!config.support) {
2979
+ config.support = `${config.homepage}/support`;
2980
+ }
2981
+ if (!config.contact) {
2982
+ config.contact = `${config.homepage}/contact`;
2983
+ }
2984
+ if (!config.error?.codesFile || !config?.error?.url) {
2985
+ config.error ??= { codesFile: S };
2986
+ if (config.homepage) {
2987
+ config.error.url ??= `${config.homepage}/errors`;
2988
+ }
2965
2989
  }
2966
2990
  }
2967
- return {
2968
- foreground: process.env[`${prefix}FOREGROUND`],
2969
- background: process.env[`${prefix}BACKGROUND`],
2970
- brand: process.env[`${prefix}BRAND`],
2971
- alternate: process.env[`${prefix}ALTERNATE`],
2972
- accent: process.env[`${prefix}ACCENT`],
2973
- link: process.env[`${prefix}LINK`],
2974
- help: process.env[`${prefix}HELP`],
2975
- success: process.env[`${prefix}SUCCESS`],
2976
- info: process.env[`${prefix}INFO`],
2977
- debug: process.env[`${prefix}DEBUG`],
2978
- warning: process.env[`${prefix}WARNING`],
2979
- danger: process.env[`${prefix}DANGER`],
2980
- fatal: process.env[`${prefix}FATAL`],
2981
- performance: process.env[`${prefix}PERFORMANCE`],
2982
- positive: process.env[`${prefix}POSITIVE`],
2983
- negative: process.env[`${prefix}NEGATIVE`],
2984
- gradient
2985
- };
2986
- };
2991
+ return config;
2992
+ }
2987
2993
 
2988
2994
  // ../config/dist/schema.js
2989
2995
  init_esm_shims();
2990
2996
 
2991
- // ../config-tools/dist/chunk-K2ESWZ47.js
2997
+ // ../config-tools/dist/chunk-DW5363CG.js
2992
2998
  import defu4 from "defu";
2993
2999
  import { existsSync as existsSync7 } from "node:fs";
2994
3000
  var _extension_cache = /* @__PURE__ */ new WeakMap();
@@ -3089,7 +3095,7 @@ ${formatLogMessage2(config)}`,
3089
3095
  return config;
3090
3096
  };
3091
3097
 
3092
- // ../config-tools/dist/chunk-EBVZQPBC.js
3098
+ // ../config-tools/dist/chunk-KKF5NXBI.js
3093
3099
  function getConfig(workspaceRoot, skipLogs = false) {
3094
3100
  return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
3095
3101
  }