nx 19.3.0-canary.20240613-c86de97 → 19.3.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.3.0
|
3
|
+
"version": "19.3.0",
|
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": {
|
@@ -70,7 +70,7 @@
|
|
70
70
|
"yargs-parser": "21.1.1",
|
71
71
|
"node-machine-id": "1.1.12",
|
72
72
|
"ora": "5.3.0",
|
73
|
-
"@nrwl/tao": "19.3.0
|
73
|
+
"@nrwl/tao": "19.3.0"
|
74
74
|
},
|
75
75
|
"peerDependencies": {
|
76
76
|
"@swc-node/register": "^1.8.0",
|
@@ -85,16 +85,16 @@
|
|
85
85
|
}
|
86
86
|
},
|
87
87
|
"optionalDependencies": {
|
88
|
-
"@nx/nx-darwin-x64": "19.3.0
|
89
|
-
"@nx/nx-darwin-arm64": "19.3.0
|
90
|
-
"@nx/nx-linux-x64-gnu": "19.3.0
|
91
|
-
"@nx/nx-linux-x64-musl": "19.3.0
|
92
|
-
"@nx/nx-win32-x64-msvc": "19.3.0
|
93
|
-
"@nx/nx-linux-arm64-gnu": "19.3.0
|
94
|
-
"@nx/nx-linux-arm64-musl": "19.3.0
|
95
|
-
"@nx/nx-linux-arm-gnueabihf": "19.3.0
|
96
|
-
"@nx/nx-win32-arm64-msvc": "19.3.0
|
97
|
-
"@nx/nx-freebsd-x64": "19.3.0
|
88
|
+
"@nx/nx-darwin-x64": "19.3.0",
|
89
|
+
"@nx/nx-darwin-arm64": "19.3.0",
|
90
|
+
"@nx/nx-linux-x64-gnu": "19.3.0",
|
91
|
+
"@nx/nx-linux-x64-musl": "19.3.0",
|
92
|
+
"@nx/nx-win32-x64-msvc": "19.3.0",
|
93
|
+
"@nx/nx-linux-arm64-gnu": "19.3.0",
|
94
|
+
"@nx/nx-linux-arm64-musl": "19.3.0",
|
95
|
+
"@nx/nx-linux-arm-gnueabihf": "19.3.0",
|
96
|
+
"@nx/nx-win32-arm64-msvc": "19.3.0",
|
97
|
+
"@nx/nx-freebsd-x64": "19.3.0"
|
98
98
|
},
|
99
99
|
"nx-migrations": {
|
100
100
|
"migrations": "./migrations.json",
|
@@ -289,15 +289,16 @@ function getPackageParent(path, packages) {
|
|
289
289
|
function mapSnapshots(rootLockFile, graph) {
|
290
290
|
const nestedNodes = new Set();
|
291
291
|
const visitedNodes = new Map();
|
292
|
-
const visitedPaths = new Set();
|
293
292
|
const remappedPackages = new Map();
|
294
293
|
// add first level children
|
295
294
|
Object.values(graph.externalNodes).forEach((node) => {
|
296
295
|
if (node.name === `npm:${node.data.packageName}`) {
|
297
296
|
const mappedPackage = mapPackage(rootLockFile, node.data.packageName, node.data.version);
|
298
297
|
remappedPackages.set(mappedPackage.path, mappedPackage);
|
299
|
-
visitedNodes.set(node,
|
300
|
-
|
298
|
+
visitedNodes.set(node, {
|
299
|
+
packagePaths: new Set([mappedPackage.path]),
|
300
|
+
unresolvedParents: new Set(),
|
301
|
+
});
|
301
302
|
}
|
302
303
|
else {
|
303
304
|
nestedNodes.add(node);
|
@@ -306,7 +307,7 @@ function mapSnapshots(rootLockFile, graph) {
|
|
306
307
|
let remappedPackagesArray;
|
307
308
|
if (nestedNodes.size) {
|
308
309
|
const invertedGraph = (0, operators_1.reverse)(graph);
|
309
|
-
nestMappedPackages(invertedGraph, remappedPackages, nestedNodes, visitedNodes,
|
310
|
+
nestMappedPackages(invertedGraph, remappedPackages, nestedNodes, visitedNodes, rootLockFile);
|
310
311
|
// initially we naively map package paths to topParent/../parent/child
|
311
312
|
// but some of those should be nested higher up the tree
|
312
313
|
remappedPackagesArray = elevateNestedPaths(remappedPackages);
|
@@ -332,31 +333,34 @@ function mapPackage(rootLockFile, packageName, version, parentPath = '') {
|
|
332
333
|
valueV3,
|
333
334
|
};
|
334
335
|
}
|
335
|
-
function nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes,
|
336
|
+
function nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes, rootLockFile) {
|
336
337
|
const initialSize = nestedNodes.size;
|
337
338
|
if (!initialSize) {
|
338
339
|
return;
|
339
340
|
}
|
340
341
|
nestedNodes.forEach((node) => {
|
341
|
-
|
342
|
+
if (!visitedNodes.has(node)) {
|
343
|
+
visitedNodes.set(node, {
|
344
|
+
packagePaths: new Set(),
|
345
|
+
unresolvedParents: new Set(invertedGraph.dependencies[node.name].map(({ target }) => target)),
|
346
|
+
});
|
347
|
+
}
|
342
348
|
invertedGraph.dependencies[node.name].forEach(({ target }) => {
|
349
|
+
if (!visitedNodes.get(node).unresolvedParents.has(target)) {
|
350
|
+
return;
|
351
|
+
}
|
343
352
|
const targetNode = invertedGraph.externalNodes[target];
|
344
|
-
if (visitedNodes.has(targetNode)
|
345
|
-
visitedNodes.get(targetNode).
|
353
|
+
if (visitedNodes.has(targetNode) &&
|
354
|
+
!visitedNodes.get(targetNode).unresolvedParents.size) {
|
355
|
+
visitedNodes.get(targetNode).packagePaths.forEach((path) => {
|
346
356
|
const mappedPackage = mapPackage(rootLockFile, node.data.packageName, node.data.version, path + '/');
|
347
357
|
result.set(mappedPackage.path, mappedPackage);
|
348
|
-
|
349
|
-
|
350
|
-
}
|
351
|
-
else {
|
352
|
-
visitedNodes.set(node, new Set([mappedPackage.path]));
|
353
|
-
}
|
354
|
-
visitedPaths.add(mappedPackage.path);
|
358
|
+
visitedNodes.get(node).packagePaths.add(mappedPackage.path);
|
359
|
+
visitedNodes.get(node).unresolvedParents.delete(target);
|
355
360
|
});
|
356
|
-
unresolvedParents--;
|
357
361
|
}
|
358
362
|
});
|
359
|
-
if (!unresolvedParents) {
|
363
|
+
if (!visitedNodes.get(node).unresolvedParents.size) {
|
360
364
|
nestedNodes.delete(node);
|
361
365
|
}
|
362
366
|
});
|
@@ -367,7 +371,7 @@ function nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes, vi
|
|
367
371
|
].join('\n'));
|
368
372
|
}
|
369
373
|
else {
|
370
|
-
nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes,
|
374
|
+
nestMappedPackages(invertedGraph, result, nestedNodes, visitedNodes, rootLockFile);
|
371
375
|
}
|
372
376
|
}
|
373
377
|
// sort paths by number of segments and then alphabetically
|
@@ -9,12 +9,12 @@ import { LoadedNxPlugin } from '../plugins/internal-api';
|
|
9
9
|
* @param nxJson
|
10
10
|
*/
|
11
11
|
export declare function retrieveWorkspaceFiles(workspaceRoot: string, projectRootMap: Record<string, string>): Promise<{
|
12
|
-
allWorkspaceFiles: import("
|
12
|
+
allWorkspaceFiles: import("nx/src/devkit-exports").FileData[];
|
13
13
|
fileMap: {
|
14
14
|
projectFileMap: ProjectFiles;
|
15
|
-
nonProjectFiles: import("
|
15
|
+
nonProjectFiles: import("nx/src/native").FileData[];
|
16
16
|
};
|
17
|
-
rustReferences: import("
|
17
|
+
rustReferences: import("nx/src/native").NxWorkspaceFilesExternals;
|
18
18
|
}>;
|
19
19
|
/**
|
20
20
|
* Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.
|