## Current Behavior
When we resolve the config file for rspack, it can be provided in a few
different formats:
```
config
config.default
config.default.default
```
We do not handle if the config is provided in any of the named default
methods.
## Expected Behavior
Handle named defaults for the resolved user config for Rspack.
Reproduction repo: https://github.com/olaf-cichocki/sample
## Current Behavior
When using mjs config file we end up with following error:
```
⚠️ Unable to construct project graph.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
An error occurred while processing files for the @nx/rspack/plugin plugin.
- apps/appA/rspack.config.mjs: require() of ES Module /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs not supported.
Instead change the require of /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs to a dynamic import() which is available in all CommonJS modules.
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs not supported.
Instead change the require of /Users/miro/Dev/Testbox/sample/apps/appA/rspack.config.mjs to a dynamic import() which is available in all CommonJS modules.
at resolveUserDefinedRspackConfig (/Users/miro/Dev/Testbox/sample/node_modules/.pnpm/@nx+rspack@20.2.0-beta.3_@babel+traverse@7.25.9_@module-federation+enhanced@0.7.6_react-dom@1_7iwdcl66l7me4m7pewq22wegge/node_modules/@nx/rspack/src/utils/resolve-user-defined-rspack-config.js:19:16)
at createRspackTargets (/Users/miro/Dev/Testbox/sample/node_modules/.pnpm/@nx+rspack@20.2.0-beta.3_@babel+traverse@7.25.9_@module-federation+enhanced@0.7.6_react-dom@1_7iwdcl66l7me4m7pewq22wegge/node_modules/@nx/rspack/src/plugins/plugin.js:65:98)
at createNodesInternal (/Users/miro/Dev/Testbox/sample/node_modules/.pnpm/@nx+rspack@20.2.0-beta.3_@babel+traverse@7.25.9_@module-federation+enhanced@0.7.6_react-dom@1_7iwdcl66l7me4m7pewq22wegge/node_modules/@nx/rspack/src/plugins/plugin.js:51:34)
at async /Users/miro/Dev/Testbox/sample/node_modules/.pnpm/nx@20.2.0-beta.3/node_modules/nx/src/project-graph/plugins/utils.js:10:27
at async Promise.all (index 0)
```
## Expected Behavior
Using EU module config files is supported
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
Thank you @olaf-cichocki for reporting the issue.
## Current Behavior
The `@nx/js/typescript` plugin infers tasks with `--verbose`. This can
prevent users from running the same task with `--clean.` It can also
produce a lot of logs that might not be too relevant.
## Expected Behavior
The `@nx/js/typescript` plugin should not infer tasks with `--verbose`.
This is more aligned with other tools.
A new plugin option `verboseOutput` is added to allow inferring all
tasks with `--verbose` if desired.
Note: This revealed that some things were working (e.g., `dependsOn`)
because all the `typecheck` commands inferred by the different plugins
matched. As soon as the command is different, the different inferred
tasks are not merged, which is expected. We shouldn't rely on that, and
each plugin inferring the task should set the right options/metadata.
The different plugins were updated in this PR accordingly (they don't
have the verbose option).
We'll follow up on this later, so only the `@nx/js/typescript` plugin
infers the `typecheck` task. This is a breaking change so it will be for
Nx v21.
## Related Issue(s)
Fixes#28677
## Current Behavior
Our Module Federation Config allows passing tuple remotes:
```js
remotes: [
["remote1", "http://localhost:4201/remoteEntry.js"]
]
```
However, if the Module Federation system is expecting the remotes to be
loaded as Global variables in the browser, then we erroneously pass just
the url to webpack/rspack's `extractUrlAndGlobal` method.
This expects a string of format `name@url`. For non-tuple remote
configurations, we create this correctly.
However, when a tuple is passed, we simply return the url.
## Expected Behavior
We should ensure that the string is massaged to `name@url` even when a
tuple is provided.
<!-- 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 #
<!-- 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 cache project report, it caches buildFileToDepsMap,
which is a map of build file to path of dependencies.txt
- however, when we try to read dependencies.txt in create dependencies,
it might not exist
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- read the dependencies.txt file when process project report to cache
- cache dependencies as processed project report result
- no need to read dependencies.txt in create dependencies
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
Small fix for using
jest-runner-groups(https://www.npmjs.com/package/jest-runner-groups)
with Nx.
## Current Behavior
When running jest executor with extra group argument like:
```
nx run app-nebula-explorer-api:test --group=unit
```
`jest-runner-groups` runs all tests, not only from selected group.
From my investigation, `jest-runner-groups` using process.argv to
extract `--group` args
3c9d3cf4cb/index.js (L57)
and `process.argv` passed to runner contains:
```javascript
[
'M:\\programs\\nodejs\\22\\node.exe',
'M:\\projects\\someproject\\node_modules\\.pnpm\\nx@19.3.2_@swc+core@1.6.6_@swc+helpers@0.5.11_\\node_modules\\nx\\bin\\run-executor.js'
]
```
## Expected Behavior
Running jest executor with jest-runner-groups runner and `--group` args
should run only tests from group.
## PR changes summary
I implemented fix as generic and any extra arg will be added to
`process.argv` .
---------
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
## Current Behavior
All of the TS source trees are unnecessarily traversed when a local
plugin is being registered.
## Expected Behavior
TS source trees are not unnecessarily traversed.
## Related Issue(s)
Fixes#29102 (see issue for more context)
<!-- 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 #
## Current Behavior
`@nx/module-federation` is currently pinned to depend on
`webpack@5.88.0`. However, other Nx packages such as `@nx/webpack`
depend on a range of versions `^5.80.0`.
This leads to peerDep issues when package managers attempt to resolve
the packages.
## Expected Behavior
Change `@nx/module-federation` to depend on a range of versions.
`wepback@^5.88.0`.
## Related Issue(s)
Fixes#29682
The fallback path resolution was only happening if the resolvedFile was
a falsy value, so it was returning inexistent filepaths.
This pull request includes a small but important change to the
`packages/vite/plugins/nx-tsconfig-paths.plugin.ts` file. The change
improves the reliability of resolving file paths by checking if the
resolved path exists before proceeding with fallback file matching.
*
[`packages/vite/plugins/nx-tsconfig-paths.plugin.ts`](diffhunk://#diff-ad026b24ed45d9df484cabc7e277fc9b4d7759560af36bf357cbc4186725ae0bL174-R176):
Added a check to verify if the resolved file path exists before using
fallback file matching.
*
<!-- 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 resolver doesn't resolve the full file path, it ignores the file
extension. For example, for a path like this:
`import mergeClassNames from '@projects/global/utils/mergeClassNames'`
It resolves to
`absolutePath.../projects/libs/global/src/utils/mergeClassNames`
When vite is building a project, it doesn't find the file and it errors.
This happens because the resolved file path is not a falsy value, thus,
it doesn't run the fallback file path matching.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
What is expected is that it resolves to (notice the file extension)
`absolutePath.../projects/libs/global/src/utils/mergeClassNames.ts`
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
---------
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
<!-- 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 current docker image being used cannot fetch chrome.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The new docker image can fetch chrome and pipelines can run.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
<!-- 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 -->
Running tasks in parallel, we can set prefixes. However, there is no way
to label our prefixes with colors. Currently the only way is to set the
entire line to the color we want. This is not ideal as users may want to
keep the default colors for the logs and only want to use the prefix
colors as identifiers.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
PR to add this option
## Screenshots (Examples)
Tested with example screenshots below
### Before (v20.2.2 latest release)
<img
src="https://github.com/user-attachments/assets/dcc9b3fa-1977-4096-9dd2-3b111570c8cd"
alt="description" width="300" />

### This PR (local release)
<img
src="https://github.com/user-attachments/assets/6dc9eb3a-bc83-49cd-aad1-778b4f2eb354"
alt="description" width="300" />

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
---------
Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
<!-- 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 -->
If I set `skipFormat` to `true` when creating a JS library with the
rollup bundler, formatting is still run during the rollup configuration
creation step.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`skipFormat` flag should be respected.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
## Current Behavior
I have a project that is utilizing the `@nx-go/nx-go` extension that's
used for supporting Go applications.
When I attempt to use the `@nx/workspace:move` generator to move a Go
library, it'll produce an error. (Please refer to the _Failure Logs_
section for said error.)
Sadly, there isn't a consistent means to get the bun to start showing
up, but once it does, the issue will persist throughout the workspace's
life cycle.
I was able to trace this to the compiled Javascript files within Nx's
installed project files under the `node_modules` directory, which is
where I found a workaround. That being to have the
`secondaryEntryPointImportPaths` variable (located within the
`updateImports` function) set with an empty array on the same line it's
declared.
However, this will produce a `tsconfig.base.json` file at the root of
the workspace with the text `undefined` contained within it and with no
actual JSON to speak of.
## Expected Behavior
I have a project that is utilizing the `@nx-go/nx-go` extension that's
used for supporting Go applications.
The `@nx/workspace:move` schematic generator should be able to move
libraries based in Go and other programming languages without any errors
popping up.
It should also do it without generating an empty `tsconfig.base.json`
file if one didn't exist previously. This tends to be the case when
there is no Typescript to speak of within the Nx workspace. For example,
an Nx workspace initiated with the `@nx-go/nx-go` preset.
## Related Issue(s)
- [#28349](https://github.com/nrwl/nx/issues/28349)
Co-authored-by: Kerick Howlett <88661181+KerickHowlett@users.noreply.github.com>
## Current Behavior
Running Nx in multiple processes at the same time with the daemon
disabled can cripple a system due to excess memory usage when creating
the graph. This is due to plugin workers being started per-parent
process when there is no daemon. This change enables a file lock to
prevent the simultaneous processing, and read from the cache when the
first run completes.
Currently, running `nx show projects` 30 times in parallel looks
something like this:
30 processes exited within 37535ms
## Expected Behavior
30 processes exited within 6435ms
## Test Script
```js
//@ts-check
const { spawn } = require('child_process');
let alive = new Set();
let start = Date.now();
let iterations = 30;
for (let i = 0; i < iterations; i++) {
const cp = spawn('npx nx show projects', [], {
shell: true,
env: {
...process.env,
NX_DAEMON: 'false',
NX_VERBOSE_LOGGING: 'true',
},
});
alive.add(i);
// cp.stdout.on('data', (data) => {
// console.log(`stdout [${i}]: ${data}`);
// });
cp.stderr.on('data', (data) => {
console.error(`stderr [${i}]: ${data}`);
});
cp.on('exit', (code) => {
console.log(`child process ${i} exited with code ${code}`);
alive.delete(i);
});
}
const i = setInterval(() => {
if (alive.size > 0) {
} else {
clearInterval(i);
console.log(
`${iterations} processes exited within ${Date.now() - start}ms`
);
}
}, 1);
```
This PR fixes an issue with React libs, where TS rules are being applied
to JSON files.
<!-- 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#28245
---------
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Removes the `node-fetch` dependency and uses the native fetch global for
the `isPackagerRunning()` check
## Current Behavior
- Dependency `node-fetch` is used.
## Expected Behavior
- Removed the `node-fetch` dependency.
- Used the native `fetch` global.
---------
Co-authored-by: Colum Ferry <cferry09@gmail.com>
There is a bug when `outputFile` is specified in `playright.config.ts`,
and atomizer is enabled via `ciTargetName`, then the path of the output
file is wrong.
For example, if you have this reporters entry:
```
reporter: [
[
'junit',
{
outputFile: 'dist/report.xml',
},
],
],
```
Then the atomized output file would be something like
`dist/report.xml/example-spec-ts`, where `report.xml` is a directory.
The correct output file should be `dist/example-spec-ts/report.xml` to
avoid conflict with the non-atomized output of `dist/report.xml`.
## Current Behavior
If you run `nx e2e proj` then `nx e2e-ci proj` then you can run into an
issue where `report.xml` (or whatever the file name is) is a directory
in the cache, but it is a file currently -- or vice versa. This happens
due to the bug described above.
## Expected Behavior
The `outputFile` should never cause a conflict where a path should be a
directory but is currently a file, or vice versa.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
<!-- 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 -->
Left a log by accident.
`master` is broken because of migrations misalignment..
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Log is removed
migrations docs are aligned.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
<!-- 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 -->
There is no specific API for running things before and after tasks run.
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This PR adds an API akin to npm's `preinstall` and `postinstall`.
Plugins can now specify `preTasksExecution` and `postTasksExecution`
functions which run before and after Nx runs tasks respectively.
```ts
import type { PreTasksExecutionContext, PostTasksExecutionContext } from '@nx/devkit';
interface PluginOptions {
field: any;
}
export function preTasksExecution(options: PluginOptions, context: PreTasksExecutionContext) {
console.log('prerun')
}
export function postTasksExecution(options: PluginOptions, context: PostTasksExecutionContext) {
console.log('postrun', context.taskResults)
}
```
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
Reverts nrwl/nx#29577
There is an issue with workspaces using tsconfig path alias, and when an
invalid import is found, it'll match on the wrong package due to the
name matching the prefix.
<!-- 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
-->
Nx should install and depend on a version of express without security
vulnerabilities.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes #
Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
- Fix server file location for the `@nx/remix:library` generator
- Do not error when generating a buildable Remix library in the TS
solution setup
- Install the correct versions of react-related packages when generating
a React library
## Current Behavior
## Expected Behavior
## Related Issue(s)
Fixes #