@storm-software/tsup 0.2.179 → 0.2.180

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