2043 Commits

Author SHA1 Message Date
Nicholas Cunningham
33bfc51ec2
fix(node): add project name sanitization for Docker commands. (#31461)
This PR improves our Docker support by sanitizing project names for
compatibility with Docker commands and Linux systems.

closes: #31421
2025-06-04 15:18:51 -06:00
Nicholas Cunningham
94e54754a8
fix(js): enable end-to-end tests for Vue application in dev mode (#31415)
This PR updates Vite's E2E testing setup for the Vue plugin. 

Instead of commenting out the serve for vite and rsbuild when using
playwright we update the test to ensure the ports are available before
attempting to run their preview target.
2025-06-02 10:52:35 -06:00
Jason Jean
2f37cb25a0
fix(core): use next available port when the port for nx graph is in use (#31365)
<!-- 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 -->
Command would fail silently with no error message
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Rather than erroring, Nx will find the next available port and use that.

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

Fixes #30915
2025-05-29 09:47:49 -04:00
James Henry
9ab5d820ab
fix(core): infer codex environment and use default tasks runner (#31359) 2025-05-28 14:12:17 +02:00
Nicholas Cunningham
f1171191dd
fix(webpack): add support for retrieving all transitive non-buildable dependencies (#31343)
This PR improves dependency resolution for Node.js apps using Webpack or
Rspack.

While we already handle direct dependencies for non-buildable libraries,
this update ensures that **transitive dependencies** are also properly
included. This guarantees that all necessary dependencies are bundled
when the main app/library is built.

closes: https://github.com/nrwl/nx/issues/31334
2025-05-27 00:53:45 -06:00
Emily Xiong
5537df6411
feat(gradle): exclude dependsOn tasks (#30913)
<!-- 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 -->
current gradle task executor will run gradle task as it is. by default,
gradle command will run the tasks itself and its all depends on tasks.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- add excludeDependsOn in gradle executor schema with default value to
true: this allows gradle command to run tasks without its dependsOn
tasks. this improves performance time
- change project graph plugin (dev.nx.gradle.project-graph) to accept
option atomizer:
```
nxProjectReport {
	atomized = false
}
```
this will disabled atomized targets to be created. check-ci will not
have dependsOn task ci, it will be test instead.
it will not created any ci and ci--* targets, but check-ci will be
created, but dependsOn test:
<img width="605" alt="Screenshot 2025-05-20 at 3 00 39 PM"
src="https://github.com/user-attachments/assets/a2e0ae20-78a1-4848-a063-5825b169c219"
/>

this is what check-ci target looks like with atomized as true:
<img width="917" alt="Screenshot 2025-05-20 at 2 59 34 PM"
src="https://github.com/user-attachments/assets/33c6af0b-3e45-498d-96d0-4f46c54a8159"
/>

- change dependsOn targets to include both project name and task name.
e.g. `spring-boot:checkFormat
`, so when excludeDependsOn is true, it will exclude exact task
- in batch runner, run test runner and build runner as same time

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

Fixes #
2025-05-26 13:59:04 -04:00
Nicholas Cunningham
dfc8162db7
fix(module-federation): enhance remote entry handling with query parameters in paths (#30615)
<!-- 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 -->
In Module Federation apps, when remotes are defined using URLs that
include query string or hash fragments (e.g. for cache busting), those
params are not preserved after the application is built.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This PR ensures that query strings and hash fragments are preserved when
resolving or generating remote URLs.

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

Fixes #30602
2025-05-26 09:25:32 -06:00
Leosvel Pérez Espinosa
752d418f78
feat(angular): support angular cli v20.0.0-rc.3 (#30715)
Add support for the Angular CLI **20.0.0-rc.3** version.
2025-05-26 10:00:47 -04:00
Benjamin Cabanes
1e30f3d148
chore(nx-dev): update tagline across projects (#31318)
Aligned all instances of the tagline. Changes include documentation, metadata, UI content, test assertions, and other project assets.
2025-05-23 16:20:35 -04:00
Jack Hsu
c0f2c4bb53
chore(repo): disable failing remix tests due to yarn errors (#31301)
This PR disables Remix+Yarn tests. It looks like the tests aren't set up
correctly, and we're using `yarn` even thought he workspace is set up
with pnpm.
2025-05-21 12:17:06 -04:00
Colum Ferry
2ec086a4b6
chore(angular): ensure e2es with rspack builds are minimized (#31294)
## Current Behavior
The e2e tests running Angular Rspack are not having their builds
minimized currently.

## Expected Behavior
Ensure `NODE_ENV=production` is set when calling the build commands
2025-05-21 14:22:47 +01:00
Colum Ferry
43a20e2ecc
feat(angular): add support for rspack module federation (#31231)
## Current Behavior
We currently have no method for generating Angular Rspack Module
Federation applications

## Expected Behavior
Update the `host` and `remote` generators to support a `--bundler` flag
to allow users to select Rspack as their bundler method
2025-05-21 09:45:58 +01:00
Colum Ferry
d61683efc6
feat(angular): migrate to angular rspack 21 (#31216)
## Current Behavior
The Angular plugin currently uses Angular Rspack at `^20.7.0`.
The latest release of Angular Rspack is `21.0.0`

## Expected Behavior
Use the latest version of Angular Rspack
2025-05-15 13:13:02 +01:00
Isaac Mann
514cdd890d
chore(core): disable flaky e2e tests (#31200)
Disable flaky `e2e-release` tasks
2025-05-14 09:58:39 -04:00
Emily Xiong
f339a1ab40
fix(gradle): fix gradle tests (#30879)
<!-- 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, because it requires to sign locally, so i thought run command
like
`:project-graph:publishToMavenLocal -x
:project-graph:signNxProjectGraphPluginPluginMarkerMavenPublication -x
:project-graph:signPluginMavenPublication -x
:project-graph:publishNxProjectGraphPluginPluginMarkerMavenPublicationToMavenLocal
-x :project-graph:publishPluginMavenPublicationToMavenLocal` would
publish the plugin locally, but it actually does not. it does not throw
an error, but does not do anything at all.
so for e2e tests, it is actually pulling the latest published gradle
plugin from maven rather than test local code, hence the e2e errors.

also, currently project graph build for java version 21, we change it to
java 17 to be used by ocean repo.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change the command to `./gradlew :project-graph:publishToMavenLocal
-PskipSign=true` and not apply signing when skip sign is true, so this
should be able to publish plugin to local repository.

work with java 17

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

Fixes #
2025-05-08 17:29:10 -04:00
Nicholas Cunningham
3b3b320ff7
fix(core): add keepExistingVersions to jest option to preserve dependency versions (#30652)
<!-- 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 use the jest configuration generator it will forcibly
update the jest version if the package already exist.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Now, the jest version will be preserved unless the option is passed to
update the version.

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

Fixes #
2025-05-07 10:01:10 -06:00
Nicholas Cunningham
516febf436
fix(core): Update nightly tests to work with continuous local-registry (#31007)
Currently, when the Nightly E2E Matrix job is ran it gets stuck at:
```
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
Waiting for Local registry to start on http://localhost:4873...
```

Which blocks other jobs and they will be queued for an unnecessary long
period.

![image](https://github.com/user-attachments/assets/bc9e0993-423b-4fb6-9fa0-4e4a1d0a5bb7)

This change should ensure that the local-registry is ran first before
attempting to run the test suite.

Results:
https://github.com/nrwl/nx/actions/runs/14799474928/job/41554727471
No longer hanging.
2025-05-02 17:30:12 -04:00
Jason Jean
51168a7c38
chore(repo): update nx to 21.0.0-rc.1 (#30989)
<!-- 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 21.0.0-beta.12

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

This repo uses Nx 21.0.0-rc.1

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

Fixes #
2025-05-02 05:09:40 +00:00
Nicholas Cunningham
f9d461e663
feat(react-native): update executor and schema files for expo and react-native to be continuous (#30985)
WIP

<!-- 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-05-01 18:47:35 -04:00
Emily Xiong
3877a43a47
fix(gradle): add gradle migration to change ciTargetName (#30965)
<!-- 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 pr address comments in https://github.com/nrwl/nx/pull/30457

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- update executor description
- use pseudo terminal when run batch command
- add an e2e test to run gradle command in batch
- add migration script to change ciTargetName to ciTestTargetName

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

Fixes #
2025-05-01 13:21:39 -04:00
Tine Kondo
d9cb931116
chore(repo): remove bun's workaround to make it work with verdaccio (#30468) 2025-05-01 12:16:25 +04:00
Nicholas Cunningham
28ddb8e9e7
feat(core)!: drop support for node versions prior to 20.19.0 (#30818)
<!-- 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. -->

BREAKING CHANGE: We are updating our minimum node version to `20.19.0`
which drops support for all prior versions.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-01 02:13:50 -04:00
Jason Jean
94803fbf53
chore(module-federation): disable test that is causing agents to run … (#30936)
…out of memory

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

Many pipelines are stuck because this task is causing agents to run out
of memory.

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

This test is disabled so that pipelines can complete.

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

Fixes #
2025-04-29 23:30:37 +00: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
Jason Jean
cf4a1f35e9
chore(repo): make local-registry continuous (#30789)
<!-- 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 -->

No continuous tasks are used in CI.

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

The local-registry is a continuous task and it is used in CI.

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

Fixes #
2025-04-28 20:45:34 -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
Emily Xiong
bb8c727681
chore(gradle): disable gradle import (#30900)
<!-- 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 import e2e failed from time to time. i think it is flaky test
because it passed before.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
disable this e2e test for now. will enable it later.

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

Fixes #
2025-04-28 12:21:56 -04: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
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
e23b25fcaf
chore(repo): disable failing gradle test (#30841) 2025-04-23 21:09:17 -04:00
Emily Xiong
b377c96d99
feat(java): add gradle kotlin plugin (#29464)
- [x] change init to create `createNodes` instead
- [x] unit tests
- [x] test-ci
- [x] test on windows
- [x] help metadata
- [x] external nodes

TODO:
- add publish executor?
- publish to maven central?

<!-- 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, it uses [project report
plugin](https://docs.gradle.org/current/userguide/project_report_plugin.html).
- pro: no need to maintain this plugin
- con: this plugin gives limited information

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
change the project report plugin to @nxn/gradle/plugin-v1
now the @nx/gradle plugin will use project graph plugin
(dev.nx.gradle.project-graph) created in this pr.
this plugin will create json file that is exactly what nx project grpah
expected.

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

Fixes #
2025-04-23 13:13:25 -04:00
Nicholas Cunningham
8b02fd48f7
fix(core): improve flaky ci test (#30738)
This PR updates `lerna-smoke-tests.test.ts` test file to improve the
consistency of the snapshots.
The serializer has been updated to reduce flakiness from spacing and
line breaks.
2025-04-16 15:08:16 -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
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
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
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
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
James Henry
7b85d912ba
feat(release): revamped nx release version implementation (#30418) 2025-04-08 18:17:19 +04:00
Colum Ferry
27d40a9270
feat(angular): add --bundler=rspack option to app generator (#30623)
## Current Behavior
The `@nx/angular` app generator currently does not support generating an
Angular Rspack application. This makes it slightly more difficult for
users to get up and running with Angular Rspack


## Expected Behavior
Add `rspack` as a supported `--bundler` option allowing for easy
generationg of new Angular Rspack apps.
2025-04-08 09:41:59 +01:00
Colum Ferry
9669dfdb62
feat(react): add crystal mf support to host and remote (#30424)
## Current Behavior
The `@nx/react` `host` and `remote` generators currently use executors
to support Module Federation


## Expected Behavior
When `bundler=rspack` use Crystal Module Federation with no executors
for Module Federation

## Related Issues
#30391
2025-04-02 16:58:45 +01:00
Nicholas Cunningham
a9a486aa21
fix(webpack): nestjs workspace libs referencing when using ts solution (#30538)
<!-- 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 you have a Nest app that imports a Nest Lib that is not
buildable inside a TS solution workspace the serving that application
fails because the library is marked as external.

Before we would include these projects as a part of
`tsconfig.compilerOptions.paths`. However, this is no longer possible as
it would not be a valid TS solution setup.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
If a library is not buildable it should be able to be resolved
regardless if we are using TS solutions or the legacy paths.

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

closes: #30492, #30410, #30544
2025-04-02 08:55:37 -06:00
Jack Hsu
538fd8cbf6
fix(js): update @swc/cli version to fix vulnerability (#30575)
The `@swc/cli` version we're currently using has a security
vulnerability due to dependency on `cross-spawn`. This PR updates it to
the version that fixes the vulnerability.

Advisory: https://github.com/advisories/GHSA-3xgq-45jj-v275


## Current Behavior
Existing and new JS workspaces have a high security warning.

## Expected Behavior
No high security warning for new workspaces, and existing ones are
updated.

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

Fixes #
2025-04-02 09:51:36 -04:00
Leosvel Pérez Espinosa
b3c6d2d417
fix(core): resolve subpath patterns in package exports correctly when constructing graph (#30511)
## Current Behavior

When a package has a subpath pattern like the following:

```json
{
  "exports": {
    "./*": {
      "types": "./dist/lib/*/index.d.ts",
      "import": "./dist/lib/*/index.js",
      "default": "./dist/lib/*/index.js"
    }
  }
}
```

When constructing the graph the project is not picked as a dependency of
others projects that import from the package using a path that matches
that subpath pattern. This is currently happening because the current
resolution is wrongly using `minimatch` to match those patterns instead
of the [Node.js spec for resolving subpath
patterns](https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification).

## Expected Behavior

Subpath patterns should be processed after the [Node.js
spec](https://nodejs.org/docs/latest-v22.x/api/esm.html#resolution-algorithm-specification)
and the graph should pick up dependencies when used.

## Related Issue(s)

Fixes #30342
2025-04-02 10:29:47 +02:00
Jack Hsu
2d210b8d0e
fix(bundling): webpack and rspack builds respect output.clean config option (#30573)
This PR fixes and issue where the standard `output.clean` option is
ignored and replaced by the Nx-specific `deleteOutputPath` option on the
`NxAppWebpackPlugin` and `NxAppRspackPlugin` plugins.

We want to allow users to use standards over our own features, so if we
see that `output.clean` is set in webpack/rspack config, then we use
that value.

For example, an Rspack config could be:

```js
const { NxAppRspackPlugin } = require("@nx/rspack/app-plugin");
const { join } = require("path");

module.exports = {
  output: {
    path: join(__dirname, "dist/demo"),
    clean: false, // <-- THIS DOES NOT WORK!
  },
  plugins: [
    new NxAppRspackPlugin({
      // ...
    }),
  ],
};
```

But even though `output.clean` is `false`, each build will still delete
`dist`. The only way to disable that behavior is to use the Nx-specific
option like this:

```js
const { NxAppRspackPlugin } = require("@nx/rspack/app-plugin");
const { join } = require("path");

module.exports = {
  output: {
    path: join(__dirname, "dist/demo"),
  },
  plugins: [
    new NxAppRspackPlugin({
      deleteOutputPath: false,
      // ...
    }),
  ],
};
```


## Current Behavior

Setting `output.clean` in Webpack/Rspack config does nothing, and we
always default our own `deleteOutputPath` to `true`.

## Expected Behavior
Setting `output.clean` standard option is respected.

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

Fixes #
2025-04-01 21:16:05 -04:00
Leosvel Pérez Espinosa
5974851c24
fix(js): infer dependency between typecheck and build tasks and more granular outputs for typecheck (#30549)
## Current Behavior

There is no dependency between the inferred `typecheck` and `build`
tasks. Depending on their run order, this can result in duplicated
processing (type-checking, `.d.ts` generation). Given there's no
explicit dependency, the order would be non-deterministic.

Additionally, when `outDir` is set in the tsconfig files, it's used
as-is in the currently inferred outputs for `typecheck`. This can result
in extra files being cached for the task.

## Expected Behavior

For optimum performance, the inferred `typecheck` task should depend on
the `build` task. The `typecheck` task's outputs should be more granular
so that only the relevant files (declaration files and declaration map
files if enabled) are cached.

### Explanation

Consider a typical setup with specific tsconfig file for files with
different concerns:

- tsconfig.lib.json: TS configuration for the library runtime files
- tsconfig.spec.json: TS configuration for the unit test files
- tsconfig.json: TS solution configuration, a solution file that
references the specific config files above

When running `tsc -b tsconfig.lib.json --verbose` (build), we can see
how the `tsconfig.lib.json` TS project is built:

```bash
Projects in this build:
    * tsconfig.lib.json

Project 'tsconfig.lib.json' is out of date because output file 'dist/tsconfig.lib.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.lib.json'...
```

After that, if we run `tsc -b tsconfig.json --emitDeclarationOnly
--verbose` (typecheck), we'll see how the `tsc` output for
`tsconfig.lib.json` is reused:

```bash
Projects in this build: 
    * tsconfig.lib.json
    * tsconfig.spec.json
    * tsconfig.json

Project 'tsconfig.lib.json' is up to date because newest input 'src/lib/file.ts' is older than output 'dist/tsconfig.lib.tsbuildinfo'

Project 'tsconfig.spec.json' is out of date because output file 'out-tsc/jest/tsconfig.spec.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.spec.json'...
```

The relevant bit above is `Project 'tsconfig.lib.json' is up to date
because newest input 'src/lib/file.ts' is older than output
'dist/tsconfig.lib.tsbuildinfo'`. Because the initial `build` task
already typechecks and produces `.d.ts` files for the
`tsconfig.lib.json`, when the `typecheck` task runs, `tsc` identifies
that the outputs for that config files were already produced and can be
reused.

If we were to run the tasks in the inverse order, the results would be
different:

```bash
> npx tsc -b tsconfig.json --emitDeclarationOnly --verbose
Projects in this build: 
    * tsconfig.lib.json
    * tsconfig.spec.json
    * tsconfig.json

Project 'tsconfig.lib.json' is out of date because output file 'dist/tsconfig.lib.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.lib.json'...

Project 'tsconfig.spec.json' is out of date because output file 'out-tsc/jest/tsconfig.spec.tsbuildinfo' does not exist

Building project '<workspace root>/packages/pkg1/tsconfig.spec.json'...

> npx tsc -b tsconfig.lib.json --verbose
Projects in this build: 
    * tsconfig.lib.json

Project 'tsconfig.lib.json' is out of date because buildinfo file 'dist/tsconfig.lib.tsbuildinfo' indicates there is change in compilerOptions

Building project '<workspace root>/packages/pkg1/tsconfig.lib.json'...
```

Note how when the `build` task is run, `tsc` identifies that there was a
change in `compilerOptions` (`--emitDeclarationOnly`) and it requires
building the project. This is because the `typecheck` task only
generates declaration files and the `build` task must also emit the
transpiled `.js` files.

### Benchmark

Running those two different flows in a simple (non-Nx) project with a TS
configuration structure like the one mentioned above and with 5000 TS
files split in half for runtime and test files yields the following:

```bash
hyperfine -r 5 -p "rm -rf dist out-tsc" \
-n "build => typecheck" "npx tsc -b tsconfig.lib.json && npx tsc -b --emitDeclarationOnly" \
-n "typecheck => build" "npx tsc -b tsconfig.json --emitDeclarationOnly && npx tsc -b tsconfig.lib.json"
Benchmark 1: build => typecheck
  Time (mean ± σ):      6.832 s ±  0.094 s    [User: 11.361 s, System: 1.060 s]
  Range (min … max):    6.734 s …  6.985 s    5 runs
 
Benchmark 2: typecheck => build
  Time (mean ± σ):      8.789 s ±  0.015 s    [User: 14.817 s, System: 1.267 s]
  Range (min … max):    8.771 s …  8.812 s    5 runs
 
Summary
  build => typecheck ran
    1.29 ± 0.02 times faster than typecheck => build
```

## Related Issue(s)

Fixes #
2025-03-31 19:05:52 +02:00
Nicholas Cunningham
bf8848da95
fix(webpack): add extension alias support for handling ESM libs (#30513)
<!-- 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, if you have a webpack application that uses out
NxWebpackAppPlugin and has a non-buildable lib that has exports with
extension enabled for example:`export * from './lib/lib8446520.js';`.
The app fails to build.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
When using webpack and including libraries that contain extension it
should resolve.

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

Fixes #30492
2025-03-28 11:51:20 -06:00
Leosvel Pérez Espinosa
e4e9973db3
fix(js): infer typecheck task for buildable libraries with tsc (#30505)
## Current Behavior

Buildable libraries using `tsc` for `build` don't get a `typecheck`
task, which results in test files not being type-checked.

## Expected Behavior

The `typecheck` task should be inferred, and test files should be
type-checked.

## Related Issue(s)

Fixes #
2025-03-27 09:35:17 +01:00
Nicholas Cunningham
1a235d7236
fix(react): react-router should work with jest out of the box (#30487)
Jest should be compatible with react-router out of the box.

<!-- 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, there are two issues when using `jest` with react-router out
of the box

1. Test files are not included from `tsconfig`
2. While running the test `jsdom` is missing Node's `TextEncoder` and
`TextDecoder` so compilation fails.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running a test should work without issues when you create a react-router
app with Jest.

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

Fixes #30387
2025-03-26 10:44:28 -06:00
Jack Hsu
32f0acab42
feat(bundling): add buildLibsFromSource option to @nx/rollup:rollup executor (#30417)
Add `buildLibsFromSource` to the `@nx/rollup:rollup` executor to bring
it to parity with Webpack/Rspack/Vite. This allows the bundle to point
to dist if `buildLibsFromSource: false` is set, which enables
incremental builds.

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

Note: This only applies to workspaces using tsconfig paths, as that
linking mechanism is assumed by `buildLibsFromSource`. For NPM
workspaces, whatever is defined in `package.json` exports is used as we
use Node resolution in the new setup.

## Current Behavior
`buildLibsFromSource` does not exist

## Expected Behavior
`buildLibsFromSource exists

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

Fixes #
2025-03-21 09:30:53 -04:00
Roman Lorenzo Balayan
2a0d89ddc3
fix(gradle): build nx graph for gradle projects regardless of build gradle file location (#29783) (#29802)
<!-- 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 -->
With a project structure where build.gradle.kts is defined in a separate
buildSrc directory, and not in the root project directory where
`gradlew` is defined, the gradle project is not included in nx project
graph. This is a valid gradle project configuration, with project-report
tasks configured. Running ./gradlew projectReport works and builds the
projectReport.

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

With the fix, as long as expected tasks - projectReport or
projectReportAll - is defined, nx should be able to build the nx graph
regardless of the location of the `build.gradle` or `build.gradle.kts`
file.

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

Fixes #29783
2025-03-19 13:35:27 -04:00