nx 22.4.0-beta.1 → 22.4.0-beta.3

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,CAAC,QAAQ,CAAsB;I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AwC,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) {
@@ -1,9 +1,18 @@
1
1
  const { join, basename } = require('path');
2
- const { copyFileSync, existsSync, mkdirSync, renameSync } = require('fs');
2
+ const {
3
+ copyFileSync,
4
+ existsSync,
5
+ mkdirSync,
6
+ renameSync,
7
+ statSync,
8
+ unlinkSync,
9
+ } = require('fs');
3
10
  const Module = require('module');
4
11
  const { nxVersion } = require('../utils/versions');
5
12
  const { getNativeFileCacheLocation } = require('./native-file-cache-location');
6
13
 
14
+ const MAX_COPY_RETRIES = 3;
15
+
7
16
  // WASI is still experimental and throws a warning when used
8
17
  // We spawn many many processes so the warning gets printed a lot
9
18
  // We have a different warning elsewhere to warn people using WASI
@@ -56,6 +65,14 @@ const localNodeFiles = [
56
65
 
57
66
  const originalLoad = Module._load;
58
67
 
68
+ function statsOrNull(path) {
69
+ try {
70
+ return statSync(path);
71
+ } catch {
72
+ return null;
73
+ }
74
+ }
75
+
59
76
  // We override the _load function so that when a native file is required,
60
77
  // we copy it to a cache directory and require it from there.
61
78
  // This prevents the file being loaded from node_modules and causing file locking issues.
@@ -83,22 +100,45 @@ Module._load = function (request, parent, isMain) {
83
100
  );
84
101
  // This is the path that will get loaded
85
102
  const tmpFile = join(nativeFileCacheLocation, nxVersion + '-' + fileName);
103
+ const expectedFileSize = statSync(nativeLocation).size;
104
+ const existingFileStats = statsOrNull(tmpFile);
86
105
 
87
106
  // If the file to be loaded already exists, just load it
88
- if (existsSync(tmpFile)) {
107
+ if (existingFileStats?.size === expectedFileSize) {
89
108
  return originalLoad.apply(this, [tmpFile, parent, isMain]);
90
109
  }
91
110
  if (!existsSync(nativeFileCacheLocation)) {
92
111
  mkdirSync(nativeFileCacheLocation, { recursive: true });
93
112
  }
94
- // First copy to a unique location for each process
95
- copyFileSync(nativeLocation, tmpTmpFile);
96
113
 
97
- // Then rename to the final location
98
- renameSync(tmpTmpFile, tmpFile);
114
+ // Retry copying up to 3 times, validating after each copy
115
+ for (let attempt = 1; attempt <= MAX_COPY_RETRIES; attempt++) {
116
+ // First copy to a unique location for each process
117
+ copyFileSync(nativeLocation, tmpTmpFile);
118
+
119
+ // Validate the copy - check file size matches expected
120
+ const copiedFileStats = statsOrNull(tmpTmpFile);
121
+ if (copiedFileStats?.size === expectedFileSize) {
122
+ // Copy succeeded, rename to final location and load
123
+ renameSync(tmpTmpFile, tmpFile);
124
+ return originalLoad.apply(this, [tmpFile, parent, isMain]);
125
+ }
99
126
 
100
- // Load from the final location
101
- return originalLoad.apply(this, [tmpFile, parent, isMain]);
127
+ // Copy failed validation, clean up the malformed file
128
+ try {
129
+ unlinkSync(tmpTmpFile);
130
+ } catch {
131
+ // Ignore cleanup errors
132
+ }
133
+ }
134
+
135
+ // All retries failed - warn and load from original location
136
+ console.warn(
137
+ `Warning: Failed to copy native module to cache after ${MAX_COPY_RETRIES} attempts. ` +
138
+ `Loading from original location instead. ` +
139
+ `This may cause file locking issues on Windows.`
140
+ );
141
+ return originalLoad.apply(this, [nativeLocation, parent, isMain]);
102
142
  } else {
103
143
  // call the original _load function for everything else
104
144
  return originalLoad.apply(this, arguments);
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/pnpm-parser.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,yBAAyB,EAE1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,YAAY,EACZ,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAwB3E,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,GACnB;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;CACpD,CASA;AAED,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,EAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,CAAC,CAAC,+BAUnD;AAodD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,EAClC,aAAa,EAAE,MAAM,GACpB,MAAM,CAuCR"}
1
+ {"version":3,"file":"pnpm-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/pnpm-parser.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,yBAAyB,EAE1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,YAAY,EACZ,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAwB3E,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,GACnB;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;CACpD,CASA;AAED,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,EAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,CAAC,CAAC,+BAUnD;AAqeD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,EAClC,aAAa,EAAE,MAAM,GACpB,MAAM,CAuCR"}
@@ -41,13 +41,25 @@ function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx, keyMap)
41
41
  const isV5 = (0, pnpm_normalizer_1.isV5Syntax)(data);
42
42
  return getDependencies(data, keyMap, isV5, ctx);
43
43
  }
44
+ function invertRecordWithoutAliases(record) {
45
+ const result = {};
46
+ for (const [depName, depVersion] of Object.entries(record)) {
47
+ if (isAliasVersion(depVersion)) {
48
+ // Ignore alias specifiers so aliases do not replace actual package names
49
+ continue;
50
+ }
51
+ result[depVersion] = depName;
52
+ }
53
+ return result;
54
+ }
44
55
  const cachedInvertedRecords = new Map();
45
56
  function matchPropValue(record, key, originalPackageName, recordName) {
46
57
  if (!record) {
47
58
  return undefined;
48
59
  }
49
60
  if (!cachedInvertedRecords.has(recordName)) {
50
- cachedInvertedRecords.set(recordName, (0, package_json_1.invertObject)(record));
61
+ // Inversion is only for non-alias specs to avoid alias -> target mislabeling.
62
+ cachedInvertedRecords.set(recordName, invertRecordWithoutAliases(record));
51
63
  }
52
64
  const packageName = cachedInvertedRecords.get(recordName)[key];
53
65
  if (packageName) {
@@ -117,6 +129,7 @@ function findPatchHash(patchEntriesByPackage, packageName, version) {
117
129
  return nameOnlyMatch?.hash;
118
130
  }
119
131
  function getNodes(data, isV5) {
132
+ cachedInvertedRecords.clear();
120
133
  const keyMap = new Map();
121
134
  const nodes = new Map();
122
135
  // Extract and pre-parse patch information from patchedDependencies section
@@ -160,8 +173,8 @@ function getNodes(data, isV5) {
160
173
  }
161
174
  }
162
175
  const packageNames = new Set();
163
- let packageNameObj;
164
176
  for (const [key, snapshot] of Object.entries(data.packages)) {
177
+ let packageNameObj;
165
178
  const originalPackageName = extractNameFromKey(key, isV5);
166
179
  if (!originalPackageName) {
167
180
  continue;
@@ -222,25 +235,26 @@ function getNodes(data, isV5) {
222
235
  }
223
236
  }
224
237
  }
238
+ if (packageNameObj) {
239
+ packageNames.add(packageNameObj);
240
+ }
225
241
  const aliasedDep = maybeAliasedPackageVersions.get(`/${key}`);
226
242
  if (aliasedDep) {
227
- packageNameObj = {
243
+ packageNames.add({
228
244
  key,
229
245
  packageName: aliasedDep,
230
246
  hash,
231
247
  alias: true,
232
- };
248
+ });
233
249
  }
234
- packageNames.add(packageNameObj);
235
250
  const localAlias = maybeAliasedPackageVersions.get(key);
236
251
  if (localAlias) {
237
- packageNameObj = {
252
+ packageNames.add({
238
253
  key,
239
254
  packageName: localAlias,
240
255
  hash,
241
256
  alias: true,
242
- };
243
- packageNames.add(packageNameObj);
257
+ });
244
258
  }
245
259
  }
246
260
  for (const { key, packageName, hash, alias } of packageNames) {
@@ -8,5 +8,4 @@ export type NormalizedPackageJson = Pick<PackageJson, 'name' | 'version' | 'lice
8
8
  * Strip off non-pruning related fields from package.json
9
9
  */
10
10
  export declare function normalizePackageJson(packageJson: PackageJson): NormalizedPackageJson;
11
- export declare function invertObject(record: Record<string, string>): Record<string, string>;
12
11
  //# sourceMappingURL=package-json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/plugins/js/lock-file/utils/package-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQpE;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,WAAW,EACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,gBAAgB,GAChB,aAAa,CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,GACvB,qBAAqB,CA0BvB;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB"}
1
+ {"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/plugins/js/lock-file/utils/package-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQpE;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,WAAW,EACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,gBAAgB,GAChB,aAAa,CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,GACvB,qBAAqB,CA0BvB"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getHoistedPackageVersion = getHoistedPackageVersion;
4
4
  exports.normalizePackageJson = normalizePackageJson;
5
- exports.invertObject = invertObject;
6
5
  const workspace_root_1 = require("../../../../utils/workspace-root");
7
6
  const fileutils_1 = require("../../../../utils/fileutils");
8
7
  /**
@@ -35,10 +34,3 @@ function normalizePackageJson(packageJson) {
35
34
  resolutions,
36
35
  };
37
36
  }
38
- function invertObject(record) {
39
- const result = {};
40
- Object.keys(record).forEach((key) => {
41
- result[record[key]] = key;
42
- });
43
- return result;
44
- }
@@ -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,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AAW;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,