nx 22.1.0-canary.20251106-e9146c7 → 22.1.0-canary.20251111-647d751

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 (50) hide show
  1. package/package.json +12 -11
  2. package/release/changelog-renderer/index.d.ts.map +1 -1
  3. package/release/changelog-renderer/index.js +13 -8
  4. package/src/command-line/init/init-v2.js +1 -1
  5. package/src/command-line/release/changelog/commit-utils.d.ts +14 -0
  6. package/src/command-line/release/changelog/commit-utils.d.ts.map +1 -0
  7. package/src/command-line/release/changelog/commit-utils.js +63 -0
  8. package/src/command-line/release/changelog/version-plan-filtering.d.ts +39 -0
  9. package/src/command-line/release/changelog/version-plan-filtering.d.ts.map +1 -0
  10. package/src/command-line/release/changelog/version-plan-filtering.js +151 -0
  11. package/src/command-line/release/changelog/version-plan-utils.d.ts +32 -0
  12. package/src/command-line/release/changelog/version-plan-utils.d.ts.map +1 -0
  13. package/src/command-line/release/changelog/version-plan-utils.js +92 -0
  14. package/src/command-line/release/changelog.d.ts +1 -16
  15. package/src/command-line/release/changelog.d.ts.map +1 -1
  16. package/src/command-line/release/changelog.js +127 -269
  17. package/src/command-line/release/command-object.d.ts +1 -0
  18. package/src/command-line/release/command-object.d.ts.map +1 -1
  19. package/src/command-line/release/command-object.js +6 -0
  20. package/src/command-line/release/utils/shared.d.ts.map +1 -1
  21. package/src/command-line/release/utils/shared.js +2 -2
  22. package/src/core/graph/main.js +1 -1
  23. package/src/native/index.d.ts +13 -2
  24. package/src/native/nx.wasm32-wasi.wasm +0 -0
  25. package/src/plugins/js/index.d.ts.map +1 -1
  26. package/src/plugins/js/index.js +55 -7
  27. package/src/plugins/js/lock-file/lock-file.d.ts +5 -2
  28. package/src/plugins/js/lock-file/lock-file.d.ts.map +1 -1
  29. package/src/plugins/js/lock-file/lock-file.js +8 -6
  30. package/src/plugins/js/lock-file/npm-parser.d.ts +5 -2
  31. package/src/plugins/js/lock-file/npm-parser.d.ts.map +1 -1
  32. package/src/plugins/js/lock-file/npm-parser.js +5 -8
  33. package/src/plugins/js/lock-file/pnpm-parser.d.ts +5 -2
  34. package/src/plugins/js/lock-file/pnpm-parser.d.ts.map +1 -1
  35. package/src/plugins/js/lock-file/pnpm-parser.js +5 -7
  36. package/src/plugins/js/lock-file/yarn-parser.d.ts +5 -2
  37. package/src/plugins/js/lock-file/yarn-parser.d.ts.map +1 -1
  38. package/src/plugins/js/lock-file/yarn-parser.js +5 -7
  39. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +1 -1
  40. package/src/project-graph/plugins/get-plugins.d.ts.map +1 -1
  41. package/src/project-graph/plugins/get-plugins.js +4 -4
  42. package/src/project-graph/plugins/isolation/index.d.ts +1 -1
  43. package/src/project-graph/plugins/isolation/index.d.ts.map +1 -1
  44. package/src/project-graph/plugins/isolation/index.js +2 -2
  45. package/src/project-graph/plugins/isolation/plugin-pool.d.ts +1 -1
  46. package/src/project-graph/plugins/isolation/plugin-pool.d.ts.map +1 -1
  47. package/src/project-graph/plugins/isolation/plugin-pool.js +10 -6
  48. package/src/tasks-runner/process-metrics-service.d.ts +1 -1
  49. package/src/tasks-runner/process-metrics-service.d.ts.map +1 -1
  50. package/src/tasks-runner/process-metrics-service.js +2 -2
@@ -117,6 +117,8 @@ export declare class ProcessMetricsCollector {
117
117
  getSystemInfo(): SystemInfo
118
118
  /** Register the main CLI process for metrics collection */
119
119
  registerMainCliProcess(pid: number): void
120
+ /** Register a subprocess of the main CLI for metrics collection */
121
+ registerMainCliSubprocess(pid: number, alias?: string | undefined | null): void
120
122
  /** Register the daemon process for metrics collection */
121
123
  registerDaemonProcess(pid: number): void
122
124
  /**
@@ -126,8 +128,6 @@ export declare class ProcessMetricsCollector {
126
128
  registerTaskProcess(taskId: string, pid: number): void
127
129
  /** Register a batch with multiple tasks sharing a worker */
128
130
  registerBatch(batchId: string, taskIds: Array<string>, pid: number): void
129
- /** Register a subprocess of the main CLI for metrics collection */
130
- registerMainCliSubprocess(pid: number): void
131
131
  /** Subscribe to push-based metrics notifications from TypeScript */
132
132
  subscribe(callback: (err: Error | null, event: MetricsUpdate) => void): void
133
133
  }
@@ -343,6 +343,7 @@ export interface ProcessMetadata {
343
343
  command: string
344
344
  exePath: string
345
345
  cwd: string
346
+ alias?: string
346
347
  }
347
348
 
348
349
  /** Process metrics (dynamic, changes every collection) */
@@ -355,6 +356,7 @@ export interface ProcessMetrics {
355
356
  /** Organized collection of process metrics with timestamp */
356
357
  export interface ProcessMetricsSnapshot {
357
358
  timestamp: number
359
+ system: SystemMetrics
358
360
  mainCli?: ProcessTreeMetrics
359
361
  daemon?: ProcessTreeMetrics
360
362
  tasks: Record<string, Array<ProcessMetrics>>
@@ -408,6 +410,15 @@ export interface SystemInfo {
408
410
  totalMemory: number
409
411
  }
410
412
 
413
+ /** System metrics (dynamic, changes every collection) */
414
+ export interface SystemMetrics {
415
+ cpu: number
416
+ memory: number
417
+ availableMemory: number
418
+ swapUsed: number
419
+ swapTotal: number
420
+ }
421
+
411
422
  export interface Target {
412
423
  executor?: string
413
424
  inputs?: Array<JsInputs>
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/plugins/js/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EACd,MAAM,6BAA6B,CAAC;AAkBrC,eAAO,MAAM,IAAI,oCAAoC,CAAC;AAKtD,eAAO,MAAM,aAAa,EAAE,aAK3B,CAAC;AAkDF,eAAO,MAAM,kBAAkB,EAAE,kBAgDhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/plugins/js/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EACd,MAAM,6BAA6B,CAAC;AAkBrC,eAAO,MAAM,IAAI,oCAAoC,CAAC;AAMtD,eAAO,MAAM,aAAa,EAAE,aAK3B,CAAC;AAoDF,eAAO,MAAM,kBAAkB,EAAE,kBAiDhC,CAAC"}
@@ -18,6 +18,7 @@ const config_1 = require("./utils/config");
18
18
  exports.name = 'nx/js/dependencies-and-lockfile';
19
19
  // Separate in-memory caches
20
20
  let cachedExternalNodes;
21
+ let cachedKeyMap;
21
22
  exports.createNodesV2 = [
22
23
  (0, globs_1.combineGlobPatterns)(lock_file_1.LOCKFILES),
23
24
  (files, _, context) => {
@@ -40,15 +41,17 @@ function internalCreateNodes(lockFile, _, context) {
40
41
  : (0, bun_parser_1.readBunLockFile)(lockFilePath);
41
42
  const lockFileHash = getLockFileHash(lockFileContents);
42
43
  if (!lockFileNeedsReprocessing(lockFileHash, externalNodesHashFile)) {
43
- const nodes = readCachedExternalNodes();
44
+ const { nodes, keyMap } = readCachedExternalNodes();
44
45
  cachedExternalNodes = nodes;
46
+ cachedKeyMap = keyMap;
45
47
  return {
46
48
  externalNodes: nodes,
47
49
  };
48
50
  }
49
- const externalNodes = (0, lock_file_1.getLockFileNodes)(packageManager, lockFileContents, lockFileHash, context);
51
+ const { nodes: externalNodes, keyMap } = (0, lock_file_1.getLockFileNodes)(packageManager, lockFileContents, lockFileHash, context);
50
52
  cachedExternalNodes = externalNodes;
51
- writeExternalNodesCache(lockFileHash, externalNodes);
53
+ cachedKeyMap = keyMap;
54
+ writeExternalNodesCache(lockFileHash, externalNodes, keyMap);
52
55
  return {
53
56
  externalNodes,
54
57
  };
@@ -70,7 +73,7 @@ const createDependencies = (_, ctx) => {
70
73
  lockfileDependencies = readCachedDependencies();
71
74
  }
72
75
  else {
73
- lockfileDependencies = (0, lock_file_1.getLockFileDependencies)(packageManager, lockFileContents, lockFileHash, ctx);
76
+ lockfileDependencies = (0, lock_file_1.getLockFileDependencies)(packageManager, lockFileContents, lockFileHash, ctx, cachedKeyMap);
74
77
  writeDependenciesCache(lockFileHash, lockfileDependencies);
75
78
  }
76
79
  }
@@ -84,6 +87,48 @@ exports.createDependencies = createDependencies;
84
87
  function getLockFileHash(lockFileContents) {
85
88
  return (0, file_hasher_1.hashArray)([versions_1.nxVersion, lockFileContents]);
86
89
  }
90
+ // Serialize keyMap to JSON-friendly format
91
+ function serializeKeyMap(keyMap) {
92
+ const serialized = {};
93
+ for (const [key, value] of keyMap.entries()) {
94
+ if (value instanceof Set) {
95
+ // pnpm: Map<string, Set<ProjectGraphExternalNode>>
96
+ serialized[key] = Array.from(value).map((node) => node.name);
97
+ }
98
+ else if (value && typeof value === 'object' && 'name' in value) {
99
+ // npm/yarn: Map<string, ProjectGraphExternalNode>
100
+ serialized[key] = value.name;
101
+ }
102
+ else {
103
+ serialized[key] = value;
104
+ }
105
+ }
106
+ return serialized;
107
+ }
108
+ // Deserialize keyMap from JSON format using ctx.externalNodes
109
+ function deserializeKeyMap(serialized, externalNodes) {
110
+ const keyMap = new Map();
111
+ for (const [key, value] of Object.entries(serialized)) {
112
+ if (Array.isArray(value)) {
113
+ // pnpm: reconstruct Set<ProjectGraphExternalNode>
114
+ const nodes = value
115
+ .map((nodeName) => externalNodes[nodeName])
116
+ .filter(Boolean);
117
+ keyMap.set(key, new Set(nodes));
118
+ }
119
+ else if (typeof value === 'string') {
120
+ // npm/yarn: reconstruct ProjectGraphExternalNode
121
+ const node = externalNodes[value];
122
+ if (node) {
123
+ keyMap.set(key, node);
124
+ }
125
+ }
126
+ else {
127
+ keyMap.set(key, value);
128
+ }
129
+ }
130
+ return keyMap;
131
+ }
87
132
  function lockFileNeedsReprocessing(lockHash, hashFilePath) {
88
133
  try {
89
134
  return (0, fs_1.readFileSync)(hashFilePath).toString() !== lockHash;
@@ -93,13 +138,16 @@ function lockFileNeedsReprocessing(lockHash, hashFilePath) {
93
138
  }
94
139
  }
95
140
  // External nodes cache functions
96
- function writeExternalNodesCache(hash, nodes) {
141
+ function writeExternalNodesCache(hash, nodes, keyMap) {
97
142
  (0, fs_1.mkdirSync)((0, path_1.dirname)(externalNodesHashFile), { recursive: true });
98
- (0, fs_1.writeFileSync)(externalNodesCache, JSON.stringify(nodes, null, 2));
143
+ const serializedKeyMap = serializeKeyMap(keyMap);
144
+ const cacheData = { nodes, keyMap: serializedKeyMap };
145
+ (0, fs_1.writeFileSync)(externalNodesCache, JSON.stringify(cacheData, null, 2));
99
146
  (0, fs_1.writeFileSync)(externalNodesHashFile, hash);
100
147
  }
101
148
  function readCachedExternalNodes() {
102
- return JSON.parse((0, fs_1.readFileSync)(externalNodesCache).toString());
149
+ const { nodes, keyMap } = JSON.parse((0, fs_1.readFileSync)(externalNodesCache, 'utf-8'));
150
+ return { nodes, keyMap: deserializeKeyMap(keyMap, nodes) };
103
151
  }
104
152
  // Dependencies cache functions
105
153
  function writeDependenciesCache(hash, dependencies) {
@@ -11,11 +11,14 @@ export declare const LOCKFILES: string[];
11
11
  /**
12
12
  * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
13
13
  */
14
- export declare function getLockFileNodes(packageManager: PackageManager, contents: string, lockFileHash: string, context: CreateNodesContextV2): Record<string, ProjectGraphExternalNode>;
14
+ export declare function getLockFileNodes(packageManager: PackageManager, contents: string, lockFileHash: string, context: CreateNodesContextV2): {
15
+ nodes: Record<string, ProjectGraphExternalNode>;
16
+ keyMap: Map<string, any>;
17
+ };
15
18
  /**
16
19
  * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
17
20
  */
18
- export declare function getLockFileDependencies(packageManager: PackageManager, contents: string, lockFileHash: string, context: CreateDependenciesContext): RawProjectGraphDependency[];
21
+ export declare function getLockFileDependencies(packageManager: PackageManager, contents: string, lockFileHash: string, context: CreateDependenciesContext, keyMap: Map<string, any>): RawProjectGraphDependency[];
19
22
  export declare function lockFileExists(packageManager: PackageManager): boolean;
20
23
  /**
21
24
  * Returns lock file name based on the detected package manager in the root
@@ -1 +1 @@
1
- {"version":3,"file":"lock-file.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/lock-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACL,YAAY,EACZ,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAGzF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAEL,cAAc,EACf,MAAM,gCAAgC,CAAC;AA8BxC,eAAO,MAAM,SAAS,UAMrB,CAAC;AAQF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,oBAAoB,GAC5B,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAqC1C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,yBAAyB,GACjC,yBAAyB,EAAE,CA8B7B;AAED,wBAAgB,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAgBtE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBtE;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAgCtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,YAAY,EACnB,cAAc,GAAE,cAAoD,GACnE,MAAM,CAmDR"}
1
+ {"version":3,"file":"lock-file.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/lock-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACL,YAAY,EACZ,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAGzF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAEL,cAAc,EACf,MAAM,gCAAgC,CAAC;AA8BxC,eAAO,MAAM,SAAS,UAMrB,CAAC;AAQF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,oBAAoB,GAC5B;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1B,CAsCA;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,yBAAyB,EAClC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GACvB,yBAAyB,EAAE,CAmD7B;AAED,wBAAgB,cAAc,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAgBtE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBtE;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAgCtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,YAAY,EACnB,cAAc,GAAE,cAAoD,GACnE,MAAM,CAmDR"}
@@ -59,7 +59,8 @@ function getLockFileNodes(packageManager, contents, lockFileHash, context) {
59
59
  const lockFilePath = getLockFilePath(packageManager);
60
60
  if (lockFilePath.endsWith(bun_parser_1.BUN_TEXT_LOCK_FILE)) {
61
61
  // Use new text-based parser
62
- return (0, bun_parser_1.getBunTextLockfileNodes)(contents, lockFileHash);
62
+ const nodes = (0, bun_parser_1.getBunTextLockfileNodes)(contents, lockFileHash);
63
+ return { nodes, keyMap: new Map() };
63
64
  }
64
65
  else {
65
66
  // Fallback to yarn parser for binary format
@@ -82,25 +83,26 @@ function getLockFileNodes(packageManager, contents, lockFileHash, context) {
82
83
  /**
83
84
  * Parses lock file and maps dependencies and metadata to {@link LockFileGraph}
84
85
  */
85
- function getLockFileDependencies(packageManager, contents, lockFileHash, context) {
86
+ function getLockFileDependencies(packageManager, contents, lockFileHash, context, keyMap) {
86
87
  try {
87
88
  if (packageManager === 'yarn') {
88
- return (0, yarn_parser_1.getYarnLockfileDependencies)(contents, lockFileHash, context);
89
+ return (0, yarn_parser_1.getYarnLockfileDependencies)(contents, lockFileHash, context, keyMap);
89
90
  }
90
91
  if (packageManager === 'pnpm') {
91
- return (0, pnpm_parser_1.getPnpmLockfileDependencies)(contents, lockFileHash, context);
92
+ return (0, pnpm_parser_1.getPnpmLockfileDependencies)(contents, lockFileHash, context, keyMap);
92
93
  }
93
94
  if (packageManager === 'npm') {
94
- return (0, npm_parser_1.getNpmLockfileDependencies)(contents, lockFileHash, context);
95
+ return (0, npm_parser_1.getNpmLockfileDependencies)(contents, lockFileHash, context, keyMap);
95
96
  }
96
97
  if (packageManager === 'bun') {
97
98
  const lockFilePath = getLockFilePath(packageManager);
98
99
  if (lockFilePath.endsWith(bun_parser_1.BUN_TEXT_LOCK_FILE)) {
100
+ // Bun parser doesn't use keyMap
99
101
  return (0, bun_parser_1.getBunTextLockfileDependencies)(contents, lockFileHash, context);
100
102
  }
101
103
  else {
102
104
  // Fallback to yarn parser for binary format
103
- return (0, yarn_parser_1.getYarnLockfileDependencies)(contents, lockFileHash, context);
105
+ return (0, yarn_parser_1.getYarnLockfileDependencies)(contents, lockFileHash, context, keyMap);
104
106
  }
105
107
  }
106
108
  }
@@ -2,7 +2,10 @@ import { NormalizedPackageJson } from './utils/package-json';
2
2
  import { RawProjectGraphDependency } from '../../../project-graph/project-graph-builder';
3
3
  import { ProjectGraph, ProjectGraphExternalNode } from '../../../config/project-graph';
4
4
  import { CreateDependenciesContext } from '../../../project-graph/plugins';
5
- export declare function getNpmLockfileNodes(lockFileContent: string, lockFileHash: string): Record<string, ProjectGraphExternalNode>;
6
- export declare function getNpmLockfileDependencies(lockFileContent: string, lockFileHash: string, ctx: CreateDependenciesContext): RawProjectGraphDependency[];
5
+ export declare function getNpmLockfileNodes(lockFileContent: string, lockFileHash: string): {
6
+ nodes: Record<string, ProjectGraphExternalNode>;
7
+ keyMap: Map<string, ProjectGraphExternalNode>;
8
+ };
9
+ export declare function getNpmLockfileDependencies(lockFileContent: string, lockFileHash: string, ctx: CreateDependenciesContext, keyMap: Map<string, ProjectGraphExternalNode>): RawProjectGraphDependency[];
7
10
  export declare function stringifyNpmLockfile(graph: ProjectGraph, rootLockFileContent: string, packageJson: NormalizedPackageJson): string;
8
11
  //# sourceMappingURL=npm-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"npm-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/npm-parser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,yBAAyB,EAE1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,YAAY,EACZ,wBAAwB,EAEzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AA6D3E,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,4CASrB;AAED,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,+BAQ/B;AAuSD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,GACjC,MAAM,CA8BR"}
1
+ {"version":3,"file":"npm-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/npm-parser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,yBAAyB,EAE1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,YAAY,EACZ,wBAAwB,EAEzB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAyD3E,wBAAgB,mBAAmB,CACjC,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,wBAAwB,CAAC,CAAC;CAC/C,CAOA;AAED,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,EAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,+BAQ9C;AAwSD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,GACjC,MAAM,CA8BR"}
@@ -11,15 +11,12 @@ const project_graph_builder_1 = require("../../../project-graph/project-graph-bu
11
11
  const project_graph_1 = require("../../../config/project-graph");
12
12
  const file_hasher_1 = require("../../../hasher/file-hasher");
13
13
  const get_workspace_packages_from_graph_1 = require("../utils/get-workspace-packages-from-graph");
14
- // we use key => node map to avoid duplicate work when parsing keys
15
- let keyMap = new Map();
16
14
  let currentLockFileHash;
17
15
  let parsedLockFile;
18
16
  function parsePackageLockFile(lockFileContent, lockFileHash) {
19
17
  if (lockFileHash === currentLockFileHash) {
20
18
  return parsedLockFile;
21
19
  }
22
- keyMap.clear();
23
20
  const results = JSON.parse(lockFileContent);
24
21
  parsedLockFile = results;
25
22
  currentLockFileHash = lockFileHash;
@@ -27,14 +24,14 @@ function parsePackageLockFile(lockFileContent, lockFileHash) {
27
24
  }
28
25
  function getNpmLockfileNodes(lockFileContent, lockFileHash) {
29
26
  const data = parsePackageLockFile(lockFileContent, lockFileHash);
30
- // we use key => node map to avoid duplicate work when parsing keys
31
- return getNodes(data, keyMap);
27
+ return getNodes(data);
32
28
  }
33
- function getNpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
29
+ function getNpmLockfileDependencies(lockFileContent, lockFileHash, ctx, keyMap) {
34
30
  const data = parsePackageLockFile(lockFileContent, lockFileHash);
35
31
  return getDependencies(data, keyMap, ctx);
36
32
  }
37
- function getNodes(data, keyMap) {
33
+ function getNodes(data) {
34
+ const keyMap = new Map();
38
35
  const nodes = new Map();
39
36
  if (data.lockfileVersion > 1) {
40
37
  Object.entries(data.packages).forEach(([path, snapshot]) => {
@@ -77,7 +74,7 @@ function getNodes(data, keyMap) {
77
74
  results[node.name] = node;
78
75
  });
79
76
  }
80
- return results;
77
+ return { nodes: results, keyMap };
81
78
  }
82
79
  function addV1Node(packageName, snapshot, path, nodes, keyMap) {
83
80
  createNode(packageName, snapshot.version, path, nodes, keyMap, snapshot);
@@ -2,7 +2,10 @@ import { NormalizedPackageJson } from './utils/package-json';
2
2
  import { RawProjectGraphDependency } from '../../../project-graph/project-graph-builder';
3
3
  import { ProjectGraph, ProjectGraphExternalNode } from '../../../config/project-graph';
4
4
  import { CreateDependenciesContext } from '../../../project-graph/plugins';
5
- export declare function getPnpmLockfileNodes(lockFileContent: string, lockFileHash: string): Record<string, ProjectGraphExternalNode>;
6
- export declare function getPnpmLockfileDependencies(lockFileContent: string, lockFileHash: string, ctx: CreateDependenciesContext): RawProjectGraphDependency[];
5
+ export declare function getPnpmLockfileNodes(lockFileContent: string, lockFileHash: string): {
6
+ nodes: Record<string, ProjectGraphExternalNode>;
7
+ keyMap: Map<string, Set<ProjectGraphExternalNode>>;
8
+ };
9
+ export declare function getPnpmLockfileDependencies(lockFileContent: string, lockFileHash: string, ctx: CreateDependenciesContext, keyMap: Map<string, Set<ProjectGraphExternalNode>>): RawProjectGraphDependency[];
7
10
  export declare function stringifyPnpmLockfile(graph: ProjectGraph, rootLockFileContent: string, packageJson: NormalizedPackageJson, workspaceRoot: string): string;
8
11
  //# sourceMappingURL=pnpm-parser.d.ts.map
@@ -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,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;AA2B3E,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,GACnB,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAS1C;AAED,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,+BAU/B;AAkUD,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;AAuB3E,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;AAqUD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,EAClC,aAAa,EAAE,MAAM,GACpB,MAAM,CAuCR"}
@@ -13,15 +13,12 @@ const catalog_1 = require("../../../utils/catalog");
13
13
  const project_graph_pruning_1 = require("./project-graph-pruning");
14
14
  const path_1 = require("path");
15
15
  const get_workspace_packages_from_graph_1 = require("../utils/get-workspace-packages-from-graph");
16
- // we use key => node map to avoid duplicate work when parsing keys
17
- let keyMap = new Map();
18
16
  let currentLockFileHash;
19
17
  let parsedLockFile;
20
18
  function parsePnpmLockFile(lockFileContent, lockFileHash) {
21
19
  if (lockFileHash === currentLockFileHash) {
22
20
  return parsedLockFile;
23
21
  }
24
- keyMap.clear();
25
22
  const results = (0, pnpm_normalizer_1.parseAndNormalizePnpmLockfile)(lockFileContent);
26
23
  parsedLockFile = results;
27
24
  currentLockFileHash = lockFileHash;
@@ -33,9 +30,9 @@ function getPnpmLockfileNodes(lockFileContent, lockFileHash) {
33
30
  console.warn('Nx was tested only with pnpm lockfile version 5-9. If you encounter any issues, please report them and downgrade to older version of pnpm.');
34
31
  }
35
32
  const isV5 = (0, pnpm_normalizer_1.isV5Syntax)(data);
36
- return getNodes(data, keyMap, isV5);
33
+ return getNodes(data, isV5);
37
34
  }
38
- function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx) {
35
+ function getPnpmLockfileDependencies(lockFileContent, lockFileHash, ctx, keyMap) {
39
36
  const data = parsePnpmLockFile(lockFileContent, lockFileHash);
40
37
  if (+data.lockfileVersion.toString() >= 10) {
41
38
  console.warn('Nx was tested only with pnpm lockfile version 5-9. If you encounter any issues, please report them and downgrade to older version of pnpm.');
@@ -71,7 +68,8 @@ function createHashFromSnapshot(snapshot) {
71
68
  function isAliasVersion(depVersion) {
72
69
  return depVersion.startsWith('/') || depVersion.includes('@');
73
70
  }
74
- function getNodes(data, keyMap, isV5) {
71
+ function getNodes(data, isV5) {
72
+ const keyMap = new Map();
75
73
  const nodes = new Map();
76
74
  const maybeAliasedPackageVersions = new Map(); // <version, alias>
77
75
  if (data.importers['.'].optionalDependencies) {
@@ -232,7 +230,7 @@ function getNodes(data, keyMap, isV5) {
232
230
  results[node.name] = node;
233
231
  });
234
232
  }
235
- return results;
233
+ return { nodes: results, keyMap };
236
234
  }
237
235
  function getHoistedVersion(hoistedDependencies, packageName, isV5) {
238
236
  let version = (0, package_json_1.getHoistedPackageVersion)(packageName);
@@ -2,7 +2,10 @@ import { NormalizedPackageJson } from './utils/package-json';
2
2
  import { RawProjectGraphDependency } from '../../../project-graph/project-graph-builder';
3
3
  import { ProjectGraph, ProjectGraphExternalNode } from '../../../config/project-graph';
4
4
  import { CreateDependenciesContext } from '../../../project-graph/plugins';
5
- export declare function getYarnLockfileNodes(lockFileContent: string, lockFileHash: string, packageJson: NormalizedPackageJson): Record<string, ProjectGraphExternalNode>;
6
- export declare function getYarnLockfileDependencies(lockFileContent: string, lockFileHash: string, ctx: CreateDependenciesContext): RawProjectGraphDependency[];
5
+ export declare function getYarnLockfileNodes(lockFileContent: string, lockFileHash: string, packageJson: NormalizedPackageJson): {
6
+ nodes: Record<string, ProjectGraphExternalNode>;
7
+ keyMap: Map<string, ProjectGraphExternalNode>;
8
+ };
9
+ export declare function getYarnLockfileDependencies(lockFileContent: string, lockFileHash: string, ctx: CreateDependenciesContext, keyMap: Map<string, ProjectGraphExternalNode>): RawProjectGraphDependency[];
7
10
  export declare function stringifyYarnLockfile(graph: ProjectGraph, rootLockFileContent: string, packageJson: NormalizedPackageJson): string;
8
11
  //# sourceMappingURL=yarn-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"yarn-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/yarn-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EAE1B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAEL,YAAY,EACZ,wBAAwB,EAEzB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AA8C3E,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,qBAAqB,4CAanC;AAED,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,+BAa/B;AAiQD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,GACjC,MAAM,CA8BR"}
1
+ {"version":3,"file":"yarn-parser.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/plugins/js/lock-file/yarn-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EAE1B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAEL,YAAY,EACZ,wBAAwB,EAEzB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AA0C3E,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,qBAAqB,GACjC;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;CAC/C,CAYA;AAED,wBAAgB,2BAA2B,CACzC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,yBAAyB,EAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,+BAa9C;AAsQD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,qBAAqB,GACjC,MAAM,CA8BR"}
@@ -12,14 +12,11 @@ const object_sort_1 = require("../../../utils/object-sort");
12
12
  const get_workspace_packages_from_graph_1 = require("../utils/get-workspace-packages-from-graph");
13
13
  let currentLockFileHash;
14
14
  let cachedParsedLockFile;
15
- // we use key => node map to avoid duplicate work when parsing keys
16
- let keyMap = new Map();
17
15
  function parseLockFile(lockFileContent, lockFileHash) {
18
16
  if (currentLockFileHash === lockFileHash) {
19
17
  return cachedParsedLockFile;
20
18
  }
21
19
  const { parseSyml } = require('@yarnpkg/parsers');
22
- keyMap.clear();
23
20
  const result = parseSyml(lockFileContent);
24
21
  cachedParsedLockFile = result;
25
22
  currentLockFileHash = lockFileHash;
@@ -32,12 +29,12 @@ function getYarnLockfileNodes(lockFileContent, lockFileHash, packageJson) {
32
29
  const groupedDependencies = groupDependencies(dependencies, isBerry);
33
30
  return getNodes(groupedDependencies, packageJson, isBerry);
34
31
  }
35
- function getYarnLockfileDependencies(lockFileContent, lockFileHash, ctx) {
32
+ function getYarnLockfileDependencies(lockFileContent, lockFileHash, ctx, keyMap) {
36
33
  const { __metadata, ...dependencies } = parseLockFile(lockFileContent, lockFileHash);
37
34
  const isBerry = !!__metadata;
38
35
  // yarn classic splits keys when parsing so we need to stich them back together
39
36
  const groupedDependencies = groupDependencies(dependencies, isBerry);
40
- return getDependencies(groupedDependencies, ctx);
37
+ return getDependencies(groupedDependencies, ctx, keyMap);
41
38
  }
42
39
  function getPackageNameKeyPairs(keys) {
43
40
  const result = new Map();
@@ -53,6 +50,7 @@ function getPackageNameKeyPairs(keys) {
53
50
  return result;
54
51
  }
55
52
  function getNodes(dependencies, packageJson, isBerry) {
53
+ const keyMap = new Map();
56
54
  const nodes = new Map();
57
55
  const combinedDeps = {
58
56
  ...packageJson.dependencies,
@@ -115,7 +113,7 @@ function getNodes(dependencies, packageJson, isBerry) {
115
113
  externalNodes[node.name] = node;
116
114
  });
117
115
  }
118
- return externalNodes;
116
+ return { nodes: externalNodes, keyMap };
119
117
  }
120
118
  function findHoistedNode(packageName, versionMap, combinedDeps) {
121
119
  const hoistedVersion = getHoistedVersion(packageName);
@@ -194,7 +192,7 @@ function getHoistedVersion(packageName) {
194
192
  return version;
195
193
  }
196
194
  }
197
- function getDependencies(dependencies, ctx) {
195
+ function getDependencies(dependencies, ctx, keyMap) {
198
196
  const projectGraphDependencies = [];
199
197
  Object.keys(dependencies).forEach((keys) => {
200
198
  const snapshot = dependencies[keys];
@@ -246,7 +246,7 @@ class TargetProjectLocator {
246
246
  if (normalizedRange.startsWith('file:')) {
247
247
  const targetPath = maybeDep?.data.root;
248
248
  const normalizedPath = normalizedRange.replace('file:', '');
249
- const resolvedPath = (0, node_path_1.join)((0, node_path_1.dirname)(packageJsonPath), normalizedPath);
249
+ const resolvedPath = node_path_1.posix.join((0, node_path_1.dirname)(packageJsonPath), normalizedPath);
250
250
  if (targetPath === resolvedPath) {
251
251
  return maybeDep?.name;
252
252
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-plugins.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/get-plugins.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBzD,wBAAsB,UAAU,CAC9B,IAAI,SAAgB,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAgC3B;AAaD,wBAAsB,qBAAqB,CAAC,IAAI,SAAgB,6BAyB/D;AAED,wBAAgB,cAAc,SAG7B"}
1
+ {"version":3,"file":"get-plugins.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/plugins/get-plugins.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA0BzD,wBAAsB,UAAU,CAC9B,IAAI,SAAgB,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAgC3B;AAaD,wBAAsB,qBAAqB,CAAC,IAAI,SAAgB,6BAyB/D;AAED,wBAAgB,cAAc,SAG7B"}
@@ -19,6 +19,9 @@ let currentPluginsConfigurationHash;
19
19
  let loadedPlugins;
20
20
  let pendingPluginsPromise;
21
21
  let cleanupSpecifiedPlugins;
22
+ const loadingMethod = (plugin, root, index) => (0, enabled_1.isIsolationEnabled)()
23
+ ? (0, isolation_1.loadNxPluginInIsolation)(plugin, root, index)
24
+ : (0, in_process_loader_1.loadNxPlugin)(plugin, root);
22
25
  async function getPlugins(root = workspace_root_1.workspaceRoot) {
23
26
  const pluginsConfiguration = (0, nx_json_1.readNxJson)(root).plugins ?? [];
24
27
  const pluginsConfigurationHash = (0, file_hasher_1.hashObject)(pluginsConfiguration);
@@ -78,9 +81,6 @@ function cleanupPlugins() {
78
81
  /**
79
82
  * Stuff for generic loading
80
83
  */
81
- const loadingMethod = (0, enabled_1.isIsolationEnabled)()
82
- ? isolation_1.loadNxPluginInIsolation
83
- : in_process_loader_1.loadNxPlugin;
84
84
  async function loadDefaultNxPlugins(root = workspace_root_1.workspaceRoot) {
85
85
  performance.mark('loadDefaultNxPlugins:start');
86
86
  const plugins = getDefaultPlugins(root);
@@ -116,7 +116,7 @@ async function loadSpecifiedNxPlugins(plugins, root = workspace_root_1.workspace
116
116
  await Promise.all(plugins.map(async (plugin, index) => {
117
117
  const pluginPath = typeof plugin === 'string' ? plugin : plugin.plugin;
118
118
  performance.mark(`Load Nx Plugin: ${pluginPath} - start`);
119
- const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root);
119
+ const [loadedPluginPromise, cleanup] = await loadingMethod(plugin, root, index);
120
120
  cleanupFunctions.push(cleanup);
121
121
  const res = await loadedPluginPromise;
122
122
  res.index = index;
@@ -1,4 +1,4 @@
1
1
  import type { PluginConfiguration } from '../../../config/nx-json';
2
2
  import type { LoadedNxPlugin } from '../loaded-nx-plugin';
3
- export declare function loadNxPluginInIsolation(plugin: PluginConfiguration, root?: string): Promise<readonly [Promise<LoadedNxPlugin>, () => void]>;
3
+ export declare function loadNxPluginInIsolation(plugin: PluginConfiguration, root?: string, index?: number): Promise<readonly [Promise<LoadedNxPlugin>, () => void]>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/project-graph/plugins/isolation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,mBAAmB,EAC3B,IAAI,SAAgB,GACnB,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAEzD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/project-graph/plugins/isolation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,mBAAmB,EAC3B,IAAI,SAAgB,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAEzD"}
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadNxPluginInIsolation = loadNxPluginInIsolation;
4
4
  const workspace_root_1 = require("../../../utils/workspace-root");
5
5
  const plugin_pool_1 = require("./plugin-pool");
6
- async function loadNxPluginInIsolation(plugin, root = workspace_root_1.workspaceRoot) {
7
- return (0, plugin_pool_1.loadRemoteNxPlugin)(plugin, root);
6
+ async function loadNxPluginInIsolation(plugin, root = workspace_root_1.workspaceRoot, index) {
7
+ return (0, plugin_pool_1.loadRemoteNxPlugin)(plugin, root, index);
8
8
  }
@@ -1,4 +1,4 @@
1
1
  import { PluginConfiguration } from '../../../config/nx-json';
2
2
  import type { LoadedNxPlugin } from '../loaded-nx-plugin';
3
- export declare function loadRemoteNxPlugin(plugin: PluginConfiguration, root: string): Promise<[Promise<LoadedNxPlugin>, () => void]>;
3
+ export declare function loadRemoteNxPlugin(plugin: PluginConfiguration, root: string, index?: number): Promise<[Promise<LoadedNxPlugin>, () => void]>;
4
4
  //# sourceMappingURL=plugin-pool.d.ts.map
@@ -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,GACX,OAAO,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAgFhD"}
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"}
@@ -25,7 +25,7 @@ const MAX_MESSAGE_WAIT = process.env.NX_PLUGIN_NO_TIMEOUTS === 'true'
25
25
  2147483647
26
26
  : 1000 * 60 * MINUTES; // 10 minutes
27
27
  const nxPluginWorkerCache = (global['nxPluginWorkerCache'] ??= new Map());
28
- async function loadRemoteNxPlugin(plugin, root) {
28
+ async function loadRemoteNxPlugin(plugin, root, index) {
29
29
  const cacheKey = JSON.stringify({ plugin, root });
30
30
  if (nxPluginWorkerCache.has(cacheKey)) {
31
31
  return [nxPluginWorkerCache.get(cacheKey), () => { }];
@@ -37,12 +37,16 @@ async function loadRemoteNxPlugin(plugin, root) {
37
37
  // This allows metrics collection when the daemon is not used
38
38
  if (worker.pid) {
39
39
  try {
40
- const { isDaemonEnabled } = await Promise.resolve().then(() => require('../../../daemon/client/client'));
41
- // Only register if daemon is not enabled - when daemon is enabled,
42
- // plugin workers are spawned as children of the daemon and tracked automatically
43
- if (!isDaemonEnabled()) {
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()) {
44
48
  const { getProcessMetricsService } = await Promise.resolve().then(() => require('../../../tasks-runner/process-metrics-service'));
45
- getProcessMetricsService().registerMainCliSubprocess(worker.pid);
49
+ getProcessMetricsService().registerMainCliSubprocess(worker.pid, `${name}${index !== undefined ? ` (${index})` : ''}`);
46
50
  }
47
51
  }
48
52
  catch {
@@ -36,7 +36,7 @@ declare class ProcessMetricsService {
36
36
  /**
37
37
  * Register a subprocess of the main CLI (e.g., plugin worker)
38
38
  */
39
- registerMainCliSubprocess(pid: number): void;
39
+ registerMainCliSubprocess(pid: number, alias?: string): void;
40
40
  /**
41
41
  * Get system information (CPU cores and total memory)
42
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"process-metrics-service.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/process-metrics-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,UAAU,EACX,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,UAAU,GACX,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE7D;;;;GAIG;AACH,cAAM,qBAAqB;IACzB,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,iBAAiB,CAAS;;IAmBlC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IA+B1C;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAQtD;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAQpE;;OAEG;IACH,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQxC;;OAEG;IACH,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQ5C;;OAEG;IACH,aAAa,IAAI,UAAU,GAAG,IAAI;IASlC;;OAEG;IACH,QAAQ,IAAI,IAAI;CAOjB;AAOD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,qBAAqB,CAKhE"}
1
+ {"version":3,"file":"process-metrics-service.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/process-metrics-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,UAAU,EACX,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,UAAU,GACX,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE7D;;;;GAIG;AACH,cAAM,qBAAqB;IACzB,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,iBAAiB,CAAS;;IAmBlC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IA+B1C;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAQtD;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAQpE;;OAEG;IACH,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQxC;;OAEG;IACH,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ5D;;OAEG;IACH,aAAa,IAAI,UAAU,GAAG,IAAI;IASlC;;OAEG;IACH,QAAQ,IAAI,IAAI;CAOjB;AAOD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,qBAAqB,CAKhE"}
@@ -113,9 +113,9 @@ class ProcessMetricsService {
113
113
  /**
114
114
  * Register a subprocess of the main CLI (e.g., plugin worker)
115
115
  */
116
- registerMainCliSubprocess(pid) {
116
+ registerMainCliSubprocess(pid, alias) {
117
117
  try {
118
- this.collector?.registerMainCliSubprocess(pid);
118
+ this.collector?.registerMainCliSubprocess(pid, alias);
119
119
  }
120
120
  catch {
121
121
  // Silent failure - metrics collection is optional