nx 21.5.0-beta.0 → 21.5.0-beta.1
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 +11 -11
- package/src/command-line/affected/affected.d.ts.map +1 -1
- package/src/command-line/affected/affected.js +1 -0
- package/src/command-line/graph/graph.d.ts +2 -2
- package/src/command-line/graph/graph.d.ts.map +1 -1
- package/src/command-line/graph/graph.js +89 -166
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +3 -1
- package/src/command-line/run-many/run-many.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +1 -0
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +31 -4
- package/src/daemon/server/shutdown-utils.d.ts.map +1 -1
- package/src/daemon/server/shutdown-utils.js +1 -0
- package/src/executors/run-commands/running-tasks.d.ts +1 -0
- package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
- package/src/executors/run-commands/running-tasks.js +40 -14
- package/src/generators/utils/project-configuration.js +7 -2
- package/src/native/nx.wasi-browser.js +39 -42
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/task-graph-utils.d.ts.map +1 -1
- package/src/tasks-runner/task-graph-utils.js +27 -4
- package/src/utils/promised-based-queue.d.ts +7 -0
- package/src/utils/promised-based-queue.d.ts.map +1 -1
- package/src/utils/promised-based-queue.js +9 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"task-graph-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-graph-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA0BvD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACnD,GAAG,MAAM,EAAE,GAAG,IAAI,CAYlB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACnD,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAerB;AA2BD,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACxC,GAAG,IAAI,CAWP;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,QAyC3B;AAED,wBAAgB,2CAA2C,CACzD,SAAS,EAAE,SAAS,
|
1
|
+
{"version":3,"file":"task-graph-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-graph-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA0BvD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACnD,GAAG,MAAM,EAAE,GAAG,IAAI,CAYlB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACnD,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAerB;AA2BD,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACxC,GAAG,IAAI,CAWP;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,QAyC3B;AAED,wBAAgB,2CAA2C,CACzD,SAAS,EAAE,SAAS,QAgCrB;AAwCD,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAU9D"}
|
@@ -117,15 +117,24 @@ function validateNoAtomizedTasks(taskGraph, projectGraph) {
|
|
117
117
|
process.exit(1);
|
118
118
|
}
|
119
119
|
function assertTaskGraphDoesNotContainInvalidTargets(taskGraph) {
|
120
|
-
const
|
120
|
+
const nonParallelTasksThatDependOnContinuousTasks = [];
|
121
|
+
const nonParallelContinuousTasksThatAreDependedOn = [];
|
121
122
|
for (const task of Object.values(taskGraph.tasks)) {
|
122
123
|
if (task.parallelism === false &&
|
123
124
|
taskGraph.continuousDependencies[task.id].length > 0) {
|
124
|
-
|
125
|
+
nonParallelTasksThatDependOnContinuousTasks.push(task);
|
125
126
|
}
|
127
|
+
for (const dependency of taskGraph.continuousDependencies[task.id]) {
|
128
|
+
if (taskGraph.tasks[dependency].parallelism === false) {
|
129
|
+
nonParallelContinuousTasksThatAreDependedOn.push(taskGraph.tasks[dependency]);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
}
|
133
|
+
if (nonParallelTasksThatDependOnContinuousTasks.length > 0) {
|
134
|
+
throw new NonParallelTaskDependsOnContinuousTasksError(nonParallelTasksThatDependOnContinuousTasks, taskGraph);
|
126
135
|
}
|
127
|
-
if (
|
128
|
-
throw new
|
136
|
+
if (nonParallelContinuousTasksThatAreDependedOn.length > 0) {
|
137
|
+
throw new DependingOnNonParallelContinuousTaskError(nonParallelContinuousTasksThatAreDependedOn, taskGraph);
|
129
138
|
}
|
130
139
|
}
|
131
140
|
class NonParallelTaskDependsOnContinuousTasksError extends Error {
|
@@ -139,6 +148,20 @@ class NonParallelTaskDependsOnContinuousTasksError extends Error {
|
|
139
148
|
this.name = 'NonParallelTaskDependsOnContinuousTasksError';
|
140
149
|
}
|
141
150
|
}
|
151
|
+
class DependingOnNonParallelContinuousTaskError extends Error {
|
152
|
+
constructor(invalidTasks, taskGraph) {
|
153
|
+
let message = 'The following continuous tasks do not support parallelism but are depended on:';
|
154
|
+
for (const task of invalidTasks) {
|
155
|
+
const dependents = Object.keys(taskGraph.continuousDependencies).filter((parentTaskId) => taskGraph.continuousDependencies[parentTaskId].includes(task.id));
|
156
|
+
message += `\n - ${task.id} <- ${dependents.join(', ')}`;
|
157
|
+
}
|
158
|
+
message +=
|
159
|
+
'\nParallelism must be enabled for a continuous task if it is depended on, as the tasks that depend on it will run in parallel with it.';
|
160
|
+
super(message);
|
161
|
+
this.invalidTasks = invalidTasks;
|
162
|
+
this.name = 'DependingOnNonParallelContinuousTaskError';
|
163
|
+
}
|
164
|
+
}
|
142
165
|
function getLeafTasks(taskGraph) {
|
143
166
|
const reversed = reverseTaskGraph(taskGraph);
|
144
167
|
const leafTasks = new Set();
|
@@ -3,5 +3,12 @@ export declare class PromisedBasedQueue {
|
|
3
3
|
private promise;
|
4
4
|
sendToQueue(fn: () => Promise<any>): Promise<any>;
|
5
5
|
isEmpty(): boolean;
|
6
|
+
/**
|
7
|
+
* Used to decrement the internal counter representing the number of active promises in the queue.
|
8
|
+
* This is useful for retrying a failed daemon message, as we want to be able to shut the daemon down
|
9
|
+
* without marking the promise that represents the failed message as settled. To do so, we store
|
10
|
+
* the promise in a separate variable and only resolve or reject it later.
|
11
|
+
*/
|
12
|
+
decrementQueueCounter(): void;
|
6
13
|
}
|
7
14
|
//# sourceMappingURL=promised-based-queue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"promised-based-queue.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/promised-based-queue.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAyB;IAExC,WAAW,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IA8BjD,OAAO;
|
1
|
+
{"version":3,"file":"promised-based-queue.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/promised-based-queue.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAyB;IAExC,WAAW,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IA8BjD,OAAO;IAIP;;;;;OAKG;IACH,qBAAqB;CAGtB"}
|
@@ -39,5 +39,14 @@ class PromisedBasedQueue {
|
|
39
39
|
isEmpty() {
|
40
40
|
return this.counter === 0;
|
41
41
|
}
|
42
|
+
/**
|
43
|
+
* Used to decrement the internal counter representing the number of active promises in the queue.
|
44
|
+
* This is useful for retrying a failed daemon message, as we want to be able to shut the daemon down
|
45
|
+
* without marking the promise that represents the failed message as settled. To do so, we store
|
46
|
+
* the promise in a separate variable and only resolve or reject it later.
|
47
|
+
*/
|
48
|
+
decrementQueueCounter() {
|
49
|
+
this.counter--;
|
50
|
+
}
|
42
51
|
}
|
43
52
|
exports.PromisedBasedQueue = PromisedBasedQueue;
|