@storm-software/workspace-tools 1.60.23 → 1.61.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.
@@ -215471,7 +215471,7 @@ var init_get_log_level = __esm({
215471
215471
  return LogLevel.INFO;
215472
215472
  }
215473
215473
  };
215474
- getLogLevelLabel = (logLevel) => {
215474
+ getLogLevelLabel = (logLevel = LogLevel.INFO) => {
215475
215475
  if (logLevel >= LogLevel.ALL) {
215476
215476
  return LogLevelLabel.ALL;
215477
215477
  }
@@ -215797,14 +215797,14 @@ var init_set_env = __esm({
215797
215797
  if (extension[key2]) {
215798
215798
  const result = key2?.replace(
215799
215799
  /([A-Z])+/g,
215800
- (input) => input ? input[0].toUpperCase() + input.slice(1) : ""
215800
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
215801
215801
  ).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
215802
215802
  let extensionKey;
215803
215803
  if (result.length === 0) {
215804
215804
  return;
215805
215805
  }
215806
215806
  if (result.length === 1) {
215807
- extensionKey = result[0].toUpperCase();
215807
+ extensionKey = result[0]?.toUpperCase() ?? "";
215808
215808
  } else {
215809
215809
  extensionKey = result.reduce((ret, part) => {
215810
215810
  return `${ret}_${part.toLowerCase()}`;
@@ -456087,9 +456087,13 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
456087
456087
  sourceRoot = context.sourceRoot;
456088
456088
  } else {
456089
456089
  const projectConfig = tokenizerOptions;
456090
- projectName = projectConfig.name;
456091
456090
  projectRoot = projectConfig.root;
456092
- sourceRoot = projectConfig.sourceRoot;
456091
+ if (projectConfig.name) {
456092
+ projectName = projectConfig.name;
456093
+ }
456094
+ if (projectConfig.sourceRoot) {
456095
+ sourceRoot = projectConfig.sourceRoot;
456096
+ }
456093
456097
  }
456094
456098
  if (tokenizerOptions.config) {
456095
456099
  const configKeys = Object.keys(tokenizerOptions.config);
@@ -456113,7 +456117,7 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
456113
456117
  if (result.includes("{workspaceRoot}")) {
456114
456118
  result = result.replaceAll(
456115
456119
  "{workspaceRoot}",
456116
- tokenizerOptions.workspaceRoot ?? findWorkspaceRootSafe()
456120
+ tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
456117
456121
  );
456118
456122
  }
456119
456123
  return result;
@@ -456138,7 +456142,6 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
456138
456142
  };
456139
456143
 
456140
456144
  // packages/workspace-tools/src/base/base-executor.ts
456141
- init_src2();
456142
456145
  var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
456143
456146
  const stopwatch = getStopwatch(name);
456144
456147
  let options8 = _options;
@@ -456151,10 +456154,10 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
456151
456154
  "The Build process failed because the context is not valid. Please run this command from a workspace."
456152
456155
  );
456153
456156
  }
456154
- const workspaceRoot = findWorkspaceRootSafe();
456155
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
456156
- const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
456157
- const projectName = context.projectsConfigurations.projects[context.projectName].name;
456157
+ const workspaceRoot = findWorkspaceRoot();
456158
+ const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
456159
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
456160
+ const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
456158
456161
  if (!executorOptions.skipReadingConfig) {
456159
456162
  const { loadStormConfig: loadStormConfig2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
456160
456163
  writeDebug(
@@ -456439,7 +456442,7 @@ var outExtension = ({ format: format3 }) => {
456439
456442
 
456440
456443
  // packages/workspace-tools/src/utils/file-path-utils.ts
456441
456444
  var removeExtension = (filePath) => {
456442
- return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
456445
+ return !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
456443
456446
  };
456444
456447
 
456445
456448
  // packages/workspace-tools/src/utils/run-tsup-build.ts
@@ -456477,17 +456480,17 @@ var applyDefaultOptions = (options8) => {
456477
456480
  return options8;
456478
456481
  };
456479
456482
  var runTsupBuild = async (context, config, options8) => {
456480
- const stormEnv = Object.keys(options8.env).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
456481
- ret[key2] = options8.env[key2];
456483
+ const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
456484
+ ret[key2] = options8.env?.[key2];
456482
456485
  return ret;
456483
456486
  }, {});
456484
- options8.plugins.push(
456487
+ options8.plugins?.push(
456485
456488
  (0, import_esbuild_decorators.esbuildDecorators)({
456486
456489
  tsconfig: options8.tsConfig,
456487
456490
  cwd: config.workspaceRoot
456488
456491
  })
456489
456492
  );
456490
- options8.plugins.push(environmentPlugin(stormEnv));
456493
+ options8.plugins?.push(environmentPlugin(stormEnv));
456491
456494
  const getConfigOptions = {
456492
456495
  ...options8,
456493
456496
  main: context.main,
@@ -456505,7 +456508,7 @@ var runTsupBuild = async (context, config, options8) => {
456505
456508
  },
456506
456509
  dtsTsConfig: getNormalizedTsConfig(
456507
456510
  context,
456508
- config.workspaceRoot,
456511
+ config.workspaceRoot ?? ".",
456509
456512
  options8.outputPath,
456510
456513
  createTypeScriptCompilationOptions(
456511
456514
  (0, import_normalize_options.normalizeOptions)(
@@ -456515,9 +456518,9 @@ var runTsupBuild = async (context, config, options8) => {
456515
456518
  main: context.main,
456516
456519
  transformers: []
456517
456520
  },
456518
- config.workspaceRoot,
456521
+ config.workspaceRoot ?? ".",
456519
456522
  context.sourceRoot,
456520
- config.workspaceRoot
456523
+ config.workspaceRoot ?? "."
456521
456524
  ),
456522
456525
  context.projectName
456523
456526
  )
@@ -456540,7 +456543,7 @@ ${options8.banner}
456540
456543
  const getConfigFns = [options8.getConfig];
456541
456544
  const tsupConfig = (0, import_tsup.defineConfig)(
456542
456545
  getConfigFns.map(
456543
- (getConfigFn) => getConfig(config.workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
456546
+ (getConfigFn) => getConfig(config.workspaceRoot ?? ".", context.projectRoot, getConfigFn, getConfigOptions)
456544
456547
  )
456545
456548
  );
456546
456549
  if (_isFunction2(tsupConfig)) {
@@ -456549,7 +456552,7 @@ ${options8.banner}
456549
456552
  } else {
456550
456553
  await build(tsupConfig, config);
456551
456554
  }
456552
- } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
456555
+ } else if (getLogLevel(config?.logLevel ?? "debug") >= LogLevel.WARN) {
456553
456556
  writeWarning(
456554
456557
  config,
456555
456558
  "The Build process did not run because no `getConfig` parameter was provided"
@@ -462821,7 +462824,7 @@ var import_fileutils = require("nx/src/utils/fileutils.js");
462821
462824
  // packages/workspace-tools/src/utils/get-project-configurations.ts
462822
462825
  var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
462823
462826
  init_src2();
462824
- var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRootSafe());
462827
+ var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
462825
462828
 
462826
462829
  // packages/workspace-tools/src/utils/get-project-deps.ts
462827
462830
  function getExtraDependencies(projectName, graph) {
@@ -462829,18 +462832,19 @@ function getExtraDependencies(projectName, graph) {
462829
462832
  recur(projectName);
462830
462833
  function recur(currProjectName) {
462831
462834
  const allDeps = graph.dependencies[currProjectName];
462832
- const externalDeps = allDeps.reduce((acc, node) => {
462833
- const found = graph.externalNodes[node.target];
462834
- if (found)
462835
+ const externalDeps = allDeps?.reduce((acc, node) => {
462836
+ const found = graph.externalNodes?.[node.target];
462837
+ if (found) {
462835
462838
  acc.push(found);
462839
+ }
462836
462840
  return acc;
462837
- }, []);
462838
- const internalDeps = allDeps.reduce((acc, node) => {
462841
+ }, []) ?? [];
462842
+ const internalDeps = allDeps?.reduce((acc, node) => {
462839
462843
  const found = graph.nodes[node.target];
462840
462844
  if (found)
462841
462845
  acc.push(found);
462842
462846
  return acc;
462843
- }, []);
462847
+ }, []) ?? [];
462844
462848
  for (const externalDep of externalDeps) {
462845
462849
  deps.set(externalDep.name, {
462846
462850
  name: externalDep.name,
@@ -462856,7 +462860,6 @@ function getExtraDependencies(projectName, graph) {
462856
462860
  }
462857
462861
 
462858
462862
  // packages/workspace-tools/src/executors/tsup/executor.ts
462859
- init_src2();
462860
462863
  async function tsupExecutorFn(options8, context, config) {
462861
462864
  writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
462862
462865
  getLogLevel(config?.logLevel) >= LogLevel.TRACE && writeDebug(
@@ -462872,9 +462875,9 @@ ${Object.keys(options8).map(
462872
462875
  "The Build process failed because the context is not valid. Please run this command from a workspace."
462873
462876
  );
462874
462877
  }
462875
- const workspaceRoot = findWorkspaceRootSafe();
462876
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
462877
- const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
462878
+ const workspaceRoot = findWorkspaceRoot();
462879
+ const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
462880
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
462878
462881
  if (options8.clean !== false) {
462879
462882
  writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
462880
462883
  (0, import_fs_extra.removeSync)(options8.outputPath);
@@ -462929,7 +462932,7 @@ ${Object.keys(options8).map(
462929
462932
  const externalDependencies = options8.external.reduce(
462930
462933
  (ret, name) => {
462931
462934
  if (!packageJson?.devDependencies?.[name]) {
462932
- const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
462935
+ const externalNode = context.projectGraph?.externalNodes?.[`npm:${name}`];
462933
462936
  if (externalNode) {
462934
462937
  ret.push({
462935
462938
  name,
@@ -462942,7 +462945,7 @@ ${Object.keys(options8).map(
462942
462945
  },
462943
462946
  []
462944
462947
  );
462945
- const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
462948
+ const implicitDependencies = context.projectsConfigurations.projects[context.projectName]?.implicitDependencies;
462946
462949
  const internalDependencies = [];
462947
462950
  const projectConfigs = await Promise.resolve(getProjectConfigurations());
462948
462951
  if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
@@ -462955,7 +462958,7 @@ ${Object.keys(options8).map(
462955
462958
  const projectConfig = projectConfigs[key2];
462956
462959
  if (projectConfig?.targets?.build) {
462957
462960
  const projectPackageJson = (0, import_devkit3.readJsonFile)(projectConfig.targets?.build.options.project);
462958
- if (projectPackageJson?.name && !options8.external.includes(projectPackageJson.name)) {
462961
+ if (projectPackageJson?.name && !options8.external?.includes(projectPackageJson.name)) {
462959
462962
  ret.push(projectPackageJson.name);
462960
462963
  internalDependencies.push(projectPackageJson.name);
462961
462964
  }
@@ -463023,7 +463026,7 @@ ${externalDependencies.map((dep) => {
463023
463026
  packageJson.dependencies = void 0;
463024
463027
  for (const externalDependency of externalDependencies) {
463025
463028
  const packageConfig = externalDependency?.node?.data;
463026
- if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
463029
+ if (packageConfig?.packageName && !!(projectGraph.externalNodes?.[externalDependency.node.name]?.type === "npm")) {
463027
463030
  const { packageName, version } = packageConfig;
463028
463031
  if (!workspacePackageJson.dependencies?.[packageName] && !workspacePackageJson.devDependencies?.[packageName] && !packageJson?.devDependencies?.[packageName]) {
463029
463032
  packageJson.dependencies ??= {};
@@ -463071,16 +463074,16 @@ ${externalDependencies.map((dep) => {
463071
463074
  }
463072
463075
  packageJson.exports[`./${formattedEntryPoint}`] = {
463073
463076
  import: {
463074
- types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
463075
- default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
463077
+ types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
463078
+ default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
463076
463079
  },
463077
463080
  require: {
463078
- types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.cts`,
463079
- default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.cjs`
463081
+ types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.cts`,
463082
+ default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.cjs`
463080
463083
  },
463081
463084
  default: {
463082
- types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
463083
- default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
463085
+ types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
463086
+ default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
463084
463087
  }
463085
463088
  };
463086
463089
  }
@@ -463130,10 +463133,10 @@ ${externalDependencies.map((dep) => {
463130
463133
  }
463131
463134
  if (options8.includeSrc === true) {
463132
463135
  const files = globSync([
463133
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.ts"),
463134
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.tsx"),
463135
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.js"),
463136
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.jsx")
463136
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.ts"),
463137
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.tsx"),
463138
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.js"),
463139
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.jsx")
463137
463140
  ]);
463138
463141
  await Promise.allSettled(
463139
463142
  files.map(
@@ -463153,10 +463156,11 @@ ${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
463153
463156
  {
463154
463157
  main: entryPoint,
463155
463158
  projectRoot,
463159
+ // biome-ignore lint/style/noNonNullAssertion: <explanation>
463156
463160
  projectName: context.projectName,
463157
463161
  sourceRoot
463158
463162
  },
463159
- config,
463163
+ config ?? {},
463160
463164
  options8
463161
463165
  )
463162
463166
  )
@@ -215471,7 +215471,7 @@ var init_get_log_level = __esm({
215471
215471
  return LogLevel.INFO;
215472
215472
  }
215473
215473
  };
215474
- getLogLevelLabel = (logLevel) => {
215474
+ getLogLevelLabel = (logLevel = LogLevel.INFO) => {
215475
215475
  if (logLevel >= LogLevel.ALL) {
215476
215476
  return LogLevelLabel.ALL;
215477
215477
  }
@@ -215797,14 +215797,14 @@ var init_set_env = __esm({
215797
215797
  if (extension[key2]) {
215798
215798
  const result = key2?.replace(
215799
215799
  /([A-Z])+/g,
215800
- (input) => input ? input[0].toUpperCase() + input.slice(1) : ""
215800
+ (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
215801
215801
  ).split(/(?=[A-Z])|[\.\-\s_]/).map((x5) => x5.toLowerCase()) ?? [];
215802
215802
  let extensionKey;
215803
215803
  if (result.length === 0) {
215804
215804
  return;
215805
215805
  }
215806
215806
  if (result.length === 1) {
215807
- extensionKey = result[0].toUpperCase();
215807
+ extensionKey = result[0]?.toUpperCase() ?? "";
215808
215808
  } else {
215809
215809
  extensionKey = result.reduce((ret, part) => {
215810
215810
  return `${ret}_${part.toLowerCase()}`;
@@ -456087,9 +456087,13 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
456087
456087
  sourceRoot = context.sourceRoot;
456088
456088
  } else {
456089
456089
  const projectConfig = tokenizerOptions;
456090
- projectName = projectConfig.name;
456091
456090
  projectRoot = projectConfig.root;
456092
- sourceRoot = projectConfig.sourceRoot;
456091
+ if (projectConfig.name) {
456092
+ projectName = projectConfig.name;
456093
+ }
456094
+ if (projectConfig.sourceRoot) {
456095
+ sourceRoot = projectConfig.sourceRoot;
456096
+ }
456093
456097
  }
456094
456098
  if (tokenizerOptions.config) {
456095
456099
  const configKeys = Object.keys(tokenizerOptions.config);
@@ -456113,7 +456117,7 @@ var applyWorkspaceExecutorTokens = (option, tokenizerOptions) => {
456113
456117
  if (result.includes("{workspaceRoot}")) {
456114
456118
  result = result.replaceAll(
456115
456119
  "{workspaceRoot}",
456116
- tokenizerOptions.workspaceRoot ?? findWorkspaceRootSafe()
456120
+ tokenizerOptions.workspaceRoot ?? findWorkspaceRoot()
456117
456121
  );
456118
456122
  }
456119
456123
  return result;
@@ -456138,7 +456142,6 @@ var applyWorkspaceTokens = (options8, config, tokenizerFn) => {
456138
456142
  };
456139
456143
 
456140
456144
  // packages/workspace-tools/src/base/base-executor.ts
456141
- init_src2();
456142
456145
  var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
456143
456146
  const stopwatch = getStopwatch(name);
456144
456147
  let options8 = _options;
@@ -456151,10 +456154,10 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
456151
456154
  "The Build process failed because the context is not valid. Please run this command from a workspace."
456152
456155
  );
456153
456156
  }
456154
- const workspaceRoot = findWorkspaceRootSafe();
456155
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
456156
- const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
456157
- const projectName = context.projectsConfigurations.projects[context.projectName].name;
456157
+ const workspaceRoot = findWorkspaceRoot();
456158
+ const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
456159
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
456160
+ const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
456158
456161
  if (!executorOptions.skipReadingConfig) {
456159
456162
  const { loadStormConfig: loadStormConfig2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
456160
456163
  writeDebug(
@@ -456439,7 +456442,7 @@ var outExtension = ({ format: format3 }) => {
456439
456442
 
456440
456443
  // packages/workspace-tools/src/utils/file-path-utils.ts
456441
456444
  var removeExtension = (filePath) => {
456442
- return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
456445
+ return !filePath || (filePath.match(/./g) || []).length <= 1 ? "." : filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
456443
456446
  };
456444
456447
 
456445
456448
  // packages/workspace-tools/src/utils/run-tsup-build.ts
@@ -456477,17 +456480,17 @@ var applyDefaultOptions = (options8) => {
456477
456480
  return options8;
456478
456481
  };
456479
456482
  var runTsupBuild = async (context, config, options8) => {
456480
- const stormEnv = Object.keys(options8.env).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
456481
- ret[key2] = options8.env[key2];
456483
+ const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
456484
+ ret[key2] = options8.env?.[key2];
456482
456485
  return ret;
456483
456486
  }, {});
456484
- options8.plugins.push(
456487
+ options8.plugins?.push(
456485
456488
  (0, import_esbuild_decorators.esbuildDecorators)({
456486
456489
  tsconfig: options8.tsConfig,
456487
456490
  cwd: config.workspaceRoot
456488
456491
  })
456489
456492
  );
456490
- options8.plugins.push(environmentPlugin(stormEnv));
456493
+ options8.plugins?.push(environmentPlugin(stormEnv));
456491
456494
  const getConfigOptions = {
456492
456495
  ...options8,
456493
456496
  main: context.main,
@@ -456505,7 +456508,7 @@ var runTsupBuild = async (context, config, options8) => {
456505
456508
  },
456506
456509
  dtsTsConfig: getNormalizedTsConfig(
456507
456510
  context,
456508
- config.workspaceRoot,
456511
+ config.workspaceRoot ?? ".",
456509
456512
  options8.outputPath,
456510
456513
  createTypeScriptCompilationOptions(
456511
456514
  (0, import_normalize_options.normalizeOptions)(
@@ -456515,9 +456518,9 @@ var runTsupBuild = async (context, config, options8) => {
456515
456518
  main: context.main,
456516
456519
  transformers: []
456517
456520
  },
456518
- config.workspaceRoot,
456521
+ config.workspaceRoot ?? ".",
456519
456522
  context.sourceRoot,
456520
- config.workspaceRoot
456523
+ config.workspaceRoot ?? "."
456521
456524
  ),
456522
456525
  context.projectName
456523
456526
  )
@@ -456540,7 +456543,7 @@ ${options8.banner}
456540
456543
  const getConfigFns = [options8.getConfig];
456541
456544
  const tsupConfig = (0, import_tsup.defineConfig)(
456542
456545
  getConfigFns.map(
456543
- (getConfigFn) => getConfig(config.workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
456546
+ (getConfigFn) => getConfig(config.workspaceRoot ?? ".", context.projectRoot, getConfigFn, getConfigOptions)
456544
456547
  )
456545
456548
  );
456546
456549
  if (_isFunction2(tsupConfig)) {
@@ -456549,7 +456552,7 @@ ${options8.banner}
456549
456552
  } else {
456550
456553
  await build(tsupConfig, config);
456551
456554
  }
456552
- } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
456555
+ } else if (getLogLevel(config?.logLevel ?? "debug") >= LogLevel.WARN) {
456553
456556
  writeWarning(
456554
456557
  config,
456555
456558
  "The Build process did not run because no `getConfig` parameter was provided"
@@ -462821,7 +462824,7 @@ var import_fileutils = require("nx/src/utils/fileutils.js");
462821
462824
  // packages/workspace-tools/src/utils/get-project-configurations.ts
462822
462825
  var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
462823
462826
  init_src2();
462824
- var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRootSafe());
462827
+ var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(findWorkspaceRoot());
462825
462828
 
462826
462829
  // packages/workspace-tools/src/utils/get-project-deps.ts
462827
462830
  function getExtraDependencies(projectName, graph) {
@@ -462829,18 +462832,19 @@ function getExtraDependencies(projectName, graph) {
462829
462832
  recur(projectName);
462830
462833
  function recur(currProjectName) {
462831
462834
  const allDeps = graph.dependencies[currProjectName];
462832
- const externalDeps = allDeps.reduce((acc, node) => {
462833
- const found = graph.externalNodes[node.target];
462834
- if (found)
462835
+ const externalDeps = allDeps?.reduce((acc, node) => {
462836
+ const found = graph.externalNodes?.[node.target];
462837
+ if (found) {
462835
462838
  acc.push(found);
462839
+ }
462836
462840
  return acc;
462837
- }, []);
462838
- const internalDeps = allDeps.reduce((acc, node) => {
462841
+ }, []) ?? [];
462842
+ const internalDeps = allDeps?.reduce((acc, node) => {
462839
462843
  const found = graph.nodes[node.target];
462840
462844
  if (found)
462841
462845
  acc.push(found);
462842
462846
  return acc;
462843
- }, []);
462847
+ }, []) ?? [];
462844
462848
  for (const externalDep of externalDeps) {
462845
462849
  deps.set(externalDep.name, {
462846
462850
  name: externalDep.name,
@@ -462856,7 +462860,6 @@ function getExtraDependencies(projectName, graph) {
462856
462860
  }
462857
462861
 
462858
462862
  // packages/workspace-tools/src/executors/tsup/executor.ts
462859
- init_src2();
462860
462863
  async function tsupExecutorFn(options8, context, config) {
462861
462864
  writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
462862
462865
  getLogLevel(config?.logLevel) >= LogLevel.TRACE && writeDebug(
@@ -462872,9 +462875,9 @@ ${Object.keys(options8).map(
462872
462875
  "The Build process failed because the context is not valid. Please run this command from a workspace."
462873
462876
  );
462874
462877
  }
462875
- const workspaceRoot = findWorkspaceRootSafe();
462876
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
462877
- const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
462878
+ const workspaceRoot = findWorkspaceRoot();
462879
+ const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ?? workspaceRoot;
462880
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? workspaceRoot;
462878
462881
  if (options8.clean !== false) {
462879
462882
  writeInfo(config, `\u{1F9F9} Cleaning output path: ${options8.outputPath}`);
462880
462883
  (0, import_fs_extra.removeSync)(options8.outputPath);
@@ -462929,7 +462932,7 @@ ${Object.keys(options8).map(
462929
462932
  const externalDependencies = options8.external.reduce(
462930
462933
  (ret, name) => {
462931
462934
  if (!packageJson?.devDependencies?.[name]) {
462932
- const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
462935
+ const externalNode = context.projectGraph?.externalNodes?.[`npm:${name}`];
462933
462936
  if (externalNode) {
462934
462937
  ret.push({
462935
462938
  name,
@@ -462942,7 +462945,7 @@ ${Object.keys(options8).map(
462942
462945
  },
462943
462946
  []
462944
462947
  );
462945
- const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
462948
+ const implicitDependencies = context.projectsConfigurations.projects[context.projectName]?.implicitDependencies;
462946
462949
  const internalDependencies = [];
462947
462950
  const projectConfigs = await Promise.resolve(getProjectConfigurations());
462948
462951
  if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
@@ -462955,7 +462958,7 @@ ${Object.keys(options8).map(
462955
462958
  const projectConfig = projectConfigs[key2];
462956
462959
  if (projectConfig?.targets?.build) {
462957
462960
  const projectPackageJson = (0, import_devkit3.readJsonFile)(projectConfig.targets?.build.options.project);
462958
- if (projectPackageJson?.name && !options8.external.includes(projectPackageJson.name)) {
462961
+ if (projectPackageJson?.name && !options8.external?.includes(projectPackageJson.name)) {
462959
462962
  ret.push(projectPackageJson.name);
462960
462963
  internalDependencies.push(projectPackageJson.name);
462961
462964
  }
@@ -463023,7 +463026,7 @@ ${externalDependencies.map((dep) => {
463023
463026
  packageJson.dependencies = void 0;
463024
463027
  for (const externalDependency of externalDependencies) {
463025
463028
  const packageConfig = externalDependency?.node?.data;
463026
- if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
463029
+ if (packageConfig?.packageName && !!(projectGraph.externalNodes?.[externalDependency.node.name]?.type === "npm")) {
463027
463030
  const { packageName, version } = packageConfig;
463028
463031
  if (!workspacePackageJson.dependencies?.[packageName] && !workspacePackageJson.devDependencies?.[packageName] && !packageJson?.devDependencies?.[packageName]) {
463029
463032
  packageJson.dependencies ??= {};
@@ -463071,16 +463074,16 @@ ${externalDependencies.map((dep) => {
463071
463074
  }
463072
463075
  packageJson.exports[`./${formattedEntryPoint}`] = {
463073
463076
  import: {
463074
- types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
463075
- default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
463077
+ types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
463078
+ default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
463076
463079
  },
463077
463080
  require: {
463078
- types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.cts`,
463079
- default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.cjs`
463081
+ types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.cts`,
463082
+ default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.cjs`
463080
463083
  },
463081
463084
  default: {
463082
- types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.d.ts`,
463083
- default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0], formattedEntryPoint)}.js`
463085
+ types: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
463086
+ default: `./${(0, import_devkit3.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
463084
463087
  }
463085
463088
  };
463086
463089
  }
@@ -463130,10 +463133,10 @@ ${externalDependencies.map((dep) => {
463130
463133
  }
463131
463134
  if (options8.includeSrc === true) {
463132
463135
  const files = globSync([
463133
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.ts"),
463134
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.tsx"),
463135
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.js"),
463136
- (0, import_devkit3.joinPathFragments)(config.workspaceRoot, options8.outputPath, "src/**/*.jsx")
463136
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.ts"),
463137
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.tsx"),
463138
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.js"),
463139
+ (0, import_devkit3.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.jsx")
463137
463140
  ]);
463138
463141
  await Promise.allSettled(
463139
463142
  files.map(
@@ -463153,10 +463156,11 @@ ${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
463153
463156
  {
463154
463157
  main: entryPoint,
463155
463158
  projectRoot,
463159
+ // biome-ignore lint/style/noNonNullAssertion: <explanation>
463156
463160
  projectName: context.projectName,
463157
463161
  sourceRoot
463158
463162
  },
463159
- config,
463163
+ config ?? {},
463160
463164
  options8
463161
463165
  )
463162
463166
  )