nx 21.2.0-canary.20250530-b51676a → 21.2.0-canary.20250603-88c5196

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": "nx",
3
- "version": "21.2.0-canary.20250530-b51676a",
3
+ "version": "21.2.0-canary.20250603-88c5196",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -83,16 +83,16 @@
83
83
  }
84
84
  },
85
85
  "optionalDependencies": {
86
- "@nx/nx-darwin-arm64": "21.2.0-canary.20250530-b51676a",
87
- "@nx/nx-darwin-x64": "21.2.0-canary.20250530-b51676a",
88
- "@nx/nx-freebsd-x64": "21.2.0-canary.20250530-b51676a",
89
- "@nx/nx-linux-arm-gnueabihf": "21.2.0-canary.20250530-b51676a",
90
- "@nx/nx-linux-arm64-gnu": "21.2.0-canary.20250530-b51676a",
91
- "@nx/nx-linux-arm64-musl": "21.2.0-canary.20250530-b51676a",
92
- "@nx/nx-linux-x64-gnu": "21.2.0-canary.20250530-b51676a",
93
- "@nx/nx-linux-x64-musl": "21.2.0-canary.20250530-b51676a",
94
- "@nx/nx-win32-arm64-msvc": "21.2.0-canary.20250530-b51676a",
95
- "@nx/nx-win32-x64-msvc": "21.2.0-canary.20250530-b51676a"
86
+ "@nx/nx-darwin-arm64": "21.2.0-canary.20250603-88c5196",
87
+ "@nx/nx-darwin-x64": "21.2.0-canary.20250603-88c5196",
88
+ "@nx/nx-freebsd-x64": "21.2.0-canary.20250603-88c5196",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.2.0-canary.20250603-88c5196",
90
+ "@nx/nx-linux-arm64-gnu": "21.2.0-canary.20250603-88c5196",
91
+ "@nx/nx-linux-arm64-musl": "21.2.0-canary.20250603-88c5196",
92
+ "@nx/nx-linux-x64-gnu": "21.2.0-canary.20250603-88c5196",
93
+ "@nx/nx-linux-x64-musl": "21.2.0-canary.20250603-88c5196",
94
+ "@nx/nx-win32-arm64-msvc": "21.2.0-canary.20250603-88c5196",
95
+ "@nx/nx-win32-x64-msvc": "21.2.0-canary.20250603-88c5196"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -6,7 +6,7 @@ const documentation_1 = require("../yargs-utils/documentation");
6
6
  const shared_options_1 = require("../yargs-utils/shared-options");
7
7
  exports.yargsAffectedCommand = {
8
8
  command: 'affected',
9
- describe: 'Run target for affected projects. See https://nx.dev/ci/features/affected for more details.',
9
+ describe: 'Run target for affected projects. Affected projects are projects that have been changed and projects that depend on the changed projects. See https://nx.dev/ci/features/affected for more details.',
10
10
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withTuiOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs))))))
11
11
  .option('all', {
12
12
  type: 'boolean',
@@ -36,6 +36,7 @@ export interface ExpandedTaskInputsReponse {
36
36
  }
37
37
  export declare function generateGraph(args: {
38
38
  file?: string;
39
+ print?: boolean;
39
40
  host?: string;
40
41
  port?: number;
41
42
  groupByFolder?: boolean;
@@ -208,7 +208,7 @@ async function generateGraph(args, affectedProjects) {
208
208
  }
209
209
  }
210
210
  if (args.affected) {
211
- affectedProjects = (await (0, affected_1.getAffectedGraphNodes)((0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: args.file !== 'stdout' }, (0, configuration_1.readNxJson)()).nxArgs, rawGraph)).map((n) => n.name);
211
+ affectedProjects = (await (0, affected_1.getAffectedGraphNodes)((0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: !args.print && args.file !== 'stdout' }, (0, configuration_1.readNxJson)()).nxArgs, rawGraph)).map((n) => n.name);
212
212
  }
213
213
  if (args.exclude) {
214
214
  const invalidExcludes = [];
@@ -227,13 +227,12 @@ async function generateGraph(args, affectedProjects) {
227
227
  }
228
228
  let html = (0, node_fs_1.readFileSync)((0, path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
229
229
  prunedGraph = filterGraph(prunedGraph, args.focus || null, args.exclude || []);
230
+ if (args.print || args.file === 'stdout') {
231
+ console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
232
+ await output_1.output.drain();
233
+ process.exit(0);
234
+ }
230
235
  if (args.file) {
231
- // stdout is a magical constant that doesn't actually write a file
232
- if (args.file === 'stdout') {
233
- console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
234
- await output_1.output.drain();
235
- process.exit(0);
236
- }
237
236
  const workspaceFolder = workspace_root_1.workspaceRoot;
238
237
  const ext = (0, path_1.extname)(args.file);
239
238
  const fullFilePath = (0, path_1.isAbsolute)(args.file)
Binary file
@@ -51,10 +51,13 @@ const getProjectPathsAffectedByDependencyUpdates = (changedLockFile) => {
51
51
  return Array.from(changedProjectPaths);
52
52
  };
53
53
  const getProjectsNamesFromPaths = (projectGraphNodes, projectPaths) => {
54
+ if (!projectPaths.length) {
55
+ return [];
56
+ }
54
57
  const lookup = new RootPathLookup(projectGraphNodes);
55
- return projectPaths.map((path) => {
56
- return lookup.findNodeNameByRoot(path);
57
- });
58
+ return projectPaths
59
+ .map((path) => lookup.findNodeNameByRoot(path))
60
+ .filter(Boolean);
58
61
  };
59
62
  class RootPathLookup {
60
63
  constructor(nodes) {