@storm-software/workspace-tools 1.46.0 → 1.47.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.
@@ -61937,216 +61937,23 @@ var createTailwindConfig = ({ inputPath }) => {
61937
61937
 
61938
61938
  // packages/config-tools/src/config-file/get-config-file.ts
61939
61939
  var import_cosmiconfig = __toESM(require_dist17(), 1);
61940
-
61941
- // packages/config-tools/src/utilities/logger.ts
61942
- var chalk = __toESM(require_source(), 1);
61943
-
61944
- // packages/config-tools/src/types.ts
61945
- var LogLevel = {
61946
- SILENT: 0,
61947
- FATAL: 10,
61948
- ERROR: 20,
61949
- WARN: 30,
61950
- INFO: 40,
61951
- SUCCESS: 45,
61952
- DEBUG: 60,
61953
- TRACE: 70,
61954
- ALL: 100
61955
- };
61956
- var LogLevelLabel = {
61957
- SILENT: "silent",
61958
- FATAL: "fatal",
61959
- ERROR: "error",
61960
- WARN: "warn",
61961
- INFO: "info",
61962
- DEBUG: "debug",
61963
- TRACE: "trace",
61964
- ALL: "all"
61965
- };
61966
-
61967
- // packages/config-tools/src/utilities/get-log-level.ts
61968
- var getLogLevel = (label) => {
61969
- switch (label) {
61970
- case "all":
61971
- return LogLevel.ALL;
61972
- case "trace":
61973
- return LogLevel.TRACE;
61974
- case "debug":
61975
- return LogLevel.DEBUG;
61976
- case "info":
61977
- return LogLevel.INFO;
61978
- case "warn":
61979
- return LogLevel.WARN;
61980
- case "error":
61981
- return LogLevel.ERROR;
61982
- case "fatal":
61983
- return LogLevel.FATAL;
61984
- case "silent":
61985
- return LogLevel.SILENT;
61986
- default:
61987
- return LogLevel.INFO;
61988
- }
61989
- };
61990
- var getLogLevelLabel = (logLevel) => {
61991
- if (logLevel >= LogLevel.ALL) {
61992
- return LogLevelLabel.ALL;
61993
- }
61994
- if (logLevel >= LogLevel.TRACE) {
61995
- return LogLevelLabel.TRACE;
61996
- }
61997
- if (logLevel >= LogLevel.DEBUG) {
61998
- return LogLevelLabel.DEBUG;
61999
- }
62000
- if (logLevel >= LogLevel.INFO) {
62001
- return LogLevelLabel.INFO;
62002
- }
62003
- if (logLevel >= LogLevel.WARN) {
62004
- return LogLevelLabel.WARN;
62005
- }
62006
- if (logLevel >= LogLevel.ERROR) {
62007
- return LogLevelLabel.ERROR;
62008
- }
62009
- if (logLevel >= LogLevel.FATAL) {
62010
- return LogLevelLabel.FATAL;
62011
- }
62012
- if (logLevel <= LogLevel.SILENT) {
62013
- return LogLevelLabel.SILENT;
62014
- }
62015
- return LogLevelLabel.INFO;
62016
- };
62017
-
62018
- // packages/config-tools/src/utilities/logger.ts
62019
- var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
62020
- if (typeof logLevel === "number" && (logLevel >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
62021
- return (_) => {
62022
- };
62023
- }
62024
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
62025
- return (message) => {
62026
- console.error(
62027
- `
62028
- ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
62029
- config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
62030
- )(message)}
62031
-
62032
- `
62033
- );
62034
- };
62035
- }
62036
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
62037
- return (message) => {
62038
- console.error(
62039
- `
62040
- ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u2718 Error ")} ${chalk.hex(
62041
- config?.colors?.error ? config.colors.error : "#7d1a1a"
62042
- )(message)}
62043
- `
62044
- );
62045
- };
62046
- }
62047
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
62048
- return (message) => {
62049
- console.warn(
62050
- `
62051
- ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
62052
- config?.colors?.warning ? config.colors.warning : "#fcc419"
62053
- )(message)}
62054
- `
62055
- );
62056
- };
62057
- }
62058
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
62059
- return (message) => {
62060
- console.info(
62061
- `
62062
- ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u2139 Info ")} ${chalk.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
62063
- message
62064
- )}
62065
- `
62066
- );
62067
- };
62068
- }
62069
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
62070
- return (message) => {
62071
- console.info(
62072
- `
62073
- ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
62074
- config?.colors?.success ? config.colors.success : "#087f5b"
62075
- )(message)}
62076
- `
62077
- );
62078
- };
62079
- }
62080
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
62081
- return (message) => {
62082
- console.debug(
62083
- `
62084
- ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
62085
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
62086
- )(message)}
62087
- `
62088
- );
62089
- };
62090
- }
62091
- return (message) => {
62092
- console.log(
62093
- `
62094
- ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
62095
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
62096
- )(message)}
62097
- `
62098
- );
62099
- };
62100
- };
62101
- var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
62102
- var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
62103
- var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
62104
- var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
62105
- var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
62106
- var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
62107
- var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
62108
- var getStopwatch = (name) => {
62109
- const start = process.hrtime();
62110
- return () => {
62111
- const end = process.hrtime(start);
62112
- console.info(
62113
- chalk.dim(
62114
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
62115
- end[0] * 1e3 + end[1] / 1e6
62116
- )}ms to complete`
62117
- )
62118
- );
62119
- };
62120
- };
62121
-
62122
- // packages/config-tools/src/config-file/get-config-file.ts
62123
61940
  var _static_cache = void 0;
62124
- var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
61941
+ var getConfigFileByName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
62125
61942
  var getConfigFile = async (filePath) => {
62126
61943
  if (_static_cache) {
62127
61944
  return _static_cache;
62128
61945
  }
62129
- let cosmiconfigResult = await getConfigFileName("storm", filePath);
61946
+ let cosmiconfigResult = await getConfigFileByName("storm", filePath);
62130
61947
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
62131
- cosmiconfigResult = await getConfigFileName("storm-software", filePath);
61948
+ cosmiconfigResult = await getConfigFileByName("storm-software", filePath);
62132
61949
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
62133
- cosmiconfigResult = await getConfigFileName("storm-stack", filePath);
61950
+ cosmiconfigResult = await getConfigFileByName("storm-stack", filePath);
62134
61951
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
62135
- cosmiconfigResult = await getConfigFileName("storm-cloud", filePath);
62136
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
62137
- cosmiconfigResult = await getConfigFileName("acidic", filePath);
62138
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
62139
- cosmiconfigResult = await getConfigFileName("acid", filePath);
62140
- }
62141
- }
61952
+ cosmiconfigResult = await getConfigFileByName("storm-cloud", filePath);
62142
61953
  }
62143
61954
  }
62144
61955
  }
62145
61956
  if (!cosmiconfigResult || Object.keys(cosmiconfigResult).length === 0 || cosmiconfigResult.isEmpty || !cosmiconfigResult.filepath) {
62146
- writeWarning(
62147
- { logLevel: "all" },
62148
- "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"
62149
- );
62150
61957
  return void 0;
62151
61958
  }
62152
61959
  const config = cosmiconfigResult.config ?? {};
@@ -65937,6 +65744,185 @@ var getDefaultConfig = (config = {}, root) => {
65937
65744
  });
65938
65745
  };
65939
65746
 
65747
+ // packages/config-tools/src/types.ts
65748
+ var LogLevel = {
65749
+ SILENT: 0,
65750
+ FATAL: 10,
65751
+ ERROR: 20,
65752
+ WARN: 30,
65753
+ INFO: 40,
65754
+ SUCCESS: 45,
65755
+ DEBUG: 60,
65756
+ TRACE: 70,
65757
+ ALL: 100
65758
+ };
65759
+ var LogLevelLabel = {
65760
+ SILENT: "silent",
65761
+ FATAL: "fatal",
65762
+ ERROR: "error",
65763
+ WARN: "warn",
65764
+ INFO: "info",
65765
+ DEBUG: "debug",
65766
+ TRACE: "trace",
65767
+ ALL: "all"
65768
+ };
65769
+
65770
+ // packages/config-tools/src/utilities/get-log-level.ts
65771
+ var getLogLevel = (label) => {
65772
+ switch (label) {
65773
+ case "all":
65774
+ return LogLevel.ALL;
65775
+ case "trace":
65776
+ return LogLevel.TRACE;
65777
+ case "debug":
65778
+ return LogLevel.DEBUG;
65779
+ case "info":
65780
+ return LogLevel.INFO;
65781
+ case "warn":
65782
+ return LogLevel.WARN;
65783
+ case "error":
65784
+ return LogLevel.ERROR;
65785
+ case "fatal":
65786
+ return LogLevel.FATAL;
65787
+ case "silent":
65788
+ return LogLevel.SILENT;
65789
+ default:
65790
+ return LogLevel.INFO;
65791
+ }
65792
+ };
65793
+ var getLogLevelLabel = (logLevel) => {
65794
+ if (logLevel >= LogLevel.ALL) {
65795
+ return LogLevelLabel.ALL;
65796
+ }
65797
+ if (logLevel >= LogLevel.TRACE) {
65798
+ return LogLevelLabel.TRACE;
65799
+ }
65800
+ if (logLevel >= LogLevel.DEBUG) {
65801
+ return LogLevelLabel.DEBUG;
65802
+ }
65803
+ if (logLevel >= LogLevel.INFO) {
65804
+ return LogLevelLabel.INFO;
65805
+ }
65806
+ if (logLevel >= LogLevel.WARN) {
65807
+ return LogLevelLabel.WARN;
65808
+ }
65809
+ if (logLevel >= LogLevel.ERROR) {
65810
+ return LogLevelLabel.ERROR;
65811
+ }
65812
+ if (logLevel >= LogLevel.FATAL) {
65813
+ return LogLevelLabel.FATAL;
65814
+ }
65815
+ if (logLevel <= LogLevel.SILENT) {
65816
+ return LogLevelLabel.SILENT;
65817
+ }
65818
+ return LogLevelLabel.INFO;
65819
+ };
65820
+
65821
+ // packages/config-tools/src/utilities/logger.ts
65822
+ var chalk = __toESM(require_source(), 1);
65823
+ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
65824
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
65825
+ return (_) => {
65826
+ };
65827
+ }
65828
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
65829
+ return (message) => {
65830
+ console.error(
65831
+ `
65832
+ ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
65833
+ config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
65834
+ )(message)}
65835
+
65836
+ `
65837
+ );
65838
+ };
65839
+ }
65840
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
65841
+ return (message) => {
65842
+ console.error(
65843
+ `
65844
+ ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u2718 Error ")} ${chalk.hex(
65845
+ config?.colors?.error ? config.colors.error : "#7d1a1a"
65846
+ )(message)}
65847
+ `
65848
+ );
65849
+ };
65850
+ }
65851
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
65852
+ return (message) => {
65853
+ console.warn(
65854
+ `
65855
+ ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
65856
+ config?.colors?.warning ? config.colors.warning : "#fcc419"
65857
+ )(message)}
65858
+ `
65859
+ );
65860
+ };
65861
+ }
65862
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
65863
+ return (message) => {
65864
+ console.info(
65865
+ `
65866
+ ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u2139 Info ")} ${chalk.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
65867
+ message
65868
+ )}
65869
+ `
65870
+ );
65871
+ };
65872
+ }
65873
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
65874
+ return (message) => {
65875
+ console.info(
65876
+ `
65877
+ ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u221A Success ")} ${chalk.hex(
65878
+ config?.colors?.success ? config.colors.success : "#087f5b"
65879
+ )(message)}
65880
+ `
65881
+ );
65882
+ };
65883
+ }
65884
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
65885
+ return (message) => {
65886
+ console.debug(
65887
+ `
65888
+ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
65889
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
65890
+ )(message)}
65891
+ `
65892
+ );
65893
+ };
65894
+ }
65895
+ return (message) => {
65896
+ console.log(
65897
+ `
65898
+ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
65899
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
65900
+ )(message)}
65901
+ `
65902
+ );
65903
+ };
65904
+ };
65905
+ var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
65906
+ var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
65907
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
65908
+ var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
65909
+ var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
65910
+ var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
65911
+ var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
65912
+ var getStopwatch = (name) => {
65913
+ const start = process.hrtime();
65914
+ return () => {
65915
+ const end = process.hrtime(start);
65916
+ console.info(
65917
+ chalk.dim(
65918
+ `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
65919
+ end[0] * 1e3 + end[1] / 1e6
65920
+ )}ms to complete`
65921
+ )
65922
+ );
65923
+ };
65924
+ };
65925
+
65940
65926
  // node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
65941
65927
  var import_node_buffer2 = require("node:buffer");
65942
65928
  var import_node_path4 = __toESM(require("node:path"), 1);
@@ -67705,10 +67691,17 @@ var loadStormConfig = async (workspaceRoot) => {
67705
67691
  if (!_workspaceRoot) {
67706
67692
  _workspaceRoot = findWorkspaceRoot();
67707
67693
  }
67694
+ const configFile = await getConfigFile(_workspaceRoot);
67695
+ if (!configFile) {
67696
+ writeWarning(
67697
+ { logLevel: "all" },
67698
+ "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"
67699
+ );
67700
+ }
67708
67701
  config = StormConfigSchema.parse(
67709
67702
  await getDefaultConfig(
67710
67703
  {
67711
- ...await getConfigFile(_workspaceRoot),
67704
+ ...configFile,
67712
67705
  ...getConfigEnv()
67713
67706
  },
67714
67707
  _workspaceRoot