nx 22.0.0-canary.20251016-849f356 → 22.0.0-rc.0

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 (84) hide show
  1. package/bin/nx.js +3 -0
  2. package/migrations.json +37 -0
  3. package/package.json +12 -11
  4. package/src/command-line/add/add.d.ts.map +1 -1
  5. package/src/command-line/add/add.js +3 -5
  6. package/src/command-line/init/configure-plugins.d.ts.map +1 -1
  7. package/src/command-line/init/configure-plugins.js +2 -3
  8. package/src/command-line/init/init-v2.d.ts.map +1 -1
  9. package/src/command-line/init/init-v2.js +18 -0
  10. package/src/command-line/migrate/migrate.d.ts.map +1 -1
  11. package/src/command-line/migrate/migrate.js +16 -0
  12. package/src/command-line/nx-cloud/complete-run/command-object.d.ts +3 -0
  13. package/src/command-line/nx-cloud/complete-run/command-object.d.ts.map +1 -0
  14. package/src/command-line/nx-cloud/complete-run/command-object.js +16 -0
  15. package/src/command-line/nx-cloud/complete-run/stop-all-agents.d.ts +5 -0
  16. package/src/command-line/nx-cloud/complete-run/stop-all-agents.d.ts.map +1 -0
  17. package/src/command-line/nx-cloud/complete-run/stop-all-agents.js +7 -0
  18. package/src/command-line/nx-cloud/start-agent/command-object.d.ts +3 -0
  19. package/src/command-line/nx-cloud/start-agent/command-object.d.ts.map +1 -0
  20. package/src/command-line/nx-cloud/start-agent/command-object.js +15 -0
  21. package/src/command-line/nx-cloud/start-agent/start-agent.d.ts +5 -0
  22. package/src/command-line/nx-cloud/start-agent/start-agent.d.ts.map +1 -0
  23. package/src/command-line/nx-cloud/start-agent/start-agent.js +7 -0
  24. package/src/command-line/nx-cloud/start-ci-run/command-object.js +1 -1
  25. package/src/command-line/nx-commands.d.ts.map +1 -1
  26. package/src/command-line/nx-commands.js +11 -7
  27. package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
  28. package/src/command-line/release/version/release-group-processor.js +5 -3
  29. package/src/command-line/release/version/resolve-current-version.d.ts.map +1 -1
  30. package/src/command-line/release/version/resolve-current-version.js +2 -4
  31. package/src/command-line/sync/sync.d.ts.map +1 -1
  32. package/src/command-line/sync/sync.js +2 -3
  33. package/src/core/graph/main.js +1 -1
  34. package/src/devkit-internals.d.ts +1 -0
  35. package/src/devkit-internals.d.ts.map +1 -1
  36. package/src/devkit-internals.js +3 -1
  37. package/src/generators/utils/project-configuration.js +13 -1
  38. package/src/migrations/update-15-0-0/prefix-outputs.d.ts +3 -0
  39. package/src/migrations/update-15-0-0/prefix-outputs.d.ts.map +1 -0
  40. package/src/migrations/update-15-0-0/prefix-outputs.js +49 -0
  41. package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +3 -0
  42. package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts.map +1 -0
  43. package/src/migrations/update-16-0-0/remove-nrwl-cli.js +16 -0
  44. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +3 -0
  45. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts.map +1 -0
  46. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +97 -0
  47. package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +3 -0
  48. package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts.map +1 -0
  49. package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +29 -0
  50. package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +3 -0
  51. package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts.map +1 -0
  52. package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +45 -0
  53. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +13 -0
  54. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts.map +1 -0
  55. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +67 -0
  56. package/src/native/nx.wasm32-wasi.wasm +0 -0
  57. package/src/plugins/package-json/create-nodes.js +1 -1
  58. package/src/plugins/project-json/build-nodes/project-json.d.ts +0 -1
  59. package/src/plugins/project-json/build-nodes/project-json.d.ts.map +1 -1
  60. package/src/plugins/project-json/build-nodes/project-json.js +1 -13
  61. package/src/project-graph/plugins/public-api.d.ts +1 -1
  62. package/src/project-graph/plugins/public-api.d.ts.map +1 -1
  63. package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
  64. package/src/project-graph/utils/project-configuration-utils.js +9 -0
  65. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts.map +1 -1
  66. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +8 -2
  67. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts.map +1 -1
  68. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +8 -2
  69. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +1 -1
  70. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
  71. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +83 -55
  72. package/src/utils/catalog/index.d.ts +1 -1
  73. package/src/utils/catalog/index.d.ts.map +1 -1
  74. package/src/utils/catalog/manager.d.ts +1 -0
  75. package/src/utils/catalog/manager.d.ts.map +1 -1
  76. package/src/utils/catalog/pnpm-manager.d.ts +1 -0
  77. package/src/utils/catalog/pnpm-manager.d.ts.map +1 -1
  78. package/src/utils/catalog/pnpm-manager.js +3 -0
  79. package/src/utils/delayed-spinner.d.ts +2 -2
  80. package/src/utils/delayed-spinner.d.ts.map +1 -1
  81. package/src/utils/delayed-spinner.js +8 -10
  82. package/src/utils/spinner.d.ts +13 -0
  83. package/src/utils/spinner.d.ts.map +1 -0
  84. package/src/utils/spinner.js +61 -0
@@ -14,7 +14,7 @@ export declare function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, ta
14
14
  initiatingTasks: Task[];
15
15
  resolveRenderIsDonePromise: (value: void) => void;
16
16
  }): {
17
- lifeCycle: Partial<LifeCycle>;
17
+ lifeCycle: LifeCycle;
18
18
  printSummary: () => void;
19
19
  };
20
20
  //# sourceMappingURL=tui-summary-life-cycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tui-summary-life-cycle.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/tasks-runner/life-cycles/tui-summary-life-cycle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAa/C,wBAAgB,8BAA8B,CAAC,EAC7C,YAAY,EACZ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,0BAA0B,GAC3B,EAAE;IACD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,IAAI,EAAE,CAAC;IACxB,0BAA0B,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;CACnD;;;EAkbA"}
1
+ {"version":3,"file":"tui-summary-life-cycle.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/tasks-runner/life-cycles/tui-summary-life-cycle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAa/C,wBAAgB,8BAA8B,CAAC,EAC7C,YAAY,EACZ,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,0BAA0B,GAC3B,EAAE;IACD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,IAAI,EAAE,CAAC;IACxB,0BAA0B,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;CACnD;eAqekC,SAAS;;EAC3C"}
@@ -39,8 +39,13 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
39
39
  tasksToTerminalOutputs[taskId] += output;
40
40
  };
41
41
  // TODO(@AgentEnder): The following 2 methods should be one but will need more refactoring
42
- lifeCycle.printTaskTerminalOutput = (task, taskStatus) => {
42
+ lifeCycle.printTaskTerminalOutput = (task, taskStatus, output) => {
43
43
  tasksToTaskStatus[task.id] = taskStatus;
44
+ // Store the complete output for display in the summary
45
+ // This is called with the full output for cached and executed tasks
46
+ if (output) {
47
+ tasksToTerminalOutputs[task.id] = output;
48
+ }
44
49
  };
45
50
  lifeCycle.setTaskStatus = (taskId, taskStatus) => {
46
51
  if (taskStatus === 9 /* NativeTaskStatus.Stopped */) {
@@ -106,7 +111,6 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
106
111
  (0, task_history_life_cycle_1.getTasksHistoryLifeCycle)().printFlakyTasksMessage();
107
112
  };
108
113
  const printRunOneSummary = ({ failure, cancelled, }) => {
109
- let lines = [];
110
114
  // Prints task outputs in the order they were completed
111
115
  // above the summary, since run-one should print all task results.
112
116
  for (const taskId of taskIdsInTheOrderTheyStart) {
@@ -114,62 +118,71 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
114
118
  const terminalOutput = tasksToTerminalOutputs[taskId];
115
119
  output_1.output.logCommandOutput(taskId, taskStatus, terminalOutput);
116
120
  }
117
- lines.push(...output_1.output.getVerticalSeparatorLines(failure ? 'red' : 'green'));
121
+ // Print vertical separator
122
+ const separatorLines = output_1.output.getVerticalSeparatorLines(failure ? 'red' : 'green');
123
+ for (const line of separatorLines) {
124
+ console.log(line);
125
+ }
118
126
  if (!failure && !cancelled) {
119
127
  const text = `Successfully ran ${(0, formatting_utils_1.formatTargetsAndProjects)([initiatingProject], targets, tasks)}`;
120
- const taskOverridesLines = [];
128
+ // Build success message with color applied to the entire block
129
+ const messageLines = [
130
+ output_1.output.applyNxPrefix('green', output_1.output.colors.green(text) + output_1.output.dim(` (${timeTakenText})`)),
131
+ ];
121
132
  const filteredOverrides = Object.entries(overrides).filter(
122
133
  // Don't print the data passed through from the version subcommand to the publish executor options, it could be quite large and it's an implementation detail.
123
134
  ([flag]) => flag !== 'nxReleaseVersionData');
124
135
  if (filteredOverrides.length > 0) {
125
- taskOverridesLines.push('');
126
- taskOverridesLines.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.green('With additional flags:')}`);
136
+ messageLines.push('');
137
+ messageLines.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.green('With additional flags:')}`);
127
138
  filteredOverrides
128
139
  .map(([flag, value]) => output_1.output.dim.green((0, formatting_utils_1.formatFlags)(EXTENDED_LEFT_PAD, flag, value)))
129
- .forEach((arg) => taskOverridesLines.push(arg));
140
+ .forEach((arg) => messageLines.push(arg));
130
141
  }
131
- lines.push(output_1.output.applyNxPrefix('green', output_1.output.colors.green(text) + output_1.output.dim(` (${timeTakenText})`)), ...taskOverridesLines);
132
142
  if (totalCachedTasks > 0) {
133
- lines.push(output_1.output.dim(`${node_os_1.EOL}Nx read the output from the cache instead of running the command for ${totalCachedTasks} out of ${totalTasks} tasks.`));
143
+ messageLines.push(output_1.output.dim(`${node_os_1.EOL}Nx read the output from the cache instead of running the command for ${totalCachedTasks} out of ${totalTasks} tasks.`));
134
144
  }
135
- lines = [output_1.output.colors.green(lines.join(node_os_1.EOL))];
145
+ // Print the entire success message block with green color
146
+ console.log(output_1.output.colors.green(messageLines.join(node_os_1.EOL)));
136
147
  }
137
148
  else if (!cancelled) {
138
149
  let text = `Ran target ${output_1.output.bold(targets[0])} for project ${output_1.output.bold(initiatingProject)}`;
139
150
  if (tasks.length > 1) {
140
151
  text += ` and ${output_1.output.bold(tasks.length - 1)} task(s) they depend on`;
141
152
  }
142
- const taskOverridesLines = [];
153
+ // Build failure message lines
154
+ const messageLines = [
155
+ output_1.output.applyNxPrefix('red', output_1.output.colors.red(text) + output_1.output.dim(` (${timeTakenText})`)),
156
+ ];
143
157
  const filteredOverrides = Object.entries(overrides).filter(
144
158
  // Don't print the data passed through from the version subcommand to the publish executor options, it could be quite large and it's an implementation detail.
145
159
  ([flag]) => flag !== 'nxReleaseVersionData');
146
160
  if (filteredOverrides.length > 0) {
147
- taskOverridesLines.push('');
148
- taskOverridesLines.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.red('With additional flags:')}`);
161
+ messageLines.push('');
162
+ messageLines.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.red('With additional flags:')}`);
149
163
  filteredOverrides
150
164
  .map(([flag, value]) => output_1.output.dim.red((0, formatting_utils_1.formatFlags)(EXTENDED_LEFT_PAD, flag, value)))
151
- .forEach((arg) => taskOverridesLines.push(arg));
165
+ .forEach((arg) => messageLines.push(arg));
152
166
  }
167
+ messageLines.push('');
168
+ messageLines.push(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} failed`);
169
+ messageLines.push(`${LEFT_PAD}${output_1.output.dim(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`);
153
170
  const viewLogs = (0, view_logs_utils_1.viewLogsFooterRows)(totalFailedTasks);
154
- lines.push(output_1.output.colors.red([
155
- output_1.output.applyNxPrefix('red', output_1.output.colors.red(text) + output_1.output.dim(` (${timeTakenText})`)),
156
- ...taskOverridesLines,
157
- '',
158
- `${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} failed`,
159
- `${LEFT_PAD}${output_1.output.dim(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`,
160
- ...viewLogs,
161
- ].join(node_os_1.EOL)));
171
+ messageLines.push(...viewLogs);
172
+ // Print the entire failure message block with red color
173
+ console.log(output_1.output.colors.red(messageLines.join(node_os_1.EOL)));
162
174
  }
163
175
  else {
164
- lines.push(output_1.output.applyNxPrefix('red', output_1.output.colors.red(`Cancelled running target ${output_1.output.bold(targets[0])} for project ${output_1.output.bold(initiatingProject)}`) + output_1.output.dim(` (${timeTakenText})`)));
176
+ console.log(output_1.output.applyNxPrefix('red', output_1.output.colors.red(`Cancelled running target ${output_1.output.bold(targets[0])} for project ${output_1.output.bold(initiatingProject)}`) + output_1.output.dim(` (${timeTakenText})`)));
165
177
  }
166
178
  // adds some vertical space after the summary to avoid bunching against terminal
167
- lines.push('');
168
- console.log(lines.join(node_os_1.EOL));
179
+ console.log('');
169
180
  };
170
181
  const printRunManySummary = ({ failure, cancelled, }) => {
171
182
  console.log('');
172
- const lines = [''];
183
+ // Collect checklist lines to print after task outputs
184
+ const checklistLines = [];
185
+ // First pass: Print task outputs and collect checklist lines
173
186
  for (const taskId of taskIdsInTheOrderTheyStart) {
174
187
  const taskStatus = tasksToTaskStatus[taskId];
175
188
  const terminalOutput = tasksToTerminalOutputs[taskId];
@@ -177,66 +190,82 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
177
190
  if (!taskStatus) {
178
191
  output_1.output.logCommandOutput(taskId, taskStatus, terminalOutput);
179
192
  output_1.output.addNewline();
180
- lines.push(`${LEFT_PAD}${output_1.output.colors.cyan(figures.squareSmallFilled)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
193
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.cyan(figures.squareSmallFilled)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
181
194
  }
182
195
  else if (taskStatus === 'failure') {
183
196
  output_1.output.logCommandOutput(taskId, taskStatus, terminalOutput);
184
197
  output_1.output.addNewline();
185
- lines.push(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
198
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
199
+ }
200
+ else if (taskStatus === 'local-cache') {
201
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId} ${output_1.output.dim('[local cache]')}`);
202
+ }
203
+ else if (taskStatus === 'local-cache-kept-existing') {
204
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId} ${output_1.output.dim('[existing outputs match the cache, left as is]')}`);
205
+ }
206
+ else if (taskStatus === 'remote-cache') {
207
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId} ${output_1.output.dim('[remote cache]')}`);
208
+ }
209
+ else if (taskStatus === 'success') {
210
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
186
211
  }
187
212
  else {
188
- lines.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
213
+ checklistLines.push(`${LEFT_PAD}${output_1.output.colors.green(figures.tick)}${SPACER}${output_1.output.colors.gray('nx run ')}${taskId}`);
189
214
  }
190
215
  }
191
- lines.push(...output_1.output.getVerticalSeparatorLines(failure ? 'red' : 'green'));
216
+ // Print all checklist lines together
217
+ console.log();
218
+ for (const line of checklistLines) {
219
+ console.log(line);
220
+ }
221
+ // Print vertical separator
222
+ const separatorLines = output_1.output.getVerticalSeparatorLines(failure ? 'red' : 'green');
223
+ for (const line of separatorLines) {
224
+ console.log(line);
225
+ }
192
226
  if (totalSuccessfulTasks + stoppedTasks.size === totalTasks) {
193
- const successSummaryRows = [];
194
227
  const text = `Successfully ran ${(0, formatting_utils_1.formatTargetsAndProjects)(projectNames, targets, tasks)}`;
195
- const taskOverridesRows = [];
228
+ const successSummaryRows = [
229
+ output_1.output.applyNxPrefix('green', output_1.output.colors.green(text) + output_1.output.dim.white(` (${timeTakenText})`)),
230
+ ];
196
231
  const filteredOverrides = Object.entries(overrides).filter(
197
232
  // Don't print the data passed through from the version subcommand to the publish executor options, it could be quite large and it's an implementation detail.
198
233
  ([flag]) => flag !== 'nxReleaseVersionData');
199
234
  if (filteredOverrides.length > 0) {
200
- taskOverridesRows.push('');
201
- taskOverridesRows.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.green('With additional flags:')}`);
235
+ successSummaryRows.push('');
236
+ successSummaryRows.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.green('With additional flags:')}`);
202
237
  filteredOverrides
203
238
  .map(([flag, value]) => output_1.output.dim.green((0, formatting_utils_1.formatFlags)(EXTENDED_LEFT_PAD, flag, value)))
204
- .forEach((arg) => taskOverridesRows.push(arg));
239
+ .forEach((arg) => successSummaryRows.push(arg));
205
240
  }
206
- successSummaryRows.push(...[
207
- output_1.output.applyNxPrefix('green', output_1.output.colors.green(text) + output_1.output.dim.white(` (${timeTakenText})`)),
208
- ...taskOverridesRows,
209
- ]);
210
241
  if (totalCachedTasks > 0) {
211
242
  successSummaryRows.push(output_1.output.dim(`${node_os_1.EOL}Nx read the output from the cache instead of running the command for ${totalCachedTasks} out of ${totalTasks} tasks.`));
212
243
  }
213
- lines.push(successSummaryRows.join(node_os_1.EOL));
244
+ console.log(successSummaryRows.join(node_os_1.EOL));
214
245
  }
215
246
  else {
216
247
  const text = `${cancelled ? 'Cancelled while running' : 'Ran'} ${(0, formatting_utils_1.formatTargetsAndProjects)(projectNames, targets, tasks)}`;
217
- const taskOverridesRows = [];
248
+ const failureSummaryRows = [
249
+ output_1.output.applyNxPrefix('red', output_1.output.colors.red(text) + output_1.output.dim.white(` (${timeTakenText})`)),
250
+ ];
218
251
  const filteredOverrides = Object.entries(overrides).filter(
219
252
  // Don't print the data passed through from the version subcommand to the publish executor options, it could be quite large and it's an implementation detail.
220
253
  ([flag]) => flag !== 'nxReleaseVersionData');
221
254
  if (filteredOverrides.length > 0) {
222
- taskOverridesRows.push('');
223
- taskOverridesRows.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.red('With additional flags:')}`);
255
+ failureSummaryRows.push('');
256
+ failureSummaryRows.push(`${EXTENDED_LEFT_PAD}${output_1.output.dim.red('With additional flags:')}`);
224
257
  filteredOverrides
225
258
  .map(([flag, value]) => output_1.output.dim.red((0, formatting_utils_1.formatFlags)(EXTENDED_LEFT_PAD, flag, value)))
226
- .forEach((arg) => taskOverridesRows.push(arg));
259
+ .forEach((arg) => failureSummaryRows.push(arg));
227
260
  }
228
- const numFailedToPrint = 5;
229
- const failedTasksForPrinting = Array.from(failedTasks).slice(0, numFailedToPrint);
230
- const failureSummaryRows = [
231
- output_1.output.applyNxPrefix('red', output_1.output.colors.red(text) + output_1.output.dim.white(` (${timeTakenText})`)),
232
- ...taskOverridesRows,
233
- '',
234
- ];
261
+ failureSummaryRows.push('');
235
262
  if (totalCompletedTasks > 0) {
236
263
  if (totalSuccessfulTasks > 0) {
237
264
  failureSummaryRows.push(output_1.output.dim(`${LEFT_PAD}${output_1.output.dim(figures.tick)}${SPACER}${totalSuccessfulTasks}${`/${totalCompletedTasks}`} succeeded ${output_1.output.dim(`[${totalCachedTasks} read from cache]`)}`), '');
238
265
  }
239
266
  if (totalFailedTasks > 0) {
267
+ const numFailedToPrint = 5;
268
+ const failedTasksForPrinting = Array.from(failedTasks).slice(0, numFailedToPrint);
240
269
  failureSummaryRows.push(`${LEFT_PAD}${output_1.output.colors.red(figures.cross)}${SPACER}${totalFailedTasks}${`/${totalCompletedTasks}`} targets failed, including the following:`, '', `${failedTasksForPrinting
241
270
  .map((t) => `${EXTENDED_LEFT_PAD}${output_1.output.colors.red('-')} ${output_1.output.formatCommand(t.toString())}`)
242
271
  .join('\n')}`, '');
@@ -256,12 +285,11 @@ function getTuiTerminalSummaryLifeCycle({ projectNames, tasks, taskGraph, args,
256
285
  }
257
286
  }
258
287
  failureSummaryRows.push(...(0, view_logs_utils_1.viewLogsFooterRows)(failedTasks.size));
259
- lines.push(output_1.output.colors.red(failureSummaryRows.join(node_os_1.EOL)));
260
288
  }
289
+ console.log(output_1.output.colors.red(failureSummaryRows.join(node_os_1.EOL)));
261
290
  }
262
291
  // adds some vertical space after the summary to avoid bunching against terminal
263
- lines.push('');
264
- console.log(lines.join(node_os_1.EOL));
292
+ console.log('');
265
293
  };
266
- return { lifeCycle, printSummary };
294
+ return { lifeCycle: lifeCycle, printSummary };
267
295
  }
@@ -1,7 +1,7 @@
1
1
  import type { Tree } from '../../generators/tree';
2
2
  import type { CatalogManager } from './manager';
3
3
  import { getCatalogManager } from './manager-factory';
4
- export { getCatalogManager };
4
+ export { type CatalogManager, getCatalogManager };
5
5
  /**
6
6
  * Detects which packages in a package.json use catalog references
7
7
  * Returns Map of package name -> catalog name (undefined for default catalog)
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/catalog/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,cAAc,GACtB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CA+BjC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/catalog/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,KAAK,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAElD;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,cAAc,GACtB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CA+BjC"}
@@ -8,6 +8,7 @@ export interface CatalogManager {
8
8
  readonly name: string;
9
9
  isCatalogReference(version: string): boolean;
10
10
  parseCatalogReference(version: string): CatalogReference | null;
11
+ getCatalogDefinitionFilePaths(): string[];
11
12
  /**
12
13
  * Get catalog definitions from the workspace.
13
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/catalog/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;GAEG;AACH,MAAM,WA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AC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,GACD,IAAI,CAAC;IACR,qBAAqB,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,KAAK,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,GACD,IAAI,CAAC;CACT"}
@@ -10,6 +10,7 @@ export declare class PnpmCatalogManager implements CatalogManager {
10
10
  readonly catalogProtocol = "catalog:";
11
11
  isCatalogReference(version: string): boolean;
12
12
  parseCatalogReference(version: string): CatalogReference | null;
13
+ getCatalogDefinitionFilePaths(): string[];
13
14
  getCatalogDefinitions(treeOrRoot: Tree | string): PnpmWorkspaceYaml | null;
14
15
  resolveCatalogReference(treeOrRoot: Tree | string, packageName: string, version: string): string | null;
15
16
  validateCatalogReference(treeOrRoot: Tree | string, packageName: string, version: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/utils/catalog/pnpm-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,eAAe,cAAc;IAEtC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI5C,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAe/D,qBAAqB,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,GAAG,iBAAiB,GA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M,GAAG,IAAI;IAuBhB,wBAAwB,CACtB,UAAU,EAAE,IAAI,GAAG,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,IAAI;IA0HP,qBAAqB,CACnB,UAAU,EAAE,IAAI,GAAG,MAAM,EACzB,OAAO,EAAE,KAAK,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,GACD,IAAI;CAgFR"}
@@ -29,6 +29,9 @@ class PnpmCatalogManager {
29
29
  isDefaultCatalog: isDefault,
30
30
  };
31
31
  }
32
+ getCatalogDefinitionFilePaths() {
33
+ return ['pnpm-workspace.yaml'];
34
+ }
32
35
  getCatalogDefinitions(treeOrRoot) {
33
36
  if (typeof treeOrRoot === 'string') {
34
37
  const pnpmWorkspacePath = (0, node_path_1.join)(treeOrRoot, 'pnpm-workspace.yaml');
@@ -1,4 +1,4 @@
1
- import * as ora from 'ora';
1
+ import { globalSpinner } from './spinner';
2
2
  export type DelayedSpinnerOptions = {
3
3
  delay?: number;
4
4
  ciDelay?: number;
@@ -10,7 +10,7 @@ export type DelayedSpinnerOptions = {
10
10
  * takes longer than a certain amount of time.
11
11
  */
12
12
  export declare class DelayedSpinner {
13
- spinner: ora.Ora;
13
+ spinner: typeof globalSpinner;
14
14
  timeouts: NodeJS.Timeout[];
15
15
  private lastMessage;
16
16
  private ready;
@@ -1 +1 @@
1
- {"version":3,"file":"delayed-spinner.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/delayed-spinner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,CAAM;IAEhC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAU;IAEvB;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,qBAAqB;IAiBzD;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM;IAY1B;;;;;;OAMG;IACH,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,qBAAqB;IAanE;;OAEG;IACH,OAAO;CAIR"}
1
+ {"version":3,"file":"delayed-spinner.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/delayed-spinner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAwB,MAAM,WAAW,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,EAAE,OAAO,aAAa,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,CAAM;IAEhC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAU;IAEvB;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,qBAAqB;IAiBzD;;;;;OAKG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM;IAY1B;;;;;;OAMG;IACH,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,qBAAqB;IAanE;;OAEG;IACH,OAAO;CAIR"}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DelayedSpinner = void 0;
4
- const ora = require("ora");
5
- const is_ci_1 = require("./is-ci");
4
+ const spinner_1 = require("./spinner");
6
5
  /**
7
6
  * A class that allows to delay the creation of a spinner, as well
8
7
  * as schedule updates to the message of the spinner. Useful for
@@ -18,15 +17,15 @@ class DelayedSpinner {
18
17
  constructor(message, opts) {
19
18
  this.timeouts = [];
20
19
  opts = normalizeDelayedSpinnerOpts(opts);
21
- const delay = SHOULD_SHOW_SPINNERS ? opts.delay : opts.ciDelay;
20
+ const delay = spinner_1.SHOULD_SHOW_SPINNERS ? opts.delay : opts.ciDelay;
22
21
  this.timeouts.push(setTimeout(() => {
23
22
  this.ready = true;
24
23
  this.lastMessage = message;
25
- if (!SHOULD_SHOW_SPINNERS) {
24
+ if (!spinner_1.SHOULD_SHOW_SPINNERS) {
26
25
  console.warn(this.lastMessage);
27
26
  }
28
- else {
29
- this.spinner = ora(this.lastMessage).start();
27
+ else if (!spinner_1.globalSpinner.isSpinning()) {
28
+ this.spinner = spinner_1.globalSpinner.start(this.lastMessage);
30
29
  }
31
30
  }, delay).unref());
32
31
  }
@@ -37,9 +36,9 @@ class DelayedSpinner {
37
36
  * @returns The {@link DelayedSpinner} instance
38
37
  */
39
38
  setMessage(message) {
40
- if (SHOULD_SHOW_SPINNERS) {
39
+ if (spinner_1.SHOULD_SHOW_SPINNERS) {
41
40
  if (this.spinner) {
42
- this.spinner.text = message;
41
+ this.spinner.updateText(message);
43
42
  }
44
43
  }
45
44
  else if (this.ready && this.lastMessage && this.lastMessage !== message) {
@@ -59,7 +58,7 @@ class DelayedSpinner {
59
58
  opts = normalizeDelayedSpinnerOpts(opts);
60
59
  this.timeouts.push(setTimeout(() => {
61
60
  this.setMessage(message);
62
- }, SHOULD_SHOW_SPINNERS ? opts.delay : opts.ciDelay).unref());
61
+ }, spinner_1.SHOULD_SHOW_SPINNERS ? opts.delay : opts.ciDelay).unref());
63
62
  return this;
64
63
  }
65
64
  /**
@@ -71,7 +70,6 @@ class DelayedSpinner {
71
70
  }
72
71
  }
73
72
  exports.DelayedSpinner = DelayedSpinner;
74
- const SHOULD_SHOW_SPINNERS = process.stdout.isTTY && !(0, is_ci_1.isCI)();
75
73
  function normalizeDelayedSpinnerOpts(opts) {
76
74
  opts ??= {};
77
75
  opts.delay ??= 500;
@@ -0,0 +1,13 @@
1
+ export declare const SHOULD_SHOW_SPINNERS: boolean;
2
+ declare class SpinnerManager {
3
+ #private;
4
+ start(text?: string, prefix?: string): SpinnerManager;
5
+ succeed(text?: string): void;
6
+ stop(): void;
7
+ fail(text?: string): void;
8
+ updateText(text?: string): void;
9
+ isSpinning(): boolean;
10
+ }
11
+ export declare const globalSpinner: SpinnerManager;
12
+ export {};
13
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/spinner.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,SAAkC,CAAC;AAEpE,cAAM,cAAc;;IAIlB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc;IAiBrD,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM;IAIrB,IAAI;IAIJ,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM;IAIlB,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM;IAQxB,UAAU;CAYX;AAED,eAAO,MAAM,aAAa,gBAAuB,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var _SpinnerManager_instances, _SpinnerManager_ora, _SpinnerManager_prefix, _SpinnerManager_createOra;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.globalSpinner = exports.SHOULD_SHOW_SPINNERS = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const ora = require("ora");
7
+ const is_ci_1 = require("./is-ci");
8
+ exports.SHOULD_SHOW_SPINNERS = process.stdout.isTTY && !(0, is_ci_1.isCI)();
9
+ class SpinnerManager {
10
+ constructor() {
11
+ _SpinnerManager_instances.add(this);
12
+ _SpinnerManager_ora.set(this, void 0);
13
+ _SpinnerManager_prefix.set(this, void 0);
14
+ }
15
+ start(text, prefix) {
16
+ if (!exports.SHOULD_SHOW_SPINNERS) {
17
+ return this;
18
+ }
19
+ if (prefix !== undefined) {
20
+ tslib_1.__classPrivateFieldSet(this, _SpinnerManager_prefix, prefix, "f");
21
+ }
22
+ if (tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f")) {
23
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f").text = text;
24
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f").prefixText = tslib_1.__classPrivateFieldGet(this, _SpinnerManager_prefix, "f");
25
+ }
26
+ else {
27
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_instances, "m", _SpinnerManager_createOra).call(this, text);
28
+ }
29
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f").start();
30
+ return this;
31
+ }
32
+ succeed(text) {
33
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f")?.succeed(text);
34
+ }
35
+ stop() {
36
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f")?.stop();
37
+ }
38
+ fail(text) {
39
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f")?.fail(text);
40
+ }
41
+ updateText(text) {
42
+ if (tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f")) {
43
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f").text = text;
44
+ }
45
+ else if (exports.SHOULD_SHOW_SPINNERS) {
46
+ tslib_1.__classPrivateFieldGet(this, _SpinnerManager_instances, "m", _SpinnerManager_createOra).call(this, text);
47
+ }
48
+ }
49
+ isSpinning() {
50
+ return tslib_1.__classPrivateFieldGet(this, _SpinnerManager_ora, "f")?.isSpinning ?? false;
51
+ }
52
+ }
53
+ _SpinnerManager_ora = new WeakMap(), _SpinnerManager_prefix = new WeakMap(), _SpinnerManager_instances = new WeakSet(), _SpinnerManager_createOra = function _SpinnerManager_createOra(text) {
54
+ tslib_1.__classPrivateFieldSet(this, _SpinnerManager_ora, ora({
55
+ text: text,
56
+ prefixText: tslib_1.__classPrivateFieldGet(this, _SpinnerManager_prefix, "f"),
57
+ hideCursor: false,
58
+ discardStdin: false,
59
+ }), "f");
60
+ };
61
+ exports.globalSpinner = new SpinnerManager();