@storm-software/linting-tools 1.28.1 → 1.29.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.28.1](https://github.com/storm-software/storm-ops/compare/linting-tools-v1.28.0...linting-tools-v1.28.1) (2024-01-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **config-tools:** Added the `defineConfig` function to type-check config options ([0676271](https://github.com/storm-software/storm-ops/commit/0676271161ec4a04715fb495f55042328a9f116f))
7
+
1
8
  # [1.28.0](https://github.com/storm-software/storm-ops/compare/linting-tools-v1.27.2...linting-tools-v1.28.0) (2024-01-19)
2
9
 
3
10
 
package/bin/lint.js CHANGED
@@ -278627,203 +278627,23 @@ var init_lib2 = __esm({
278627
278627
 
278628
278628
  // packages/config-tools/src/config-file/get-config-file.ts
278629
278629
  var import_cosmiconfig = __toESM(require_dist(), 1);
278630
-
278631
- // packages/config-tools/src/utilities/logger.ts
278632
- var chalk = __toESM(require_source(), 1);
278633
-
278634
- // packages/config-tools/src/types.ts
278635
- var LogLevel = {
278636
- SILENT: 0,
278637
- FATAL: 10,
278638
- ERROR: 20,
278639
- WARN: 30,
278640
- INFO: 40,
278641
- SUCCESS: 45,
278642
- DEBUG: 60,
278643
- TRACE: 70,
278644
- ALL: 100
278645
- };
278646
- var LogLevelLabel = {
278647
- SILENT: "silent",
278648
- FATAL: "fatal",
278649
- ERROR: "error",
278650
- WARN: "warn",
278651
- INFO: "info",
278652
- DEBUG: "debug",
278653
- TRACE: "trace",
278654
- ALL: "all"
278655
- };
278656
-
278657
- // packages/config-tools/src/utilities/get-log-level.ts
278658
- var getLogLevel = (label) => {
278659
- switch (label) {
278660
- case "all":
278661
- return LogLevel.ALL;
278662
- case "trace":
278663
- return LogLevel.TRACE;
278664
- case "debug":
278665
- return LogLevel.DEBUG;
278666
- case "info":
278667
- return LogLevel.INFO;
278668
- case "warn":
278669
- return LogLevel.WARN;
278670
- case "error":
278671
- return LogLevel.ERROR;
278672
- case "fatal":
278673
- return LogLevel.FATAL;
278674
- case "silent":
278675
- return LogLevel.SILENT;
278676
- default:
278677
- return LogLevel.INFO;
278678
- }
278679
- };
278680
- var getLogLevelLabel = (logLevel) => {
278681
- if (logLevel >= LogLevel.ALL) {
278682
- return LogLevelLabel.ALL;
278683
- }
278684
- if (logLevel >= LogLevel.TRACE) {
278685
- return LogLevelLabel.TRACE;
278686
- }
278687
- if (logLevel >= LogLevel.DEBUG) {
278688
- return LogLevelLabel.DEBUG;
278689
- }
278690
- if (logLevel >= LogLevel.INFO) {
278691
- return LogLevelLabel.INFO;
278692
- }
278693
- if (logLevel >= LogLevel.WARN) {
278694
- return LogLevelLabel.WARN;
278695
- }
278696
- if (logLevel >= LogLevel.ERROR) {
278697
- return LogLevelLabel.ERROR;
278698
- }
278699
- if (logLevel >= LogLevel.FATAL) {
278700
- return LogLevelLabel.FATAL;
278701
- }
278702
- if (logLevel <= LogLevel.SILENT) {
278703
- return LogLevelLabel.SILENT;
278704
- }
278705
- return LogLevelLabel.INFO;
278706
- };
278707
-
278708
- // packages/config-tools/src/utilities/logger.ts
278709
- var getLogFn = (config3 = {}, logLevel = LogLevel.INFO) => {
278710
- if (typeof logLevel === "number" && (logLevel >= getLogLevel(config3.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config3.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
278711
- return (_) => {
278712
- };
278713
- }
278714
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
278715
- return (message) => {
278716
- console.error(
278717
- `
278718
- ${chalk.bold.hex(config3?.colors?.fatal ? config3.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config3?.colors?.fatal ? config3.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
278719
- config3?.colors?.fatal ? config3.colors.fatal : "#1fb2a6"
278720
- )(message)}
278721
-
278722
- `
278723
- );
278724
- };
278725
- }
278726
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
278727
- return (message) => {
278728
- console.error(
278729
- `
278730
- ${chalk.bold.hex(config3?.colors?.error ? config3.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config3?.colors?.error ? config3.colors.error : "#7d1a1a").white(" \u2718 Error ")} ${chalk.hex(
278731
- config3?.colors?.error ? config3.colors.error : "#7d1a1a"
278732
- )(message)}
278733
- `
278734
- );
278735
- };
278736
- }
278737
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
278738
- return (message) => {
278739
- console.warn(
278740
- `
278741
- ${chalk.bold.hex(config3?.colors?.warning ? config3.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config3?.colors?.warning ? config3.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
278742
- config3?.colors?.warning ? config3.colors.warning : "#fcc419"
278743
- )(message)}
278744
- `
278745
- );
278746
- };
278747
- }
278748
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
278749
- return (message) => {
278750
- console.info(
278751
- `
278752
- ${chalk.bold.hex(config3?.colors?.info ? config3.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config3?.colors?.info ? config3.colors.info : "#0ea5e9").white(" \u2139 Info ")} ${chalk.hex(config3?.colors?.info ? config3.colors.info : "#0ea5e9")(
278753
- message
278754
- )}
278755
- `
278756
- );
278757
- };
278758
- }
278759
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
278760
- return (message) => {
278761
- console.info(
278762
- `
278763
- ${chalk.bold.hex(config3?.colors?.success ? config3.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config3?.colors?.success ? config3.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
278764
- config3?.colors?.success ? config3.colors.success : "#087f5b"
278765
- )(message)}
278766
- `
278767
- );
278768
- };
278769
- }
278770
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
278771
- return (message) => {
278772
- console.debug(
278773
- `
278774
- ${chalk.bold.hex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
278775
- config3?.colors?.primary ? config3.colors.primary : "#1fb2a6"
278776
- )(message)}
278777
- `
278778
- );
278779
- };
278780
- }
278781
- return (message) => {
278782
- console.log(
278783
- `
278784
- ${chalk.bold.hex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
278785
- config3?.colors?.primary ? config3.colors.primary : "#1fb2a6"
278786
- )(message)}
278787
- `
278788
- );
278789
- };
278790
- };
278791
- var writeFatal = (config3, message) => getLogFn(config3, LogLevel.FATAL)(message);
278792
- var writeError = (config3, message) => getLogFn(config3, LogLevel.ERROR)(message);
278793
- var writeWarning = (config3, message) => getLogFn(config3, LogLevel.WARN)(message);
278794
- var writeInfo = (config3, message) => getLogFn(config3, LogLevel.INFO)(message);
278795
- var writeSuccess = (config3, message) => getLogFn(config3, LogLevel.SUCCESS)(message);
278796
- var writeDebug = (config3, message) => getLogFn(config3, LogLevel.DEBUG)(message);
278797
- var writeTrace = (config3, message) => getLogFn(config3, LogLevel.TRACE)(message);
278798
-
278799
- // packages/config-tools/src/config-file/get-config-file.ts
278800
278630
  var _static_cache = void 0;
278801
- var getConfigFileName = async (fileName, filePath2) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath2);
278631
+ var getConfigFileByName = async (fileName, filePath2) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath2);
278802
278632
  var getConfigFile = async (filePath2) => {
278803
278633
  if (_static_cache) {
278804
278634
  return _static_cache;
278805
278635
  }
278806
- let cosmiconfigResult = await getConfigFileName("storm", filePath2);
278636
+ let cosmiconfigResult = await getConfigFileByName("storm", filePath2);
278807
278637
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
278808
- cosmiconfigResult = await getConfigFileName("storm-software", filePath2);
278638
+ cosmiconfigResult = await getConfigFileByName("storm-software", filePath2);
278809
278639
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
278810
- cosmiconfigResult = await getConfigFileName("storm-stack", filePath2);
278640
+ cosmiconfigResult = await getConfigFileByName("storm-stack", filePath2);
278811
278641
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
278812
- cosmiconfigResult = await getConfigFileName("storm-cloud", filePath2);
278813
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
278814
- cosmiconfigResult = await getConfigFileName("acidic", filePath2);
278815
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
278816
- cosmiconfigResult = await getConfigFileName("acid", filePath2);
278817
- }
278818
- }
278642
+ cosmiconfigResult = await getConfigFileByName("storm-cloud", filePath2);
278819
278643
  }
278820
278644
  }
278821
278645
  }
278822
278646
  if (!cosmiconfigResult || Object.keys(cosmiconfigResult).length === 0 || cosmiconfigResult.isEmpty || !cosmiconfigResult.filepath) {
278823
- writeWarning(
278824
- { logLevel: "all" },
278825
- "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not.\n"
278826
- );
278827
278647
  return void 0;
278828
278648
  }
278829
278649
  const config3 = cosmiconfigResult.config ?? {};
@@ -282614,6 +282434,172 @@ var getDefaultConfig = (config3 = {}, root) => {
282614
282434
  });
282615
282435
  };
282616
282436
 
282437
+ // packages/config-tools/src/types.ts
282438
+ var LogLevel = {
282439
+ SILENT: 0,
282440
+ FATAL: 10,
282441
+ ERROR: 20,
282442
+ WARN: 30,
282443
+ INFO: 40,
282444
+ SUCCESS: 45,
282445
+ DEBUG: 60,
282446
+ TRACE: 70,
282447
+ ALL: 100
282448
+ };
282449
+ var LogLevelLabel = {
282450
+ SILENT: "silent",
282451
+ FATAL: "fatal",
282452
+ ERROR: "error",
282453
+ WARN: "warn",
282454
+ INFO: "info",
282455
+ DEBUG: "debug",
282456
+ TRACE: "trace",
282457
+ ALL: "all"
282458
+ };
282459
+
282460
+ // packages/config-tools/src/utilities/get-log-level.ts
282461
+ var getLogLevel = (label) => {
282462
+ switch (label) {
282463
+ case "all":
282464
+ return LogLevel.ALL;
282465
+ case "trace":
282466
+ return LogLevel.TRACE;
282467
+ case "debug":
282468
+ return LogLevel.DEBUG;
282469
+ case "info":
282470
+ return LogLevel.INFO;
282471
+ case "warn":
282472
+ return LogLevel.WARN;
282473
+ case "error":
282474
+ return LogLevel.ERROR;
282475
+ case "fatal":
282476
+ return LogLevel.FATAL;
282477
+ case "silent":
282478
+ return LogLevel.SILENT;
282479
+ default:
282480
+ return LogLevel.INFO;
282481
+ }
282482
+ };
282483
+ var getLogLevelLabel = (logLevel) => {
282484
+ if (logLevel >= LogLevel.ALL) {
282485
+ return LogLevelLabel.ALL;
282486
+ }
282487
+ if (logLevel >= LogLevel.TRACE) {
282488
+ return LogLevelLabel.TRACE;
282489
+ }
282490
+ if (logLevel >= LogLevel.DEBUG) {
282491
+ return LogLevelLabel.DEBUG;
282492
+ }
282493
+ if (logLevel >= LogLevel.INFO) {
282494
+ return LogLevelLabel.INFO;
282495
+ }
282496
+ if (logLevel >= LogLevel.WARN) {
282497
+ return LogLevelLabel.WARN;
282498
+ }
282499
+ if (logLevel >= LogLevel.ERROR) {
282500
+ return LogLevelLabel.ERROR;
282501
+ }
282502
+ if (logLevel >= LogLevel.FATAL) {
282503
+ return LogLevelLabel.FATAL;
282504
+ }
282505
+ if (logLevel <= LogLevel.SILENT) {
282506
+ return LogLevelLabel.SILENT;
282507
+ }
282508
+ return LogLevelLabel.INFO;
282509
+ };
282510
+
282511
+ // packages/config-tools/src/utilities/logger.ts
282512
+ var chalk = __toESM(require_source(), 1);
282513
+ var getLogFn = (config3 = {}, logLevel = LogLevel.INFO) => {
282514
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(config3.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config3.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
282515
+ return (_) => {
282516
+ };
282517
+ }
282518
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
282519
+ return (message) => {
282520
+ console.error(
282521
+ `
282522
+ ${chalk.bold.hex(config3?.colors?.fatal ? config3.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config3?.colors?.fatal ? config3.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
282523
+ config3?.colors?.fatal ? config3.colors.fatal : "#1fb2a6"
282524
+ )(message)}
282525
+
282526
+ `
282527
+ );
282528
+ };
282529
+ }
282530
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
282531
+ return (message) => {
282532
+ console.error(
282533
+ `
282534
+ ${chalk.bold.hex(config3?.colors?.error ? config3.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config3?.colors?.error ? config3.colors.error : "#7d1a1a").white(" \u2718 Error ")} ${chalk.hex(
282535
+ config3?.colors?.error ? config3.colors.error : "#7d1a1a"
282536
+ )(message)}
282537
+ `
282538
+ );
282539
+ };
282540
+ }
282541
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
282542
+ return (message) => {
282543
+ console.warn(
282544
+ `
282545
+ ${chalk.bold.hex(config3?.colors?.warning ? config3.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config3?.colors?.warning ? config3.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
282546
+ config3?.colors?.warning ? config3.colors.warning : "#fcc419"
282547
+ )(message)}
282548
+ `
282549
+ );
282550
+ };
282551
+ }
282552
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
282553
+ return (message) => {
282554
+ console.info(
282555
+ `
282556
+ ${chalk.bold.hex(config3?.colors?.info ? config3.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config3?.colors?.info ? config3.colors.info : "#0ea5e9").white(" \u2139 Info ")} ${chalk.hex(config3?.colors?.info ? config3.colors.info : "#0ea5e9")(
282557
+ message
282558
+ )}
282559
+ `
282560
+ );
282561
+ };
282562
+ }
282563
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
282564
+ return (message) => {
282565
+ console.info(
282566
+ `
282567
+ ${chalk.bold.hex(config3?.colors?.success ? config3.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config3?.colors?.success ? config3.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
282568
+ config3?.colors?.success ? config3.colors.success : "#087f5b"
282569
+ )(message)}
282570
+ `
282571
+ );
282572
+ };
282573
+ }
282574
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
282575
+ return (message) => {
282576
+ console.debug(
282577
+ `
282578
+ ${chalk.bold.hex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
282579
+ config3?.colors?.primary ? config3.colors.primary : "#1fb2a6"
282580
+ )(message)}
282581
+ `
282582
+ );
282583
+ };
282584
+ }
282585
+ return (message) => {
282586
+ console.log(
282587
+ `
282588
+ ${chalk.bold.hex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config3?.colors?.primary ? config3.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
282589
+ config3?.colors?.primary ? config3.colors.primary : "#1fb2a6"
282590
+ )(message)}
282591
+ `
282592
+ );
282593
+ };
282594
+ };
282595
+ var writeFatal = (config3, message) => getLogFn(config3, LogLevel.FATAL)(message);
282596
+ var writeError = (config3, message) => getLogFn(config3, LogLevel.ERROR)(message);
282597
+ var writeWarning = (config3, message) => getLogFn(config3, LogLevel.WARN)(message);
282598
+ var writeInfo = (config3, message) => getLogFn(config3, LogLevel.INFO)(message);
282599
+ var writeSuccess = (config3, message) => getLogFn(config3, LogLevel.SUCCESS)(message);
282600
+ var writeDebug = (config3, message) => getLogFn(config3, LogLevel.DEBUG)(message);
282601
+ var writeTrace = (config3, message) => getLogFn(config3, LogLevel.TRACE)(message);
282602
+
282617
282603
  // packages/config-tools/src/utilities/process-handler.ts
282618
282604
  var exitWithError = (config3) => {
282619
282605
  writeFatal(config3, "Exiting script with an error status...");
@@ -284418,10 +284404,17 @@ var loadStormConfig = async (workspaceRoot) => {
284418
284404
  if (!_workspaceRoot) {
284419
284405
  _workspaceRoot = findWorkspaceRoot();
284420
284406
  }
284407
+ const configFile = await getConfigFile(_workspaceRoot);
284408
+ if (!configFile) {
284409
+ writeWarning(
284410
+ { logLevel: "all" },
284411
+ "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not.\n"
284412
+ );
284413
+ }
284421
284414
  config3 = StormConfigSchema.parse(
284422
284415
  await getDefaultConfig(
284423
284416
  {
284424
- ...await getConfigFile(_workspaceRoot),
284417
+ ...configFile,
284425
284418
  ...getConfigEnv()
284426
284419
  },
284427
284420
  _workspaceRoot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/linting-tools",
3
- "version": "1.28.1",
3
+ "version": "1.29.0",
4
4
  "private": false,
5
5
  "description": "⚡ A package containing various linting tools used to validate syntax, enforce design standards, and format code in a Storm workspace.",
6
6
  "keywords": [
package/src/cli/index.js CHANGED
@@ -278627,136 +278627,6 @@ var init_lib2 = __esm({
278627
278627
  // packages/config-tools/src/config-file/get-config-file.ts
278628
278628
  var import_cosmiconfig = __toESM(require_dist(), 1);
278629
278629
 
278630
- // packages/config-tools/src/utilities/logger.ts
278631
- var chalk = __toESM(require_source(), 1);
278632
-
278633
- // packages/config-tools/src/types.ts
278634
- var LogLevel = {
278635
- SILENT: 0,
278636
- FATAL: 10,
278637
- ERROR: 20,
278638
- WARN: 30,
278639
- INFO: 40,
278640
- SUCCESS: 45,
278641
- DEBUG: 60,
278642
- TRACE: 70,
278643
- ALL: 100
278644
- };
278645
-
278646
- // packages/config-tools/src/utilities/get-log-level.ts
278647
- var getLogLevel = (label) => {
278648
- switch (label) {
278649
- case "all":
278650
- return LogLevel.ALL;
278651
- case "trace":
278652
- return LogLevel.TRACE;
278653
- case "debug":
278654
- return LogLevel.DEBUG;
278655
- case "info":
278656
- return LogLevel.INFO;
278657
- case "warn":
278658
- return LogLevel.WARN;
278659
- case "error":
278660
- return LogLevel.ERROR;
278661
- case "fatal":
278662
- return LogLevel.FATAL;
278663
- case "silent":
278664
- return LogLevel.SILENT;
278665
- default:
278666
- return LogLevel.INFO;
278667
- }
278668
- };
278669
-
278670
- // packages/config-tools/src/utilities/logger.ts
278671
- var getLogFn = (config2 = {}, logLevel = LogLevel.INFO) => {
278672
- if (typeof logLevel === "number" && (logLevel >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
278673
- return (_) => {
278674
- };
278675
- }
278676
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
278677
- return (message) => {
278678
- console.error(
278679
- `
278680
- ${chalk.bold.hex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
278681
- config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6"
278682
- )(message)}
278683
-
278684
- `
278685
- );
278686
- };
278687
- }
278688
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
278689
- return (message) => {
278690
- console.error(
278691
- `
278692
- ${chalk.bold.hex(config2?.colors?.error ? config2.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config2?.colors?.error ? config2.colors.error : "#7d1a1a").white(" \u2718 Error ")} ${chalk.hex(
278693
- config2?.colors?.error ? config2.colors.error : "#7d1a1a"
278694
- )(message)}
278695
- `
278696
- );
278697
- };
278698
- }
278699
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
278700
- return (message) => {
278701
- console.warn(
278702
- `
278703
- ${chalk.bold.hex(config2?.colors?.warning ? config2.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config2?.colors?.warning ? config2.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
278704
- config2?.colors?.warning ? config2.colors.warning : "#fcc419"
278705
- )(message)}
278706
- `
278707
- );
278708
- };
278709
- }
278710
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
278711
- return (message) => {
278712
- console.info(
278713
- `
278714
- ${chalk.bold.hex(config2?.colors?.info ? config2.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config2?.colors?.info ? config2.colors.info : "#0ea5e9").white(" \u2139 Info ")} ${chalk.hex(config2?.colors?.info ? config2.colors.info : "#0ea5e9")(
278715
- message
278716
- )}
278717
- `
278718
- );
278719
- };
278720
- }
278721
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
278722
- return (message) => {
278723
- console.info(
278724
- `
278725
- ${chalk.bold.hex(config2?.colors?.success ? config2.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config2?.colors?.success ? config2.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
278726
- config2?.colors?.success ? config2.colors.success : "#087f5b"
278727
- )(message)}
278728
- `
278729
- );
278730
- };
278731
- }
278732
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
278733
- return (message) => {
278734
- console.debug(
278735
- `
278736
- ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
278737
- config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
278738
- )(message)}
278739
- `
278740
- );
278741
- };
278742
- }
278743
- return (message) => {
278744
- console.log(
278745
- `
278746
- ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
278747
- config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
278748
- )(message)}
278749
- `
278750
- );
278751
- };
278752
- };
278753
- var writeFatal = (config2, message) => getLogFn(config2, LogLevel.FATAL)(message);
278754
- var writeError = (config2, message) => getLogFn(config2, LogLevel.ERROR)(message);
278755
- var writeInfo = (config2, message) => getLogFn(config2, LogLevel.INFO)(message);
278756
- var writeSuccess = (config2, message) => getLogFn(config2, LogLevel.SUCCESS)(message);
278757
- var writeDebug = (config2, message) => getLogFn(config2, LogLevel.DEBUG)(message);
278758
- var writeTrace = (config2, message) => getLogFn(config2, LogLevel.TRACE)(message);
278759
-
278760
278630
  // packages/config-tools/src/utilities/find-up.ts
278761
278631
  import { existsSync } from "node:fs";
278762
278632
  import { join } from "node:path";
@@ -282474,6 +282344,134 @@ var DEFAULT_STORM_CONFIG = {
282474
282344
  extensions: {}
282475
282345
  };
282476
282346
 
282347
+ // packages/config-tools/src/types.ts
282348
+ var LogLevel = {
282349
+ SILENT: 0,
282350
+ FATAL: 10,
282351
+ ERROR: 20,
282352
+ WARN: 30,
282353
+ INFO: 40,
282354
+ SUCCESS: 45,
282355
+ DEBUG: 60,
282356
+ TRACE: 70,
282357
+ ALL: 100
282358
+ };
282359
+
282360
+ // packages/config-tools/src/utilities/get-log-level.ts
282361
+ var getLogLevel = (label) => {
282362
+ switch (label) {
282363
+ case "all":
282364
+ return LogLevel.ALL;
282365
+ case "trace":
282366
+ return LogLevel.TRACE;
282367
+ case "debug":
282368
+ return LogLevel.DEBUG;
282369
+ case "info":
282370
+ return LogLevel.INFO;
282371
+ case "warn":
282372
+ return LogLevel.WARN;
282373
+ case "error":
282374
+ return LogLevel.ERROR;
282375
+ case "fatal":
282376
+ return LogLevel.FATAL;
282377
+ case "silent":
282378
+ return LogLevel.SILENT;
282379
+ default:
282380
+ return LogLevel.INFO;
282381
+ }
282382
+ };
282383
+
282384
+ // packages/config-tools/src/utilities/logger.ts
282385
+ var chalk = __toESM(require_source(), 1);
282386
+ var getLogFn = (config2 = {}, logLevel = LogLevel.INFO) => {
282387
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
282388
+ return (_) => {
282389
+ };
282390
+ }
282391
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
282392
+ return (message) => {
282393
+ console.error(
282394
+ `
282395
+ ${chalk.bold.hex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
282396
+ config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6"
282397
+ )(message)}
282398
+
282399
+ `
282400
+ );
282401
+ };
282402
+ }
282403
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
282404
+ return (message) => {
282405
+ console.error(
282406
+ `
282407
+ ${chalk.bold.hex(config2?.colors?.error ? config2.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config2?.colors?.error ? config2.colors.error : "#7d1a1a").white(" \u2718 Error ")} ${chalk.hex(
282408
+ config2?.colors?.error ? config2.colors.error : "#7d1a1a"
282409
+ )(message)}
282410
+ `
282411
+ );
282412
+ };
282413
+ }
282414
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
282415
+ return (message) => {
282416
+ console.warn(
282417
+ `
282418
+ ${chalk.bold.hex(config2?.colors?.warning ? config2.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config2?.colors?.warning ? config2.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
282419
+ config2?.colors?.warning ? config2.colors.warning : "#fcc419"
282420
+ )(message)}
282421
+ `
282422
+ );
282423
+ };
282424
+ }
282425
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
282426
+ return (message) => {
282427
+ console.info(
282428
+ `
282429
+ ${chalk.bold.hex(config2?.colors?.info ? config2.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config2?.colors?.info ? config2.colors.info : "#0ea5e9").white(" \u2139 Info ")} ${chalk.hex(config2?.colors?.info ? config2.colors.info : "#0ea5e9")(
282430
+ message
282431
+ )}
282432
+ `
282433
+ );
282434
+ };
282435
+ }
282436
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
282437
+ return (message) => {
282438
+ console.info(
282439
+ `
282440
+ ${chalk.bold.hex(config2?.colors?.success ? config2.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config2?.colors?.success ? config2.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
282441
+ config2?.colors?.success ? config2.colors.success : "#087f5b"
282442
+ )(message)}
282443
+ `
282444
+ );
282445
+ };
282446
+ }
282447
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
282448
+ return (message) => {
282449
+ console.debug(
282450
+ `
282451
+ ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
282452
+ config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
282453
+ )(message)}
282454
+ `
282455
+ );
282456
+ };
282457
+ }
282458
+ return (message) => {
282459
+ console.log(
282460
+ `
282461
+ ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
282462
+ config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
282463
+ )(message)}
282464
+ `
282465
+ );
282466
+ };
282467
+ };
282468
+ var writeFatal = (config2, message) => getLogFn(config2, LogLevel.FATAL)(message);
282469
+ var writeError = (config2, message) => getLogFn(config2, LogLevel.ERROR)(message);
282470
+ var writeInfo = (config2, message) => getLogFn(config2, LogLevel.INFO)(message);
282471
+ var writeSuccess = (config2, message) => getLogFn(config2, LogLevel.SUCCESS)(message);
282472
+ var writeDebug = (config2, message) => getLogFn(config2, LogLevel.DEBUG)(message);
282473
+ var writeTrace = (config2, message) => getLogFn(config2, LogLevel.TRACE)(message);
282474
+
282477
282475
  // node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
282478
282476
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
282479
282477
  import { Buffer as Buffer3 } from "node:buffer";