@storm-software/tsup 0.2.216 → 0.2.218

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.
@@ -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-RL5DRDS6.js
741
+ // ../config-tools/dist/chunk-L6MSRILP.js
742
742
  init_esm_shims();
743
743
 
744
- // ../config-tools/dist/chunk-6VD3CYGA.js
744
+ // ../config-tools/dist/chunk-IASBTY6Z.js
745
745
  init_esm_shims();
746
746
 
747
- // ../config-tools/dist/chunk-KVJGV2WN.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-ZG3KCER4.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,934 +959,388 @@ var getLogLevelLabel2 = (logLevel = LogLevel2.INFO) => {
1167
959
  return LogLevelLabel2.INFO;
1168
960
  };
1169
961
 
1170
- // ../config-tools/dist/chunk-ZG3KCER4.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;
1630
1162
  }
1631
- };
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
- })
1669
- };
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
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
+ );
1680
1172
  }
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;
1173
+ if (config.repository) {
1174
+ process.env[`${prefix}REPOSITORY`] = config.repository;
1762
1175
  }
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
- }
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
+ );
1819
1201
  }
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);
1835
1202
  }
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);
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]);
1849
1220
  }
1850
1221
  }
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
- };
1222
+ };
1223
+ var setThemeColorsEnv = (prefix, config) => {
1224
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1225
+ };
1226
+ var setSingleThemeColorsEnv = (prefix, config) => {
1227
+ if (config.dark) {
1228
+ process.env[`${prefix}DARK`] = config.dark;
1229
+ }
1230
+ if (config.light) {
1231
+ process.env[`${prefix}LIGHT`] = config.light;
1232
+ }
1233
+ if (config.brand) {
1234
+ process.env[`${prefix}BRAND`] = config.brand;
1235
+ }
1236
+ if (config.alternate) {
1237
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1238
+ }
1239
+ if (config.accent) {
1240
+ process.env[`${prefix}ACCENT`] = config.accent;
1241
+ }
1242
+ if (config.link) {
1243
+ process.env[`${prefix}LINK`] = config.link;
1244
+ }
1245
+ if (config.help) {
1246
+ process.env[`${prefix}HELP`] = config.help;
1866
1247
  }
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
- };
1248
+ if (config.success) {
1249
+ process.env[`${prefix}SUCCESS`] = config.success;
1877
1250
  }
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
- };
1251
+ if (config.info) {
1252
+ process.env[`${prefix}INFO`] = config.info;
1888
1253
  }
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
- };
1254
+ if (config.debug) {
1255
+ process.env[`${prefix}DEBUG`] = config.debug;
1899
1256
  }
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
- };
1257
+ if (config.warning) {
1258
+ process.env[`${prefix}WARNING`] = config.warning;
1910
1259
  }
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
- };
1260
+ if (config.danger) {
1261
+ process.env[`${prefix}DANGER`] = config.danger;
1921
1262
  }
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
- };
1263
+ if (config.fatal) {
1264
+ process.env[`${prefix}FATAL`] = config.fatal;
1932
1265
  }
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
- };
1266
+ if (config.performance) {
1267
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1943
1268
  }
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
- };
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.sort(
1989
- sort ? (a3, b2) => !a3 && !b2 ? 0 : !a3 ? 1 : !b2 ? -1 : String(a3).localeCompare(String(b2)) : void 0
1990
- ).map(
1991
- (item, index) => ` ${prefix}> #${index} = ${formatLogMessage2(
1992
- item,
1993
- { prefix: `${prefix}--`, skip, sort },
1994
- depth2 + 1
1995
- )}`
1996
- ).join("\n")}` : typeof message === "object" && message ? `
1997
- ${Object.keys(message).filter(
1998
- (key) => typeof key !== "string" || !skip.map((k2) => k2.toLowerCase().trim()).includes(key.toLowerCase().trim())
1999
- ).sort(
2000
- sort ? (a3, b2) => !a3 && !b2 ? 0 : !a3 ? 1 : !b2 ? -1 : String(a3).localeCompare(String(b2)) : void 0
2001
- ).map(
2002
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" && message[key] ? Object.keys(message[key]).filter(
2003
- (key2) => typeof key2 !== "string" || !skip.map((k2) => k2.toLowerCase().trim()).includes(key2.toLowerCase().trim())
2004
- ).length === 0 ? "{}" : formatLogMessage2(
2005
- message[key],
2006
- { prefix: `${prefix}--`, skip, sort },
2007
- depth2 + 1
2008
- ) : message[key]}`
2009
- ).join("\n")}` : String(message);
2010
- };
2011
- var _isFunction = (value) => {
2012
- try {
2013
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
2014
- } catch {
2015
- return false;
1291
+ if (config.background) {
1292
+ process.env[`${prefix}BACKGROUND`] = config.background;
2016
1293
  }
2017
- };
2018
-
2019
- // ../config-tools/dist/chunk-KVJGV2WN.js
2020
- import { loadConfig as loadConfig2 } from "c12";
2021
- import defu3 from "defu";
2022
- var getConfigFileByName = async (fileName, filePath, options = {}) => {
2023
- const workspacePath = filePath || findWorkspaceRoot2(filePath);
2024
- const configs = await Promise.all([
2025
- loadConfig2({
2026
- cwd: workspacePath,
2027
- packageJson: true,
2028
- name: fileName,
2029
- envName: fileName?.toUpperCase(),
2030
- jitiOptions: {
2031
- debug: false,
2032
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2033
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2034
- "jiti"
2035
- )
2036
- },
2037
- ...options
2038
- }),
2039
- loadConfig2({
2040
- cwd: workspacePath,
2041
- packageJson: true,
2042
- name: fileName,
2043
- envName: fileName?.toUpperCase(),
2044
- jitiOptions: {
2045
- debug: false,
2046
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2047
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2048
- "jiti"
2049
- )
2050
- },
2051
- configFile: fileName,
2052
- ...options
2053
- })
2054
- ]);
2055
- return defu3(configs[0] ?? {}, configs[1] ?? {});
2056
- };
2057
- var getConfigFile = async (filePath, additionalFileNames = []) => {
2058
- const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
2059
- const result = await getConfigFileByName("storm-workspace", workspacePath);
2060
- let config = result.config;
2061
- const configFile = result.configFile;
2062
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
2063
- writeTrace2(
2064
- `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
2065
- {
2066
- logLevel: "all"
2067
- }
2068
- );
1294
+ if (config.brand) {
1295
+ process.env[`${prefix}BRAND`] = config.brand;
1296
+ }
1297
+ if (config.alternate) {
1298
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1299
+ }
1300
+ if (config.accent) {
1301
+ process.env[`${prefix}ACCENT`] = config.accent;
1302
+ }
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;
2069
1311
  }
2070
- if (additionalFileNames && additionalFileNames.length > 0) {
2071
- const results = await Promise.all(
2072
- additionalFileNames.map(
2073
- (fileName) => getConfigFileByName(fileName, workspacePath)
2074
- )
2075
- );
2076
- for (const result2 of results) {
2077
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
2078
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
2079
- writeTrace2(
2080
- `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
2081
- {
2082
- logLevel: "all"
2083
- }
2084
- );
2085
- }
2086
- config = defu3(result2.config ?? {}, config ?? {});
2087
- }
2088
- }
1312
+ if (config.info) {
1313
+ process.env[`${prefix}INFO`] = config.info;
2089
1314
  }
2090
- if (!config || Object.keys(config).length === 0) {
2091
- return void 0;
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
+ }
2092
1340
  }
2093
- config.configFile = configFile;
2094
- return config;
2095
1341
  };
2096
1342
 
2097
- // ../config-tools/dist/chunk-RGET2UQV.js
1343
+ // ../config-tools/dist/chunk-A5JXMY6X.js
2098
1344
  init_esm_shims();
2099
1345
 
2100
1346
  // ../config/dist/index.js
@@ -2301,696 +1547,1454 @@ o2.add(x, { description: "Storm Workspace config values used during various dev-
2301
1547
  init_esm_shims();
2302
1548
  var e3 = ["dark", "light", "base", "brand", "alternate", "accent", "link", "success", "help", "info", "warning", "danger", "fatal", "performance", "positive", "negative"];
2303
1549
 
2304
- // ../config-tools/dist/chunk-RGET2UQV.js
2305
- import { existsSync as existsSync6 } from "node:fs";
2306
- import { readFile as readFile5 } from "node:fs/promises";
2307
- import { join as join4 } from "node:path";
2308
- async function getPackageJsonConfig(root) {
2309
- let license = i;
2310
- let homepage = void 0;
2311
- let support = void 0;
2312
- let name = void 0;
2313
- let namespace = void 0;
2314
- let repository = void 0;
2315
- const workspaceRoot = findWorkspaceRoot2(root);
2316
- if (existsSync6(join4(workspaceRoot, "package.json"))) {
2317
- const file = await readFile5(
2318
- joinPaths2(workspaceRoot, "package.json"),
2319
- "utf8"
2320
- );
2321
- if (file) {
2322
- const packageJson = JSON.parse(file);
2323
- if (packageJson.name) {
2324
- name = packageJson.name;
2325
- }
2326
- if (packageJson.namespace) {
2327
- namespace = packageJson.namespace;
2328
- }
2329
- if (packageJson.repository) {
2330
- if (typeof packageJson.repository === "string") {
2331
- repository = packageJson.repository;
2332
- } else if (packageJson.repository.url) {
2333
- repository = packageJson.repository.url;
2334
- }
2335
- }
2336
- if (packageJson.license) {
2337
- license = packageJson.license;
2338
- }
2339
- if (packageJson.homepage) {
2340
- homepage = packageJson.homepage;
2341
- }
2342
- if (packageJson.bugs) {
2343
- if (typeof packageJson.bugs === "string") {
2344
- support = packageJson.bugs;
2345
- } else if (packageJson.bugs.url) {
2346
- support = packageJson.bugs.url;
2347
- }
2348
- }
2349
- }
2350
- }
2351
- return {
2352
- workspaceRoot,
2353
- name,
2354
- namespace,
2355
- repository,
2356
- license,
2357
- homepage,
2358
- support
2359
- };
2360
- }
2361
- function applyDefaultConfig(config) {
2362
- if (!config.support && config.contact) {
2363
- config.support = config.contact;
2364
- }
2365
- if (!config.contact && config.support) {
2366
- config.contact = config.support;
2367
- }
2368
- if (config.homepage) {
2369
- if (!config.docs) {
2370
- config.docs = `${config.homepage}/docs`;
2371
- }
2372
- if (!config.license) {
2373
- config.license = `${config.homepage}/license`;
2374
- }
2375
- if (!config.support) {
2376
- config.support = `${config.homepage}/support`;
2377
- }
2378
- if (!config.contact) {
2379
- config.contact = `${config.homepage}/contact`;
2380
- }
2381
- if (!config.error?.codesFile || !config?.error?.url) {
2382
- config.error ??= { codesFile: S };
2383
- if (config.homepage) {
2384
- config.error.url ??= `${config.homepage}/errors`;
2385
- }
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];
2386
1559
  }
2387
- }
2388
- return config;
2389
- }
2390
-
2391
- // ../config-tools/dist/chunk-SDSQ2HHF.js
2392
- init_esm_shims();
2393
- var setExtensionEnv = (extensionName, extension) => {
2394
- for (const key of Object.keys(extension ?? {})) {
2395
- if (extension[key]) {
2396
- const result = key?.replace(
2397
- /([A-Z])+/g,
2398
- (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
2399
- ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
2400
- let extensionKey;
2401
- if (result.length === 0) {
2402
- return;
2403
- }
2404
- if (result.length === 1) {
2405
- extensionKey = result[0]?.toUpperCase() ?? "";
2406
- } else {
2407
- extensionKey = result.reduce((ret, part) => {
2408
- return `${ret}_${part.toLowerCase()}`;
2409
- });
2410
- }
2411
- process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
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
1648
+ };
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`;
2412
1666
  }
2413
1667
  }
2414
- };
2415
- var setConfigEnv = (config) => {
2416
- const prefix = "STORM_";
2417
- if (config.extends) {
2418
- process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
2419
- }
2420
- if (config.name) {
2421
- process.env[`${prefix}NAME`] = config.name;
2422
- }
2423
- if (config.variant) {
2424
- process.env[`${prefix}VARIANT`] = config.variant;
2425
- }
2426
- if (config.namespace) {
2427
- process.env[`${prefix}NAMESPACE`] = config.namespace;
2428
- }
2429
- if (config.owner) {
2430
- process.env[`${prefix}OWNER`] = config.owner;
2431
- }
2432
- if (config.bot) {
2433
- process.env[`${prefix}BOT_NAME`] = config.bot.name;
2434
- process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
2435
- }
2436
- if (config.error) {
2437
- process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
2438
- process.env[`${prefix}ERROR_URL`] = config.error.url;
2439
- }
2440
- if (config.release) {
2441
- if (config.release.banner) {
2442
- if (typeof config.release.banner === "string") {
2443
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
2444
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
2445
- } else {
2446
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
2447
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
2448
- process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
2449
- }
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`;
2450
1673
  }
2451
- process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
2452
- process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
2453
1674
  }
2454
- if (config.socials) {
2455
- if (config.socials.twitter) {
2456
- process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
2457
- }
2458
- if (config.socials.discord) {
2459
- process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
2460
- }
2461
- if (config.socials.telegram) {
2462
- process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
2463
- }
2464
- if (config.socials.slack) {
2465
- process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
2466
- }
2467
- if (config.socials.medium) {
2468
- process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
2469
- }
2470
- if (config.socials.github) {
2471
- process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
2472
- }
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
+ };
2473
1684
  }
2474
- if (config.organization) {
2475
- if (typeof config.organization === "string") {
2476
- process.env[`${prefix}ORG`] = config.organization;
2477
- process.env[`${prefix}ORG_NAME`] = config.organization;
2478
- process.env[`${prefix}ORGANIZATION`] = config.organization;
2479
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
2480
- } else {
2481
- process.env[`${prefix}ORG`] = config.organization.name;
2482
- process.env[`${prefix}ORG_NAME`] = config.organization.name;
2483
- process.env[`${prefix}ORGANIZATION`] = config.organization.name;
2484
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
2485
- if (config.organization.url) {
2486
- process.env[`${prefix}ORG_URL`] = config.organization.url;
2487
- process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
2488
- }
2489
- if (config.organization.description) {
2490
- process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
2491
- process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
2492
- }
2493
- if (config.organization.logo) {
2494
- process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
2495
- process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
2496
- }
2497
- if (config.organization.icon) {
2498
- process.env[`${prefix}ORG_ICON`] = config.organization.icon;
2499
- process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
2500
- }
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++;
2501
1703
  }
2502
1704
  }
2503
- if (config.packageManager) {
2504
- process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
2505
- }
2506
- if (config.license) {
2507
- process.env[`${prefix}LICENSE`] = config.license;
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++;
1743
+ }
2508
1744
  }
2509
- if (config.homepage) {
2510
- 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-7UEOVCKZ.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;
2511
1784
  }
2512
- if (config.docs) {
2513
- process.env[`${prefix}DOCS`] = config.docs;
1785
+ if (endFileNames.some((endFileName) => existsSync5(join3(_startPath, endFileName)))) {
1786
+ return _startPath;
2514
1787
  }
2515
- if (config.portal) {
2516
- 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);
2517
1791
  }
2518
- if (config.licensing) {
2519
- 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
+ );
2520
1843
  }
2521
- if (config.contact) {
2522
- 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
+ );
2523
1862
  }
2524
- if (config.support) {
2525
- process.env[`${prefix}SUPPORT`] = config.support;
1863
+ return result;
1864
+ }
1865
+
1866
+ // ../config-tools/dist/chunk-EN32U2DR.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"]
2526
1907
  }
2527
- if (config.timezone) {
2528
- process.env[`${prefix}TIMEZONE`] = config.timezone;
2529
- process.env.TZ = config.timezone;
2530
- process.env.DEFAULT_TIMEZONE = config.timezone;
2531
- 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
2532
1940
  }
2533
- if (config.locale) {
2534
- process.env[`${prefix}LOCALE`] = config.locale;
2535
- process.env.DEFAULT_LOCALE = config.locale;
2536
- process.env.LOCALE = config.locale;
2537
- 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;
2538
1946
  }
2539
- if (config.configFile) {
2540
- process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths2(
2541
- config.configFile
2542
- );
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";
2543
1958
  }
2544
- if (config.workspaceRoot) {
2545
- process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths2(config.workspaceRoot);
2546
- process.env.NX_WORKSPACE_ROOT = correctPaths2(config.workspaceRoot);
2547
- 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-EN32U2DR.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"
2548
2063
  }
2549
- if (config.directories) {
2550
- if (!config.skipCache && config.directories.cache) {
2551
- process.env[`${prefix}CACHE_DIR`] = correctPaths2(
2552
- config.directories.cache
2553
- );
2554
- process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
2555
- }
2556
- if (config.directories.data) {
2557
- process.env[`${prefix}DATA_DIR`] = correctPaths2(config.directories.data);
2558
- process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
2559
- }
2560
- if (config.directories.config) {
2561
- process.env[`${prefix}CONFIG_DIR`] = correctPaths2(
2562
- config.directories.config
2563
- );
2564
- process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
2565
- }
2566
- if (config.directories.temp) {
2567
- process.env[`${prefix}TEMP_DIR`] = correctPaths2(config.directories.temp);
2568
- process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
2569
- }
2570
- if (config.directories.log) {
2571
- process.env[`${prefix}LOG_DIR`] = correctPaths2(config.directories.log);
2572
- process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
2573
- }
2574
- if (config.directories.build) {
2575
- process.env[`${prefix}BUILD_DIR`] = correctPaths2(
2576
- config.directories.build
2577
- );
2578
- process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
2579
- }
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());
2580
2074
  }
2581
- if (config.skipCache !== void 0) {
2582
- process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
2583
- if (config.skipCache) {
2584
- process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
2585
- 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";
2586
2080
  }
2587
2081
  }
2588
- if (config.mode) {
2589
- process.env[`${prefix}MODE`] = config.mode;
2590
- process.env.NODE_ENV = config.mode;
2591
- process.env.ENVIRONMENT = config.mode;
2592
- }
2593
- if (config.colors?.base?.light || config.colors?.base?.dark) {
2594
- for (const key of Object.keys(config.colors)) {
2595
- 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];
2596
2144
  }
2597
- } else {
2598
- setThemeColorsEnv(
2599
- `${prefix}COLOR_`,
2600
- config.colors
2601
- );
2602
- }
2603
- if (config.repository) {
2604
- process.env[`${prefix}REPOSITORY`] = config.repository;
2605
- }
2606
- if (config.branch) {
2607
- 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"
2608
2234
  }
2609
- if (config.preid) {
2610
- 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"
2611
2266
  }
2612
- if (config.registry) {
2613
- if (config.registry.github) {
2614
- process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
2615
- }
2616
- if (config.registry.npm) {
2617
- process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
2618
- }
2619
- if (config.registry.cargo) {
2620
- process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
2621
- }
2622
- if (config.registry.cyclone) {
2623
- process.env[`${prefix}REGISTRY_CYCLONE`] = String(
2624
- config.registry.cyclone
2625
- );
2626
- }
2627
- if (config.registry.container) {
2628
- process.env[`${prefix}REGISTRY_CONTAINER`] = String(
2629
- config.registry.container
2630
- );
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";
2631
2279
  }
2632
2280
  }
2633
- if (config.logLevel) {
2634
- process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
2635
- process.env.LOG_LEVEL = String(config.logLevel);
2636
- process.env.NX_VERBOSE_LOGGING = String(
2637
- getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? true : false
2638
- );
2639
- process.env.RUST_BACKTRACE = getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? "full" : "none";
2640
- }
2641
- if (config.skipConfigLogging !== void 0) {
2642
- process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
2643
- 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))
2644
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
+ }
2645
2338
  }
2646
- process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
2647
- for (const key of Object.keys(config.extensions ?? {})) {
2648
- if (config.extensions[key] && Object.keys(config.extensions[key])) {
2649
- 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;
2650
2345
  }
2651
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
2652
2368
  };
2653
- var setThemeColorsEnv = (prefix, config) => {
2654
- return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
2369
+ var parseEraPatterns = {
2370
+ any: [/^b/i, /^(a|c)/i]
2655
2371
  };
2656
- var setSingleThemeColorsEnv = (prefix, config) => {
2657
- if (config.dark) {
2658
- process.env[`${prefix}DARK`] = config.dark;
2659
- }
2660
- if (config.light) {
2661
- process.env[`${prefix}LIGHT`] = config.light;
2662
- }
2663
- if (config.brand) {
2664
- process.env[`${prefix}BRAND`] = config.brand;
2665
- }
2666
- if (config.alternate) {
2667
- process.env[`${prefix}ALTERNATE`] = config.alternate;
2668
- }
2669
- if (config.accent) {
2670
- process.env[`${prefix}ACCENT`] = config.accent;
2671
- }
2672
- if (config.link) {
2673
- process.env[`${prefix}LINK`] = config.link;
2674
- }
2675
- if (config.help) {
2676
- process.env[`${prefix}HELP`] = config.help;
2677
- }
2678
- if (config.success) {
2679
- process.env[`${prefix}SUCCESS`] = config.success;
2680
- }
2681
- if (config.info) {
2682
- process.env[`${prefix}INFO`] = config.info;
2683
- }
2684
- if (config.debug) {
2685
- process.env[`${prefix}DEBUG`] = config.debug;
2686
- }
2687
- if (config.warning) {
2688
- process.env[`${prefix}WARNING`] = config.warning;
2689
- }
2690
- if (config.danger) {
2691
- process.env[`${prefix}DANGER`] = config.danger;
2692
- }
2693
- if (config.fatal) {
2694
- process.env[`${prefix}FATAL`] = config.fatal;
2695
- }
2696
- if (config.performance) {
2697
- process.env[`${prefix}PERFORMANCE`] = config.performance;
2698
- }
2699
- if (config.positive) {
2700
- process.env[`${prefix}POSITIVE`] = config.positive;
2701
- }
2702
- if (config.negative) {
2703
- process.env[`${prefix}NEGATIVE`] = config.negative;
2704
- }
2705
- if (config.gradient) {
2706
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
2707
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2708
- }
2709
- }
2372
+ var matchQuarterPatterns = {
2373
+ narrow: /^[1234]/i,
2374
+ abbreviated: /^q[1234]/i,
2375
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2710
2376
  };
2711
- var setMultiThemeColorsEnv = (prefix, config) => {
2712
- return {
2713
- light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
2714
- dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
2715
- };
2377
+ var parseQuarterPatterns = {
2378
+ any: [/1/i, /2/i, /3/i, /4/i]
2716
2379
  };
2717
- var setBaseThemeColorsEnv = (prefix, config) => {
2718
- if (config.foreground) {
2719
- process.env[`${prefix}FOREGROUND`] = config.foreground;
2720
- }
2721
- if (config.background) {
2722
- process.env[`${prefix}BACKGROUND`] = config.background;
2723
- }
2724
- if (config.brand) {
2725
- process.env[`${prefix}BRAND`] = config.brand;
2726
- }
2727
- if (config.alternate) {
2728
- process.env[`${prefix}ALTERNATE`] = config.alternate;
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
2729
2439
  }
2730
- if (config.accent) {
2731
- process.env[`${prefix}ACCENT`] = config.accent;
2440
+ };
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
+ })
2478
+ };
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
2732
2489
  }
2733
- if (config.link) {
2734
- 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;
2735
2571
  }
2736
- if (config.help) {
2737
- 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);
2738
2644
  }
2739
- if (config.success) {
2740
- 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
+ }
2741
2659
  }
2742
- if (config.info) {
2743
- 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
+ };
2744
2675
  }
2745
- if (config.debug) {
2746
- 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
+ };
2747
2686
  }
2748
- if (config.warning) {
2749
- 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
+ };
2750
2697
  }
2751
- if (config.danger) {
2752
- 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
+ };
2753
2708
  }
2754
- if (config.fatal) {
2755
- 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
+ };
2756
2719
  }
2757
- if (config.performance) {
2758
- 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
+ };
2759
2730
  }
2760
- if (config.positive) {
2761
- 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
+ };
2762
2741
  }
2763
- if (config.negative) {
2764
- 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
+ };
2765
2752
  }
2766
- if (config.gradient) {
2767
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
2768
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2769
- }
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
+ };
2770
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
+ };
2771
2773
  };
2772
-
2773
- // ../config-tools/dist/chunk-A5JXMY6X.js
2774
- init_esm_shims();
2775
- var getExtensionEnv = (extensionName) => {
2776
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
2777
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
2778
- const name = key.replace(prefix, "").split("_").map(
2779
- (i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
2780
- ).join("");
2781
- if (name) {
2782
- ret[name] = process.env[key];
2783
- }
2784
- return ret;
2785
- }, {});
2786
- };
2787
- var getConfigEnv = () => {
2788
- const prefix = "STORM_";
2789
- let config = {
2790
- extends: process.env[`${prefix}EXTENDS`] || void 0,
2791
- name: process.env[`${prefix}NAME`] || void 0,
2792
- variant: process.env[`${prefix}VARIANT`] || void 0,
2793
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
2794
- owner: process.env[`${prefix}OWNER`] || void 0,
2795
- bot: {
2796
- name: process.env[`${prefix}BOT_NAME`] || void 0,
2797
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
2798
- },
2799
- release: {
2800
- banner: {
2801
- url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
2802
- alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
2803
- },
2804
- header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
2805
- footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
2806
- },
2807
- error: {
2808
- codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
2809
- url: process.env[`${prefix}ERROR_URL`] || void 0
2810
- },
2811
- socials: {
2812
- twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
2813
- discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
2814
- telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
2815
- slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
2816
- medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
2817
- github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
2818
- },
2819
- 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`] ? {
2820
- name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
2821
- description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
2822
- url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
2823
- logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
2824
- icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
2825
- } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
2826
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
2827
- license: process.env[`${prefix}LICENSE`] || void 0,
2828
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
2829
- docs: process.env[`${prefix}DOCS`] || void 0,
2830
- portal: process.env[`${prefix}PORTAL`] || void 0,
2831
- licensing: process.env[`${prefix}LICENSING`] || void 0,
2832
- contact: process.env[`${prefix}CONTACT`] || void 0,
2833
- support: process.env[`${prefix}SUPPORT`] || void 0,
2834
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
2835
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
2836
- configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
2837
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
2838
- directories: {
2839
- 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,
2840
- 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,
2841
- 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,
2842
- 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,
2843
- 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,
2844
- 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
2845
- },
2846
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
2847
- mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
2848
- // ci:
2849
- // process.env[`${prefix}CI`] !== undefined
2850
- // ? Boolean(
2851
- // process.env[`${prefix}CI`] ??
2852
- // process.env.CI ??
2853
- // process.env.CONTINUOUS_INTEGRATION
2854
- // )
2855
- // : undefined,
2856
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
2857
- branch: process.env[`${prefix}BRANCH`] || void 0,
2858
- preid: process.env[`${prefix}PRE_ID`] || void 0,
2859
- registry: {
2860
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
2861
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
2862
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
2863
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
2864
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
2865
- },
2866
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
2867
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2868
- ) ? getLogLevelLabel2(
2869
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2870
- ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
2871
- 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
+ );
2872
2786
  };
2873
- const themeNames = Object.keys(process.env).filter(
2874
- (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
2875
- (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
2876
- )
2877
- );
2878
- config.colors = themeNames.length > 0 ? themeNames.reduce(
2879
- (ret, themeName) => {
2880
- ret[themeName] = getThemeColorsEnv(prefix, themeName);
2881
- return ret;
2882
- },
2883
- {}
2884
- ) : getThemeColorsEnv(prefix);
2885
- if (config.docs === s) {
2886
- if (config.homepage === r) {
2887
- config.docs = `${r}/projects/${config.name}/docs`;
2888
- } else {
2889
- config.docs = `${config.homepage}/docs`;
2890
- }
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" && message ? `
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" && message[key] ? 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;
2891
2825
  }
2892
- if (config.licensing === a) {
2893
- if (config.homepage === r) {
2894
- config.licensing = `${r}/projects/${config.name}/licensing`;
2895
- } else {
2896
- config.licensing = `${config.homepage}/docs`;
2826
+ };
2827
+
2828
+ // ../config-tools/dist/chunk-7UEOVCKZ.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
+ }
2897
2897
  }
2898
2898
  }
2899
- const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
2900
- if (serializedConfig) {
2901
- const parsed = JSON.parse(serializedConfig);
2902
- config = {
2903
- ...config,
2904
- ...parsed,
2905
- colors: { ...config.colors, ...parsed.colors },
2906
- extensions: { ...config.extensions, ...parsed.extensions }
2907
- };
2899
+ if (!config || Object.keys(config).length === 0) {
2900
+ return void 0;
2908
2901
  }
2902
+ config.configFile = configFile;
2909
2903
  return config;
2910
2904
  };
2911
- var getThemeColorsEnv = (prefix, theme) => {
2912
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
2913
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
2914
- };
2915
- var getSingleThemeColorsEnv = (prefix) => {
2916
- const gradient = [];
2917
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2918
- gradient.push(
2919
- process.env[`${prefix}GRADIENT_START`],
2920
- 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"
2921
2923
  );
2922
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2923
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2924
- while (process.env[`${prefix}GRADIENT_${index}`]) {
2925
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2926
- 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
+ }
2927
2952
  }
2928
2953
  }
2929
2954
  return {
2930
- dark: process.env[`${prefix}DARK`],
2931
- light: process.env[`${prefix}LIGHT`],
2932
- brand: process.env[`${prefix}BRAND`],
2933
- alternate: process.env[`${prefix}ALTERNATE`],
2934
- accent: process.env[`${prefix}ACCENT`],
2935
- link: process.env[`${prefix}LINK`],
2936
- help: process.env[`${prefix}HELP`],
2937
- success: process.env[`${prefix}SUCCESS`],
2938
- info: process.env[`${prefix}INFO`],
2939
- debug: process.env[`${prefix}DEBUG`],
2940
- warning: process.env[`${prefix}WARNING`],
2941
- danger: process.env[`${prefix}DANGER`],
2942
- fatal: process.env[`${prefix}FATAL`],
2943
- performance: process.env[`${prefix}PERFORMANCE`],
2944
- positive: process.env[`${prefix}POSITIVE`],
2945
- negative: process.env[`${prefix}NEGATIVE`],
2946
- gradient
2947
- };
2948
- };
2949
- var getMultiThemeColorsEnv = (prefix) => {
2950
- return {
2951
- light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
2952
- dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
2955
+ workspaceRoot,
2956
+ name,
2957
+ namespace,
2958
+ repository,
2959
+ license,
2960
+ homepage,
2961
+ support
2953
2962
  };
2954
- };
2955
- var getBaseThemeColorsEnv = (prefix) => {
2956
- const gradient = [];
2957
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2958
- gradient.push(
2959
- process.env[`${prefix}GRADIENT_START`],
2960
- process.env[`${prefix}GRADIENT_END`]
2961
- );
2962
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2963
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2964
- while (process.env[`${prefix}GRADIENT_${index}`]) {
2965
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2966
- 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
+ }
2967
2989
  }
2968
2990
  }
2969
- return {
2970
- foreground: process.env[`${prefix}FOREGROUND`],
2971
- background: process.env[`${prefix}BACKGROUND`],
2972
- brand: process.env[`${prefix}BRAND`],
2973
- alternate: process.env[`${prefix}ALTERNATE`],
2974
- accent: process.env[`${prefix}ACCENT`],
2975
- link: process.env[`${prefix}LINK`],
2976
- help: process.env[`${prefix}HELP`],
2977
- success: process.env[`${prefix}SUCCESS`],
2978
- info: process.env[`${prefix}INFO`],
2979
- debug: process.env[`${prefix}DEBUG`],
2980
- warning: process.env[`${prefix}WARNING`],
2981
- danger: process.env[`${prefix}DANGER`],
2982
- fatal: process.env[`${prefix}FATAL`],
2983
- performance: process.env[`${prefix}PERFORMANCE`],
2984
- positive: process.env[`${prefix}POSITIVE`],
2985
- negative: process.env[`${prefix}NEGATIVE`],
2986
- gradient
2987
- };
2988
- };
2991
+ return config;
2992
+ }
2989
2993
 
2990
2994
  // ../config/dist/schema.js
2991
2995
  init_esm_shims();
2992
2996
 
2993
- // ../config-tools/dist/chunk-6VD3CYGA.js
2997
+ // ../config-tools/dist/chunk-IASBTY6Z.js
2994
2998
  import defu4 from "defu";
2995
2999
  import { existsSync as existsSync7 } from "node:fs";
2996
3000
  var _extension_cache = /* @__PURE__ */ new WeakMap();
@@ -3091,7 +3095,7 @@ ${formatLogMessage2(config)}`,
3091
3095
  return config;
3092
3096
  };
3093
3097
 
3094
- // ../config-tools/dist/chunk-RL5DRDS6.js
3098
+ // ../config-tools/dist/chunk-L6MSRILP.js
3095
3099
  function getConfig(workspaceRoot, skipLogs = false) {
3096
3100
  return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
3097
3101
  }