9383 Commits

Author SHA1 Message Date
Colum Ferry
6b081363c1
feat(webpack): set default sassImplementation to sass-embedded (#30580)
## Current Behavior
The `sassImplementation` option for Webpack and Rspack is set to `sass`
by default.
`sass-embedded` offers a faster alternative.

## Expected Behavior
Switch the default `sassImplementation` option to `sass-embedded`.
2025-04-16 11:06:57 +01:00
Jason Jean
31548a1282
fix(core): only register forced shutdown when tui is enabled (#30735)
<!-- 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 -->

The `registerForcedShutdownCallback` lifecycle hook does not exist if
the TUI is not enabled as it is not on CI. But Nx tries to invoke it
anyways so it causes an error in CI:
https://github.com/nrwl/nx/actions/runs/14471341199/job/40585817051?pr=30710#step:11:31

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

The `registerForcedShutdownCallback` is only utilized when the TUI is
enabled so it will not be invoked on CI where it does not exist.

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

Fixes #
2025-04-15 16:13:01 +00:00
Jack Hsu
9ce301f30c
fix(testing): fix cypress and playwright atomized targetDefaults so they match correctly (#30717)
Currently, we provide `targetDefaults` for atomized targets (e.g.
`e2e-ci`) with a glob pattern that may not match nested paths.

i.e.

```
"e2e-ci--**/*": {
  "dependsOn": [
    "^build",
  ],
},
```

The `e2e-ci--**/*` pattern should be `e2e-ci--**/**`.

<!-- 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
The generated `e2e-ci` pattern in `nx.json` does not match nested paths
for split tasks.

## Expected Behavior
The generated `e2e-ci` pattern should apply to all split tasks.

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

Fixes #28842
2025-04-15 11:03:52 -04:00
Colum Ferry
4f14f9d5af
fix(angular): remove deprecated standaloneConfig from generators (#30578)
## Current Behavior
The `standaloneConfig` option has long been deprecated as it is the only
behaviour that Nx now provides.
Using it is a no-op.

## Expected Behavior
Remove the `standaloneConfig` option.
2025-04-15 15:04:49 +01:00
Leosvel Pérez Espinosa
5aab4eb420 cleanup(testing): fix outdated test snapshot in cypress graph plugin tests (#30728)
## Current Behavior

A couple of unit tests for the `@nx/cypress` graph plugin are failing
due to outdated snapshots.

## Expected Behavior

The `@nx/cypress` graph plugin tests should succeed. The test snapshots
should be updated to match the new behavior.

## Related Issue(s)

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean
016e5fda2a chore(core): fix command info (#30720)
<!-- 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 -->

"Printing" the command info before output causes `run-script` to hang
and not run. In addition, the screen was cleared.

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

The command in run-script runs without issues. The screen is not
cleared.

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

Fixes #
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa
9a60dec0de feat(testing): support continuous tasks (#30632)
## Current Behavior

The Cypress and Playwright graph plugins do not infer tasks configured
to take advantage of continuous tasks (do not add the task they run to
start the app/server as a dependency of the e2e task).

## Expected Behavior

The Cypress and Playwright graph plugins should infer tasks configured
to take advantage of continuous tasks.

## Related Issue(s)

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean
46888b294c fix(core): use dev tty for crossterm (#30696)
<!-- 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 -->

`git push -u origin HEAD` causes the following panic when the TUI is
enabled on macos:

```
Backtrace (most recent call last):
  File "<unknown>:0", in __pthread_cond_wait
  File "<unknown>:0", in std::sys::pal::unix:🧵:Thread:🆕:thread_start
  File "<unknown>:0", in core::ops::function::FnOnce::call_once{{vtable.shim}}
  File "<unknown>:0", in std::sys::backtrace::__rust_begin_short_backtrace
  File "<unknown>:0", in tokio::runtime::task::raw::poll
  File "<unknown>:0", in tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  File "<unknown>:0", in tokio::runtime::task::raw::poll
  File "<unknown>:0", in tokio::runtime::task::core::Core<T,S>::poll
  File "<unknown>:0", in nx::native::tui::tui::Tui::start::{{closure}}
  File "<unknown>:0", in core::option::expect_failed

The application panicked (crashed).
  reader source not set
in /Users/jason/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossterm-0.29.0/src/event/read.rs:39
thread: tokio-runtime-worker

```

This is due to the fact that crossterm until recently did not use
/dev/tty on mac and thus could not read events correctly when forwarded
from another program such as husky.

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

This adds the `use-dev-tty` features so that `crossterm` utilizes
`/dev/tty` and works when forwarded from other programs such as husky on
macos.

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

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean
9359490326 chore(core): fix wasm build (#30684)
<!-- 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 -->

Wasm build is broken.

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

Wasm build is fixed.

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

Fixes #
2025-04-15 09:23:45 -04:00
James Henry
3f9f2a78b7 fix(core): improve tui exit consistency and summary (#30678)
<!-- 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 -->

- When a user presses `ctrl+c` to force kill the TUI/Nx, continuous
tasks that are running are not killed, and the terminal can get stuck or
leave the cursor hidden
- The summary is incomplete and messy

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

- When a user presses `ctrl+c` to force kill the TUI/Nx, continuous
tasks that are running are appropriately killed and everything in the
user's terminal is restored back to a good state.
- The summary looks good and contains the in progress logs for
continuous tasks that were killed

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

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean
285211f98c feat(core): add shared status for tui (#30679)
<!-- 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 -->

Shared continuous tasks are not shown as running in the TUI

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

There is a special status for Shared continuous tasks for the TUI where
it will say that it is running in a different nx process

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

Fixes #
2025-04-15 09:23:45 -04:00
Colum Ferry
e5c7f6db18 feat(testing): add continuous tasks support for jest e2e with node (#30675)
## Current Behavior
When generating `node` projects with an `e2e` project using Jest, we do
not supply any method for the node application to actually be started
before running the tests.

## Expected Behavior
Using Continuous Tasks, have the e2e project dependOn the serve of the
`node` project such that it is available for the e2e tests to run
against it.
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa
a1cd4e31ad fix(core): schedule tasks and release waiting threads when continuous task is already running (#30673)
## Current Behavior

When a continuous task is already running, parent tasks are not
scheduled.

## Expected Behavior

When a continuous task is already running, the task orchestrator should
schedule the next tasks and release the waiting threads so parent tasks
can be scheduled.

## Related Issue(s)

Fixes #
2025-04-15 09:23:45 -04:00
Jason Jean
48a5d1987e feat(core): enable dte to execute continuous tasks (#29993)
<!-- 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 -->

Continuous tasks are not supported in DTE and there is no good API for
Agents to utilize

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

There is an API for agents to utilize to run continuous tasks.

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

Fixes #
2025-04-15 09:23:45 -04:00
FrozenPandaz
87badb0486 chore(core): regen native typings 2025-04-15 09:23:45 -04:00
James Henry
6541751aab feat(core): add the experimental Terminal UI for tasks (#30565) 2025-04-15 09:23:45 -04:00
Colum Ferry
5f26c6811e feat(module-federation): add continuous tasks support to react rspack (#30644)
## Current Behavior
Continuous tasks are not set up for React Rspack Module Federation
Remote projects.
This is important because `--dev-remotes` is no longer supported with
Crystal Module Federation usage.

## Expected Behavior
Add Continuous Tasks support for React Rspack Module Federation Remote
Projects.
This replaces the need for `nx serve shell --dev-remotes=remote1`.

Instead, the command is simply `nx serve remote1` and continuous tasks
means that the `shell:serve` task is executed correctly.
2025-04-15 09:23:45 -04:00
Jason Jean
c5fb467118 feat(core): share continuous tasks (#29901)
<!-- 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. -->

<!-- This is the behavior we have today -->

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

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-04-15 09:23:45 -04:00
Jason Jean
dee4906f5e chore(repo): fix unit tests (#30431)
<!-- 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 -->

Unit tests are broken after rebase

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

Unit tests are passing

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

Fixes #
2025-04-15 09:23:45 -04:00
Colum Ferry
0d38ec4454 feat(node): generate new apps with continuous: true (#30148)
## Current Behavior
Node applications rely on the `@nx/js:node` executor to handle serving. 
Unfortunately, it can not be determined if existing usage of the
executor is used for a continuous or finite task.

## Expected Behavior
Generate new node applications with `continuous: true` for their serve
targets
2025-04-15 09:23:45 -04:00
Colum Ferry
f5e124972a feat(storybook): infer continuous tasks for storybook serve and serve-static (#30069)
## Current Behavior
The `@nx/storybook/plugin` does not set `continuous:true` for serve-like
targets.

## Expected Behavior
The plugin should correctly set `continuous: true` for `serve` and
`serve-static`.
2025-04-15 09:23:45 -04:00
Colum Ferry
7989e39461 feat(vite): infer continuous tasks for dev (#30043)
## Current Behavior
The `dev`, `serve`, `preview` and `serve-static` targets inferred by the
`@nx/vite/plugin` do not infer `continuous:true` indicating to Nx that
these tasks are continuous.


## Expected Behavior
Infer `continuous: true` for the serve-like targets for Vite.
2025-04-15 09:23:45 -04:00
Colum Ferry
63282bc070 feat(webpack): add continuous inference support (#29974)
## Current Behavior
Webpack Inference Plugin does not currently infer `continuous` for
`serve, preview, serve-static` targets.

## Expected Behavior
Webpack Inference Plugin correctly infers `continuous: true`
2025-04-15 09:23:45 -04:00
Colum Ferry
9fc7ffdaf3 feat(rspack): add continous inference support (#29973)
## Current Behavior
Rspack and Rsbuild Inference Plugins do not infer `continuous` for serve
tasks.

## Expected Behavior
Correctly infer `continuous` true.
2025-04-15 09:23:45 -04:00
Colum Ferry
2cd3252365 feat(js): infer continuous for watch-deps task (#29976)
## Current Behavior
The `@nx/js` plugin exposes a helper to generate `build-deps` and
`watch-deps` tasks for inference plugins.
It does not currently infer `continuous` for the `watch-deps` task.

## Expected Behavior
Ensure `watch-deps` is infered with `continuous: true`
2025-04-15 09:23:45 -04:00
Colum Ferry
229cf28198 feat(remix): add continuous task support (#29905)
## Current Behavior
When `serve, dev, start` targets are inferred by the `@nx/remix` plugin,
they are not inferring `continuous`.


## Expected Behavior
When `NX_CONTINUOUS_TASKS_PREVIEW` env var exists, infer the
`continuous` property.
2025-04-15 09:23:45 -04:00
Jason Jean
f326bfe52e feat(core): introduce continuous tasks (#29750)
<!-- 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. -->

An RFC about this feature is happening here: #29025. This has the most
information about this feature.

<!-- This is the behavior we have today -->

Nx currently does not explicitly handle tasks which run continuously
until they are terminated.

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

This PR adds the initial support for continuous tasks which run
continuously until they are terminated. This adds the ability to depend
on continuous tasks. There is some more work to be done but this will be
enough as an MVP.

<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-04-15 09:23:45 -04:00
Leosvel Pérez Espinosa
0082d939eb
fix(linter): remove empty entry in typescript eslint flat config (#30727)
## Current Behavior

The `flat/typescript` config contains a config block with the `files`
containing an invalid empty entry.

## Expected Behavior

The `flat/typescript` config should be correct.

## Related Issue(s)

Fixes #30725
2025-04-15 08:08:17 -04:00
Leosvel Pérez Espinosa
b3c1404b02
fix(testing): unset customConditions when running cypress tasks (#30709)
## Current Behavior

Cypress e2e tasks in a workspace with the `customConditions` TypeScript
compiler option set, fail with the error:

```bash
TSError: ⨯ Unable to compile TypeScript:
error TS5098: Option 'customConditions' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'.
```

This happens because Cypress forces ts-node to use `module: commonjs`
and `moduleResolution: node10`, which is not compatible with the
`customConditions` TypeScript compiler option.

## Expected Behavior

Cypress e2e tasks in a workspace with the `customConditions` TypeScript
compiler option set should work as expected.

## Related Issue(s)

Fixes #
2025-04-14 09:17:34 -04:00
Leosvel Pérez Espinosa
70f1e660c8
fix(rspack): do not reuse existing ts-node compiler options when inferring tasks (#30703)
## Current Behavior

The `@nx/rspack` graph plugin reuses the potentially existing
`TS_NODE_COMPILER_OPTIONS` to set the `env` property of the inferred
tasks for a TS config file. This is not correct since the env var could
have a different value (or not exist at all) when running tasks compared
to when the graph plugin runs.

## Expected Behavior

The `@nx/rspack` graph plugin should not reuse any existing
`TS_NODE_COMPILER_OPTIONS` when inferring tasks for a TS config file.

## Related Issue(s)

Fixes #
2025-04-14 14:36:20 +02:00
Emily Xiong
65752addb5
fix(core): clean up batch process after post run (#30687)
<!-- 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 -->
currently, the batch process is not being cleanup

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
need to kill the batch process after post run in task orchestrator,
otherwise, when kill it during the post run (store the output to cache),
it will cause the process to hang in DTE

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

Fixes #
2025-04-12 08:36:45 -04:00
Jason Jean
d66b663879
fix(core): copy native file atomically to avoid hanging graph creation (#30695)
<!-- 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 -->

When copying the native file out of node_modules into tmp from multiple
processes (aka plugin workers)... this can result in Node deadlocking.

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

Copying the native file out of node_modules into tmp from multiple
processes will first copy to unique places in `/tmp` but then atomically
rename to the final location where it is still loaded from.

This at least fixes a flaky test in `nx:test` where the explicit
dependencies tests were timing out after 35 seconds

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

Fixes #
2025-04-11 19:21:14 -04:00
Jason Jean
b56df7ba7a
chore(repo): update nx to 20.8.0-beta.2 (#30694)
<!-- 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 -->

This repo uses Nx 20.7.0-beta.3

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

This repo uses Nx 20.8.0-beta.2

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

Fixes #
2025-04-11 19:18:50 -04:00
Leosvel Pérez Espinosa
ce41dedf01
fix(js): ensure the tsconfig files cache is correctly busted when implementation changes (#30689)
## Current Behavior

The `@nx/js/typescript` plugin sometimes throws an error due to a
mismatch between the cached information for the tsconfig files and a
newer implementation.

## Expected Behavior

The `@nx/js/typescript` plugin should correctly invalidate the cached
tsconfig files when the implementation changes.

## Related Issue(s)

Fixes #
2025-04-11 18:12:22 -04:00
Jason Jean
f3013ccafe
fix(testing): do not inherit existing env (#30688)
<!-- 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 -->

Inheriting the existing environment variable here causes tests to fail
for some reason.

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

This reverts it to how it functioned before and fixes the failing tests.

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

Fixes #
2025-04-11 14:25:49 -04:00
Jason Jean
f839b070f0
fix(core): ensure fileworker is cleaned up when workspace context is … (#30683)
…dropped

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

The file worker was holding onto `nx_files.nxt` causing our tempFs to
not clean up properly.

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

When the node cleans up workspace context, the file worker will be
dropped and release the `nx_files.nxt`. TempFs will thus be able to
clean up the temp directory properly.

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

Fixes #
2025-04-11 17:44:16 +00:00
Leosvel Pérez Espinosa
259561ff9a
fix(testing): enforce commonjs module for ts-jest (#30681)
## Current Behavior

The `@nx/jest` graph plugin and the `@nx/jest:jest` executor correctly
force the `moduleResolution: node10` to be used by `ts-node` (used by
`ts-jest`), but don't force using `module: commonjs`, which can result
in issues due to incompatible `module`/`moduleResolution` pair.

## Expected Behavior

The `@nx/jest` graph plugin and the `@nx/jest:jest` executor should
force the `moduleResolution: node10` and `module: commonjs` compiler
options to be used by `ts-node`.

## Related Issue(s)

Fixes #
2025-04-11 14:47:34 +00:00
Miroslav Jonaš
baf663729c
feat(core): allow globs in project config to extend atomized targets (#30630)
## TL;DR;

This PR enabled mapping glob patterns in target names within the project
config to match and extend atomized targets.

## Problem statement

The project configuration (via project.json or package.json) enables us
to override target defaults set via inferred plugins and/or
targetDefaults.

However, this is only possible for fixed targets. Overriding
atomized/dynamic targets would require listing them all explicitly,
which would create a lot of overhead and would break the dynamicity and
automation of the atomized targets.

## Why not use targetDefaults?

The targetDefaults already support globbing to match a range of targets
like e2e-ci-**/* so we can use the same logic on the project level.

We often need to make modifications on project level, rather than the
entire monorepo. E.g. all atomized targets running on a feature lib
checkout should have an implicit dependency on build target of
dependency as stated by "dependsOn": ["^build"] but they also should
have a dependency on app:build - the application which e2e tests are
serving, although there is no direct or indirect dependency between
checkout-e2e and app. This is significant to retain the lean affected
graph.

## Solution 

We can use the same globbing logic from targetDefaults and will apply in
mergeProjectConfigurationIntoRootMap function to match glob patterns to
range of targets instead of searching for the explicit target name only.

When the glob pattern doesn't match any targets, the fallback is still
the existing functionality.

This is possible given the fact that plugins' targets get applied before
we start parsing the project configurations, as they have priority over
generic plugin definitions and `targetDefaults.`

Override would look like this:
```jsonc
{
  "name": "users-e2e",
  "implicitDependencies": ["users"],
  "targets": {
    "e2e": {
      "dependsOn": ["^build", { "target": "build", "projects": "app" }]
    },
    "e2e-ci--**/*": {
      "dependsOn": ["^build", { "target": "build", "projects": "app" }]
    }
  }
}
```

## 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 #
2025-04-11 11:26:13 +02:00
Nicholas Cunningham
ff53b006e4
fix(bundling): Lock webpack version to be compatible with @angular-devkit (#30676)
<!-- 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 -->
Currently, when we have `^` it forces an update to webpack version
`5.99.x` which is incompatible at the moment with `@angular-devkit`
which is locked to webpack version `5.98.0`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Nx should be compatible with the migration provided by it's own package
`@nx/webpack`

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

Fixes #
2025-04-10 19:03:05 +00:00
Jason Jean
9fe73eaf31
chore(core): fix publish for linux (#30669)
<!-- 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 -->

Publish is failing for linux workflows missing openssl.

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

Publish passes as reqwest will use `rustls-tls`

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

Fixes #
2025-04-10 11:55:29 -04:00
Leosvel Pérez Espinosa
136e721d58
fix(js): handle when there are no package manager workspaces' patterns (#30666)
## Current Behavior

The helper to add a project to the package manager workspaces'
configuration doesn't handle correctly when there are no patterns and
this results in the error `Invalid glob pattern` being thrown.

## Expected Behavior

The helper to add a project to the package manager workspaces'
configuration should handle when there are no patterns.

## Related Issue(s)

Fixes #
2025-04-10 13:16:43 +00:00
Leosvel Pérez Espinosa
77e60c329f
fix(core): log more information when ProjectConfigurationsError is thrown (#30661)
## Current Behavior

When the `ProjectConfigurationsError` is thrown, no helpful information
is logged.

## Expected Behavior

When the `ProjectConfigurationsError` is thrown, helpful information
should be logged.

It replicates the handling previously done for `ProjectGraphError`.

## Related Issue(s)

Fixes #
2025-04-10 13:34:12 +02:00
Colum Ferry
c71a7832b9
fix(angular): ensure crystal targets for testing when bundler=rspack (#30631)
## Current Behavior
Angular Rspack relies on Inferred Targets however, when scaffolding the
application, the unit test runners are being set up with executors.

## Expected Behavior
Ensure that when `bundler=rspack` unit test runners are being set up
with inference plugins
2025-04-10 11:06:15 +01:00
Miroslav Jonaš
d4ebf82ac8
feat(core): add filter for git checkouts in generated pipelines and docs (#30547)
This PR adds Git filter `tree:0` to Azure and GitHub pipelines to avoid
fetching the full history content because of the affected command.

The change is made to:
- `ci-workflow` generator in `workspace` project for Azure and GitHub
- `ci-workflow` generator in `gradle` project for GitHub
- this repo's  main pipeline -`ci.yaml`
- all documentation occurrences where fetch depth 0 is used on Azure or
GitHub

More info on reasoning here:
https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/

## 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 #
2025-04-10 11:33:31 +02:00
Craigory Coppola
3ad8082a39
fix(core): wasm build should build (#30655)
## Current Behavior
There are warnings as well as an error and wasm does not build

## Expected Behavior
wasm. builds
2025-04-09 18:18:39 -04:00
Leosvel Pérez Espinosa
5feafd64d4
feat(testing): add support for cypress v14 (#30618)
## Current Behavior

Cypress v14 is not supported.

## Expected Behavior

Cypress v14 is supported.

## Related Issue(s)

Fixes #30097
2025-04-09 17:12:39 -04:00
Craigory Coppola
0525426a51
feat(core): add support for http based caches (#30593)
Implements http based remote caches per the RFC here:
https://github.com/nrwl/nx/discussions/30548
2025-04-09 19:25:03 +00:00
Colum Ferry
494f150a69
fix(core): angular rspack should not prompt for SSG (#30647)
## Current Behavior
Create Nx Workspace will prompt for SSG when `Rspack` is chosen as a
bundler option for Angular.
SSG is currently not supported by Angular Rspack.

## Expected Behavior
Do not mention SSG when prompting for SSR with Angular Rspack
2025-04-09 16:17:56 +00:00
James Henry
7b85d912ba
feat(release): revamped nx release version implementation (#30418) 2025-04-08 18:17:19 +04:00
Jason Jean
dbd86480c8
chore(core): regen native typings (#30633)
<!-- 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 -->

Native typings are out of date.

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

native typings are updated

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

Fixes #
2025-04-08 14:02:34 +00:00