@storm-software/workspace-tools 1.46.1 → 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.
@@ -103948,216 +103948,23 @@ var import_tsc = __toESM(require_tsc_impl());
103948
103948
 
103949
103949
  // packages/config-tools/src/config-file/get-config-file.ts
103950
103950
  var import_cosmiconfig = __toESM(require_dist(), 1);
103951
-
103952
- // packages/config-tools/src/utilities/logger.ts
103953
- var chalk = __toESM(require_source(), 1);
103954
-
103955
- // packages/config-tools/src/types.ts
103956
- var LogLevel = {
103957
- SILENT: 0,
103958
- FATAL: 10,
103959
- ERROR: 20,
103960
- WARN: 30,
103961
- INFO: 40,
103962
- SUCCESS: 45,
103963
- DEBUG: 60,
103964
- TRACE: 70,
103965
- ALL: 100
103966
- };
103967
- var LogLevelLabel = {
103968
- SILENT: "silent",
103969
- FATAL: "fatal",
103970
- ERROR: "error",
103971
- WARN: "warn",
103972
- INFO: "info",
103973
- DEBUG: "debug",
103974
- TRACE: "trace",
103975
- ALL: "all"
103976
- };
103977
-
103978
- // packages/config-tools/src/utilities/get-log-level.ts
103979
- var getLogLevel = (label) => {
103980
- switch (label) {
103981
- case "all":
103982
- return LogLevel.ALL;
103983
- case "trace":
103984
- return LogLevel.TRACE;
103985
- case "debug":
103986
- return LogLevel.DEBUG;
103987
- case "info":
103988
- return LogLevel.INFO;
103989
- case "warn":
103990
- return LogLevel.WARN;
103991
- case "error":
103992
- return LogLevel.ERROR;
103993
- case "fatal":
103994
- return LogLevel.FATAL;
103995
- case "silent":
103996
- return LogLevel.SILENT;
103997
- default:
103998
- return LogLevel.INFO;
103999
- }
104000
- };
104001
- var getLogLevelLabel = (logLevel) => {
104002
- if (logLevel >= LogLevel.ALL) {
104003
- return LogLevelLabel.ALL;
104004
- }
104005
- if (logLevel >= LogLevel.TRACE) {
104006
- return LogLevelLabel.TRACE;
104007
- }
104008
- if (logLevel >= LogLevel.DEBUG) {
104009
- return LogLevelLabel.DEBUG;
104010
- }
104011
- if (logLevel >= LogLevel.INFO) {
104012
- return LogLevelLabel.INFO;
104013
- }
104014
- if (logLevel >= LogLevel.WARN) {
104015
- return LogLevelLabel.WARN;
104016
- }
104017
- if (logLevel >= LogLevel.ERROR) {
104018
- return LogLevelLabel.ERROR;
104019
- }
104020
- if (logLevel >= LogLevel.FATAL) {
104021
- return LogLevelLabel.FATAL;
104022
- }
104023
- if (logLevel <= LogLevel.SILENT) {
104024
- return LogLevelLabel.SILENT;
104025
- }
104026
- return LogLevelLabel.INFO;
104027
- };
104028
-
104029
- // packages/config-tools/src/utilities/logger.ts
104030
- var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
104031
- 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)) {
104032
- return (_) => {
104033
- };
104034
- }
104035
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
104036
- return (message) => {
104037
- console.error(
104038
- `
104039
- ${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(
104040
- config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
104041
- )(message)}
104042
-
104043
- `
104044
- );
104045
- };
104046
- }
104047
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
104048
- return (message) => {
104049
- console.error(
104050
- `
104051
- ${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(
104052
- config?.colors?.error ? config.colors.error : "#7d1a1a"
104053
- )(message)}
104054
- `
104055
- );
104056
- };
104057
- }
104058
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
104059
- return (message) => {
104060
- console.warn(
104061
- `
104062
- ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
104063
- config?.colors?.warning ? config.colors.warning : "#fcc419"
104064
- )(message)}
104065
- `
104066
- );
104067
- };
104068
- }
104069
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
104070
- return (message) => {
104071
- console.info(
104072
- `
104073
- ${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")(
104074
- message
104075
- )}
104076
- `
104077
- );
104078
- };
104079
- }
104080
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
104081
- return (message) => {
104082
- console.info(
104083
- `
104084
- ${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(
104085
- config?.colors?.success ? config.colors.success : "#087f5b"
104086
- )(message)}
104087
- `
104088
- );
104089
- };
104090
- }
104091
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
104092
- return (message) => {
104093
- console.debug(
104094
- `
104095
- ${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(
104096
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
104097
- )(message)}
104098
- `
104099
- );
104100
- };
104101
- }
104102
- return (message) => {
104103
- console.log(
104104
- `
104105
- ${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(
104106
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
104107
- )(message)}
104108
- `
104109
- );
104110
- };
104111
- };
104112
- var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
104113
- var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
104114
- var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
104115
- var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
104116
- var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
104117
- var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
104118
- var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
104119
- var getStopwatch = (name) => {
104120
- const start = process.hrtime();
104121
- return () => {
104122
- const end = process.hrtime(start);
104123
- console.info(
104124
- chalk.dim(
104125
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
104126
- end[0] * 1e3 + end[1] / 1e6
104127
- )}ms to complete`
104128
- )
104129
- );
104130
- };
104131
- };
104132
-
104133
- // packages/config-tools/src/config-file/get-config-file.ts
104134
103951
  var _static_cache = void 0;
104135
- var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
103952
+ var getConfigFileByName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
104136
103953
  var getConfigFile = async (filePath) => {
104137
103954
  if (_static_cache) {
104138
103955
  return _static_cache;
104139
103956
  }
104140
- let cosmiconfigResult = await getConfigFileName("storm", filePath);
103957
+ let cosmiconfigResult = await getConfigFileByName("storm", filePath);
104141
103958
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
104142
- cosmiconfigResult = await getConfigFileName("storm-software", filePath);
103959
+ cosmiconfigResult = await getConfigFileByName("storm-software", filePath);
104143
103960
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
104144
- cosmiconfigResult = await getConfigFileName("storm-stack", filePath);
103961
+ cosmiconfigResult = await getConfigFileByName("storm-stack", filePath);
104145
103962
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
104146
- cosmiconfigResult = await getConfigFileName("storm-cloud", filePath);
104147
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
104148
- cosmiconfigResult = await getConfigFileName("acidic", filePath);
104149
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
104150
- cosmiconfigResult = await getConfigFileName("acid", filePath);
104151
- }
104152
- }
103963
+ cosmiconfigResult = await getConfigFileByName("storm-cloud", filePath);
104153
103964
  }
104154
103965
  }
104155
103966
  }
104156
103967
  if (!cosmiconfigResult || Object.keys(cosmiconfigResult).length === 0 || cosmiconfigResult.isEmpty || !cosmiconfigResult.filepath) {
104157
- writeWarning(
104158
- { logLevel: "all" },
104159
- "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"
104160
- );
104161
103968
  return void 0;
104162
103969
  }
104163
103970
  const config = cosmiconfigResult.config ?? {};
@@ -107948,6 +107755,185 @@ var getDefaultConfig = (config = {}, root) => {
107948
107755
  });
107949
107756
  };
107950
107757
 
107758
+ // packages/config-tools/src/types.ts
107759
+ var LogLevel = {
107760
+ SILENT: 0,
107761
+ FATAL: 10,
107762
+ ERROR: 20,
107763
+ WARN: 30,
107764
+ INFO: 40,
107765
+ SUCCESS: 45,
107766
+ DEBUG: 60,
107767
+ TRACE: 70,
107768
+ ALL: 100
107769
+ };
107770
+ var LogLevelLabel = {
107771
+ SILENT: "silent",
107772
+ FATAL: "fatal",
107773
+ ERROR: "error",
107774
+ WARN: "warn",
107775
+ INFO: "info",
107776
+ DEBUG: "debug",
107777
+ TRACE: "trace",
107778
+ ALL: "all"
107779
+ };
107780
+
107781
+ // packages/config-tools/src/utilities/get-log-level.ts
107782
+ var getLogLevel = (label) => {
107783
+ switch (label) {
107784
+ case "all":
107785
+ return LogLevel.ALL;
107786
+ case "trace":
107787
+ return LogLevel.TRACE;
107788
+ case "debug":
107789
+ return LogLevel.DEBUG;
107790
+ case "info":
107791
+ return LogLevel.INFO;
107792
+ case "warn":
107793
+ return LogLevel.WARN;
107794
+ case "error":
107795
+ return LogLevel.ERROR;
107796
+ case "fatal":
107797
+ return LogLevel.FATAL;
107798
+ case "silent":
107799
+ return LogLevel.SILENT;
107800
+ default:
107801
+ return LogLevel.INFO;
107802
+ }
107803
+ };
107804
+ var getLogLevelLabel = (logLevel) => {
107805
+ if (logLevel >= LogLevel.ALL) {
107806
+ return LogLevelLabel.ALL;
107807
+ }
107808
+ if (logLevel >= LogLevel.TRACE) {
107809
+ return LogLevelLabel.TRACE;
107810
+ }
107811
+ if (logLevel >= LogLevel.DEBUG) {
107812
+ return LogLevelLabel.DEBUG;
107813
+ }
107814
+ if (logLevel >= LogLevel.INFO) {
107815
+ return LogLevelLabel.INFO;
107816
+ }
107817
+ if (logLevel >= LogLevel.WARN) {
107818
+ return LogLevelLabel.WARN;
107819
+ }
107820
+ if (logLevel >= LogLevel.ERROR) {
107821
+ return LogLevelLabel.ERROR;
107822
+ }
107823
+ if (logLevel >= LogLevel.FATAL) {
107824
+ return LogLevelLabel.FATAL;
107825
+ }
107826
+ if (logLevel <= LogLevel.SILENT) {
107827
+ return LogLevelLabel.SILENT;
107828
+ }
107829
+ return LogLevelLabel.INFO;
107830
+ };
107831
+
107832
+ // packages/config-tools/src/utilities/logger.ts
107833
+ var chalk = __toESM(require_source(), 1);
107834
+ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
107835
+ 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)) {
107836
+ return (_) => {
107837
+ };
107838
+ }
107839
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
107840
+ return (message) => {
107841
+ console.error(
107842
+ `
107843
+ ${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(
107844
+ config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
107845
+ )(message)}
107846
+
107847
+ `
107848
+ );
107849
+ };
107850
+ }
107851
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
107852
+ return (message) => {
107853
+ console.error(
107854
+ `
107855
+ ${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(
107856
+ config?.colors?.error ? config.colors.error : "#7d1a1a"
107857
+ )(message)}
107858
+ `
107859
+ );
107860
+ };
107861
+ }
107862
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
107863
+ return (message) => {
107864
+ console.warn(
107865
+ `
107866
+ ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
107867
+ config?.colors?.warning ? config.colors.warning : "#fcc419"
107868
+ )(message)}
107869
+ `
107870
+ );
107871
+ };
107872
+ }
107873
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
107874
+ return (message) => {
107875
+ console.info(
107876
+ `
107877
+ ${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")(
107878
+ message
107879
+ )}
107880
+ `
107881
+ );
107882
+ };
107883
+ }
107884
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
107885
+ return (message) => {
107886
+ console.info(
107887
+ `
107888
+ ${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(
107889
+ config?.colors?.success ? config.colors.success : "#087f5b"
107890
+ )(message)}
107891
+ `
107892
+ );
107893
+ };
107894
+ }
107895
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
107896
+ return (message) => {
107897
+ console.debug(
107898
+ `
107899
+ ${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(
107900
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
107901
+ )(message)}
107902
+ `
107903
+ );
107904
+ };
107905
+ }
107906
+ return (message) => {
107907
+ console.log(
107908
+ `
107909
+ ${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(
107910
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
107911
+ )(message)}
107912
+ `
107913
+ );
107914
+ };
107915
+ };
107916
+ var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
107917
+ var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
107918
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
107919
+ var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
107920
+ var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
107921
+ var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
107922
+ var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
107923
+ var getStopwatch = (name) => {
107924
+ const start = process.hrtime();
107925
+ return () => {
107926
+ const end = process.hrtime(start);
107927
+ console.info(
107928
+ chalk.dim(
107929
+ `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
107930
+ end[0] * 1e3 + end[1] / 1e6
107931
+ )}ms to complete`
107932
+ )
107933
+ );
107934
+ };
107935
+ };
107936
+
107951
107937
  // node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
107952
107938
  var import_node_buffer2 = require("node:buffer");
107953
107939
  var import_node_path4 = __toESM(require("node:path"), 1);
@@ -109716,10 +109702,17 @@ var loadStormConfig = async (workspaceRoot) => {
109716
109702
  if (!_workspaceRoot) {
109717
109703
  _workspaceRoot = findWorkspaceRoot();
109718
109704
  }
109705
+ const configFile = await getConfigFile(_workspaceRoot);
109706
+ if (!configFile) {
109707
+ writeWarning(
109708
+ { logLevel: "all" },
109709
+ "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"
109710
+ );
109711
+ }
109719
109712
  config = StormConfigSchema.parse(
109720
109713
  await getDefaultConfig(
109721
109714
  {
109722
- ...await getConfigFile(_workspaceRoot),
109715
+ ...configFile,
109723
109716
  ...getConfigEnv()
109724
109717
  },
109725
109718
  _workspaceRoot