@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.
@@ -33256,216 +33256,23 @@ module.exports = __toCommonJS(executor_exports);
33256
33256
 
33257
33257
  // packages/config-tools/src/config-file/get-config-file.ts
33258
33258
  var import_cosmiconfig = __toESM(require_dist(), 1);
33259
-
33260
- // packages/config-tools/src/utilities/logger.ts
33261
- var chalk = __toESM(require_source(), 1);
33262
-
33263
- // packages/config-tools/src/types.ts
33264
- var LogLevel = {
33265
- SILENT: 0,
33266
- FATAL: 10,
33267
- ERROR: 20,
33268
- WARN: 30,
33269
- INFO: 40,
33270
- SUCCESS: 45,
33271
- DEBUG: 60,
33272
- TRACE: 70,
33273
- ALL: 100
33274
- };
33275
- var LogLevelLabel = {
33276
- SILENT: "silent",
33277
- FATAL: "fatal",
33278
- ERROR: "error",
33279
- WARN: "warn",
33280
- INFO: "info",
33281
- DEBUG: "debug",
33282
- TRACE: "trace",
33283
- ALL: "all"
33284
- };
33285
-
33286
- // packages/config-tools/src/utilities/get-log-level.ts
33287
- var getLogLevel = (label) => {
33288
- switch (label) {
33289
- case "all":
33290
- return LogLevel.ALL;
33291
- case "trace":
33292
- return LogLevel.TRACE;
33293
- case "debug":
33294
- return LogLevel.DEBUG;
33295
- case "info":
33296
- return LogLevel.INFO;
33297
- case "warn":
33298
- return LogLevel.WARN;
33299
- case "error":
33300
- return LogLevel.ERROR;
33301
- case "fatal":
33302
- return LogLevel.FATAL;
33303
- case "silent":
33304
- return LogLevel.SILENT;
33305
- default:
33306
- return LogLevel.INFO;
33307
- }
33308
- };
33309
- var getLogLevelLabel = (logLevel) => {
33310
- if (logLevel >= LogLevel.ALL) {
33311
- return LogLevelLabel.ALL;
33312
- }
33313
- if (logLevel >= LogLevel.TRACE) {
33314
- return LogLevelLabel.TRACE;
33315
- }
33316
- if (logLevel >= LogLevel.DEBUG) {
33317
- return LogLevelLabel.DEBUG;
33318
- }
33319
- if (logLevel >= LogLevel.INFO) {
33320
- return LogLevelLabel.INFO;
33321
- }
33322
- if (logLevel >= LogLevel.WARN) {
33323
- return LogLevelLabel.WARN;
33324
- }
33325
- if (logLevel >= LogLevel.ERROR) {
33326
- return LogLevelLabel.ERROR;
33327
- }
33328
- if (logLevel >= LogLevel.FATAL) {
33329
- return LogLevelLabel.FATAL;
33330
- }
33331
- if (logLevel <= LogLevel.SILENT) {
33332
- return LogLevelLabel.SILENT;
33333
- }
33334
- return LogLevelLabel.INFO;
33335
- };
33336
-
33337
- // packages/config-tools/src/utilities/logger.ts
33338
- var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
33339
- 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)) {
33340
- return (_) => {
33341
- };
33342
- }
33343
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
33344
- return (message) => {
33345
- console.error(
33346
- `
33347
- ${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(
33348
- config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
33349
- )(message)}
33350
-
33351
- `
33352
- );
33353
- };
33354
- }
33355
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
33356
- return (message) => {
33357
- console.error(
33358
- `
33359
- ${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(
33360
- config?.colors?.error ? config.colors.error : "#7d1a1a"
33361
- )(message)}
33362
- `
33363
- );
33364
- };
33365
- }
33366
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
33367
- return (message) => {
33368
- console.warn(
33369
- `
33370
- ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
33371
- config?.colors?.warning ? config.colors.warning : "#fcc419"
33372
- )(message)}
33373
- `
33374
- );
33375
- };
33376
- }
33377
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
33378
- return (message) => {
33379
- console.info(
33380
- `
33381
- ${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")(
33382
- message
33383
- )}
33384
- `
33385
- );
33386
- };
33387
- }
33388
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
33389
- return (message) => {
33390
- console.info(
33391
- `
33392
- ${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(
33393
- config?.colors?.success ? config.colors.success : "#087f5b"
33394
- )(message)}
33395
- `
33396
- );
33397
- };
33398
- }
33399
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
33400
- return (message) => {
33401
- console.debug(
33402
- `
33403
- ${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(
33404
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
33405
- )(message)}
33406
- `
33407
- );
33408
- };
33409
- }
33410
- return (message) => {
33411
- console.log(
33412
- `
33413
- ${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(
33414
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
33415
- )(message)}
33416
- `
33417
- );
33418
- };
33419
- };
33420
- var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
33421
- var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
33422
- var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
33423
- var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
33424
- var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
33425
- var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
33426
- var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
33427
- var getStopwatch = (name) => {
33428
- const start = process.hrtime();
33429
- return () => {
33430
- const end = process.hrtime(start);
33431
- console.info(
33432
- chalk.dim(
33433
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
33434
- end[0] * 1e3 + end[1] / 1e6
33435
- )}ms to complete`
33436
- )
33437
- );
33438
- };
33439
- };
33440
-
33441
- // packages/config-tools/src/config-file/get-config-file.ts
33442
33259
  var _static_cache = void 0;
33443
- var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
33260
+ var getConfigFileByName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
33444
33261
  var getConfigFile = async (filePath) => {
33445
33262
  if (_static_cache) {
33446
33263
  return _static_cache;
33447
33264
  }
33448
- let cosmiconfigResult = await getConfigFileName("storm", filePath);
33265
+ let cosmiconfigResult = await getConfigFileByName("storm", filePath);
33449
33266
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
33450
- cosmiconfigResult = await getConfigFileName("storm-software", filePath);
33267
+ cosmiconfigResult = await getConfigFileByName("storm-software", filePath);
33451
33268
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
33452
- cosmiconfigResult = await getConfigFileName("storm-stack", filePath);
33269
+ cosmiconfigResult = await getConfigFileByName("storm-stack", filePath);
33453
33270
  if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
33454
- cosmiconfigResult = await getConfigFileName("storm-cloud", filePath);
33455
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
33456
- cosmiconfigResult = await getConfigFileName("acidic", filePath);
33457
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
33458
- cosmiconfigResult = await getConfigFileName("acid", filePath);
33459
- }
33460
- }
33271
+ cosmiconfigResult = await getConfigFileByName("storm-cloud", filePath);
33461
33272
  }
33462
33273
  }
33463
33274
  }
33464
33275
  if (!cosmiconfigResult || Object.keys(cosmiconfigResult).length === 0 || cosmiconfigResult.isEmpty || !cosmiconfigResult.filepath) {
33465
- writeWarning(
33466
- { logLevel: "all" },
33467
- "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"
33468
- );
33469
33276
  return void 0;
33470
33277
  }
33471
33278
  const config = cosmiconfigResult.config ?? {};
@@ -37256,6 +37063,185 @@ var getDefaultConfig = (config = {}, root) => {
37256
37063
  });
37257
37064
  };
37258
37065
 
37066
+ // packages/config-tools/src/types.ts
37067
+ var LogLevel = {
37068
+ SILENT: 0,
37069
+ FATAL: 10,
37070
+ ERROR: 20,
37071
+ WARN: 30,
37072
+ INFO: 40,
37073
+ SUCCESS: 45,
37074
+ DEBUG: 60,
37075
+ TRACE: 70,
37076
+ ALL: 100
37077
+ };
37078
+ var LogLevelLabel = {
37079
+ SILENT: "silent",
37080
+ FATAL: "fatal",
37081
+ ERROR: "error",
37082
+ WARN: "warn",
37083
+ INFO: "info",
37084
+ DEBUG: "debug",
37085
+ TRACE: "trace",
37086
+ ALL: "all"
37087
+ };
37088
+
37089
+ // packages/config-tools/src/utilities/get-log-level.ts
37090
+ var getLogLevel = (label) => {
37091
+ switch (label) {
37092
+ case "all":
37093
+ return LogLevel.ALL;
37094
+ case "trace":
37095
+ return LogLevel.TRACE;
37096
+ case "debug":
37097
+ return LogLevel.DEBUG;
37098
+ case "info":
37099
+ return LogLevel.INFO;
37100
+ case "warn":
37101
+ return LogLevel.WARN;
37102
+ case "error":
37103
+ return LogLevel.ERROR;
37104
+ case "fatal":
37105
+ return LogLevel.FATAL;
37106
+ case "silent":
37107
+ return LogLevel.SILENT;
37108
+ default:
37109
+ return LogLevel.INFO;
37110
+ }
37111
+ };
37112
+ var getLogLevelLabel = (logLevel) => {
37113
+ if (logLevel >= LogLevel.ALL) {
37114
+ return LogLevelLabel.ALL;
37115
+ }
37116
+ if (logLevel >= LogLevel.TRACE) {
37117
+ return LogLevelLabel.TRACE;
37118
+ }
37119
+ if (logLevel >= LogLevel.DEBUG) {
37120
+ return LogLevelLabel.DEBUG;
37121
+ }
37122
+ if (logLevel >= LogLevel.INFO) {
37123
+ return LogLevelLabel.INFO;
37124
+ }
37125
+ if (logLevel >= LogLevel.WARN) {
37126
+ return LogLevelLabel.WARN;
37127
+ }
37128
+ if (logLevel >= LogLevel.ERROR) {
37129
+ return LogLevelLabel.ERROR;
37130
+ }
37131
+ if (logLevel >= LogLevel.FATAL) {
37132
+ return LogLevelLabel.FATAL;
37133
+ }
37134
+ if (logLevel <= LogLevel.SILENT) {
37135
+ return LogLevelLabel.SILENT;
37136
+ }
37137
+ return LogLevelLabel.INFO;
37138
+ };
37139
+
37140
+ // packages/config-tools/src/utilities/logger.ts
37141
+ var chalk = __toESM(require_source(), 1);
37142
+ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
37143
+ 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)) {
37144
+ return (_) => {
37145
+ };
37146
+ }
37147
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
37148
+ return (message) => {
37149
+ console.error(
37150
+ `
37151
+ ${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(
37152
+ config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
37153
+ )(message)}
37154
+
37155
+ `
37156
+ );
37157
+ };
37158
+ }
37159
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
37160
+ return (message) => {
37161
+ console.error(
37162
+ `
37163
+ ${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(
37164
+ config?.colors?.error ? config.colors.error : "#7d1a1a"
37165
+ )(message)}
37166
+ `
37167
+ );
37168
+ };
37169
+ }
37170
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
37171
+ return (message) => {
37172
+ console.warn(
37173
+ `
37174
+ ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" ! Warn ")} ${chalk.hex(
37175
+ config?.colors?.warning ? config.colors.warning : "#fcc419"
37176
+ )(message)}
37177
+ `
37178
+ );
37179
+ };
37180
+ }
37181
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
37182
+ return (message) => {
37183
+ console.info(
37184
+ `
37185
+ ${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")(
37186
+ message
37187
+ )}
37188
+ `
37189
+ );
37190
+ };
37191
+ }
37192
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
37193
+ return (message) => {
37194
+ console.info(
37195
+ `
37196
+ ${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(
37197
+ config?.colors?.success ? config.colors.success : "#087f5b"
37198
+ )(message)}
37199
+ `
37200
+ );
37201
+ };
37202
+ }
37203
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
37204
+ return (message) => {
37205
+ console.debug(
37206
+ `
37207
+ ${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(
37208
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
37209
+ )(message)}
37210
+ `
37211
+ );
37212
+ };
37213
+ }
37214
+ return (message) => {
37215
+ console.log(
37216
+ `
37217
+ ${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(
37218
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
37219
+ )(message)}
37220
+ `
37221
+ );
37222
+ };
37223
+ };
37224
+ var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
37225
+ var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
37226
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
37227
+ var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
37228
+ var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
37229
+ var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
37230
+ var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
37231
+ var getStopwatch = (name) => {
37232
+ const start = process.hrtime();
37233
+ return () => {
37234
+ const end = process.hrtime(start);
37235
+ console.info(
37236
+ chalk.dim(
37237
+ `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
37238
+ end[0] * 1e3 + end[1] / 1e6
37239
+ )}ms to complete`
37240
+ )
37241
+ );
37242
+ };
37243
+ };
37244
+
37259
37245
  // node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
37260
37246
  var import_node_buffer2 = require("node:buffer");
37261
37247
  var import_node_path4 = __toESM(require("node:path"), 1);
@@ -39024,10 +39010,17 @@ var loadStormConfig = async (workspaceRoot) => {
39024
39010
  if (!_workspaceRoot) {
39025
39011
  _workspaceRoot = findWorkspaceRoot();
39026
39012
  }
39013
+ const configFile = await getConfigFile(_workspaceRoot);
39014
+ if (!configFile) {
39015
+ writeWarning(
39016
+ { logLevel: "all" },
39017
+ "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"
39018
+ );
39019
+ }
39027
39020
  config = StormConfigSchema.parse(
39028
39021
  await getDefaultConfig(
39029
39022
  {
39030
- ...await getConfigFile(_workspaceRoot),
39023
+ ...configFile,
39031
39024
  ...getConfigEnv()
39032
39025
  },
39033
39026
  _workspaceRoot