nx 19.8.8 → 19.8.10
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 +12 -12
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/cache.js +2 -1
- package/src/tasks-runner/create-task-graph.d.ts +15 -0
- package/src/tasks-runner/create-task-graph.js +37 -9
- package/src/utils/task-history.d.ts +1 -1
- package/src/utils/task-history.js +2 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.8.
|
3
|
+
"version": "19.8.10",
|
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": {
|
@@ -67,7 +67,7 @@
|
|
67
67
|
"yargs-parser": "21.1.1",
|
68
68
|
"node-machine-id": "1.1.12",
|
69
69
|
"ora": "5.3.0",
|
70
|
-
"@nrwl/tao": "19.8.
|
70
|
+
"@nrwl/tao": "19.8.10"
|
71
71
|
},
|
72
72
|
"peerDependencies": {
|
73
73
|
"@swc-node/register": "^1.8.0",
|
@@ -82,16 +82,16 @@
|
|
82
82
|
}
|
83
83
|
},
|
84
84
|
"optionalDependencies": {
|
85
|
-
"@nx/nx-darwin-x64": "19.8.
|
86
|
-
"@nx/nx-darwin-arm64": "19.8.
|
87
|
-
"@nx/nx-linux-x64-gnu": "19.8.
|
88
|
-
"@nx/nx-linux-x64-musl": "19.8.
|
89
|
-
"@nx/nx-win32-x64-msvc": "19.8.
|
90
|
-
"@nx/nx-linux-arm64-gnu": "19.8.
|
91
|
-
"@nx/nx-linux-arm64-musl": "19.8.
|
92
|
-
"@nx/nx-linux-arm-gnueabihf": "19.8.
|
93
|
-
"@nx/nx-win32-arm64-msvc": "19.8.
|
94
|
-
"@nx/nx-freebsd-x64": "19.8.
|
85
|
+
"@nx/nx-darwin-x64": "19.8.10",
|
86
|
+
"@nx/nx-darwin-arm64": "19.8.10",
|
87
|
+
"@nx/nx-linux-x64-gnu": "19.8.10",
|
88
|
+
"@nx/nx-linux-x64-musl": "19.8.10",
|
89
|
+
"@nx/nx-win32-x64-msvc": "19.8.10",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "19.8.10",
|
91
|
+
"@nx/nx-linux-arm64-musl": "19.8.10",
|
92
|
+
"@nx/nx-linux-arm-gnueabihf": "19.8.10",
|
93
|
+
"@nx/nx-win32-arm64-msvc": "19.8.10",
|
94
|
+
"@nx/nx-freebsd-x64": "19.8.10"
|
95
95
|
},
|
96
96
|
"nx-migrations": {
|
97
97
|
"migrations": "./migrations.json",
|
Binary file
|
@@ -21,7 +21,8 @@ const get_cloud_options_1 = require("../nx-cloud/utilities/get-cloud-options");
|
|
21
21
|
const is_ci_1 = require("../utils/is-ci");
|
22
22
|
const output_1 = require("../utils/output");
|
23
23
|
function dbCacheEnabled(nxJson = (0, nx_json_1.readNxJson)()) {
|
24
|
-
return (
|
24
|
+
return (!native_1.IS_WASM &&
|
25
|
+
process.env.NX_DISABLE_DB !== 'true' &&
|
25
26
|
(nxJson.enableDbCache === true || process.env.NX_DB_CACHE === 'true'));
|
26
27
|
}
|
27
28
|
// Do not change the order of these arguments as this function is used by nx cloud
|
@@ -22,6 +22,21 @@ export declare class ProcessTasks {
|
|
22
22
|
createTask(id: string, project: ProjectGraphProjectNode, target: string, resolvedConfiguration: string | undefined, overrides: Object): Task;
|
23
23
|
resolveConfiguration(project: ProjectGraphProjectNode, target: string, configuration: string | undefined): string;
|
24
24
|
getId(project: string, target: string, configuration: string | undefined): string;
|
25
|
+
/**
|
26
|
+
* this function is used to get the non dummy dependencies of a task recursively
|
27
|
+
* For example, when we have the following dependencies:
|
28
|
+
* {
|
29
|
+
* 'app1:compile': [ 'app2:__nx_dummy_task__' ],
|
30
|
+
* 'app2:__nx_dummy_task__': [ 'app3:__nx_dummy_task__' ],
|
31
|
+
* 'app3:__nx_dummy_task__': [ 'app4:precompile' ],
|
32
|
+
* 'app4:precompile': []
|
33
|
+
* }
|
34
|
+
* getNonDummyDeps('app1:compile') will return ['app1:compile']
|
35
|
+
* getNonDummyDeps('app2:__nx_dummy_task__') will return ['app4:precompile']
|
36
|
+
* getNonDummyDeps('app3:__nx_dummy_task__') will return ['app4:precompile']
|
37
|
+
* getNonDummyDeps('app4:precompile') will return ['app4:precompile']
|
38
|
+
*/
|
39
|
+
private getNonDummyDeps;
|
25
40
|
private filterDummyTasks;
|
26
41
|
}
|
27
42
|
export declare function createTaskGraph(projectGraph: ProjectGraph, extraTargetDependencies: TargetDependencies, projectNames: string[], targets: string[], configuration: string | undefined, overrides: Object, excludeTaskDependencies?: boolean): TaskGraph;
|
@@ -6,6 +6,7 @@ exports.mapTargetDefaultsToDependencies = mapTargetDefaultsToDependencies;
|
|
6
6
|
const utils_1 = require("./utils");
|
7
7
|
const project_graph_utils_1 = require("../utils/project-graph-utils");
|
8
8
|
const output_1 = require("../utils/output");
|
9
|
+
const task_graph_utils_1 = require("./task-graph-utils");
|
9
10
|
const DUMMY_TASK_TARGET = '__nx_dummy_task__';
|
10
11
|
class ProcessTasks {
|
11
12
|
constructor(extraTargetDependencies, projectGraph) {
|
@@ -139,7 +140,7 @@ class ProcessTasks {
|
|
139
140
|
else {
|
140
141
|
const dummyId = this.getId(depProject.name, DUMMY_TASK_TARGET, undefined);
|
141
142
|
this.dependencies[task.id].push(dummyId);
|
142
|
-
this.dependencies[dummyId]
|
143
|
+
this.dependencies[dummyId] ??= [];
|
143
144
|
const noopTask = this.createDummyTask(dummyId, task);
|
144
145
|
this.processTask(noopTask, depProject.name, configuration, overrides);
|
145
146
|
}
|
@@ -188,18 +189,45 @@ class ProcessTasks {
|
|
188
189
|
}
|
189
190
|
return id;
|
190
191
|
}
|
192
|
+
/**
|
193
|
+
* this function is used to get the non dummy dependencies of a task recursively
|
194
|
+
* For example, when we have the following dependencies:
|
195
|
+
* {
|
196
|
+
* 'app1:compile': [ 'app2:__nx_dummy_task__' ],
|
197
|
+
* 'app2:__nx_dummy_task__': [ 'app3:__nx_dummy_task__' ],
|
198
|
+
* 'app3:__nx_dummy_task__': [ 'app4:precompile' ],
|
199
|
+
* 'app4:precompile': []
|
200
|
+
* }
|
201
|
+
* getNonDummyDeps('app1:compile') will return ['app1:compile']
|
202
|
+
* getNonDummyDeps('app2:__nx_dummy_task__') will return ['app4:precompile']
|
203
|
+
* getNonDummyDeps('app3:__nx_dummy_task__') will return ['app4:precompile']
|
204
|
+
* getNonDummyDeps('app4:precompile') will return ['app4:precompile']
|
205
|
+
*/
|
206
|
+
getNonDummyDeps(currentTask, originalTask, cycle) {
|
207
|
+
if (currentTask === originalTask) {
|
208
|
+
return [];
|
209
|
+
}
|
210
|
+
else if (currentTask.endsWith(DUMMY_TASK_TARGET)) {
|
211
|
+
if (cycle?.length && cycle?.includes(currentTask)) {
|
212
|
+
return [];
|
213
|
+
}
|
214
|
+
// if not a cycle, recursively get the non dummy dependencies
|
215
|
+
return (this.dependencies[currentTask]?.flatMap((dep) => this.getNonDummyDeps(dep, originalTask, cycle)) ?? []);
|
216
|
+
}
|
217
|
+
else {
|
218
|
+
return [currentTask];
|
219
|
+
}
|
220
|
+
}
|
191
221
|
filterDummyTasks() {
|
222
|
+
const cycle = (0, task_graph_utils_1.findCycle)({ dependencies: this.dependencies });
|
192
223
|
for (const [key, deps] of Object.entries(this.dependencies)) {
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
normalizedDeps.push(...this.
|
197
|
-
}
|
198
|
-
else {
|
199
|
-
normalizedDeps.push(dep);
|
224
|
+
if (!key.endsWith(DUMMY_TASK_TARGET)) {
|
225
|
+
const normalizedDeps = [];
|
226
|
+
for (const dep of deps) {
|
227
|
+
normalizedDeps.push(...this.getNonDummyDeps(dep, key, cycle));
|
200
228
|
}
|
229
|
+
this.dependencies[key] = normalizedDeps;
|
201
230
|
}
|
202
|
-
this.dependencies[key] = normalizedDeps;
|
203
231
|
}
|
204
232
|
for (const key of Object.keys(this.dependencies)) {
|
205
233
|
if (key.endsWith(DUMMY_TASK_TARGET)) {
|
@@ -12,6 +12,6 @@ export declare class TaskHistory {
|
|
12
12
|
}
|
13
13
|
/**
|
14
14
|
* This function returns the singleton instance of TaskHistory
|
15
|
-
* @returns singleton instance of TaskHistory, null if database is disabled or WASM is
|
15
|
+
* @returns singleton instance of TaskHistory, null if database is disabled or WASM is enabled
|
16
16
|
*/
|
17
17
|
export declare function getTaskHistory(): TaskHistory | null;
|
@@ -38,10 +38,10 @@ exports.TaskHistory = TaskHistory;
|
|
38
38
|
let taskHistory;
|
39
39
|
/**
|
40
40
|
* This function returns the singleton instance of TaskHistory
|
41
|
-
* @returns singleton instance of TaskHistory, null if database is disabled or WASM is
|
41
|
+
* @returns singleton instance of TaskHistory, null if database is disabled or WASM is enabled
|
42
42
|
*/
|
43
43
|
function getTaskHistory() {
|
44
|
-
if (process.env.NX_DISABLE_DB === 'true' ||
|
44
|
+
if (process.env.NX_DISABLE_DB === 'true' || native_1.IS_WASM) {
|
45
45
|
return null;
|
46
46
|
}
|
47
47
|
if (!taskHistory) {
|