@storm-software/tsup 0.2.177 → 0.2.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/options.cjs CHANGED
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(options_exports);
38
38
  var import_node_fs = require("fs");
39
39
  var import_node_path = require("path");
40
40
 
41
- // ../build-tools/dist/chunk-GFRBIUU6.mjs
41
+ // ../build-tools/dist/chunk-2D2G26KB.mjs
42
42
  var import_formatDistanceToNow = require("date-fns/formatDistanceToNow");
43
43
  var import_chalk = __toESM(require("chalk"), 1);
44
44
  var LogLevelLabel = {
@@ -75,7 +75,7 @@ var CONSOLE_ICONS = {
75
75
  [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
76
76
  };
77
77
 
78
- // ../build-tools/dist/chunk-JL5TSK3E.mjs
78
+ // ../build-tools/dist/chunk-ZU4PGT6D.mjs
79
79
  var import_c12 = require("c12");
80
80
  var import_defu = __toESM(require("defu"), 1);
81
81
  var z = __toESM(require("zod/v4/mini"), 1);
@@ -668,19 +668,19 @@ schemaRegistry.add(extensionsSchema, {
668
668
  // ../build-tools/dist/chunk-JCFRYUYP.mjs
669
669
  var import_create_task_graph = require("nx/src/tasks-runner/create-task-graph");
670
670
 
671
- // ../build-tools/dist/chunk-SI3IDR4Y.mjs
671
+ // ../build-tools/dist/chunk-O5JLRHXY.mjs
672
672
  var import_copy_assets_handler = require("@nx/js/src/utils/assets/copy-assets-handler");
673
673
  var import_glob = require("glob");
674
674
  var import_promises3 = require("fs/promises");
675
675
 
676
- // ../build-tools/dist/chunk-MZNEKMYV.mjs
676
+ // ../build-tools/dist/chunk-MD22HLYQ.mjs
677
677
  var import_buildable_libs_utils = require("@nx/js/src/utils/buildable-libs-utils");
678
678
  var import_glob2 = require("glob");
679
679
  var import_node_fs5 = require("fs");
680
680
  var import_promises4 = require("fs/promises");
681
681
  var import_project_graph = require("nx/src/project-graph/project-graph");
682
682
 
683
- // ../build-tools/dist/chunk-FBGJEKIF.mjs
683
+ // ../build-tools/dist/chunk-J4SM55F4.mjs
684
684
  var import_glob3 = require("glob");
685
685
 
686
686
  // ../build-tools/dist/chunk-TJ6NHBO5.mjs
@@ -714,7 +714,7 @@ var getEnv = (builder, options) => {
714
714
  // ../build-tools/dist/chunk-7YKXR5JJ.mjs
715
715
  var import_core = require("@swc/core");
716
716
 
717
- // ../build-tools/dist/chunk-YGAFXMVQ.mjs
717
+ // ../build-tools/dist/chunk-MT2TKIIG.mjs
718
718
  var import_node_fs6 = __toESM(require("fs"), 1);
719
719
  var import_node_module = require("module");
720
720
  var import_node_path3 = __toESM(require("path"), 1);
@@ -724,28 +724,6 @@ 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
-
749
727
  // ../config-tools/dist/chunk-V3GMJ4TX.js
750
728
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
751
729
  function normalizeWindowsPath(input = "") {
@@ -871,161 +849,6 @@ var isAbsolute = function(p3) {
871
849
  return _IS_ABSOLUTE_RE.test(p3);
872
850
  };
873
851
 
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
-
1029
852
  // ../config-tools/dist/chunk-RALMUN5C.js
1030
853
  var LogLevel2 = {
1031
854
  SILENT: 0,
@@ -1052,25 +875,6 @@ var LogLevelLabel2 = {
1052
875
  ALL: "all"
1053
876
  };
1054
877
 
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
-
1074
878
  // ../config-tools/dist/chunk-SXPH7ILL.js
1075
879
  var getLogLevel2 = (label) => {
1076
880
  switch (label) {
@@ -1127,925 +931,385 @@ var getLogLevelLabel2 = (logLevel = LogLevel2.INFO) => {
1127
931
  return LogLevelLabel2.INFO;
1128
932
  };
1129
933
 
1130
- // ../config-tools/dist/chunk-4UFIHIMZ.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"
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
+ }
1214
955
  }
1215
956
  };
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());
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;
1225
961
  }
1226
- if (options?.addSuffix) {
1227
- if (options.comparison && options.comparison > 0) {
1228
- return "in " + result;
1229
- } else {
1230
- return result + " ago";
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
+ }
1231
992
  }
993
+ process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
994
+ process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
1232
995
  }
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];
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
+ }
1015
+ }
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;
1291
1022
  } else {
1292
- const defaultWidth = args.defaultWidth;
1293
- const width = options?.width ? String(options.width) : args.defaultWidth;
1294
- valuesArray = args.values[width] || args.values[defaultWidth];
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
+ }
1295
1043
  }
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"
1385
1044
  }
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"
1045
+ if (config.packageManager) {
1046
+ process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
1417
1047
  }
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";
1430
- }
1048
+ if (config.license) {
1049
+ process.env[`${prefix}LICENSE`] = config.license;
1431
1050
  }
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;
1467
- }
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))
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
1473
1084
  );
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;
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);
1090
+ }
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`];
1488
1121
  }
1489
1122
  }
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;
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);
1128
+ }
1129
+ }
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]);
1138
+ }
1139
+ } else {
1140
+ setThemeColorsEnv(
1141
+ `${prefix}COLOR_`,
1142
+ config.colors
1143
+ );
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
+ );
1173
+ }
1174
+ }
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]);
1496
1192
  }
1497
1193
  }
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
1535
- };
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
- ]
1565
- };
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
1194
  };
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
1195
+ var setThemeColorsEnv = (prefix, config) => {
1196
+ return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
1579
1197
  };
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
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;
1210
+ }
1211
+ if (config.accent) {
1212
+ process.env[`${prefix}ACCENT`] = config.accent;
1213
+ }
1214
+ if (config.link) {
1215
+ process.env[`${prefix}LINK`] = config.link;
1216
+ }
1217
+ if (config.help) {
1218
+ process.env[`${prefix}HELP`] = config.help;
1219
+ }
1220
+ if (config.success) {
1221
+ process.env[`${prefix}SUCCESS`] = config.success;
1222
+ }
1223
+ if (config.info) {
1224
+ process.env[`${prefix}INFO`] = config.info;
1225
+ }
1226
+ if (config.debug) {
1227
+ process.env[`${prefix}DEBUG`] = config.debug;
1228
+ }
1229
+ if (config.warning) {
1230
+ process.env[`${prefix}WARNING`] = config.warning;
1231
+ }
1232
+ if (config.danger) {
1233
+ process.env[`${prefix}DANGER`] = config.danger;
1234
+ }
1235
+ if (config.fatal) {
1236
+ process.env[`${prefix}FATAL`] = config.fatal;
1237
+ }
1238
+ if (config.performance) {
1239
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1240
+ }
1241
+ if (config.positive) {
1242
+ process.env[`${prefix}POSITIVE`] = config.positive;
1243
+ }
1244
+ if (config.negative) {
1245
+ process.env[`${prefix}NEGATIVE`] = config.negative;
1246
+ }
1247
+ if (config.gradient) {
1248
+ for (let i3 = 0; i3 < config.gradient.length; i3++) {
1249
+ process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
1250
+ }
1590
1251
  }
1591
1252
  };
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
- })
1253
+ var setMultiThemeColorsEnv = (prefix, config) => {
1254
+ return {
1255
+ light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
1256
+ dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
1257
+ };
1629
1258
  };
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
1259
+ var setBaseThemeColorsEnv = (prefix, config) => {
1260
+ if (config.foreground) {
1261
+ process.env[`${prefix}FOREGROUND`] = config.foreground;
1640
1262
  }
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;
1263
+ if (config.background) {
1264
+ process.env[`${prefix}BACKGROUND`] = config.background;
1722
1265
  }
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);
1266
+ if (config.brand) {
1267
+ process.env[`${prefix}BRAND`] = config.brand;
1795
1268
  }
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
- }
1269
+ if (config.alternate) {
1270
+ process.env[`${prefix}ALTERNATE`] = config.alternate;
1810
1271
  }
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
- };
1272
+ if (config.accent) {
1273
+ process.env[`${prefix}ACCENT`] = config.accent;
1826
1274
  }
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
- };
1275
+ if (config.link) {
1276
+ process.env[`${prefix}LINK`] = config.link;
1837
1277
  }
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
- };
1278
+ if (config.help) {
1279
+ process.env[`${prefix}HELP`] = config.help;
1848
1280
  }
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
- };
1281
+ if (config.success) {
1282
+ process.env[`${prefix}SUCCESS`] = config.success;
1859
1283
  }
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
- };
1284
+ if (config.info) {
1285
+ process.env[`${prefix}INFO`] = config.info;
1870
1286
  }
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
- };
1287
+ if (config.debug) {
1288
+ process.env[`${prefix}DEBUG`] = config.debug;
1881
1289
  }
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
- };
1290
+ if (config.warning) {
1291
+ process.env[`${prefix}WARNING`] = config.warning;
1892
1292
  }
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
- };
1293
+ if (config.danger) {
1294
+ process.env[`${prefix}DANGER`] = config.danger;
1903
1295
  }
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
- };
1296
+ if (config.fatal) {
1297
+ process.env[`${prefix}FATAL`] = config.fatal;
1914
1298
  }
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
- };
1924
- };
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
- );
1937
- };
1938
- };
1939
- var MAX_DEPTH = 10;
1940
- var formatLogMessage2 = (message, options = {}, depth2 = 0) => {
1941
- if (depth2 > MAX_DEPTH) {
1942
- return "<max depth>";
1299
+ if (config.performance) {
1300
+ process.env[`${prefix}PERFORMANCE`] = config.performance;
1943
1301
  }
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.map(
1949
- (item, index) => ` ${prefix}> #${index} = ${formatLogMessage2(
1950
- item,
1951
- { prefix: `${prefix}--`, skip, sort },
1952
- depth2 + 1
1953
- )}`
1954
- ).join("\n")}` : typeof message === "object" ? `
1955
- ${Object.keys(message).filter((key) => !skip.includes(key)).sort(sort ? (a3, b2) => a3.localeCompare(b2) : void 0).map(
1956
- (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? Object.keys(message[key]).filter(
1957
- (key2) => !skip.includes(key2)
1958
- ).length === 0 ? "{}" : formatLogMessage2(
1959
- message[key],
1960
- { prefix: `${prefix}--`, skip, sort },
1961
- depth2 + 1
1962
- ) : message[key]}`
1963
- ).join("\n")}` : String(message);
1964
- };
1965
- var _isFunction = (value) => {
1966
- try {
1967
- return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
1968
- } catch {
1969
- return false;
1302
+ if (config.positive) {
1303
+ process.env[`${prefix}POSITIVE`] = config.positive;
1970
1304
  }
1971
- };
1972
-
1973
- // ../config-tools/dist/chunk-FXQGOFJI.js
1974
- var import_c122 = require("c12");
1975
- var import_defu3 = __toESM(require("defu"), 1);
1976
- var getConfigFileByName = async (fileName, filePath, options = {}) => {
1977
- const workspacePath = filePath || findWorkspaceRoot2(filePath);
1978
- const configs = await Promise.all([
1979
- (0, import_c122.loadConfig)({
1980
- cwd: workspacePath,
1981
- packageJson: true,
1982
- name: fileName,
1983
- envName: fileName?.toUpperCase(),
1984
- jitiOptions: {
1985
- debug: false,
1986
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
1987
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
1988
- "jiti"
1989
- )
1990
- },
1991
- ...options
1992
- }),
1993
- (0, import_c122.loadConfig)({
1994
- cwd: workspacePath,
1995
- packageJson: true,
1996
- name: fileName,
1997
- envName: fileName?.toUpperCase(),
1998
- jitiOptions: {
1999
- debug: false,
2000
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths2(
2001
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
2002
- "jiti"
2003
- )
2004
- },
2005
- configFile: fileName,
2006
- ...options
2007
- })
2008
- ]);
2009
- return (0, import_defu3.default)(configs[0] ?? {}, configs[1] ?? {});
2010
- };
2011
- var getConfigFile = async (filePath, additionalFileNames = []) => {
2012
- const workspacePath = filePath ? filePath : findWorkspaceRoot2(filePath);
2013
- const result = await getConfigFileByName("storm-workspace", workspacePath);
2014
- let config = result.config;
2015
- const configFile = result.configFile;
2016
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
2017
- writeTrace2(
2018
- `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
2019
- {
2020
- logLevel: "all"
2021
- }
2022
- );
1305
+ if (config.negative) {
1306
+ process.env[`${prefix}NEGATIVE`] = config.negative;
2023
1307
  }
2024
- if (additionalFileNames && additionalFileNames.length > 0) {
2025
- const results = await Promise.all(
2026
- additionalFileNames.map(
2027
- (fileName) => getConfigFileByName(fileName, workspacePath)
2028
- )
2029
- );
2030
- for (const result2 of results) {
2031
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
2032
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
2033
- writeTrace2(
2034
- `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
2035
- {
2036
- logLevel: "all"
2037
- }
2038
- );
2039
- }
2040
- config = (0, import_defu3.default)(result2.config ?? {}, config ?? {});
2041
- }
1308
+ if (config.gradient) {
1309
+ for (let i3 = 0; i3 < config.gradient.length; i3++) {
1310
+ process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2042
1311
  }
2043
1312
  }
2044
- if (!config || Object.keys(config).length === 0) {
2045
- return void 0;
2046
- }
2047
- config.configFile = configFile;
2048
- return config;
2049
1313
  };
2050
1314
 
2051
1315
  // ../config/dist/chunk-TYDRIJER.js
@@ -2241,691 +1505,1433 @@ o2.add(x, { description: "Storm Workspace config values used during various dev-
2241
1505
  // ../config/dist/chunk-YKRE3MWC.js
2242
1506
  var e3 = ["dark", "light", "base", "brand", "alternate", "accent", "link", "success", "help", "info", "warning", "danger", "fatal", "performance", "positive", "negative"];
2243
1507
 
2244
- // ../config-tools/dist/chunk-RGET2UQV.js
2245
- var import_node_fs8 = require("fs");
2246
- var import_promises5 = require("fs/promises");
2247
- var import_node_path5 = require("path");
2248
- async function getPackageJsonConfig(root) {
2249
- let license = i;
2250
- let homepage = void 0;
2251
- let support = void 0;
2252
- let name = void 0;
2253
- let namespace = void 0;
2254
- let repository = void 0;
2255
- const workspaceRoot = findWorkspaceRoot2(root);
2256
- if ((0, import_node_fs8.existsSync)((0, import_node_path5.join)(workspaceRoot, "package.json"))) {
2257
- const file = await (0, import_promises5.readFile)(
2258
- joinPaths2(workspaceRoot, "package.json"),
2259
- "utf8"
2260
- );
2261
- if (file) {
2262
- const packageJson = JSON.parse(file);
2263
- if (packageJson.name) {
2264
- name = packageJson.name;
2265
- }
2266
- if (packageJson.namespace) {
2267
- namespace = packageJson.namespace;
2268
- }
2269
- if (packageJson.repository) {
2270
- if (typeof packageJson.repository === "string") {
2271
- repository = packageJson.repository;
2272
- } else if (packageJson.repository.url) {
2273
- repository = packageJson.repository.url;
2274
- }
2275
- }
2276
- if (packageJson.license) {
2277
- license = packageJson.license;
2278
- }
2279
- if (packageJson.homepage) {
2280
- homepage = packageJson.homepage;
2281
- }
2282
- if (packageJson.bugs) {
2283
- if (typeof packageJson.bugs === "string") {
2284
- support = packageJson.bugs;
2285
- } else if (packageJson.bugs.url) {
2286
- support = packageJson.bugs.url;
2287
- }
2288
- }
2289
- }
2290
- }
2291
- return {
2292
- workspaceRoot,
2293
- name,
2294
- namespace,
2295
- repository,
2296
- license,
2297
- homepage,
2298
- support
2299
- };
2300
- }
2301
- function applyDefaultConfig(config) {
2302
- if (!config.support && config.contact) {
2303
- config.support = config.contact;
2304
- }
2305
- if (!config.contact && config.support) {
2306
- config.contact = config.support;
2307
- }
2308
- if (config.homepage) {
2309
- if (!config.docs) {
2310
- config.docs = `${config.homepage}/docs`;
2311
- }
2312
- if (!config.license) {
2313
- config.license = `${config.homepage}/license`;
2314
- }
2315
- if (!config.support) {
2316
- config.support = `${config.homepage}/support`;
2317
- }
2318
- if (!config.contact) {
2319
- config.contact = `${config.homepage}/contact`;
2320
- }
2321
- if (!config.error?.codesFile || !config?.error?.url) {
2322
- config.error ??= { codesFile: S };
2323
- if (config.homepage) {
2324
- config.error.url ??= `${config.homepage}/errors`;
2325
- }
2326
- }
2327
- }
2328
- return config;
2329
- }
2330
-
2331
- // ../config-tools/dist/chunk-SDSQ2HHF.js
2332
- var setExtensionEnv = (extensionName, extension) => {
2333
- for (const key of Object.keys(extension ?? {})) {
2334
- if (extension[key]) {
2335
- const result = key?.replace(
2336
- /([A-Z])+/g,
2337
- (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
2338
- ).split(/(?=[A-Z])|[.\-\s_]/).map((x2) => x2.toLowerCase()) ?? [];
2339
- let extensionKey;
2340
- if (result.length === 0) {
2341
- return;
2342
- }
2343
- if (result.length === 1) {
2344
- extensionKey = result[0]?.toUpperCase() ?? "";
2345
- } else {
2346
- extensionKey = result.reduce((ret, part) => {
2347
- return `${ret}_${part.toLowerCase()}`;
2348
- });
2349
- }
2350
- process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
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];
2351
1517
  }
2352
- }
1518
+ return ret;
1519
+ }, {});
2353
1520
  };
2354
- var setConfigEnv = (config) => {
1521
+ var getConfigEnv = () => {
2355
1522
  const prefix = "STORM_";
2356
- if (config.extends) {
2357
- process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
2358
- }
2359
- if (config.name) {
2360
- process.env[`${prefix}NAME`] = config.name;
2361
- }
2362
- if (config.variant) {
2363
- process.env[`${prefix}VARIANT`] = config.variant;
2364
- }
2365
- if (config.namespace) {
2366
- process.env[`${prefix}NAMESPACE`] = config.namespace;
2367
- }
2368
- if (config.owner) {
2369
- process.env[`${prefix}OWNER`] = config.owner;
2370
- }
2371
- if (config.bot) {
2372
- process.env[`${prefix}BOT_NAME`] = config.bot.name;
2373
- process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
2374
- }
2375
- if (config.error) {
2376
- process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
2377
- process.env[`${prefix}ERROR_URL`] = config.error.url;
2378
- }
2379
- if (config.release) {
2380
- if (config.release.banner) {
2381
- if (typeof config.release.banner === "string") {
2382
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
2383
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
2384
- } else {
2385
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
2386
- process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
2387
- process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
2388
- }
2389
- }
2390
- process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
2391
- process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
2392
- }
2393
- if (config.socials) {
2394
- if (config.socials.twitter) {
2395
- process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
2396
- }
2397
- if (config.socials.discord) {
2398
- process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
2399
- }
2400
- if (config.socials.telegram) {
2401
- process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
2402
- }
2403
- if (config.socials.slack) {
2404
- process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
2405
- }
2406
- if (config.socials.medium) {
2407
- process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
2408
- }
2409
- if (config.socials.github) {
2410
- process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
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
1606
+ };
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 {
1623
+ config.docs = `${config.homepage}/docs`;
2411
1624
  }
2412
1625
  }
2413
- if (config.organization) {
2414
- if (typeof config.organization === "string") {
2415
- process.env[`${prefix}ORG`] = config.organization;
2416
- process.env[`${prefix}ORG_NAME`] = config.organization;
2417
- process.env[`${prefix}ORGANIZATION`] = config.organization;
2418
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
1626
+ if (config.licensing === a) {
1627
+ if (config.homepage === r) {
1628
+ config.licensing = `${r}/projects/${config.name}/licensing`;
2419
1629
  } else {
2420
- process.env[`${prefix}ORG`] = config.organization.name;
2421
- process.env[`${prefix}ORG_NAME`] = config.organization.name;
2422
- process.env[`${prefix}ORGANIZATION`] = config.organization.name;
2423
- process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
2424
- if (config.organization.url) {
2425
- process.env[`${prefix}ORG_URL`] = config.organization.url;
2426
- process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
2427
- }
2428
- if (config.organization.description) {
2429
- process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
2430
- process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
2431
- }
2432
- if (config.organization.logo) {
2433
- process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
2434
- process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
2435
- }
2436
- if (config.organization.icon) {
2437
- process.env[`${prefix}ORG_ICON`] = config.organization.icon;
2438
- process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
2439
- }
1630
+ config.licensing = `${config.homepage}/docs`;
2440
1631
  }
2441
1632
  }
2442
- if (config.packageManager) {
2443
- process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
2444
- }
2445
- if (config.license) {
2446
- process.env[`${prefix}LICENSE`] = config.license;
2447
- }
2448
- if (config.homepage) {
2449
- process.env[`${prefix}HOMEPAGE`] = config.homepage;
2450
- }
2451
- if (config.docs) {
2452
- process.env[`${prefix}DOCS`] = config.docs;
2453
- }
2454
- if (config.portal) {
2455
- process.env[`${prefix}PORTAL`] = config.portal;
2456
- }
2457
- if (config.licensing) {
2458
- process.env[`${prefix}LICENSING`] = config.licensing;
2459
- }
2460
- if (config.contact) {
2461
- process.env[`${prefix}CONTACT`] = config.contact;
2462
- }
2463
- if (config.support) {
2464
- process.env[`${prefix}SUPPORT`] = config.support;
2465
- }
2466
- if (config.timezone) {
2467
- process.env[`${prefix}TIMEZONE`] = config.timezone;
2468
- process.env.TZ = config.timezone;
2469
- process.env.DEFAULT_TIMEZONE = config.timezone;
2470
- process.env.TIMEZONE = config.timezone;
2471
- }
2472
- if (config.locale) {
2473
- process.env[`${prefix}LOCALE`] = config.locale;
2474
- process.env.DEFAULT_LOCALE = config.locale;
2475
- process.env.LOCALE = config.locale;
2476
- process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
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
+ };
2477
1642
  }
2478
- if (config.configFile) {
2479
- process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths2(
2480
- config.configFile
1643
+ 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`]
2481
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++;
1661
+ }
2482
1662
  }
2483
- if (config.workspaceRoot) {
2484
- process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths2(config.workspaceRoot);
2485
- process.env.NX_WORKSPACE_ROOT = correctPaths2(config.workspaceRoot);
2486
- process.env.NX_WORKSPACE_ROOT_PATH = correctPaths2(config.workspaceRoot);
2487
- }
2488
- if (config.directories) {
2489
- if (!config.skipCache && config.directories.cache) {
2490
- process.env[`${prefix}CACHE_DIR`] = correctPaths2(
2491
- config.directories.cache
2492
- );
2493
- process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
2494
- }
2495
- if (config.directories.data) {
2496
- process.env[`${prefix}DATA_DIR`] = correctPaths2(config.directories.data);
2497
- process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
2498
- }
2499
- if (config.directories.config) {
2500
- process.env[`${prefix}CONFIG_DIR`] = correctPaths2(
2501
- config.directories.config
2502
- );
2503
- process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
2504
- }
2505
- if (config.directories.temp) {
2506
- process.env[`${prefix}TEMP_DIR`] = correctPaths2(config.directories.temp);
2507
- process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
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
+ };
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++;
2508
1701
  }
2509
- if (config.directories.log) {
2510
- process.env[`${prefix}LOG_DIR`] = correctPaths2(config.directories.log);
2511
- process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1702
+ }
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;
1735
+ }
1736
+ if (endFileNames.some((endFileName) => (0, import_node_fs7.existsSync)((0, import_node_path4.join)(_startPath, endFileName)))) {
1737
+ return _startPath;
1738
+ }
1739
+ if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
1740
+ const parent = (0, import_node_path4.join)(_startPath, "..");
1741
+ return findFolderUp(parent, endFileNames, endDirectoryNames);
1742
+ }
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
+ );
1794
+ }
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
+ );
1813
+ }
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"]
1854
+ }
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
1885
+ }
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;
1891
+ }
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";
1899
+ }
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"
2004
+ }
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());
2015
+ }
2016
+ if (options?.addSuffix) {
2017
+ if (options.comparison && options.comparison > 0) {
2018
+ return "in " + result;
2019
+ } else {
2020
+ return result + " ago";
2512
2021
  }
2513
- if (config.directories.build) {
2514
- process.env[`${prefix}BUILD_DIR`] = correctPaths2(
2515
- config.directories.build
2516
- );
2517
- process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
2022
+ }
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];
2518
2085
  }
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"
2519
2175
  }
2520
- if (config.skipCache !== void 0) {
2521
- process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
2522
- if (config.skipCache) {
2523
- process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
2524
- process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
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
+ }
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";
2525
2220
  }
2526
2221
  }
2527
- if (config.mode) {
2528
- process.env[`${prefix}MODE`] = config.mode;
2529
- process.env.NODE_ENV = config.mode;
2530
- process.env.ENVIRONMENT = config.mode;
2531
- }
2532
- if (config.colors?.base?.light || config.colors?.base?.dark) {
2533
- for (const key of Object.keys(config.colors)) {
2534
- setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
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;
2535
2257
  }
2536
- } else {
2537
- setThemeColorsEnv(
2538
- `${prefix}COLOR_`,
2539
- config.colors
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))
2540
2263
  );
2541
- }
2542
- if (config.repository) {
2543
- process.env[`${prefix}REPOSITORY`] = config.repository;
2544
- }
2545
- if (config.branch) {
2546
- process.env[`${prefix}BRANCH`] = config.branch;
2547
- }
2548
- if (config.preid) {
2549
- process.env[`${prefix}PRE_ID`] = String(config.preid);
2550
- }
2551
- if (config.registry) {
2552
- if (config.registry.github) {
2553
- process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
2554
- }
2555
- if (config.registry.npm) {
2556
- process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
2557
- }
2558
- if (config.registry.cargo) {
2559
- process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
2560
- }
2561
- if (config.registry.cyclone) {
2562
- process.env[`${prefix}REGISTRY_CYCLONE`] = String(
2563
- config.registry.cyclone
2564
- );
2565
- }
2566
- if (config.registry.container) {
2567
- process.env[`${prefix}REGISTRY_CONTAINER`] = String(
2568
- config.registry.container
2569
- );
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;
2570
2278
  }
2571
2279
  }
2572
- if (config.logLevel) {
2573
- process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
2574
- process.env.LOG_LEVEL = String(config.logLevel);
2575
- process.env.NX_VERBOSE_LOGGING = String(
2576
- getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? true : false
2577
- );
2578
- process.env.RUST_BACKTRACE = getLogLevel2(config.logLevel) >= LogLevel2.DEBUG ? "full" : "none";
2579
- }
2580
- if (config.skipConfigLogging !== void 0) {
2581
- process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
2582
- config.skipConfigLogging
2583
- );
2584
- }
2585
- process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
2586
- for (const key of Object.keys(config.extensions ?? {})) {
2587
- if (config.extensions[key] && Object.keys(config.extensions[key])) {
2588
- setExtensionEnv(key, config.extensions[key]);
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;
2589
2286
  }
2590
2287
  }
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
2591
2309
  };
2592
- var setThemeColorsEnv = (prefix, config) => {
2593
- return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
2310
+ var parseEraPatterns = {
2311
+ any: [/^b/i, /^(a|c)/i]
2594
2312
  };
2595
- var setSingleThemeColorsEnv = (prefix, config) => {
2596
- if (config.dark) {
2597
- process.env[`${prefix}DARK`] = config.dark;
2598
- }
2599
- if (config.light) {
2600
- process.env[`${prefix}LIGHT`] = config.light;
2601
- }
2602
- if (config.brand) {
2603
- process.env[`${prefix}BRAND`] = config.brand;
2604
- }
2605
- if (config.alternate) {
2606
- process.env[`${prefix}ALTERNATE`] = config.alternate;
2607
- }
2608
- if (config.accent) {
2609
- process.env[`${prefix}ACCENT`] = config.accent;
2610
- }
2611
- if (config.link) {
2612
- process.env[`${prefix}LINK`] = config.link;
2613
- }
2614
- if (config.help) {
2615
- process.env[`${prefix}HELP`] = config.help;
2616
- }
2617
- if (config.success) {
2618
- process.env[`${prefix}SUCCESS`] = config.success;
2619
- }
2620
- if (config.info) {
2621
- process.env[`${prefix}INFO`] = config.info;
2622
- }
2623
- if (config.debug) {
2624
- process.env[`${prefix}DEBUG`] = config.debug;
2625
- }
2626
- if (config.warning) {
2627
- process.env[`${prefix}WARNING`] = config.warning;
2628
- }
2629
- if (config.danger) {
2630
- process.env[`${prefix}DANGER`] = config.danger;
2631
- }
2632
- if (config.fatal) {
2633
- process.env[`${prefix}FATAL`] = config.fatal;
2634
- }
2635
- if (config.performance) {
2636
- process.env[`${prefix}PERFORMANCE`] = config.performance;
2637
- }
2638
- if (config.positive) {
2639
- process.env[`${prefix}POSITIVE`] = config.positive;
2640
- }
2641
- if (config.negative) {
2642
- process.env[`${prefix}NEGATIVE`] = config.negative;
2643
- }
2644
- if (config.gradient) {
2645
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
2646
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2647
- }
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
+ };
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
2369
+ };
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
2648
2380
  }
2649
2381
  };
2650
- var setMultiThemeColorsEnv = (prefix, config) => {
2651
- return {
2652
- light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
2653
- dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
2654
- };
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
+ })
2655
2419
  };
2656
- var setBaseThemeColorsEnv = (prefix, config) => {
2657
- if (config.foreground) {
2658
- process.env[`${prefix}FOREGROUND`] = config.foreground;
2659
- }
2660
- if (config.background) {
2661
- process.env[`${prefix}BACKGROUND`] = config.background;
2662
- }
2663
- if (config.brand) {
2664
- process.env[`${prefix}BRAND`] = config.brand;
2665
- }
2666
- if (config.alternate) {
2667
- process.env[`${prefix}ALTERNATE`] = config.alternate;
2668
- }
2669
- if (config.accent) {
2670
- process.env[`${prefix}ACCENT`] = config.accent;
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
2671
2430
  }
2672
- if (config.link) {
2673
- process.env[`${prefix}LINK`] = config.link;
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;
2674
2512
  }
2675
- if (config.help) {
2676
- process.env[`${prefix}HELP`] = config.help;
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);
2677
2585
  }
2678
- if (config.success) {
2679
- process.env[`${prefix}SUCCESS`] = config.success;
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
+ }
2680
2600
  }
2681
- if (config.info) {
2682
- process.env[`${prefix}INFO`] = config.info;
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
+ };
2683
2616
  }
2684
- if (config.debug) {
2685
- process.env[`${prefix}DEBUG`] = config.debug;
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
+ };
2686
2627
  }
2687
- if (config.warning) {
2688
- process.env[`${prefix}WARNING`] = config.warning;
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
+ };
2689
2638
  }
2690
- if (config.danger) {
2691
- process.env[`${prefix}DANGER`] = config.danger;
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
+ };
2692
2649
  }
2693
- if (config.fatal) {
2694
- process.env[`${prefix}FATAL`] = config.fatal;
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
+ };
2695
2660
  }
2696
- if (config.performance) {
2697
- process.env[`${prefix}PERFORMANCE`] = config.performance;
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
+ };
2698
2671
  }
2699
- if (config.positive) {
2700
- process.env[`${prefix}POSITIVE`] = config.positive;
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
+ };
2701
2682
  }
2702
- if (config.negative) {
2703
- process.env[`${prefix}NEGATIVE`] = config.negative;
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
+ };
2704
2693
  }
2705
- if (config.gradient) {
2706
- for (let i3 = 0; i3 < config.gradient.length; i3++) {
2707
- process.env[`${prefix}GRADIENT_${i3}`] = config.gradient[i3];
2708
- }
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
+ };
2709
2704
  }
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
+ };
2710
2714
  };
2711
-
2712
- // ../config-tools/dist/chunk-A5JXMY6X.js
2713
- var getExtensionEnv = (extensionName) => {
2714
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
2715
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
2716
- const name = key.replace(prefix, "").split("_").map(
2717
- (i3) => i3.length > 0 ? i3.trim().charAt(0).toUpperCase() + i3.trim().slice(1) : ""
2718
- ).join("");
2719
- if (name) {
2720
- ret[name] = process.env[key];
2721
- }
2722
- return ret;
2723
- }, {});
2724
- };
2725
- var getConfigEnv = () => {
2726
- const prefix = "STORM_";
2727
- let config = {
2728
- extends: process.env[`${prefix}EXTENDS`] || void 0,
2729
- name: process.env[`${prefix}NAME`] || void 0,
2730
- variant: process.env[`${prefix}VARIANT`] || void 0,
2731
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
2732
- owner: process.env[`${prefix}OWNER`] || void 0,
2733
- bot: {
2734
- name: process.env[`${prefix}BOT_NAME`] || void 0,
2735
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
2736
- },
2737
- release: {
2738
- banner: {
2739
- url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
2740
- alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
2741
- },
2742
- header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
2743
- footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
2744
- },
2745
- error: {
2746
- codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
2747
- url: process.env[`${prefix}ERROR_URL`] || void 0
2748
- },
2749
- socials: {
2750
- twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
2751
- discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
2752
- telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
2753
- slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
2754
- medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
2755
- github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
2756
- },
2757
- 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`] ? {
2758
- name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
2759
- description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
2760
- url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
2761
- logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
2762
- icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
2763
- } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
2764
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
2765
- license: process.env[`${prefix}LICENSE`] || void 0,
2766
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
2767
- docs: process.env[`${prefix}DOCS`] || void 0,
2768
- portal: process.env[`${prefix}PORTAL`] || void 0,
2769
- licensing: process.env[`${prefix}LICENSING`] || void 0,
2770
- contact: process.env[`${prefix}CONTACT`] || void 0,
2771
- support: process.env[`${prefix}SUPPORT`] || void 0,
2772
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
2773
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
2774
- configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths2(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
2775
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths2(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
2776
- directories: {
2777
- 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,
2778
- 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,
2779
- 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,
2780
- 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,
2781
- 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,
2782
- 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
2783
- },
2784
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
2785
- mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
2786
- // ci:
2787
- // process.env[`${prefix}CI`] !== undefined
2788
- // ? Boolean(
2789
- // process.env[`${prefix}CI`] ??
2790
- // process.env.CI ??
2791
- // process.env.CONTINUOUS_INTEGRATION
2792
- // )
2793
- // : undefined,
2794
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
2795
- branch: process.env[`${prefix}BRANCH`] || void 0,
2796
- preid: process.env[`${prefix}PRE_ID`] || void 0,
2797
- registry: {
2798
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
2799
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
2800
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
2801
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
2802
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
2803
- },
2804
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
2805
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2806
- ) ? getLogLevelLabel2(
2807
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
2808
- ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
2809
- skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
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
+ );
2810
2727
  };
2811
- const themeNames = Object.keys(process.env).filter(
2812
- (envKey) => envKey.startsWith(`${prefix}COLOR_`) && e3.every(
2813
- (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
2814
- )
2815
- );
2816
- config.colors = themeNames.length > 0 ? themeNames.reduce(
2817
- (ret, themeName) => {
2818
- ret[themeName] = getThemeColorsEnv(prefix, themeName);
2819
- return ret;
2820
- },
2821
- {}
2822
- ) : getThemeColorsEnv(prefix);
2823
- if (config.docs === s) {
2824
- if (config.homepage === r) {
2825
- config.docs = `${r}/projects/${config.name}/docs`;
2826
- } else {
2827
- config.docs = `${config.homepage}/docs`;
2828
- }
2829
- }
2830
- if (config.licensing === a) {
2831
- if (config.homepage === r) {
2832
- config.licensing = `${r}/projects/${config.name}/licensing`;
2833
- } else {
2834
- config.licensing = `${config.homepage}/docs`;
2835
- }
2728
+ };
2729
+ var MAX_DEPTH = 10;
2730
+ var formatLogMessage2 = (message, options = {}, depth2 = 0) => {
2731
+ if (depth2 > MAX_DEPTH) {
2732
+ return "<max depth>";
2836
2733
  }
2837
- const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
2838
- if (serializedConfig) {
2839
- const parsed = JSON.parse(serializedConfig);
2840
- config = {
2841
- ...config,
2842
- ...parsed,
2843
- colors: { ...config.colors, ...parsed.colors },
2844
- extensions: { ...config.extensions, ...parsed.extensions }
2845
- };
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;
2846
2766
  }
2847
- return config;
2848
2767
  };
2849
- var getThemeColorsEnv = (prefix, theme) => {
2850
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
2851
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
2768
+
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] ?? {});
2852
2806
  };
2853
- var getSingleThemeColorsEnv = (prefix) => {
2854
- const gradient = [];
2855
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2856
- gradient.push(
2857
- process.env[`${prefix}GRADIENT_START`],
2858
- process.env[`${prefix}GRADIENT_END`]
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
+ }
2859
2818
  );
2860
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2861
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2862
- while (process.env[`${prefix}GRADIENT_${index}`]) {
2863
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2864
- index++;
2819
+ }
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
+ }
2865
2838
  }
2866
2839
  }
2867
- return {
2868
- dark: process.env[`${prefix}DARK`],
2869
- light: process.env[`${prefix}LIGHT`],
2870
- brand: process.env[`${prefix}BRAND`],
2871
- alternate: process.env[`${prefix}ALTERNATE`],
2872
- accent: process.env[`${prefix}ACCENT`],
2873
- link: process.env[`${prefix}LINK`],
2874
- help: process.env[`${prefix}HELP`],
2875
- success: process.env[`${prefix}SUCCESS`],
2876
- info: process.env[`${prefix}INFO`],
2877
- debug: process.env[`${prefix}DEBUG`],
2878
- warning: process.env[`${prefix}WARNING`],
2879
- danger: process.env[`${prefix}DANGER`],
2880
- fatal: process.env[`${prefix}FATAL`],
2881
- performance: process.env[`${prefix}PERFORMANCE`],
2882
- positive: process.env[`${prefix}POSITIVE`],
2883
- negative: process.env[`${prefix}NEGATIVE`],
2884
- gradient
2885
- };
2886
- };
2887
- var getMultiThemeColorsEnv = (prefix) => {
2888
- return {
2889
- light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
2890
- dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
2891
- };
2840
+ if (!config || Object.keys(config).length === 0) {
2841
+ return void 0;
2842
+ }
2843
+ config.configFile = configFile;
2844
+ return config;
2892
2845
  };
2893
- var getBaseThemeColorsEnv = (prefix) => {
2894
- const gradient = [];
2895
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
2896
- gradient.push(
2897
- process.env[`${prefix}GRADIENT_START`],
2898
- process.env[`${prefix}GRADIENT_END`]
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"
2899
2863
  );
2900
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
2901
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
2902
- while (process.env[`${prefix}GRADIENT_${index}`]) {
2903
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
2904
- index++;
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
+ }
2905
2892
  }
2906
2893
  }
2907
2894
  return {
2908
- foreground: process.env[`${prefix}FOREGROUND`],
2909
- background: process.env[`${prefix}BACKGROUND`],
2910
- brand: process.env[`${prefix}BRAND`],
2911
- alternate: process.env[`${prefix}ALTERNATE`],
2912
- accent: process.env[`${prefix}ACCENT`],
2913
- link: process.env[`${prefix}LINK`],
2914
- help: process.env[`${prefix}HELP`],
2915
- success: process.env[`${prefix}SUCCESS`],
2916
- info: process.env[`${prefix}INFO`],
2917
- debug: process.env[`${prefix}DEBUG`],
2918
- warning: process.env[`${prefix}WARNING`],
2919
- danger: process.env[`${prefix}DANGER`],
2920
- fatal: process.env[`${prefix}FATAL`],
2921
- performance: process.env[`${prefix}PERFORMANCE`],
2922
- positive: process.env[`${prefix}POSITIVE`],
2923
- negative: process.env[`${prefix}NEGATIVE`],
2924
- gradient
2895
+ workspaceRoot,
2896
+ name,
2897
+ namespace,
2898
+ repository,
2899
+ license,
2900
+ homepage,
2901
+ support
2925
2902
  };
2926
- };
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
+ }
2929
+ }
2930
+ }
2931
+ return config;
2932
+ }
2927
2933
 
2928
- // ../config-tools/dist/chunk-UWI3QVYJ.js
2934
+ // ../config-tools/dist/chunk-DW5363CG.js
2929
2935
  var import_defu4 = __toESM(require("defu"), 1);
2930
2936
  var import_node_fs9 = require("fs");
2931
2937
  var _extension_cache = /* @__PURE__ */ new WeakMap();
@@ -3026,7 +3032,7 @@ ${formatLogMessage2(config)}`,
3026
3032
  return config;
3027
3033
  };
3028
3034
 
3029
- // ../config-tools/dist/chunk-TIH4RSTL.js
3035
+ // ../config-tools/dist/chunk-KKF5NXBI.js
3030
3036
  function getConfig(workspaceRoot, skipLogs = false) {
3031
3037
  return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
3032
3038
  }