nx 21.3.0-canary.20250626-8b6ad42 → 21.3.0-canary.20250627-07233f0

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.3.0-canary.20250626-8b6ad42",
3
+ "version": "21.3.0-canary.20250627-07233f0",
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.3.0-canary.20250626-8b6ad42",
87
- "@nx/nx-darwin-x64": "21.3.0-canary.20250626-8b6ad42",
88
- "@nx/nx-freebsd-x64": "21.3.0-canary.20250626-8b6ad42",
89
- "@nx/nx-linux-arm-gnueabihf": "21.3.0-canary.20250626-8b6ad42",
90
- "@nx/nx-linux-arm64-gnu": "21.3.0-canary.20250626-8b6ad42",
91
- "@nx/nx-linux-arm64-musl": "21.3.0-canary.20250626-8b6ad42",
92
- "@nx/nx-linux-x64-gnu": "21.3.0-canary.20250626-8b6ad42",
93
- "@nx/nx-linux-x64-musl": "21.3.0-canary.20250626-8b6ad42",
94
- "@nx/nx-win32-arm64-msvc": "21.3.0-canary.20250626-8b6ad42",
95
- "@nx/nx-win32-x64-msvc": "21.3.0-canary.20250626-8b6ad42"
86
+ "@nx/nx-darwin-arm64": "21.3.0-canary.20250627-07233f0",
87
+ "@nx/nx-darwin-x64": "21.3.0-canary.20250627-07233f0",
88
+ "@nx/nx-freebsd-x64": "21.3.0-canary.20250627-07233f0",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.3.0-canary.20250627-07233f0",
90
+ "@nx/nx-linux-arm64-gnu": "21.3.0-canary.20250627-07233f0",
91
+ "@nx/nx-linux-arm64-musl": "21.3.0-canary.20250627-07233f0",
92
+ "@nx/nx-linux-x64-gnu": "21.3.0-canary.20250627-07233f0",
93
+ "@nx/nx-linux-x64-musl": "21.3.0-canary.20250627-07233f0",
94
+ "@nx/nx-win32-arm64-msvc": "21.3.0-canary.20250627-07233f0",
95
+ "@nx/nx-win32-x64-msvc": "21.3.0-canary.20250627-07233f0"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -182,8 +182,14 @@ async function handleMessage(socket, data) {
182
182
  }
183
183
  }
184
184
  async function handleResult(socket, type, hrFn) {
185
+ let hr;
185
186
  const startMark = new Date();
186
- const hr = await hrFn();
187
+ try {
188
+ hr = await hrFn();
189
+ }
190
+ catch (error) {
191
+ hr = { description: `[${type}]`, error };
192
+ }
187
193
  const doneHandlingMark = new Date();
188
194
  if (hr.error) {
189
195
  await (0, shutdown_utils_1.respondWithErrorAndExit)(socket, hr.description, hr.error);
@@ -89,6 +89,7 @@ class ForkedProcessTaskRunner {
89
89
  if (pseudo_terminal_1.PseudoTerminal.isSupported() &&
90
90
  !disablePseudoTerminal &&
91
91
  (this.tuiEnabled || (streamOutput && !shouldPrefix))) {
92
+ // Use pseudo-terminal for interactive tasks that can support user input
92
93
  return this.forkProcessWithPseudoTerminal(task, {
93
94
  temporaryOutputPath,
94
95
  streamOutput,
@@ -97,6 +98,9 @@ class ForkedProcessTaskRunner {
97
98
  });
98
99
  }
99
100
  else {
101
+ // Use non-interactive process with piped output
102
+ // Tradeoff: These tasks cannot support interactivity but can still provide
103
+ // progressive output to the TUI if it's enabled
100
104
  return this.forkProcessWithPrefixAndNotTTY(task, {
101
105
  temporaryOutputPath,
102
106
  streamOutput,
@@ -4,12 +4,14 @@ export declare class NodeChildProcessWithNonDirectOutput implements RunningTask
4
4
  private childProcess;
5
5
  private terminalOutput;
6
6
  private exitCallbacks;
7
+ private outputCallbacks;
7
8
  private exitCode;
8
9
  constructor(childProcess: ChildProcess, { streamOutput, prefix }: {
9
10
  streamOutput: boolean;
10
11
  prefix: string;
11
12
  });
12
13
  onExit(cb: (code: number, terminalOutput: string) => void): void;
14
+ onOutput(cb: (output: string) => void): void;
13
15
  getResults(): Promise<{
14
16
  code: number;
15
17
  terminalOutput: string;
@@ -10,6 +10,7 @@ class NodeChildProcessWithNonDirectOutput {
10
10
  this.childProcess = childProcess;
11
11
  this.terminalOutput = '';
12
12
  this.exitCallbacks = [];
13
+ this.outputCallbacks = [];
13
14
  if (streamOutput) {
14
15
  if (process.env.NX_PREFIX_OUTPUT === 'true') {
15
16
  const color = getColor(prefix);
@@ -47,15 +48,28 @@ class NodeChildProcessWithNonDirectOutput {
47
48
  }
48
49
  });
49
50
  this.childProcess.stdout.on('data', (chunk) => {
50
- this.terminalOutput += chunk.toString();
51
+ const output = chunk.toString();
52
+ this.terminalOutput += output;
53
+ // Stream output to TUI via callbacks
54
+ for (const cb of this.outputCallbacks) {
55
+ cb(output);
56
+ }
51
57
  });
52
58
  this.childProcess.stderr.on('data', (chunk) => {
53
- this.terminalOutput += chunk.toString();
59
+ const output = chunk.toString();
60
+ this.terminalOutput += output;
61
+ // Stream output to TUI via callbacks
62
+ for (const cb of this.outputCallbacks) {
63
+ cb(output);
64
+ }
54
65
  });
55
66
  }
56
67
  onExit(cb) {
57
68
  this.exitCallbacks.push(cb);
58
69
  }
70
+ onOutput(cb) {
71
+ this.outputCallbacks.push(cb);
72
+ }
59
73
  async getResults() {
60
74
  if (typeof this.exitCode === 'number') {
61
75
  return {
@@ -398,12 +398,18 @@ class TaskOrchestrator {
398
398
  this.options.lifeCycle.appendTaskOutput(task.id, output, true);
399
399
  });
400
400
  }
401
- else if ('onOutput' in runningTask) {
401
+ else if ('onOutput' in runningTask &&
402
+ typeof runningTask.onOutput === 'function') {
403
+ // Register task that can provide progressive output but isn't interactive (e.g., NodeChildProcessWithNonDirectOutput)
402
404
  this.options.lifeCycle.registerRunningTaskWithEmptyParser(task.id);
403
405
  runningTask.onOutput((output) => {
404
406
  this.options.lifeCycle.appendTaskOutput(task.id, output, false);
405
407
  });
406
408
  }
409
+ else {
410
+ // Fallback for tasks that don't support progressive output
411
+ this.options.lifeCycle.registerRunningTaskWithEmptyParser(task.id);
412
+ }
407
413
  }
408
414
  return runningTask;
409
415
  }