9651 Commits

Author SHA1 Message Date
Jacob Ley
6610f3d632
fix(core)!: respect packageManager field in package.json when detecting version (#29249)
Attept to read package manager version from config before invoking
package manager CLI

BREAK CHANGE: If you have a mismatch between the `packageManager` field
in `package.json` and the actual version installed in the environment,
it may lead to unexpected behavior when installing. This should not be a
problem if you are using corepack already.

## Related Issue(s)
https://github.com/nrwl/nx/issues/29244

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-04-30 16:59:24 -04:00
Jason Jean
7a62c7374b
fix(core): fix logging when directory does not exist (#30944) 2025-04-30 14:34:36 -04:00
Craigory Coppola
8f2c11c9ee
fix(core): dont cache default plugins as all plugins if loading plugins fails (#30927) 2025-04-30 15:54:58 +00:00
Jack Hsu
dcef5c7cf2
feat(graph): show next steps for successful migrations (#30934)
This PR updates Migration UI to display "next steps" when they are
provided by a migration. This works by writing `nextSteps` into the Nx
Console meta in `migrations.json`.

If the `nextSteps` is missing or it's empty, then nothing will be shown.

<img width="1555" alt="Screenshot 2025-04-29 at 5 16 49 PM"
src="https://github.com/user-attachments/assets/88491632-9b33-421a-887a-b6fbb5676098"
/>

See: https://www.loom.com/share/c0a4a7dce9df46b5b023fce5e0a3bd2f
2025-04-30 08:16:30 -04:00
James Henry
9dcab79b10
feat(release)!: support gitlab releases (#30802) 2025-04-30 12:41:03 +04:00
Jason Jean
d5a1918eb6
fix(core): write keybindings with control to terminal panes in intera… (#30938)
…ctive mode

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

Ctrl Keybindings are not sent to terminal panes when it's interactive
mode, only single key presses are sent.

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

Ctrl Keybindings are sent to the terminal panes when it is in
interactive mode. This means that editors like `nano` and `nvim`
somewhat work in interactive mode. The rendering is still broken right
now but the keypresses work.

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

Fixes #
2025-04-30 12:36:23 +04:00
Leosvel Pérez Espinosa
e75eeabac5
cleanup(angular): update ng-packagr nested import paths (#30897)
Update the nested import paths from `ng-packagr` to handle the different
paths in the upcoming Angular v20.

We must update and release `@nx/angular` and update the Nx repo with the
new version to handle the path changes in the upcoming `ng-packagr` v20
before updating the version in the Angular v20 branch. Otherwise, a
compilation error is thrown when building the v20 branch because the
installed `@nx/angular` version does not support the new paths needed in
`ng-packagr` v20.
2025-04-30 10:28:11 +02:00
Jason Jean
07b881d9ed
fix(core): kill child processes when pseudo terminal shutsdown (#30935)
<!-- 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 PseudoTerminal does not kill it's child processes when it shuts
down.

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

The PseudoTerminal will kill it's child processes when it shuts down.

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

Fixes #
2025-04-29 20:58:36 -04:00
Jason Jean
84c4dc55d2
fix(core): throw errors when task graph has invalid continuous tasks (#30924)
<!-- 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 -->

1. The continuous property is not present in the nx.json schema.
2. When tasks which do not support parallelism depend on a continuous
task, task execution is deadlocked.
3. Circular dependencies between continuous dependencies are allowed.

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

1. The continuous property is added to the nx.json schema.
2. An error is thrown when tasks which do not support parallelism
depends on a continuous task.
3. Circular dependencies between continuous tasks are caught and thrown
as an error.

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

Fixes #
2025-04-29 18:51:52 -04:00
Jack Hsu
6451f66492
Revert "feat(graph): show next steps for successful migrations" (#30933)
This reverts commit 307c45542a10b6e273d090a768175739690f2663.

<!-- 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 #
2025-04-29 17:09:19 -04:00
Emily Xiong
624f0359e3
feat(gradle): add batch runner (#30457)
<!-- 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 -->

Gradle tasks are run by invoking the Gradle CLI

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

Gradle tasks are run through the Gradle Tooling API and is more
performant.

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

Fixes #

---------

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-04-29 16:57:16 -04:00
Colum Ferry
57724d3df9
feat(nuxt): enable continuous tasks (#30925)
## Current Behavior
The tasks inferred by the `@nx/nuxt/plugin` do not set `continuous:true`
for serve-like tasks.

## Expected Behavior
The tasks should be correctly inferred with `continuous:true`.
2025-04-29 16:44:00 -04:00
Jack Hsu
307c45542a feat(graph): show next steps for successful migrations 2025-04-29 16:29:52 -04:00
Leosvel Pérez Espinosa
f39c1f991e
cleanup(linter): deprecate the Linter enum (#30875)
Properly deprecate the `Linter` enum in favor of the `LinterType` union
type and remove unneeded internal usages.
2025-04-29 12:39:36 -04:00
Leosvel Pérez Espinosa
8d0c7f6349
feat(testing): remove tsConfig and copyFiles options from the @nx/cypress:cypress executor (#30870)
Removes the previously deprecated and unused `tsConfig` and `copyFiles`
options from the `@nx/cypress:cypress` executor.

BREAKING CHANGE: The previously deprecated and unused `tsConfig` and
`copyFiles` options from the `@nx/cypress:cypress` executor were
removed.
2025-04-29 11:12:47 -04:00
Leosvel Pérez Espinosa
9ae691ede8
feat(testing): remove tsConfig option from the @nx/jest:jest executor (#30888)
Removes the previously deprecated and unused `tsConfig` option from the
`@nx/jest:jest` executor.

BREAKING CHANGE: The previously deprecated and unused `tsConfig` option
from the `@nx/jest:jest` executor was removed.
2025-04-29 11:08:59 -04:00
Craigory Coppola
c8d89e2f2a
feat(core)!: remove legacy cache flag from nx.json (#30787) 2025-04-29 10:39:36 -04:00
Craigory Coppola
4b9eab994a
fix(core): tui summary should handle in progress tasks properly (#30905)
## Current Behavior
When running via run-many failures that include a continuous task are
indicated as a cancellation on the tui summary

## Expected Behavior
Failures that run to completion are not cancelled, and should be
displayed as a failure

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

Fixes #
2025-04-29 10:00:54 -04:00
Jack Hsu
147d0e1345
chore(js): bump some v21 removal to v22 (#30911)
This PR bumps two v21 removals to v22:
1. SWC inline feature -- some people still use it even though it's
experimental. We should rethink how to remove this.
2. Cypress component testing not relying on `@nx/webpack:webpack`
executor -- we need a separate `webpack.cy.config.js` that only
configures the plugins needed Cypress CT.

This PR also keeps the Webpack plugin exports of `@nx/react` and
`@nx/webpack` packages. The `convert-to-inferred` and app generators
have been using the `@nx/react/webpack-plugin` and
`@nx/webpack/app-plugin` already for a while, there's no harm to keep
the exports in the index for older projects if they haven't been
updated.
2025-04-29 09:58:06 -04:00
Jack Hsu
e1b56f7c0a
feat(webpack): remove isolatedConfig option for @nx/webpack:webpack (#30910)
This PR removes the `isolatedConfig` option that has been deprecated
since v17. Back when it was deprecated, we had a migration to remove the
option and set `webpackConfig` with a generate config file that matches
the executor's built-in behavior. Now that we're removing the option, a
similar migration is added to generate the config files for any projects
that skipped the migration the first time.
2025-04-29 09:57:24 -04:00
Jack Hsu
e21c1a6010
feat(react): replace deprecated babel classProperties.loose option in .babelrc files (#30912)
This PR updates all `.babelrc` file that still uses the deprecated
`classProperties.loose` (deprecated since v18). The top-level `loose`
option does the same thing -- previously the two options handled
different cases because `@babel/preset-env` did not include class
properties.
2025-04-29 09:57:16 -04:00
Jack Hsu
9234fb30a6
feat(react): undeprecate svgr option for Next.js apps since --turbo supports it (#30909)
This PR delays deprecation of `svgr` for `@nx/next`, as Turbopack
supports it now.

This PR also deprecates all SVGR support for v22. It is not a well-used
feature, and the webpack plugin is not maintained. We'll ensure in v22
to add the SVGR webpack plugin to userland configs, but we'll not
maintain it ourselves moving forward.

<!-- 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 #
2025-04-29 08:44:21 -04:00
Craigory Coppola
eb54b1d249
feat(core)!: drop support for create nodes v1 in favor of only calling create nodes v2 (#30616) 2025-04-28 15:47:44 -04:00
Jason Jean
87e5e6bef8
fix(core): properly print errors coming from js when tui is enabled (#30885)
<!-- 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 the TUI is enabled, JS errors during task running cause the process
to exit without printing out information about the error and also leave
the terminal in a broken state.

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

JS errors are printed before the process exits and the terminal is
restored to a good state.

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

Fixes #
2025-04-28 11:58:59 -04:00
Jason Jean
2c8aba2fc2
feat(core): add enter and q keybindings (#30786)
<!-- 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 TUI is missing some standard keybindings:

Q to quit
Enter to show task output

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

Q now triggers a confirmation to exit. Because Q is close to 1, users
might often accidentally hit Q so this gives them a chance to cancel the
exit.
Enter will show the task output.

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

Fixes #
2025-04-28 10:40:34 -04:00
Jason Jean
85bc540a15
fix(core): quick fix to support trailing commas when reading hoisted … (#29436)
…versions

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

Graph fails when there is a trailing comma in a package.json

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

Graph does not fail and works when there is a trailing comma in a
package.json

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

Fixes #
2025-04-27 00:12:44 +00:00
François
da4f55bca3
fix: check if dependencies & devDependencies exist before deleting dep (#30224)
## Current Behavior
`removeDependenciesFromPackageJson` tries to delete dep from `undefined`
if there is no `dependencies` or `devDependencies` in package.json

## Expected Behavior
First check if `dependencies` or `devDependencies` exists

## Related Issue(s)
Fixes #30222

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-04-25 23:42:31 +00:00
Jack Hsu
0dc4dbf499
feat(graph): add undo migration option when one is pending approval (#30878)
This PR adds a button for user to undo a migration that's already been
applied and pending approval.

See: https://www.loom.com/share/97286bdc80ea4538af76a914ef8f0f8b

Also, fixes an existing issue where `migrations.json` did not record the
correct git sha for each commit.


## Current Behavior
When a migration is pending approval, the only option is to accept it.

## Expected Behavior
Allow user to undo a migration if they don't want the changes.

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

Fixes #
2025-04-25 16:20:17 -04:00
Jason Jean
73da211694
feat(misc): remove migrations prior to v19 in preparation for v21 (#30839)
<!-- 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 -->

Users migrating from Nx 17 can go up to Nx 20. 

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

Users migrating from Nx 19 can go up to Nx 21. Users migrating from Nx
17 or 18 should go to Nx 19 first.. then go to Nx 21.

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

Fixes #
2025-04-25 15:06:02 -04:00
Craigory Coppola
c21b606120
fix(core): error message when failing to fetch migrations is no good (#30874)
<!-- 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
We error when failing to find a package version via the install step,
but meant to warn. Additionally, the warning is hard to see.

## Expected Behavior
We don't error when failing to install the package, but the warning is
more visible.

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

Fixes #
2025-04-25 13:40:10 -04:00
Jonathan Cammisuli
2f739e9fbf
fix(core): do not clone screen on every render loop of the TUI (#30872)
<!-- 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 -->
Everytime the TUI is rendered with a terminal pane opened, we clone the
screen. This cloning is resource intensive as we would be creating a new
screen every couple of milliseconds.
 
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This has changes so that we can pass a reference to the screen to be
used in places where its needed. This avoids the cloning the screen.

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

Fixes #
2025-04-25 17:25:53 +00:00
Jason Jean
8214ab49f2
chore(repo): assign proper outputs to build targets (#30865)
<!-- 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 -->

`nx:build` cannot be run in parallel with any other tasks. It was an
improper fix for an issue we were facing in our task graph. This is also
not workable if any continuous tasks are running.. which I want
`local-registry` to be running while things are built.

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

The proper outputs are set on `build` targets. Most of them only need
`README.md` as the output. `nx`, `create-nx-workspace`, and
`create-nx-plugin` are different and need a few more files.

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

Fixes #
2025-04-25 13:23:44 -04:00
Leosvel Pérez Espinosa
840aef802f
feat(core): remove deprecated readWorkspaceConfig (#30868)
Remove the deprecated function `readWorkspaceConfig` from
`@nx/workspace`.

BREAKING CHANGE: The previously deprecated `readWorkspaceConfig`
function from `@nx/workspace` was removed.
2025-04-25 15:28:37 +00:00
Colum Ferry
0c63624407
fix(module-federation): check the remote project targets for buildTarget to use #30808 (#30867)
## Current Behavior
Module Federation collectRemotes util looks for a hardcoded `build`
target.

## Expected Behavior
Read the remote's targets and find the correct `buildTarget` option for
the module-federation-dev-server to use

## Related Issue(s)

Fixes #30808
2025-04-25 16:00:00 +01:00
James Henry
c0426c1b35
fix(release): ensure versionData is always populated even when no bumps (#30866) 2025-04-25 09:13:37 -04:00
Leosvel Pérez Espinosa
73077fec66
feat(core): remove usage of cli property from migration definitions (#30855)
Removes the usage of the `cli` property from migration definitions.

BREAKING CHANGE: The `cli` property from migration generator definitions
is no longer used. The CLI to run the migration generator will be
identified based on whether the definition is contained in `generators`
(Nx) or `schematics` (Angular CLI).
2025-04-25 09:13:01 -04:00
Leosvel Pérez Espinosa
c0aa245d9c
feat(testing): remove deprecated getJestProjects (#30844)
Remove the deprecated function `getJestProjects`.

BREAKING CHANGE: The previously deprecated `getJestProjects` function
was removed in favor of `getJestProjectsAsync`.
2025-04-25 09:12:13 -04:00
Thomas Dekiere
69ea6327d3
fix(release): ensure generatorOptions and rootVersionActionsOptions are passed to updateLockfile function (#30796) 2025-04-25 12:41:03 +00:00
Miroslav Jonaš
cd55dfcb3e
feat(linter): add support for package based secondary entry points (#30809)
This PR adds support for package.json based secondary entry points and
implements fix for situation when package imports base entry point as
dynamic dependency and secondary entry point as static dependency.

## Current Behavior
When the package is imported from itself, check for a secondary entry
point checks only Angular-style secondary entry points.

When package is importing from the same library as dynamic import from
root and static import from secondary entry point we still get linter
errror.

## Expected Behavior
Check for secondary entry points should also support standard
package.json-based entry points.

Importing from the same library as dynamic import from root and static
import from secondary entry point should be allowed.

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

Fixes #18552
2025-04-25 14:31:33 +02:00
Jason Jean
dda740fd2d
fix(core): handle skipped tasks and trigger finished state (#30864)
<!-- 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 tasks are skipped due to a dependent task's failure, the TUI does
not recognize that the command is concluded and leaves the user in a
confusing state where Nx seems like it is still waiting for tasks.

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

When tasks are skipped due to a dependent task's failure, the TUI shows
that the command has concluded.

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

Fixes #
2025-04-25 12:15:43 +00:00
Colum Ferry
a65f0f421b
feat(rspack): use custom WriteIndexHtmlPlugin to handle variable interpolation (#30805)
## Current Behavior
The `HtmlRspackPlugin` does not support interpolation of %VAR% in the
index.html.
This is supported with a custom Webpack Plugin for `@nx/webpack` for
generating index.html files.

## Expected Behavior
The `@nx/rspack` plugin should support the same feature set as webpack
for seamless migration.
Add a new `WriteIndexHtmlPlugin` for Rspack to support this.
It should only be used when `useLegacyHtmlPlugin` is set to true
2025-04-25 09:58:21 +01:00
James Henry
ee097a8e10
feat(release)!: useLegacyVersioning is false by default, migrate config (#30838)
This PR updates `nx release` to use the revamped versioning
implementation by default. It also updates and adds relevant
documentation, and provides an automated migration for the new
configuration structure.

For anyone exclusively versioning TS/JS packages, there should be no
real difference to your experience (although a number of bugs have been
fixed and new features around updating multiple `package.json` files at
once are now available to you with this change).

For the lifecycle of Nx v21, `release.version.useLegacyVersioning` will
remain as a option that can be set to `true` to revert to the old
behavior and configuration structure.

NOTE: This should only be a temporary solution, for example if one of
the plugins you use does provide a `VersionActions` based versioning
implementation yet. The option and legacy implementation will be removed
entirely in Nx v22 (in ~6 months).

BREAKING CHANGE:

**⚠️ For any early adopters of `VersionActions` in Nx 20.8 when it was
opt-in, there are breaking changes to the abstract class here as well.**

`manifestRootsToUpdate` has gone from `string[]` to `manifestsToUpdate:
{ manifestPath: string; preserveLocalDependencyProtocols: boolean; }[]`
to support controlling the local dependency updates per manifest in
order to support advanced source vs dist scenarios, and correspondingly
`isLocalDependencyProtocol` has been removed from the abstract class and
the method will no longer be called from the core logic. It should be
thought of as an implementation detail of `updateProjectDependencies`
instead.
2025-04-24 22:09:38 -04:00
Jason Jean
053fc67e90
fix(core): ensure task environments are processed properly in dte (#30862)
<!-- 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 new DTE APIs are missing a few things related to task environments.
Firstly, even though it processes task envs.. they are not stored on the
`processedTasks` map. Thus, the task env is not actually used to run
tasks. Secondly, some environment variables are not set during dte..
which used to.

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

The.2 things that are missing are now back. The map is populated with
the task envs and the environment variables are set based on the args.

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

Fixes #
2025-04-24 20:08:34 -04:00
Jason Jean
4254c4bcce
feat(core): allow executors to specify if they are continuous (#30821)
<!-- 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 only way to set if a task is continuous is either directly in
`project.json` or via Project Graph Plugins.

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

Executors know if they are definitely continuous or not. Plenty of
existing continuous tasks are using executors. Executors are now able to
define if they are continuous in their `schema.json` files. Thus,
existing tasks configured with certain executors will automatically
become continuous.

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

Fixes #
2025-04-24 16:41:17 -04:00
Jason Jean
eb5138e858
fix(core): add continuous to the project.json schema (#30853)
<!-- 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 `project.json` schema is missing `continuous`.

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

The `project.json` schema has `continuous` defined.

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

Fixes #
2025-04-24 15:53:54 -04:00
Jason Jean
5fb9def379
chore(repo): ensure nx build does not run with other tasks (#30857)
<!-- 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 -->

`nx:build` has `build/packages/nx` as an output. At the same time,
`build-base` tasks which depend on Nx.. are compiling based on
`build/pacakges/nx`. When `nx:build` is being restored from cache..
`build/packages/nx` gets deleted.. and then restored. While it is
deleted, `tsc` tasks are unable to find modules from `nx`.

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

This isn't necessarily the correct solution, but `nx:build` will no
longer support parallelism ensuring that it does not get restored from
the cache while other `build-base` `tsc` tasks are running. The proper
fix is to fix the outputs of `nx:build` to be more specific about the
files that it is actually modifying.

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

Fixes #
2025-04-24 14:19:57 -04:00
Nicholas Cunningham
939cc732de
fix(module-federation): remove disabling runtimeChunk (#30637)
<!-- 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 using Module Federation with an app that defines styles as a
separate entry point, HMR fails to update in the browser. Instead of
updating automatically, a warning is shown in the console related to a
missing chunk. A full-page reload is typically required, which is not
the intended behaviour.


## Expected Behavior
<!-- This is the behaviour we should expect with the changes in this PR
-->
HMR should work with styles as an entrypoint.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
The default is for `runtimeChunk` is `config.optimization.runtimeChunk =
{name: 'runtime'}` it is _not_ the same as `single` but the naming will
be the same.

Fixes #9582
2025-04-24 12:08:35 -06:00
MaxKless
ceddd44b8e
fix(gradle): make sure v1 hash file is named differently to prevent compatability errors (#30846) 2025-04-24 16:57:32 +02:00
Craigory Coppola
2961bce152
feat(core): add flaky task detection to tui summary (#30835)
<!-- 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
Flaky tasks are only shown when not using the tui

## Expected Behavior
Flaky tasks are printed at the end of the summary view
<img width="1053" alt="image"
src="https://github.com/user-attachments/assets/4b068a52-72c3-415e-af91-481c12bb3f12"
/>

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

Fixes #
2025-04-24 01:14:05 -04:00
Jason Jean
2e1896e9f7
feat(core): stream task output for all tasks except for direct output… (#30822)
… tasks

<!-- 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, only running tasks which are a PseudoTTYProcess stream
outputs to the TUI.

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

Most running tasks have `onOutput` even if they are not a
`PseudoTTYProcess`. This method is used to stream outputs to the TUI.
The only sort of running task which does not have this `onOutput` are
tasks with direct output... Those remain unhandled.. for now.

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

Fixes #
2025-04-23 17:41:14 -04:00