nx 22.1.0-rc.5 → 22.1.1

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.
Files changed (67) hide show
  1. package/bin/init-local.d.ts.map +1 -1
  2. package/bin/init-local.js +2 -40
  3. package/package.json +11 -11
  4. package/src/command-line/daemon/command-object.d.ts +3 -2
  5. package/src/command-line/daemon/command-object.d.ts.map +1 -1
  6. package/src/command-line/daemon/command-object.js +11 -4
  7. package/src/command-line/graph/graph.d.ts.map +1 -1
  8. package/src/command-line/graph/graph.js +25 -16
  9. package/src/command-line/release/utils/shared.d.ts.map +1 -1
  10. package/src/command-line/release/utils/shared.js +5 -5
  11. package/src/command-line/yargs-utils/arguments-of.d.ts +12 -0
  12. package/src/command-line/yargs-utils/arguments-of.d.ts.map +1 -0
  13. package/src/command-line/yargs-utils/arguments-of.js +9 -0
  14. package/src/core/graph/main.js +1 -1
  15. package/src/daemon/client/client.d.ts +0 -3
  16. package/src/daemon/client/client.d.ts.map +1 -1
  17. package/src/daemon/client/client.js +2 -14
  18. package/src/daemon/server/server.d.ts.map +1 -1
  19. package/src/daemon/server/server.js +9 -21
  20. package/src/daemon/server/shutdown-utils.d.ts.map +1 -1
  21. package/src/daemon/server/shutdown-utils.js +0 -3
  22. package/src/devkit-internals.d.ts +1 -1
  23. package/src/devkit-internals.d.ts.map +1 -1
  24. package/src/devkit-internals.js +1 -2
  25. package/src/hasher/task-hasher.js +1 -1
  26. package/src/native/nx.wasi-browser.js +45 -53
  27. package/src/native/nx.wasm32-wasi.wasm +0 -0
  28. package/src/project-graph/error-types.d.ts +3 -2
  29. package/src/project-graph/error-types.d.ts.map +1 -1
  30. package/src/project-graph/error-types.js +9 -2
  31. package/src/project-graph/plugins/get-plugins.d.ts.map +1 -1
  32. package/src/project-graph/plugins/get-plugins.js +33 -35
  33. package/src/project-graph/plugins/in-process-loader.d.ts.map +1 -1
  34. package/src/project-graph/plugins/in-process-loader.js +2 -2
  35. package/src/project-graph/plugins/isolation/plugin-pool.js +3 -2
  36. package/src/project-graph/plugins/isolation/plugin-worker.js +3 -3
  37. package/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -0
  38. package/src/project-graph/plugins/loaded-nx-plugin.d.ts.map +1 -1
  39. package/src/project-graph/plugins/loaded-nx-plugin.js +5 -0
  40. package/src/project-graph/project-graph.d.ts +1 -0
  41. package/src/project-graph/project-graph.d.ts.map +1 -1
  42. package/src/project-graph/project-graph.js +21 -0
  43. package/src/project-graph/utils/project-configuration-utils.d.ts +1 -1
  44. package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
  45. package/src/project-graph/utils/project-configuration-utils.js +46 -15
  46. package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
  47. package/src/project-graph/utils/retrieve-workspace-files.d.ts.map +1 -1
  48. package/src/tasks-runner/utils.d.ts.map +1 -1
  49. package/src/tasks-runner/utils.js +3 -2
  50. package/src/utils/ab-testing.js +1 -1
  51. package/src/utils/assert-workspace-validity.d.ts.map +1 -1
  52. package/src/utils/assert-workspace-validity.js +5 -8
  53. package/src/utils/call-sites.d.ts +15 -0
  54. package/src/utils/call-sites.d.ts.map +1 -0
  55. package/src/utils/call-sites.js +28 -0
  56. package/src/utils/package-json.d.ts +0 -4
  57. package/src/utils/package-json.d.ts.map +1 -1
  58. package/src/utils/package-json.js +11 -45
  59. package/src/daemon/message-types/nx-console.d.ts +0 -18
  60. package/src/daemon/message-types/nx-console.d.ts.map +0 -1
  61. package/src/daemon/message-types/nx-console.js +0 -19
  62. package/src/daemon/server/handle-nx-console.d.ts +0 -4
  63. package/src/daemon/server/handle-nx-console.d.ts.map +0 -1
  64. package/src/daemon/server/handle-nx-console.js +0 -54
  65. package/src/daemon/server/nx-console-operations.d.ts +0 -31
  66. package/src/daemon/server/nx-console-operations.d.ts.map +0 -1
  67. package/src/daemon/server/nx-console-operations.js +0 -135
@@ -1 +1 @@
1
- {"version":3,"file":"init-local.d.ts","sourceRoot":"","sources":["../../../../packages/nx/bin/init-local.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,oBAAoB,iBA6C9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,YA6BvD"}
1
+ {"version":3,"file":"init-local.d.ts","sourceRoot":"","sources":["../../../../packages/nx/bin/init-local.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIxE;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,oBAAoB,iBA6C9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,YA6BvD"}
package/bin/init-local.js CHANGED
@@ -5,9 +5,7 @@ exports.rewriteTargetsAndProjects = rewriteTargetsAndProjects;
5
5
  const perf_hooks_1 = require("perf_hooks");
6
6
  const nx_commands_1 = require("../src/command-line/nx-commands");
7
7
  const strip_indents_1 = require("../src/utils/strip-indents");
8
- const client_1 = require("../src/daemon/client/client");
9
- const enquirer_1 = require("enquirer");
10
- const output_1 = require("../src/utils/output");
8
+ const nx_console_prompt_1 = require("../src/utils/nx-console-prompt");
11
9
  /**
12
10
  * Nx is being run inside a workspace.
13
11
  *
@@ -31,7 +29,7 @@ async function initLocal(workspace) {
31
29
  }
32
30
  // Ensure NxConsole is installed if the user has it configured.
33
31
  try {
34
- await ensureNxConsoleInstalledViaDaemon();
32
+ await (0, nx_console_prompt_1.ensureNxConsoleInstalled)();
35
33
  }
36
34
  catch { }
37
35
  const command = process.argv[2];
@@ -117,42 +115,6 @@ function shouldDelegateToAngularCLI() {
117
115
  ];
118
116
  return commands.indexOf(command) > -1;
119
117
  }
120
- async function ensureNxConsoleInstalledViaDaemon() {
121
- // Only proceed if daemon is available
122
- if (!client_1.daemonClient.enabled()) {
123
- return;
124
- }
125
- // Get status from daemon
126
- const status = await client_1.daemonClient.getNxConsoleStatus();
127
- // If we should prompt the user
128
- if (status.shouldPrompt && process.stdout.isTTY) {
129
- output_1.output.log({
130
- title: "Install Nx's official editor extension to:",
131
- bodyLines: [
132
- '- Enable your AI assistant to do more by understanding your workspace',
133
- '- Add IntelliSense for Nx configuration files',
134
- '- Explore your workspace visually',
135
- ],
136
- });
137
- try {
138
- const { shouldInstallNxConsole } = await (0, enquirer_1.prompt)({
139
- type: 'confirm',
140
- name: 'shouldInstallNxConsole',
141
- message: 'Install Nx Console? (you can uninstall anytime)',
142
- initial: true,
143
- });
144
- // Set preference and install if user said yes
145
- const result = await client_1.daemonClient.setNxConsolePreferenceAndInstall(shouldInstallNxConsole);
146
- if (result.installed) {
147
- output_1.output.log({ title: 'Successfully installed Nx Console!' });
148
- }
149
- }
150
- catch (error) {
151
- // User cancelled or error occurred, save preference as false
152
- await client_1.daemonClient.setNxConsolePreferenceAndInstall(false);
153
- }
154
- }
155
- }
156
118
  function handleAngularCLIFallbacks(workspace) {
157
119
  if (process.argv[2] === 'update' && process.env.FORCE_NG_UPDATE != 'true') {
158
120
  console.log(`Nx provides a much improved version of "ng update". It runs the same migrations, but allows you to:`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "22.1.0-rc.5",
3
+ "version": "22.1.1",
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": "22.1.0-rc.5",
87
- "@nx/nx-darwin-x64": "22.1.0-rc.5",
88
- "@nx/nx-freebsd-x64": "22.1.0-rc.5",
89
- "@nx/nx-linux-arm-gnueabihf": "22.1.0-rc.5",
90
- "@nx/nx-linux-arm64-gnu": "22.1.0-rc.5",
91
- "@nx/nx-linux-arm64-musl": "22.1.0-rc.5",
92
- "@nx/nx-linux-x64-gnu": "22.1.0-rc.5",
93
- "@nx/nx-linux-x64-musl": "22.1.0-rc.5",
94
- "@nx/nx-win32-arm64-msvc": "22.1.0-rc.5",
95
- "@nx/nx-win32-x64-msvc": "22.1.0-rc.5"
86
+ "@nx/nx-darwin-arm64": "22.1.1",
87
+ "@nx/nx-darwin-x64": "22.1.1",
88
+ "@nx/nx-freebsd-x64": "22.1.1",
89
+ "@nx/nx-linux-arm-gnueabihf": "22.1.1",
90
+ "@nx/nx-linux-arm64-gnu": "22.1.1",
91
+ "@nx/nx-linux-arm64-musl": "22.1.1",
92
+ "@nx/nx-linux-x64-gnu": "22.1.1",
93
+ "@nx/nx-linux-x64-musl": "22.1.1",
94
+ "@nx/nx-win32-arm64-msvc": "22.1.1",
95
+ "@nx/nx-win32-x64-msvc": "22.1.1"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -1,3 +1,4 @@
1
- import { CommandModule } from 'yargs';
2
- export declare const yargsDaemonCommand: CommandModule;
1
+ export declare const yargsDaemonCommand: import("../yargs-utils/arguments-of").CommandModule<{}, {
2
+ verbose: boolean;
3
+ }>;
3
4
  //# sourceMappingURL=command-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/daemon/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAQ,MAAM,OAAO,CAAC;AAG5C,eAAO,MAAM,kBAAkB,EAAE,aAOhC,CAAC"}
1
+ {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/daemon/command-object.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB;;EAW7B,CAAC"}
@@ -2,12 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsDaemonCommand = void 0;
4
4
  const documentation_1 = require("../yargs-utils/documentation");
5
- exports.yargsDaemonCommand = {
5
+ const handle_errors_1 = require("../../utils/handle-errors");
6
+ const shared_options_1 = require("../yargs-utils/shared-options");
7
+ const arguments_of_1 = require("../yargs-utils/arguments-of");
8
+ const builder = (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)(withDaemonOptions(yargs)), 'daemon');
9
+ exports.yargsDaemonCommand = (0, arguments_of_1.makeCommandModule)({
6
10
  command: 'daemon',
7
11
  describe: 'Prints information about the Nx Daemon process or starts a daemon process.',
8
- builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withDaemonOptions(yargs), 'daemon'),
9
- handler: async (args) => (await Promise.resolve().then(() => require('./daemon'))).daemonHandler(args),
10
- };
12
+ builder,
13
+ handler: async (args) => {
14
+ const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => (await Promise.resolve().then(() => require('./daemon'))).daemonHandler(args));
15
+ process.exit(exitCode);
16
+ },
17
+ });
11
18
  function withDaemonOptions(yargs) {
12
19
  return yargs
13
20
  .option('start', {
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAuBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC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O,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,EACD,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CA4Tf;AAyuBD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/graph/graph.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwBpD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,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,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;CACrB"}
@@ -27,6 +27,7 @@ const transform_objects_1 = require("../../native/transform-objects");
27
27
  const affected_1 = require("../affected/affected");
28
28
  const nx_deps_cache_1 = require("../../project-graph/nx-deps-cache");
29
29
  const task_hasher_1 = require("../../hasher/task-hasher");
30
+ const find_matching_projects_1 = require("../../utils/find-matching-projects");
30
31
  const create_task_hasher_1 = require("../../hasher/create-task-hasher");
31
32
  const error_types_1 = require("../../project-graph/error-types");
32
33
  const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
@@ -203,23 +204,29 @@ async function generateGraph(args, affectedProjects) {
203
204
  // and the operation might fail (i.e: in e2e tests), we fallback to empty array
204
205
  affectedProjects = [];
205
206
  }
206
- if (args.exclude) {
207
- const invalidExcludes = [];
208
- args.exclude.forEach((project) => {
209
- if (!projectExists(projects, project)) {
210
- invalidExcludes.push(project);
207
+ let excludePatterns = [];
208
+ if (args.exclude && args.exclude.length > 0) {
209
+ try {
210
+ // Use findMatchingProjects to expand patterns (supports globs, tags, directories, etc.)
211
+ excludePatterns = (0, find_matching_projects_1.findMatchingProjects)(args.exclude, prunedGraph.nodes);
212
+ // If no projects matched any of the exclude patterns, show a warning
213
+ if (excludePatterns.length === 0) {
214
+ output_1.output.warn({
215
+ title: `No projects matched the following exclude patterns:`,
216
+ bodyLines: args.exclude,
217
+ });
211
218
  }
212
- });
213
- if (invalidExcludes.length > 0) {
219
+ }
220
+ catch (e) {
214
221
  output_1.output.error({
215
- title: `The following projects provided to --exclude do not exist:`,
216
- bodyLines: invalidExcludes,
222
+ title: `Invalid exclude pattern:`,
223
+ bodyLines: [e.message],
217
224
  });
218
225
  process.exit(1);
219
226
  }
220
227
  }
221
228
  let html = (0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../core/graph/index.html'), 'utf-8');
222
- prunedGraph = filterGraph(prunedGraph, args.focus || null, args.exclude || []);
229
+ prunedGraph = filterGraph(prunedGraph, args.focus || null, excludePatterns);
223
230
  if (args.print || args.file === 'stdout') {
224
231
  console.log(JSON.stringify(await createJsonOutput(prunedGraph, rawGraph, args.projects, args.targets), null, 2));
225
232
  await output_1.output.drain();
@@ -250,7 +257,7 @@ async function generateGraph(args, affectedProjects) {
250
257
  ? await createTaskGraphForTargetsAndProjects(args.targets, args.projects)
251
258
  : await createTaskGraphClientResponse();
252
259
  const taskInputsReponse = await createExpandedTaskInputResponse(taskGraphClientResponse, projectGraphClientResponse);
253
- const environmentJs = buildEnvironmentJs(args.exclude || [], args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve', projectGraphClientResponse, taskGraphClientResponse, taskInputsReponse, sourceMaps);
260
+ const environmentJs = buildEnvironmentJs(excludePatterns, args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve', projectGraphClientResponse, taskGraphClientResponse, taskInputsReponse, sourceMaps);
254
261
  html = html.replace(/src="/g, 'src="static/');
255
262
  html = html.replace(/href="styles/g, 'href="static/styles');
256
263
  html = html.replace(/<base href="\/".*>/g, '');
@@ -281,11 +288,11 @@ async function generateGraph(args, affectedProjects) {
281
288
  process.exit(0);
282
289
  }
283
290
  else {
284
- const environmentJs = buildEnvironmentJs(args.exclude || [], args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve');
291
+ const environmentJs = buildEnvironmentJs(excludePatterns, args.watch, !!args.file && args.file.endsWith('html') ? 'build' : 'serve');
285
292
  let app;
286
293
  let url;
287
294
  try {
288
- const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder, args.exclude);
295
+ const result = await startServer(html, environmentJs, args.host || '127.0.0.1', args.port || 4211, args.watch, affectedProjects, args.focus, args.groupByFolder, excludePatterns);
289
296
  app = result.app;
290
297
  url = result.url;
291
298
  }
@@ -377,7 +384,7 @@ async function startServer(html, environmentJs, host, port = 4211, watchForChang
377
384
  if (watchForChanges && client_1.daemonClient.enabled()) {
378
385
  unregisterFileWatcher = await createFileWatcher();
379
386
  }
380
- const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected);
387
+ const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse(affected, focus, exclude);
381
388
  currentProjectGraphClientResponse = projectGraphClientResponse;
382
389
  currentProjectGraphClientResponse.focus = focus;
383
390
  currentProjectGraphClientResponse.groupByFolder = groupByFolder;
@@ -534,7 +541,7 @@ function createFileWatcher() {
534
541
  }
535
542
  else if (changes !== null && changes.changedFiles.length > 0) {
536
543
  output_1.output.note({ title: 'Recalculating project graph...' });
537
- const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse();
544
+ const { projectGraphClientResponse, sourceMapResponse } = await createProjectGraphAndSourceMapClientResponse([], currentProjectGraphClientResponse.focus, currentProjectGraphClientResponse.exclude);
538
545
  if (projectGraphClientResponse.hash !==
539
546
  currentProjectGraphClientResponse.hash &&
540
547
  sourceMapResponse) {
@@ -563,7 +570,7 @@ function createFileWatcher() {
563
570
  }
564
571
  }, 500));
565
572
  }
566
- async function createProjectGraphAndSourceMapClientResponse(affected = []) {
573
+ async function createProjectGraphAndSourceMapClientResponse(affected = [], focus = null, exclude = []) {
567
574
  node_perf_hooks_1.performance.mark('project graph watch calculation:start');
568
575
  let projectGraph;
569
576
  let sourceMaps;
@@ -598,6 +605,8 @@ async function createProjectGraphAndSourceMapClientResponse(affected = []) {
598
605
  }
599
606
  }
600
607
  let graph = (0, operators_1.pruneExternalNodes)(projectGraph);
608
+ // Apply focus and exclude filters
609
+ graph = filterGraph(graph, focus, exclude);
601
610
  const fileMap = (0, nx_deps_cache_1.readFileMapCache)()?.fileMap.projectFileMap || {};
602
611
  node_perf_hooks_1.performance.mark('project graph watch calculation:end');
603
612
  node_perf_hooks_1.performance.mark('project graph response generation:start');
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAK7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAEpC,CAAC;AAGF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,iBAAiB,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,oBAAoB,EAAE,MAAM,CAAC;QAC7B,cAAc,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED,qBAAa,cAAc;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;gBAEV,EACV,OAAO,EAAE,qEAAqE;IAC9E,iBAAiB,EAAE,8EAA8E;IACjG,WAAW,GACZ,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CAQF;AAED,wBAAsB,aAAa,CAAC,EAClC,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,aAAa,GACd,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,EAA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AC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC,iBAsBA;AAED,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CA0GV;AAcD,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,oBAAoB,GACjC,OAAO,GAAG,MAAM,CAElB;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CAAE,EAC1D,WAAW,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,oBAAoB,EAAE,EACrC,8BAA8B,EAAE,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,EACtE,WAAW,EAAE,WAAW,GACvB,MAAM,EAAE,CA6FV;AAeD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAcnE;AAED,wBAAsB,4BAA4B,CAChD,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,SAAS,EAAE,EACpB,QAAQ,EAAE,MAAM,EAAE,GAEpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,qBAAqB,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAAC,CAwC5E"}
@@ -272,11 +272,11 @@ async function getCommitsRelevantToProjects(projectGraph, commits, projects) {
272
272
  const projectSet = new Set(projects);
273
273
  const relevantCommits = new Map();
274
274
  for (const commit of commits) {
275
- // Convert affectedFiles to FileChange[] format
276
- const touchedFiles = commit.affectedFiles.map((f) => ({
277
- file: f,
278
- getChanges: () => [new file_utils_1.WholeFileChange()],
279
- }));
275
+ // Convert affectedFiles to FileChange[] format with proper diff computation
276
+ const touchedFiles = (0, file_utils_1.calculateFileChanges)(commit.affectedFiles, {
277
+ base: `${commit.shortHash}^`,
278
+ head: commit.shortHash,
279
+ });
280
280
  // Use the same affected detection logic as `nx affected`
281
281
  const affectedGraph = await (0, affected_project_graph_1.filterAffected)(projectGraph, touchedFiles);
282
282
  for (const projectName of Object.keys(affectedGraph.nodes)) {
@@ -0,0 +1,12 @@
1
+ import type { Argv, CommandModule as YargsCommandModule } from 'yargs';
2
+ export type Builder<InitialArgs, FinalArgs> = (yargs: Argv<InitialArgs>) => Argv<FinalArgs>;
3
+ export type Handler<B extends Builder<any, any>> = (args: Awaited<ReturnType<B>['argv']>) => void | Promise<void>;
4
+ export interface CommandModule<T, U> extends Omit<YargsCommandModule<T, U>, 'handler'> {
5
+ builder: Builder<T, U>;
6
+ handler: Handler<Builder<T, U>>;
7
+ }
8
+ /**
9
+ * Helper function to define a Yargs CommandModule with proper typing and not sacrifice inference.
10
+ */
11
+ export declare function makeCommandModule<T, U>(module: CommandModule<T, U>): CommandModule<T, U>;
12
+ //# sourceMappingURL=arguments-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments-of.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/yargs-utils/arguments-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEvE,MAAM,MAAM,OAAO,CAAC,WAAW,EAAE,SAAS,IAAI,CAC5C,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,KACrB,IAAI,CAAC,SAAS,CAAC,CAAC;AAErB,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CACjD,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KACjC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,MAAM,WAAW,aAAa,CAAC,CAAC,EAAE,CAAC,CACjC,SAAQ,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC;IACjD,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EACpC,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAErB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeCommandModule = makeCommandModule;
4
+ /**
5
+ * Helper function to define a Yargs CommandModule with proper typing and not sacrifice inference.
6
+ */
7
+ function makeCommandModule(module) {
8
+ return module;
9
+ }