Colum Ferry 364198f03e
feat(devkit): add aggregateLog util for executor to plugin migration (#26523)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->
There is no way to aggregate logs and output at the end of execution for
the executor to plugin migrations

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
There should be a way to aggregate logs and output them at the end of
execution

Usage:
```ts
// Call with the executorName that is being migrated
// Make sure the log itself does not contain dynamic values
// Add the project root that is being migrated

aggregateLog({executorName: '@nx/vite:build', project: projectRoot, log: 'Encountered X in project.json. Do Y to handle this manually.'})

// Then in GeneratorCallback run a task
return () => { flushLogs() };
```

Example Output

![image](https://github.com/nrwl/nx/assets/12140467/9a36c855-7377-4ad5-946c-c50202d9b50c)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-06-13 19:31:20 +02:00
..

Nx - Smart Monorepos · Fast CI

{{links}}


Nx: Smart Monorepos · Fast CI

Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.

This package contains a set of utilities for creating Nx plugins.

{{content}}