nx 20.5.0-canary.20250208-c0fd00d → 20.5.0-canary.20250211-9672949

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.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{69552:()=>{}},s=>{var e;e=69552,s(s.s=e)}]);
1
+ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{92784:()=>{}},s=>{var e;e=92784,s(s.s=e)}]);
Binary file
@@ -216,7 +216,10 @@ class AggregateCreateNodesError extends Error {
216
216
  exports.AggregateCreateNodesError = AggregateCreateNodesError;
217
217
  function formatAggregateCreateNodesError(error, pluginName) {
218
218
  const errorBodyLines = [
219
- `${error.errors.length > 1 ? `${error.errors.length} errors` : 'An error'} occurred while processing files for the ${pluginName} plugin.`,
219
+ `${error.errors.length > 1 ? `${error.errors.length} errors` : 'An error'} occurred while processing files for the ${pluginName} plugin${error.pluginIndex
220
+ ? ` (Defined at nx.json#plugins[${error.pluginIndex}])`
221
+ : ''}`,
222
+ `.`,
220
223
  ];
221
224
  const errorStackLines = [];
222
225
  const innerErrors = error.errors;
@@ -108,12 +108,13 @@ async function loadSpecifiedNxPlugins(plugins, root = workspace_root_1.workspace
108
108
  plugins ??= [];
109
109
  const cleanupFunctions = [];
110
110
  const ret = [
111
- await Promise.all(plugins.map(async (plugin) => {
111
+ await Promise.all(plugins.map(async (plugin, index) => {
112
112
  const pluginPath = typeof plugin === 'string' ? plugin : plugin.plugin;
113
113
  performance.mark(`Load Nx Plugin: ${pluginPath} - start`);
114
114
  const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root);
115
115
  cleanupFunctions.push(cleanup);
116
116
  const res = await loadedPluginPromise;
117
+ res.index = index;
117
118
  performance.mark(`Load Nx Plugin: ${pluginPath} - end`);
118
119
  performance.measure(`Load Nx Plugin: ${pluginPath}`, `Load Nx Plugin: ${pluginPath} - start`, `Load Nx Plugin: ${pluginPath} - end`);
119
120
  return res;
@@ -3,6 +3,7 @@ import type { PluginConfiguration } from '../../config/nx-json';
3
3
  import type { RawProjectGraphDependency } from '../project-graph-builder';
4
4
  import type { CreateDependenciesContext, CreateMetadataContext, CreateNodesContextV2, CreateNodesResult, NxPluginV2, PostTasksExecutionContext, PreTasksExecutionContext, ProjectsMetadata } from './public-api';
5
5
  export declare class LoadedNxPlugin {
6
+ index?: number;
6
7
  readonly name: string;
7
8
  readonly createNodes?: [
8
9
  filePattern: string,
@@ -248,7 +248,7 @@ plugins) {
248
248
  const results = [];
249
249
  const errors = [];
250
250
  // We iterate over plugins first - this ensures that plugins specified first take precedence.
251
- for (const [index, { createNodes: createNodesTuple, include, exclude, name: pluginName },] of plugins.entries()) {
251
+ for (const [index, { index: pluginIndex, createNodes: createNodesTuple, include, exclude, name: pluginName, },] of plugins.entries()) {
252
252
  const [pattern, createNodes] = createNodesTuple ?? [];
253
253
  if (!pattern) {
254
254
  continue;
@@ -265,8 +265,10 @@ plugins) {
265
265
  e
266
266
  : // This represents a single plugin erroring out with a hard error.
267
267
  new error_types_1.AggregateCreateNodesError([[null, e]], []);
268
+ if (pluginIndex) {
269
+ error.pluginIndex = pluginIndex;
270
+ }
268
271
  (0, error_types_1.formatAggregateCreateNodesError)(error, pluginName);
269
- error.pluginIndex = index;
270
272
  // This represents a single plugin erroring out with a hard error.
271
273
  errors.push(error);
272
274
  // The plugin didn't return partial results, so we return an empty array.
@@ -309,7 +311,7 @@ function mergeCreateNodesResults(results, nxJsonConfiguration, errors) {
309
311
  const externalNodes = {};
310
312
  const configurationSourceMaps = {};
311
313
  for (const result of results.flat()) {
312
- const [pluginName, file, nodes, index] = result;
314
+ const [pluginName, file, nodes, pluginIndex] = result;
313
315
  const { projects: projectNodes, externalNodes: pluginExternalNodes } = nodes;
314
316
  const sourceInfo = [file, pluginName];
315
317
  for (const node in projectNodes) {
@@ -329,7 +331,7 @@ function mergeCreateNodesResults(results, nxJsonConfiguration, errors) {
329
331
  file,
330
332
  pluginName,
331
333
  error,
332
- pluginIndex: index,
334
+ pluginIndex,
333
335
  }));
334
336
  }
335
337
  }
@@ -44,7 +44,7 @@ async function retrieveProjectConfigurations(plugins, workspaceRoot, nxJson) {
44
44
  const pluginsWithCreateNodes = plugins.filter((p) => !!p.createNodes);
45
45
  const globPatterns = getGlobPatternsOfPlugins(pluginsWithCreateNodes);
46
46
  const pluginConfigFiles = await (0, workspace_context_1.multiGlobWithWorkspaceContext)(workspaceRoot, globPatterns);
47
- return (0, project_configuration_utils_1.createProjectConfigurationsWithPlugins)(workspaceRoot, nxJson, pluginConfigFiles, plugins);
47
+ return (0, project_configuration_utils_1.createProjectConfigurationsWithPlugins)(workspaceRoot, nxJson, pluginConfigFiles, pluginsWithCreateNodes);
48
48
  }
49
49
  async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, nxJson) {
50
50
  const pluginsToLoad = nxJson?.plugins ?? [];