@storm-software/workspace-tools 1.60.23 → 1.62.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.
@@ -79,7 +79,7 @@ var init_find_workspace_root = __esm({
79
79
  "packages/config-tools/src/utilities/find-workspace-root.ts"() {
80
80
  init_find_up();
81
81
  rootFiles = [
82
- "lerna.json",
82
+ "storm.json",
83
83
  "storm.config.js",
84
84
  "storm.config.ts",
85
85
  ".storm.json",
@@ -87,6 +87,7 @@ var init_find_workspace_root = __esm({
87
87
  ".storm.yml",
88
88
  ".storm.js",
89
89
  ".storm.ts",
90
+ "lerna.json",
90
91
  "nx.json",
91
92
  "turbo.json",
92
93
  "npm-workspace.json",
@@ -211472,25 +211473,23 @@ var init_get_config_file = __esm({
211472
211473
  } : { config: {}, filepath: jsonPath, isEmpty };
211473
211474
  };
211474
211475
  getConfigFile = async (filePath, additionalFileNames = []) => {
211475
- const workspacePath = filePath ? filePath : findWorkspaceRootSafe(filePath);
211476
- let cosmiconfigResult = await getJsonConfigFile("storm", workspacePath);
211477
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
211478
- if (!defaultExplorer) {
211479
- defaultExplorer = await getConfigFileExplorer("storm");
211480
- }
211481
- if (defaultExplorer) {
211482
- cosmiconfigResult = await defaultExplorer.search(workspacePath);
211483
- }
211484
- if ((!cosmiconfigResult || cosmiconfigResult.isEmpty) && additionalFileNames.length > 0) {
211485
- for (const additionalFileName of additionalFileNames) {
211486
- cosmiconfigResult = await getJsonConfigFile(additionalFileName, workspacePath);
211487
- if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
211488
- break;
211489
- }
211490
- cosmiconfigResult = await getConfigFileByName(additionalFileName, workspacePath);
211491
- if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
211492
- break;
211493
- }
211476
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
211477
+ if (!defaultExplorer) {
211478
+ defaultExplorer = await getConfigFileExplorer("storm");
211479
+ }
211480
+ let cosmiconfigResult = null;
211481
+ if (defaultExplorer) {
211482
+ cosmiconfigResult = await defaultExplorer.search(workspacePath);
211483
+ }
211484
+ if ((!cosmiconfigResult || cosmiconfigResult.isEmpty) && additionalFileNames.length > 0) {
211485
+ for (const additionalFileName of additionalFileNames) {
211486
+ cosmiconfigResult = await getJsonConfigFile(additionalFileName, workspacePath);
211487
+ if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
211488
+ break;
211489
+ }
211490
+ cosmiconfigResult = await getConfigFileByName(additionalFileName, workspacePath);
211491
+ if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
211492
+ break;
211494
211493
  }
211495
211494
  }
211496
211495
  }
@@ -215471,7 +215470,7 @@ var init_get_log_level = __esm({
215471
215470
  return LogLevel.INFO;
215472
215471
  }
215473
215472
  };
215474
- getLogLevelLabel = (logLevel) => {
215473
+ getLogLevelLabel = (logLevel = LogLevel.INFO) => {
215475
215474
  if (logLevel >= LogLevel.ALL) {
215476
215475
  return LogLevelLabel.ALL;
215477
215476
  }
@@ -215797,14 +215796,14 @@ var init_set_env = __esm({
215797
215796
  if (extension[key]) {
215798
215797
  const result = key?.replace(
215799
215798
  /([A-Z])+/g,
215800
- (input) => input ? input[0].toUpperCase() + input.slice(1) : ""
215799
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
215801
215800
  ).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
215802
215801
  let extensionKey;
215803
215802
  if (result.length === 0) {
215804
215803
  return;
215805
215804
  }
215806
215805
  if (result.length === 1) {
215807
- extensionKey = result[0].toUpperCase();
215806
+ extensionKey = result[0]?.toUpperCase() ?? "";
215808
215807
  } else {
215809
215808
  extensionKey = result.reduce((ret, part) => {
215810
215809
  return `${ret}_${part.toLowerCase()}`;
@@ -238972,9 +238971,13 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
238972
238971
  sourceRoot = context.sourceRoot;
238973
238972
  } else {
238974
238973
  const projectConfig = tokenizerOptions;
238975
- projectName = projectConfig.name;
238976
238974
  projectRoot = projectConfig.root;
238977
- sourceRoot = projectConfig.sourceRoot;
238975
+ if (projectConfig.name) {
238976
+ projectName = projectConfig.name;
238977
+ }
238978
+ if (projectConfig.sourceRoot) {
238979
+ sourceRoot = projectConfig.sourceRoot;
238980
+ }
238978
238981
  }
238979
238982
  if (tokenizerOptions.config) {
238980
238983
  const configKeys = Object.keys(tokenizerOptions.config);
@@ -238998,7 +239001,7 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
238998
239001
  if (result.includes("{workspaceRoot}")) {
238999
239002
  result = result.replaceAll(
239000
239003
  "{workspaceRoot}",
239001
- tokenizerOptions.workspaceRoot ?? findWorkspaceRootSafe()
239004
+ tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
239002
239005
  );
239003
239006
  }
239004
239007
  return result;
@@ -239023,7 +239026,6 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
239023
239026
  };
239024
239027
 
239025
239028
  // packages/workspace-tools/src/base/base-executor.ts
239026
- init_src2();
239027
239029
  var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
239028
239030
  const stopwatch = getStopwatch(name);
239029
239031
  let options = _options;
@@ -239036,10 +239038,10 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
239036
239038
  "The Build process failed because the context is not valid. Please run this command from a workspace."
239037
239039
  );
239038
239040
  }
239039
- const workspaceRoot = findWorkspaceRootSafe();
239040
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
239041
- const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
239042
- const projectName = context.projectsConfigurations.projects[context.projectName].name;
239041
+ const workspaceRoot = findWorkspaceRoot();
239042
+ const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
239043
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
239044
+ const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
239043
239045
  if (!executorOptions.skipReadingConfig) {
239044
239046
  const { loadStormConfig: loadStormConfig2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
239045
239047
  writeDebug(