nx 22.4.0-canary.20260108-e38d285 → 22.4.0-canary.20260112-6cca28c

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
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/client/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAC;AAmBpD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAapE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAKhG,OAAO,EAAW,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAmC9E,OAAO,KAAK,EACV,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,wCAAwC,CAAC;AAQhD,OAAO,EAIL,KAAK,uBAAuB,EAE5B,KAAK,wCAAwC,EAC9C,MAAM,6BAA6B,CAAC;AAarC,MAAM,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACtC,CAAC;AAaF,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;;IAWpD,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,eAAe,CAAwB;IAE/C,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,cAAc,CAAC;IACvB,OAAO,CAAC,aAAa,CAAC;IAEtB,OAAO,CAA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B,OAAO,CAAC,wCAAwC,CAAC;IAQ9C,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;YAwB7B,sBAAsB;YAsCtB,oBAAoB;IASlC,OAAO,CAAC,eAAe;YA8CT,qBAAqB;IAoDnC,OAAO,CAAC,mBAAmB;IAO3B;;;OAGG;YACW,0BAA0B;YAwC1B,mBAAmB;YAsBnB,uCAAuC;IAiBrD,OAAO,CAAC,aAAa;IA2Cf,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAoDjD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB5B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C,wBAAgB,eAAe,YAE9B"}
@@ -716,12 +716,14 @@ class DaemonClient {
716
716
  this._daemonStatus = DaemonStatus.CONNECTED;
717
717
  this._daemonReady();
718
718
  daemonPid ??= (0, cache_1.getDaemonProcessIdSync)();
719
- await this.registerDaemonProcessWithMetricsService(daemonPid);
719
+ // Fire-and-forget - don't block daemon connection by waiting for metrics registration
720
+ this.registerDaemonProcessWithMetricsService(daemonPid);
720
721
  }
721
722
  else if (this._daemonStatus == DaemonStatus.CONNECTING) {
722
723
  await this._waitForDaemonReady;
723
724
  const daemonPid = (0, cache_1.getDaemonProcessIdSync)();
724
- await this.registerDaemonProcessWithMetricsService(daemonPid);
725
+ // Fire-and-forget - don't block daemon connection by waiting for metrics registration
726
+ this.registerDaemonProcessWithMetricsService(daemonPid);
725
727
  }
726
728
  }
727
729
  async sendToDaemonViaQueue(messageToDaemon, force) {
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-pool.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/project-graph/plugins/isolation/plugin-pool.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAK9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA8C1D,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAuFhD"}
1
+ {"version":3,"file":"plugin-pool.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/project-graph/plugins/isolation/plugin-pool.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAO9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA4C1D,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAmGhD"}
@@ -2,13 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadRemoteNxPlugin = loadRemoteNxPlugin;
4
4
  const child_process_1 = require("child_process");
5
- const path = require("path");
6
5
  const net_1 = require("net");
6
+ const path = require("path");
7
+ // TODO (@AgentEnder): After scoped verbose logging is implemented, re-add verbose logs here.
8
+ // import { logger } from '../../utils/logger';
7
9
  const socket_utils_1 = require("../../../daemon/socket-utils");
8
10
  const consume_messages_from_socket_1 = require("../../../utils/consume-messages-from-socket");
9
- const messaging_1 = require("./messaging");
10
11
  const installation_directory_1 = require("../../../utils/installation-directory");
11
12
  const resolve_plugin_1 = require("../resolve-plugin");
13
+ const messaging_1 = require("./messaging");
12
14
  const cleanupFunctions = new Set();
13
15
  const pluginNames = new Map();
14
16
  const PLUGIN_TIMEOUT_HINT_TEXT = 'As a last resort, you can set NX_PLUGIN_NO_TIMEOUTS=true to bypass this timeout.';
@@ -35,28 +37,40 @@ async function loadRemoteNxPlugin(plugin, root, index) {
35
37
  const { worker, socket } = await startPluginWorker(name);
36
38
  // Register plugin worker as a subprocess of the main CLI
37
39
  // This allows metrics collection when the daemon is not used
40
+ // Fire-and-forget to avoid blocking the loading of the plugin
38
41
  if (worker.pid) {
39
- try {
40
- const { isOnDaemon } = await Promise.resolve().then(() => require('../../../daemon/is-on-daemon'));
41
- /**
42
- * We can only register the plugin worker as a subprocess of the main CLI
43
- * when the daemon is not used. Additionally, we can't explcitly register
44
- * the plugin worker as a subprocess of the daemon, because when on the
45
- * daemon, we'd get a different instance of the process metrics service.
46
- */
47
- if (!isOnDaemon()) {
48
- const { getProcessMetricsService } = await Promise.resolve().then(() => require('../../../tasks-runner/process-metrics-service'));
49
- getProcessMetricsService().registerMainCliSubprocess(worker.pid, `${name}${index !== undefined ? ` (${index})` : ''}`);
42
+ (async () => {
43
+ try {
44
+ const { isOnDaemon } = await Promise.resolve().then(() => require('../../../daemon/is-on-daemon'));
45
+ /**
46
+ * We can only register the plugin worker as a subprocess of the main CLI
47
+ * when the daemon is not used. Additionally, we can't explcitly register
48
+ * the plugin worker as a subprocess of the daemon, because when on the
49
+ * daemon, we'd get a different instance of the process metrics service.
50
+ */
51
+ if (!isOnDaemon()) {
52
+ const { getProcessMetricsService } = await Promise.resolve().then(() => require('../../../tasks-runner/process-metrics-service'));
53
+ getProcessMetricsService().registerMainCliSubprocess(worker.pid, `${name}${index !== undefined ? ` (${index})` : ''}`);
54
+ }
50
55
  }
51
- }
52
- catch {
53
- // Silently ignore - metrics collection is optional
54
- }
56
+ catch {
57
+ // Silently ignore - metrics collection is optional
58
+ }
59
+ })();
55
60
  }
56
61
  const pendingPromises = new Map();
57
62
  const exitHandler = createWorkerExitHandler(worker, pendingPromises);
58
63
  const cleanupFunction = () => {
59
64
  worker.off('exit', exitHandler);
65
+ // Unpipe streams to prevent hanging processes and release references
66
+ if (worker.stdout) {
67
+ worker.stdout.unpipe(process.stdout);
68
+ worker.stdout.destroy();
69
+ }
70
+ if (worker.stderr) {
71
+ worker.stderr.unpipe(process.stderr);
72
+ worker.stderr.destroy();
73
+ }
60
74
  socket.destroy();
61
75
  nxPluginWorkerCache.delete(cacheKey);
62
76
  };
@@ -235,6 +249,13 @@ function createWorkerHandler(worker, pending, onload, onloadError, socket) {
235
249
  }
236
250
  function createWorkerExitHandler(worker, pendingPromises) {
237
251
  return () => {
252
+ // Clean up piped streams when worker exits to prevent hanging
253
+ if (worker.stdout) {
254
+ worker.stdout.unpipe(process.stdout);
255
+ }
256
+ if (worker.stderr) {
257
+ worker.stderr.unpipe(process.stderr);
258
+ }
238
259
  for (const [_, pendingPromise] of pendingPromises) {
239
260
  pendingPromise.rejector(new Error(`Plugin worker ${pluginNames.get(worker) ?? worker.pid} exited unexpectedly with code ${worker.exitCode}`));
240
261
  }
@@ -298,13 +319,56 @@ async function startPluginWorker(name) {
298
319
  ipcPath,
299
320
  name,
300
321
  ], {
301
- stdio: 'inherit',
322
+ stdio: ['ignore', 'pipe', 'pipe'],
302
323
  env,
303
324
  detached: true,
304
325
  shell: false,
305
326
  windowsHide: true,
306
327
  });
328
+ // To make debugging easier and allow plugins to communicate things
329
+ // like performance metrics, we pipe the stdout/stderr of the worker
330
+ // to the main process.
331
+ // This adds one listener per plugin to a few events on process.stdout/stderr,
332
+ // so we need to increase the max listener count to avoid warnings.
333
+ //
334
+ // We originally used `inherit` for stdio, but that caused issues with
335
+ // some environments where the terminal was left in an inconsistent state
336
+ // that prevented `↑`/`↓` arrow keys from working correctly after Nx finished execution.
337
+ // Instead, they would print things like `^[[A`/`^[[B` to the terminal.
338
+ const stdoutMaxListeners = process.stdout.getMaxListeners();
339
+ const stderrMaxListeners = process.stderr.getMaxListeners();
340
+ if (stdoutMaxListeners !== 0) {
341
+ process.stdout.setMaxListeners(stdoutMaxListeners + 1);
342
+ }
343
+ if (stderrMaxListeners !== 0) {
344
+ process.stderr.setMaxListeners(stderrMaxListeners + 1);
345
+ }
346
+ worker.stdout.pipe(process.stdout);
347
+ worker.stderr.pipe(process.stderr);
348
+ // Unref the worker process so it doesn't prevent the parent from exiting.
349
+ // IMPORTANT: We must also unref the stdout/stderr streams. When streams are
350
+ // piped, they maintain internal references in Node's event loop. Without
351
+ // unreferencing them, the parent process will wait for the worker to exit
352
+ // even after worker.unref() is called. This causes e2e tests to hang on CI
353
+ // where test frameworks wait for all handles to be released.
354
+ //
355
+ // Although TypeScript types these as Readable/Writable, they are actually
356
+ // net.Socket instances at runtime. Node.js internally creates sockets for
357
+ // stdio pipes (see lib/internal/child_process.js createSocket function).
358
+ // Socket.unref() allows the event loop to exit if these are the only handles.
307
359
  worker.unref();
360
+ if (worker.stdout instanceof net_1.Socket) {
361
+ worker.stdout.unref();
362
+ }
363
+ else {
364
+ throw new Error(`Expected worker.stdout to be an instance of Socket, but got ${getTypeName(worker.stdout)}`);
365
+ }
366
+ if (worker.stderr instanceof net_1.Socket) {
367
+ worker.stderr.unref();
368
+ }
369
+ else {
370
+ throw new Error(`Expected worker.stderr to be an instance of Socket, but got ${getTypeName(worker.stderr)}`);
371
+ }
308
372
  let attempts = 0;
309
373
  return new Promise((resolve, reject) => {
310
374
  const id = setInterval(async () => {
@@ -343,3 +407,16 @@ function isServerAvailable(ipcPath) {
343
407
  }
344
408
  });
345
409
  }
410
+ function getTypeName(u) {
411
+ if (u === null)
412
+ return 'null';
413
+ if (u === undefined)
414
+ return 'undefined';
415
+ if (typeof u !== 'object')
416
+ return typeof u;
417
+ if (Array.isArray(u)) {
418
+ const innerTypes = u.map((el) => getTypeName(el));
419
+ return `Array<${Array.from(new Set(innerTypes)).join('|')}>`;
420
+ }
421
+ return u.constructor?.name ?? 'unknown object';
422
+ }
@@ -105,7 +105,7 @@ async function createOrchestrator(tasks, projectGraph, taskGraphForHashing, nxJs
105
105
  lifeCycle: compositedLifeCycle,
106
106
  };
107
107
  (0, run_command_1.setEnvVarsBasedOnArgs)(nxArgs, true);
108
- const orchestrator = new task_orchestrator_1.TaskOrchestrator(hasher, null, [], projectGraph, taskGraph, nxJson, nxArgs, false, client_1.daemonClient, undefined, taskGraphForHashing);
108
+ const orchestrator = new task_orchestrator_1.TaskOrchestrator(hasher, null, tasks, projectGraph, taskGraph, nxJson, nxArgs, false, client_1.daemonClient, undefined, taskGraphForHashing);
109
109
  await orchestrator.init();
110
110
  orchestrator.processAllScheduledTasks();
111
111
  return orchestrator;
@@ -1 +1 @@
1
- {"version":3,"file":"task-orchestrator.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-orchestrator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQnD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAMrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAiB,MAAM,kBAAkB,CAAC;AAUxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,qBAAa,gBAAgB;IA8CzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACx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AClB,iBAAiB,EAAE,MAAM,GAAG,SAAS,EACrC,eAAe,EAAE,IAAI,EAAE,EACvB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,GAAG,yBAAyB,EAC3C,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,MAAM,EACnB,mBAAmB,GAAE,SAAqB;IAGvD,IAAI;IAiBJ,GAAG;;;IA6CF,SAAS;YAIF,wCAAwC;IAwDtD,OAAO,CAAC,YAAY;YAUN,WAAW;YAoBX,qBAAqB;IAgB5B,wBAAwB;YAajB,kBAAkB;YAUlB,iBAAiB;IAuClB,wBAAwB,CACnC,cAAc,EAAE,OAAO,EACvB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,EAAE,CAAC;YAmEV,QAAQ;IA8ChB,uBAAuB,CAC3B,cAAc,EAAE,OAAO,EACvB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,CAAC;YAkER,OAAO;YAqKP,sBAAsB;IA2C9B,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM;YA4GvC,WAAW;YAQX,YAAY;YAmFZ,kCAAkC;IAQhD,OAAO,CAAC,QAAQ;YA0CF,iBAAiB;IAuB/B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,SAAS;YAIH,0BAA0B;YAQ1B,iBAAiB;YAQjB,OAAO;IA6BrB,OAAO,CAAC,8BAA8B;CA6BvC;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,GAAG,yBAAyB,EAC3C,SAAS,EAAE,SAAS,UAqBrB"}
@@ -126,7 +126,19 @@ class TaskOrchestrator {
126
126
  if (task) {
127
127
  const groupId = this.closeGroup();
128
128
  if (task.continuous) {
129
- await this.startContinuousTask(task, groupId);
129
+ const runningTask = await this.startContinuousTask(task, groupId);
130
+ if (this.initializingTaskIds.has(task.id)) {
131
+ await new Promise((res) => {
132
+ runningTask.onExit((code) => {
133
+ if (!this.tuiEnabled) {
134
+ if (code > 128) {
135
+ process.exit(code);
136
+ }
137
+ }
138
+ res();
139
+ });
140
+ });
141
+ }
130
142
  }
131
143
  else {
132
144
  await this.applyFromCacheOrRunTask(doNotSkipCache, task, groupId);
@@ -475,18 +487,6 @@ class TaskOrchestrator {
475
487
  // task is already running by another process, we schedule the next tasks
476
488
  // and release the threads
477
489
  await this.scheduleNextTasksAndReleaseThreads();
478
- if (this.initializingTaskIds.has(task.id)) {
479
- await new Promise((res) => {
480
- runningTask.onExit((code) => {
481
- if (!this.tuiEnabled) {
482
- if (code > 128) {
483
- process.exit(code);
484
- }
485
- }
486
- res();
487
- });
488
- });
489
- }
490
490
  return runningTask;
491
491
  }
492
492
  const taskSpecificEnv = await this.processedTasks.get(task.id);
@@ -520,18 +520,6 @@ class TaskOrchestrator {
520
520
  }
521
521
  });
522
522
  await this.scheduleNextTasksAndReleaseThreads();
523
- if (this.initializingTaskIds.has(task.id)) {
524
- await new Promise((res) => {
525
- childProcess.onExit((code) => {
526
- if (!this.tuiEnabled) {
527
- if (code > 128) {
528
- process.exit(code);
529
- }
530
- }
531
- res();
532
- });
533
- });
534
- }
535
523
  return childProcess;
536
524
  }
537
525
  // endregion Single Task
@@ -225,7 +225,7 @@ function preparePackageInstallation(pkg, requiredVersion) {
225
225
  const execOptions = {
226
226
  cwd: tempDir,
227
227
  stdio: isVerbose ? 'inherit' : 'ignore',
228
- windowsHide: false,
228
+ windowsHide: true,
229
229
  };
230
230
  return {
231
231
  tempDir,