@storm-software/workspace-tools 1.43.4 → 1.43.6

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.
@@ -43538,17 +43538,17 @@ var LogLevelLabel = {
43538
43538
  };
43539
43539
 
43540
43540
  // packages/config-tools/src/utilities/find-up.ts
43541
- var import_fs = require("fs");
43542
- var import_path = require("path");
43541
+ var import_node_fs = require("node:fs");
43542
+ var import_node_path = require("node:path");
43543
43543
  var MAX_PATH_SEARCH_DEPTH = 30;
43544
43544
  var depth = 0;
43545
43545
  function findFolderUp(startPath, endFileNames) {
43546
43546
  const _startPath = startPath ?? process.cwd();
43547
- if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
43547
+ if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
43548
43548
  return _startPath;
43549
43549
  }
43550
43550
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
43551
- const parent = (0, import_path.join)(_startPath, "..");
43551
+ const parent = (0, import_node_path.join)(_startPath, "..");
43552
43552
  return findFolderUp(parent, endFileNames);
43553
43553
  }
43554
43554
  return void 0;
@@ -43607,8 +43607,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
43607
43607
  }
43608
43608
 
43609
43609
  // packages/config-tools/src/utilities/get-default-config.ts
43610
- var import_fs2 = require("fs");
43611
- var import_path2 = require("path");
43610
+ var import_node_fs2 = require("node:fs");
43611
+ var import_node_path2 = require("node:path");
43612
43612
 
43613
43613
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
43614
43614
  var util;
@@ -47277,8 +47277,8 @@ var getDefaultConfig = (config = {}, root) => {
47277
47277
  let license = DefaultStormConfig.license;
47278
47278
  let homepage = DefaultStormConfig.homepage;
47279
47279
  const workspaceRoot = findWorkspaceRoot(root);
47280
- if ((0, import_fs2.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
47281
- const file = (0, import_fs2.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
47280
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
47281
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
47282
47282
  encoding: "utf-8"
47283
47283
  });
47284
47284
  if (file) {
@@ -47379,12 +47379,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47379
47379
  console.error(
47380
47380
  `
47381
47381
 
47382
+
47382
47383
  ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(
47383
47384
  ">"
47384
47385
  )} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.reset.hex(
47385
47386
  config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
47386
47387
  )(message)}
47387
47388
 
47389
+
47388
47390
  `
47389
47391
  );
47390
47392
  };
@@ -47394,12 +47396,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47394
47396
  console.error(
47395
47397
  `
47396
47398
 
47399
+
47397
47400
  ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(
47398
47401
  ">"
47399
47402
  )} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.reset.hex(
47400
47403
  config?.colors?.error ? config.colors.error : "#7d1a1a"
47401
47404
  )(message)}
47402
47405
 
47406
+
47403
47407
  `
47404
47408
  );
47405
47409
  };
@@ -47409,12 +47413,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47409
47413
  console.warn(
47410
47414
  `
47411
47415
 
47416
+
47412
47417
  ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(
47413
47418
  ">"
47414
47419
  )} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
47415
47420
  config?.colors?.warning ? config.colors.warning : "#fcc419"
47416
47421
  )(message)}
47417
47422
 
47423
+
47418
47424
  `
47419
47425
  );
47420
47426
  };
@@ -47424,12 +47430,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47424
47430
  console.info(
47425
47431
  `
47426
47432
 
47433
+
47427
47434
  ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
47428
47435
  ">"
47429
47436
  )} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.reset.hex(
47430
47437
  config?.colors?.info ? config.colors.info : "#0ea5e9"
47431
47438
  )(message)}
47432
47439
 
47440
+
47433
47441
  `
47434
47442
  );
47435
47443
  };
@@ -47439,12 +47447,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47439
47447
  console.info(
47440
47448
  `
47441
47449
 
47450
+
47442
47451
  ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(
47443
47452
  ">"
47444
47453
  )} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.reset.hex(
47445
47454
  config?.colors?.success ? config.colors.success : "#087f5b"
47446
47455
  )(message)}
47447
47456
 
47457
+
47448
47458
  `
47449
47459
  );
47450
47460
  };
@@ -47454,12 +47464,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47454
47464
  console.debug(
47455
47465
  `
47456
47466
 
47467
+
47457
47468
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
47458
47469
  ">"
47459
47470
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.reset.hex(
47460
47471
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
47461
47472
  )(message)}
47462
47473
 
47474
+
47463
47475
  `
47464
47476
  );
47465
47477
  };
@@ -47468,18 +47480,21 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47468
47480
  console.log(
47469
47481
  `
47470
47482
 
47483
+
47471
47484
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
47472
47485
  ">"
47473
47486
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.bold.hex(
47474
47487
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
47475
47488
  )(message)}
47476
47489
 
47490
+
47477
47491
  `
47478
47492
  );
47479
47493
  };
47480
47494
  };
47481
47495
  var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
47482
47496
  var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
47497
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
47483
47498
  var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
47484
47499
  var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
47485
47500
  var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
@@ -47632,16 +47647,6 @@ var setConfigEnv = (config) => {
47632
47647
  }
47633
47648
  };
47634
47649
 
47635
- // packages/config-tools/src/utilities/prepare-workspace.ts
47636
- var prepareWorkspace = async () => {
47637
- const _STORM_CONFIG = getDefaultConfig({
47638
- ...await getConfigFile(),
47639
- ...getConfigEnv()
47640
- });
47641
- setConfigEnv(_STORM_CONFIG);
47642
- return _STORM_CONFIG;
47643
- };
47644
-
47645
47650
  // packages/config-tools/src/env/get-env.ts
47646
47651
  var getExtensionEnv = (extensionName) => {
47647
47652
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -47709,6 +47714,32 @@ var getConfigEnv = () => {
47709
47714
  }, config);
47710
47715
  };
47711
47716
 
47717
+ // packages/config-tools/src/create-storm-config.ts
47718
+ var loadStormConfig = async (workspaceRoot) => {
47719
+ let config = {};
47720
+ let _workspaceRoot = workspaceRoot;
47721
+ if (!_workspaceRoot) {
47722
+ _workspaceRoot = findWorkspaceRoot();
47723
+ }
47724
+ const configFile = await getDefaultConfig(
47725
+ {
47726
+ ...await getConfigFile(_workspaceRoot),
47727
+ ...getConfigEnv()
47728
+ },
47729
+ _workspaceRoot
47730
+ );
47731
+ if (configFile) {
47732
+ config = StormConfigSchema.parse(configFile);
47733
+ } else {
47734
+ writeWarning(
47735
+ config,
47736
+ "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."
47737
+ );
47738
+ }
47739
+ setConfigEnv(config);
47740
+ return config;
47741
+ };
47742
+
47712
47743
  // packages/workspace-tools/src/utils/get-workspace-root.ts
47713
47744
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
47714
47745
  var getWorkspaceRoot = () => {
@@ -47789,7 +47820,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
47789
47820
  `Loading the Storm Config from environment variables and storm.config.js file...
47790
47821
  - workspaceRoot: ${workspaceRoot}`
47791
47822
  );
47792
- config = await prepareWorkspace();
47823
+ config = await loadStormConfig(workspaceRoot);
47793
47824
  writeTrace(
47794
47825
  config,
47795
47826
  `Loaded Storm config into env:
@@ -26297,17 +26297,17 @@ var LogLevelLabel = {
26297
26297
  };
26298
26298
 
26299
26299
  // packages/config-tools/src/utilities/find-up.ts
26300
- var import_fs = require("fs");
26301
- var import_path = require("path");
26300
+ var import_node_fs = require("node:fs");
26301
+ var import_node_path = require("node:path");
26302
26302
  var MAX_PATH_SEARCH_DEPTH = 30;
26303
26303
  var depth = 0;
26304
26304
  function findFolderUp(startPath, endFileNames) {
26305
26305
  const _startPath = startPath ?? process.cwd();
26306
- if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
26306
+ if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
26307
26307
  return _startPath;
26308
26308
  }
26309
26309
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
26310
- const parent = (0, import_path.join)(_startPath, "..");
26310
+ const parent = (0, import_node_path.join)(_startPath, "..");
26311
26311
  return findFolderUp(parent, endFileNames);
26312
26312
  }
26313
26313
  return void 0;
@@ -26366,8 +26366,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
26366
26366
  }
26367
26367
 
26368
26368
  // packages/config-tools/src/utilities/get-default-config.ts
26369
- var import_fs2 = require("fs");
26370
- var import_path2 = require("path");
26369
+ var import_node_fs2 = require("node:fs");
26370
+ var import_node_path2 = require("node:path");
26371
26371
 
26372
26372
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
26373
26373
  var util;
@@ -30036,8 +30036,8 @@ var getDefaultConfig = (config = {}, root) => {
30036
30036
  let license = DefaultStormConfig.license;
30037
30037
  let homepage = DefaultStormConfig.homepage;
30038
30038
  const workspaceRoot = findWorkspaceRoot(root);
30039
- if ((0, import_fs2.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
30040
- const file = (0, import_fs2.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
30039
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
30040
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
30041
30041
  encoding: "utf-8"
30042
30042
  });
30043
30043
  if (file) {
@@ -30138,12 +30138,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30138
30138
  console.error(
30139
30139
  `
30140
30140
 
30141
+
30141
30142
  ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(
30142
30143
  ">"
30143
30144
  )} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.reset.hex(
30144
30145
  config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
30145
30146
  )(message)}
30146
30147
 
30148
+
30147
30149
  `
30148
30150
  );
30149
30151
  };
@@ -30153,12 +30155,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30153
30155
  console.error(
30154
30156
  `
30155
30157
 
30158
+
30156
30159
  ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(
30157
30160
  ">"
30158
30161
  )} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.reset.hex(
30159
30162
  config?.colors?.error ? config.colors.error : "#7d1a1a"
30160
30163
  )(message)}
30161
30164
 
30165
+
30162
30166
  `
30163
30167
  );
30164
30168
  };
@@ -30168,12 +30172,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30168
30172
  console.warn(
30169
30173
  `
30170
30174
 
30175
+
30171
30176
  ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(
30172
30177
  ">"
30173
30178
  )} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
30174
30179
  config?.colors?.warning ? config.colors.warning : "#fcc419"
30175
30180
  )(message)}
30176
30181
 
30182
+
30177
30183
  `
30178
30184
  );
30179
30185
  };
@@ -30183,12 +30189,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30183
30189
  console.info(
30184
30190
  `
30185
30191
 
30192
+
30186
30193
  ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
30187
30194
  ">"
30188
30195
  )} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.reset.hex(
30189
30196
  config?.colors?.info ? config.colors.info : "#0ea5e9"
30190
30197
  )(message)}
30191
30198
 
30199
+
30192
30200
  `
30193
30201
  );
30194
30202
  };
@@ -30198,12 +30206,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30198
30206
  console.info(
30199
30207
  `
30200
30208
 
30209
+
30201
30210
  ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(
30202
30211
  ">"
30203
30212
  )} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.reset.hex(
30204
30213
  config?.colors?.success ? config.colors.success : "#087f5b"
30205
30214
  )(message)}
30206
30215
 
30216
+
30207
30217
  `
30208
30218
  );
30209
30219
  };
@@ -30213,12 +30223,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30213
30223
  console.debug(
30214
30224
  `
30215
30225
 
30226
+
30216
30227
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
30217
30228
  ">"
30218
30229
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.reset.hex(
30219
30230
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
30220
30231
  )(message)}
30221
30232
 
30233
+
30222
30234
  `
30223
30235
  );
30224
30236
  };
@@ -30227,18 +30239,21 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30227
30239
  console.log(
30228
30240
  `
30229
30241
 
30242
+
30230
30243
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
30231
30244
  ">"
30232
30245
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.bold.hex(
30233
30246
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
30234
30247
  )(message)}
30235
30248
 
30249
+
30236
30250
  `
30237
30251
  );
30238
30252
  };
30239
30253
  };
30240
30254
  var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
30241
30255
  var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
30256
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
30242
30257
  var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
30243
30258
  var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
30244
30259
  var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
@@ -30391,16 +30406,6 @@ var setConfigEnv = (config) => {
30391
30406
  }
30392
30407
  };
30393
30408
 
30394
- // packages/config-tools/src/utilities/prepare-workspace.ts
30395
- var prepareWorkspace = async () => {
30396
- const _STORM_CONFIG = getDefaultConfig({
30397
- ...await getConfigFile(),
30398
- ...getConfigEnv()
30399
- });
30400
- setConfigEnv(_STORM_CONFIG);
30401
- return _STORM_CONFIG;
30402
- };
30403
-
30404
30409
  // packages/config-tools/src/env/get-env.ts
30405
30410
  var getExtensionEnv = (extensionName) => {
30406
30411
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -30468,6 +30473,32 @@ var getConfigEnv = () => {
30468
30473
  }, config);
30469
30474
  };
30470
30475
 
30476
+ // packages/config-tools/src/create-storm-config.ts
30477
+ var loadStormConfig = async (workspaceRoot) => {
30478
+ let config = {};
30479
+ let _workspaceRoot = workspaceRoot;
30480
+ if (!_workspaceRoot) {
30481
+ _workspaceRoot = findWorkspaceRoot();
30482
+ }
30483
+ const configFile = await getDefaultConfig(
30484
+ {
30485
+ ...await getConfigFile(_workspaceRoot),
30486
+ ...getConfigEnv()
30487
+ },
30488
+ _workspaceRoot
30489
+ );
30490
+ if (configFile) {
30491
+ config = StormConfigSchema.parse(configFile);
30492
+ } else {
30493
+ writeWarning(
30494
+ config,
30495
+ "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."
30496
+ );
30497
+ }
30498
+ setConfigEnv(config);
30499
+ return config;
30500
+ };
30501
+
30471
30502
  // packages/workspace-tools/src/utils/get-workspace-root.ts
30472
30503
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
30473
30504
  var getWorkspaceRoot = () => {
@@ -30548,7 +30579,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
30548
30579
  `Loading the Storm Config from environment variables and storm.config.js file...
30549
30580
  - workspaceRoot: ${workspaceRoot}`
30550
30581
  );
30551
- config = await prepareWorkspace();
30582
+ config = await loadStormConfig(workspaceRoot);
30552
30583
  writeTrace(
30553
30584
  config,
30554
30585
  `Loaded Storm config into env: