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.
@@ -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,QAkBrB;AAkBD,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAU9D"}
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 invalidTasks = [];
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
- invalidTasks.push(task);
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 (invalidTasks.length > 0) {
128
- throw new NonParallelTaskDependsOnContinuousTasksError(invalidTasks, taskGraph);
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;CAGR"}
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;