@storm-software/config-tools 1.190.19 → 1.190.21

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.
Files changed (53) hide show
  1. package/bin/config.cjs +9 -3
  2. package/bin/config.js +9 -3
  3. package/dist/{chunk-FXQGOFJI.js → chunk-2JA3KDUW.js} +1 -1
  4. package/dist/{chunk-TIH4RSTL.js → chunk-3SX4SLEU.js} +1 -1
  5. package/dist/{chunk-4UFIHIMZ.js → chunk-4IHL3E5M.js} +37 -31
  6. package/dist/{chunk-KRVACLYZ.cjs → chunk-5OYYSFK5.cjs} +3 -3
  7. package/dist/{chunk-QXMSQMVN.cjs → chunk-7YIRETM2.cjs} +14 -14
  8. package/dist/{chunk-DFWIRJGH.cjs → chunk-BEFNWKPD.cjs} +3 -3
  9. package/dist/{chunk-AZJQFL6W.cjs → chunk-BF4MDUTR.cjs} +37 -31
  10. package/dist/{chunk-MOXINQRL.js → chunk-BUB7FBXA.js} +1 -1
  11. package/dist/{chunk-VEYONVTU.js → chunk-C47DWQVX.js} +1 -1
  12. package/dist/{chunk-5NAMOQCY.js → chunk-CBM6ZRFO.js} +1 -1
  13. package/dist/{chunk-44SHQAD4.cjs → chunk-DPHVF4QR.cjs} +10 -10
  14. package/dist/{chunk-UWI3QVYJ.js → chunk-DW5363CG.js} +9 -9
  15. package/dist/chunk-EYNQLRTA.cjs +165 -0
  16. package/dist/{chunk-R5BZDTQW.cjs → chunk-FOAMXVC2.cjs} +2 -2
  17. package/dist/chunk-FZ2ZJFWB.js +165 -0
  18. package/dist/{chunk-TW273ZN4.cjs → chunk-GXRAHLKT.cjs} +9 -9
  19. package/dist/chunk-H7J7UFAV.cjs +47 -0
  20. package/dist/chunk-IMRWBPKB.cjs +35 -0
  21. package/dist/chunk-JLLNUKG7.cjs +55 -0
  22. package/dist/chunk-KKF5NXBI.js +40 -0
  23. package/dist/chunk-MNUSVN5B.js +55 -0
  24. package/dist/chunk-NFL55S75.cjs +40 -0
  25. package/dist/chunk-NT26TB4H.js +92 -0
  26. package/dist/chunk-O76J367J.js +947 -0
  27. package/dist/chunk-SN6BVPYU.cjs +92 -0
  28. package/dist/chunk-T35FQNUH.cjs +947 -0
  29. package/dist/chunk-TAD4S6KA.js +47 -0
  30. package/dist/chunk-TLZTD7WU.js +35 -0
  31. package/dist/config-file/get-config-file.cjs +9 -9
  32. package/dist/config-file/get-config-file.js +8 -8
  33. package/dist/config-file/index.cjs +9 -9
  34. package/dist/config-file/index.js +8 -8
  35. package/dist/create-storm-config.cjs +12 -12
  36. package/dist/create-storm-config.js +11 -11
  37. package/dist/get-config.cjs +13 -13
  38. package/dist/get-config.js +12 -12
  39. package/dist/index.cjs +23 -23
  40. package/dist/index.js +25 -25
  41. package/dist/logger/console.cjs +4 -4
  42. package/dist/logger/console.js +3 -3
  43. package/dist/logger/create-logger.cjs +5 -5
  44. package/dist/logger/create-logger.js +4 -4
  45. package/dist/logger/index.cjs +8 -8
  46. package/dist/logger/index.js +10 -10
  47. package/dist/utilities/index.cjs +8 -8
  48. package/dist/utilities/index.js +7 -7
  49. package/dist/utilities/process-handler.cjs +5 -5
  50. package/dist/utilities/process-handler.js +4 -4
  51. package/dist/utilities/toml.cjs +6 -6
  52. package/dist/utilities/toml.js +5 -5
  53. package/package.json +5 -5
@@ -19,7 +19,7 @@ var _chunkJWLDCEBZcjs = require('./chunk-JWLDCEBZ.cjs');
19
19
 
20
20
  var _chunk7QBTVNMRcjs = require('./chunk-7QBTVNMR.cjs');
21
21
 
22
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
22
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/constants.js
23
23
  var daysInYear = 365.2425;
24
24
  var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
25
25
  var minTime = -maxTime;
@@ -33,7 +33,7 @@ var secondsInMonth = secondsInYear / 12;
33
33
  var secondsInQuarter = secondsInMonth * 3;
34
34
  var constructFromSymbol = Symbol.for("constructDateFrom");
35
35
 
36
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
36
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/constructFrom.js
37
37
  function constructFrom(date, value) {
38
38
  if (typeof date === "function") return date(value);
39
39
  if (date && typeof date === "object" && constructFromSymbol in date)
@@ -42,12 +42,12 @@ function constructFrom(date, value) {
42
42
  return new Date(value);
43
43
  }
44
44
 
45
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructNow.js
45
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/constructNow.js
46
46
  function constructNow(date) {
47
47
  return constructFrom(date, Date.now());
48
48
  }
49
49
 
50
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
50
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
51
51
  var formatDistanceLocale = {
52
52
  lessThanXSeconds: {
53
53
  one: "less than a second",
@@ -131,7 +131,7 @@ var formatDistance = (token, count, options) => {
131
131
  return result;
132
132
  };
133
133
 
134
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
134
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
135
135
  function buildFormatLongFn(args) {
136
136
  return (options = {}) => {
137
137
  const width = options.width ? String(options.width) : args.defaultWidth;
@@ -140,7 +140,7 @@ function buildFormatLongFn(args) {
140
140
  };
141
141
  }
142
142
 
143
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js
143
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/en-US/_lib/formatLong.js
144
144
  var dateFormats = {
145
145
  full: "EEEE, MMMM do, y",
146
146
  long: "MMMM do, y",
@@ -174,7 +174,7 @@ var formatLong = {
174
174
  })
175
175
  };
176
176
 
177
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
177
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
178
178
  var formatRelativeLocale = {
179
179
  lastWeek: "'last' eeee 'at' p",
180
180
  yesterday: "'yesterday at' p",
@@ -185,7 +185,7 @@ var formatRelativeLocale = {
185
185
  };
186
186
  var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
187
187
 
188
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
188
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
189
189
  function buildLocalizeFn(args) {
190
190
  return (value, options) => {
191
191
  const context = _optionalChain([options, 'optionalAccess', _3 => _3.context]) ? String(options.context) : "standalone";
@@ -204,7 +204,7 @@ function buildLocalizeFn(args) {
204
204
  };
205
205
  }
206
206
 
207
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js
207
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/en-US/_lib/localize.js
208
208
  var eraValues = {
209
209
  narrow: ["B", "A"],
210
210
  abbreviated: ["BC", "AD"],
@@ -366,7 +366,7 @@ var localize = {
366
366
  })
367
367
  };
368
368
 
369
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
369
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/_lib/buildMatchFn.js
370
370
  function buildMatchFn(args) {
371
371
  return (string, options = {}) => {
372
372
  const width = options.width;
@@ -408,7 +408,7 @@ function findIndex(array, predicate) {
408
408
  return void 0;
409
409
  }
410
410
 
411
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
411
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
412
412
  function buildMatchPatternFn(args) {
413
413
  return (string, options = {}) => {
414
414
  const matchResult = string.match(args.matchPattern);
@@ -423,7 +423,7 @@ function buildMatchPatternFn(args) {
423
423
  };
424
424
  }
425
425
 
426
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js
426
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/en-US/_lib/match.js
427
427
  var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
428
428
  var parseOrdinalNumberPattern = /\d+/i;
429
429
  var matchEraPatterns = {
@@ -542,7 +542,7 @@ var match = {
542
542
  })
543
543
  };
544
544
 
545
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js
545
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/locale/en-US.js
546
546
  var enUS = {
547
547
  code: "en-US",
548
548
  formatDistance,
@@ -556,18 +556,18 @@ var enUS = {
556
556
  }
557
557
  };
558
558
 
559
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
559
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/_lib/defaultOptions.js
560
560
  var defaultOptions = {};
561
561
  function getDefaultOptions() {
562
562
  return defaultOptions;
563
563
  }
564
564
 
565
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
565
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/toDate.js
566
566
  function toDate(argument, context) {
567
567
  return constructFrom(context || argument, argument);
568
568
  }
569
569
 
570
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
570
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
571
571
  function getTimezoneOffsetInMilliseconds(date) {
572
572
  const _date = toDate(date);
573
573
  const utcDate = new Date(
@@ -585,7 +585,7 @@ function getTimezoneOffsetInMilliseconds(date) {
585
585
  return +date - +utcDate;
586
586
  }
587
587
 
588
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
588
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/_lib/normalizeDates.js
589
589
  function normalizeDates(context, ...dates) {
590
590
  const normalize = constructFrom.bind(
591
591
  null,
@@ -594,7 +594,7 @@ function normalizeDates(context, ...dates) {
594
594
  return dates.map(normalize);
595
595
  }
596
596
 
597
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareAsc.js
597
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/compareAsc.js
598
598
  function compareAsc(dateLeft, dateRight) {
599
599
  const diff = +toDate(dateLeft) - +toDate(dateRight);
600
600
  if (diff < 0) return -1;
@@ -602,7 +602,7 @@ function compareAsc(dateLeft, dateRight) {
602
602
  return diff;
603
603
  }
604
604
 
605
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js
605
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/differenceInCalendarMonths.js
606
606
  function differenceInCalendarMonths(laterDate, earlierDate, options) {
607
607
  const [laterDate_, earlierDate_] = normalizeDates(
608
608
  _optionalChain([options, 'optionalAccess', _6 => _6.in]),
@@ -614,14 +614,14 @@ function differenceInCalendarMonths(laterDate, earlierDate, options) {
614
614
  return yearsDiff * 12 + monthsDiff;
615
615
  }
616
616
 
617
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDay.js
617
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/endOfDay.js
618
618
  function endOfDay(date, options) {
619
619
  const _date = toDate(date, _optionalChain([options, 'optionalAccess', _7 => _7.in]));
620
620
  _date.setHours(23, 59, 59, 999);
621
621
  return _date;
622
622
  }
623
623
 
624
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js
624
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/endOfMonth.js
625
625
  function endOfMonth(date, options) {
626
626
  const _date = toDate(date, _optionalChain([options, 'optionalAccess', _8 => _8.in]));
627
627
  const month = _date.getMonth();
@@ -630,13 +630,13 @@ function endOfMonth(date, options) {
630
630
  return _date;
631
631
  }
632
632
 
633
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isLastDayOfMonth.js
633
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/isLastDayOfMonth.js
634
634
  function isLastDayOfMonth(date, options) {
635
635
  const _date = toDate(date, _optionalChain([options, 'optionalAccess', _9 => _9.in]));
636
636
  return +endOfDay(_date, options) === +endOfMonth(_date, options);
637
637
  }
638
638
 
639
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMonths.js
639
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/differenceInMonths.js
640
640
  function differenceInMonths(laterDate, earlierDate, options) {
641
641
  const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
642
642
  _optionalChain([options, 'optionalAccess', _10 => _10.in]),
@@ -660,7 +660,7 @@ function differenceInMonths(laterDate, earlierDate, options) {
660
660
  return result === 0 ? 0 : result;
661
661
  }
662
662
 
663
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getRoundingMethod.js
663
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/_lib/getRoundingMethod.js
664
664
  function getRoundingMethod(method) {
665
665
  return (number) => {
666
666
  const round = method ? Math[method] : Math.trunc;
@@ -669,18 +669,18 @@ function getRoundingMethod(method) {
669
669
  };
670
670
  }
671
671
 
672
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js
672
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/differenceInMilliseconds.js
673
673
  function differenceInMilliseconds(laterDate, earlierDate) {
674
674
  return +toDate(laterDate) - +toDate(earlierDate);
675
675
  }
676
676
 
677
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js
677
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/differenceInSeconds.js
678
678
  function differenceInSeconds(laterDate, earlierDate, options) {
679
679
  const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
680
680
  return getRoundingMethod(_optionalChain([options, 'optionalAccess', _11 => _11.roundingMethod]))(diff);
681
681
  }
682
682
 
683
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js
683
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/formatDistance.js
684
684
  function formatDistance2(laterDate, earlierDate, options) {
685
685
  const defaultOptions2 = getDefaultOptions();
686
686
  const locale = _nullishCoalesce(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _12 => _12.locale]), () => ( defaultOptions2.locale)), () => ( enUS));
@@ -754,7 +754,7 @@ function formatDistance2(laterDate, earlierDate, options) {
754
754
  }
755
755
  }
756
756
 
757
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js
757
+ // ../../node_modules/.pnpm/date-fns@4.2.1/node_modules/date-fns/formatDistanceToNow.js
758
758
  function formatDistanceToNow(date, options) {
759
759
  return formatDistance2(date, constructNow(date), options);
760
760
  }
@@ -898,16 +898,22 @@ var formatLogMessage = (message, options = {}, depth = 0) => {
898
898
  const skip = _nullishCoalesce(options.skip, () => ( []));
899
899
  const sort = _nullishCoalesce(options.sort, () => ( true));
900
900
  return typeof message === "undefined" || message === null ? "<empty>" : typeof message === "string" ? !message ? "<empty string>" : message : Array.isArray(message) ? `
901
- ${message.map(
901
+ ${message.sort(
902
+ sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
903
+ ).map(
902
904
  (item, index) => ` ${prefix}> #${index} = ${formatLogMessage(
903
905
  item,
904
906
  { prefix: `${prefix}--`, skip, sort },
905
907
  depth + 1
906
908
  )}`
907
909
  ).join("\n")}` : typeof message === "object" ? `
908
- ${Object.keys(message).filter((key) => !skip.includes(key)).sort(sort ? (a, b) => a.localeCompare(b) : void 0).map(
910
+ ${Object.keys(message).filter(
911
+ (key) => typeof key !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key.toLowerCase().trim())
912
+ ).sort(
913
+ sort ? (a, b) => !a && !b ? 0 : !a ? 1 : !b ? -1 : String(a).localeCompare(String(b)) : void 0
914
+ ).map(
909
915
  (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? Object.keys(message[key]).filter(
910
- (key2) => !skip.includes(key2)
916
+ (key2) => typeof key2 !== "string" || !skip.map((k) => k.toLowerCase().trim()).includes(key2.toLowerCase().trim())
911
917
  ).length === 0 ? "{}" : formatLogMessage(
912
918
  message[key],
913
919
  { prefix: `${prefix}--`, skip, sort },
@@ -3,7 +3,7 @@ import {
3
3
  writeFatal,
4
4
  writeSuccess,
5
5
  writeTrace
6
- } from "./chunk-4UFIHIMZ.js";
6
+ } from "./chunk-O76J367J.js";
7
7
 
8
8
  // src/utilities/process-handler.ts
9
9
  var exitWithError = (config) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeError
3
- } from "./chunk-4UFIHIMZ.js";
3
+ } from "./chunk-4IHL3E5M.js";
4
4
 
5
5
  // src/utilities/toml.ts
6
6
  import TOML from "@ltd/j-toml";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getLogFn,
3
3
  getStopwatch
4
- } from "./chunk-4UFIHIMZ.js";
4
+ } from "./chunk-O76J367J.js";
5
5
  import {
6
6
  LogLevel
7
7
  } from "./chunk-RALMUN5C.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
3
 
4
- var _chunkAZJQFL6Wcjs = require('./chunk-AZJQFL6W.cjs');
4
+ var _chunkT35FQNUHcjs = require('./chunk-T35FQNUH.cjs');
5
5
 
6
6
 
7
7
  var _chunk7QBTVNMRcjs = require('./chunk-7QBTVNMR.cjs');
@@ -9,14 +9,14 @@ var _chunk7QBTVNMRcjs = require('./chunk-7QBTVNMR.cjs');
9
9
  // src/logger/create-logger.ts
10
10
  var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
11
11
  async function createLogger(config) {
12
- const writeFatal = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.FATAL, config, { chalk: _chalk2.default });
13
- const writeError = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.ERROR, config, { chalk: _chalk2.default });
14
- const writeWarning = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.WARN, config, { chalk: _chalk2.default });
15
- const writeInfo = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.INFO, config, { chalk: _chalk2.default });
16
- const writeSuccess = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.SUCCESS, config, { chalk: _chalk2.default });
17
- const writeDebug = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.DEBUG, config, { chalk: _chalk2.default });
18
- const writePerformance = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.PERFORMANCE, config, { chalk: _chalk2.default });
19
- const writeTrace = _chunkAZJQFL6Wcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.TRACE, config, { chalk: _chalk2.default });
12
+ const writeFatal = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.FATAL, config, { chalk: _chalk2.default });
13
+ const writeError = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.ERROR, config, { chalk: _chalk2.default });
14
+ const writeWarning = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.WARN, config, { chalk: _chalk2.default });
15
+ const writeInfo = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.INFO, config, { chalk: _chalk2.default });
16
+ const writeSuccess = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.SUCCESS, config, { chalk: _chalk2.default });
17
+ const writeDebug = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.DEBUG, config, { chalk: _chalk2.default });
18
+ const writePerformance = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.PERFORMANCE, config, { chalk: _chalk2.default });
19
+ const writeTrace = _chunkT35FQNUHcjs.getLogFn.call(void 0, _chunk7QBTVNMRcjs.LogLevel.TRACE, config, { chalk: _chalk2.default });
20
20
  return {
21
21
  fatal: writeFatal,
22
22
  error: writeError,
@@ -26,7 +26,7 @@ async function createLogger(config) {
26
26
  performance: writePerformance,
27
27
  debug: writeDebug,
28
28
  trace: writeTrace,
29
- getStopwatch: _chunkAZJQFL6Wcjs.getStopwatch
29
+ getStopwatch: _chunkT35FQNUHcjs.getStopwatch
30
30
  };
31
31
  }
32
32
 
@@ -1,6 +1,13 @@
1
+ import {
2
+ setConfigEnv
3
+ } from "./chunk-SDSQ2HHF.js";
4
+ import {
5
+ getConfigEnv,
6
+ getExtensionEnv
7
+ } from "./chunk-A5JXMY6X.js";
1
8
  import {
2
9
  getConfigFile
3
- } from "./chunk-FXQGOFJI.js";
10
+ } from "./chunk-NT26TB4H.js";
4
11
  import {
5
12
  applyDefaultConfig,
6
13
  getPackageJsonConfig
@@ -12,14 +19,7 @@ import {
12
19
  formatLogMessage,
13
20
  writeTrace,
14
21
  writeWarning
15
- } from "./chunk-4UFIHIMZ.js";
16
- import {
17
- setConfigEnv
18
- } from "./chunk-SDSQ2HHF.js";
19
- import {
20
- getConfigEnv,
21
- getExtensionEnv
22
- } from "./chunk-A5JXMY6X.js";
22
+ } from "./chunk-O76J367J.js";
23
23
  import {
24
24
  joinPaths
25
25
  } from "./chunk-V3GMJ4TX.js";
@@ -0,0 +1,165 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkBEFNWKPDcjs = require('./chunk-BEFNWKPD.cjs');
4
+
5
+
6
+
7
+ var _chunkCFXT4ZAWcjs = require('./chunk-CFXT4ZAW.cjs');
8
+
9
+
10
+ var _chunk3CNCDDWZcjs = require('./chunk-3CNCDDWZ.cjs');
11
+
12
+
13
+
14
+
15
+ var _chunkBF4MDUTRcjs = require('./chunk-BF4MDUTR.cjs');
16
+
17
+
18
+ var _chunkB2CQPVVLcjs = require('./chunk-B2CQPVVL.cjs');
19
+
20
+
21
+
22
+ var _chunkNHILCONIcjs = require('./chunk-NHILCONI.cjs');
23
+
24
+
25
+ var _chunkBDATZ3UBcjs = require('./chunk-BDATZ3UB.cjs');
26
+
27
+ // src/create-storm-config.ts
28
+ var _schema = require('@storm-software/config/schema');
29
+ var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
30
+ var _fs = require('fs');
31
+ var _extension_cache = /* @__PURE__ */ new WeakMap();
32
+ var _static_cache = void 0;
33
+ var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
34
+ let result;
35
+ if (!_optionalChain([_static_cache, 'optionalAccess', _ => _.data]) || !_optionalChain([_static_cache, 'optionalAccess', _2 => _2.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
36
+ let _workspaceRoot = workspaceRoot;
37
+ if (!_workspaceRoot) {
38
+ _workspaceRoot = _chunk3CNCDDWZcjs.findWorkspaceRoot.call(void 0, );
39
+ }
40
+ const configEnv = _chunkNHILCONIcjs.getConfigEnv.call(void 0, );
41
+ const configFile = await _chunkBEFNWKPDcjs.getConfigFile.call(void 0, _workspaceRoot);
42
+ if (!configFile) {
43
+ if (!skipLogs) {
44
+ _chunkBF4MDUTRcjs.writeWarning.call(void 0,
45
+ "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n",
46
+ { logLevel: "all" }
47
+ );
48
+ }
49
+ if (useDefault === false) {
50
+ return void 0;
51
+ }
52
+ }
53
+ const defaultConfig = await _chunkCFXT4ZAWcjs.getPackageJsonConfig.call(void 0, _workspaceRoot);
54
+ const configInput = _defu2.default.call(void 0,
55
+ configEnv,
56
+ configFile,
57
+ defaultConfig
58
+ );
59
+ if (!configInput.variant) {
60
+ configInput.variant = _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, "nx.json")) || _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, ".nx")) || _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, "lerna.json")) || _fs.existsSync.call(void 0, _chunkBDATZ3UBcjs.joinPaths.call(void 0, _workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
61
+ }
62
+ try {
63
+ const parseResult = await Promise.resolve(
64
+ _schema.workspaceConfigSchema._zod.parse(
65
+ { value: configInput, issues: [] },
66
+ { async: true }
67
+ )
68
+ );
69
+ result = _chunkCFXT4ZAWcjs.applyDefaultConfig.call(void 0, parseResult.value);
70
+ result.workspaceRoot ??= _workspaceRoot;
71
+ } catch (error) {
72
+ throw new Error(
73
+ `Failed to parse Storm Workspace configuration${_optionalChain([error, 'optionalAccess', _3 => _3.message]) ? `: ${error.message}` : ""}
74
+
75
+ Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${_chunkBF4MDUTRcjs.formatLogMessage.call(void 0,
76
+ configInput
77
+ )}`,
78
+ {
79
+ cause: error
80
+ }
81
+ );
82
+ }
83
+ } else {
84
+ result = _static_cache.data;
85
+ }
86
+ if (schema && extensionName) {
87
+ result.extensions = {
88
+ ...result.extensions,
89
+ [extensionName]: createConfigExtension(extensionName, schema)
90
+ };
91
+ }
92
+ _static_cache = {
93
+ timestamp: Date.now(),
94
+ data: result
95
+ };
96
+ return result;
97
+ };
98
+ var createConfigExtension = (extensionName, schema) => {
99
+ const extension_cache_key = { extensionName };
100
+ if (_extension_cache.has(extension_cache_key)) {
101
+ return _extension_cache.get(extension_cache_key);
102
+ }
103
+ let extension = _chunkNHILCONIcjs.getExtensionEnv.call(void 0, extensionName);
104
+ if (schema) {
105
+ extension = schema.parse(extension);
106
+ }
107
+ _extension_cache.set(extension_cache_key, extension);
108
+ return extension;
109
+ };
110
+ var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
111
+ const config = await createStormWorkspaceConfig(
112
+ void 0,
113
+ void 0,
114
+ workspaceRoot,
115
+ skipLogs,
116
+ true
117
+ );
118
+ _chunkB2CQPVVLcjs.setConfigEnv.call(void 0, config);
119
+ if (!skipLogs && !config.skipConfigLogging) {
120
+ _chunkBF4MDUTRcjs.writeTrace.call(void 0,
121
+ `\u2699\uFE0F Using Storm Workspace configuration:
122
+ ${_chunkBF4MDUTRcjs.formatLogMessage.call(void 0, config)}`,
123
+ config
124
+ );
125
+ }
126
+ return config;
127
+ };
128
+ var tryLoadStormWorkspaceConfig = async (workspaceRoot, skipLogs = true, useDefault = false) => {
129
+ try {
130
+ const config = await createStormWorkspaceConfig(
131
+ void 0,
132
+ void 0,
133
+ workspaceRoot,
134
+ skipLogs,
135
+ useDefault
136
+ );
137
+ if (!config) {
138
+ return void 0;
139
+ }
140
+ _chunkB2CQPVVLcjs.setConfigEnv.call(void 0, config);
141
+ if (!skipLogs && !config.skipConfigLogging) {
142
+ _chunkBF4MDUTRcjs.writeTrace.call(void 0,
143
+ `\u2699\uFE0F Using Storm Workspace configuration:
144
+ ${_chunkBF4MDUTRcjs.formatLogMessage.call(void 0, config)}`,
145
+ config
146
+ );
147
+ }
148
+ return config;
149
+ } catch (error) {
150
+ if (!skipLogs) {
151
+ _chunkBF4MDUTRcjs.writeWarning.call(void 0,
152
+ `\u26A0\uFE0F Failed to load Storm Workspace configuration: ${error}`,
153
+ { logLevel: "all" }
154
+ );
155
+ }
156
+ return void 0;
157
+ }
158
+ };
159
+
160
+
161
+
162
+
163
+
164
+
165
+ exports.createStormWorkspaceConfig = createStormWorkspaceConfig; exports.createConfigExtension = createConfigExtension; exports.loadStormWorkspaceConfig = loadStormWorkspaceConfig; exports.tryLoadStormWorkspaceConfig = tryLoadStormWorkspaceConfig;
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkAZJQFL6Wcjs = require('./chunk-AZJQFL6W.cjs');
3
+ var _chunkT35FQNUHcjs = require('./chunk-T35FQNUH.cjs');
4
4
 
5
5
  // src/utilities/toml.ts
6
6
  var _jtoml = require('@ltd/j-toml'); var _jtoml2 = _interopRequireDefault(_jtoml);
7
7
  function parseCargoTomlWithTree(tree, projectRoot, projectName) {
8
8
  const cargoTomlString = _optionalChain([tree, 'access', _ => _.read, 'call', _2 => _2(`${projectRoot}/Cargo.toml`), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
9
9
  if (!cargoTomlString) {
10
- _chunkAZJQFL6Wcjs.writeError.call(void 0, `Cannot find a Cargo.toml file in the ${projectName}`);
10
+ _chunkT35FQNUHcjs.writeError.call(void 0, `Cannot find a Cargo.toml file in the ${projectName}`);
11
11
  throw new Error();
12
12
  }
13
13
  return parseCargoToml(cargoTomlString);