426 Commits

Author SHA1 Message Date
Nicholas Cunningham
4197a91845
feat(nextjs): Add convert-to-inferred generator (#26706)
This PR enables the ability to migrate project(s) from using nextjs
executors to inferred targets.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-06-27 11:21:35 -04:00
Leosvel Pérez Espinosa
c936f864b8
fix(misc): register plugins correctly in migration generators (#26670)
<!-- 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` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-06-25 08:33:24 -04:00
Leosvel Pérez Espinosa
47dfdcfc6b
feat(webpack): add convert-to-inferred generator (#26621)
<!-- 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` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2024-06-24 21:13:24 -04:00
Leosvel Pérez Espinosa
df3c7522ea
feat(testing): add convert-to-inferred migration generator for jest (#26259)
<!-- 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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-06-18 05:59:30 -07:00
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
Jason Jean
a7dc8f6d7f
chore(repo): fix file formatting (#26463)
<!-- 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 -->

Files are unformatted.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Files are formatted.

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

Fixes #
2024-06-07 16:10:22 -04:00
Craigory Coppola
dd6eda84b0
feat(devkit): allow to customize overwrite mode in generateFiles (#26354)
Adds a new capability to choose how to handle already existing target
files when using a generator.

See #17925

Co-authored-by: Michael Monerau <micmo@qontrol.io>
2024-06-04 16:12:15 -04:00
Leosvel Pérez Espinosa
030ede2c95
cleanup(devkit): prevent mutating targetDefaults in migration to crystal helper (#26316)
<!-- 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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-06-03 09:17:40 -04:00
Craigory Coppola
6f223005b8
fix(misc): ensure plugins are not creating workspace context while creating nodes (#26253) 2024-05-31 18:54:56 -04:00
Jason Jean
1e7cd7e9e6
feat(testing): use createNodesV2 for cypress and playwright (#26301) 2024-05-31 17:53:31 -04:00
Leosvel Pérez Espinosa
c05e4ac268
cleanup(devkit): ensure externalDependencies input from inferred task is merged into target inputs when migrating (#26273)
<!-- 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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-05-31 16:24:29 +02:00
Jason Jean
fde4932ab9
fix(gradle): expose create nodes v2 (#26282)
<!-- 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 -->

`createNodesV2` was written but not exported.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`createNodesV2` is exported.

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

Fixes #
2024-05-31 09:18:19 -04:00
Leosvel Pérez Espinosa
7b196dc630
cleanup(devkit): add util for processing outputs in crystal migration generators (#26247)
<!-- 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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-05-29 21:35:13 +00:00
Jordan Hall
4cbb0f0988
fix(core): add missing bun PM support (#26084)
This fix add support for bun PM in daemon and affected changes.

Helps towards #26053 fix
2024-05-27 10:00:35 -04:00
Colum Ferry
44429451c8
fix(devkit): combineAsyncIterable should not be blocking when error occurs #21393 (#23400)
<!-- 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 -->
`combineAsyncIterators` has a `finally` block which is blocking
execution waiting for all iterators to be `done` so it can call the
`return` function as cleanup.
This leads to prolonged execution when unnecessary, such as when an
error has occurred.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`finally` block should be non-blocking allowing errors to be immediately
surfaced and execution to stop.

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

Fixes #21393
2024-05-21 10:36:56 -04:00
Jason Jean
cfadd7d8cf
Revert "fix(core): addPlugin should not conflict on project.json targ… (#23391)
…ets (#23264)"

This reverts commit 85c89160

<!-- 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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-05-14 18:01:30 -04:00
Colum Ferry
85c8916087
fix(core): addPlugin should not conflict on project.json targets (#23264)
<!-- 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 -->
Calculating conflicts in target names does not consider if the
project.json defined targets will actually be impacted by the plugin
that wants to be added creating false negatives

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Calculating conflicts should be more accurate

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

Fixes #22476
2024-05-13 10:53:09 -04:00
Mehrad Rafigh
f7dcf433c3
fix(core): include more binary extensions (#22788) (#22861) 2024-05-10 18:50:11 -04:00
Jack Hsu
4106691d33
fix(core): update getLastValueFromAsyncIterableIterator to support AsyncIterables returned from executors (#23229)
When an executor returns an `AsyncIterable` Nx fails because it cannot
read the value using `getLastValueFromAsyncIterableIterator` (which only
supports `AsyncIterableIterator`. This PR updates it to support both so
executors like `@nx/rollup:rollup` will work.


<!-- 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
Running Nx command fails if executor returns `AsyncIterable` e.g. by
calling `createAsyncIterable`.

## Expected Behavior
Nx command succeeds when executor returns `AsyncIterable`.

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

Fixes #23028
2024-05-08 18:07:14 -04:00
Craigory Coppola
cc875a6ac8
fix(devkit): check if includes is actually necessary (#23181)
<!-- 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
We run the createNodes function once when converting to inferred
targets, and remove includes if its not needed anymore based solely on
the config files returned.

## Expected Behavior
We run the createNodes function twice, and remove includes if the result
was the same with / without it.

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

Fixes #
2024-05-04 10:01:10 -04:00
Colum Ferry
2526979ab0
fix(devkit): executor-to-plugin-migrator should add // targets hint (#23167)
<!-- 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 -->
When `convert-to-inferred` generators are run, they leave no hints as to
what happened to the targets.
This is usually fine as the person running the generator should know
what it is doing.
However, other team members who may not have been privy to the migration
may be confused when they see an empty project.json


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Add the same `// targets` hint that we generate for plugin-first
projects to help guide users to the PDV to see the targets.

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

Fixes #
2024-05-03 15:27:21 +00:00
Colum Ferry
21d7e9221d
fix(testing): convert-to-inferred generators should add includes only when needed (#23159)
- fix(devkit): executor-to-plugin-migrator should remove includes when
all config files are handled
- fix(testing): cypress convert-to-inferred should add
ciWebServerCommand correctly

<!-- 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 -->
`includes` are being added to all new plugins that are being added to
nx.json.
It should only be added when not all config files are addressed by the
plugin to be added.

Cypress Convert To Inferred is not creating a `ciWebServerCommand` when
it is possible to do so.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure `includes` is added only when required.
Ensure `cypress:convert-to-inferred` is adding a ciWebServerCommand
correctly


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

Fixes #
2024-05-03 09:50:08 -04:00
Colum Ferry
acd0993f1a
feat(linter): add convert-to-inferred migration generator (#23142) 2024-05-03 17:23:01 +04:00
Colum Ferry
dbad02afe4
fix(testing): convert-to-inferred generator should handle legacy cypress executor (#23151)
<!-- 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 -->
The `convert-to-inferred` generator does not handle
`@nrwl/cypress:cypress`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The generator should handle the legacy executor

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

Fixes #
2024-05-02 18:05:59 -04:00
Colum Ferry
11fec5a4e8
fix(devkit): run callback for forEachProjectConfig when target.options is undefined (#23143)
<!-- 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 -->
`forEachExecutorOptions` will not run the callback if `target.options`
is undefined.
This means that even if a target exists with an executor, the target is
not being processed if it does not have `options`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Run the callback anyway even if `target.options` is undefined

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

Fixes #
2024-05-02 12:20:07 -04:00
Jason Jean
a64a7e2db9
feat(core): cleanup for v19 (#22993) 2024-05-01 12:12:32 -04:00
Colum Ferry
44820f2c4b
feat(testing): add convert-to-inferred migration generator for cypress (#22884) 2024-04-30 12:47:12 -04:00
Colum Ferry
25eeddc338
feat(testing): add playwright generator to convert from executors to plugin (#22784)
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
2024-04-24 09:06:23 -04:00
Jack Hsu
bc43243498
chore(repo): add eslint and jest plugins to use inferred targets (#22946) 2024-04-23 21:52:13 -04:00
Craigory Coppola
355d5c593d
fix(core): move a few api points to return root maps directly (#22949) 2024-04-23 15:09:48 -04:00
Craigory Coppola
80b55144db
fix(misc): don't clear node_modules require cache (#22907) 2024-04-19 17:41:20 -04:00
Colum Ferry
82145e7d02
fix(core): load config util supports absolute paths on windows (#22837) 2024-04-17 11:32:09 -04:00
Jason Jean
bf206e578e
feat(misc): non conflicting init/add flow (#22791) 2024-04-15 16:45:08 -04:00
Jason Jean
54c42c1725
fix(devkit): update peer dependency on nx to include Nx 19 (#22811) 2024-04-12 18:32:26 -04:00
Craigory Coppola
7a7cbeca44
feat(core): re-enable running plugins in isolation (#22527) 2024-04-09 18:36:33 -04:00
Leosvel Pérez Espinosa
c20e00cab8
fix(misc): handle cwd correctly when generating artifacts with as-provided (#22411) 2024-03-21 12:48:47 -04:00
Leosvel Pérez Espinosa
8baddb5f08
feat(angular): support angular 17.3.0 (#22202) 2024-03-19 14:58:23 -04:00
Jack Hsu
d058c8c0b1
chore(devkit): fix failing devkit test for convertNxExecutor (#22398) 2024-03-19 14:55:43 -04:00
James Henry
1fe5b98f45
fix(linter): refactor pcv3 plugin, expose configFiles on context (#21677) 2024-03-15 16:29:13 -04:00
Jason Jean
c01b566728
feat(core): revert running plugins in isolation (#22246) 2024-03-09 11:30:10 -05:00
Jason Jean
ec12e67e10
fix(core): only start plugin workers once (#22222) 2024-03-08 10:29:37 -05:00
Jason Jean
4484a91bc1
chore(repo): update nx to 18.1.0-beta.3 (#22135) 2024-03-06 12:58:29 -05:00
Leosvel Pérez Espinosa
1731ad890a
fix(misc): do not add includedScripts unless really needed when running nx add (#22180) 2024-03-06 18:28:52 +01:00
Leosvel Pérez Espinosa
876bc94aab
fix(misc): improve package.json scripts handling when running "nx init" and "nx add" (#22168) 2024-03-06 09:39:34 -05:00
MaxKless
4c5654dac7
cleanup(core): rewrite text reference to nx console 'run' button (#21020) 2024-02-26 11:01:31 -05:00
Craigory Coppola
c2581dcf0b
feat(core): execute plugins in isolated processes (#21760) 2024-02-23 13:20:44 -05:00
Emily Xiong
f3cdce0c7a
feat(core): update swc/register (#21755) 2024-02-09 18:09:23 -05:00
Jason Jean
26a815c7df
chore(core): add one off exception for next.js (#21572) 2024-02-02 23:46:02 -05:00
Jason Jean
396ffc4636
feat(core): enable project crystal by default (#21403)
Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-02-02 03:40:59 -05:00
Jack Hsu
05b0848eb5
feat(devkit): add loadConfigFile function for plugins to use (#21511) 2024-02-01 22:46:04 -05:00