@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.
@@ -175812,7 +175812,7 @@ var init_find_workspace_root = __esm({
175812
175812
  "packages/config-tools/src/utilities/find-workspace-root.ts"() {
175813
175813
  init_find_up();
175814
175814
  rootFiles = [
175815
- "lerna.json",
175815
+ "storm.json",
175816
175816
  "storm.config.js",
175817
175817
  "storm.config.ts",
175818
175818
  ".storm.json",
@@ -175820,6 +175820,7 @@ var init_find_workspace_root = __esm({
175820
175820
  ".storm.yml",
175821
175821
  ".storm.js",
175822
175822
  ".storm.ts",
175823
+ "lerna.json",
175823
175824
  "nx.json",
175824
175825
  "turbo.json",
175825
175826
  "npm-workspace.json",
@@ -385658,25 +385659,23 @@ var init_get_config_file = __esm({
385658
385659
  } : { config: {}, filepath: jsonPath, isEmpty };
385659
385660
  };
385660
385661
  getConfigFile = async (filePath, additionalFileNames = []) => {
385661
- const workspacePath = filePath ? filePath : findWorkspaceRootSafe(filePath);
385662
- let cosmiconfigResult = await getJsonConfigFile("storm", workspacePath);
385663
- if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
385664
- if (!defaultExplorer) {
385665
- defaultExplorer = await getConfigFileExplorer("storm");
385666
- }
385667
- if (defaultExplorer) {
385668
- cosmiconfigResult = await defaultExplorer.search(workspacePath);
385669
- }
385670
- if ((!cosmiconfigResult || cosmiconfigResult.isEmpty) && additionalFileNames.length > 0) {
385671
- for (const additionalFileName of additionalFileNames) {
385672
- cosmiconfigResult = await getJsonConfigFile(additionalFileName, workspacePath);
385673
- if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
385674
- break;
385675
- }
385676
- cosmiconfigResult = await getConfigFileByName(additionalFileName, workspacePath);
385677
- if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
385678
- break;
385679
- }
385662
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
385663
+ if (!defaultExplorer) {
385664
+ defaultExplorer = await getConfigFileExplorer("storm");
385665
+ }
385666
+ let cosmiconfigResult = null;
385667
+ if (defaultExplorer) {
385668
+ cosmiconfigResult = await defaultExplorer.search(workspacePath);
385669
+ }
385670
+ if ((!cosmiconfigResult || cosmiconfigResult.isEmpty) && additionalFileNames.length > 0) {
385671
+ for (const additionalFileName of additionalFileNames) {
385672
+ cosmiconfigResult = await getJsonConfigFile(additionalFileName, workspacePath);
385673
+ if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
385674
+ break;
385675
+ }
385676
+ cosmiconfigResult = await getConfigFileByName(additionalFileName, workspacePath);
385677
+ if (cosmiconfigResult && !cosmiconfigResult.isEmpty) {
385678
+ break;
385680
385679
  }
385681
385680
  }
385682
385681
  }
@@ -385842,7 +385841,7 @@ var init_get_log_level = __esm({
385842
385841
  return LogLevel.INFO;
385843
385842
  }
385844
385843
  };
385845
- getLogLevelLabel = (logLevel) => {
385844
+ getLogLevelLabel = (logLevel = LogLevel.INFO) => {
385846
385845
  if (logLevel >= LogLevel.ALL) {
385847
385846
  return LogLevelLabel.ALL;
385848
385847
  }
@@ -386168,14 +386167,14 @@ var init_set_env = __esm({
386168
386167
  if (extension[key2]) {
386169
386168
  const result = key2?.replace(
386170
386169
  /([A-Z])+/g,
386171
- (input) => input ? input[0].toUpperCase() + input.slice(1) : ""
386170
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
386172
386171
  ).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
386173
386172
  let extensionKey;
386174
386173
  if (result.length === 0) {
386175
386174
  return;
386176
386175
  }
386177
386176
  if (result.length === 1) {
386178
- extensionKey = result[0].toUpperCase();
386177
+ extensionKey = result[0]?.toUpperCase() ?? "";
386179
386178
  } else {
386180
386179
  extensionKey = result.reduce((ret, part) => {
386181
386180
  return `${ret}_${part.toLowerCase()}`;
@@ -387499,7 +387498,7 @@ var applyWorkspaceGeneratorTokens = (option, tokenizerOptions) => {
387499
387498
  if (result.includes("{workspaceRoot}")) {
387500
387499
  result = result.replaceAll(
387501
387500
  "{workspaceRoot}",
387502
- tokenizerOptions.workspaceRoot ?? tokenizerOptions.config.workspaceRoot ?? findWorkspaceRootSafe()
387501
+ tokenizerOptions.workspaceRoot ?? tokenizerOptions.config?.workspaceRoot ?? findWorkspaceRoot()
387503
387502
  );
387504
387503
  }
387505
387504
  return result;
@@ -387560,7 +387559,7 @@ ${Object.keys(process.env).map((key2) => ` - ${key2}=${JSON.stringify(process.en
387560
387559
  writeTrace(
387561
387560
  config,
387562
387561
  `Generator schema options \u2699\uFE0F
387563
- ${Object.keys(options8).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
387562
+ ${Object.keys(options8 ?? {}).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2])}`).join("\n")}`
387564
387563
  );
387565
387564
  const tokenized = applyWorkspaceTokens(
387566
387565
  options8,
@@ -387611,15 +387610,17 @@ ${Object.keys(options8).map((key2) => ` - ${key2}=${JSON.stringify(options8[key2
387611
387610
  // packages/workspace-tools/src/utils/get-project-configurations.ts
387612
387611
  var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
387613
387612
  init_src2();
387614
- var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRootSafe());
387613
+ var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
387615
387614
 
387616
387615
  // packages/workspace-tools/src/generators/config-schema/generator.ts
387616
+ init_src2();
387617
387617
  async function configSchemaGeneratorFn(tree, options8, config) {
387618
387618
  const projectConfigurations = getProjectConfigurations();
387619
+ const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
387619
387620
  const modules = await Promise.all(
387620
387621
  Object.keys(projectConfigurations).map(async (key2) => {
387621
387622
  if (projectConfigurations[key2]?.config) {
387622
- const configPath = (0, import_node_path4.join)(config?.workspaceRoot, projectConfigurations[key2].config);
387623
+ const configPath = (0, import_node_path4.join)(workspaceRoot, projectConfigurations[key2].config);
387623
387624
  if ((0, import_node_fs3.existsSync)(configPath)) {
387624
387625
  const mod = await import(configPath);
387625
387626
  if (mod.default) {
@@ -387645,7 +387646,7 @@ async function configSchemaGeneratorFn(tree, options8, config) {
387645
387646
  );
387646
387647
  (0, import_devkit.writeJson)(
387647
387648
  tree,
387648
- options8.outputFile ? (0, import_node_path4.join)(config?.workspaceRoot, options8.outputFile) : (0, import_node_path4.join)(config?.workspaceRoot, "storm.schema.json"),
387649
+ options8.outputFile ? (0, import_node_path4.join)(workspaceRoot, options8.outputFile) : (0, import_node_path4.join)(workspaceRoot, "storm.schema.json"),
387649
387650
  zodToJsonSchema(ModulesSchema, "StormConfig")
387650
387651
  );
387651
387652
  await (0, import_devkit.formatFiles)(tree);