@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:
@@ -26296,17 +26296,17 @@ var LogLevelLabel = {
26296
26296
  };
26297
26297
 
26298
26298
  // packages/config-tools/src/utilities/find-up.ts
26299
- var import_fs = require("fs");
26300
- var import_path = require("path");
26299
+ var import_node_fs = require("node:fs");
26300
+ var import_node_path = require("node:path");
26301
26301
  var MAX_PATH_SEARCH_DEPTH = 30;
26302
26302
  var depth = 0;
26303
26303
  function findFolderUp(startPath, endFileNames) {
26304
26304
  const _startPath = startPath ?? process.cwd();
26305
- if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
26305
+ if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
26306
26306
  return _startPath;
26307
26307
  }
26308
26308
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
26309
- const parent = (0, import_path.join)(_startPath, "..");
26309
+ const parent = (0, import_node_path.join)(_startPath, "..");
26310
26310
  return findFolderUp(parent, endFileNames);
26311
26311
  }
26312
26312
  return void 0;
@@ -26365,8 +26365,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
26365
26365
  }
26366
26366
 
26367
26367
  // packages/config-tools/src/utilities/get-default-config.ts
26368
- var import_fs2 = require("fs");
26369
- var import_path2 = require("path");
26368
+ var import_node_fs2 = require("node:fs");
26369
+ var import_node_path2 = require("node:path");
26370
26370
 
26371
26371
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
26372
26372
  var util;
@@ -30035,8 +30035,8 @@ var getDefaultConfig = (config = {}, root) => {
30035
30035
  let license = DefaultStormConfig.license;
30036
30036
  let homepage = DefaultStormConfig.homepage;
30037
30037
  const workspaceRoot = findWorkspaceRoot(root);
30038
- if ((0, import_fs2.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
30039
- const file = (0, import_fs2.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
30038
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
30039
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
30040
30040
  encoding: "utf-8"
30041
30041
  });
30042
30042
  if (file) {
@@ -30137,12 +30137,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30137
30137
  console.error(
30138
30138
  `
30139
30139
 
30140
+
30140
30141
  ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(
30141
30142
  ">"
30142
30143
  )} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.reset.hex(
30143
30144
  config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
30144
30145
  )(message)}
30145
30146
 
30147
+
30146
30148
  `
30147
30149
  );
30148
30150
  };
@@ -30152,12 +30154,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30152
30154
  console.error(
30153
30155
  `
30154
30156
 
30157
+
30155
30158
  ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(
30156
30159
  ">"
30157
30160
  )} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.reset.hex(
30158
30161
  config?.colors?.error ? config.colors.error : "#7d1a1a"
30159
30162
  )(message)}
30160
30163
 
30164
+
30161
30165
  `
30162
30166
  );
30163
30167
  };
@@ -30167,12 +30171,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30167
30171
  console.warn(
30168
30172
  `
30169
30173
 
30174
+
30170
30175
  ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(
30171
30176
  ">"
30172
30177
  )} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
30173
30178
  config?.colors?.warning ? config.colors.warning : "#fcc419"
30174
30179
  )(message)}
30175
30180
 
30181
+
30176
30182
  `
30177
30183
  );
30178
30184
  };
@@ -30182,12 +30188,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30182
30188
  console.info(
30183
30189
  `
30184
30190
 
30191
+
30185
30192
  ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
30186
30193
  ">"
30187
30194
  )} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.reset.hex(
30188
30195
  config?.colors?.info ? config.colors.info : "#0ea5e9"
30189
30196
  )(message)}
30190
30197
 
30198
+
30191
30199
  `
30192
30200
  );
30193
30201
  };
@@ -30197,12 +30205,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30197
30205
  console.info(
30198
30206
  `
30199
30207
 
30208
+
30200
30209
  ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(
30201
30210
  ">"
30202
30211
  )} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.reset.hex(
30203
30212
  config?.colors?.success ? config.colors.success : "#087f5b"
30204
30213
  )(message)}
30205
30214
 
30215
+
30206
30216
  `
30207
30217
  );
30208
30218
  };
@@ -30212,12 +30222,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30212
30222
  console.debug(
30213
30223
  `
30214
30224
 
30225
+
30215
30226
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
30216
30227
  ">"
30217
30228
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.reset.hex(
30218
30229
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
30219
30230
  )(message)}
30220
30231
 
30232
+
30221
30233
  `
30222
30234
  );
30223
30235
  };
@@ -30226,18 +30238,21 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
30226
30238
  console.log(
30227
30239
  `
30228
30240
 
30241
+
30229
30242
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
30230
30243
  ">"
30231
30244
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.bold.hex(
30232
30245
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
30233
30246
  )(message)}
30234
30247
 
30248
+
30235
30249
  `
30236
30250
  );
30237
30251
  };
30238
30252
  };
30239
30253
  var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
30240
30254
  var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
30255
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
30241
30256
  var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
30242
30257
  var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
30243
30258
  var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
@@ -30390,16 +30405,6 @@ var setConfigEnv = (config) => {
30390
30405
  }
30391
30406
  };
30392
30407
 
30393
- // packages/config-tools/src/utilities/prepare-workspace.ts
30394
- var prepareWorkspace = async () => {
30395
- const _STORM_CONFIG = getDefaultConfig({
30396
- ...await getConfigFile(),
30397
- ...getConfigEnv()
30398
- });
30399
- setConfigEnv(_STORM_CONFIG);
30400
- return _STORM_CONFIG;
30401
- };
30402
-
30403
30408
  // packages/config-tools/src/env/get-env.ts
30404
30409
  var getExtensionEnv = (extensionName) => {
30405
30410
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -30467,9 +30472,35 @@ var getConfigEnv = () => {
30467
30472
  }, config);
30468
30473
  };
30469
30474
 
30475
+ // packages/config-tools/src/create-storm-config.ts
30476
+ var loadStormConfig = async (workspaceRoot) => {
30477
+ let config = {};
30478
+ let _workspaceRoot = workspaceRoot;
30479
+ if (!_workspaceRoot) {
30480
+ _workspaceRoot = findWorkspaceRoot();
30481
+ }
30482
+ const configFile = await getDefaultConfig(
30483
+ {
30484
+ ...await getConfigFile(_workspaceRoot),
30485
+ ...getConfigEnv()
30486
+ },
30487
+ _workspaceRoot
30488
+ );
30489
+ if (configFile) {
30490
+ config = StormConfigSchema.parse(configFile);
30491
+ } else {
30492
+ writeWarning(
30493
+ config,
30494
+ "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."
30495
+ );
30496
+ }
30497
+ setConfigEnv(config);
30498
+ return config;
30499
+ };
30500
+
30470
30501
  // packages/workspace-tools/src/generators/config-schema/generator.ts
30471
- var import_fs3 = require("fs");
30472
- var import_path3 = require("path");
30502
+ var import_fs = require("fs");
30503
+ var import_path = require("path");
30473
30504
 
30474
30505
  // node_modules/.pnpm/zod-to-json-schema@3.22.1_zod@3.22.4/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
30475
30506
  function addErrorMessage(res, key, errorMessage, refs) {
@@ -31562,7 +31593,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
31562
31593
  `Loading the Storm Config from environment variables and storm.config.js file...
31563
31594
  - workspaceRoot: ${workspaceRoot}`
31564
31595
  );
31565
- config = await prepareWorkspace();
31596
+ config = await loadStormConfig(workspaceRoot);
31566
31597
  writeTrace(
31567
31598
  config,
31568
31599
  `Loaded Storm config into env:
@@ -31639,11 +31670,11 @@ async function configSchemaGeneratorFn(tree, options) {
31639
31670
  const modules = await Promise.all(
31640
31671
  Object.keys(projectConfigurations).map(async (key) => {
31641
31672
  if (projectConfigurations[key]?.config) {
31642
- const configPath = (0, import_path3.join)(
31673
+ const configPath = (0, import_path.join)(
31643
31674
  workspaceRoot,
31644
31675
  projectConfigurations[key].config
31645
31676
  );
31646
- if ((0, import_fs3.existsSync)(configPath)) {
31677
+ if ((0, import_fs.existsSync)(configPath)) {
31647
31678
  const mod = await import(configPath);
31648
31679
  if (mod.default) {
31649
31680
  return { name: key, schema: mod.default };
@@ -31671,7 +31702,7 @@ async function configSchemaGeneratorFn(tree, options) {
31671
31702
  );
31672
31703
  (0, import_devkit.writeJson)(
31673
31704
  tree,
31674
- options.outputFile ? (0, import_path3.join)(workspaceRoot, options.outputFile) : (0, import_path3.join)(workspaceRoot, "storm.schema.json"),
31705
+ options.outputFile ? (0, import_path.join)(workspaceRoot, options.outputFile) : (0, import_path.join)(workspaceRoot, "storm.schema.json"),
31675
31706
  zodToJsonSchema(ModulesSchema, "StormConfig")
31676
31707
  );
31677
31708
  await (0, import_devkit.formatFiles)(tree);
@@ -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: