@storm-software/workspace-tools 1.43.5 → 1.43.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/workspace-tools",
3
- "version": "1.43.5",
3
+ "version": "1.43.7",
4
4
  "private": false,
5
5
  "description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
6
6
  "keywords": [
package/src/base/index.js CHANGED
@@ -43485,7 +43485,7 @@ module.exports = __toCommonJS(base_exports);
43485
43485
  // packages/config-tools/src/config-file/get-config-file.ts
43486
43486
  var import_cosmiconfig = __toESM(require_dist(), 1);
43487
43487
  var _static_cache = void 0;
43488
- var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
43488
+ var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
43489
43489
  var getConfigFile = async (filePath) => {
43490
43490
  if (_static_cache) {
43491
43491
  return _static_cache;
@@ -43545,17 +43545,17 @@ var LogLevelLabel = {
43545
43545
  };
43546
43546
 
43547
43547
  // packages/config-tools/src/utilities/find-up.ts
43548
- var import_fs = require("fs");
43549
- var import_path = require("path");
43548
+ var import_node_fs = require("node:fs");
43549
+ var import_node_path = require("node:path");
43550
43550
  var MAX_PATH_SEARCH_DEPTH = 30;
43551
43551
  var depth = 0;
43552
43552
  function findFolderUp(startPath, endFileNames) {
43553
43553
  const _startPath = startPath ?? process.cwd();
43554
- if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
43554
+ if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
43555
43555
  return _startPath;
43556
43556
  }
43557
43557
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
43558
- const parent = (0, import_path.join)(_startPath, "..");
43558
+ const parent = (0, import_node_path.join)(_startPath, "..");
43559
43559
  return findFolderUp(parent, endFileNames);
43560
43560
  }
43561
43561
  return void 0;
@@ -43614,8 +43614,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
43614
43614
  }
43615
43615
 
43616
43616
  // packages/config-tools/src/utilities/get-default-config.ts
43617
- var import_fs2 = require("fs");
43618
- var import_path2 = require("path");
43617
+ var import_node_fs2 = require("node:fs");
43618
+ var import_node_path2 = require("node:path");
43619
43619
 
43620
43620
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
43621
43621
  var util;
@@ -47284,8 +47284,8 @@ var getDefaultConfig = (config = {}, root) => {
47284
47284
  let license = DefaultStormConfig.license;
47285
47285
  let homepage = DefaultStormConfig.homepage;
47286
47286
  const workspaceRoot = findWorkspaceRoot(root);
47287
- if ((0, import_fs2.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
47288
- const file = (0, import_fs2.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
47287
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
47288
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
47289
47289
  encoding: "utf-8"
47290
47290
  });
47291
47291
  if (file) {
@@ -47308,9 +47308,9 @@ var getDefaultConfig = (config = {}, root) => {
47308
47308
  }
47309
47309
  }
47310
47310
  return StormConfigSchema.parse({
47311
- ...config,
47312
47311
  ...DefaultStormConfig,
47313
- colors: { ...config.colors, ...DefaultColorConfig },
47312
+ ...config,
47313
+ colors: { ...DefaultColorConfig, ...config.colors },
47314
47314
  workspaceRoot,
47315
47315
  name,
47316
47316
  namespace,
@@ -47501,6 +47501,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47501
47501
  };
47502
47502
  var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
47503
47503
  var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
47504
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
47504
47505
  var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
47505
47506
  var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
47506
47507
  var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
@@ -47653,16 +47654,6 @@ var setConfigEnv = (config) => {
47653
47654
  }
47654
47655
  };
47655
47656
 
47656
- // packages/config-tools/src/utilities/prepare-workspace.ts
47657
- var prepareWorkspace = async () => {
47658
- const _STORM_CONFIG = getDefaultConfig({
47659
- ...await getConfigFile(),
47660
- ...getConfigEnv()
47661
- });
47662
- setConfigEnv(_STORM_CONFIG);
47663
- return _STORM_CONFIG;
47664
- };
47665
-
47666
47657
  // packages/config-tools/src/env/get-env.ts
47667
47658
  var getExtensionEnv = (extensionName) => {
47668
47659
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -47730,6 +47721,32 @@ var getConfigEnv = () => {
47730
47721
  }, config);
47731
47722
  };
47732
47723
 
47724
+ // packages/config-tools/src/create-storm-config.ts
47725
+ var loadStormConfig = async (workspaceRoot) => {
47726
+ let config = {};
47727
+ let _workspaceRoot = workspaceRoot;
47728
+ if (!_workspaceRoot) {
47729
+ _workspaceRoot = findWorkspaceRoot();
47730
+ }
47731
+ const configFile = await getDefaultConfig(
47732
+ {
47733
+ ...await getConfigFile(_workspaceRoot),
47734
+ ...getConfigEnv()
47735
+ },
47736
+ _workspaceRoot
47737
+ );
47738
+ if (configFile) {
47739
+ config = StormConfigSchema.parse(configFile);
47740
+ } else {
47741
+ writeWarning(
47742
+ config,
47743
+ "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."
47744
+ );
47745
+ }
47746
+ setConfigEnv(config);
47747
+ return config;
47748
+ };
47749
+
47733
47750
  // packages/workspace-tools/src/utils/get-workspace-root.ts
47734
47751
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
47735
47752
  var getWorkspaceRoot = () => {
@@ -47868,7 +47885,7 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
47868
47885
  - projectName: ${projectName}
47869
47886
  `
47870
47887
  );
47871
- config = await prepareWorkspace();
47888
+ config = await loadStormConfig(workspaceRoot);
47872
47889
  writeTrace(
47873
47890
  config,
47874
47891
  `Loaded Storm config into env:
@@ -47956,7 +47973,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
47956
47973
  `Loading the Storm Config from environment variables and storm.config.js file...
47957
47974
  - workspaceRoot: ${workspaceRoot}`
47958
47975
  );
47959
- config = await prepareWorkspace();
47976
+ config = await loadStormConfig(workspaceRoot);
47960
47977
  writeTrace(
47961
47978
  config,
47962
47979
  `Loaded Storm config into env:
@@ -61401,7 +61401,7 @@ var createTailwindConfig = ({ inputPath }) => {
61401
61401
  // packages/config-tools/src/config-file/get-config-file.ts
61402
61402
  var import_cosmiconfig = __toESM(require_dist17(), 1);
61403
61403
  var _static_cache = void 0;
61404
- var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
61404
+ var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
61405
61405
  var getConfigFile = async (filePath) => {
61406
61406
  if (_static_cache) {
61407
61407
  return _static_cache;
@@ -61461,17 +61461,17 @@ var LogLevelLabel = {
61461
61461
  };
61462
61462
 
61463
61463
  // packages/config-tools/src/utilities/find-up.ts
61464
- var import_fs = require("fs");
61465
- var import_path = require("path");
61464
+ var import_node_fs = require("node:fs");
61465
+ var import_node_path = require("node:path");
61466
61466
  var MAX_PATH_SEARCH_DEPTH = 30;
61467
61467
  var depth = 0;
61468
61468
  function findFolderUp(startPath, endFileNames) {
61469
61469
  const _startPath = startPath ?? process.cwd();
61470
- if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
61470
+ if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
61471
61471
  return _startPath;
61472
61472
  }
61473
61473
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
61474
- const parent = (0, import_path.join)(_startPath, "..");
61474
+ const parent = (0, import_node_path.join)(_startPath, "..");
61475
61475
  return findFolderUp(parent, endFileNames);
61476
61476
  }
61477
61477
  return void 0;
@@ -61530,8 +61530,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
61530
61530
  }
61531
61531
 
61532
61532
  // packages/config-tools/src/utilities/get-default-config.ts
61533
- var import_fs2 = require("fs");
61534
- var import_path2 = require("path");
61533
+ var import_node_fs2 = require("node:fs");
61534
+ var import_node_path2 = require("node:path");
61535
61535
 
61536
61536
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
61537
61537
  var util;
@@ -65200,8 +65200,8 @@ var getDefaultConfig = (config = {}, root) => {
65200
65200
  let license = DefaultStormConfig.license;
65201
65201
  let homepage = DefaultStormConfig.homepage;
65202
65202
  const workspaceRoot = findWorkspaceRoot(root);
65203
- if ((0, import_fs2.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
65204
- const file = (0, import_fs2.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
65203
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
65204
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
65205
65205
  encoding: "utf-8"
65206
65206
  });
65207
65207
  if (file) {
@@ -65224,9 +65224,9 @@ var getDefaultConfig = (config = {}, root) => {
65224
65224
  }
65225
65225
  }
65226
65226
  return StormConfigSchema.parse({
65227
- ...config,
65228
65227
  ...DefaultStormConfig,
65229
- colors: { ...config.colors, ...DefaultColorConfig },
65228
+ ...config,
65229
+ colors: { ...DefaultColorConfig, ...config.colors },
65230
65230
  workspaceRoot,
65231
65231
  name,
65232
65232
  namespace,
@@ -65417,6 +65417,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
65417
65417
  };
65418
65418
  var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
65419
65419
  var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
65420
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
65420
65421
  var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
65421
65422
  var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
65422
65423
  var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
@@ -65569,16 +65570,6 @@ var setConfigEnv = (config) => {
65569
65570
  }
65570
65571
  };
65571
65572
 
65572
- // packages/config-tools/src/utilities/prepare-workspace.ts
65573
- var prepareWorkspace = async () => {
65574
- const _STORM_CONFIG = getDefaultConfig({
65575
- ...await getConfigFile(),
65576
- ...getConfigEnv()
65577
- });
65578
- setConfigEnv(_STORM_CONFIG);
65579
- return _STORM_CONFIG;
65580
- };
65581
-
65582
65573
  // packages/config-tools/src/env/get-env.ts
65583
65574
  var getExtensionEnv = (extensionName) => {
65584
65575
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -65646,6 +65637,32 @@ var getConfigEnv = () => {
65646
65637
  }, config);
65647
65638
  };
65648
65639
 
65640
+ // packages/config-tools/src/create-storm-config.ts
65641
+ var loadStormConfig = async (workspaceRoot) => {
65642
+ let config = {};
65643
+ let _workspaceRoot = workspaceRoot;
65644
+ if (!_workspaceRoot) {
65645
+ _workspaceRoot = findWorkspaceRoot();
65646
+ }
65647
+ const configFile = await getDefaultConfig(
65648
+ {
65649
+ ...await getConfigFile(_workspaceRoot),
65650
+ ...getConfigEnv()
65651
+ },
65652
+ _workspaceRoot
65653
+ );
65654
+ if (configFile) {
65655
+ config = StormConfigSchema.parse(configFile);
65656
+ } else {
65657
+ writeWarning(
65658
+ config,
65659
+ "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."
65660
+ );
65661
+ }
65662
+ setConfigEnv(config);
65663
+ return config;
65664
+ };
65665
+
65649
65666
  // packages/workspace-tools/src/utils/get-workspace-root.ts
65650
65667
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
65651
65668
  var getWorkspaceRoot = () => {
@@ -65758,7 +65775,7 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
65758
65775
  - projectName: ${projectName}
65759
65776
  `
65760
65777
  );
65761
- config = await prepareWorkspace();
65778
+ config = await loadStormConfig(workspaceRoot);
65762
65779
  writeTrace(
65763
65780
  config,
65764
65781
  `Loaded Storm config into env: