Compare commits

...

369 Commits

Author SHA1 Message Date
Nicholas Cunningham 22684215ad fix(react): add missing offset variable for generateFiles 2025-07-23 14:42:16 -06:00
Nicholas Cunningham 05949b1f8f fix(nextjs): use files array instead of types for Next.js typings 2025-07-23 13:45:30 -06:00
Nicholas Cunningham 635d15f50b fix(react): use files array instead of types for CSS module typings
When using pnpm with its strict symlink structure, TypeScript fails to resolve
the @nx/react/typings/cssmodule.d.ts file when it's specified in the types array.
This is because pnpm doesn't hoist dependencies in the same way as npm/yarn.

By moving these type definitions to the files array  we ensure they are always included regardless of the package manager's module resolution

Fixes: #29945
2025-07-23 13:28:21 -06:00
Nicholas Cunningham 758e793e5f feat(bundling)!: remove stylus support (#32035)
BREAKING CHANGE: Stylus (.styl) files are no longer supported.

Stylus has been deprecated and was slated to be removed in Nx 20. 
Now we are removing it.

- Remove `stylus` and `stylus-loader` dependencies
- Remove `deprecated-stylus-loader` file
- Remove `stylus` configuration from `webpack` and `rspack` plugins
- Remove `'styl'` option from `rspack` generator schemas and TypeScript
definitions
- Remove `.styl`/`.stylus` extensions from executor schema file
completion globs

MISC
Even though we removed stylus from our repo as a dependency other
projects in the workspace still have stylus as an optional dependency:
  - Vite
  - Astro
  
So we add a placeholder for it since on npm registry there is a
_security_ placeholder.

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-07-23 10:56:35 -04:00
Colum Ferry f20ff566d7 fix(core): handle undefined packageJson.dependencies (#31998)
## Current Behavior
`npm-parser` for lockfile pruning is trying to run `Object.entries` on a
potentially null or undefined object (packageJson.dependencies).

## Expected Behavior
Ensure `?? {}` is used when evaluating `Object.entries`
2025-07-23 08:24:04 -04:00
Nicholas Cunningham 87b04d4617 fix(bundling): fix stylus installation error due to npm security (#32036)
### Changes

The stylus npm registry has been compromised.
So can resolve `stylus` with `npm:ignore@*` it tells the package manager
to replace the dependency with the ignore package from npm registry.

Until we can merge: https://github.com/nrwl/nx/pull/32035
2025-07-23 10:58:06 +00:00
MaxKless b879e7e0d2 chore(misc): change cursor mcp.json to use streamable http instead of sse (#31994) 2025-07-23 12:46:52 +02:00
Leosvel Pérez Espinosa dd57e0faf0 fix(core): render the correct output in the tui terminal pane when pinning task (#31975)
## Current Behavior

In the TUI, opening the Terminal Pane for a task with the space bar,
navigating to another task, and pressing "1" to pin it, results in the
terminal pane displaying the output of the task for which the space bar
was pressed initially instead of the pinned task.

## Expected Behavior

Pinning tasks in the TUI should work correctly and always display the
output of the pinned task.
2025-07-23 09:37:39 +02:00
Victor Savkin 51b702e67f cleanup(misc): point to the guide with next steps (#32026)
<!-- 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-07-22 17:52:33 -04:00
Caleb Ukle eb2392a515 docs(core): add "next steps" for nx init docs (#32025)
improve doc page where people land after running `nx init` 
- clarify how to use nx after setup
- make sure to update CI configs
- how to finish nx cloud setup if opted-in for cloud
2025-07-22 18:11:13 +00:00
Emily Xiong 862bc4bbb0 chore(gradle): document build-ci target (#31660)
<!-- 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 -->
add documentation for build-ci target for gradle

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
currently there is no build-ci target documented

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

Fixes #
2025-07-22 13:00:09 -04:00
Caleb Ukle 0348faa7c5 docs(core): update intro language for tutorials (#32005)
<!-- 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 -->
tutorial intro language is subpar
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
improve tutorial intro language

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

Fixes #
2025-07-22 09:37:47 -05:00
Leosvel Pérez Espinosa 0bbb473f4f fix(testing): add missing package updates for ts-jest and jest-util for jest v30 migrations (#32017)
## Current Behavior

The migration for Jest v30 is missing package updates for `ts-jest` and
`jest-util`.

## Expected Behavior

The migration for Jest v30 should have package updates for `ts-jest` and
`jest-util`.
2025-07-22 13:13:12 +02:00
Leosvel Pérez Espinosa a64af8b59b fix(testing): normalize spec files correctly in jest replace-removed-matcher-aliases migration (#31995)
## Current Behavior

When running the Jest `replace-removed-matcher-aliases` migration on
Windows, it resolves the spec files incorrectly and fails.

## Expected Behavior

Running the Jest `replace-removed-matcher-aliases` migration should work
correctly regardless the OS.

## Related Issue(s)

Fixes #31991
2025-07-22 13:12:53 +02:00
Leosvel Pérez Espinosa aad2e81eaa fix(nextjs): infer relevant tasks with the typescript sync generator when using ts project references (#31996)
## Current Behavior

When using the TS solution setup, tasks inferred by the
`@nx/next/plugin` do not have the `@nx/js:typescript-sync` generator
set.

## Expected Behavior

When using the TS solution setup, tasks inferred by the
`@nx/next/plugin` should have the `@nx/js:typescript-sync` generator
set.

## Related Issue(s)

Fixes #31983
2025-07-22 09:10:21 +02:00
Jack Hsu 5163bcddfd docs(misc): remove CI tutorials and redirect to their setup guides (#32004)
This PR removes the two CI tutorials (GitHub Actions and CircleCI) and
redirect them to the setup guides:
- https://nx.dev/ci/recipes/set-up/monorepo-ci-github-actions
- https://nx.dev/ci/recipes/set-up/monorepo-ci-circle-ci

There's not much value in having separate CI tutorials now that CI is a
central part of the main tutorials, rather than an optional step. e.g.
https://nx.dev/getting-started/tutorials/typescript-packages-tutorial

The guides are sufficient for users that want to learn how to set up
their CI with Nx Cloud.
2025-07-21 21:10:15 +00:00
Mike Hartington 105ce6af06 docs(nx-dev): add 21.3 changelog (#32000)
<!-- 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-07-21 13:18:30 -04:00
Leosvel Pérez Espinosa 59496ed446 fix(linter): update lint executor to correctly handle --fix and --quiet (#31970)
## Current Behavior

When running ESLint using the `@nx/eslint:lint` executor with `--quiet`
and `--fix`, and there are errors, no fix is made, and the task
incorrectly succeeds.

This is a regression introduced by
https://github.com/nrwl/nx/commit/9406d2bfdb15e33ad85345533f96f6136130e817,
which updated the executor to not fix warnings when `--quiet` is used,
but the solution was incorrect.

## Expected Behavior

When running ESLint using the `@nx/eslint:lint` executor with `--quiet`
and `--fix`, and there are errors, fixes should be applied, and the task
should succeed if there are no remaining errors. It should not fix
warnings.

## Related Issue(s)

Fixes #31868
2025-07-21 19:03:03 +02:00
Victor Savkin 84a6f9da35 fix(misc): fix setup selection (#31997)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

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

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

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

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

Fixes #

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-07-21 15:44:10 +00:00
James Henry 27330b53bd docs(core): update self-healing-ci.md (#31993) 2025-07-21 15:37:00 +02:00
Jason Jean 4720175b1e chore(repo): update nx to 21.4.0-beta.0 (#31985)
Updating Nx from 21.3.0-rc.0 to 21.4.0-beta.0
2025-07-20 10:07:34 -04:00
Victor Savkin 82ba3b71fa cleanup(misc): small tweaks to cnw and init (#31986)
<!-- 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-07-20 10:02:26 -04:00
Jason Jean 21c528e706 fix(jest): revert back to Jest 30 after synckit compatibility fix (#31984)
## Current Behavior

Jest is currently pinned to version 29 due to compatibility issues with
synckit@0.11.10 that caused TypeErrors in Jest tests.

## Expected Behavior

With the synckit compatibility issue resolved in v0.11.11, Jest can be
safely upgraded back to version 30, providing users with the latest Jest
features and improvements.

## Related Issue(s)

The underlying synckit compatibility issue has been fixed:
https://github.com/un-ts/synckit/issues/252

This reverts the temporary downgrade that was applied in #31981.

Fixes the Jest version regression by restoring Jest 30 support.
2025-07-19 11:57:26 -04:00
Nicholas Cunningham 34c5b614f4 fix(core): adjust artifacts path for publish (#31979)
Update native `.wasm` paths to be `./artifacts`
2025-07-18 19:08:44 -06:00
Nicholas Cunningham 91acf8c792 fix(jest): revert version back to 29 (#31981)
### Changes

Newly create projects fail when using jest v30 so lets revert this for
now
2025-07-18 19:39:17 -04:00
Nicholas Cunningham 0ca4aacd0b feat(repo): use ts solution in the nx repo (#31654)
This PR updates the Nx repo to use ts solution to improve build
processes and module resolution via the `@nx/js/typescript` plugin.

- Added `@nx/js/typescript` (adding new targets `typecheck` and
`build-base`)
- Updated all e2e test projects for consistent module resolution. (Now
contains `package.json` for all dependencies)
- Fixed module resolution conflicts by streamlining `NODE_PATH` handling
in e2e tests.
- Added `legacy-post-build` executor merging `copy-asset` and
`package.json` cleanup.
- Added `package.json` to e2e projects for proper dependency management.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: yarden-island <yarden@island.io>
Co-authored-by: Julien Marcou <julien.marcou@convelio.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-18 14:49:03 -04:00
Jason Jean ccbc750b7b chore(repo): update nx to 21.3.0-rc.0 (#31968)
Updating Nx from 21.3.0-beta.7 to 21.3.0-rc.0

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-07-18 15:22:25 +00:00
Jason Jean 98383131a0 fix(core): allow nx-cloud commands to run without local Nx installation (#31974)
## Current Behavior

When running nx-cloud commands like `nx start-ci-run` in environments
without local Nx installation, users get this error:

```
NX   Could not find Nx modules at "/path/to/workspace".
Have you run npm/yarn install?
```

This prevents legitimate use of nx-cloud commands in CI environments
that don't have local Nx modules installed.

## Expected Behavior

nx-cloud commands should be able to run using the global Nx installation
without requiring local Nx modules, since they're designed to work
independently of the local workspace setup.

## Related Issue(s)

This fixes scenarios where users run `nx start-ci-run` in CI
environments without local Nx installation.

## Changes Made

- Added `isNxCloudCommand()` function to identify nx-cloud commands:
`start-ci-run`, `login`, `logout`, `connect`, `view-logs`, `fix-ci`,
`record`
- Modified the missing local installation check to exclude nx-cloud
commands
- Added execution path for nx-cloud commands when no local Nx is
available - they now run via the global nx-commands module
- Preserves the error check for regular Nx commands that require local
installation

## Testing

- Verified that nx-cloud commands are properly identified
- Confirmed that regular Nx commands still show the error when local Nx
is missing
- Ensured nx-cloud commands can run without local Nx installation
2025-07-18 10:30:10 -04:00
Iulian Marcu 2f2764d695 feat(release): releaseTagPatternStrictPreid option to match git tag based on semver preid (#31756) 2025-07-18 16:30:18 +04:00
Jason Jean 30ca911ab0 feat(core): add GitHub repository creation and push functionality (#31936)
## Current Behavior

The `create-nx-workspace` command only creates local git repositories
and does not provide any integration with GitHub for pushing the newly
created workspace to a remote repository.

## Expected Behavior

The `create-nx-workspace` command should offer users the option to
automatically create a GitHub repository and push their new workspace to
it using the GitHub CLI (`gh`), streamlining the workflow from workspace
creation to remote repository setup.

## Changes Made

- **New Options**: Added `skipGitHubPush` and `verbose` command-line
options
- **GitHub Integration**: Integrated GitHub repository creation and push
workflow into the main create-workspace process
- **Interactive Prompts**: Added user-friendly prompts for GitHub
repository creation with validation
- **Async Refactor**: Converted git utilities from sync to async/await
pattern for better error handling
- **Bug Fix**: Fixed `gh repo create` command to include `--source` flag
for proper directory specification
- **Error Handling**: Added comprehensive error handling with optional
verbose logging

## Implementation Details

### New CLI Options
- `--skipGitHubPush`: Skip pushing to GitHub via gh CLI (default: false)
- `--verbose` (`-v`): Enable verbose logging for detailed error messages

### Workflow Integration
- After successful git initialization and commit, prompts user if they
want to push to GitHub
- Uses `gh` CLI to authenticate and create repository
- Provides default repository name format (`username/workspace-name`)
- Validates repository name format
- Handles errors gracefully with helpful fallback instructions

### Technical Changes
- Refactored `git.ts` utilities to use `execAndWait` and `spawnAndWait`
for better async handling
- Added `pushToGitHub` function with comprehensive error handling
- Updated `CreateWorkspaceOptions` interface with new optional
properties
- Enhanced command-line argument parsing in `yargs-options.ts`

## Testing

The changes maintain backward compatibility - existing workflows
continue to work unchanged. The new GitHub integration is opt-in and
gracefully handles cases where:
- GitHub CLI is not installed
- User is not authenticated with GitHub
- Network issues prevent repository creation
- User chooses not to push to GitHub

## Related Issue(s)

This PR enhances the user experience by providing seamless integration
between workspace creation and GitHub repository setup.
2025-07-17 23:41:36 -04:00
Colum Ferry 9f1c811f50 fix(module-federation): ensure react deps are eagerly loaded #31612 (#31961)
## Current Behavior
The static build for a React Module Federation application can suffer
from issues where react is not initialised on load.
This is caused by Module Federation trying to lazily instantiate the
library.

## Expected Behavior
Ensure that React deps are marked as eager in the module federation
config to allow them to be instantiated on load

## Related Issue(s)

Fixes #31612

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Colum Ferry <Coly010@users.noreply.github.com>
2025-07-17 17:23:46 +00:00
Colum Ferry b9066a91d3 fix(core): lockfile pruning uess project name to identify workspace nodes (#31959)
## Current Behavior
The workspace packages logic for pruning lockfile assumes the
jsPackageName is the same as the node name.
This is not always the case.

## Expected Behavior
Ensure the actual node name is used to reference the node in the project
graph
2025-07-17 12:42:42 -04:00
Craigory Coppola 394b5b5461 feat(core): add env var for cache size (#31609)
## Summary
- support configuring max cache size via NX_MAX_CACHE_SIZE env var
- show max cache size from env var in `nx report`
- document the new `NX_MAX_CACHE_SIZE` option
- test NX_MAX_CACHE_SIZE in e2e cache tests

## Testing
- `pnpm nx run-many -t lint,test,build` *(failed: NX Lexer error)*
- `pnpm test:e2e` *(failed: Command "test:e2e" not found)*
- `pnpm e2e` *(failed: Failed to process project graph)*

------
https://chatgpt.com/codex/tasks/task_e_68503bff022c832c8c014c61432aa2ed

Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-07-17 12:18:50 -04:00
Craigory Coppola f94f608ca8 fix(core): shutdown running tasks properly when recieving sigterm (#31534)
<!-- 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
When running Nx tasks without the daemon, tui, and using run-commands w/
serially running tasks, its possible that Nx will not properly terminate
on receiving SIGTERM.

## Expected Behavior
Nx properly shuts down child tasks on receiving SIGTERM

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

Fixes #
2025-07-17 12:18:05 -04:00
Craigory Coppola d207a5cedc fix(core): improve parent gitignore handling for nested Nx workspaces (#31911)
## Current Behavior

When an Nx workspace exists inside a subdirectory of another git
repository or when parent directories contain `.gitignore` files, those
ignore patterns can affect file traversal within the Nx workspace,
making project resolution non-deterministic.

For example, if a workspace is inside a directory with `*` in its
`.gitignore`, Nx fails to properly traverse workspace files.

## Expected Behavior

Nx should respect `.gitignore` files in a smart way:
- **Workspace is git root**: Ignores all parent gitignore files 
- **Workspace nested in git repo**: Respects gitignore files within the
git repository but ignores any gitignore files above the git root
- **No git repo found**: Respects all parent gitignore files (backwards
compatibility)

This ensures deterministic project resolution regardless of where the
workspace is located.

## Related Issue(s)

Fixes #27368, #28000, #27295, #28123, #29413

Supersedes #29245 (incorporates feedback from @Cammisuli and @adamalton)

## Implementation Details

The fix implements smart gitignore boundary detection that:

1. **Finds the nearest git repository root** by walking up the directory
tree
2. **Uses built-in git ignore handling** for maximum compatibility  
3. **Disables automatic parent discovery** and manually adds only
relevant `.gitignore` files
4. **Stops at git repository boundaries** to prevent external gitignore
files from affecting the workspace

This approach addresses the feedback from the original PR #29245 to
handle both:
- Standalone workspaces (where workspace root = git root)
- Workspaces nested within larger git repositories

The solution leverages the `ignore` crate's existing functionality while
providing precise control over which ignore files are considered.

## Test Plan

- [x] Unit tests covering all three scenarios
- [x] Workspace is git root: ignores parent gitignores
- [x] Workspace nested in git repo: respects repo gitignores, ignores
external ones
- [x] No git repo: uses all parent gitignores (backwards compatibility)
- [x] All existing walker tests continue to pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Adam Biggs <adam.biggs@lmpm.com>
2025-07-17 12:13:55 -04:00
Craigory Coppola 07a6feafd6 feat(core): add --initialRun flag to nx watch command (#31910)
## Current Behavior

The `nx watch` command currently requires a file change before executing
the specified command for the first time.

## Expected Behavior

Add support for running the watch command once before watching for
changes. This is useful when you want to see results immediately without
having to make a file change first.

## Related Issue(s)

N/A - Feature addition

## Implementation Details

- Added a new `--initialRun` flag (alias `-i`) to the `nx watch` command
- When the flag is set to `true`, the command executes once before
setting up the file watcher
- Works with both `--all` mode and specific project selections
- Default value is `false` to maintain backward compatibility
- Documentation has been updated to reflect this new option

## Usage Examples

```bash
# Run the command initially, then watch for changes
nx watch --all --initialRun -- echo "Running command"

# Or with the alias
nx watch --projects=myapp -i -- npm run test
```

## Test Plan

- [ ] Manual testing with `--all` flag
- [ ] Manual testing with specific projects
- [ ] Verify command runs initially when flag is set
- [ ] Verify command does not run initially when flag is not set
(default behavior)
- [ ] Documentation generated correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-17 12:04:52 -04:00
Nicholas Cunningham a42d7a398d fix(testing): update yarn integration tests for remix and enable previously skipped tests (#31933)
These tests were skipped previously, we should re-enable them so that we
have coverage.
2025-07-17 11:55:25 -04:00
Philip Fulcher a044e062e1 docs(nx-dev): add Conformance article (#31939)
https://nx-dev-git-philip-conformance-article-nrwl.vercel.app/blog/nx-cloud-conformance-automate-consistency

---------

Co-authored-by: Juri Strumpflohner <juri.strumpflohner@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-17 08:49:34 -06:00
Craigory Coppola b1e647d9eb chore(core): add more logging by default on daemon server (#31948)
<!-- 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
The daemon doesn't log several things which would be helpful when
troubleshooting issues

## Expected Behavior
There are several more logs

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

Fixes #
2025-07-17 09:55:30 -04:00
Colum Ferry 1aa2f10697 fix(webpack): ensure less and less-loader deps are ranges (#31958)
## Current Behavior
The `@nx/webpack` and `@nx/rspack` packages depend on a pinned version
of `less` and `less-loader`.
This causes an issue with dependency resolution for packages that
require a different version of these packages.

## Expected Behavior
Use a range for `less` and `less-loader` to aid package managers in
resolution and hoisting.

## Related Issue(s)

Fixes #31953
2025-07-17 13:04:35 +01:00
Colum Ferry 0d8c32b7fe fix(webpack): use loadPaths instead of includePaths (#31946)
## Current Behavior
Nx switched to use sass-loader with `modern-compiler` api. However, it
did not update to use `loadPaths` instead of `includePaths`.

## Expected Behavior
Use `loadPaths`.

## Related Issue(s)

Fixes #30340
2025-07-17 10:46:57 +01:00
Craigory Coppola 8b4b3e94b6 fix(core): preserve scroll position when tasks complete and scroll faster (#31898)
## Current Behavior
<!-- This is the behavior we have today -->
Scroll position gets reset when unrelated tasks finish. Additionally,
scrolling is just really slow.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This pull request introduces momentum-based scrolling and improves
scroll position preservation across terminal panes and pseudo-terminal
instances (`PtyInstance`). It also adds a new `ScrollMomentum` module to
manage scrolling behavior dynamically based on user input patterns. The
changes enhance user experience by making scrolling smoother and more
intuitive, especially during rapid or sustained scrolling.

### Scroll Momentum Enhancements:
* Added the `ScrollMomentum` module to calculate dynamic scrolling
behavior based on time intervals and direction changes, allowing for
accelerated scrolling during sustained input.
(`packages/nx/src/native/tui/scroll_momentum.rs`,
[packages/nx/src/native/tui/scroll_momentum.rsR1-R101](diffhunk://#diff-60e4cfcd0a48b7d32e565a9254f89f142587e07a37536ca103b1ae76a760135eR1-R101))
* Integrated momentum-based scrolling into `TerminalPaneData` and
`PtyInstance`, replacing static scroll methods with dynamic ones
(`scroll_up` and `scroll_down`) that use calculated momentum values.
(`packages/nx/src/native/tui/components/terminal_pane.rs`,
[[1]](diffhunk://#diff-494d587e52e864f34496326a7453461a9a15e5c136d504a54db36a59cae7c446L45-R66);
`packages/nx/src/native/tui/pty.rs`,
[[2]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14L122-R158)
[[3]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14L148-R192)
[[4]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14L175-R231)

### Scroll Position Preservation:
* Enhanced `PtyInstance` to preserve scroll position during terminal
resize operations, ensuring better continuity when dimensions change.
(`packages/nx/src/native/tui/pty.rs`,
[[1]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14L76-R91)
[[2]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14L91-R120)

### Code Improvements:
* Added momentum reset logic when switching interactive modes or
changing scroll direction to avoid abrupt changes in scrolling behavior.
(`packages/nx/src/native/tui/components/terminal_pane.rs`,
[[1]](diffhunk://#diff-494d587e52e864f34496326a7453461a9a15e5c136d504a54db36a59cae7c446R150-R169);
`packages/nx/src/native/tui/scroll_momentum.rs`,
[[2]](diffhunk://#diff-60e4cfcd0a48b7d32e565a9254f89f142587e07a37536ca103b1ae76a760135eR1-R101)
* Updated `TerminalPaneData` and `PtyInstance` constructors to
initialize `ScrollMomentum` instances for consistent scrolling state
management. (`packages/nx/src/native/tui/components/terminal_pane.rs`,
[[1]](diffhunk://#diff-494d587e52e864f34496326a7453461a9a15e5c136d504a54db36a59cae7c446R38);
`packages/nx/src/native/tui/pty.rs`,
[[2]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14R53)
[[3]](diffhunk://#diff-1e180729578f1157895b8cd0df25b87ba902ac7804e3a944601d28d3cf437b14R67)

These changes collectively improve the usability of terminal panes and
pseudo-terminal instances by making scrolling more responsive and
preserving user context during resize events.

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

Fixes #

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-16 22:22:28 +00:00
Nicholas Cunningham 06c01571f2 fix(react): Ensure react-router e2e test are generated with the correct config (#31945)
<!-- 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 we generate a router-router app the e2e test generated expects the
server to be ran on port `4300`.
Which fails because react-router serves from only one port and it's the
dev port which is defaults to `4200`.

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

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

Fixes #
2025-07-16 17:46:15 -04:00
Philip Fulcher 088cdb3449 docs(nx-dev): update webinar notifier to workshop (#31947) 2025-07-16 19:42:05 +00:00
Leosvel Pérez Espinosa 71b958c053 fix(react): normalize paths correctly when generating stories (#31944)
## Current Behavior

When generating stories, the generation can fail due to a bad path
normalization with:

```bash
 NX   Failed to read src/src/app/app.tsx

Pass --verbose to see the stacktrace.
```

## Expected Behavior

Generating stories should work correctly.
2025-07-16 14:54:36 +00:00
Juri 074b398490 docs(core): align typescript query param for cloud onboarding in tutorials 2025-07-16 13:36:01 +02:00
Jack Hsu 46d21c77ff docs(core): update tutorial intros to match the new onboarding (#31895)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-07-15 20:10:27 -04:00
Victor Savkin db2b52289d cleanup(nx-dev): minor home page cleanup (#31931)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

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

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

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

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

Fixes #

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-07-15 17:03:48 -04:00
Jason Jean 89c784b059 fix(core): remove accidental additional line (#31930)
<!-- 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 line was added by accident.

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

This line is removed.

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

Fixes #
2025-07-15 18:54:22 +00:00
Jason Jean f9295bd057 fix(core): remove affected comment and improve CI setup messages (#31913)
## Current Behavior

Currently, the CI workflow templates and setup messages contain
potentially confusing or outdated information:

1. CI workflow templates include a comment about "Nx Affected runs only
tasks affected by the changes in this PR/commit. Learn more:
https://nx.dev/ci/features/affected." which may be redundant or
confusing
2. The setup messages for CI and remote cache simply say "Finish it by
visiting: {url}" which doesn't provide clear next steps

## Expected Behavior

With these changes:

1. The redundant affected comment is removed from CI workflow templates
to reduce noise
2. The setup messages are improved to say "Push your repository and
finish the setup: {url}" which provides clearer guidance on what the
user needs to do next
3. Jest snapshot test references are updated to use the current Jest
documentation URL

## Related Issue(s)

This is a minor cleanup improvement to reduce confusion and provide
better user guidance in the CI setup flow.
2025-07-15 14:20:13 -04:00
Leosvel Pérez Espinosa 5217e53513 fix(misc): improve the generation of storybook stories (#31893)
Improve the generation of Storybook stories:

- Import relevant types from the appropriate packages
- Use TypeScript `satisfies` operator
- Simplify the selector in the generated interaction test example
- Fix an issue when source root is not set in the project configuration
2025-07-15 10:37:09 -06:00
Nicholas Cunningham d4a2072e76 fix(testing): when we generate a random port we should start from 1024 (#31927)
When we generate a random port in our node e2e tests we should ensure
that the random generation port generation range starts from 1024.

Also, move the `getRandomPort` function to `e2e-utils` so that other
tests benefit from this change.
2025-07-15 11:46:58 -04:00
Craigory Coppola 4d7b17687c fix(misc): nx should error if atomization brings in invalid file paths (#31675)
<!-- 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
In some rare occurences we've observed our atomization plugins returning
an invalid list of test files. We've only seen this in the jest plugin
in our internal monorepo under a very specific yet hard to repro area.

## Expected Behavior
If this occurs, the plugin errors.

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

Fixes #

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-07-15 11:44:20 -04:00
Colum Ferry 434cf4556c feat(core): allow {args} to be fully interpolated in run-commands (#31824)
## Current Behavior
Currently, there is no way for a target using `run-commands` to define
where in the command args are attached.
This is problematic in some tooling cases where args positional location
matters

## Expected Behavior
Placing `{args}` into the command should allow for interpolation of any
and all args provided.
Therefore commands can be written such as `docker run {args} imageRef`
2025-07-15 11:11:21 -04:00
Emily Xiong 1f56eadb65 fix(react-native): app creation should sync deps (#31839)
<!-- 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 options.install=true (need to do pod install), it only
syncs deps.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
make it sync deps regardless of options.install, so when developers
choose to run `pod-install` after, it will work right away.

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

Fixes #
2025-07-15 10:48:42 -04:00
Emily Xiong 51bf772048 fix(react-native): fix react native web configuration (#29608)
<!-- 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 serve up the react-native app using web configuration, it defaults
tsconfig to
```
tsConfig: joinPathFragments(options.projectRoot, 'tsconfig.app.json'),
```
which is not right

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
not hard code ts config path, add a function determineTsConfig for that

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

Fixes #
2025-07-15 10:48:22 -04:00
Leosvel Pérez Espinosa 2527519fdd feat(core): add live durations for running tasks in the tui (#31897)
## Current Behavior

The TUI doesn't display live durations for running tasks.

<img width="506" height="384" alt="image"
src="https://github.com/user-attachments/assets/0c9d2ad6-810c-4785-9e0e-a9e56c86ba7f"
/>

## Expected Behavior

The TUI should display live durations for running tasks.

<img width="499" height="378" alt="image"
src="https://github.com/user-attachments/assets/2a675c42-3268-4faf-83d7-f747ad52ce35"
/>

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2025-07-15 09:57:43 -04:00
Julien Marcou 83d2d3b9bf feat(module-federation): bump @module-federation/node & @module-federation/enhanced to fix esbuild vulnerability (#31924)
<!-- 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

NX has a dependency to a [vulnerable version of
esbuild](https://github.com/evanw/esbuild/security/advisories/GHSA-67mh-4wv8-2f99)

## Expected Behavior

Updating several `@module-federation` dependencies to update esbuild to
v0.25.5 and fix the vulnerability

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

Fixes #31923
2025-07-15 14:04:25 +01:00
Leosvel Pérez Espinosa 8d6fa3fe4c fix(core): ensure non-pty tasks have output in terminal pane when finish (#31925)
## Current Behavior

When a task with no PTY (e.g. a task using the `nx:noop` executor) has
its output pane open and it finishes successfully, no output is shown,
and there's a blank space to the right of the task list where the output
pane is meant to be.

<img width="1366" height="413" alt="image"
src="https://github.com/user-attachments/assets/fc34cc18-1bed-4d73-9b94-5a25069e8a3d"
/>

## Expected Behavior

When a task with no PTY (e.g. a task using the `nx:noop` executor) has
its output pane open and it finishes successfully, the output pane
should be correctly rendered in a successful status.

<img width="1365" height="411" alt="image"
src="https://github.com/user-attachments/assets/cb8862d5-f1c2-4aa6-a098-f710020e64f4"
/>
2025-07-15 11:46:57 +00:00
yarden-island ce2dbd244f feat(rspack): add support for proxyConfig in the dev-server executor (#31909)
<!-- 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 PR adds support for the `proxyConfig` option in the
@rspack/dev-server executor, similarly to the existing option in the
matching Webpack executor. This new options is another step for allowing
simpler migration to Rspack when coming from Webpack, adding to the
feature parity of the Rspack executor.

## Current Behavior

The `@nx/rspack:dev-server` executor does not allow for passing a
`proxyConfig` as an option, opposed to the matching Webpack executor,
that does.

## Expected Behavior

The `@nx/rspack:dev-server` executor allows for passing a `proxyConfig`
option, same as the `@nx/webpack:dev-server` executor.

## Related Issue(s)

None.
2025-07-15 12:21:21 +01:00
Nicholas Cunningham cf994dfbe4 chore(core): update nx dependencies to 21.3.0-beta.7 (#31919)
### Changes
Update nx dependencies to `21.3.0-beta.7`
2025-07-14 19:14:55 -04:00
Nicholas Cunningham eb61103850 fix(core): update our caching for ts-node service from plugins (#31917)
## Current Behaviour

We are having a lot of cache misses due to using `compilerOptions` the
key for registering the `ts-node` service.
This can cause out-of-memory errors due to several registrations of the
`ts-node` service consecutively.

https://github.com/nrwl/nx/actions/runs/16233768215/job/45840886378

## Expected Behaviour
The `ts-node` service _should_ have cache hits so that the knock-on
effect of multiple registration (out-of-memory) does not happen via
plugins.

## MISC
If we set `NX_PREFER_TS_NODE` env variable we should not show the
warning fallback message.
2025-07-14 14:04:17 -06:00
Benjamin Cabanes d99c200dc1 docs(nx-dev): update team list (#31916)
Updated the team list.
2025-07-14 18:27:23 +00:00
Tomáš Čarnecký db4b0d3a45 fix(misc): await load in config-utils.ts
Fixes #31408

Change verified by patching the file in my local node_modules, `nx
run-many --target build` works with this change.
2025-07-14 13:24:06 -04:00
Victor Savkin eef293ce86 cleanup(nx-dev): clean up get started buttons 2025-07-12 23:24:37 -04:00
Juri 18e5d95916 docs(nx-cloud): remove obsolete callout 2025-07-11 23:20:00 +02:00
Craigory Coppola 89495db0ab fix(core): swap from gray -> dark gray for light theme secondary foreground (#31901)
## Current Behavior
Gray for secondary light foreground has low contrast in light themes

## Expected Behavior
This pull request includes a small change to the `Theme` implementation
in the `packages/nx/src/native/tui/theme.rs` file. The change updates
the `secondary_fg` color from `Color::Gray` to `Color::DarkGray` to
improve visual contrast.

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

Fixes #
2025-07-11 17:15:06 -04:00
Jack Hsu cf7ffd391b docs(misc): update react and angular monorepo tutorials to match new onboarding and include self-healing CI (#31870)
This is an update to the React and Angular monorepo tutorial to match
new onboarding experience.

Notes: 
- The link to create new workspace uses the querystring `?preset=...` --
this requires a deployment to cloud.nx.app to work
- This tutorial assumes the generated `ci.yml` comes with `npx nx-cloud
fix-ci` out of the box -- this is only in beta (but should be released
soon)

Previews:
-
https://nx-dev-git-docs-react-tutorial-update-nrwl.vercel.app/getting-started/tutorials/react-monorepo-tutorial
-
https://nx-dev-git-docs-react-tutorial-update-nrwl.vercel.app/getting-started/tutorials/angular-monorepo-tutorial
2025-07-11 17:05:35 -04:00
Jason Jean d3206e662e chore(repo): update nx to 21.3.0-beta.6 (#31900)
<!-- 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 is using Nx `21.3.0-beta.5`

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

This repo is using Nx `21.3.0-beta.6`

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

Fixes #
2025-07-11 20:59:57 +00:00
Benjamin Cabanes 61e8479a36 docs(nx-dev): update contact button link in plans section (#31899)
Changed the contact button link in the pricing section to point to the sales page.
2025-07-11 13:39:40 -04:00
Nicholas Cunningham 8123d4c62f fix(node): preserve existing test target options (#31891)
We should preserve the test target options if they are provided.
2025-07-11 11:16:28 -06:00
Benjamin Cabanes b1b332fe50 docs(nx-dev): update contact button link in plans section (#31896)
Changed the contact button link in the pricing section to point to the sales page.
2025-07-11 16:19:49 +00:00
Leosvel Pérez Espinosa f7e2256b1f fix(core): improve column display decision logic in tui (#31885)
## Current Behavior

When the available space in the TUI task list is small, task names can
be cropped while still displaying the Duration column.

## Expected Behavior

When the available space is insufficient, task names should be
prioritized over duration. Additionally, update the overall column
display decision logic to better use the available space.

### Before

<img width="622" height="368" alt="image"
src="https://github.com/user-attachments/assets/bd486408-abef-4601-9339-b2bf3c589287"
/>

### After

<img width="618" height="369" alt="image"
src="https://github.com/user-attachments/assets/5331172a-23b8-4924-8f3f-b2b107d011d8"
/>
2025-07-11 17:46:44 +02:00
Leosvel Pérez Espinosa 856cb30660 feat(testing): support jest v30 (#31853)
## Current Behavior

Jest v30 is not supported.

**Note**: this is currently awaiting for `jest-preset-angular` to
support Jest v30:
https://github.com/thymikee/jest-preset-angular/pull/3175.

## Expected Behavior

Jest v30 should be supported.

## Related Issue(s)

Fixes #31778
2025-07-11 11:17:14 -04:00
Jason Jean 29f9e76925 feat(core): add comprehensive dependency tracking with continuous task support (#31861)
## Current Behavior

When tasks are pending (not started yet), the TUI shows an empty
terminal pane with no information about why the task is waiting. Users
have no visibility into task dependencies or their status.

## Expected Behavior

When a task is pending, the TUI now displays a comprehensive dependency
view showing:
- Progress header indicating how many dependencies are complete vs total
- Scrollable list of all dependencies (direct and transitive) with
real-time status updates
- Support for continuous tasks where InProgress/Stopped are considered
complete
- Keyboard navigation (arrow keys, j/k vim keys, page up/down)
- Dependencies sorted by complexity (most dependencies first), then
alphabetically

### Dependencies Pending

![image](https://github.com/user-attachments/assets/c704dac9-500c-4ff8-a658-24fd23276a29)

### Dependencies Ready but waiting for thread

![image](https://github.com/user-attachments/assets/834dcbc8-6801-4392-b047-0c5115a5ad06)


### Scrollable

![image](https://github.com/user-attachments/assets/338c4486-6268-48c2-a91c-cfa282101565)


## Related Issue(s)

This enhancement improves the TUI experience by providing clear
visibility into task dependencies, making it easier to understand build
pipelines and debug issues.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-11 09:40:18 -04:00
Jason Jean be6d35bc26 chore(repo): update nx to 21.3.0-beta.5 2025-07-10 20:45:10 -04:00
Emily Xiong fb7f38edda fix(gradle): allow excludeDependsOn to be false (#31890)
<!-- 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 -->
excludeDependsOn is true by default, but got this error when running `nx
run nx-api:compileTestKotlin`:
```
* What went wrong:
Execution failed for task ':nx-api:compileTestKotlin'.
> Error while evaluating property 'friendPathsSet$kotlin_gradle_plugin_common' of task ':nx-api:compileTestKotlin'.
   > Querying the mapped value of provider(java.util.Set) before task ':nx-api:compileJava' has completed is not supported
   ```

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR -->
have a way to turn off excludeDependsOn

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

Fixes #
2025-07-10 18:38:18 -04:00
Craigory Coppola 819ac4442f feat(core): add support for --tui and --no-tui (#31621)
## Summary
- support `--tui` flag alongside `--output-style`
- expose tui option in NxArgs
- respect `tui` CLI option in TUI detection
- warn when environment can't display TUI even if flag is set
- test tui CLI flag parsing

## Testing
- `pnpm nx run-many -t lint,test,build` *(fails: Failed to process
project graph)*
- `pnpm test:e2e` *(fails: Command "test:e2e" not found)*

------
https://chatgpt.com/codex/tasks/task_e_68517adad738832c81ecdfba7f4a1feb

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Craigory Coppola <AgentEnder@users.noreply.github.com>
2025-07-10 17:47:31 -04:00
Benjamin Cabanes 7c9f6cadcc docs(nx-dev): add credit pricing reference & update navigation (#31875)
Introduced a new "Credit Pricing" reference page for Nx Cloud, detailing credit consumption and pricing metrics. Updated documentation structure, menus, sitemap, and headers to integrate the new page. Removed outdated FAQ entries and replaced the "Pricing" reference with the new "Credits Pricing" link in navigation. Adjusted related redirects and UI components for consistency.
2025-07-10 13:22:59 -04:00
Jason Jean 3bdc0ccd90 docs(misc): update nx fix-ci documentation link (#31884)
## Current Behavior

The CI workflow generators for both @nx/workspace and @nx/gradle
currently reference the old documentation URL `https://nx.dev/ai` when
explaining the `nx fix-ci` command.

## Expected Behavior

The CI workflow generators should reference the correct self-healing CI
documentation URL `https://nx.dev/ci/features/self-healing-ci`.

## Related Issue(s)

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

This is a follow-up to update the documentation links to point to the
correct self-healing CI feature page.

## Changes Made

- Updated @nx/workspace CI workflow generator to use the correct
documentation URL
- Updated @nx/gradle CI workflow generator to use the correct
documentation URL
- Updated all snapshot tests to reflect the new URLs
- Updated tutorial documentation that shows the CI workflow examples

**Files Updated:**
- `packages/workspace/src/generators/ci-workflow/ci-workflow.ts`
- `packages/gradle/src/generators/ci-workflow/generator.ts`
-
`packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap`
-
`packages/gradle/src/generators/ci-workflow/__snapshots__/generator.spec.ts.snap`
- `packages/workspace/src/generators/ci-workflow/ci-workflow.spec.ts`
- `docs/shared/tutorials/react-monorepo.md`
- `docs/shared/tutorials/typescript-packages.md`
- `docs/shared/tutorials/angular-monorepo.md`
- `docs/shared/tutorials/gradle.md`

All changes ensure users are directed to the correct self-healing CI
documentation when using the `nx fix-ci` command in their CI workflows.
2025-07-10 12:41:02 -04:00
Leosvel Pérez Espinosa bc939973a9 feat(angular): support angular v20.1 (#31845)
## Current Behavior

Angular v20.1 is not supported.

## Expected Behavior

Angular v20.1 should be supported.

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-07-10 16:21:03 +00:00
Leosvel Pérez Espinosa a7800c47d6 fix(misc): add fallback for missing source root (#31759)
## Current Behavior

The `sourceRoot` project configuration property is optional. Several
places in the codebase do not properly handle this, which can result in
issues.

## Expected Behavior

A missing `sourceRoot` project configuration property should be handled
correctly throughout the codebase.

## Related Issue(s)

Fixes #30638
2025-07-10 16:19:06 +00:00
Leosvel Pérez Espinosa b8f139016b fix(angular): generate ngrx facade spec file correctly (#31850)
## Current Behavior

When generating a facade with the NgRx generators, the spec file imports
a non-existent `readFirst` from `@nx/angular/testing`. That helper was
deprecated for a long time and removed in Nx v21, but this usage was
missed, causing those tests to fail.

The e2e tests that cover this were disabled for the pnpm package
manager, so it was not caught in the PR/main CI pipeline. It was
correctly failing in the Nightly CI pipeline. The tests are now enabled
for all package managers.

Nightly failure:
https://staging.nx.app/runs/uRlR20Fzt9/task/e2e-angular%3Ae2e-local

## Expected Behavior

When generating a facade with the NgRx generators, the spec file for the
facade should be correct.

## Related Issue(s)

Fixes #
2025-07-10 11:13:57 -04:00
Juri ecee1c34fc docs(core): updates to the getting started pages 2025-07-10 16:12:50 +02:00
Leosvel Pérez Espinosa b5d406dee8 fix(core): allow opting out of sorting root tsconfig path mappings with an env var (#31763)
## Current Behavior

Currently, users can opt out of sorting the root tsconfig file path
mappings by providing `--sort-root-tsconfig-paths=false` to the `nx
format` commands, or by providing `{ sortRootTsconfigPaths: false }` to
the `formatFiles` function when invoked programmatically. Still, Nx
generators sort the root tsconfig file path mappings by default, and the
only way to bypass that is to run two different commands:

```bash
nx g component path/to/component --skip-format
nx format:write --sort-root-tsconfig-paths=false
```

## Expected Behavior

Users should be able to easily opt out of sorting the root tsconfig file
path mappings by setting the `NX_FORMAT_SORT_TSCONFIG_PATHS` environment
variable to `false`. With that set, all the relevant commands, including
`nx generate` will respect it.

## Related Issue(s)

Fixes #29043
2025-07-10 09:58:52 -04:00
Leosvel Pérez Espinosa 3782d7edac Revert "fix(core): add option to use v8 for daemon message serializat… (#31881)
…ion to avoid issues when JSON.stringify would fail (#30516)"

This reverts commit a59e6eb559.
2025-07-10 13:34:38 +00:00
Jason Jean 13551c9457 feat(core): add fix-ci command to CI workflows (#31833)
## Current Behavior

Nx-cloud commands are scattered across different directories in the
command-line structure, making them harder to find and maintain.
Commands like `record`, `start-ci-run`, and `fix-ci` don't exist as
direct nx commands. The fix-ci command in CI workflows doesn't run when
previous steps fail.

## Expected Behavior

All nx-cloud related commands are organized in a dedicated directory
with consistent patterns and shared utilities. New commands provide
better CI/CD integration. The fix-ci command always runs to provide
AI-powered recommendations even when builds fail.

## Related Issue(s)

Improves code organization and adds missing CI workflow commands for
better developer experience.

## Changes Made

### 🏗️ **Reorganized nx-cloud commands**
- Created `/packages/nx/src/command-line/nx-cloud/` directory structure
- Moved existing commands (`login`, `logout`, `connect`) to new location
- Extracted shared utility function to eliminate code duplication

### 🆕 **Added new nx-cloud commands**
- `nx record` - Records command execution for distributed task execution
- `nx start-ci-run` - Starts new CI run for distributed execution  
- `nx fix-ci` - Fixes CI configuration issues with AI-powered
suggestions

### 🔧 **Code quality improvements**
- Reduced code duplication by 80+ lines across command implementations
- All commands now follow consistent patterns using shared utilities
- Fixed import paths throughout codebase after reorganization

### 🚀 **Enhanced CI workflow support**
- **Gradle Generator**: Added `alwaysRun` property to Command type for
conditional execution
- **Template Updates**: GitHub Actions and CircleCI templates now handle
`alwaysRun` property
- **Fix-CI Integration**: The `fix-ci` command now always runs
regardless of previous step failures

### 📚 **Comprehensive documentation updates**
- Updated all CI provider documentation (GitHub Actions, Azure DevOps,
GitLab, Bitbucket, CircleCI, Jenkins)
- Updated Nx Cloud tutorial documentation (GitHub Actions, CircleCI)
- **Framework Tutorials**: Added `if: always()` condition to fix-ci
commands in:
  - Gradle tutorial (`/docs/shared/tutorials/gradle.md`)
- Angular monorepo tutorial
(`/docs/shared/tutorials/angular-monorepo.md`)
  - React monorepo tutorial (`/docs/shared/tutorials/react-monorepo.md`)
- TypeScript packages tutorial
(`/docs/shared/tutorials/typescript-packages.md`)
- Added proper documentation linking for all new commands
- All validation passes (TypeScript, formatting, documentation)

### 🎯 **Key Technical Improvements**
- **Always-Run Logic**: Fix-ci command uses platform-specific
conditional execution:
  - GitHub Actions: `if: always()`
  - CircleCI: `when: always`
  - Azure DevOps: `condition: always()`
- **Consistent Patterns**: All nx-cloud commands follow unified
implementation approach
- **Backward Compatibility**: All existing functionality preserved
during reorganization

All nx-cloud commands now provide a more cohesive experience with better
CI integration, ensuring users get AI-powered recommendations even when
builds fail.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-07-09 18:20:59 -04:00
Philip Fulcher baa28ab697 docs(nx-dev): remove references to July 9th webinar (#31874) 2025-07-09 13:48:29 -06:00
Juri b67deeefe3 docs(nx-cloud): add new self-healing ci feature page 2025-07-09 19:22:17 +02:00
Jack Hsu 5eec205959 docs(misc): fix command in self-healing ci blog post 2025-07-09 18:01:35 +02:00
Craigory Coppola a59e6eb559 fix(core): add option to use v8 for daemon message serialization to avoid issues when JSON.stringify would fail (#30516)
<!-- 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
For really large objects (particularly those containing large strings)
JSON.stringify can fail

## Expected Behavior
Daemon serialization doesn't fail for the same strings when setting
`NX_USE_V8_SERIALIZER=true`. This should become the default behavior.

## 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>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-09 10:53:23 -04:00
Brandon Roberts 4a09116283 fix(vite): bump @analogjs/vite-plugin-angular to 1.19.x (#31866)
## Current Behavior

AnalogJS installs 1.17.1 for Vitest support

## Expected Behavior

AnalogJS installs 1.19.1 for Vitest support
2025-07-09 16:49:07 +02:00
Miroslav Jonaš f432f78028 docs(nx-dev): remove problematic GitHub parallelization (#31865)
The existing parallelization example does not work correctly due to the
encapsulated run_command swallowing the status codes and passing the
runs with a failed command.

If users are interested in how to parallelize the tasks they can easily
find it today. We should provide minimal example like we do for other CI
providers.

<!-- 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-07-09 10:35:16 +00:00
Jason Jean 2077a4ac4b Revert "feat(core): add CI warning for missing remote cache solution (#31678)" (#31860)
This reverts commit
[a745ca5dd6fac1c91233976b9fe3713a7018cfe3](https://github.com/nrwl/nx/pull/31860/commits/a745ca5dd6fac1c91233976b9fe3713a7018cfe3).

<!-- 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 https://github.com/nrwl/nx/issues/31837
2025-07-08 18:54:27 -04:00
Jack Hsu a024760e1d chore(repo): rename rawdocs to upstream docs (#31859)
Just a rename for https://github.com/nrwl/upstream-docs
2025-07-08 13:58:10 -04:00
Leosvel Pérez Espinosa ffb80d10ab chore(core): optionally infer all package.json files as projects (#31843)
Add an env var to allow inferring projects from all `package.json` files
when there's no `package.json` file at the workspace root.
2025-07-08 12:12:14 -04:00
Benjamin Cabanes ea5cd30e42 docs(nx-dev): update nx-cloud page (#31844)
The main Nx Cloud page was completely rebuilt with a new component structure, replacing the old sections (`Hero`, `TrustedBy`, `FasterAndCheaper`, etc.) with new ones like `NxCloudHero`, `CiBottleneck`, `TimeToGreen`, `Features`, and others.
2025-07-07 14:47:56 -04:00
Colum Ferry 16e3e7aa8d feat(release): allow for semver requirements to be disabled in version and changelog (#31794) 2025-07-07 13:53:27 +04:00
James Henry 7f674e1406 fix(core): improve tui contrast on some terminal themes (#31299) 2025-07-07 12:54:56 +04:00
Miguel 0fce02a7f5 fix(core): consider virtual trees in globAsync (#31805) 2025-07-07 12:31:02 +04:00
Jonathan Gelin 31661c8340 fix(plugin): fix e2e-project generator when the e2e target is inferred (#31809) 2025-07-07 12:22:15 +04:00
Jason Jean 666da3eaeb feat(core): refactor CI workflow generator to use centralized command generation (#31787)
## Summary

This PR refactors the @nx/workspace CI workflow generator to adopt the
same centralized command generation pattern used by the Gradle
generator, making it more maintainable and consistent.

## Key Changes

### 1. Centralized Command Generation
- Added `getCiCommands()` function that generates command arrays for all
CI providers
- Replaced hardcoded commands in templates with dynamic command
substitution
- All CI providers now use identical commands with provider-specific
formatting

### 2. Performance Improvement  
- Replaced `nx affected` with `nx run-many` for better performance
- Updated all CI workflow templates and snapshots accordingly

### 3. Better Code Organization
- Separated nx-cloud record comments from nx-affected comments
- Added helper functions `getCiPrefix()` and `getCiArgs()` for cleaner
code
- Improved comment clarity to guide users on when to switch to nx
affected

### 4. Bitbucket Prefix Fix
- Fixed inconsistent YAML formatting in Bitbucket pipelines
- Pull requests section: no prefix for comments
- Branches section: proper "- " prefix for comments

### 5. Template Consistency
- All CI providers (GitHub, Azure, GitLab, CircleCI, Bitbucket) now
generate identical commands
- Consistent comment structure across all templates
- Updated tutorial template to match new format

## Test Results
-  All 114 tests passing
-  All 95 snapshots updated and verified
-  100% backward compatibility maintained

## Benefits
1. **Maintainability**: Changes to commands only need to be made in one
place
2. **Consistency**: All CI providers use identical commands and comments
3. **Performance**: nx run-many provides better performance than nx
affected
4. **Extensibility**: Easy to add new CI providers or modify existing
ones
5. **Clean Architecture**: Follows the same pattern as other generators
2025-07-04 15:02:47 +00:00
Nicholas Cunningham e92cbee9f6 chore(repo): bump nx version to 21.3.0-beta.2 (#31819)
Bump the Nx version to 21.3.0-beta.2
2025-07-03 16:01:55 -04:00
Victor Savkin 6fdca3d539 fix(core): return current nx init date when no git available yet 2025-07-03 12:51:13 -04:00
Emily Xiong 2a0153e839 fix(gradle): handle custom build gradle files (#31817)
<!-- 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 -->
for spring-framework
```
rootProject.children.each {project ->
	project.buildFileName = "${project.name}.gradle"
}
```
it got custom build file name

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- change nxProjectGraph plugin, add buildFiles in the output json like:
```
{
  "nodes": {},
...
  "buildFiles": ["build.gradle"]
}
```
then, it get the build files from reports, combine build files from
build.gradle and custom build files from reports.
```
    const allBuildFiles = Array.from(
      new Set([...buildFilesFromSplitConfigFiles, ...buildFiles])
    );
```

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

Fixes #
2025-07-03 10:49:52 -04:00
Benjamin Cabanes 62d7bf6d17 docs(nx-dev): update team list (#31784)
Standard team list updates.
2025-07-02 21:44:26 -06:00
Benjamin Cabanes 84ce8311a4 docs(nx-dev): add Nx Essentials workshop announcement (#31816)
Inserted an announcement callout highlighting the upcoming Nx Essentials Online Workshop (July 29-30) in the Getting Started and Quick Start documentation pages. Includes a link for registration and early bird details.
2025-07-02 19:05:40 -04:00
Emily Xiong 2abf1116d6 fix(gradle): add dependsOn outputs to inputs dependentTasksOutputFiles (#31683)
<!-- 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
for gradle, its inputs depends on outputs of its dependsOn task. (e.g.
jar task)
however, if the output file does not exist, (for example, running for
1st time in ci), it will not add to inputs.
when getting inputs, it would give a warning like
```
file or directory '/Users/emily/code/ocean/dist/libs/shared/db-schema-kotlin/classes/java/main', not found
file or directory '/Users/emily/code/ocean/dist/libs/shared/db-schema-kotlin/classes/kotlin/main', not found
file or directory '/Users/emily/code/ocean/dist/libs/shared/db-schema-kotlin/resources/main', not found
```
it is a warning, not an error, so can't be caught.

```
In Gradle's file resolution internals:

When you call task.inputs.files → Gradle resolves each file/directory.

If a declared file or dir does not exist AND it's allowed to be missing, Gradle does not throw an error — instead it logs:
file or directory '...' not found
This log is just an INFO or DEBUG message.
Gradle's normal file resolution is designed to be tolerant —
so missing files do NOT stop the build by default
```

## Expected Behavior
this solution basically take AL
<img width="1106" alt="Screenshot 2025-06-22 at 1 02 33 PM"
src="https://github.com/user-attachments/assets/7a6e8a50-44ec-4c83-bf3d-dc52346b331d"
/>
L of outputs of dependsOn tasks and add to inputs.


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

Fixes #
2025-07-02 16:17:29 -04:00
Jason Jean 46e8cd198c chore(workspace): format new generator code (#31815)
## Current Behavior

The getPackageManagerCommand call in the new generator has a long line
that doesn't follow the codebase's formatting standards.

## Expected Behavior

The code should be properly formatted with line breaks for better
readability.

## Related Issue(s)

Code formatting improvement - no related issue.
2025-07-02 20:16:43 +00:00
Nicholas Cunningham 2c121f64f9 fix(linter): refactor checking if the identifier is a function via tsquery (#31792)
This PR addresses the issue where the `eslint-plugin` rules fail to
`require()` modules during development when working with ts source
files. The problem occurs because `require.resolve()` finds .js paths in
package.json exports, but the actual .js files don't exist in
development mode - only .ts files are present.

So when you `require()` and the file is loaded NodeJS throws an error
because the `.js` imports cannot be resolved.
This can occur in a ts solution workspace environment where the failure
is not accommodating.

Instead, we can use `tsquery` to check if the file has a valid named
function export.
2025-07-02 15:21:34 -04:00
Jason Jean fca5650869 feat(core): enhance native cache operations with comprehensive logging (#31652)
## Current Behavior

The native cache system has minimal logging, making it difficult to
debug issues or understand what's happening during cache operations.
When problems occur, there's insufficient visibility into:
- File copying operations and their progress
- Output expansion and glob pattern matching
- Cache PUT operation timing and success/failure details
- Directory creation and cleanup processes

## Expected Behavior

With these changes, the native cache system provides comprehensive
logging that:
- Tracks all file operations with sizes and timing
- Provides detailed visibility into glob pattern expansion
- Logs cache PUT operations with performance metrics
- Includes trace-level debugging for troubleshooting
- Makes it easier to diagnose cache-related issues

## Related Issue(s)

This enhancement improves the observability and debugging capabilities
of the native cache system without changing its core functionality.

## Changes Made

- **Enhanced cache PUT operations**: Added timing metrics and detailed
logging for each step
- **Improved file copying**: Added progress tracking, size reporting,
and detailed trace logs
- **Better output expansion**: Added comprehensive logging for glob
pattern analysis and path validation
- **Fixed borrow checker error**: Resolved compilation issue in file_ops
copy function
- **Comprehensive tracing**: Added trace and debug logging throughout
the cache operations

The logging follows a structured approach:
- `trace\!()` for detailed step-by-step operations
- `debug\!()` for summary information and timing metrics
- Proper error context for debugging issues

This makes the native cache system much more observable and easier to
debug when issues arise.
2025-07-02 13:54:32 -04:00
Rares Matei 157a34ae40 docs(nx-cloud): update release notes (#31802)
<!-- 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-07-01 16:02:39 +00:00
Chau Tran bfdf892a0a docs(misc): add info about Okta advanced configuration (#31791)
This is to make sure enterprises set the configuration required for our
saml integration
2025-06-30 21:36:59 +00:00
Philip Fulcher 2a10953c52 docs(nx-dev): add CTAs for July 9 webinar (#31769) 2025-06-30 14:59:03 -06:00
Benjamin Cabanes 487f8e6d42 chore(core): replace hardcoded registry URLs with placeholder (#31789)
Updated tests to utilize the `customRegistryUrl` variable instead of hardcoded `http://localhost:7190` URLs, improving maintainability and flexibility.
2025-06-30 18:36:52 +00:00
Jason Jean 784a14a5b0 fix(core): allow any framework value in preset generator schema (#31665)
## Current Behavior

When using third-party presets with `npx create-nx-workspace`, passing
framework values other than the predefined backend frameworks fails with
a schema validation error:

```
Error: Property 'framework' does not match the schema. 'angular' should be one of express,koa,fastify,nest,none.
```

For example:
```bash
npx create-nx-workspace --preset=@rig/cli@alpha --framework=angular --theme=pcb --name=hello-world
```

## Expected Behavior

Third-party presets should be able to pass any framework value without
schema validation errors, allowing for greater flexibility in the Nx
ecosystem.

## Related Issue(s)

This fixes the issue where third-party presets cannot pass framework
values like 'angular', 'react', 'vue', etc., due to overly restrictive
schema validation.

## Changes

- Removed the `enum` constraint from the `framework` property in the
workspace preset generator schema
- The property remains a string type but now accepts any value
- Maintains backward compatibility with existing functionality

The built-in Nx preset generators still only handle frameworks they know
about, but the schema validation no longer blocks third-party presets
from passing other framework values.

## Test plan

- [x] Workspace package builds successfully
- [x] Schema validation allows any string value for framework property
- [x] Backward compatibility maintained for existing presets
- [ ] Manual test: `npx create-nx-workspace --preset=@rig/cli@alpha
--framework=angular` should work without schema validation errors

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
Co-authored-by: Claude <claude@anthropic.com>
2025-06-30 14:22:53 -04:00
Benjamin Cabanes a73855c74e feat(core): add CI warning for missing remote cache solution (#31678)
Running Nx in CI without a remote cache is a common misconfiguration that leads to slow, inefficient builds. This change introduces a proactive warning to prevent this "silent failure" and guide users toward a performant setup.

A new `NxCloudCIMessageLifeCycle` hook now checks for a remote cache configuration at the start of any command run within a CI environment.

The warning is only displayed if no remote caching is detected. It is intelligently suppressed if the workspace has:

* An Nx Cloud access token configured.
* A dependency on nx-cloud or @nrwl/nx-cloud.
* An on-premise cache provider (s3, gcs, azure, sharedFs) configured in nx.json.
* The NX_SELF_HOSTED_REMOTE_CACHE_SERVER environment variable set.
* `tasksRunnerOptions` is configured

This ensures we only notify users who are genuinely missing out on caching, improving the out-of-the-box developer experience.
2025-06-30 13:53:23 -04:00
Nicholas Cunningham 8b3fc7fba0 fix(node): reorder addPlugin in normalizeOptions return object (#31785)
When creating a node app If you want plugins to be added and
`applicationGeneratorInternal` is called instead of
`applicationGenerator` the option will be overwritten by the default
`false`.
2025-06-30 13:32:19 -04:00
Nicholas Cunningham f8a23eef96 fix(core): update nx to version 21.3.0-beta.0 (#31771)
Update nx repo package version
2025-06-30 09:32:40 -04:00
Nicholas Cunningham 7430238529 fix(core): resolve package.json for @nx/js to improve plugin detection (#31770)
This PR updates the package.json inferred target to resolve package.json
instead of the entry file.
2025-06-27 23:22:38 +00:00
Nicholas Cunningham ad14f2f477 chore(repo): update e2e nightly report adding more golden test and updating the report (#31752)
This PR changes our Nightly GHA status reporting from a
per-project-per-environment basis to a per-project basis.
This consolidation will make the status reports easier to understand by
reducing the granularity of reporting.

Additionally, we now capture timed-out jobs as a failure instead of
being overlooked.

Sample:
```

Golden Test Failure
 : Golden Projects
 : Passing: 15
 : Failing: 1
🚨 : Failed Golden Projects
| Failed project                 |
|--------------------------------|
| e2e-node                       |
```
2025-06-27 17:08:04 -04:00
Nicholas Cunningham 9d5030b253 fix(js): improve typescript plugin build detection (#31533)
This PR enhances the typescript plugin build detection. Notably the
changes include:
- Add absolute path handling for package.json entry points.
- Simplify the buildable verification
- Add glob pattern matching for `include` patterns.

MISC: 
- Also fixes `e2e-rollup` test failing due to the typescript plugin
having the same build target as rollup so it created an unexpected
output.

closes: #29670
2025-06-27 11:23:03 -06:00
Colum Ferry 47e1a9ce05 fix(storybook): handle hyphenated framework names in pnpm dependency installation (#31760)
## Current Behavior

When installing Storybook dependencies with pnpm, the regex for
extracting base framework names from compound framework packages (e.g.,
@storybook/web-components-vite) was not properly handling hyphens in
framework names. This
caused it to extract incorrect base framework names like @storybook/web
instead of @storybook/web-components, leading to attempts to install
non-existent packages.

 ## Expected Behavior

The regex should properly extract base framework names that include
hyphens, correctly identifying @storybook/web-components as the base
framework for packages like @storybook/web-components-vite. This ensures
that only valid
  Storybook packages are installed during dependency resolution.

  ## Related Issue(s)

  Fixes #31292
2025-06-27 17:18:59 +00:00
Nicholas Cunningham e78f9e308a fix(node): improve error handling during cleanup in Node application tests (#31767)
This PR Improves the test cleanup logging for `killPorts`.

Instead of asserting that no error is thrown during cleanup, we now log
the error message when one occurs. This helps surface common but
non-critical errors (like `ECONNRESET`) without failing the test
unnecessarily.

So a test like this:
https://github.com/nrwl/nx/actions/runs/15918605455/job/44900857152
won't fail although the primary body of the test has passed
successfully.
2025-06-27 13:06:07 -04:00
Jack Hsu beb95ccce2 fix(core): clarify TypeScript configuration requirements for applications in project references migration (#31764)
The documentation for migrating to TypeScript project references only
shows examples for library projects, making it unclear whether the same
configuration requirements apply to application projects.

This PR clarifies that the steps apply to both libs and apps, with the
latter typically using `tsconfig.app.json` instead of
`tsconfig.lib.json`.

Fixes #31715

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-27 11:02:02 -04:00
Colum Ferry 3c248961c7 fix(bundling): ensure lockfile creation doesnt error with bun (#31762)
## Current Behavior

When using bun as a package manager with Nx bundling operations
(webpack, vite,
   etc.), lockfile creation was failing with various errors:

  - "Unable to create bun lock files" warnings
  - "argument 'value' must be either string or Buffer" errors
  - External dependencies not being found (next, webpack-cli, etc.)
  - Build failures when using generatePackageJson option
  - Project graph issues with bun text-based lockfiles

  This affected multiple bundlers and scenarios across the Nx ecosystem.

 ## Expected Behavior

Bun lockfile creation should work seamlessly across all Nx bundling
operations
without errors. Users should be able to use bun with any Nx bundler
(webpack,
  vite, esbuild) and the generatePackageJson option without encountering
  lockfile-related build failures.

 ## Related Issues

  Fixes #30568
  Fixes #26640
2025-06-27 15:49:45 +01:00
Colum Ferry 4553748d8c fix(vite): ensure vue-tsc is used for typecheck of vue projects (#31761)
## Current Behavior

When Vite projects use Vue, the typecheck target still uses the standard
TypeScript compiler (tsc) instead of vue-tsc, which is the recommended
TypeScript compiler for Vue projects. This can lead to incomplete type
checking as
tsc doesn't understand Vue's single-file components (.vue files) and
their specific syntax.

 ## Expected Behavior

When a Vite project uses the Vue plugin (vite:vue), the typecheck target
should automatically use vue-tsc instead of tsc for type checking. This
ensures proper type checking of Vue components and maintains
compatibility with
Vue's TypeScript integration. The external dependencies and help
metadata are also updated to reflect the use of vue-tsc when
appropriate.

 ## Related Issue(s)

  Fixes #31647
2025-06-27 15:46:50 +01:00
Colum Ferry cae6df7096 fix(bundling): respect decision to create babelrc file (#31755)
## Current Behavior

When generating a JS library with the rollup bundler, the generator
would always create a .swcrc file regardless of the includeBabelRc flag
setting. This meant that even when users explicitly requested a Babel
configuration by
setting includeBabelRc: true, the generator would ignore this preference
and still use SWC configuration.

## Expected Behavior

When generating a JS library with any bundler (including rollup), the
generator should respect the includeBabelRc flag. If includeBabelRc is
set to true, it should create a .babelrc file and skip creating a .swcrc
file. Only
when includeBabelRc is false or not set should it fall back to creating
the appropriate transformer configuration file (.swcrc for swc/rollup
bundlers).

## Related Issue(s)

  Fixes #31582
2025-06-27 13:37:52 +01:00
Colum Ferry 3131f4aa29 fix(node): ensure args are set in target correctly (#31758)
## Current Behavior

The Nest.js webpack build target configuration was generating
webpack-cli arguments without the required -- prefix, resulting in
node-env=production and node-env=development instead of proper CLI
arguments.

  ## Expected Behavior

The Nest.js webpack build target should generate proper webpack-cli
arguments with the -- prefix: --node-env=production and
--node-env=development for correct command line execution.

  ## Related Issue(s)

  Fixes #31578
2025-06-27 13:37:40 +01:00
Leosvel Pérez Espinosa 7651f6343e fix(linter): update lint executor to always log errors and stack traces (#31757)
## Current Behavior

When the `@nx/eslint:lint` executor runs and an unexpected error occurs,
only the error message is displayed and not the stack trace. This
requires users to re-run with `--verbose` to see the stack trace.

## Expected Behavior

When the `@nx/eslint:lint` executor runs and an unexpected error occurs,
the error message and the stack trace should be logged.

## Related Issue(s)

Fixes #21630
2025-06-27 08:34:15 -04:00
Leosvel Pérez Espinosa 2d028f7ad5 fix(angular): expand nx tokens in project configurations when running schematic migrations (#31526)
## Current Behavior

Running Angular CLI schematic migrations that update project
configurations that contain Nx tokens (e.g. `{workspaceRoot}`,
`{projectRoot}`, `{projectName}`) does not work correctly. The schematic
migrations receive the project configuration option values with the
non-expanded tokens, which is not something handled.

## Expected Behavior

The Nx adapter for Angular should expand Nx tokens in project
configurations so schematic migrations can correctly process them. When
writing the project configuration back, the tokens should be restored on
a best-effort basis.

## Related Issue(s)

Fixes #29052
2025-06-27 12:41:47 +02:00
Leosvel Pérez Espinosa 6305922e32 fix(expo): respect --unit-test-runner=none properly when generating expo apps and libs (#31754)
## Current Behavior

When generating Expo apps and libs with `--unit-test-runner=none` some
test-specific files and dependencies are generated.

## Expected Behavior

When generating Expo apps and libs with `--unit-test-runner=none` no
test-specific files and dependencies should be generated.

## Related Issue(s)

Fixes #30366
2025-06-27 10:47:00 +02:00
Leosvel Pérez Espinosa 99f38b8770 fix(vite): ensure path aliases are not replaced when building vite projects and using ts path mappings (#31747)
## Current Behavior

Projects generated with Vite that import from another project will
produce incorrect declaration files when built in an integrated
workspace (using TS path mappings).

## Expected Behavior

Projects generated with Vite that import from another project should
produce the correct declaration files when built in an integrated
workspace (using TS path mappings).

## Related Issue(s)

Fixes #30814
2025-06-27 09:08:44 +02:00
Caleb Ukle 07233f0e03 docs(nx-cloud): callout templates use nx-cloud features (#31733)
template examples use nx-cloud record feature which will fail if cloud
isn't enable making for bad user experience. We instead commend out the
usage and call attention to how to connect to cloud so the template will
work OOTB

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-26 15:46:57 -05:00
Isaac Mann c8bad17bba docs(core): webinar for july 9 2025 (#31751)
Add banner for July 9th webinar
2025-06-26 19:24:54 +00:00
Victor Savkin 4a666b7854 chore(nx-dev): update remote cache docs 2025-06-26 14:52:23 -04:00
Craigory Coppola 402d946534 feat(core): pass in progress task outputs to tui for non-direct child processes (#31655)
## Current Behavior
Currently the TUI is disabled on windows due to poor support for the
pseudoterminal and some lingering issues.

## Expected Behavior
This PR starts tackling this by making the TUI more usable without the
pty. The first step here is enabling processes created without the pty
to display live outputs in the TUI, which was currently not possible.

## Copilot Summary
This pull request introduces enhancements to task execution and output
handling in the Nx task runner. The changes focus on improving the
handling of progressive output for the TUI (Text User Interface), adding
support for pseudo-terminal processes, and refining the orchestration of
tasks. Below are the most important changes grouped by theme:

### Enhancements to Task Execution and Output Handling:
*
[`packages/nx/src/tasks-runner/running-tasks/node-child-process.ts`](diffhunk://#diff-8c0c3712ab796458d8f6fc6cb685f68a45c01fb94f2210d9b60eaabb07610a7cR12):
Added a new `onOutput` method to allow streaming output to the TUI via
callbacks. Updated `stdout` and `stderr` handlers to invoke these
callbacks for progressive output. Introduced a
`canProvideProgressiveOutput` method to indicate whether a task can
stream output.
[[1]](diffhunk://#diff-8c0c3712ab796458d8f6fc6cb685f68a45c01fb94f2210d9b60eaabb07610a7cR12)
[[2]](diffhunk://#diff-8c0c3712ab796458d8f6fc6cb685f68a45c01fb94f2210d9b60eaabb07610a7cL55-R80)
[[3]](diffhunk://#diff-8c0c3712ab796458d8f6fc6cb685f68a45c01fb94f2210d9b60eaabb07610a7cL88-R112)

### Support for Pseudo-Terminal Processes:
*
[`packages/nx/src/tasks-runner/forked-process-task-runner.ts`](diffhunk://#diff-9e7468f39e004b5e6087ab9a309150efa755b4f9f8047514b63fc71f8034c930L143-R143):
Added comments to clarify when pseudo-terminal processes are used for
interactive tasks and when non-interactive processes with piped output
are used. These changes improve readability and understanding of the
trade-offs involved.
[[1]](diffhunk://#diff-9e7468f39e004b5e6087ab9a309150efa755b4f9f8047514b63fc71f8034c930L143-R143)
[[2]](diffhunk://#diff-9e7468f39e004b5e6087ab9a309150efa755b4f9f8047514b63fc71f8034c930R155-R165)

### Improvements to Task Orchestration:
*
[`packages/nx/src/tasks-runner/task-orchestrator.ts`](diffhunk://#diff-e9bae83332b3d6e57c023959ab2e5f191c97e0a154a8c1d36dd81f8f869e1bdfL637-R637):
Enhanced the registration of tasks in the TUI lifecycle. Added checks to
ensure tasks that support progressive output but are not interactive
(e.g., `NodeChildProcessWithNonDirectOutput`) are registered correctly.
Introduced a fallback for tasks that don't support progressive output.
[[1]](diffhunk://#diff-e9bae83332b3d6e57c023959ab2e5f191c97e0a154a8c1d36dd81f8f869e1bdfL637-R637)
[[2]](diffhunk://#diff-e9bae83332b3d6e57c023959ab2e5f191c97e0a154a8c1d36dd81f8f869e1bdfL649-R655)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-06-26 13:50:13 -04:00
Rares Matei c7d2c77641 docs(nx-cloud): update release notes (#31749)
<!-- 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-06-26 17:17:21 +00:00
Leosvel Pérez Espinosa afb94afd7d fix(testing): unset customConditions when running the open-cypress inferred task (#31687)
## Current Behavior

Cypress `open-cypress` inferred task in a workspace with the
`customConditions` TypeScript compiler option set, fail with the error:

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

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

## Expected Behavior

Cypress `open-cypress` inferred task in a workspace with the
`customConditions` TypeScript compiler option set should work as
expected.

## Related Issue(s)

Fixes #31616
2025-06-26 10:48:54 -04:00
Leosvel Pérez Espinosa 2daa73dd10 fix(testing): prefer using tsconfig.spec.json when loading jest config in plugin (#31726)
## Current Behavior

The `@nx/jest/plugin` loads the Jest config file using the project's
`tsconfig.json` file.

## Expected Behavior

The `@nx/jest/plugin` should try to load the Jest config file using the
`tsconfig.spec.json` file (or other common filenames also handled by the
nx jest resolver). If those files don't exist, it should fall back to
the project's `tsconfig.json` file.

## Related Issue(s)

Fixes #31351
2025-06-26 10:31:33 -04:00
Jack Hsu 948c985925 fix(linter): correct lintFilePatterns documentation to show it's optional (#31744)
- Updated documentation to clarify lintFilePatterns is optional
- Added default value information ['{projectRoot}']

Fixes #29648
2025-06-26 09:56:06 -04:00
Leosvel Pérez Espinosa 54b36a6da0 fix(testing): do not re-add vscode recommended extension for jest after initial jest setup (#31745)
## Current Behavior

The `@nx/jest:configuration` generator always adds the
`firsttris.vscode-jest-runner` to the VSCode recommended extensions if
it's missing.

## Expected Behavior

The `@nx/jest:configuration` generator should only add the
`firsttris.vscode-jest-runner` to the VSCode recommended extensions when
configuring `@nx/jest` for the first time.

## Related Issue(s)

Fixes #29345
2025-06-26 13:54:55 +00:00
Leosvel Pérez Espinosa 768a11aee4 fix(core): improve error handling in daemon server (#31728)
## Current Behavior

When a message handler in the Daemon server throws an error, the process
exits, and nothing is printed to the terminal.

## Expected Behavior

Errors thrown by message handlers in the Daemon server should be handled
appropriately and printed to the output.

## Related Issue(s)

Fixes #31407 
Fixes #31567
2025-06-26 15:44:51 +02:00
Colum Ferry 836defed4a feat(bundling): add useLegacyTypescriptPlugin option to migrate from rollup-plugin-typescript2 (#31718)
## Current Behavior

  When using the Rollup executor with TypeScript, the build process uses
`rollup-plugin-typescript2` which can fail when importing types from
external dependencies.
This results in errors like "Invalid value for option 'files' - entry
does not exist" when
the TypeScript plugin tries to resolve type imports from node_modules.

  ## Expected Behavior

Users should be able to build TypeScript projects with Rollup without
encountering errors
when importing types from external packages. Additionally, users should
have the option to
migrate to the newer `@rollup/plugin-typescript` which handles external
dependencies more
  gracefully.

  ## Related Issue(s)

  Fixes #30488
2025-06-26 14:38:50 +01:00
Jack Hsu 35d5074dde fix(angular): improve indexHtmlTransformer documentation (#31742)
This PR updates the description for `indexHtmlTransformer` for Angular
webpack browser executor to clarify what it accepts. Also adds an
example

<img width="1192" alt="Screenshot 2025-06-26 at 8 22 23 AM"
src="https://github.com/user-attachments/assets/883d9d91-21a9-4806-ae1d-336779b09061"
/>


<!-- 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 #30831
2025-06-26 09:10:01 -04:00
Jack Hsu 57405e6a22 fix(testing): correct Playwright grep documentation from glob to regex (#31743)
- Fixed documentation to clarify grep uses regex not glob patterns
- Updated examples to show proper regex usage
- Corrected both --grep and --grepInvert documentation

Fixes #30181
2025-06-26 09:09:46 -04:00
Colum Ferry eb03e22cb2 fix(vite): resolve outDir path correctly for nested monorepos (#31741)
## Current Behavior

The Vite build executor uses naive string manipulation to calculate the
output directory path, which fails in nested monorepo structures where
the workspace root and project root have different relative paths.

## Expected Behavior

The Vite build executor properly resolves the output directory path
using Node.js path utilities, ensuring correct path calculation
regardless of monorepo nesting structure.

## Related Issue(s)

  Fixes #31234
2025-06-26 13:36:39 +01:00
Colum Ferry 71d60a910d fix(react): add .js extensions to subpath imports in module federation templates (#31730)
## Current Behavior

  Module federation templates in React generators use subpath imports
  without explicit file extensions (e.g., @nx/rspack/app-plugin,
  @nx/module-federation/webpack). This causes compatibility issues with
  Node.js 24's native TypeScript support, which requires explicit file
  extensions for ESM package subpath imports.

  ## Expected Behavior

Module federation templates should include .js extensions on all subpath
   imports to ensure compatibility with Node.js 24 while maintaining
  backwards compatibility with earlier Node.js versions. The imports
  should be in the format @nx/rspack/app-plugin.js,
  @nx/module-federation/webpack.js, etc.

  ## Related Issue(s)

  Fixes #31448
2025-06-26 13:22:24 +01:00
Benjamin Cabanes 110318291e docs(nx-dev): update headers to reference "Nx Enterprise" (#31731)
Revised "Enterprise" references to "Nx Enterprise" across headers for consistency. Added a new link to "AI" in the documentation header.
2025-06-26 08:18:42 -04:00
Colum Ferry babf86a456 fix(angular): respect skipTsConfig option in library generator (#31738)
## Current Behavior

The Angular library generator ignores the `skipTsConfig` option and
always modifies the `tsconfig.base.json` file, even when users
explicitly set `skipTsConfig=true` to avoid TypeScript configuration
changes.

  ## Expected Behavior

When `skipTsConfig=true` is passed to the Angular library generator, the
`tsconfig.base.json` file should not be modified. Project-specific
tsconfig files should still be created as expected, but the
workspace-level TypeScript
   configuration should remain untouched.

  ## Related Issue(s)

  Fixes #31185
2025-06-26 12:18:41 +01:00
Colum Ferry 316c9cd651 fix(docs): add missing --project parameter to Angular service generation command (#31735)
The command `nx g @nx/angular:service
libs/shared/data-access-user/src/lib/user` was missing the required
`--project` parameter. Added `--project=data-access-user` to fix the
error "Required property 'project' is missing".

Fixes #31410

Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
2025-06-26 11:58:46 +01:00
MaxKless 03faab1ee7 docs(nx-dev): write blog post about autofix notifications in JetBrains (#31666)
Co-authored-by: Juri Strumpflohner <juri.strumpflohner@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-26 00:47:59 -07:00
Colum Ferry 8b6ad42244 fix(module-federation): restore support for relative URLs in module federation remotes (#31723)
## Current Behavior

Module federation configurations with relative URLs are broken due to PR
   #30615, which forced all remote URLs to be parsed as absolute URLs
  using `new URL()`. This breaking change prevents developers from using
relative URLs in their module federation setups, causing runtime errors
  when the application tries to load remote modules.

  ## Expected Behavior

  Module federation should support both relative and absolute URLs
  seamlessly:
  - Relative URLs should work as they did before, maintaining backward
  compatibility
  - Absolute URLs should continue to work with enhanced query parameter
  support
  - The URL processing should be consistent across all module federation
  helpers (Angular and React)

  ## Related Issue(s)

  Fixes #31538
2025-06-25 18:18:43 +01:00
Nicholas Cunningham 92e9133165 feat(graph): enhance migration state management and introduce migration stopping functionality. (#31626)
## Overview
This PR enhances the Migrate UI by adding a "Stop" button that allows
users to halt in-progress migrations at any point during execution.
It works in tandem with https://github.com/nrwl/nx-console/pull/2567

### Currently
When a migration is running and needs to be stopped for any reason:
- User accidentally triggered the migration
- Migration is taking longer than expected
- Changes are needed before completion

Users must wait for the migration to complete before using the available
"Undo" or "Skip" options.

### Expected
Users should be able to stop a currently running migration at any time
before it completes, providing immediate control over the migration
process.

### Key Features:

- Refactor guards to improve migration state checks and add conditions
for running and completing migrations.
- Update the state machine to handle new states for running, stopped,
and evaluating migrations.
- Implement logic to track running migrations and allow for stopping
them gracefully.
- Introduce a new process for running migrations in a separate child
process to support cancellation.
- Enhance metadata management to include stopped migrations and update
UI accordingly. (The UI is completely driven by the backend now aka Nx
Console)
- Add tests to cover new migration states and behaviours.
2025-06-25 11:11:52 -06:00
Jason Jean b7e73feb1d docs: clarify that gitignored files are excluded from inputs (#31594)
Add callout box to the inputs documentation explaining that .gitignored
files are automatically excluded from inputs and won't affect task hash
computation.

Fixes #31574

Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jason Jean <FrozenPandaz@users.noreply.github.com>
2025-06-25 12:06:55 -04:00
Jordan 39954181bc docs(core): add ThisDotLabs and Angular Architects to partners page (#31670)
<!-- 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 adds new partners `Angular Architects` and `This Dot Labs`

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

Fixes #
2025-06-25 10:58:51 -04:00
Leosvel Pérez Espinosa 08b8e717ba fix(vite): fix the build command for the deps in the vite tsconfig paths plugin (#31729)
## Current Behavior

The `nxViteTsPaths` plugin determines the buildable libraries by
checking the existence of the following target:

```ts
process.env.NX_TASK_TARGET_TARGET === 'serve'
  ? 'build'
  : process.env.NX_TASK_TARGET_TARGET
```

But it later creates the command to build the dependencies to always run
the `process.env.NX_TASK_TARGET_TARGET` target. This is wrong and
results in trying to run the `serve` task for the dependencies when the
root task is `serve`.

## Expected Behavior

The `nxViteTsPaths` plugin should use the same task name to determine
the buildable libraries and run the command to build the dependencies.

## Related Issue(s)

Fixes #31333
2025-06-25 16:58:16 +02:00
Isaac Mann e4694efeb8 docs(core): remove june webinar 2025-06-25 15:11:30 +02:00
Colum Ferry c706a4e89e fix(webpack): respect user config when applying node target #30937 (#31700)
## Current Behavior
When a user sets `target: node` in their Webpack or Rspack config,
`NxAppRspackPlugin` and `NxAppWebpackPlugin` do not respect additional
user config for `library.target`.

## Expected Behavior
The user config should be respected.

## Related Issue(s)

Fixes #30937
2025-06-25 11:50:54 +01:00
Juri 25521f89ab docs(nx-dev): add blog post about being able to query CI 2025-06-25 12:14:26 +02:00
Juri d347d976ad fix(nx-dev): update sorting of pinned posts 2025-06-25 11:59:24 +02:00
Philip Fulcher fe687a003c docs(nx-dev): add creep vulnerability article (#31710) 2025-06-24 17:39:31 -06:00
Philip Fulcher c01d65e3f0 docs(nx-dev): add polygraph launch article (#31696)
https://nx-dev-git-philip-polygraph-release-article-nrwl.vercel.app/blog/nx-cloud-introducing-polygraph

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-24 13:16:49 -06:00
Jack Hsu 13da36e63e fix(nextjs): use next/jest.js for Jest configuration to support modern JSX transform (#31705)
This PR fixes and issue with Next.js + Jest to remove warnings about
outdated transforms.

## Changes Made

- Updated Next.js application generator to use next/jest.js instead of
manual babel-jest configuration
- Updated Next.js library generator to use the same modern configuration
approach
- Added e2e tests to verify the new Jest configuration works correctly
- Kept same CJS vs ESM logic for JS vs TS config (existing behavior)

## Current Behavior

When using React 19 with Next.js applications in Nx, developers receive
a warning about outdated JSX transform because the Jest configuration
uses
manual babel-jest setup instead of Next.js's recommended approach.

## Expected Behavior

Next.js applications and libraries generated by Nx should use
next/jest.js configuration which automatically handles the modern JSX
transform
(runtime: 'automatic') and provides proper Jest setup for Next.js
projects without warnings.

## Related Issue(s)

Fixes #27900
2025-06-24 15:09:16 -04:00
Jack Hsu 819abe9337 docs(js): update tsconfig examples so extend from the root properly to remove confusion (#31707)
## Current Behavior

  Documentation examples show `tsconfig.lib.json` and
  `tsconfig.spec.json` extending from `./tsconfig.json`.

  ## Expected Behavior

  Examples should extend directly from `../../tsconfig.base.json` to
  match Nx's recommended TypeScript configuration structure.

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

Fixes #31704
2025-06-24 14:03:39 -04:00
Colum Ferry 52af4238eb fix(nuxt): fix TypeScript configuration chain for Nuxt components and composables (#31701)
- Modified create-ts-config.ts to make tsconfig.json extend
./.nuxt/tsconfig.json instead of root tsconfig
- Updated nuxt.config.ts template to make .nuxt/tsconfig.json extend the
root tsconfig with correct relative path
- Added relativePathToRootTsConfig parameter to template generation
- Updated test snapshots to reflect the new configuration chain

This ensures IDEs can properly recognize Nuxt components, composables,
and auto-imports by establishing the correct TypeScript configuration
inheritance chain: tsconfig.app.json → tsconfig.json →
.nuxt/tsconfig.json → tsconfig.base.json

## Related Issues
#30742

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-24 17:51:01 +01:00
Colum Ferry 82ddc1abfc fix(module-federation): ensure manifest path not prepended with workspace root (#31698)
## Current Behavior

When users provide an absolute path for the Module Federation manifest
file
that already includes the workspace root, the plugin incorrectly
prepends the
  workspace root again, resulting in an invalid path like
  `/workspace/root/workspace/root/path/to/manifest.json`.

  ## Expected Behavior

The plugin should detect if the provided manifest file path already
starts with
the workspace root and avoid prepending it again. This allows users to
provide
either relative or absolute paths for the manifest file, and both will
work
  correctly.

  ## Related Issue(s)

  Fixes #31524
2025-06-24 14:47:20 +01:00
Julien Marcou 014d774bff feat(module-federation): bump @module-federation/enhanced version to 0.15.0 to fix vulnerability (#30806)
## Current Behavior

`@module-federation/enhanced` v0.9.0 has a dependency to
`@module-federation/dts-plugin` v0.9.0, which has a dependency to `koa`
v2.15.4, which has a [security vulnerability
](https://github.com/koajs/koa/security/advisories/GHSA-x2rg-q646-7m2v)

And because `@module-federation/enhanced` is pinned with `^0.9.0` it
won't automatically update it to a version greater than `0.9.x`

## Expected Behavior

Until `@module-federation/enhanced` releases a v1, it needs to be
manually updated when we want to benefit from a newer "minor" version.

Pinning `@module-federation/enhanced` to `^0.15.0` allows to benefit
from the latest release and security fix.

## Related Issue(s)

Fixes #30502
Fixes #30748

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-06-24 14:30:15 +01:00
Colum Ferry e703e0bb3b feat(js): add prune-lockfile executor (#31557)
## Current Behavior
In the new TS Soln Setup with Package Manager Workspaces, there is
currently no builtin method for creating a pruned lockfile that is
agnostic across bundlers and compilers.
This is problematic for apps that must be containerized.

## Expected Behavior
Add a new `@nx/js:prune-lockfile` executor that can be used to produce a
pruned lockfile in the build artifact output directory, ready for
containerization.

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Colum Ferry <Coly010@users.noreply.github.com>
2025-06-24 14:10:34 +01:00
Juri ebb1716a99 fix(nx-dev): pinning logic on blog entry page 2025-06-24 10:57:37 +02:00
Caleb Ukle 0ef88573b2 docs(nx-cloud): initial polygraph docs (#31657)
add docs over polygraph features

https://nx-dev-git-docs-polygraph-nrwl.vercel.app/ci/recipes/enterprise/polygraph

---------

Co-authored-by: Mike Hartington <mhartington@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Mike Hartington <mikehartington@gmail.com>
2025-06-23 18:23:20 -04:00
Benjamin Cabanes a74bbaf32c docs(nx-dev): add Nx Labs page (#31679)
Created a new contact page for Nx Labs to highlight services and provide a form for inquiries. Updated the professional services section in the header menu to include a link to this page.
2025-06-23 15:09:01 -04:00
MaxKless a8cd1c77e3 chore(repo): add .cursor/mcp.json to gitignore (#31691)
people use it locally with different ports so we should just add it to
gitignore
2025-06-23 15:25:09 +00:00
Benjamin Cabanes 4e55020b1b docs(nx-dev): update ai page (#31669)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-06-23 13:42:11 +00:00
Juri 755de341a4 docs(nx-dev): add self-healing CI blog post 2025-06-23 14:53:57 +02:00
Jonathan Gelin fd31fa633d fix(js): resolve asset paths relative to workspace root instead of cwd (#31664)
## Description

This PR fixes an issue where asset files copied during a build using the
`@nx/js:tsc` executor are placed in the wrong directory depending on the
current working directory from which the `nx` command is executed.

This behavior becomes particularly problematic in scenarios like release
workflows that rely on `preVersionCommand` to run E2E tests. For
instance, when using tools like Jest from the root of an E2E project,
scripts like `start-local-registry` may trigger a build and run the
`preVersionCommand`. However, instead of placing assets in the expected
`dist` folder of the project, they are incorrectly copied relative to
the E2E folder’s location.


## Reproduction Steps

1. Create a new Nx workspace:

   ```bash
npx --yes create-nx-workspace assets-issue --preset=ts --no-interactive
   cd assets-issue
   ```

2. Add the Nx Plugin package:

   ```bash
   nx add @nx/plugin
   ```

3. Generate a new plugin:

   ```bash
nx g @nx/plugin:plugin packages/my-plugin --linter eslint
--unitTestRunner jest
   ```

4. Add a generator to the plugin:

   ```bash
nx g @nx/plugin:generator packages/my-plugin/src/generators/my-generator
   ```

5. Build the plugin from the workspace root:

   ```bash
   nx build my-plugin
   ```

    Assets are copied correctly:

   ```
   dist/packages/my-plugin/generators/files/src/index.ts.template
   dist/packages/my-plugin/generators/schema.json
   dist/packages/my-plugin/generators/schema.d.ts
   ```

6. Now build the same project from a nested folder:

   ```bash
   mkdir e2e && cd e2e
   nx build my-plugin --skip-nx-cache
   ```

    Assets are copied relative to the current folder:

   ```
   e2e/packages/my-plugin/dist/generators/files/src/index.ts.template
   e2e/packages/my-plugin/dist/generators/schema.json
   e2e/packages/my-plugin/dist/generators/schema.d.ts
   ```

## Expected Behavior

The build output—especially copied assets—should always respect the
project’s `outputPath` configuration regardless of where the `nx`
command is invoked from. The behavior should be consistent and **not
influenced by `process.cwd()`**.
2025-06-23 08:42:59 +02:00
Jack Hsu 57e70d0e91 feat(js): deprecate simpleName option in library generator (#31673)
The simpleName option is no longer useful as we've moved to using
options "as provided" without transformation. Users should provide the
exact name, directory, and import path they want to use.

## Changes
- Add x-deprecated to schema.json marking for removal in Nx 22
- Add runtime warning when simpleName is used


🤖 Generated with [Claude Code](https://claude.ai/code)

<!-- 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
Users are confused with `--simpleName` with using `--name` AND
`--directory`

## Expected Behavior
We should tell users that only `--name` should be used.

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

Fixes #29508

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-20 21:39:55 -04:00
Benjamin Cabanes 8026885128 docs(nx-dev): fix typo (#31677)
Update callout type from 'warn' to 'warning' in CVE blog post.
2025-06-20 20:59:15 +00:00
Nicholas Cunningham df75799ed7 fix(js): failing e2e test due to dependency (#31676)
This PR updates our `e2e-js` test to include dependencies for all
package managers and not just pnpm.

E2E Matrix for `e2e-js` is now passing:
https://github.com/nrwl/nx/actions/runs/15786673606/job/44504580439
2025-06-20 20:28:49 +00:00
Jack Hsu 1f493bf251 docs(react): update tutorial for ESLint flat config format (#31672)
Update React monorepo tutorial:
- Fix reference to .eslintrc.base.json (now eslint.config.mjs)

🤖 Generated with [Claude Code](https://claude.ai/code)

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-20 16:21:35 -04:00
Jack Hsu c452821bfa docs(nextjs): fix incorrect build output path and vite.config.ts mention (#31671)
## Changes

- Update build output path from {workspaceRoot}/dist/{projectRoot} to
.next folder
- Replace vite.config.ts example with next.config.js distDir
configuration
- Add note about legacy executor configuration vs inferred tasks
- Clarify that sourceRoot may not exist in all Next.js projects


🤖 Generated with [Claude Code](https://claude.ai/code)

<!-- 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
The docs for Next.js says output can be configured in `vite.config.ts`,
which is nonsense. It also mentions the output directory that is only
applicable in the legacy setup.

## Expected Behavior
Fix configuration example, and show different ways to configure output
(both new crystal setup, and legacy executor-based setup).

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

Fixes #31037

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-20 16:21:31 -04:00
Benjamin Cabanes acae2eca89 docs(nx-dev): enhance AI feature descriptions & update links (#31659)
Refined AI features including new capabilities (self-healing CI, AI data analysis), updated descriptions, and rearranged feature order. Adjusted section ID for CI security and added links to highlight AI integrations in pricing plans.
2025-06-20 20:07:01 +00:00
Jack Hsu 55251ca0bf fix(react): do not set styles.tailwind for executor options for projects not using inferred targets (#31667)
This PR fixes an issue when you use React with Webpack/Rspack, and
aren't using `@nx/webpack/plugin` or `@nx/rspack/plugin`.



<!-- 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
Project configuration contains this for build options:

```
"styles": ["src/myapp/styles.tailwind"]
```

## Expected Behavior


It shoud be :

```
"styles": ["src/myapp/styles.css"]
```

Which is what we actually generate.
2025-06-20 15:02:27 -04:00
Leosvel Pérez Espinosa 9e8c1a1062 cleanup(angular): set target version to v22 for the decorate cli script deprecation warning (#31170)
## Current Behavior

The deprecation warning for the old script to decorate the Angular CLI
doesn't state the version in which it will be removed. This was
intentional to allow sufficient time for users to migrate away from it.

## Expected Behavior

The deprecation warning for the old script to decorate the Angular CLI
should state that it will be removed in Nx v22. It has been a long time
since it was deprecated, and it should have provided more than enough
time for users to move away from it.

## Related Issue(s)

Fixes #
2025-06-20 09:48:50 -04:00
Leosvel Pérez Espinosa 617b8d49cb fix(testing): do not update component configuration in cypress set-inject-document-domain migration (#31614)
## Current Behavior

The `set-inject-document-domain` migration updates the component
configuration. This is incorrect since the `inject-document-domain` is
not a property supported by the component configuration.

## Expected Behavior

The `set-inject-document-domain` migration should not update the
component configuration.

## Related Issue(s)

Fixes #31610
2025-06-20 09:45:36 -04:00
Leosvel Pérez Espinosa 6b2175bfcb fix(core): do not auto-exit tui when there are multiple failed tasks (#31631)
## Current Behavior

When the user hasn't interacted with the TUI and has not disabled the
auto-exit functionality, it will always auto-exit regardless of the
number of failed tasks.

## Expected Behavior

When the user hasn't interacted with the TUI and has not disabled the
auto-exit functionality, it should not auto-exit if there are multiple
failed tasks. Additionally, as long as no terminal output panes are open
(e.g., the run one command will always display the initiating task
terminal pane), it should focus and open the first failed task.

If all tasks succeed or there's only one failure, it should continue to
auto-exit.
2025-06-20 10:12:38 +02:00
Victor Savkin bd898d3220 fix(nx-dev): small adjustment to the blog post 2025-06-19 19:18:47 -04:00
Juri 9e9345b5e1 docs(nx-dev): new blog post on how to use sync generators for Tailwind globs 2025-06-20 00:15:08 +02:00
James Henry 4c7586c82d chore(repo): migrate to conformance v3 (#31475) 2025-06-19 21:37:16 +00:00
Jack Hsu ec457f72df chore(repo): add raw-docs (#31640)
This PR adds `raw-docs` integration. See here for more details:
https://github.com/nrwl/raw-docs
2025-06-19 12:53:01 -04:00
Juri 460d2114dd docs(nx-cloud): embed course widget to give full course more visibility 2025-06-19 14:25:00 +02:00
Jack Hsu 64d0294e4e docs(core): clarify package.json vs project.json usage and capabilities (#31642)
Adds comprehensive explanation that both files support executors and all
Nx features through the 'nx' property in package.json. Clarifies that
project.json is optional.

Preview:
https://nx-dev-git-issues-28715-nrwl.vercel.app/reference/project-configuration#project-level-configuration-files

## Current Behavior

The documentation for project configuration does not clearly explain
that both package.json and project.json support the same Nx features,
including executors.

## Expected Behavior

The documentation now clearly states that:
- Both package.json and project.json support targets through the "nx"
property in package.json
- The choice between the two is primarily a matter of preference
- Includes an updated example showing how to use `nx.targets` in
package.json

## Related Issue(s)

Fixes #28715
2025-06-19 08:23:15 -04:00
Jason Jean 29b14b1bd3 fix(core): prevent duplicate nx cloud logs from global and local nx invocations (#31641)
## Current Behavior

When Nx is invoked from a global install, both the global and local
versions register process exit handlers that flush captured logs. This
causes Nx Cloud logs to be displayed twice - once from the global
installation and once from the local installation.

## Expected Behavior

Only the local Nx installation should handle log flushing, preventing
duplicate log output. The process exit handler is moved from the global
entry point (nx.ts) to the local entry point (init-local.ts) so that log
flushing only occurs once.

## Related Issue(s)

This change requires users to update their globally installed Nx to
fully resolve the duplicate logging issue, as the fix is now in the
local version that gets invoked.
2025-06-18 14:23:43 -04:00
Benjamin Cabanes 1c8f964c33 docs(nx-dev): add CVE reference on security (#31627)
Improved the clarity of caching risks, added detailed explanations on CREEP vulnerability, and linked to the CVE-2025-36852 publication.
2025-06-18 14:17:25 -04:00
Benjamin Cabanes 9b756bef7e docs(nx-dev): add CVE reference on remote cache (#31639)
Improved the clarity of caching risks, added detailed explanations on CREEP vulnerability, and linked to the CVE-2025-36852 publication.
2025-06-18 14:17:10 -04:00
Leosvel Pérez Espinosa 1a9405b0bc chore(repo): fix the regex to validate commits (#31630)
## Current Behavior

The string regex the script uses to validate commits is not correctly
escaped.

## Expected Behavior

The string regex the script uses to validate commits should be correctly
escaped.
2025-06-18 13:36:14 -04:00
Mike Hartington db6e0d1217 docs(misc): update cve blog (#31638)
<!-- 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-06-18 11:49:28 -04:00
Juri Strumpflohner fa7d37e5ed feat(core): improve message when workspace is not detected (#31632)
<!-- 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
-->

Adds the path to the terminal output s.t. you can at least debug what's
going on


![image](https://github.com/user-attachments/assets/2aed9a24-d88d-4e54-8581-94210979ded4)


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

Fixes #
2025-06-18 10:34:42 -04:00
Jack Hsu 84796d011e docs(misc): add titles to intro/overview pages (#31636)
## Current Behavior

- Documentation pages under "technologies" and "core-api" sections with
"introduction"/"overview" IDs lack H1 titles after front matter
- Some remote caching package links point to parent sections instead of
overview pages

## Expected Behavior

- All affected documentation pages should have H1 titles for consistency
- Links should point directly to overview pages

## Related Issue(s)

Fixes #

## Changes Made

### 1. Updated Remote Caching Links (commit fae9055f8c)

Updated links in 3 files to point directly to overview pages:
- `docs/blog/2025-01-06-nx-update-20-3.md`
- `docs/shared/deprecated/custom-tasks-runner.md`
- `docs/shared/recipes/running-tasks/self-hosted-caching.md`

Changed links from:
- `/reference/core-api/azure-cache` →
`/reference/core-api/azure-cache/overview`
- `/reference/core-api/gcs-cache` →
`/reference/core-api/gcs-cache/overview`
- `/reference/core-api/s3-cache` →
`/reference/core-api/s3-cache/overview`
- `/reference/core-api/shared-fs-cache` →
`/reference/core-api/shared-fs-cache/overview`

### 2. Added H1 Titles to Documentation Pages

Added H1 titles to 29 documentation files that were missing them:

#### Core API Overview Pages (6 files)
- `docs/shared/packages/azure-cache/azure-cache-plugin.md` → `#
@nx/azure-cache`
- `docs/shared/packages/conformance/conformance-plugin.md` → `#
@nx/conformance`
- `docs/shared/packages/gcs-cache/gcs-cache-plugin.md` → `#
@nx/gcs-cache`
- `docs/shared/packages/owners/owners-plugin.md` → `# @nx/owners`
- `docs/shared/packages/s3-cache/s3-cache-plugin.md` → `# @nx/s3-cache`
- `docs/shared/packages/shared-fs-cache/shared-fs-cache-plugin.md` → `#
@nx/shared-fs-cache`

#### Technology Introduction Pages (23 files)
- `docs/shared/packages/angular/angular-plugin.md` → `# @nx/angular`
- `docs/shared/packages/esbuild/esbuild-plugin.md` → `# @nx/esbuild`
- `docs/shared/packages/rspack/rspack-plugin.md` → `# @nx/rspack`
- `docs/shared/packages/vite/vite-plugin.md` → `# @nx/vite`
- `docs/shared/packages/webpack/plugin-overview.md` → `# @nx/webpack`
- `docs/shared/packages/eslint/eslint.md` → `# @nx/eslint`
- `docs/shared/packages/gradle/gradle-plugin.md` → `# @nx/gradle`
- `docs/shared/packages/express/express-plugin.md` → `# @nx/express`
- `docs/shared/packages/node/node-plugin.md` → `# @nx/node`
- `docs/shared/packages/nest/nest-plugin.md` → `# @nx/nest`
- `docs/shared/packages/expo/expo-plugin.md` → `# @nx/expo`
- `docs/shared/packages/react/react-plugin.md` → `# @nx/react`
- `docs/shared/packages/next/plugin-overview.md` → `# @nx/next`
- `docs/shared/packages/react-native/react-native-plugin.md` → `#
@nx/react-native`
- `docs/shared/packages/remix/remix-plugin.md` → `# @nx/remix`
- `docs/shared/packages/cypress/cypress-plugin.md` → `# @nx/cypress`
- `docs/shared/packages/detox/detox-plugin.md` → `# @nx/detox`
- `docs/shared/packages/jest/jest-plugin.md` → `# @nx/jest`
- `docs/shared/packages/playwright/playwright-plugin.md` → `#
@nx/playwright`
- `docs/shared/packages/storybook/plugin-overview.md` → `#
@nx/storybook`
- `docs/shared/packages/js/js-plugin.md` → `# @nx/js`
- `docs/shared/packages/vue/vue-plugin.md` → `# @nx/vue`
- `docs/shared/packages/nuxt/nuxt-plugin.md` → `# @nx/nuxt`

Note: The Angular Rspack introduction page
(`docs/shared/guides/angular-rspack/introduction.md`) already had an
appropriate H1
title "# Introduction" and was left unchanged.

All changes improve documentation consistency and navigation by ensuring
proper titles and direct links to overview pages.
2025-06-18 09:50:44 -04:00
Colum Ferry 06089663c6 feat(js): add copy-workspace-modules executor (#31545)
## Current Behavior

When building applications that depend on workspace libraries for
deployment (particularly in containerized environments like Docker),
developers must manually handle copying workspace dependencies and
updating package.json references.

This creates friction when trying to deploy applications that consume
workspace libraries, as the build output doesn't contain the necessary
workspace dependencies and the package.json still references them with
`workspace:` protocol which doesn't work outside the workspace context.

  ## Expected Behavior

With the new `@nx/js:copy-workspace-modules` executor, developers can
automatically prepare their built applications for deployment by:

1. **Automatically copying workspace dependencies**: The executor scans
the application's package.json for workspace dependencies (those with
`workspace:` or `file:` version specifiers) and copies the source code
of these dependencies into a `workspace_modules` directory within the
build output

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-18 13:50:01 +01:00
Leosvel Pérez Espinosa e1dfe6ea09 fix(angular): handle inferred projects without project configuration files in migrations (#31633)
## Current Behavior

Some Angular migrations collect the Angular projects from the project
graph using the dependencies information. When reading the project
configuration for those projects, it can throw an error if trying to do
it for a completely inferred project (it doesn't have a project
configuration file).

## Expected Behavior

The Angular migrations collecting Angular projects from the project
graph using the dependencies information should gracefully handle
projects that were completely inferred when trying to read the project
configuration.

In fact, the current migrations didn't need to read the project
configuration and could use the project graph information directly, so
the call to read the project configuration was removed.

## Related Issue(s)

Fixes #31607
2025-06-18 12:31:48 +02:00
bkp-ttd 9406d2bfdb fix(linter): respect the --quiet option when running with --fix (#31403)
## Current Behavior

`nx run lint --quiet --fix` doesn't respect `--quiet` and fixes all
issues, even silenced ones. This is different from how `eslint --quiet
--fix` behaves.

## Expected Behavior

`nx run lint --quiet --fix` should only fix issues that aren't silenced
by `--quiet`, like `eslint` does

## Related Issue(s)

Fixes #31401
2025-06-18 09:33:02 +00:00
Jonathan Gelin 578405862d feat(js): support publishing with registryConfigKey when pnpm >=9.15.7 <10.0.0 || >=10.5.0 (#31622) 2025-06-18 09:16:59 +00:00
Juri 5c2fdc9e31 docs(devkit): callout to disable the daemon when developing plugins 2025-06-17 22:26:52 +02:00
Nicholas Cunningham 1ef43d0b95 fix(core): ensure destination directories are created before copying files (#31624)
This PR updates the `copy-local-native.js` script to ensure destination
directories are created before copying files.
2025-06-17 13:50:29 -04:00
Jack Hsu 11691d141a docs(core): add NX_TUI environment variables documentation (#31619)
This PR added two TUI environment variables to the reference page:
- NX_TUI to enabled/disable
- NX_TUI_AUTO_EXIT to control auto-exit behavior

## Current Behavior

The environment variables documentation does not include the new
Terminal UI (TUI) environment variables `NX_TUI` and `NX_TUI_AUTO_EXIT`
that were recently added to control the interactive terminal interface
for task
execution.

## Expected Behavior

The documentation now includes comprehensive information about the TUI
environment variables:
- `NX_TUI`: Controls whether the Terminal UI is enabled or disabled for
running tasks
- `NX_TUI_AUTO_EXIT`: Controls the auto-exit behavior of the TUI after
tasks complete, supporting boolean values or a number for countdown
seconds

## Related Issue(s)

Fixes #31111
2025-06-17 13:27:37 -04:00
Emily Xiong 3aa546ffe3 fix(gradle): add build-ci target even if atomized=false (#31537)
<!-- 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 atomized=false, it does not generate build-ci and check-ci targets

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- when atomized=false, it should still generate build-ci and check-ci
targets
- upgrade dev.nx.gradle.project-graph version to 0.1.2

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

Fixes #
2025-06-17 13:06:24 -04:00
Jack Hsu b89ca32a01 docs(ci): add Bun to supported package managers list (#31618)
This PR adds bun to list of package managers that can be used on the CI
deployment page.

Fixes #31431

##  Current Behavior

The CI deployment documentation at
https://nx.dev/ci/recipes/other/ci-deployment only mentions npm, yarn,
and pnpm as supported package managers. However, Bun is actually
supported by Nx as shown in the PackageManager type
   definition which includes 'bun' as a valid option.

##  Expected Behavior

The documentation should accurately reflect all supported package
managers, including Bun. Users should be aware that they can use Bun as
their package manager when following the CI deployment recipes.

## Related Issue(s)

Fixes #31431
2025-06-17 12:59:55 -04:00
Emily Xiong 7f349fb6bf fix(gradle): fix gradle on windows (#31595)
<!-- 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 -->
fix to run gradle on windows
./gradlew command is only macos

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
use @nx/gradle:gradle executor instead of command ./gradlew

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

Fixes #
2025-06-17 11:35:01 -04:00
Leosvel Pérez Espinosa d0d62846a2 fix(core): show the correct content in the tui terminal pane for skipped tasks (#31559)
## Current Behavior

When a task is skipped (e.g. some dep(s) failed), the terminal pane is
completely empty. If you navigate to another task and see its output and
navigate back to the skipped task, then you see the correct title and
borders but the output is wrong: it shows the output of the previous
task.


![image](https://github.com/user-attachments/assets/8d304019-a17e-4a5a-9369-30fb4025aeb3)


![image](https://github.com/user-attachments/assets/c43b9019-2438-46a1-8ebb-cf28c662afa6)

## Expected Behavior

The TUI terminal pane should be correctly rendered for skipped tasks. It
should correctly show the title, border and content (`Task was
skipped`).


![image](https://github.com/user-attachments/assets/f4f80b39-79c4-41c8-a2e5-cfdcb46030fa)
2025-06-17 09:45:15 -04:00
Akos Komuves 17507ad023 docs(core): update package names for run-task feature (#31617)
## Summary

This pull request updates the documentation to reflect changes in
project names for task dependencies. The documentation was referring to
the `modules-shared-ui` and `modules-products` packages on the chart,
but these packages are called differently.


![image](https://github.com/user-attachments/assets/c924ad1f-f13f-4b6c-9f0e-a95317e73987)
2025-06-17 13:22:38 +00:00
Caleb Ukle b97222ded4 docs(nx-dev): fix issue with related docs not loading (#31605)
make sure new paths work for related docs resolution
include related docs for 'legacy' fallback page logic


## before: 
on the `/features/manage-releases` route
![WKMac
2025-06-16T15-37-13](https://github.com/user-attachments/assets/570493bb-571c-47fb-9dd8-dae6b138f951)

on the `/ci/features/affected` route
![WKMac
2025-06-16T15-37-53](https://github.com/user-attachments/assets/f269c6fe-01ec-43a4-a98a-37448d486a54)


## after:
on the `/features/manage-releases` route
![WKMac
2025-06-16T15-38-43](https://github.com/user-attachments/assets/98ed4e98-ea99-485b-b09e-82079bd88fdd)

on the `/ci/features/affected` route
![WKMac
2025-06-16T15-36-17](https://github.com/user-attachments/assets/31bf3be2-3104-4c3c-bdbf-c8701e99ce10)

rename recipes to guides for the related docs card
![WKMac
2025-06-16T16-01-05](https://github.com/user-attachments/assets/4fd6dcf9-dd02-4042-9102-b1d9e72e3866)
2025-06-16 12:03:28 -05:00
Leosvel Pérez Espinosa 87234da015 docs(misc): fix broken links in tutorials (#31603)
## Current Behavior

Some links in the Angular and React tutorials are broken.

## Expected Behavior

The links in the Angular and React tutorials work correctly.

## Related Issue(s)

Fixes #31601
2025-06-16 14:23:58 +02:00
Leosvel Pérez Espinosa bf9c677e79 fix(angular): fix import from ng-packagr (#31600)
## Current Behavior

Using the `ng-packagr` executors in an Angular version lower than v20
results in an error due to a bad import.

## Expected Behavior

The `ng-packagr` executors should work correctly regardless of the
Angular version used.

## Related Issue(s)

Fixes #31597
2025-06-16 10:20:13 +02:00
Philip Fulcher db86a355c6 docs(nx-dev): add 21.2 release article (#31585)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-13 17:03:52 +00:00
Benjamin Cabanes 363058ee54 docs(nx-dev): add support for 'announcement' type callout (#31583)
Extended the `Callout` component and schema to support a new 'announcement' type with corresponding styles and icon. Updated documentation example for the new type.
2025-06-13 11:55:49 -04:00
Juri Strumpflohner 7c5faba41b docs(devkit): fix instructions for creating sync generators (#31576)
Co-authored-by: Caleb Ukle <caleb@nrwl.io>
2025-06-13 14:31:55 +00:00
Jack Hsu 40cf21b10c feat(react): support port option for react app generator (#31552)
This PR adds the ability to set the port of the React application when
using the generator.

e.g.

```shell
npx nx g @nx/react:app --port 8080
```

This is useful when generating multiple apps and then running them in
parallel.
2025-06-13 08:53:14 -04:00
Juri Strumpflohner 6bc4ef47ec feat(nx-dev): read description from markdown frontmatter for index pages (#31566)
<!-- 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

Index pages read from the map.json description which is missing for a
lot of entries.

<img width="853" alt="image"
src="https://github.com/user-attachments/assets/8c0db9a2-d293-482d-8597-647cda47cc93"
/>


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

The new logic

- checks the corresponding markdown file `description` property which is
also used for the HTML meta description tags
- falls back to the `map.json` description

<img width="809" alt="image"
src="https://github.com/user-attachments/assets/716358f0-bab9-4bd4-97b2-b31fa151ebe0"
/>



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

Fixes #
2025-06-13 08:52:53 -04:00
Juri d2d18a6cb4 docs(core): update getting started pages 2025-06-13 13:39:21 +02:00
Miguel 8ef39c1140 docs(nx-dev): Fix typo in 2025-01-27-project-references (#31571)
Small typo in docs :)
2025-06-13 11:02:09 +02:00
Rares Matei 18155f4574 docs(nx-cloud): update release notes (#31563)
<!-- 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-06-12 12:01:36 -05:00
Jack Hsu 51dced2469 docs(misc): update getSchemaViewModel to return new API path rather than /nx-api/:plugin (#31561)
This PR updates pages like
`/technologies/typescript/api/executors/verdaccio`, such that the
backlink to the API index is correct. Even though we redirect `/nx-api`
pages, the Next.js pages router does not respect them and users see 404
instead.
2025-06-12 12:28:47 -04:00
Caleb Ukle 5ac1c08d34 docs(nx-dev): add CVE-2025-36852 ref post (#31560) 2025-06-12 11:00:05 -05:00
Nicholas Cunningham 4e187e1c35 fix(core): update Node.js version to 22.16.0 since the rust-docker-lts version is not updated (#31547)
This PR updates the Nodejs version installed on our docker images
contained in the publish script to be consistent with the Nx repository
Node compatibility version.

The current Nodejs version being pulled from the docker image is Node
v18 but our repository requires Node v20.19.0.

A test run can be found here:
https://github.com/nrwl/nx/actions/runs/15593332649
2025-06-12 11:36:20 -04:00
Ashkan 8ddd697a07 fix(bundling): correctly handle .cjs.js .mjs.js in rollup for type definitions (#29366)
…le extensions for type definitions.

Updated the Rollup plugin's logic for generating type definition files
to ensure compatibility with additional file extensions, including
.cjs.js and .mjs.js.

This change improves the handling of entry points and ensures that
corresponding .d.ts files are correctly named and emitted in all
supported scenarios.

Added a comprehensive test case to validate the new behavior.

closed #29308

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

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

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

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

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

Fixes #

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-06-11 15:06:49 +01:00
Nicholas Cunningham ec0eda513d fix(repo): MacOS failures in our E2E Tests (#31528)
This PR modifies the populate-local-registry-storage inputs to
invalidate the cache when the native task is updated (which includes
OS/architecture information).

This change addresses MacOS failures we've been encountering in our
nightly GitHub Actions runs. The issue stems from incorrect cache
restoration when running multiple OS and Node.js version combinations,
which explains why native modules were consistently missing in most
MacOS tests.

Here is the result: https://github.com/nrwl/nx/actions/runs/15562011534
2025-06-10 15:41:01 -04:00
Caleb Ukle 001c7a1dde docs(core): add port conflict resolution guidance for multiple apps (#31509)
## Current Behavior

Docs do not callout potential port conflict issues with running e2e in
parallel

## Expected Behavior

Docs mention how to avoid parallel port collisions

## Related Issue(s)


Fixes #
2025-06-10 15:40:04 -04:00
Jason Jean c3c9ba39b3 fix(core): simplify Nx Console installation prompt (#31532)
## Current Behavior

The Nx Console installation prompt has verbose and redundant wording
that makes the message unclear.

## Expected Behavior

The prompt is simplified and more concise, focusing on the key benefits
of installing Nx Console while being more direct about what users will
gain.

## Related Issue(s)

This change improves the user experience when prompted to install Nx
Console.
2025-06-10 19:10:02 +00:00
Jack Hsu 28b48ad1f3 docs(misc): update URls that should point to intro pages rather than API index pages (#31531)
This PR fixes an issue introduced when we removed `/nx-api` pages:
https://github.com/nrwl/nx/pull/31453.

Most of the old `/nx-api/<plugin>` URLs should now go to
`/technologies/<plugin>/introduction`, since those pages contain what
was on the previous "overview" pages.

The only exception are places where we explicitly link to
`.../api/{generators,executors,migrations}` URLs, and the following
three blog posts that we want users to land on the API index.

-
https://github.com/nrwl/nx/blob/master/docs/blog/2022-03-29-the-react-cli-you-always-wanted-but-didnt-know-about.md?plain=1#L132
(https://nx.dev/blog/the-react-cli-you-always-wanted-but-didnt-know-about)
-
https://github.com/nrwl/nx/blob/master/docs/blog/2022-04-08-what-is-new-in-nx-13-10.md?plain=1#L245
(https://nx.dev/blog/what-is-new-in-nx-13-10)
-
https://github.com/nrwl/nx/blob/master/docs/blog/2022-05-02-nx-v14-is-out-here-is-all-you-need-to-know.md?plain=1#L253
(https://nx.dev/blog/nx-v14-is-out-here-is-all-you-need-to-know)
2025-06-10 15:08:29 -04:00
Jason Jean df4f1363f7 fix(core): scope native logging to nx module by default (#31530)
## Current Behavior

The native logging is currently set to a global 'info' level, which can
produce verbose output that may not be relevant to users.

## Expected Behavior

Native logging should be scoped to the 'nx::native' module by default
with 'info' level, reducing noise while still allowing users to control
logging verbosity through the `NX_NATIVE_LOGGING` environment variable.

## Related Issue(s)

This improves the developer experience by providing more focused logging
output and reduces unnecessary verbosity in the console.

Fixes https://github.com/nrwl/nx/issues/31518
2025-06-10 13:43:38 -04:00
Emily Xiong 7a53477adc fix(gradle): fix gradle test running gaps (#31313)
<!-- 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 -->
- for the atomized test, currenly, its testClassName is just the 1st
class name in the file

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- upgrade gradle to latest version from 8.13 to 8.14
- for test task, exclude all its depends on tasks
  - it currently only exclude its direct depends on, its children
- now it will go down the dependency tree and exclude all of its depends
on, its children and grandchildren
- for the atomized test target, its testClassName will be the full
package name
- e.g.
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfigurationCustomObjectMapperProviderTest
   - add logics to handle nested class
   - exclude private class name
<img width="1081" alt="Screenshot 2025-06-06 at 2 53 39 PM"
src="https://github.com/user-attachments/assets/285792fb-f098-4511-85dc-ee1263d75929"
/>
- add build-ci target
<img width="1140" alt="Screenshot 2025-06-10 at 10 21 06 AM"
src="https://github.com/user-attachments/assets/25db4a3e-2794-4654-9a95-1b66d229340b"
/>


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

Fixes #
2025-06-10 13:23:09 -04:00
Colum Ferry 8daad98992 chore(node): refactor application generator for more clarity (#31523)
## Current Behavior

The Node.js application generator
(`packages/node/src/generators/application/application.ts`) is
implemented as a single large file containing ~469 lines of code. All
generator logic is mixed together in one file including:

- Option normalization and validation
- Project configuration creation  
- File generation
- Build/serve target setup
- Dependency management
- ESLint configuration
- Proxy setup

This makes the code harder to maintain, test, and understand as the file
handles multiple responsibilities.

## Expected Behavior

The generator is now refactored into smaller, focused modules organized
in a `lib/` directory:

- `normalize-options.ts` - handles option normalization and validation
- `normalized-schema.ts` - defines the normalized schema interface  
- `create-project.ts` - handles project configuration creation (exported
as `addProject`)
- `create-files.ts` - handles file generation (exported as
`addAppFiles`)
- `create-targets.ts` - handles build/serve target configuration
- `add-dependencies.ts` - handles dependency management (exported as
`addProjectDependencies`)
- `add-linting.ts` - handles ESLint setup (exported as
`addLintingToApplication`)
- `add-proxy.ts` - handles proxy configuration (exported as `addProxy`)
- `index.ts` - exports all the functions

The main `application.ts` file is now much cleaner at ~15 lines,
focusing on orchestrating the generator workflow by calling the
extracted functions. This separation of concerns improves:

- **Maintainability**: Each file has a single responsibility
- **Testability**: Individual functions can be tested in isolation
- **Readability**: Easier to understand what each part does
- **Reusability**: Functions can be potentially reused by other
generators
2025-06-10 16:57:46 +01:00
Isaac Mann 8bfa9f90de docs(core): enterprise webinar section (#31527)
Create WebinarSection component for enterprise docs
2025-06-10 10:35:15 -04:00
Benjamin Cabanes 8767f0d9ec docs(nx-dev): consolidate enterprise menus (#31517)
Replaced the "Enterprise" drop-down menu with a direct link to the Enterprise page for simpler navigation. Updated mobile menus to integrate enterprise items alongside solutions.
2025-06-10 14:08:57 +00:00
Jack Hsu 719c5f55fb docs(core): update Nx installation steps to prefer global installs (#31513)
This PR makes the global install more prominent. This is important for
non-JS workspaces since they may not have node or npm available. The
installation flow should be:

1. Install Nx (e.g. `brew install nx`)
2. Run `nx init` in your project

The `create-nx-workspace` is removed since it's already mentioned on the
intro page, and it is covered in tutorials. It is also not technically
an "install" command.

Preview:
https://nx-dev-git-docs-update-installation-nrwl.vercel.app/getting-started/installation

**Note:** The cross-platform NPM install is still featured first because
it'll work for everyone. It shouldn't be a concern for non-JS devs since
other tools like Claude Code also has `npm install --global` as their
install step.
2025-06-10 09:34:10 -04:00
Jason Jean 92d9d13da4 Experimental TaskHashPlanInspector (#27809)
## Current Behavior
<!-- This is the behavior we have today -->

There is no easy way to inspect the hash plan for a task.

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

There is a `TaskHashPlanInspector` which can be used to provide details
about the hash plan for a task.

## Example Usage

```js
const { createProjectGraphAsync } = require('@nx/devkit');
const { HashPlanInspector } = require('nx/src/hasher/hash-plan-inspector');

(async () => {
  const graph = await createProjectGraphAsync();
  const hashPlanInspector = new HashPlanInspector(graph);
  await hashPlanInspector.init();
  const target = {
    project: 'nx',
    target: 'build-native',
  };
  console.log(
    JSON.stringify(hashPlanInspector.inspectTask(target), null, 2)
  );
})();
```

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

Fixes #

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
2025-06-10 07:39:59 -04:00
Colum Ferry 61eb47f0d3 fix(js): enhance TypeScript transformer loading to support function-based plugins (#31443)
## Current Behavior

TypeScript transformer loading in the js package was limited to standard
Nx/TypeScript transformer plugins and didnt handle different exports

## Expected Behavior

TypeScript transformer loading should support various function-based
transformer formats in a generic way

## Related Issue(s)

Fixes #31411

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-06-10 12:10:15 +01:00
Jason Jean 55f33c582d chore(repo): update nx to 21.2.0-beta.4 (#31481)
<!-- 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.2.0-beta.1`

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

This repo uses Nx `21.2.0-beta.4`

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

Fixes #

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
2025-06-10 11:09:43 +02:00
Jason Jean c8ff3394e6 fix(core): remove log_error function and standardize logging (#31515)
## Current Behavior

The codebase has separate `logError` and `logDebug` functions in the
native logging infrastructure, with both error and debug logging paths.

## Expected Behavior

Consolidate logging to use a single standardized approach. Error
messages are now logged through the debug channel for consistency.

## Related Issue(s)

This change standardizes the logging interface by removing the separate
error logging function and routing all log messages through the debug
logger.
2025-06-09 22:22:19 +00:00
Isaac Mann 445338c496 docs(core): add polygraph webinar (#31511)
Adds the Polygraph webinar
Adds a link to the Bitovi webinar recording
2025-06-09 19:08:09 +00:00
Jordan 2ac98045e6 docs(core): add zephyr cloud to partners page (#31472)
<!-- 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
PR Adds Zephyr Cloud to Partners Page

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

Fixes #
2025-06-09 14:51:46 -04:00
Jason Jean 022789202e chore(repo): fix publish workflow (#31510)
## Current Behavior

The publish workflow was failing because the preinstall script was
exiting with code 1 when detecting an older Node.js version, causing the
entire publishing process to fail.

## Expected Behavior  

The preinstall script should warn about Node.js version requirements but
not exit with an error code during publishing, allowing the workflow to
continue.

## Related Issue(s)

This fixes a critical issue preventing package publishing due to Node.js
version check failures in CI environments.

The fix changes:
- `console.error()` to `console.warn()` for better log categorization
- Removes `process.exit(1)` to prevent workflow termination  
- Adds the actual Node.js version to the warning message for better
debugging

This ensures the publish workflow can complete successfully while still
providing visibility into Node.js version mismatches.
2025-06-09 14:39:06 -04:00
Benjamin Cabanes 51bddad10f docs(nx-dev): update analytics event identifier (#31506)
Update event identifier for newsletter subscription clicks in Solutions' hero components.
2025-06-09 12:30:52 -04:00
Jason Jean 35f54044ca fix(core): default to 'run' target when only project is specified (#31452)
## Current Behavior

When running `nx run <project>` without specifying a target, the command
always fails with an error message "Both project and target have to be
specified", even if the project has a "run" target defined.

## Expected Behavior

When running `nx run <project>` without specifying a target, the command
should check if the project has a "run" target defined. If it does, use
it as the default target. This improves developer experience by allowing
simpler commands like `nx run myapp` instead of `nx run myapp:run`.

## Related Issue(s)

This change improves the developer experience for projects that have a
"run" target defined, making the CLI more intuitive.

## Changes Made

- Modified `packages/nx/src/command-line/run/run-one.ts` to check for a
"run" target when no target is specified
- Added comprehensive test coverage in `e2e/nx/src/run.test.ts` to
verify:
- Projects with a "run" target default to it when no target is specified
- Projects without a "run" target still show the original error message
- Maintains full backward compatibility

## Testing

- All existing tests pass
- Added new e2e tests to verify the behavior
- Ran full validation suite (`nx prepush`) successfully
2025-06-09 12:13:47 -04:00
Leosvel Pérez Espinosa c49b941ad0 cleanup(js): fix outdated test snapshots (#31507)
Update some outdated test snapshots.
2025-06-09 16:01:31 +00:00
Nicholas Cunningham a5544e371b feat(repo): migrate to pnpm 10 (#31427)
- Added .pnpmrc for pnpm 10 configuration, enabling peer dependencies
and lifecycle scripts.
- Updated package.json to reflect pnpm version change to 10.11.1 and
added onlyBuiltDependencies.
- Update pipelines to reflect pnpm version update to 10.11.1

## Upgrading your pnpm version
Now to upgrade your `pnpm` version you can run `pnpm
migrate-to-pnpm-version 10`. Which would upgrade your `pnpm` and it will
run the upgrade script.

Later on if you want to upgrade to pnpm v11 you can run `pnpm
migrate-to-pnpm-version 11`.
Additionally, if you just want to upgrade to the version that is inside
of `package.json` you would run
`pnpm migrate-to-pnpm-version` without passing in a major version.
2025-06-09 10:29:16 -04:00
Allen Ngorora 4fa95c21c7 docs(module-federation): update creating-a-remote.md (#30462)
Without explicitly specifying the --name option nx adds the full
workspace name ie @workspace/remote-app of which that fails the name
validation

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

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

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

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

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

Fixes #

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-06-09 15:17:24 +01:00
Jason Jean 62bd2f8f0a chore(testing): disable flaky e2e test (#31504)
<!-- 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 test is flaky.

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

This test is disabled and should be investigated to see why it is flaky.

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

Fixes #
2025-06-09 13:48:38 +00:00
Jason Jean 25dc8b64ae fix(core): add conditional compilation for WASM build compatibility (#31491)
## Current Behavior

The `pnpm build:wasm` command fails with compilation errors due to
missing dependencies and system-dependent features being included in
WASM builds.

## Expected Behavior

WASM builds should compile successfully by excluding features that
require system access (IPC, terminals, file locking, etc.) while
maintaining these features for native builds.

## Related Issue(s)

Fixes WASM build compatibility issues

## Changes Made

### Core Changes
- Added conditional compilation flags (`#[cfg(not(target_arch =
"wasm32"))]`) to IDE console modules
- Made `socket_path` module conditional for non-WASM targets only
- Fixed unused import warnings for WASM builds in `file_lock.rs` and
`walker.rs`

### Generated File Updates  
- Updated TypeScript definitions and JavaScript bindings to reflect
conditional compilation
- WASM builds now exclude system-dependent features like terminal UI and
database connections

### Technical Details
The IDE console functionality depends on:
- `interprocess` crate for IPC communication
- `jsonrpsee` crate for JSON-RPC messaging  
- Terminal and file system features not available in WASM

These features are now properly isolated for native targets only while
maintaining full functionality for standard Node.js builds.

## Testing
-  `pnpm build:wasm` now passes successfully
-  Generated bindings properly exclude WASM-incompatible features
-  Native builds retain all existing functionality
2025-06-09 13:43:22 +00:00
Leosvel Pérez Espinosa e68d884d63 fix(core): handle external node without default version when generating a pnpm pruned lockfile (#31503)
## Current Behavior

When generating a pruned pnpm lockfile, if there's no external node with
a default version for a given package and the dependency specification
for the package includes a Semver range specifier, an error is thrown.

## Expected Behavior

When generating a pruned pnpm lockfile, the parser should correctly
handle the scenario where there's no external node with a default
version for a given package, and the dependency specification for the
package includes a Semver range specifier.

## Related Issue(s)

Fixes #28627
2025-06-09 09:31:33 -04:00
Torin f1c090b640 fix(linter): update allowed ESLint config file extensions (#30127)
ESLint added experimental support for typescript config files since
[9.9.0](https://eslint.org/blog/2024/08/eslint-v9.9.0-released/#experimental-typescript-configuration-files),
and as of
[9.18.0](https://eslint.org/blog/2025/01/eslint-v9.18.0-released/#stable-typescript-configuration-file-support)
that support is stable. This PR add ts/mts/cts to the list of known
eslint config files, and adds the same extensions to config file
generators

## Current Behavior
When using the eslint executor with a ts file, returns error "When using
the new Flat Config with ESLint, all configs must be named
eslint.config.js or eslint.config.cjs and .eslintrc files may not be
used. See
https://eslint.org/docs/latest/use/configure/configuration-files"

When using the eslint plugin, the inferred task is not created for
projects that do not have a non-ts eslint config.

### Workarounds
- Compiling ts rules/configs in a project. Introduces other issues
- Using jiti or comparable
- For plugin users, having a fake eslint.config.js at the root allows
the inferred task to be created. ESLint will still use the ts config.
  - Cache targets are wrong
  - Complications in non-monorepo workspaces

## Expected Behavior
When using the eslint executor with a ts file, no error is thrown.

When using the eslint plugin with a ts file, the inferred task is
created.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
No issues, but addresses [this
discussion](https://github.com/nrwl/nx/discussions/29710#discussion-7856165)

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-06-09 09:29:19 -04:00
Colum Ferry f9c427a80b fix(webpack): handle package.json exports field for non-buildable libs (#31444)
Current Behavior
The webpack and rspack plugins for handling non-buildable libraries
don't properly process the exports field in package.json. They
incorrectly assume libraries have only a single entry point, typically
through a barrel file (index.ts).

When a library defines multiple export paths using the exports field
(e.g., "./*": "./src/*.ts"), the plugins fail to generate the correct
allowlist patterns for webpack externals. This causes build failures
when trying to use non-buildable libraries that expose multiple entry
points without barrel files.

Expected Behavior
The webpack and rspack plugins should properly parse the exports field
from package.json and generate appropriate allowlist patterns for all
exported subpaths. This includes:

Handling wildcard patterns ("./*": "./src/*.ts")
Processing conditional exports (import/require/development)
Supporting exact subpath exports ("./utils": "./src/utils.ts")
Escaping special characters in package names for regex patterns
Gracefully falling back to reading package.json directly when metadata
is unavailable

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-09 13:58:57 +01:00
Matthias Stemmler 659149d87c fix(bundling): do not normalize tsconfig path for Windows with rollup (#30567)
## Current Behavior
Rollup build fails on Windows with errors like this:
```
[plugin rpt2] error TS6059: File '/foo/bar/baz.ts' is not under 'rootDir' 'C:/foo/bar'. 'rootDir' is expected to contain all source files.
```

This is because since
https://github.com/nrwl/nx/commit/81fe7bb278826ece0bec9ff794fa5b1ef5c0c295
the `tsconfig` path passed to `rollup-plugin-typescript2` is built using
`joinPathFragments`, which removes the drive letter on Windows.

## Expected Behavior
Rollup build should not fail.
2025-06-09 11:31:20 +01:00
Jacob S 5f7d46354e fix(react): allow for buildTargetWebpack to have an executor of @nx/webpack:webpack or @nx/rspack:rspack (#30253)
closed #30235

## Current Behavior
nxComponentTestingPreset for webpack cannot use rspack as an executor.

## Expected Behavior
nxComponentTestingPreset for webpack can use webpack or rspack as an
executor.

## Related Issue(s)
#30235

Fixes #30235
2025-06-09 11:15:33 +01:00
dpnolte 438457ab12 fix(rspack): must run type check with @nx/rspack:rspack when skipTypeChecking is false (#31027)
<!-- 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
- Create a project that uses @nx/rspack:rspack as build target with
SkipTypeChecking set to false.
- Run build target for project.
- Type check has not been run and will not bail in case of any
typescript errors

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

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
- It should run type checking as documented:
https://nx.dev/nx-api/rspack/executors/rspack#skiptypechecking
I looked at the webpack executor and there it also runs the type check
based on `skipTypeChecking` and not the `typeCheck` alias. So I've
adjusted it accordingly for the rspack executor.

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

Fixes #31026

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-06-09 11:08:01 +01:00
Rui Lima b38f966707 fix(node): esbuild breaks and does not cleanup (#30469)
<!-- 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 -->
esbuild breaks on function checks and improperly handles dangling
promises, preventing the program to exit successfully.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The program should exit properly and no zombie processes kept running.

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

Fixes #
2025-06-09 10:50:57 +01:00
Paul Bohm c9021b0e39 fix(vite): NxReporter compatible with Vitest ≥0.29 (#31425)
<!-- 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(vite): must begin with lowercase` -->

## Current Behavior
Running `nx test … --reporter=verbose` (or any additional Vitest
reporter) on
projects that use **Vitest ≥ 0.29** hangs indefinitely at the end of the
run.
`vitest` itself finishes, but the Nx task-runner never receives the
*done*
signal because **`NxReporter` only implements the legacy
`onFinished()` hook**.  
When multiple reporters are configured, Vitest now emits
`onTestRunEnd()` instead of `onFinished()`, so the promise in
`NxReporter`
remains unresolved and the worker process stays alive forever.

## Expected Behavior
`nx test` (and affected `nx run-many --target=test`) exits cleanly on
**all**
Vitest versions, regardless of how many reporters are passed.

* `NxReporter` resolves its internal promise via **either**
  `onTestRunEnd` (Vitest ≥ 0.29) **or** `onFinished` (Vitest ≤ 0.28).
* No functional change in watch-mode.
* No extra timers or fallbacks – just one shared helper.

## Implementation Notes
* Added `onTestRunEnd` method that delegates to a private
`_handleFinished`.
* Re-implemented `onFinished` as a thin delegate to the same helper.
* Original error-detection logic is untouched.

## Related Issue(s)
Closes nrwl/nx#<insert-issue-number-if/when-one-exists>

Co-authored-by: Paul Bohm <{{GITHUB_NOREPLY_EMAIL}}>
2025-06-09 10:50:04 +01:00
Petr Plenkov ddaf77b109 feat(bundling): use tsconfig.lib.json for rollup.config.ts (#30453)
## Current Behavior

Currently when we're using `rollup.config.ts` rollup is picking up wrong
tsconfig. Because of this not everything works as expected:

- `You are using one of Typescript's compiler options 'declaration',
'declarationMap' or 'composite'. In this case 'outDir' or
'declarationDir' must be specified to generate declaration files.` error
appears , because lib tsconfig.json doesn't have outputDir at all
- even if we add outDir to `tsconfig.base.json` we'll have another error
`[!] (plugin typescript) RollupError: [plugin typescript]
@rollup/plugin-typescript TS6377: Cannot write file
'/workspaces/abapify-docs/dist/tsconfig.tsbuildinfo' because it will
overwrite '.tsbuildinfo' file generated by referenced project
'/workspaces/abapify-docs/packages/abap-to-markdown'`
This happens becase it tries to write all tsbuildinfo files into a root
dist folder.

## Expected Behavior
Using rollup.config.ts should just work in a similar way as js|cjs|mjs
config work.

## Solution

According to docs:

> This option supports the same syntax as the
[--plugin](https://rollupjs.org/command-line-interface/#p-plugin-plugin-plugin)
option i.e., you can specify the option multiple times, you can omit the
@rollup/plugin- prefix and just write typescript and you can specify
plugin options via ={...}.

So it means we can use something like this:
```
rollup -c rollup.config.ts --configPlugin typescript={tsconfig:\'tsconfig.lib.json\'}
```

## Related Issue(s)
Solution is taken from this issue::
https://github.com/rollup/plugins/issues/1713#issuecomment-2201138846
2025-06-09 10:41:49 +01:00
Leosvel Pérez Espinosa 73e2c506bb docs(angular): update tutorial and docs with angular v20 changes (#31356)
Updates the Angular Monorepo tutorials to reflect the changes in Angular
v20.
2025-06-09 10:27:53 +02:00
Leosvel Pérez Espinosa 2d33862c43 feat(angular): update angular eslint packages to v20 (#31489)
## Current Behavior

The Angular ESLint packages are installed with a v20 beta version.

## Expected Behavior

The Angular ESLint packages should be installed with the stable v20
version.
2025-06-06 23:16:30 +00:00
Jason Jean 635dd06368 fix(core): remove tabs from local workspace plugins section in nx report (#31490)
## Current Behavior

The `nx report` command uses tab characters for indenting local
workspace plugins in its output, which creates inconsistent formatting
compared to other sections like 'Registered Plugins' and 'Community
plugins'.

## Expected Behavior

Local workspace plugins should be formatted consistently with other
plugin sections in the report output, without tab indentation.

## Related Issue(s)

This is a minor formatting improvement for better consistency in the nx
report output. No specific issue was filed for this change.
2025-06-06 18:40:44 -04:00
Leosvel Pérez Espinosa 8941362d1a fix(core): scope typescript resolution cache correctly when processing the graph (#31455)
## Current Behavior

When using Node.js subpath imports with the same name in different
projects, the Nx graph incorrectly picks up seemingly random
dependencies between projects that shouldn't exist.

This happens because the result of the resolution performed with
TypeScript is cached using the import path as the cache key. The problem
with that is that multiple projects can have the same subpath import
name pointing to internal files of the project, so when the resolution
is made for the first project (say `project1`), the result will be
cached and incorrectly reused for other projects with the same subpath
import name. So, all projects with the same subpath import name would
resolve the dependency to the first project (`project1`).

The same could happen to projects with TS path mappings defined in the
project's tsconfig file. These TS path mappings would only apply to the
project internally and therefore, other unrelated projects could also
define them with the same name pointing to different files.

## Expected Behavior

The Node.js subpath imports should be handled correctly. The TypeScript
resolution result should be cached safely and scoped to the project from
which the import is being done.

## Related Issue(s)

Fixes #31223
2025-06-06 13:18:08 -04:00
Jason Jean 77ff63f356 feat(misc): enhance IDE integration with Nx Console auto-installation and improved logging (#31462)
## Current Behavior

Currently, IDE integration setup requires manual configuration and lacks
streamlined auto-installation capabilities for Nx Console. The logging
system also needs improvement for better developer experience.

## Expected Behavior

With these changes, the IDE integration provides:
- Prompt for automatic Nx Console installation with user preferences
- Enhanced native logger with proper formatting and levels
- Better development documentation for IDE setup
- Updated documentation links to use the new format

## Related Issue(s)

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

This PR implements IDE integration improvements including Nx Console
auto-installation and enhanced logging capabilities.
2025-06-06 17:15:50 +00:00
Leosvel Pérez Espinosa 6613dd29ea fix(linter): infer lint tasks with inputs using {workspaceRoot} to support nested projects (#31488)
## Current Behavior

When running the `lint` task on a project that contains nested projects,
the task runs over all the files, including the ones inside the nested
projects, but the task cache status is not affected by changes to the
files in nested projects. This only happens when the inputs are defined
with `{projectRoot}/...` (what the `@nx/eslint/plugin` infers). The
`{projectRoot}` token scopes the files inside the project without files
in other nested projects. While the `{workspaceRoot}` token would
include every file and wouldn't scope them to any particular project.

## Expected Behavior

The `@nx/eslint/plugin` should infer `lint` tasks with their inputs
using the `{workspaceRoot}` token to support nested projects. This would
be more aligned with what the tool itself does, which runs over all the
files inside the project root regardless of them being inside nested Nx
projects.

Additionally, the difference in behavior between `{workspaceRoot}` and
`{projectRoot}` should be documented.

## Related Issue(s)

Fixes #31264
2025-06-06 12:52:15 -04:00
Colum Ferry e73a1411a0 feat(storybook)!: support storybook 9 (#31172)
## Current Behavior
We currently do not have support for Storybook 9, nor any migrations to
help users switch to it.


## Expected Behavior
Support Storybook 9 and add a migration for users to switch to v9

BREAKING CHANGE: Remove deprecated generators:
`@nx/storybook:cypress-project`,
`@nx/react-native:storybook-configuration`, `@nx/react-native:stories`,
`@nx/react-native:component-story`
2025-06-06 12:51:47 -04:00
Jonathan Cammisuli 9c366d39c4 chore(core): fix editor detection tests when running in cursor (#31478)
<!-- 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 tests in the Cursor terminal fails. 

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running tests in the Cursor terminal should pass. 

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

Fixes #
2025-06-06 12:03:43 -04:00
Paweł Tymczuk c5146d1b5f fix(release): changelog filtering logic for the project commits (#31449) 2025-06-06 19:25:54 +04:00
Leosvel Pérez Espinosa 601fecdf0c feat(angular): support angular v20 (#31369)
Add support for Angular v20.

BREAKING CHANGE: Support for Angular v17 was dropped.

### TODO

- [x] Update Angular packages to the stable v20
- [x] Update `jest-preset-angular` when it releases support for Angular
v20
  - [x] PR: https://github.com/thymikee/jest-preset-angular/pull/3119
- [x] Release:
https://github.com/thymikee/jest-preset-angular/releases/tag/v14.6.0
- [ ] Update Angular ESLint packages to the v20 stable version once
released
  - [ ] PR: https://github.com/angular-eslint/angular-eslint/pull/2448
- [x] Update AnalogJS packages when they are released with support for
Angular v20
  - [x] PR: https://github.com/analogjs/analog/pull/1751
- [x] Release: https://github.com/analogjs/analog/releases/tag/v1.17.0
- [x] Fix for `@analogjs/vitest-angular` peer deps:
https://github.com/analogjs/analog/pull/1754
    - [x] Release:
- [x] Beta:
https://github.com/analogjs/analog/releases/tag/v1.17.1-beta.1
- [x] Stable: https://github.com/analogjs/analog/releases/tag/v1.17.1
- [ ] Update Storybook packages
- [x] PRs: https://github.com/storybookjs/storybook/pull/31602 and
https://github.com/storybookjs/storybook/pull/31611
- [x] Storybook 9 Release:
https://github.com/storybookjs/storybook/releases/tag/v9.0.3
  - [ ] Storybook 8 Release??: PENDING
- [ ] Remaining issue:
https://github.com/storybookjs/storybook/issues/31652
2025-06-06 10:55:26 -04:00
Jason Jean 66c4dae6b6 fix: add .ts extension to nx-release script reference in project.json (#31483)
<!-- 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 -->

Node 24 is more strict for module resolution and was not able to resolve
this path.

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

Node 24 is now able to resolve this path.

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

Fixes #
2025-06-06 09:33:00 -04:00
Miguel fa9290abf4 fix(release): sort groups topologically bottom-up and fix typo to allow multi-level group dependencies (#31374) 2025-06-06 13:05:13 +04:00
Jason Jean c43d2f2d62 feat(repo): add ndcunningham to Claude workflow authorized users (#31479)
## Current Behavior

Currently, ndcunningham is not included in the list of authorized users
who can trigger the Claude AI assistant in GitHub workflows.

## Expected Behavior

With this change, ndcunningham will be able to trigger the Claude AI
assistant by mentioning @claude in GitHub issue comments, PR comments,
and PR reviews.

## Related Issue(s)

This change adds ndcunningham to the authorized user list for the Claude
workflow, enabling them to use the AI assistant for development tasks.
2025-06-05 17:24:26 -04:00
Nadav Shatz 1afe6acabe fix(rspack): Add missing return for rspack composoable plugin (#31372)
This was broken in https://github.com/nrwl/nx/pull/29691

it's missing this return.
2025-06-05 15:04:39 -06:00
Nicholas Cunningham ce9ff9220a fix(core): Update macos pipelines configuration (#31476)
This PR updates the CI workflow in `.github/workflows/ci.yml` to improve
the setup and management of iOS simulators.
The change includes
- Enhanced error handling
- Better diagnostics 
- Configurations for M-series Macs.

This change is similar to what we in `.github/workflows/e2e-matrix.yml`
so the result should be consistent across workflows.
2025-06-05 14:24:03 -06:00
Nicholas Cunningham ae89efb8d1 fix(nextjs): add extension alias support for handling ESM libs (#31323)
<!-- 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 try to import a ESM lib after you generate a Next.js
application it fails to build due to how the module exports `export *
from './lib/lib8446520.js';`.

This has been addressed with webpack and needs to be extended to
Next.js.

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

You should work out of the box and you should be able to import a lib
defined like: `export * from './lib/lib8446520.js';.`

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
This is also related to our webpack and rspack packages. Changes have
also been made to them to ensure consistency across bundlers.

Fixes #30714
2025-06-05 13:54:29 -06:00
Jack Hsu 5c405fa72f docs(misc): add missing angular-rspack and angular-rsbuild API docs and add missing redirects (#31473)
This PR fixes some 404s in the production nx.dev docs.

These were picked up by the script provided here:
https://linear.app/nxdev/issue/NXC-2628/create-a-test-for-verifying-the-redirect-rules

```
https://nx.dev/nx-api → Status: 404
https://nx.dev/nx-api/azure-cache/documents/overview → Status: 404
https://nx.dev/nx-api/owners/documents/overview → Status: 404
https://nx.dev/nx-api/gcs-cache/documents/overview → Status: 404
https://nx.dev/nx-api/s3-cache/documents/overview → Status: 404
https://nx.dev/nx-api/shared-fs-cache/documents/overview → Status: 404
https://nx.dev/nx-api/angular-rspack/documents/create-config → Status: 404
https://nx.dev/nx-api/angular-rspack/documents/create-server → Status: 404
https://nx.dev/nx-api/angular-rsbuild/documents/create-config → Status: 404
https://nx.dev/nx-api/angular-rsbuild/documents/create-server → Status: 404
https://nx.dev/nx-api/angular-rspack/documents → Status: 404
https://nx.dev/nx-api/angular-rsbuild/documents → Status: 404
https://nx.dev/nx-api/angular-rspack/executors → Status: 404
https://nx.dev/nx-api/angular-rsbuild/executors → Status: 404
https://nx.dev/nx-api/angular-rspack → Status: 404
https://nx.dev/nx-api/angular-rsbuild → Status: 404
https://nx.dev/nx-api/angular-rspack/migrations → Status: 404
https://nx.dev/nx-api/angular-rsbuild/migrations → Status: 404
https://nx.dev/nx-api/angular-rspack/generators → Status: 404
https://nx.dev/nx-api/angular-rsbuild/generators → Status: 404
```

**Changes:**
- The `/nx-api` goes to `/plugin-registry` since the intend is to list
out plugins.
- Remote Cache and Owners do not have overview API doc since this is now
a proper overview page (e.g. `/reference/core-api/azure-cache/overview`
NOT `/reference/core-api/azure-cache/api/documents/overview`
- Angular Rspack and Rsbuild had missing API docs that did not get
ported
2025-06-05 14:16:53 -04:00
Leosvel Pérez Espinosa 93234039c9 fix(core): use ts-node option from tsconfig files when creating transpiler (#31469)
## Current Behavior

When creating a `ts-node` transpiler, only `compilerOptions` are
provided. Because we instruct `ts-node` to skip reading the tsconfig
(this was previously done to avoid some edge cases), other options in
the tsconfig files are lost (e.g. `ts-node` specific options).

This was previously reported at https://github.com/nrwl/nx/issues/21695
and fixed by https://github.com/nrwl/nx/pull/21723, but a rework at a
later point caused a regression.

## Expected Behavior

When creating a `ts-node` transpiler, we should provide
`compilerOptions` and the `ts-node` options.
2025-06-05 14:04:36 -04:00
Nicholas Cunningham 6fe9d297e2 feat(repo): add golden list of projects to our Nightly CI (#31414)
This pull request introduces several updates to the CI/CD workflows and
matrix configuration files.

The aim is to highlight critical Nx failures contained in each project
for maintainers to address.

### Changes
- Improvements to workflow caching.
- Improvements to macOS simulator handling.
- Updates to Slack notifications.
- Update matrix data processing for golden projects. 
- Support for Windows has been temporarily disabled due to build issues.
2025-06-05 14:03:42 -04:00
James Henry 7a45f53d9a Revert "chore(core): temporarily remove conformance check" (#31471)
Reverts nrwl/nx#31463
2025-06-05 17:06:23 +00:00
Jack Hsu 2f8eb24504 docs(core): add docs for tui options in nx.json (#31459)
This PR adds the missing `tui` property in `nx.json` on this page:
https://nx.dev/reference/nx-json

<img width="884" alt="Screenshot 2025-06-04 at 1 10 04 PM"
src="https://github.com/user-attachments/assets/d7edb8dd-7b1a-4e3e-a738-4eb0dbb1feba"
/>

Preview:
https://nx-dev-git-docs-add-tui-option-nrwl.vercel.app/reference/nx-json
2025-06-05 08:29:57 -04:00
Miroslav Jonaš 9715da7be9 docs(nx-dev): fix the nx cloud version (#31466)
<!-- 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-06-05 13:09:51 +01:00
Colum Ferry bc01bbaca1 fix(angular): optimize ng-packagr-lite watch mode file writing (#31434)
## Current Behavior

In ng-packagr-lite watch mode, all output files are written to disk on
every incremental build regardless of whether their content actually
changed. This causes downstream watchers (like Vite) to see all files as
"changed" and trigger full rebuilds instead of incremental ones.

## Expected Behavior

Only files with changed content should be written to disk during
incremental builds in watch mode. This allows downstream watchers to
properly detect which files actually changed and perform efficient
incremental rebuilds.

## Related Issue(s)

Fixes #31033

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-06-05 11:07:23 +01:00
Altan Stalker 5ffd82ea57 chore(core): temporarily remove conformance check (#31463)
## Current Behavior
Conformance is broken

## Expected Behavior
Conformance is not broken...or just doesn't run so we can't tell it's
broken
2025-06-05 00:04:47 +00:00
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
Jack Hsu 66eaf2fc74 docs(misc): remove /nx-api pages (#31453)
This PR removes the `/nx-api` pages from `nx-dev`. They are already
redirected from `/nx-api` to either `/technologies` or
`/reference/core-api` URLs.

e.g. `/nx-api/nx` goes to `/reference/core-api/nx` and `/nx-api/react`
goes to `/technologies/react/api`

**Changes**:
- Remove old `nx-api.json` from being generated in
`scripts/documentation/generators/generate-manifests.ts` -- this was
used to generate the sitemap
- Remove `pages/nx-api` from Next.js app since we don't need them
- Remove workaround from link checker
`scripts/documentation/internal-link-checker.ts` -- the angular
rspack/rsbuild and other workarounds are gone now that they are proper
docs in `map.json`
- Update Powerpack/Remote Cache reference docs to exclude API documents
(since they are duplicated in the Intro page) --
`nx-dev/models-document/src/lib/mappings.ts`
- All content in `docs` have been updated with new URL structure

**Note:** Redirects are already handled, and Claude Code was used to
verify the updated `docs/` URLs (see report below). The twelve 404s
links were updated by hand.

## Verification Report

https://gist.github.com/jaysoo/c7863fe7e091cb77929d1976165c357a
2025-06-04 16:57:01 -04:00
Benjamin Cabanes 733122bc9d docs(nx-dev): update hero section (#31460)
Update tagline.
2025-06-04 15:48:19 -04:00
Juri Strumpflohner ee7dbf9c3a feat(nx-dev): add rss and atom feeds 2025-06-04 20:40:07 +02:00
Benjamin Cabanes 6fd55300f9 chore(nx-dev): remove references to live webinar banners (#31456)
Commented out `WebinarNotifier` and all instances of the live event banner in hero components across the project.
2025-06-04 12:26:07 -04:00
Rares Matei 207c869e51 docs(nx-cloud): update release notes (#31450)
<!-- 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-06-04 16:27:23 +01:00
Jack Hsu 3320883f1d docs(misc): update broken URL (#31451)
This PR updates fixes a broken URL on
https://nx.dev/concepts/module-federation/nx-module-federation-technical-overview.
2025-06-04 09:05:02 -04:00
Jack Hsu 283ec76966 docs(misc): fix up /plugin-registry URLs a devkit URLs (#31441)
This PR fixes two issues with the docs restructure:

1. `/plugin-registry` was reading from `new-nx-api.json`, which had the
wrong base path for API docs -- it was not using `mapping.ts`
2. `/reference/core-api/devkit/documents` did not statically generate
all URLs -- this required a change specifically to handle legacy devkit
documents
2025-06-03 16:48:06 -04:00
Jordan 60495e4af6 docs(core): add nStudio and LiveLoveApp to partners page (#31396)
<!-- 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
Add LiveLoveApp and nStudio to our partners page

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

Fixes #
2025-06-03 16:44:49 -04:00
Juri Strumpflohner 41387af458 feat(nx-dev): update hero tagline 2025-06-03 22:00:35 +02:00
Chau Tran 49b346b912 docs(nx-cloud): update github vcs docs with fine-grained pat permissions (#31442)
<!-- 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-06-03 13:26:29 -05:00
Caleb Ukle 4f57f01d01 docs(core): move plugin api docs to tech plugin guides (#31402)
# before

plugin api docs where stuck in `api` section which doesn't make sense

# after

move plugin api docs into `guides` section and add redirect for better
discoverability
2025-06-03 13:43:24 -04:00
Jack Hsu 5176f10c23 docs(misc): fix link in blog post (#31438)
The link in the post does not start with `/`, so it is going to
`/blog/blog/...` instead. The `new Terminal UI` URL is going to
`https://nx.dev/blog/blog/nx-21-terminal-ui`.

Fixes: https://nx.dev/blog/nx-generators-ai-integration
2025-06-03 12:18:43 -04:00
Jack Hsu 9be3d20fe3 docs(misc): update installation via Homebrew (#31439)
Now that Nx is merged into
[`homebrew-core`](https://github.com/Homebrew/homebrew-core/pull/225452)
we no longer need to tap to access a non-official formula.

This PR updates our brew install to remove `brew tap nrwl/nx`. It also
mentions Linux for Homebrew since it is supported across different Linux
distros.
2025-06-03 12:08:33 -04:00
Philip Fulcher 79122afb2a docs(core): add changelog entries for 20.x and 21.x (#31322)
This PR backfills the missing changelog entries.

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-06-03 11:39:34 -04:00
Leosvel Pérez Espinosa 77b34bd788 fix(angular): generate correct output for buildable libraries on windows (#31437)
## Current Behavior

The `@nx/angular:ng-packagr-lite` executor is generating a wrong output
on Windows.

## Expected Behavior

The `@nx/angular:ng-packagr-lite` executor should generate the correct
output on Windows.

## Related Issue(s)

Fixes #31436
2025-06-03 17:09:41 +02:00
Colum Ferry 34cf5a243f fix(rspack): ensure nest applications generated correctly #31204 (#31424)
- fix(rspack): choosing nest as framework should not result in error
#31204
- fix(rspack): add deprecation message for application generator
- fix(rspack): ensure application generated projects are added to
excludes

## Current Behavior
Running the `@nx/rspack:application` generator with `--framework=nest`
results in an error due to mix of inferred and executor usage throughout
the generation process.

## Expected Behavior
Running the generator should pass without failure and create a working
project.
Deprecate the generator in favour of using project specific packages
(@nx/react etc)

## Related Issue(s)

Fixes #31204

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-06-03 13:41:17 +00:00
Leosvel Pérez Espinosa d3faf53c56 fix(core): print installation logs when installing latest version during nx migrate and using --verbose (#31432)
## Current Behavior

By default, `nx migrate` installs the latest version of `nx` in a
temporary directory to run the migration process. When this installation
fails, no helpful information is printed even when running with
`--verbose`; it only prints a generic message that the package manager
install process failed. This doesn't help when debugging/troubleshooting
issues with the installation.

## Expected Behavior

When installing the latest version of `nx` during `nx migrate` fails,
the installation logs should be printed when running with `--verbose`.

## Related Issue(s)

Fixes #
2025-06-03 08:15:15 -04:00
Leosvel Pérez Espinosa cb930d006a fix(core): ensure nx init implementation for angular correctly resolves @angular/core (#31430)
## Current Behavior

When running `nx init` in an Angular CLI repo located in a directory
that has an ancestor directory with an Nx installation, it silently
exits when trying to determine the compatibility of the Angular version.
The migration is not performed, and no feedback is given to the user.
This happens because the current implementation will determine that
ancestor directory (outside the workspace root) as the workspace root
(when starting the migration, there's no `nx` in the repo).

## Expected Behavior

Running `nx init` should work correctly, and proper feedback should be
printed to the user if it can't determine the compatibility of the
Angular version. It should correctly resolve the `@angular/core` package
from the Angular CLI workspace root.

## Related Issue(s)

Fixes #31291
2025-06-03 12:55:29 +02:00
Colum Ferry b97ee099c8 fix(vite): resolve project-specific tsconfig before workspace fallback (#31423)
## Current Behavior

The Nx Vite TsConfig paths plugin incorrectly resolves to workspace root
tsconfig files instead of project-specific ones, causing path aliases
like `@/contexts` to fail resolution.

## Expected Behavior

The plugin should check for project-specific tsconfig files
(`tsconfig.app.json`, `tsconfig.lib.json`, `tsconfig.json`) before
falling back to workspace root configurations.

## Related Issue(s)

Fixes #28945

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-06-03 10:27:44 +01:00
laney 88c51965e6 fix(core): update getTouchedProjectsFromLockFile to handle deleted/moved projects correctly (#31361) 2025-06-02 17:41:13 -04:00
Jason Jean fc99ded082 fix(core): implement missing --print flag for nx graph command (#31406)
## Current Behavior

The `nx graph --print` flag is documented and shows in CLI help, but
when used, it opens the graph UI in a browser instead of printing the
dependency graph to the console.

## Expected Behavior

With this PR, `nx graph --print` correctly prints the dependency graph
JSON to stdout in the terminal and exits, matching the documented
behavior and CLI help description.

## Related Issue(s)

Fixes #30255

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
2025-06-02 21:18:51 +00:00
Jack Hsu 7990930cd0 docs(misc): set up redirect rules for recipes and fix broken nx-api redirects (#31426)
The Algolia sitemap notified on some 404s, so this PR addresses those
that were either not handled or handled improperly.

Two fixes:
- Add missing redirects for `/recipes` that have changed
- Update `/nx-api` redirects to account for sub-paths like
`/tecnologies/react/next`

The crawler results for 404 is at:
https://dashboard.algolia.com/apps/PCTGM1JTQL/crawler/crawler/867fee54-cdee-47cc-893d-297cb8edb0ff/monitoring/list?status=SKIPPED&reason=http_not_found&readable=HTTP%20Not%20Found%20%28404%29

---

Finding the redirects and validating them on canary.nx.dev were both
done with AI assistance. The verification script is attached here:
https://linear.app/nxdev/issue/NXC-2628/create-a-test-for-verifying-the-redirect-rules
2025-06-02 16:39:26 -04:00
Nicholas Cunningham d87f4c2d23 fix(remix): update setup-tailwind generator to correct import statements (#30599)
<!-- 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 are two issues when we generate a remix application with ts
solutions:

1. Running the `setup-tailwind` generator with a reference project which
now is commonly with the pattern `@nx/acme` throws an error based on the
schema.
```
Property 'project' does not match the schema.'@nx/acme' should match the pattern '^[a-zA-Z].*$'.
```
2. The `tailwind.css` inside of `root.tsx` causes error with Vite.
```
app/root.tsx (9:7): "default" is not exported by "app/tailwind.css", imported by "app/root.tsx".
```




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

The remix project should be able to be referenced similarly to how we
handle React.
The tailwind import should not throw an error.

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

Fixes #30343
2025-06-02 12:52:43 -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
Nicholas Cunningham 80aeb92664 fix(vite): add ajv dependency for non-pnpm package managers (#31413)
This PR updates your `package.json` to add `ajv` as a devDependency to
ensure the correct version is hoisted during module resolution.

For non-pnpm package managers notably (yarn and npm) the hosited version
is outdated and it spawns errors when vite is generating types via
`vite-plugin-dts`.
```shell
 - packages/vite-parent-lib9113241/vite.config.ts: Error: Cannot find module 'ajv/dist/core'
  Require stack:
  - /private/var/folders/tp/bfmjfn9s0hd59bm9z80j3mgm0000gn/T/nx-e2e--29165-pQZxOyX4J3ot/nx/proj2191858/node_modules/ajv-draft-04/dist/index.js
  - /private/var/folders/tp/bfmjfn9s0hd59bm9z80j3mgm0000gn/T/nx-e2e--29165-pQZxOyX4J3ot/nx/proj2191858/node_modules/@rushstack/node-core-library/lib/JsonSchema.js
  - /private/var/folders/tp/bfmjfn9s0hd59bm9z80j3mgm0000gn/T/nx-e2e--29165-pQZxOyX4J3ot/nx/proj2191858/node_modules/@rushstack/node-core-library/lib/index.js
  - /private/var/folders/tp/bfmjfn9s0hd59bm9z80j3mgm0000gn/T/nx-e2e--29165-pQZxOyX4J3ot/nx/proj2191858/node_modules/@microsoft/api-extractor/lib/api/CompilerState.js
```
Here is an example of the failures: 
-  [NPM + MacOS]
https://staging.nx.app/runs/uaJ1pbWHtK/task/e2e-js%3Ae2e-local
-  [PNPM + Linux]
https://staging.nx.app/runs/WRgY8Z6Jlw/task/e2e-js%3Ae2e-local
-  [NPM + Linux]
https://staging.nx.app/runs/Ght82l5Upa/task/e2e-js%3Ae2e-local
2025-06-02 10:51:56 -06:00
Nicholas Cunningham 8fb63e00ce feat(nest): Update nest version to 11 (#31393)
This PR updates our Nest dependency to version 11.
It also fixes an issue when you generate a Nest app with
`--unitTestRunner=none` it would still generate `.spec` files

closes: #30188
2025-06-02 09:47:01 -06:00
Jason Jean cb4ae8a779 chore(repo): update nx-mcp to v0.1.0 and fix MCP configuration (#31422)
## Current Behavior
<!-- This is the behavior we have today -->

`nx-mcp` fails not being able to resolve `node_modules/nx/*` files.

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

This was fixed in an updated version so this just updates `nx-mcp`

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

Fixes #
2025-06-02 15:40:11 +00:00
Leosvel Pérez Espinosa 2cf519a654 fix(angular): keep extra target metadata when needed in convert-to-rspack generator (#31309)
## Current Behavior

When converting an Angular project to use Rspack with the
`@nx/angular:convert-to-rspack` generator, some target top-level options
can be lost (e.g. custom `dependsOn`, `outputs`, etc.).

## Expected Behavior

When converting an Angular project to use Rspack with the
`@nx/angular:convert-to-rspack` generator, relevant target top-level
options that wouldn't be inferred need to be kept in the converted
project.
2025-06-02 12:58:41 +02:00
Jason Jean f02cc49b06 feat(repo): enhance Claude Code workflow and settings (#31405)
## Current Behavior

The Claude Code setup has basic workflow automation but lacks
comprehensive tooling permissions and detailed guidance for issue
management. The workflow documentation contains redundant sections and
some outdated commands.

## Expected Behavior

With these changes, the Claude Code integration will have:
- Enhanced tool permissions for better CI/CD workflow support
- Comprehensive GitHub CLI commands for efficient multi-issue management
- Clear mandatory requirements for PR template completion
- Streamlined documentation with accurate command references

## Related Issue(s)

This PR builds upon the initial Claude Code setup from #31380 by
refining the workflow configuration and improving the developer
experience.
2025-05-30 21:26:52 -04:00
Jason Jean e4124c1c93 docs(core): improve affected command description to define affected projects (#31404)
<!-- 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 affected` documentation was unclear and did not state what affected
projects actually meant.

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

Adds a clear definition of "affected projects" to the CLI documentation.
Affected projects are projects that have been changed and projects that
depend on the changed projects.

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

Fixes #30712

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2025-05-30 21:25:57 -04:00
Jason Jean 8cec6ceebb chore(repo): setup claude code (#31380)
## Summary

This PR integrates Claude Code AI assistant capabilities into the Nx
repository through GitHub Actions and workspace configuration.

## Changes Made

### 🤖 GitHub Actions Integration
- **Added `.github/workflows/claude.yml`**: GitHub Actions workflow that
triggers Claude Code on:
  - Issue comments containing `@claude`
  - Pull request review comments containing `@claude` 
  - Pull request reviews containing `@claude`
  - New issues with `@claude` in title or body
- Configured appropriate permissions for repository access and PR/issue
management
- See [Claude Code GitHub Actions
documentation](https://docs.anthropic.com/en/docs/claude-code/cli-usage#github-actions)
for usage details

### 📝 Project Documentation & Configuration
- **Added `CLAUDE.md`**: Comprehensive instructions for Claude Code
including:
  - Repository-specific guidance and best practices
  - Essential commands for development workflow
- Testing procedures (individual projects → affected projects → e2e
tests)
  - GitHub issue resolution workflow
  - Pre-push validation requirements
- **Added `.claude/settings.json`**: Claude Code permissions and
environment configuration
- **Added `.mcp.json`**: Model Context Protocol server configuration for
Nx workspace integration

### 🔧 Workspace Setup
- **Updated `package.json`**: Added `nx-mcp` dependency for enhanced
workspace integration
- **Updated `pnpm-lock.yaml`**: Lock file changes for new dependency
- **Updated `.gitignore`**: Added Claude-specific ignore patterns
- **Updated `CODEOWNERS`**: Assigned ownership of Claude-related files
to @FrozenPandaz
- **Updated `CONTRIBUTING.md`**: Enhanced contribution guidelines with
technology stack information

## Benefits

- Enables AI-assisted development and issue resolution through GitHub
- Provides Claude with deep understanding of Nx workspace structure via
MCP
- Establishes clear development workflows and validation procedures
- Maintains security through configured permissions and environment
settings

## Usage

After this PR is merged, team members and contributors can:
1. Comment `@claude` in issues or PRs to get AI assistance
2. Use Claude Code locally with enhanced Nx workspace understanding
3. Follow established workflows for testing and validation

For more information, see the [Claude Code
documentation](https://docs.anthropic.com/en/docs/claude-code).

## Test Plan

- [x] Verify GitHub Actions workflow syntax is valid
- [x] Confirm Claude Code configuration files are properly structured
- [x] Validate new dependency integration
- [x] Test workflow triggers on issue/PR interactions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-30 18:14:11 -04:00
Leosvel Pérez Espinosa 7595d8a5e1 fix(js): write typescript plugin cache files atomically (#31390)
## Current Behavior

The `@nx/js/typescript` plugin writes cache files in a non-atomic
fashion, which can result in corrupted or empty files being written.

## Expected Behavior

The `@nx/js/typescript` plugin should write cache files atomically, and
they should not be corrupt. It should also retry a limited amount
attempts to account for temporary file locks.

## Related Issue(s)

Fixes #30239 
Fixes #31187
2025-05-30 16:41:45 -04:00
Johann Wagner efc9c8d12a fix(rspack): fix issue with optimization options in rspack config (#31337)
## Current Behavior
rspack.config.ts options related to optimizations are removed if the
mode is not "production". This makes the compile fail for all
non-production builds.

## Expected Behavior
If mode isn't set to "production" configuration related to optimization
should be passed through.

## Related Issue(s)
Fixes #31268 #30292
2025-05-30 11:41:13 -06:00
Juri 9400f09603 docs(nx-dev): update pinned posts 2025-05-30 10:40:27 +02:00
Terry e249109615 fix(linter): fix line endings handling in '@nx/eslint:convert-to-flat-config' generator (#31043)
## Current Behavior

When running `nx g @nx/eslint:convert-to-flat-config` on windows, the
ignores path is not handled correctly. After converting, the path will
have the additional `/r`

## Expected Behavior

When running `nx g @nx/eslint:convert-to-flat-config` on windows, the
ignores path should be correct.
2025-05-30 09:45:11 +02:00
Juri Strumpflohner b51676a89a docs(core): restructure guides into technologies sections (#31288)
Updates the docs structure, navigation etc to be easier + better suited
for showing Nx technology support beyond just TS.

**Notes:**

- API (`/nx-api`) tab is removed from the navigation (i.e. menu bar),
but pages still remain for now until we update references in `*.md`
files.
- Redirects are set up `/nx-api` to go to their respect new location
e.g. `/technologies` or `/reference/core-api`
- Old URLs still exist in the sitemap for now, but majority of them will
be redirected -- a follow-up PR can remove them.

**Preview:**
https://nx-dev-git-nx-dev-polyglot-docs-restructure-nrwl.vercel.app/docs

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-05-29 14:55:34 -04:00
Jason Jean d7106f5ede fix(core): handle run-commands targets with no commands (#31364)
<!-- 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 hangs when here is a `run-commands` target with no commands.

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

Nx does not hang when there is a `run-commands` target with no commands.

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

Fixes #31345
2025-05-29 09:48:03 -04: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
Leosvel Pérez Espinosa ab97087f2a feat(angular): update nx init legacy integrated migration for angular to handle angular v17 (#31352)
## Current Behavior

The `nx init` legacy integrated migration for Angular doesn't handle
Angular v17 because it was part of the LTS versions. With the upcoming
Angular v20, that version is no longer part of the LTS, so it needs to
be handled by the legacy migration.

## Expected Behavior

The `nx init` legacy integrated migration for Angular should handle
Angular v17 because it's no longer part of the LTS versions.
2025-05-29 09:47:02 -04:00
Leosvel Pérez Espinosa fc0aeb5a4b fix(angular): update tsconfig files generation to better support angular v20 (#31357)
- Remove TS project reference to non-existent `tsconfig.editor.json`
file
- Ensure the `tsconfig.spec.json` file for Jest has the correct
`module`/`moduleResolution` compiler options
2025-05-29 14:33:19 +02:00
Leosvel Pérez Espinosa e0ea5be3f6 docs(angular): add angular 20 to the nx and angular compatibility version docs (#31342)
Adds the upcoming Angular v20 version to the Nx and Angular
compatibility version docs.
2025-05-29 14:20:25 +02:00
MaxKless 788ae147e5 docs(nx-dev): new blog post about building an MCP server with Nx (#31370)
Co-authored-by: Juri <juri.strumpflohner@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-29 05:07:10 -07:00
Jack Hsu c8a6ffb6ab docs(misc): fix issue with GA events during local development (#31376)
This PR fixes an issue when you serve nx-dev locally and navigate
between pages in the browser. You'll get an error that `gtag` is not
defined since we never loaded it. We now check that we're in production
environment before sending events.
2025-05-28 09:33:26 -04:00
Juri Strumpflohner d74c39e9be docs(nx-dev): add blog post about TUI integration with LLM (#31373)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-28 13:00:13 +00:00
Juri Strumpflohner 4fb362a5ac fix(nx-dev): only track analytics in prod envs (#31367)
Refactors the tracking scripts on the nx website and only runs them in
prod environments
2025-05-28 08:12:50 -04:00
James Henry 9ab5d820ab fix(core): infer codex environment and use default tasks runner (#31359) 2025-05-28 14:12:17 +02:00
Leosvel Pérez Espinosa c7a9c71c07 fix(linter): handle ng-package.json file with no lib.entryFile in @nx/enforce-module-boundaries rule (#31360)
## Current Behavior

When an `ng-package.json` file of an Angular library secondary entry
point does not specify `lib.entryFile`, the
`@nx/enforce-module-boundaries` rule throws an error. The
`ng-package.json` file of an Angular secondary entry point can be as
simple as `{}`, but it would cause the rule to throw an error.

## Expected Behavior

The `@nx/enforce-module-boundaries` rule should correctly handle an
`ng-package.json` file of an Angular library secondary entry point that
does not specify `lib.entryFile`. The property should [default to
`src/public_api.ts`](https://github.com/ng-packagr/ng-packagr/blob/22a7ba1979f117a12901dca195187948c1fd022d/src/ng-entrypoint.schema.json#L20).

Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2025-05-28 09:45:32 +02:00
Victor Savkin 2572455c9c docs(nx-dev): more blog post tweaks 2025-05-27 21:53:52 -04:00
Victor Savkin c5e7f0253e chore(repo): fix formatting 2025-05-27 17:38:16 -04:00
Victor Savkin fac38b7971 docs(nx-dev): small tweaks to the post 2025-05-27 17:33:34 -04:00
Juri Strumpflohner 3e3402bad5 docs(nx-dev): practical guide for AI and coding (#31362)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-27 16:01:25 -04:00
Brandon Roberts 187b1ee76f fix(vite): bump @analogjs/vite-plugin-angular to 1.16.x (#31317)
## Current Behavior

AnalogJS installs 1.14.1 for Vitest support

## Expected Behavior

AnalogJS installs 1.16.1 for Vitest support

Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2025-05-27 17:27:11 +02:00
Miroslav Jonaš a71a6cab40 fix(core): fix broken nx-cloud url shortening logic (#31283)
Current URL shortening logic is based on the old Nx Cloud version format
- `YYMM.DD.BuildVersion`.

Since, 2025 we changed that format to `YYYY.MM.BuildVersion` which
breaks this logic and causes the connection URL to be just host.

## 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-27 12:01: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 4a94841916 fix(gradle): add migration script to check gradle plugin version (#31304)
<!-- 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 migrate @nx/gradle to latest, we don't check the
dev.nx.gradle.project-graph version in build file

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
we should check the project-praph in the build file and make sure it is
correct version

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

Fixes #
2025-05-26 13:59:28 -04: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
Jack Hsu cb25df1c98 chore(repo): update to 21.2 (#31340)
Update to the latest beta that includes Angular v20 support.
2025-05-26 13:18:03 -04:00
Nicholas Cunningham 5abcc662fa fix(core): generate workspace file readme typo (#31341)
Fixes typo in ReadMe file

closes: #31335
2025-05-26 16:21:03 +00: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
Nicholas Cunningham 07baaafb43 fix(react): routing option to library generator (#31328)
<!-- 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 we try to generate a library with react it fails because `name` is
required.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
This should work out of the box.
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #30721
2025-05-26 08:14:00 -04:00
Juri ac226ef62b docs(nx-dev): fix issue on landing page and wording update 2025-05-26 10:04:36 +02:00
Benjamin Cabanes 3ea50eb0e7 docs(nx-dev): adjust Popover.Panel max-width in small screens (#31331)
Updated the `max-w` property to use `max-w-xl` by default and `xl:max-w-2xl` for larger screens.
2025-05-25 11:27:37 -04:00
Jonathan Cammisuli e2b3acaa37 fix(core): do not hide task list with run-many if there is only 1 task (#31324) 2025-05-24 01:28:00 +00:00
Caleb Ukle 85d4136811 docs(nx-cloud): improve info on setting access tokens in various CI providers (#31261)
## Current Behavior

talking about access tokens info is sparse in our docs

## Expected Behavior

more robust docs for setting up access tokens in CI

---------

Co-authored-by: Isaac Mann <isaacplmann@users.noreply.github.com>
Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-23 21:37:54 +00:00
Emily Xiong e01a18dee9 fix(gradle): change run and bootRun to cacheable false (#31287)
<!-- 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, all tasks are cacheable

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
run and bootRun should not be cacheable

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

Fixes #
2025-05-23 17:25:02 -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
Juri Strumpflohner 873f2d8046 feat(nx-dev): AI landing page (#31310)
adds a new AI landing page at `/ai`
2025-05-23 10:52:51 -04:00
Benjamin Cabanes 9fd51ed659 docs(nx-dev): update headings on solutions (#31316)
Revised the heading text from "Hear from developers like you" to "Don't just take our word for it".
2025-05-23 08:48:24 -04:00
Benjamin Cabanes 560a53e558 docs(nx-dev): clarify security mention of caching policies (#31312)
Clarified language on cache poisoning protection to emphasize trusted CI branches. Removed redundant content regarding personal access tied to identity providers for simplification.
2025-05-22 21:26:00 -04:00
Nicholas Cunningham 26110a6619 fix(react): add missing dependency when generating a react lib that has testing (#31308)
<!-- 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 we generate a react library with `--unitTestRunner` OOTB
it will fail when you run the `test` command because of a missing
dependency.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Generating a library with `--unitTestRunner` and then running that test
should work by default.

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

Fixes #
2025-05-22 16:53:50 -04:00
Jonathan Cammisuli 781a3ae424 chore(core): fix rust socket_path tests to be OS agnostic (#31298)
<!-- 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 -->
Rust tests did not pass on MacOS

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Rust tests now pass on MacOS

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

Fixes #
2025-05-22 14:39:18 +00:00
Miroslav Jonaš d78782da49 fix(linter): speed up inferred plugin node processing (#31281)
This PR improves the **createNodes** function of eslint's inferred
plugin by making two pragmatic choices:
- reusing the ESLint between config file's runs instead of recreating
the new one every time
- skipping ignored files checks for projects that already have eslint
config file

## Results of benchmarks on customer's repo:

### Without ESLint plugin
- create-project-graph-async - avg. 11739.1326225 -> 11 seconds
### With current ESLint plugin
- create-project-graph-async - avg. 98005.0965135 -> 98 seconds
### With modified ESLint plugin
- create-project-graph-async - avg. 13225.073817  -> 13 seconds
  - (@nx/eslint/plugin:createNodes - 2206.96497, 16.69%)


## 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-22 15:59:25 +02:00
Charlie Croom 3a33d5f54f fix(storybook): improve speed of storybook plugin (#31277)
## Current Behavior
#22953 updated the way that storybook parsing works to always do full TS
tree resolution instead of AST parsing. While this is more accurate,
it's orders of magnitude slower...creating a bottleneck in graph
creation for larger repos which use the plugin.

The only reason we need to do this complex functionality is to determine
if we use angular or not.

## Expected Behavior
Graph creation should be quite fast. 

This PR returns the old behavior, and uses the new behavior as an
additive fallback. In most cases this will result in extremely fast
parsing when the framework is defined inline, and in the failure case,
it will result in unnoticeably slower parsing as the incremental
difference is minor.

Before:
```
Time for '@nx/storybook/plugin:createNodes' 13536.203667
```

After:
```
Time for '@nx/storybook/plugin:createNodes' 292.584667
```

An alternative solve (at least in our case) would be to add an option to
skip angular detection...essentially letting people bypass the whole
reason for doing this config parsing. Although that's probably not a
sustainable option.

NOTE: A majority of the remaining slowness in this plugin is spent
hashing the files for the target cache. If we wanted to, we could
further speed this up by making some assumptions there...but that may
drastically harm repos which rely on the fully resolution behavior

## Related Issue(s)
Fixes #31276
2025-05-22 08:22:01 -04:00
Jack Hsu 7e0719cc0a fix(core): handle killing child processes of continuous tasks on Windows (#31296)
This PR fixes an issue where running `nx e2e <proj>` on Windows does not
kill the underlying dev/preview server when the e2e task ends.

Repro:
1. `npx create-nx-workspace@latest repro --preset=react-monorepo
--e2eTestRunner=playwright --appName=demo`
2. `cd repro && npx nx e2e demo-e2e`

This will leave the preview server running on port `4300`, and you have
to `netstat -ano | findstr :4300` to find the PID and kill it.

https://www.loom.com/share/fcbea53cdff543a98f4d4c8377027ee0

## Current Behavior
Continuous task does not kill the process correctly once discrete task
ends.

## Expected Behavior
Processes are killed correctly once task is done running.

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

Fixes #31235
2025-05-21 13:09:30 -04:00
Isaac Mann ca4ad45c84 docs(core): fix bitovi webinar title (#31302)
Fix Bitovi webinar title
2025-05-21 17:00:07 +00: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 1ab77c8a55 fix(module-federation): use runtimeChunk false when not in dev mode (#31256)
## Current Behavior
In #30637 `runtimeChunk: false` was removed to allow HMR for styles.

## Expected Behavior
We need to set runtimeChunk to false or multiple when working with MF.
https://github.com/nrwl/nx/issues/31114#issuecomment-2881996043

## Related Issue(s)

Fixes #31114
2025-05-21 14:34:40 +01: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
Caleb Ukle a52a4356df docs(nx-cloud): add install-aws-cli launch template step usage info (#31255)
## Current Behavior
aws cli usage in Nx Agents is undocumented

## Expected Behavior
aws cli step is documented for Nx Agents
preview:
https://nx-dev-git-docs-add-aws-cli-workflow-step-nrwl.vercel.app/ci/reference/launch-templates#aws-cli-on-nx-agents

---------

Co-authored-by: Nicole Oliver <nicole.oliver.42@gmail.com>
2025-05-20 13:32:54 +00:00
Jason Jean 9228e9f3d1 chore(repo): update nx to 21.1.0-beta.2 (#31262)
<!-- 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.1.0-beta.1`

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

This repo uses Nx `21.1.0-beta.2`

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

Fixes #
2025-05-20 09:32:36 -04:00
Emily Xiong da9d84c62a chore(core): increase verdaccio max_body_size to 20mb (#31260)
<!-- 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 -->
Got error: "413 Payload Too Large - PUT http://localhost:4873/nx -
request entity too large"
<img width="873" alt="Screenshot 2025-05-16 at 4 23 17 PM"
src="https://github.com/user-attachments/assets/fd151405-6f4a-4987-b9cd-63b5dc9cef2f"
/>


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
increase body size to avoid this error

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

Fixes #
2025-05-17 19:12:57 -04:00
Jason Jean fa654c6520 fix(core): prefer vertical layout categorically if there are less tha… (#31221)
…n 75 characters of width

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

Auto layout is always based on an aspect ratio which lead to horizontal
layout even when there is very little horizontal space.

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

Auto layout prefers vertical layout with less than 75 characters of
width which will allow 50 characters (75 * 2/3) for terminal output. It
should be enough to show a URL in most cases:


![image](https://github.com/user-attachments/assets/0804d7ff-02aa-45e1-89f8-bd86b478f88e)

![image](https://github.com/user-attachments/assets/f2f04e3a-c306-4dea-bfca-66052dc28f20)


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

Fixes #
2025-05-17 14:24:13 +00:00
Jason Jean c92b4a3d50 chore(repo): make sure that the ci pipeline runs on any release branches (#31257)
<!-- 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 -->

Pipeline only runs on `master` and PRs

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

Pipeline runs on any release branches and PRs

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

Fixes #
2025-05-16 19:20:56 +00:00
3216 changed files with 119062 additions and 73039 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
[build]
target-dir = 'build/target'
target-dir = 'dist/target'
[target.x86_64-unknown-linux-musl]
rustflags = [
+47
View File
@@ -0,0 +1,47 @@
# Commit Command
## Description
Create a git commit following Nx repository standards and validation requirements.
## Usage
```bash
/commit [message]
```
## What this command does:
1. **Pre-commit validation**: Runs the full validation suite (`pnpm nx prepush`) to ensure code quality
2. **Formatting**: Automatically formats changed files with Prettier
3. **Testing**: Runs tests on affected projects to validate changes
4. **Commit creation**: Creates a well-formed commit with proper message formatting (without co-author attribution)
5. **Status reporting**: Provides clear feedback on the commit process
## Workflow:
1. Format any modified files with Prettier
2. Run the prepush validation suite
3. If validation passes, stage relevant changes
4. Create commit with descriptive message
5. Provide summary of what was committed
## Commit Message Format:
- Use conventional commit format when appropriate
- Include scope (e.g., `feat(core):`, `fix(angular):`, `docs(nx):`)
- Keep first line under 72 characters
- Include detailed description if needed
## Examples:
- `/commit "feat(core): add new project graph visualization"`
- `/commit "fix(react): resolve build issues with webpack config"`
- `/commit "docs(nx): update getting started guide"`
## Validation Requirements:
- All tests must pass
- Code must be properly formatted
- No linting errors
- E2E tests for affected areas should pass
+155
View File
@@ -0,0 +1,155 @@
# GitHub Issue Planning and Resolution
This command provides guidance for both automated and manual GitHub issue workflows.
## Automated Workflow (GitHub Actions)
The automated workflow consists of two phases:
### Phase 1: Planning (`@claude plan` or `claude:plan` label)
- Claude analyzes the issue and creates a detailed implementation plan
- Plan is posted as a comment on the issue
- Issue is labeled with `claude:planned`
### Phase 2: Implementation (`@claude implement` or `claude:implement` label)
- Claude implements the solution based on the plan
- Runs validation tests and creates a feature branch
- Suggests opening a PR with proper formatting
## Planning Phase Template
When creating a plan (either automated or manual), include these sections:
### Problem Analysis
- Root cause identification
- Impact assessment
- Related components or systems affected
### Proposed Solution
- High-level approach
- Alternative solutions considered
- Trade-offs and rationale
### Implementation Details
- Files that need to be modified
- Key changes required
- Dependencies or prerequisites
### Testing Strategy
- Unit tests to add/modify
- Integration tests needed
- E2E test considerations
### Validation Steps
```bash
# Test specific affected projects
nx run-many -t test,build,lint -p PROJECT_NAME
# Test all affected projects
nx affected -t build,test,lint
# Run affected e2e tests
nx affected -t e2e-local
# Format code
npx nx prettier -- FILES
# Final validation
pnpm nx prepush
```
### Risks and Considerations
- Breaking changes
- Performance implications
- Migration requirements
## Manual Workflow
When working on a GitHub issue manually, follow this systematic approach:
## 1. Get Issue Details
```bash
# Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number)
gh issue view ISSUE_NUMBER
```
When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER`
## 2. Analyze the Plan
- Look for a plan or implementation details in the issue description
- Check comments for additional context or clarification
- Identify affected projects and components
## 3. Implement the Solution
- Follow the plan outlined in the issue
- Make focused changes that address the specific problem
- Ensure code follows existing patterns and conventions
## 4. Run Full Validation
```bash
# Test specific affected projects first
nx run-many -t test,build,lint -p PROJECT_NAME
# Test all affected projects
nx affected -t build,test,lint
# Run affected e2e tests
nx affected -t e2e-local
# Final pre-push validation
pnpm nx prepush
```
## 5. Submit Pull Request
- Create a descriptive PR title that references the issue
- Include "Fixes #ISSUE_NUMBER" in the PR description
- Provide a clear summary of changes made
- Request appropriate reviewers
## Pull Request Template
When creating a pull request, follow the template found in `.github/PULL_REQUEST_TEMPLATE.md`. The template includes:
### Required Sections
1. **Current Behavior**: Describe the behavior we have today
2. **Expected Behavior**: Describe the behavior we should expect with the changes in this PR
3. **Related Issue(s)**: Link the issue being fixed so it gets closed when the PR is merged
### Template Format
```markdown
## 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 #ISSUE_NUMBER
```
### Guidelines
- Ensure your commit message follows the conventional commit format (use `pnpm commit`)
- Read the submission guidelines in CONTRIBUTING.md before posting
- For complex changes, you can request a dedicated Nx release by mentioning the Nx team
- Always link the related issue using "Fixes #ISSUE_NUMBER" to automatically close it when merged
+30
View File
@@ -0,0 +1,30 @@
# Claude Issue Workflow Usage Guide
## Quick Start
## Expected Outputs
### Planning Phase
- Detailed analysis comment posted to issue
- Implementation plan with steps and file changes
- Testing strategy and validation steps
- Risk assessment
### Implementation Phase
- Code changes made according to plan
- Tests run and validated
- Feature branch created: `fix/issue-{number}`
- PR suggestion with proper title format
## Manual Override
If you need to work on an issue manually, use the `/gh-issue-plan` command for structured guidance following the same workflow patterns.
## Troubleshooting
- Ensure you're on the authorized users list
- Check that the issue has sufficient detail for analysis
- For implementation, ensure a plan comment exists from the planning phase
- If workflows fail, check the Actions tab for detailed logs
+34
View File
@@ -0,0 +1,34 @@
{
"permissions": {
"allow": [
"Bash(find:*)",
"Bash(ls:*)",
"Bash(mkdir:*)",
"WebFetch(domain:github.com)",
"WebFetch(domain:www.typescriptlang.org)",
"Bash(git log:*)",
"Bash(gh issue list:*)",
"Bash(gh issue view:*)",
"Bash(npx prettier:*)",
"Bash(nx prepush:*)",
"Bash(pnpm commit:*)",
"Bash(rg:*)",
"mcp__nx__nx_docs",
"mcp__nx__nx_workspace",
"mcp__nx__nx_project_details",
"Bash(nx show projects:*)",
"Bash(nx run-many:*)",
"Bash(nx run:*)",
"Bash(nx affected:*)",
"Bash(nx lint:*)",
"Bash(nx test:*)",
"Bash(nx build:*)",
"Bash(nx documentation:*)"
],
"deny": []
},
"enableAllProjectMcpServers": true,
"env": {
"BASH_MAX_TIMEOUT_MS": "1800000"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"mcpServers": {
"nx-mcp": {
"url": "http://localhost:9470/mcp"
}
}
}
+2
View File
@@ -7,3 +7,5 @@
# These are Windows script files and should use crlf
*.bat text eol=crlf
# Exclude files from Graphite reviews
docs/generated/* linguist-generated=true
+144 -13
View File
@@ -4,12 +4,14 @@ on:
push:
branches:
- master
- '[0-9]+.[0-9]+.x'
pull_request:
branches:
- "**"
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
PNPM_HOME: ~/.pnpm
jobs:
main-linux:
@@ -57,13 +59,26 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
version: 10.11.1
run_install: false
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Cache Rust toolchain and cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
@@ -74,6 +89,14 @@ jobs:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- name: Check Documentation
run: pnpm nx documentation
timeout-minutes: 20
@@ -143,10 +166,100 @@ jobs:
- name: Configure Detox Environment, Install applesimutils
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
xcrun simctl shutdown all && xcrun simctl erase all
timeout-minutes: 20
# Ensure Xcode command line tools are installed and configured
xcode-select --print-path || sudo xcode-select --reset
sudo xcode-select -s /Applications/Xcode.app
# Install or update applesimutils with error handling
if ! brew list applesimutils &>/dev/null; then
echo "Installing applesimutils..."
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null || {
echo "Failed to install applesimutils, retrying with update..."
brew update
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils
}
else
echo "Updating applesimutils..."
HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade applesimutils || true
fi
# Verify applesimutils installation
applesimutils --version || (echo "applesimutils installation failed" && exit 1)
# Configure environment for M-series Mac
echo "DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer" >> $GITHUB_ENV
echo "PLATFORM_NAME=iOS Simulator" >> $GITHUB_ENV
# Set additional environment variables for better debugging
echo "DETOX_DISABLE_TELEMETRY=1" >> $GITHUB_ENV
echo "DETOX_LOG_LEVEL=trace" >> $GITHUB_ENV
# Verify Xcode installation
xcodebuild -version
# List available simulators
xcrun simctl list devices available
timeout-minutes: 10
continue-on-error: false
- name: Reset iOS Simulators
id: reset-simulators
run: |
echo "Resetting iOS Simulators..."
# Kill simulator processes
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null || true
killall "Simulator" 2>/dev/null || true
killall "iOS Simulator" 2>/dev/null || true
# Wait for processes to terminate
sleep 3
# Shutdown and erase all simulators (ignore failures)
xcrun simctl shutdown all 2>/dev/null || true
sleep 5
xcrun simctl erase all 2>/dev/null || true
# If erase failed, try the nuclear option
if xcrun simctl list devices | grep -q "Booted" 2>/dev/null; then
echo "Standard reset failed, using nuclear option..."
rm -rf ~/Library/Developer/CoreSimulator/Devices/* 2>/dev/null || true
launchctl remove com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null || true
sleep 3
fi
# Clean up additional directories
rm -rf ~/Library/Developer/CoreSimulator/Caches/* 2>/dev/null || true
rm -rf ~/Library/Logs/CoreSimulator/* 2>/dev/null || true
rm -rf ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null || true
echo "Simulator reset completed"
timeout-minutes: 5
continue-on-error: true
- name: Verify Simulator Reset
if: ${{ steps.reset-simulators.outcome == 'success' }}
run: |
# Verify CoreSimulator service restarted
pgrep -fl "CoreSimulator" || (echo "CoreSimulator service not running" && exit 1)
# Check simulator list is clean
xcrun simctl list devices
# Verify simulator runtime paths exist and are writable
test -d ~/Library/Developer/CoreSimulator/Devices || (echo "Simulator devices directory missing" && exit 1)
touch ~/Library/Developer/CoreSimulator/Devices/test || (echo "Simulator devices directory not writable" && exit 1)
rm ~/Library/Developer/CoreSimulator/Devices/test
timeout-minutes: 5
- name: Diagnose Simulator Reset Failure
if: ${{ steps.reset-simulators.outcome == 'failure' }}
run: |
echo "Simulator reset failed. Collecting diagnostic information..."
xcrun simctl list
echo "Checking simulator logs..."
ls -la ~/Library/Logs/CoreSimulator/ || echo "No simulator logs found"
- name: Save Homebrew Cache
uses: actions/cache@v4
@@ -159,17 +272,35 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
version: 10.11.1
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Cache Rust toolchain and cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set SHAs
uses: nrwl/nx-set-shas@v4
with:
+93
View File
@@ -0,0 +1,93 @@
name: Claude Code
env:
PNPM_HOME: ~/.pnpm
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
contains(fromJson('["AgentEnder", "barbados-clemens", "Cammisuli", "Coly010", "FrozenPandaz", "isaacplmann", "JamesHenry", "jaysoo", "leosvelperez", "mandarini", "MaxKless", "meeroslav", "nartc", "ndcunningham", "philipjfulcher", "vsavkin", "xiongemi"]'), github.actor) &&
((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
actions: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 250
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10.11.1
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
timeout-minutes: 90
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_tools: "Bash,Edit,Read,Write,Glob,Grep,LS,MultiEdit,NotebookRead,NotebookEdit"
+129 -170
View File
@@ -25,7 +25,8 @@ jobs:
os:
- ubuntu-latest
- macos-latest
- windows-latest
# - windows-latest Windows fails to build gradle wrapper which always runs when we build nx.
## https://staging.nx.app/runs/LgD4vxGn8w?utm_source=pull-request&utm_medium=comment
node_version:
- 20
- 22
@@ -36,9 +37,9 @@ jobs:
node_version: 22
# - os: macos-latest
# node_version: 23
- os: windows-latest
node_version: 22
# - os: windows-latest
# - os: windows-latest TODO (emily): Windows fails to build gradle wrapper which always runs when we build nx. Re-enable when we fix this.
# node_version: 22
# - os: windows-latest TODO (emily): Windows fails to build gradle wrapper which always runs when we build nx. Re-enable when we fix this.
# node_version: 23
name: Cache install (${{ matrix.os }}, node v${{ matrix.node_version }})
@@ -52,7 +53,7 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
version: 10.11.1
run_install: false
- name: Set node
@@ -61,13 +62,17 @@ jobs:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'
- name: Cache node_modules
id: cache-modules
- name: Get pnpm store directory
id: pnpm-cache
run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm store
uses: actions/cache@v4
with:
lookup-only: true
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ matrix.node_version }}-${{ hashFiles('pnpm-lock.yaml') }}
path: ${{ steps.pnpm-cache.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Ensure Python setuptools Installed on Macos
if: ${{ matrix.os == 'macos-latest' }}
@@ -75,7 +80,6 @@ jobs:
run: brew install python-setuptools
- name: Install packages
if: steps.cache-modules.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Homebrew cache directory path
@@ -132,7 +136,7 @@ jobs:
permissions:
contents: read
runs-on: ${{ matrix.os }}
timeout-minutes: 70 # <- cap each job to 70 minutes
timeout-minutes: 200 # <- cap each job to 200 minutes
strategy:
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} # Load matrix from previous job
fail-fast: false
@@ -151,7 +155,7 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
version: 10.11.1
run_install: false
- name: Use Node.js ${{ matrix.node_version }}
@@ -220,33 +224,110 @@ jobs:
- name: Configure Detox Environment, Install applesimutils
if: ${{ matrix.os == 'macos-latest' }}
run: |
# Check if applesimutils is already installed
# Ensure Xcode command line tools are installed and configured
xcode-select --print-path || sudo xcode-select --reset
sudo xcode-select -s /Applications/Xcode.app
# Install or update applesimutils with error handling
if ! brew list applesimutils &>/dev/null; then
echo "Installing applesimutils..."
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null || {
echo "Failed to install applesimutils, retrying with update..."
brew update
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils
}
else
echo "applesimutils is already installed, skipping installation"
echo "Updating applesimutils..."
HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade applesimutils || true
fi
# Verify applesimutils installation
applesimutils --version || (echo "applesimutils installation failed" && exit 1)
# Configure environment for M-series Mac
echo "DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer" >> $GITHUB_ENV
echo "PLATFORM_NAME=iOS Simulator" >> $GITHUB_ENV
# Set additional environment variables for better debugging
echo "DETOX_DISABLE_TELEMETRY=1" >> $GITHUB_ENV
echo "DETOX_LOG_LEVEL=trace" >> $GITHUB_ENV
# Verify Xcode installation
xcodebuild -version
timeout-minutes: 10
continue-on-error: false
- name: Reset iOS Simulators
if: ${{ matrix.os == 'macos-latest' }}
id: reset-simulators
run: |
xcrun simctl shutdown all && xcrun simctl erase all
echo "Resetting iOS Simulators..."
# Kill simulator processes
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null || true
killall "Simulator" 2>/dev/null || true
killall "iOS Simulator" 2>/dev/null || true
# Wait for processes to terminate
sleep 3
# Shutdown and erase all simulators (ignore failures)
xcrun simctl shutdown all 2>/dev/null || true
sleep 5
xcrun simctl erase all 2>/dev/null || true
# If erase failed, try the nuclear option
if xcrun simctl list devices | grep -q "Booted" 2>/dev/null; then
echo "Standard reset failed, using nuclear option..."
rm -rf ~/Library/Developer/CoreSimulator/Devices/* 2>/dev/null || true
launchctl remove com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null || true
sleep 3
fi
# Clean up additional directories
rm -rf ~/Library/Developer/CoreSimulator/Caches/* 2>/dev/null || true
rm -rf ~/Library/Logs/CoreSimulator/* 2>/dev/null || true
rm -rf ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null || true
echo "Simulator reset completed"
timeout-minutes: 5
continue-on-error: true
- name: Verify Simulator Reset
if: ${{ matrix.os == 'macos-latest' && steps.reset-simulators.outcome == 'success' }}
run: |
# Verify CoreSimulator service restarted
pgrep -fl "CoreSimulator" || (echo "CoreSimulator service not running" && exit 1)
# Verify simulator runtime paths exist and are writable
test -d ~/Library/Developer/CoreSimulator/Devices || (echo "Simulator devices directory missing" && exit 1)
touch ~/Library/Developer/CoreSimulator/Devices/test || (echo "Simulator devices directory not writable" && exit 1)
rm ~/Library/Developer/CoreSimulator/Devices/test
timeout-minutes: 5
- name: Diagnose Simulator Reset Failure
if: ${{ matrix.os == 'macos-latest' && steps.reset-simulators.outcome == 'failure' }}
run: |
echo "Simulator reset failed. Collecting diagnostic information..."
xcrun simctl list
echo "Checking simulator logs..."
ls -la ~/Library/Logs/CoreSimulator/ || echo "No simulator logs found"
- name: Configure git metadata (needed for lerna smoke tests)
if: ${{ (matrix.os != 'macos-latest') || (matrix.os == 'macos-latest' && steps.reset-simulators.outcome == 'success') }}
run: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- name: Set starting timestamp
if: ${{ (matrix.os != 'macos-latest') || (matrix.os == 'macos-latest' && steps.reset-simulators.outcome == 'success') }}
id: before-e2e
shell: bash
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- name: Run e2e tests with pnpm (Linux/Windows)
id: e2e-run-pnpm
if: ${{ matrix.os != 'macos-latest' }}
@@ -270,7 +351,7 @@ jobs:
- name: Run e2e tests with npm (macOS)
id: e2e-run-npm
if: ${{ matrix.os == 'macos-latest' }}
if: ${{ matrix.os == 'macos-latest' && steps.reset-simulators.outcome == 'success' }}
run: |
# Run the tests
if [[ "${{ matrix.project }}" == "e2e-detox" ]] || [[ "${{ matrix.project }}" == "e2e-react-native" ]] || [[ "${{ matrix.project }}" == "e2e-expo" ]]; then
@@ -328,16 +409,23 @@ jobs:
sudo: ${{ matrix.os != 'windows-latest' }} # disable sudo for windows debugging
process-result:
if: ${{ always() && github.repository_owner == 'nrwl' }}
if: ${{ always() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
needs: e2e
timeout-minutes: 10
outputs:
message: ${{ steps.process-json.outputs.SLACK_MESSAGE }}
proj-duration: ${{ steps.process-json.outputs.SLACK_PROJ_DURATION }}
pm-duration: ${{ steps.process-json.outputs.SLACK_PM_DURATION }}
codeowners: ${{ steps.process-json.outputs.CODEOWNERS }}
message: ${{ steps.process-json.outputs.slack_message }}
proj_duration: ${{ steps.process-json.outputs.slack_proj_duration }}
pm_duration: ${{ steps.process-json.outputs.slack_pm_duration }}
codeowners: ${{ steps.process-json.outputs.codeowners }}
has_golden_failures: ${{ steps.process-json.outputs.has_golden_failures }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Prepare dir for output
run: mkdir -p outputs
@@ -349,145 +437,16 @@ jobs:
- name: Join and stringify matrix configs
id: combine-json
run: |
combined=$((jq -s . outputs/*/matrix.json) | jq tostring)
combined=$(jq -sc . outputs/*/matrix.json)
echo "combined=$combined" >> $GITHUB_OUTPUT
- name: Make slack outputs
- name: Process results with TypeScript script
id: process-json
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ github.token }}
with:
script: |
const combined = JSON.parse(${{ steps.combine-json.outputs.combined }});
const failedProjects = combined.filter(c => c.status === 'failure').sort((a, b) => a.project.localeCompare(b.project));
// codeowners
const codeowners = new Set();
failedProjects.forEach(c => {
codeowners.add(c.codeowners);
});
core.setOutput('CODEOWNERS', Array.from(codeowners).join(','));
function trimSpace(res) {
return res.split('\n').map((l) => l.trim()).join('\n');
}
// failed message
let lastProject;
let result = `
\`\`\`
| Failed project | PM | OS | Node |
|--------------------------------|------|-------|------|`;
failedProjects.forEach(matrix => {
const project = matrix.project !== lastProject ? matrix.project : '...';
result += `\n| ${project.padEnd(30)} | ${matrix.package_manager.padEnd(4)} | ${matrix.os_name} | v${matrix.node_version} |`
lastProject = matrix.project;
});
result += `\`\`\``;
core.setOutput('SLACK_MESSAGE', trimSpace(result));
console.log(trimSpace(result));
function humanizeDuration(num) {
let res = '';
const hours = Math.floor(num / 3600);
if (hours) {
res += `${hours}h `;
}
const mins = Math.floor((num % 3600) / 60);
if (mins) {
res += `${mins}m `;
}
const sec = num % 60;
if (sec) {
res += `${sec}s`
}
return res;
}
// duration message
const timeReport = {};
const pmReport = {
npm: 0,
yarn: 0,
pnpm: 0
};
const macosProjects = ['e2e-detox', 'e2e-expo', 'e2e-react-native'];
combined.forEach((matrix) => {
if (matrix.os_name === 'Linux' && matrix.node_version === 20) {
pmReport[matrix.package_manager] += matrix.duration;
}
if (matrix.os_name === 'Linux' || macosProjects.includes(matrix.project)) {
if (timeReport[matrix.project]) {
if (matrix.duration > timeReport[matrix.project].max) {
timeReport[matrix.project].max = matrix.duration;
timeReport[
matrix.project
].maxEnv = `${matrix.os_name}, ${matrix.package_manager}`;
}
if (matrix.duration < timeReport[matrix.project].min) {
timeReport[matrix.project].min = matrix.duration;
timeReport[
matrix.project
].minEnv = `${matrix.os_name}, ${matrix.package_manager}`;
}
} else {
timeReport[matrix.project] = {
min: matrix.duration,
max: matrix.duration,
minEnv: `${matrix.os_name}, ${matrix.package_manager}`,
maxEnv: `${matrix.os_name}, ${matrix.package_manager}`,
};
}
}
});
// project time report
let resultPkg = `
\`\`\`
| Project | Time |
|--------------------------------|---------------------------|`;
function mapProjectTime(proj, section) {
let res = '';
res += `${humanizeDuration(timeReport[proj][section])}`;
res += ` (${timeReport[proj][section + 'Env']})`
return res;
}
function durationIcon(proj, section) {
if (timeReport[proj][section] < 12 * 60) {
return `${section} ✅`;
}
if (timeReport[proj][section] < 15 * 60) {
return `${section} ❗`;
}
return `${section} ❌`;
}
Object.keys(timeReport).forEach(proj => {
resultPkg += `\n| ${proj.padEnd(30)} | |`;
resultPkg += `\n| ${durationIcon(proj, 'min').padStart(29)} | ${mapProjectTime(proj, 'min').padEnd(25)} |`;
resultPkg += `\n| ${durationIcon(proj, 'max').padStart(29)} | ${mapProjectTime(proj, 'max').padEnd(25)} |`;
});
resultPkg += `\`\`\``;
core.setOutput('SLACK_PROJ_DURATION', trimSpace(resultPkg));
// Print project duration report inline to allow reviewing on manual runs (when no slack message will be sent)
console.log(trimSpace(resultPkg));
let resultPm = `
\`\`\`
| PM | Total time |
|------|-------------|`;
Object.keys(pmReport).forEach(pm => {
resultPm += `\n| ${pm.padEnd(4)} | ${humanizeDuration(pmReport[pm]).padEnd(11)} |`
});
resultPm += `\`\`\``;
core.setOutput('SLACK_PM_DURATION', trimSpace(resultPm));
// Print package manager duration report inline to allow reviewing on manual runs (when no slack message will be sent)
console.log(trimSpace(resultPm));
run: |
echo '${{ steps.combine-json.outputs.combined }}' | npx tsx .github/workflows/nightly/process-result.ts
report-failure:
if: ${{ failure() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
if: ${{ always() && needs.process-result.outputs.has_golden_failures == 'true' && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: process-result
runs-on: ubuntu-latest
name: Report failure
@@ -497,16 +456,16 @@ jobs:
uses: ravsamhq/notify-slack-action@v2
with:
status: 'failure'
message_format: '{emoji} Workflow has {status_message} ${{ needs.process-result.outputs.message }}'
notification_title: '{workflow}'
message_format: '${{ needs.process-result.outputs.message }}'
notification_title: 'Golden Test Failure'
footer: '<{run_url}|View Run> / Last commit <{commit_url}|{commit_sha}>'
mention_groups: ${{ needs.process-result.outputs.codeowners }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
report-success:
if: ${{ success() && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: e2e
if: ${{ always() && needs.process-result.outputs.has_golden_failures == 'false' && github.repository_owner == 'nrwl' && github.event_name != 'workflow_dispatch' }}
needs: process-result
runs-on: ubuntu-latest
name: Report status
timeout-minutes: 10
@@ -514,9 +473,9 @@ jobs:
- name: Send notification
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ needs.e2e.result }}
message_format: '{emoji} Workflow has {status_message}'
notification_title: '{workflow}'
status: 'success'
message_format: '${{ needs.process-result.outputs.message }}'
notification_title: '✅ Golden Tests: All Passed!'
footer: '<{run_url}|View Run> / Last commit <{commit_url}|{commit_sha}>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -532,8 +491,8 @@ jobs:
uses: ravsamhq/notify-slack-action@v2
with:
status: 'skipped'
message_format: '${{ needs.process-result.outputs.pm-duration }}'
notification_title: 'Total duration per package manager (ubuntu only)'
message_format: '${{ needs.process-result.outputs.pm_duration }}'
notification_title: 'Total duration per package manager (ubuntu only)'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -542,13 +501,13 @@ jobs:
needs: process-result
runs-on: ubuntu-latest
timeout-minutes: 10
name: Report duration per package manager
name: Report duration per project
steps:
- name: Send notification
uses: ravsamhq/notify-slack-action@v2
with:
status: 'skipped'
message_format: '${{ needs.process-result.outputs.proj-duration }}'
notification_title: 'E2E Project duration stats'
message_format: '${{ needs.process-result.outputs.proj_duration }}'
notification_title: 'E2E Project duration stats'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 9.8.0
version: 10.11.1
run_install: false
- name: Get pnpm store directory
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 9.8.0
version: 10.11.1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v3
+52 -46
View File
@@ -1,6 +1,7 @@
type MatrixDataProject = {
name: string,
codeowners: string,
is_golden?: boolean, // true if this is a golden project, false otherwise
};
type MatrixDataOS = {
@@ -19,58 +20,62 @@ type MatrixData = {
setup: MatrixDataOS[],
}
// TODO: Extract Slack groups into named groups for easier maintenance
const matrixData: MatrixData = {
coreProjects: [
{ name: 'e2e-lerna-smoke-tests', codeowners: 'S04TNCVEETS' },
{ name: 'e2e-js', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-nx-init', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-nx', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-release', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-workspace-create', codeowners: 'S04SYHYKGNP' }
],
projects: [
{ name: 'e2e-angular', codeowners: 'S04SS457V38' },
{ name: 'e2e-cypress', codeowners: 'S04T16BTJJY' },
{ name: 'e2e-detox', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-esbuild', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-expo', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-gradle', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-jest', codeowners: 'S04T16BTJJY' },
{ name: 'e2e-eslint', codeowners: 'S04SYJGKSCT' },
{ name: 'e2e-next', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-node', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-plugin', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-react', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-react-native', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-web', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-rollup', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-storybook', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-playwright', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-remix', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-rspack', codeowners: 'S04SJ6HHP0X' },
{ name: 'e2e-vite', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-vue', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-nuxt', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-webpack', codeowners: 'S04SJ6PL98X' }
],
nodeTLS: 20,
setup: [
{ os: 'ubuntu-latest', os_name: 'Linux', os_timeout: 60, package_managers: ['npm', 'pnpm', 'yarn'], node_versions: ['20.19.0', "22.12.0"], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] },
{ os: 'macos-latest', os_name: 'MacOS', os_timeout: 90, package_managers: ['npm'], node_versions: ['20.19.0'] },
{ os: 'windows-latest', os_name: 'WinOS', os_timeout: 180, package_managers: ['npm'], node_versions: ['20.19.0'], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] }
]
};
const matrix: Array<{
export type MatrixItem = {
project: string,
codeowners: string,
node_version: number | string,
package_manager: string,
os: string,
os_name: string,
os_timeout: number
}> = [];
os_timeout: number,
is_golden?: boolean,
};
// TODO: Extract Slack groups into named groups for easier maintenance
const matrixData: MatrixData = {
coreProjects: [
{ name: 'e2e-lerna-smoke-tests', codeowners: 'S04TNCVEETS', is_golden: true },
{ name: 'e2e-js', codeowners: 'S04SJ6HHP0X', is_golden: true },
{ name: 'e2e-nx-init', codeowners: 'S04SYHYKGNP', is_golden: true },
{ name: 'e2e-nx', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-release', codeowners: 'S04SYHYKGNP'},
{ name: 'e2e-workspace-create', codeowners: 'S04SYHYKGNP' },
],
projects: [
{ name: 'e2e-cypress', codeowners: 'S04T16BTJJY', is_golden: true },
{ name: 'e2e-detox', codeowners: 'S04TNCNJG5N' , is_golden: true},
{ name: 'e2e-esbuild', codeowners: 'S04SJ6HHP0X' , is_golden: true},
{ name: 'e2e-gradle', codeowners: 'S04TNCNJG5N' , is_golden: true},
{ name: 'e2e-eslint', codeowners: 'S04SYJGKSCT', is_golden: true },
{ name: 'e2e-node', codeowners: 'S04SJ6HHP0X', is_golden: true },
{ name: 'e2e-playwright', codeowners: 'S04SVQ8H0G5', is_golden: true },
{ name: 'e2e-remix', codeowners: 'S04SVQ8H0G5' , is_golden: true},
{ name: 'e2e-rspack', codeowners: 'S04SJ6HHP0X', is_golden: true },
{ name: 'e2e-vite', codeowners: 'S04SJ6PL98X' , is_golden: true},
{ name: 'e2e-vue', codeowners: 'S04SJ6PL98X' , is_golden: true},
{ name: 'e2e-web', codeowners: 'S04SJ6PL98X', is_golden: true },
{ name: 'e2e-webpack', codeowners: 'S04SJ6PL98X', is_golden: true },
{ name: 'e2e-jest', codeowners: 'S04T16BTJJY', is_golden: true },
{ name: 'e2e-angular', codeowners: 'S04SS457V38' },
{ name: 'e2e-expo', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-next', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-plugin', codeowners: 'S04SYHYKGNP' },
{ name: 'e2e-react', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-react-native', codeowners: 'S04TNCNJG5N' },
{ name: 'e2e-rollup', codeowners: 'S04SJ6PL98X' },
{ name: 'e2e-storybook', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-nuxt', codeowners: 'S04SJ6PL98X' }
],
nodeTLS: 20,
setup: [
{ os: 'ubuntu-latest', os_name: 'Linux', os_timeout: 60, package_managers: ['npm', 'pnpm', 'yarn'], node_versions: ['20.19.0', "22.12.0"], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] },
{ os: 'macos-latest', os_name: 'MacOS', os_timeout: 90, package_managers: ['npm'], node_versions: ['20.19.0'] },
// TODO (emily): Fix Windows support as gradle fails when running nx build https://staging.nx.app/runs/LgD4vxGn8w?utm_source=pull-request&utm_medium=comment
// { os: 'windows-latest', os_name: 'WinOS', os_timeout: 180, package_managers: ['npm'], node_versions: ['20.19.0'], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] }
]
};
const matrix: Array<MatrixItem> = [];
function addMatrixCombo(project: MatrixDataProject, nodeVersion: number | string, pm: number, os: number) {
matrix.push({
@@ -81,6 +86,7 @@ function addMatrixCombo(project: MatrixDataProject, nodeVersion: number | string
os: matrixData.setup[os].os,
os_name: matrixData.setup[os].os_name,
os_timeout: matrixData.setup[os].os_timeout,
is_golden: !!project.is_golden, // Mark golden projects as true, others as false
});
}
+197
View File
@@ -0,0 +1,197 @@
import * as fs from 'fs';
import { MatrixItem } from './process-matrix';
interface MatrixResult extends MatrixItem {
status: 'success' | 'failure' | 'cancelled';
duration: number;
}
interface ProcessedResults {
codeowners: string;
slack_message: string;
slack_proj_duration: string;
slack_pm_duration: string;
has_golden_failures: string;
}
function trimSpace(res: string): string {
return res.split('\n').map((l) => l.trim()).join('\n');
}
function humanizeDuration(num: number): string {
let res = '';
const hours = Math.floor(num / 3600);
if (hours) res += `${hours}h `;
const mins = Math.floor((num % 3600) / 60);
if (mins) res += `${mins}m `;
const sec = num % 60;
if (sec) res += `${sec}s`;
return res;
}
function processResults(combined: MatrixResult[]): ProcessedResults {
const failedProjects = combined.filter(c => c.status === 'failure' || c.status === 'cancelled').sort((a, b) => a.project.localeCompare(b.project));
const failedGoldenProjects = failedProjects.filter(c => c.is_golden);
const hasGoldenFailures = failedGoldenProjects.length > 0;
const codeowners = new Set<string>();
failedGoldenProjects.forEach(c => codeowners.add(c.codeowners));
let result = '';
const allGoldenProjects = combined.filter(c => c.is_golden);
const uniqueGoldenProjects = new Set(allGoldenProjects.map(c => c.project));
const uniqueFailedGoldenProjects = new Set(failedGoldenProjects.map(c => c.project));
const goldenPassingCount = uniqueGoldenProjects.size - uniqueFailedGoldenProjects.size;
const goldenFailingCount = uniqueFailedGoldenProjects.size;
const allOtherProjects = combined.filter(c => !c.is_golden);
const uniqueOtherProjects = new Set(allOtherProjects.map(c => c.project));
const failedRegularProjects = failedProjects.filter(c => !c.is_golden);
const uniqueFailedOtherProjects = new Set(failedRegularProjects.map(c => c.project));
const otherPassingCount = uniqueOtherProjects.size - uniqueFailedOtherProjects.size;
const otherFailingCount = uniqueFailedOtherProjects.size;
result += `\n🌟 *Golden Projects*`;
result += `\n✅ Passing: ${goldenPassingCount}`;
result += `\n❌ Failing: ${goldenFailingCount}`;
if (failedGoldenProjects.length > 0) {
result += `\n\n🚨 *Failed Golden Projects*\n\`\`\``;
result += `\n| Failed project |`;
result += `\n|--------------------------------|`;
let lastProject: string | undefined;
failedGoldenProjects.forEach(matrix => {
const project = matrix.project !== lastProject ? matrix.project : '';
if (project) {
result += `\n| ${project.padEnd(30)} |`;
lastProject = matrix.project;
}
});
result += `\n\`\`\``;
}
result += `\n\n🔧 *Other Projects*`;
result += `\n✅ Passing: ${otherPassingCount}`;
result += `\n❌ Failing: ${otherFailingCount}`;
// Failed Other Projects Table (if any)
if (failedRegularProjects.length > 0) {
result += `\n\n⚠️ *Failed Other Projects*\n\`\`\``;
result += `\n| Failed project |`;
result += `\n|--------------------------------|`;
let lastProject: string | undefined;
failedRegularProjects.forEach(matrix => {
const project = matrix.project !== lastProject ? matrix.project : '';
if (project) {
result += `\n| ${project.padEnd(30)} |`;
lastProject = matrix.project;
}
});
result += `\n\`\`\``;
}
if (failedProjects.length === 0) {
result = '🎉 *No test failures detected!* All systems green! 🟢';
}
const timeReport: Record<string, { min: number; max: number; minEnv: string; maxEnv: string }> = {};
const pmReport = { npm: 0, yarn: 0, pnpm: 0 };
const macosProjects = ['e2e-detox', 'e2e-expo', 'e2e-react-native'];
combined.forEach(matrix => {
const nodeVersion = parseInt(matrix.node_version.toString());
if (matrix.os_name === 'Linux' && nodeVersion === 20 && matrix.package_manager in pmReport) {
pmReport[matrix.package_manager as keyof typeof pmReport] += matrix.duration;
}
if (matrix.os_name === 'Linux' || macosProjects.includes(matrix.project)) {
if (timeReport[matrix.project]) {
if (matrix.duration > timeReport[matrix.project].max) {
timeReport[matrix.project].max = matrix.duration;
timeReport[matrix.project].maxEnv = `${matrix.os_name}, ${matrix.package_manager}`;
}
if (matrix.duration < timeReport[matrix.project].min) {
timeReport[matrix.project].min = matrix.duration;
timeReport[matrix.project].minEnv = `${matrix.os_name}, ${matrix.package_manager}`;
}
} else {
timeReport[matrix.project] = {
min: matrix.duration,
max: matrix.duration,
minEnv: `${matrix.os_name}, ${matrix.package_manager}`,
maxEnv: `${matrix.os_name}, ${matrix.package_manager}`,
};
}
}
});
let resultPkg = `
\`\`\`
| Project | Time |
|--------------------------------|---------------------------|`;
function mapProjectTime(proj: string, section: 'min' | 'max'): string {
return `${humanizeDuration(timeReport[proj][section])} (${timeReport[proj][`${section}Env`]})`;
}
function durationIcon(proj: string, section: 'min' | 'max'): string {
const duration = timeReport[proj][section];
if (duration < 12 * 60) return `${section}`;
if (duration < 15 * 60) return `${section}`;
return `${section}`;
}
Object.keys(timeReport).forEach(proj => {
resultPkg += `\n| ${proj.padEnd(30)} | |`;
resultPkg += `\n| ${durationIcon(proj, 'min').padStart(29)} | ${mapProjectTime(proj, 'min').padEnd(25)} |`;
resultPkg += `\n| ${durationIcon(proj, 'max').padStart(29)} | ${mapProjectTime(proj, 'max').padEnd(25)} |`;
});
resultPkg += `\`\`\``;
let resultPm = `
\`\`\`
| PM | Total time |
|------|-------------|`;
Object.keys(pmReport).forEach(pm => {
resultPm += `\n| ${pm.padEnd(4)} | ${humanizeDuration(pmReport[pm as keyof typeof pmReport]).padEnd(11)} |`;
});
resultPm += `\`\`\``;
return {
codeowners: Array.from(codeowners).join(','),
slack_message: trimSpace(result),
slack_proj_duration: trimSpace(resultPkg),
slack_pm_duration: trimSpace(resultPm),
has_golden_failures: hasGoldenFailures.toString(),
};
}
function setOutput(key: string, value: string) {
const outputPath = process.env.GITHUB_OUTPUT;
if (!outputPath) {
console.warn(`GITHUB_OUTPUT not set. Skipping output for "${key}".`);
return;
}
if (value.includes('\n')) {
const delimiter = `EOF_${key}_${Date.now()}`;
fs.appendFileSync(outputPath, `${key}<<${delimiter}\n${value}\n${delimiter}\n`);
} else {
fs.appendFileSync(outputPath, `${key}=${value}\n`);
}
}
try {
const combinedInput = process.argv[2]
? process.argv[2]
: fs.readFileSync(0, 'utf-8').trim();
const combined: MatrixResult[] = JSON.parse(combinedInput);
const results = processResults(combined);
Object.entries(results).forEach(([key, value]) => {
setOutput(key, value);
});
} catch (error) {
console.error('Error processing results:', error);
process.exit(1);
}
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 9.8.0 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
version: 10.11.1 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
- name: Run a security audit
run: pnpm dlx audit-ci --critical --report-type summary
+93 -32
View File
@@ -21,8 +21,8 @@ env:
DEBUG: napi:*
NX_RUN_GROUP: ${{ github.run_id }}-${{ github.run_attempt }}
CYPRESS_INSTALL_BINARY: 0
NODE_VERSION: 20.19.0
PNPM_VERSION: 9.8.0 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
NODE_VERSION: 22.16.0
PNPM_VERSION: 10.11.1 # Aligned with root package.json (pnpm/action-setup will helpfully error if out of sync)
jobs:
# We first need to determine the version we are releasing, and if we need a custom repo or ref to use for the git checkout in subsequent steps.
@@ -140,23 +140,50 @@ jobs:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add aarch64-unknown-linux-gnu &&
build: |
set -e
apt-get update
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs=22.16.0-1nodesource1
export PATH="/usr/local/bin:$PATH"
node --version
npm --version
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
pnpm install --frozen-lockfile
rustup target add x86_64-unknown-linux-gnu
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add x86_64-unknown-linux-musl &&
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
build: |
bash -c "
set -e
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
apk add --no-cache curl xz
curl -fsSL https://unofficial-builds.nodejs.org/download/release/v22.16.0/node-v22.16.0-linux-x64-musl.tar.xz -o node.tar.xz
tar -xJf node.tar.xz
mv node-v22.16.0-linux-x64-musl /usr/local/node
export PATH=\"/usr/local/node/bin:\$PATH\"
echo Node: \$(node -v)
echo NPM: \$(npm -v)
# Install PNPM
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
# Install deps and run native build
pnpm install --frozen-lockfile
rustup target add x86_64-unknown-linux-musl
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
"
- host: macos-13
target: aarch64-apple-darwin
setup: |-
@@ -171,12 +198,22 @@ jobs:
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
rustup target add aarch64-unknown-linux-gnu &&
build: |
set -e
apt-get update
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs=22.16.0-1nodesource1
export PATH="/usr/local/bin:$PATH"
node --version
npm --version
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
pnpm install --frozen-lockfile
rustup target add aarch64-unknown-linux-gnu
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
@@ -198,19 +235,36 @@ jobs:
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
npm i -g pnpm@9.8.0 --force &&
pnpm --version &&
pnpm install --frozen-lockfile &&
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
build: |
bash -c "
set -e
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
apk add --no-cache curl xz
curl -fsSL https://unofficial-builds.nodejs.org/download/release/v22.16.0/node-v22.16.0-linux-x64-musl.tar.xz -o node.tar.xz
tar -xJf node.tar.xz
mv node-v22.16.0-linux-x64-musl /usr/local/node
export PATH=\"/usr/local/node/bin:\$PATH\"
echo Node: \$(node -v)
echo NPM: \$(npm -v)
# Install PNPM
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version
# Install deps and run native build
pnpm install --frozen-lockfile
rustup target add aarch64-unknown-linux-musl
pnpm nx run-many --verbose --target=build-native -- --target=aarch64-unknown-linux-musl
"
- host: windows-latest
target: aarch64-pc-windows-msvc
setup: |-
rustup target add aarch64-pc-windows-msvc
build: pnpm nx run-many --target=build-native -- --target=aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
name: stable - ${{ matrix.settings.target }} - node@22.16.0
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
@@ -296,6 +350,7 @@ jobs:
path: |
packages/**/*.node
packages/**/*.wasm
!packages/*/node_modules/**
if-no-files-found: error
build-freebsd:
@@ -318,17 +373,18 @@ jobs:
RUSTUP_IO_THREADS: 1
NX_PREFER_TS_NODE: true
PLAYWRIGHT_BROWSERS_PATH: 0
NODE_VERSION: 22.16.0
with:
operating_system: freebsd
version: '14.0'
architecture: x86-64
environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH
environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH NODE_VERSION
shell: bash
run: |
env
whoami
sudo pkg install -y -f node libnghttp2 www/npm git
sudo npm install --location=global --ignore-scripts pnpm@9.8.0
sudo npm install --location=global --ignore-scripts pnpm@10.11.1
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
source "$HOME/.cargo/env"
@@ -343,8 +399,11 @@ jobs:
whoami
env
freebsd-version
echo "Installing dependencies"
pnpm install --frozen-lockfile --ignore-scripts
echo "Building FreeBSD bindings"
pnpm nx run-many --verbose --outputStyle stream --target=build-native -- --target=x86_64-unknown-freebsd
echo "Cleaning up"
pnpm nx reset
rm -rf node_modules
rm -rf dist
@@ -356,7 +415,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bindings-freebsd
path: packages/**/*.node
path: |
packages/**/*.node
!packages/*/node_modules/**
if-no-files-found: error
publish:
+35 -2
View File
@@ -2,7 +2,6 @@ node_modules
/.idea
/.fleet
/.vscode
/.cursor
dist
/build
/coverage
@@ -36,6 +35,7 @@ CHANGELOG.md
.next
out
# Angular Cache
.angular
@@ -73,5 +73,38 @@ storybook-static
.gradle
.kotlin
.claude/settings.local.json
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
.cursor/mcp.json
.github/instructions/nx.instructions.md
# Added by Claude Task Master
# Logs
logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
dev-debug.log
# Dependency directories
node_modules/
# Environment variables
.env
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.specstory/**
.cursorindexingignore
# OS specific
# Task files
tasks.json
tasks/
# Upstream docs local configuration (machine-specific)
.upstreamdocs.local.json
+9
View File
@@ -0,0 +1,9 @@
{
"mcpServers": {
"nx": {
"command": "pnpm",
"args": ["nx-mcp"],
"env": {}
}
}
}
+13
View File
@@ -0,0 +1,13 @@
# Enable pre/post-install which are disabled by default. Installing peer deps which is also disabled by default
auto-install-peers=true
enable-pre-post-scripts=true
# Enable lifecycle scripts for specific packages that require them (like post-install)
enable-scripts=@napi-rs/canvas,sharp,@swc/core,@swc/cli,@swc-node/register,esbuild
# Compatibility
strict-peer-dependencies=false
lockfile-version-strict=false
# Consistency across environments
use-node-version=20.19.0
+3
View File
@@ -51,3 +51,6 @@ CODEOWNERS
/.nx/workflows/dynamic-changesets.yaml
_files
_solution
# this file uses TS import attributes which the current prettier version does not support
tools/documentation/create-embeddings/src/main.mts
+10
View File
@@ -0,0 +1,10 @@
{
"include": ["apps/**/*", "libs/**/*", "packages/**/*"],
"exclude": [
"**/*.spec.*",
"**/test/**/*",
"**/__tests__/**/*",
"**/*.test.*",
"node_modules/**/*"
]
}
+1 -1
View File
@@ -5,7 +5,7 @@ auth:
htpasswd:
file: ./htpasswd
max_body_size: 15mb
max_body_size: 20mb
# a list of other known repositories we can talk to
uplinks:
+184
View File
@@ -0,0 +1,184 @@
When responding to queries about this repository:
1. Use the `nx_workspace` mcp tool for understanding the workspace architecture when appropriate
2. When working in projects, use the `nx_project` mcp tool to analyze and understand the specific project structure and
dependencies
3. Suggest relevant commands from the "Essential Commands" section when applicable
4. Highlight Nx's focus on monorepos and its key features like smart task execution, code generation, and project graph
analysis
5. Mention the plugin ecosystem and support for various frameworks when relevant
6. Emphasize the importance of running the full validation suite before committing changes
Always strive to provide accurate, helpful responses that align with the best practices and workflows described in this
file.
## GitHub Issue Response Mode
When responding to GitHub issues, determine your approach based on how the request is phrased:
### Plan-First Mode (Default)
Use this approach when users ask you to:
- "analyze", "investigate", "assess", "review", "examine", or "plan"
- Or when the request is ambiguous
In this mode:
1. Provide a detailed analysis of the issue
2. Create a comprehensive implementation plan
3. Break down the solution into clear steps
4. Then please post the plan as a comment on the issue
### Immediate Implementation Mode
Use this approach when users ask you to:
- "fix", "implement", "solve", "build", "create", "update", or "add"
- Or when they explicitly request immediate action
In this mode:
1. Analyze the issue quickly
2. Implement the complete solution immediately
3. Make all necessary code changes. Please make multiple commits so that the changes are easier to review.
4. Run appropriate tests and validation
5. If the tests, are not passing, please fix the issues and continue doing this up to 3 more times until the tests pass
6. Once the tests pass, push a branch and then suggest opening a PR which has a description of the changes made, and
that
it make sure that it explicitly says "Fixes #ISSUE_NUMBER" to automatically close the issue when the PR is merged.
## Avoid making changes to generated files
Files under `generated` directories are generated based on a different source file and should not be modified directly.
Find the underlying source and modify that instead.
## Essential Commands
### Code Formatting
After code changes are made, please make sure to format the files with prettier via `npx prettier -- FILE_NAME`
### Pre-push Validation
```bash
# Full validation suite - run before committing
nx prepush
```
If the prepush validation suite fails, please fix the issues before proceeding with your work. This ensures that all
code adheres to the project's standards and passes all tests. DO NOT make a new commit to fix these issues. Instead,
amend the current commit.
### Testing Changes
After code changes are made, first test the specific project where the changes were made:
```bash
nx run-many -t test,build,lint -p PROJECT_NAME
```
After verifying the individual project, validate that the changes in projects which have been affected:
```bash
# Test only affected projects (recommended for development)
nx affected -t build,test,lint
```
As the last step, run the e2e tests to fully ensure that changes are valid:
```bash
# Run affected e2e tests (recommended for development)
nx affected -t e2e-local
```
## Fixing GitHub Issues
When working on a GitHub issue, follow this systematic approach:
### 1. Get Issue Details
```bash
# Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number)
gh issue view ISSUE_NUMBER
# View multiple issues efficiently in one command
gh issue list --limit 50 --json number,title,state,labels,assignees,updatedAt,body --jq '.[] | select(.number == 123 or .number == 456 or .number == 789)'
# Or filter by specific criteria to get multiple related issues
gh issue list --label "bug" --state "open" --json number,title,body,labels --jq '.[]'
gh issue list --assignee "@me" --json number,title,body,state --jq '.[]'
```
**Tip**: Instead of running `gh issue view` multiple times, use `gh issue list` with JSON output and filtering to gather
information about multiple issues in a single command. This is much more efficient than viewing issues one at a time.
**Always provide clickable links**: When discussing GitHub issues or PRs, always include the full GitHub URL so the user
can easily open them in their browser. For example:
- Issue #12345: https://github.com/nrwl/nx/issues/12345
- PR #67890: https://github.com/nrwl/nx/pull/67890
When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER`
### 2. Analyze the Plan
- Look for a plan or implementation details in the issue description
- Check comments for additional context or clarification
- Identify affected projects and components
### 3. Implement the Solution
- Follow the plan outlined in the issue
- Make focused changes that address the specific problem
- Ensure code follows existing patterns and conventions
### 4. Run Full Validation
Use the testing workflow from the "Essential Commands" section.
### 5. Submit Pull Request
- Create a descriptive PR title that references the issue
- **Always fill in the PR template** - don't leave it empty
- Include "Fixes #ISSUE_NUMBER" in the PR description
- Provide a clear summary of changes made
- Request appropriate reviewers
## Pull Request Template
**IMPORTANT**: When creating a pull request, you MUST fill in the template found in `.github/PULL_REQUEST_TEMPLATE.md`.
Do not leave the template sections empty. The template includes:
### Required Sections
1. **Current Behavior**: Describe the behavior we have today
2. **Expected Behavior**: Describe the behavior we should expect with the changes in this PR
3. **Related Issue(s)**: Link the issue being fixed so it gets closed when the PR is merged
### Template Format
```markdown
## 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 #ISSUE_NUMBER
```
### Guidelines
- Ensure your commit message follows the conventional commit format (use `pnpm commit`)
- Use `fix:`, `feat:`, `chore:`, etc. as appropriate types.
- Scope is **required** for all commits. Possible scopes are listed in `scripts/commitizen.js`.
- Read the submission guidelines in CONTRIBUTING.md before posting
- For complex changes, you can request a dedicated Nx release by mentioning the Nx team
- Always link the related issue using "Fixes #ISSUE_NUMBER" to automatically close it when merged
+5
View File
@@ -191,6 +191,11 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
/.husky/** @nrwl/nx-pipelines-reviewers
/packages/workspace/src/generators/ci-workflow/** @nrwl/nx-pipelines-reviewers
# Claude AI Integration
CLAUDE.md @FrozenPandaz
.claude/** @FrozenPandaz
.mcp.json @FrozenPandaz
# Global Files
project.json @FrozenPandaz @vsavkin
jest.config.ts @nrwl/nx-testing-tools-reviewers @FrozenPandaz
+65 -3
View File
@@ -27,14 +27,25 @@ can [submit a Pull Request](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.
Source code and documentation are included in the top-level folders listed below.
- `docs` - Markdown and configuration files for documentation including tutorials, guides for each supported platform,
and API docs.
- `e2e` - E2E tests.
- `packages` - Source code for Nx packages such as Angular, React, Web, NestJS, Next and others including generators and
executors (or builders).
- `e2e` - E2E tests for the Nx packages
- `graph` - Source code for the Nx Graph application which shows the project graph, task graph, project details, and more in the browser.
- `docs` - Markdown and configuration files for documentation including tutorials, guides for each supported platform,
and API docs.
- `nx-dev` - Source code for the Nx documentation site which displays the markdown in `docs` and more.
- `tools` - Workspace-specific tooling and plugins
- `scripts` - Miscellaneous scripts for project tasks such as building documentation, testing, and code formatting.
- `tmp` - Folder used by e2e tests. If you are a WebStorm user, make sure to mark this folder as excluded.
## Technologies
This repo contains a mix of different technologies, including:
- **Rust**: The core of Nx is written in Rust, which provides performance and safety.
- **TypeScript**: The primary language for Nx packages and the Nx DevKit.
- **Kotlin**: Used for the Gradle and Java plugins.
## Development Workstation Setup
If you are using `VSCode`, and provided you have [Docker](https://docker.com) installed on your machine, then you can leverage [Dev Containers](https://containers.dev) through this [VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), to easily setup your development environment, with everything needed to contribute to Nx, already installed (namely `NodeJS`, `Yarn`, `Rust`, `Cargo`, plus some useful extensions like `Nx Console`).
@@ -374,6 +385,57 @@ To simplify and automate the process of committing with this format,
**Nx is a [Commitizen](https://github.com/commitizen/cz-cli) friendly repository**, just do `git add` and
execute `pnpm commit`.
##### Using the Interactive Commit Tool
Instead of `git commit`, use:
```bash
pnpm commit
```
This will launch an interactive prompt that will:
1. Ask you to select the type of change (feat, fix, docs, cleanup, chore)
2. Let you choose the appropriate scope from the predefined list
3. Guide you through writing a clear, descriptive commit message
4. Ensure your commit follows the conventional commit format
##### Available Commit Types
- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **cleanup**: A code change that neither fixes a bug nor adds a feature
- **chore**: Other changes that don't modify src or test files
##### Available Scopes
The repository includes many predefined scopes. Use the one which is most specific to the changes being committed
- **core**: anything Nx core specific
- **angular**: anything Angular specific
- **react**: anything React specific
- **nextjs**: anything Next specific
- **node**: anything Node specific
- **devkit**: devkit-related changes
- **graph**: anything graph app specific
- **testing**: anything testing specific (e.g. jest or cypress)
- **misc**: misc stuff
- **repo**: anything related to managing the repo itself
- **nx-dev**: anything related to docs infrastructure
For the complete list of available scopes, see `/scripts/commitizen.js`.
##### Example Commits
```bash
feat(core): add new project graph visualization
fix(angular): resolve build issues with standalone components
docs(misc): update contributing guidelines
chore(repo): bump dependencies
cleanup(devkit): refactor utility functions for better readability
```
#### PR releases
If you are working on a particularly complex change or feature addition, you can request a dedicated Nx release for the associated 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.
+17 -17
View File
@@ -1,7 +1,7 @@
<p style="text-align: center;">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
<img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
<img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
</picture>
</p>
@@ -19,9 +19,9 @@
<hr>
# Smart Monorepos · Fast CI
# Smart Repos · Fast Builds
Build system, optimized for monorepos, with AI-powered architectural awareness and advanced CI capabilities.
An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
Create a new Nx workspace with
@@ -35,7 +35,7 @@ npx create-nx-workspace
npx nx init
```
to add Nx to your existing workspace to get faster task scheduling, caching and more. More [in the docs](https://nx.dev/getting-started/intro#try-nx-yourself).
to add Nx to your existing workspace to get faster task scheduling, caching and more. More [in the docs](https://nx.dev/getting-started/intro).
## Learn about CI with Nx Cloud
@@ -58,7 +58,7 @@ Learn more in the [Nx CI docs &raquo;](https://nx.dev/ci/intro?utm_source=nxrepo
- [Our Twitter/X](https://x.com/nxdevtools)
<p style="text-align: center;"><a href="https://www.youtube.com/@nxdevtools/videos" target="_blank" rel="noreferrer"><img src="./images/nx-courses-and-videos.svg"
width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
width="100%" alt="Nx - Smart Repos · Fast Builds"></a></p>
## Want to help?
@@ -82,17 +82,17 @@ help you get started.
| ![James Henry](https://avatars.githubusercontent.com/u/900523?s=160&v=4) | ![Jon Cammisuli](https://avatars2.githubusercontent.com/u/4332460?s=160) | ![Isaac Mann](https://avatars1.githubusercontent.com/u/861504?s=160) | ![Juri Strumpflohner](https://avatars1.githubusercontent.com/u/542458?s=160) |
| [JamesHenry](https://github.com/JamesHenry) | [cammisuli](https://github.com/cammisuli) | [isaacplmann](https://github.com/isaacplmann) | [juristr](https://github.com/juristr) |
| Philip Fulcher | Caleb Ukle | Katerina Skroumpelou | Colum Ferry |
| ------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| ![Philip Fulcher](https://avatars1.githubusercontent.com/u/1536471?s=160) | ![Caleb Ukle](https://avatars.githubusercontent.com/u/23272162?s=160) | ![Katerina Skroumpelou](https://avatars0.githubusercontent.com/u/6603745?s=160) | ![Colum Ferry](https://avatars.githubusercontent.com/u/12140467?s=160) |
| [philipjfulcher](https://github.com/philipjfulcher) | [barbados-clemens](https://github.com/barbados-clemens) | [mandarini](https://github.com/mandarini) | [Coly010](https://github.com/Coly010) |
| Philip Fulcher | Caleb Ukle | Colum Ferry | Emily Xiong |
| ------------------------------------------------------------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| ![Philip Fulcher](https://avatars1.githubusercontent.com/u/1536471?s=160) | ![Caleb Ukle](https://avatars.githubusercontent.com/u/23272162?s=160) | ![Colum Ferry](https://avatars.githubusercontent.com/u/12140467?s=160) | ![Emily Xiong](https://avatars.githubusercontent.com/u/16211801?s=160) |
| [philipjfulcher](https://github.com/philipjfulcher) | [barbados-clemens](https://github.com/barbados-clemens) | [Coly010](https://github.com/Coly010) | [xiongemi](https://github.com/xiongemi) |
| Emily Xiong | Miroslav Jonaš | Leosvel Pérez Espinosa | Zachary DeRose |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| ![Emily Xiong](https://avatars.githubusercontent.com/u/16211801?s=160) | ![Miroslav Jonaš](https://avatars.githubusercontent.com/u/881612?s=160) | ![Leosvel Pérez Espinosa](https://avatars.githubusercontent.com/u/12051310?s=160) | ![Zachary DeRose](https://avatars.githubusercontent.com/u/3788405?s=160) |
| [xiongemi](https://github.com/xiongemi) | [meeroslav](https://github.com/meeroslav) | [leosvelperez](https://github.com/leosvelperez) | [ZackDeRose](https://github.com/ZackDeRose) |
| Miroslav Jonaš | Leosvel Pérez Espinosa | Zachary DeRose | Craigory Coppola |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| ![Miroslav Jonaš](https://avatars.githubusercontent.com/u/881612?s=160) | ![Leosvel Pérez Espinosa](https://avatars.githubusercontent.com/u/12051310?s=160) | ![Zachary DeRose](https://avatars.githubusercontent.com/u/3788405?s=160) | ![Craigory Coppola](https://avatars.githubusercontent.com/u/6933928?s=160) |
| [meeroslav](https://github.com/meeroslav) | [leosvelperez](https://github.com/leosvelperez) | [ZackDeRose](https://github.com/ZackDeRose) | [AgentEnder](https://github.com/AgentEnder) |
| Craigory Coppola | Chau Tran | Nicholas Cunningham | Max Kless |
| -------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| ![Craigory Coppola](https://avatars.githubusercontent.com/u/6933928?s=160) | ![Chau Tran](https://avatars.githubusercontent.com/u/25516557?s=160) | ![Nicholas Cunningham](https://avatars.githubusercontent.com/u/338948?s=160) | ![Max Kless](https://avatars.githubusercontent.com/u/34165455?s=160) |
| [AgentEnder](https://github.com/AgentEnder) | [nartc](https://github.com/nartc) | [ndcunningham](https://github.com/ndcunningham) | [MaxKless](https://github.com/MaxKless) |
| Chau Tran | Nicholas Cunningham | Max Kless |
| -------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| ![Chau Tran](https://avatars.githubusercontent.com/u/25516557?s=160) | ![Nicholas Cunningham](https://avatars.githubusercontent.com/u/338948?s=160) | ![Max Kless](https://avatars.githubusercontent.com/u/34165455?s=160) |
| [nartc](https://github.com/nartc) | [ndcunningham](https://github.com/ndcunningham) | [MaxKless](https://github.com/MaxKless) |
+1 -1
View File
@@ -88,7 +88,7 @@ The documentation website [nx.dev](https://nx.dev) is using custom Markdown synt
Callouts are available to get the attention of the reader on some specific type of information.
```markdown
{% callout type="caution|check|note|warning" title="string" %}
{% callout type="announcement|caution|check|note|warning" title="string" %}
Your content goes here.
{% /callout %}
```
@@ -54,7 +54,7 @@ The `allow` array acts as a whitelist listing the import definitions that should
The `depConstraints` section is the one you will be spending most time fine-tuning. It represents an array of constraints, each consisting of `sourceTag` and `onlyDependOnLibsWithTags` properties. The default configuration has a wildcard `*` set as a value for both of them, meaning that any project can import (depend on) any other project.
> Note, the wildcard only applies to libraries. Applications and E2E applications cannot be imported. It wouldn't make any sense. If you want to combine applications, you should use the [micro-frontends](/recipes/angular/dynamic-module-federation-with-angular) approach with the module federation.
> Note, the wildcard only applies to libraries. Applications and E2E applications cannot be imported. It wouldn't make any sense. If you want to combine applications, you should use the [micro-frontends](/technologies/angular/recipes/dynamic-module-federation-with-angular) approach with the module federation.
The circular dependency chains such as `lib A -> lib B -> lib C -> lib A` are also not allowed. The self circular dependency (when lib imports from a named alias of itself), while not recommended, can be overridden by setting the flag `allowCircularSelfDependency` to true.
@@ -65,7 +65,7 @@ Tailwind is a utility-first CSS framework packed with classes that can be compos
nx g @nrwl/angular:app my-app --addTailwind
```
Read more about Angular and Tailwind in our [docs](/nx-api/angular/generators/setup-tailwind).
Read more about Angular and Tailwind in our [docs](/technologies/angular/api/generators/setup-tailwind).
### Other Highlights 🗒
@@ -55,7 +55,7 @@ Thanks [Jason](https://twitter.com/FrozenPandaz) for working on this feature!
### React Native now supports Environment Variables
Whenever you set up React Native support within an Nx workspace, it should now automatically come with the [react-native-config](https://github.com/luggit/react-native-config) package installed. That allows you to have a `.env` file in the React Native app folder which can then be loaded from within your React Native application.
You can find all the details on the [Nx docs](/recipes/react/react-native).
You can find all the details on the [Nx docs](/technologies/react/recipes/react-native).
Thanks [Emily Xiong](https://twitter.com/xiongemily) for implementing this!
@@ -317,7 +317,7 @@ At this point, if we serve again the application, everything should still be wor
Similar to the previous section we are going to start by creating a new library to add the card component to. The only difference is that this library is going to be buildable.
> If you are not aware of what buildable libraries are or what problem do they intend to solve, please make sure to read [/ci/incremental-builds](/recipes/angular/setup-incremental-builds-angular).
> If you are not aware of what buildable libraries are or what problem do they intend to solve, please make sure to read [/technologies/angular/recipes/setup-incremental-builds-angular](/technologies/angular/recipes/setup-incremental-builds-angular).
Run the following command to generate the library:
@@ -420,7 +420,7 @@ And finally, replace the existing markup for the cards in the `apps/app1/src/app
With that in place, we can serve the application and it should be working exactly as before, but our application is still not fully set up to consume the library build output. As it stands right now, when the application that's consuming it is built, the library will be built together with it and its files will be processed as part of the application build pipeline.
To finish the buildable library setup, we can follow the instructions in [/recipes/angular/setup-incremental-builds-angular](/recipes/angular/setup-incremental-builds-angular). We need to install the `@nrwl/web` package, change the application `build` target executor to `@nrwl/angular:webpack-browser`, and change the application `serve` target executor to `@nrwl/web:file-server`:
To finish the buildable library setup, we can follow the instructions in [/technologies/angular/recipes/setup-incremental-builds-angular](/technologies/angular/recipes/setup-incremental-builds-angular). We need to install the `@nrwl/web` package, change the application `build` target executor to `@nrwl/angular:webpack-browser`, and change the application `serve` target executor to `@nrwl/web:file-server`:
```shell
yarn add -D @nrwl/web@latest
@@ -129,7 +129,7 @@ Many of these generators come with a rich set of flags. For example, passing `--
**How do we find all these generators though?** There are different options:
- **Nx documentation** — use the search function there or just navigate the docs. All the reference pages are structured like `nx.dev/packages/<packagename>`. As an example for React that would look like: [/nx-api/react](/nx-api/react).
- **Nx documentation** — use the search function there or just navigate the docs. All the reference pages are structured like `nx.dev/packages/<packagename>`. As an example for React that would look like: [/technologies/react/api](/technologies/react/api).
- `npx nx list` - lists a set of installed plugins as well as other available plugins that can be installed. To get a list of generators for a specific plugin - say for the `@nrwl/react` plugin - run `npx nx list @nrwl/react`. Similarly, you can then run `npx nx g @nrwl/react:lib --help` to get help for a particular generator
However, the absolute easiest way to explore the potential and even use Nx if you are not the "terminal type of person" is [Nx Console](https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console)! I'll go a bit deeper into that in a later section.
@@ -152,7 +152,7 @@ Let's have a closer look.
The Nx core team strongly believes in the benefits of TypeScript (in fact, check out the [new Nx and TypeScript setup](/getting-started/intro)). As such, by default every project is automatically set up and configured to use TypeScript, making sure builds, as well as IDEs, are able to properly pick up TypeScript definitions. All without you having to worry about it.
Now, if you really want to use pure JavaScript you totally can. Just pass the `--js` when running a generator. Read [more on the docs](/recipes/tips-n-tricks/js-and-ts).
Now, if you really want to use pure JavaScript you totally can. Just pass the `--js` when running a generator. Read [more on the docs](/technologies/typescript/recipes/js-and-ts).
## ESLint preconfigured!
@@ -273,7 +273,7 @@ One of the advantages of using Nx over — say CRA or a custom starter template
Just to mention an example: when upgrading Nx to v13, all Nx users automatically got migrated to Webpack 5.
This is possible with Nx's [migrate command](/nx-api/nx/documents/migrate) that allows you to keep up to date with your framework in a mostly automated fashion. Whenever you upgrade Nx, you run
This is possible with Nx's [migrate command](/reference/core-api/nx/documents/migrate) that allows you to keep up to date with your framework in a mostly automated fashion. Whenever you upgrade Nx, you run
```shell
npx nx migrate latest
@@ -346,7 +346,7 @@ Here's the `project.json` for our `happynrwl` React application. I clipped out t
}
```
As you can see, all these "targets" (`build`, `serve`,...) have a so-called `options` property that allows you to configure how the target behaves. The actual configuration is abstracted behind the "[Nx Executor](/concepts/executors-and-configurations)", in our case `@nrwl/web:webpack`. You can find the details of how to configure that on the Nx docs in the CLI reference for the `@nrwl/web` package: [/nx-api/webpack/executors/webpack](/nx-api/webpack/executors/webpack).
As you can see, all these "targets" (`build`, `serve`,...) have a so-called `options` property that allows you to configure how the target behaves. The actual configuration is abstracted behind the "[Nx Executor](/concepts/executors-and-configurations)", in our case `@nrwl/web:webpack`. You can find the details of how to configure that on the Nx docs in the CLI reference for the `@nrwl/web` package: [/nx-api/webpack/executors/webpack](/technologies/build-tools/webpack/api/executors/webpack).
To read more about how the `project.json`, its executors, and configuration options are structured, check out the official docs: [/reference/project-configuration](/reference/project-configuration).
@@ -356,8 +356,8 @@ Nx's extensibility and customizability have really no limits, allowing it to rea
- [Custom workspace executors](/extending-nx/recipes/local-executors)
- [Custom workspace generators](/extending-nx/recipes/local-generators)
- [Create Nx plugins](/nx-api/plugin)
- Control the entire workspace setup with [custom presets](/nx-api/plugin)
- [Create Nx plugins](/reference/core-api/plugin)
- Control the entire workspace setup with [custom presets](/reference/core-api/plugin)
## Q: Can I customize my Webpack config used to build my React app?
@@ -36,7 +36,7 @@ Nx can be used in a wide range of scenarios, from small open source projects, st
- `@nrwl/*` plugins which are those actively maintained by the Nx core team
- [Community plugins](/community)
This illustration should give you a rough idea. obviously some of the plugins may be built on top of others, leveraging common functionality. An example is the [@nrwl/js](/nx-api/js) plugin which not only can be used as a standalone plugin but also builds the basis for of many others by providing core JavaScript/TypeScript features.
This illustration should give you a rough idea. obviously some of the plugins may be built on top of others, leveraging common functionality. An example is the [@nrwl/js](/technologies/typescript/introduction) plugin which not only can be used as a standalone plugin but also builds the basis for of many others by providing core JavaScript/TypeScript features.
![](/blog/images/2022-04-08/iMPg692nMj5ty709M7tTQQ.avif)
@@ -206,7 +206,7 @@ If however you're curious, you can now append `--allPrompts` to get all possible
npx create-nx-workspace@next myorg --allPrompts
```
Alternatively you can browse the [API docs on the Nx website](/nx-api/nx/documents/create-nx-workspace) to find out more.
Alternatively you can browse the [API docs on the Nx website](/reference/core-api/nx/documents/create-nx-workspace) to find out more.
## Deliver the best possible TypeScript experience with `@nrwl/js`
@@ -242,7 +242,7 @@ Learn more in this short video walkthrough:
## Our docs keep getting more and more awesome
Besides delivering awesome features, we keep improving our docs. They are essential to help discover new features and better understand existing ones. In the last weeks we've improved the navigation support, allowing you to navigate to a specific package with `/packages/<package-name>` such as [/nx-api/react](/nx-api/react) listing executors and generators that come with that Nx package, also improving the API docs of the individual executor options including a live embedded editor playground to experiment with different configuration setup.
Besides delivering awesome features, we keep improving our docs. They are essential to help discover new features and better understand existing ones. In the last weeks we've improved the navigation support, allowing you to navigate to a specific package with `/packages/<package-name>` such as [/technologies/react/api](/technologies/react/api) listing executors and generators that come with that Nx package, also improving the API docs of the individual executor options including a live embedded editor playground to experiment with different configuration setup.
Check out Benjamin Cabanes' tweet with some short videos:
@@ -74,7 +74,7 @@ Also see this example repository with some more information: [https://github.com
## Simplifying Nx
Nx follows a modular plugin architecture. There is the core part of Nx which has the main logic around managing the project graph, computation caching, hashing and more. On top of that we have a series of Nx provided plugins for some of the most common frameworks and libraries out there, like [TypeScript/Javascript](/nx-api/js), [Angular](/nx-api/angular), [React](/nx-api/react) & [React Native](/nx-api/react-native), [Next.js](/nx-api/next), [Nest.js](/nx-api/nest), [Node](/nx-api/node) and many more, not to forget about [all the community plugins](/community). We also have a [labs project section](https://github.com/nrwl/nx-labs) which is our incubator for potentially new, natively supported Nx plugins.
Nx follows a modular plugin architecture. There is the core part of Nx which has the main logic around managing the project graph, computation caching, hashing and more. On top of that we have a series of Nx provided plugins for some of the most common frameworks and libraries out there, like [TypeScript/Javascript](/technologies/typescript/introduction), [Angular](/technologies/angular/introduction), [React](/technologies/react/introduction) & [React Native](/technologies/react/react-native/introduction), [Next.js](/technologies/react/next/introduction), [Nest.js](/technologies/node/nest/introduction), [Node](/technologies/node/introduction) and many more, not to forget about [all the community plugins](/community). We also have a [labs project section](https://github.com/nrwl/nx-labs) which is our incubator for potentially new, natively supported Nx plugins.
This modular structure allows you to just use [Nx core without plugins](/getting-started/intro). An ideal approach if you want to add Nx to an [existing Lerna/Yarn/NPM/PNPM workspace](/recipes/adopting-nx/adding-to-monorepo). With v14 we made it even simpler s.t. now you only have a single `nx` package in your dependencies with the core setup.
@@ -197,14 +197,14 @@ This can be a game-changer when building huge apps. Stay tuned for more content
We recommend this approach if you want to speed up local serve and build times, but you still deploy the application as a whole.
Read more in our docs: [/concepts/module-federation/faster-builds-with-module-federation](/concepts/module-federation/faster-builds-with-module-federation)
Read more in our docs: [/technologies/module-federation/concepts/faster-builds-with-module-federation](/technologies/module-federation/concepts/faster-builds-with-module-federation)
## Micro Frontend Architecture with Nx
As mentioned in the previous section, Nx v14 comes with out-of-the-box for Webpack Module Federation. The Micro Frontend architecture builds on top of that and adds the ability for independent deployability. While Module Federation enables faster builds by vertically slicing your application into smaller ones, the MFE architecture layers _independent deployments_
on top of federation. Teams should only choose MFEs if they want to deploy their host and remotes on different cadences.
Read more in our docs: [/concepts/module-federation/micro-frontend-architecture](/concepts/module-federation/micro-frontend-architecture)
Read more in our docs: [/technologies/module-federation/concepts/micro-frontend-architecture](/technologies/module-federation/concepts/micro-frontend-architecture)
## Dark mode for Project Graph as well as path tracking
@@ -250,7 +250,7 @@ Nx v14 ships with React 18 support for React DOM and React Native. The latter ha
In addition to that, Expo and Expo Application Service support has been added which has lead already to some drastic speed improvements with some of our clients.
Finally, it is the first version which ships the built-in module federation support for React as we've mentioned a couple of sections above. Check out the React package docs page and search for the `host` and `remote` generator: [/nx-api/react](/nx-api/react)
Finally, it is the first version which ships the built-in module federation support for React as we've mentioned a couple of sections above. Check out the React package docs page and search for the `host` and `remote` generator: [/technologies/react/api](/technologies/react/api)
## Angular
@@ -258,7 +258,7 @@ There have been a lot of highlights for the Nx Angular plugin since v13. Here ar
- Support and migrations for Angular 13 (Angular v14 coming soon. We will release that as a minor upgrade in Nx once the Angular team releases v14)
- Tailwind CSS support (generators, added support to library executors). Read [our blog detailed post](/blog/set-up-tailwind-css-with-angular-in-an-nx-workspace).
- Single Component Application Modules (SCAM) generators for components, directives and pipes ([see our docs](/nx-api/angular))
- Single Component Application Modules (SCAM) generators for components, directives and pipes ([see our docs](/technologies/angular/api))
- Improved Angular CLI to Nx migration support. We invested quite some time refactoring our current migration support from the Angular CLI which not only will allow us to implement more migration scenarios in the future but it also provides better error messages and hints during the migration process. This also allowed us to add support for multi-project Angular CLI workspaces which can now be seamlessly migrated. Multi-application Angular CLI workspace support will be added soon.
Finally, similar to React also Angular gets built-in support for Webpack Module federation and hence also Microfrontends within Nx. See the sections about Module Federation and Microservices for more info and links to the docs.
@@ -37,7 +37,7 @@ You can also append the `--generate-tests` to automatically generate Cypress com
nx g @nrwl/react:cypress-component-configuration --project=my-react-project --generate-tests
```
Check out our [generator docs](/nx-api/react/generators/cypress-component-configuration) for more info.
Check out our [generator docs](/technologies/react/api/generators/cypress-component-configuration) for more info.
{% youtube src="https://youtu.be/QDWN4C7T-Ck" /%}
+2 -2
View File
@@ -215,7 +215,7 @@ Cypress v10 also comes with [Component Testing](https://docs.cypress.io/guides/c
npx nx g @nrwl/react:cypress-component-configuration --project=your-projectnpx nx g @nrwl/angular:cypress-component-configuration --project=your-project
```
Read more here: [/recipes/cypress/cypress-component-testing](/recipes/cypress/cypress-component-testing)
Read more here: [/technologies/test-tools/cypress/recipes/cypress-component-testing](/technologies/test-tools/cypress/recipes/cypress-component-testing)
## Angular: Improved Angular CLI Migrations and Standalone Components
@@ -223,7 +223,7 @@ We landed generators to support Angular developers in leveraging the new standal
{% tweet url="https://twitter.com/NxDevTools/status/1567513106380894215" /%}
In addition, we improved the migration support for moving projects from the Angular CLI to an Nx workspace. Whether for a single Angular CLI project or to consolidate multiple Angular CLI projects into a single Nx workspace. Please read all about it here: [/recipes/angular/migration/angular](/recipes/angular/migration/angular)
In addition, we improved the migration support for moving projects from the Angular CLI to an Nx workspace. Whether for a single Angular CLI project or to consolidate multiple Angular CLI projects into a single Nx workspace. Please read all about it here: [/technologies/angular/migration/angular](/technologies/angular/migration/angular)
## Easily add Nx to an existing repository
@@ -198,9 +198,9 @@ If you are currently using the NxExt based Vite plugin, or even a Webpack based
npx nx g @nrwl/vite:configuration
```
This will adjust the NxExt Vite plugin configuration to match the one provided by our core team. Check out our docs for more info: [/nx-api/vite/generators/configuration](/nx-api/vite/generators/configuration)
This will adjust the NxExt Vite plugin configuration to match the one provided by our core team. Check out our docs for more info: [/technologies/build-tools/vite/generators/configuration](/technologies/build-tools/vite/api/generators/configuration)
You can also find all the details about the new Vite package in our docs: [/nx-api/vite](/nx-api/vite)
You can also find all the details about the new Vite package in our docs: [/technologies/build-tools/vite/introduction](/technologies/build-tools/vite/introduction)
## Adopting Nx has never been easier
@@ -227,7 +227,7 @@ Check out our docs for all the details on
- [adding Nx to an existing monorepo](/recipes/adopting-nx/adding-to-monorepo)
- [adding Nx to any non-monorepo setup](/recipes/adopting-nx/adding-to-existing-project)
- [migrating your CRA project to Nx](/recipes/adopting-nx/adding-to-existing-project)
- [migrating your Angular CLI app to Nx](/recipes/angular/migration/angular)
- [migrating your Angular CLI app to Nx](/technologies/angular/migration/angular)
Oh..you're wondering why you would want to add Nx to an existing non-monorepo project? Then keep reading 👇
@@ -30,17 +30,17 @@ Nx 15.4 brings in the latest Vite major version following the Vite 4 release ear
As the [Vite launch article](https://vitejs.dev/blog/announcing-vite4.html) mentions, we are investing in the Vite ecosystem, and now officially support a first-party Vite plugin. Nx 15.4 continues this investment with timely support for Vite 4, and we're excited to be a part of the Vite ecosystem and a part of bringing more value to our devs through Vite support!
Projects already using our [@nrwl/vite plugin](/nx-api/vite) will be automatically upgraded to Vite 4 when they upgrade to the latest Nx version with the `nx migrate` command, and we've also simplified the configuration required to support Vite.
Projects already using our [@nrwl/vite plugin](/technologies/build-tools/vite/introduction) will be automatically upgraded to Vite 4 when they upgrade to the latest Nx version with the `nx migrate` command, and we've also simplified the configuration required to support Vite.
We've also spent some effort into making the conversion of existing projects to use Vite simpler, including:
- the ability to choose which targets you want to convert
- enhanced `vite.config.ts` file configuration
- better DX with detailed messages during conversion
- [better documentation around converting using our generator](/nx-api/vite/generators/configuration)
- [adding a guide to our docs for converting manually](/recipes/vite/configure-vite)
- [better documentation around converting using our generator](/technologies/build-tools/vite/api/generators/configuration)
- [adding a guide to our docs for converting manually](/technologies/build-tools/vite/recipes/configure-vite)
You can check out more details about our Vite plugin including how to add Vite and Vitest to your existing Nx workspace by visiting our docs at [nx.dev/nx-api/vite](/nx-api/vite)
You can check out more details about our Vite plugin including how to add Vite and Vitest to your existing Nx workspace by visiting our docs at [nx.dev/technologies/build-tools/vite/introduction](/technologies/build-tools/vite/introduction)
## Nx Watch
@@ -96,7 +96,7 @@ Our existing `host` and `remote` Module Federation generators have an added `--s
We've also added a new executor to allow you to serve the host server locally, along with all remote servers from a single command.
Learn more about this new feature [in our docs](/recipes/react/module-federation-with-ssr)!
Learn more about this new feature [in our docs](/technologies/react/recipes/module-federation-with-ssr)!
## Running Multiple Targets in Parallel for Multiple Projects
@@ -13,7 +13,7 @@ This technology has enabled a much cleaner approach to Micro Frontend Architectu
Nx offers great out-of-the-box support and developer experience for Module Federation for Angular and React. You can learn more about it from the resources below:
📄 [Module Federation Recipes on Nx](/recipes/module-federation)
📄 [Module Federation Recipes on Nx](/technologies/module-federation/recipes)
📺 [Speed up your Angular serve and build times with Module Federation and Nx](https://www.youtube.com/watch?v=JkcaGzhRjkc)
However, until now, it has only supported Client-Side Rendering (CSR). Essentially it worked only for Single Page Applications (SPAs). While this is still valuable, it is becoming ever more apparent that Server-Side Rendering (SSR) is becoming the de-facto standard for building web applications, due to the multitude of benefits it provides.
@@ -56,7 +56,7 @@ Answer with the following:
When your workspace is created, run `cd myorg`.
Next, we will need to install the [Official Nx Angular Plugin](/nx-api/angular):
Next, we will need to install the [Official Nx Angular Plugin](/technologies/angular/introduction):
```
npm install @nrwl/angular
@@ -200,7 +200,7 @@ This might look weird initially, but basically, we run the `e2e` target (see `e2
By default, these tests run in headless mode, but you can pass `--watch` to run it interactively with the Cypress test runner such that the tests get re-executed whenever we change our source.
> _Want Cypress Component testing? There's an Nx generator that can help set that up. Check out the docs:_ [_/nx-api/react/generators/cypress-component-configuration_](/nx-api/react/generators/cypress-component-configuration)
> _Want Cypress Component testing? There's an Nx generator that can help set that up. Check out the docs:_ [_/nx-api/react/generators/cypress-component-configuration_](/technologies/react/api/generators/cypress-component-configuration)
## Linting
@@ -88,7 +88,7 @@ $ nx migrate latest --from=nx@<version>
In particular, we're working on making that part more intuitive in upcoming versions.
Also, have a look at our [updated docs](/recipes/tips-n-tricks/advanced-update) as well as our [Nx and Angular compatibility matrix](/nx-api/angular/documents/angular-nx-version-matrix) for more details.
Also, have a look at our [updated docs](/recipes/tips-n-tricks/advanced-update) as well as our [Nx and Angular compatibility matrix](/technologies/angular/recipes/angular-nx-version-matrix) for more details.
## Bootstrapping a new Angular app with Standalone API support
@@ -135,7 +135,7 @@ Stay tuned for a more in-depth blog post coming soon to [our blog](/blog).
Nx provides support for Storybook version 7.0 beta, with generators and executors, so that you can try it out now, either in a new or in your existing Nx workspace. Storybook version 7 is a major release that brings a lot of new features and improvements. You can read more about it in the [Storybook 7 beta announcement blog post](https://storybook.js.org/blog/7-0-beta/). Apart from the new features and enhancements, it also brings some breaking changes. You can read more about them in the [Storybook 7 migration docs](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700) and the [Storybook 7 migration guide](https://chromatic-ui.notion.site/Storybook-7-migration-guide-dbf41fa347304eb2a5e9c69b34503937). Do note that _version 7 is still in beta_, and so is the Nx support for it.
You can try out Storybook 7.0 beta in a new Nx workspace by passing the `--storybook7betaConfiguration` flag when generating the Storybook configuration for your projects. Read more in our [Storybook 7 setup guide](/nx-api/storybook/documents/storybook-7-setup). If you want to migrate your existing Storybook configuration to Storybook 7.0 beta, please read our [migration guide](/nx-api/storybook/generators/migrate-7).
You can try out Storybook 7.0 beta in a new Nx workspace by passing the `--storybook7betaConfiguration` flag when generating the Storybook configuration for your projects.
## More flexible Webpack config
@@ -147,11 +147,11 @@ Previously when you created a new React application with the Nx `@nrwl/react` pl
It was for a good reason, but at the same time, it is a thin line to walk between giving more flexibility and ensuring integrity and consistency (not to speak about features such as [automated code migrations](/features/automate-updating-dependencies)). We wrote a [blog post about it last week](/blog/configuration-files-and-potholes-in-your-codebase).
Inspired by our new [Vite setup](/nx-api/vite), which allows for a more modular configuration in the `vite.config.ts`, we wanted to bring some of the same flexibility to our Webpack setup as well. As such, now every Nx Webpack setup (e.g. a new React + Webpack based app) have a `webpack.config.js` in the project root. Old project are automatically migrated to this new setup.
Inspired by our new [Vite setup](/technologies/build-tools/vite/introduction), which allows for a more modular configuration in the `vite.config.ts`, we wanted to bring some of the same flexibility to our Webpack setup as well. As such, now every Nx Webpack setup (e.g. a new React + Webpack based app) have a `webpack.config.js` in the project root. Old project are automatically migrated to this new setup.
![](/blog/images/2023-02-16/emRP2gF7umWc4UE-.avif)
If you want to upgrade but still retain the previous behavior, we introduced an `isolatedConfig` mode that can be set to `false`. More details in our docs: [/recipes/webpack/webpack-config-setup](/recipes/webpack/webpack-config-setup)
If you want to upgrade but still retain the previous behavior, we introduced an `isolatedConfig` mode that can be set to `false`. More details in our docs: [/technologies/build-tools/webpack/recipes/webpack-config-setup](/technologies/build-tools/webpack/recipes/webpack-config-setup)
## How to Update Nx
@@ -203,7 +203,7 @@ host apps and libraries in any language. With the newly released [**_Encapsulate
The codebase contains both Typescript code for the VSCode extension and Kotlin code for the IntelliJ plugin. Currently,
all the Kotlin code resides in a single app. Targets defined in `project.json` are available that wrap different gradle
tasks like running a development instance, building or formatting the plugin using the
[`nx:run-commands`](/nx-api/nx/executors/run-commands) executor.
[`nx:run-commands`](/reference/core-api/nx/executors/run-commands) executor.
Since the plugin depends on artifacts provided by other Nx apps (namely the `nxls` and `generate-ui`), we have also
created gradle tasks that call Nx to build these dependencies under the hood. This roundabout way of calling one tool
from the other (and back again) could definitely be improved and we might look into having a more straightforward
@@ -137,7 +137,7 @@ Read all the details [on our blog post](/blog/expanding-nx-console-to-jetbrains-
{% youtube src="https://youtu.be/JJ12zKedwIs" /%}
Nx Console has proven a highly valuable tool for exploring Nx generators. Especially if you cannot recall all the various parameters, you can possibly pass. And sure, you could always pass the `--help` or browse [the docs](/nx-api/react/generators/library), but it is just less convenient.
Nx Console has proven a highly valuable tool for exploring Nx generators. Especially if you cannot recall all the various parameters, you can possibly pass. And sure, you could always pass the `--help` or browse [the docs](/technologies/react/api/generators/library), but it is just less convenient.
![](/blog/images/2023-03-08/xFSreZ1G_zifIsdf.avif)
@@ -164,7 +164,7 @@ Read all about it [in the doc about Customizing Generator Options](/extending-nx
## Modular Node Applications
Nx has had Node backend support since the beginning, where you could add an [ExpressJS](/nx-api/express) or [Nest.js](/nx-api/nest) based application to your monorepo. This is a powerful approach as it allows you to colocate your frontend and backend code, which helps share code and, in particular, TypeScript types for your APIs!!
Nx has had Node backend support since the beginning, where you could add an [ExpressJS](/technologies/node/express/introduction) or [Nest.js](/technologies/node/nest/introduction) based application to your monorepo. This is a powerful approach as it allows you to colocate your frontend and backend code, which helps share code and, in particular, TypeScript types for your APIs!!
In [Nx 15.7](/blog/nx-15-7-node-support-angular-lts-lockfile-pruning), we then announced [Nx Standalone Projects](https://youtu.be/qEaVzh-oBBc) support for Node. This allows to develop a Node backend in isolation but still leverages all the features from Nx in terms of code generators, automated migrations, and speed features such as [affected commands](/ci/features/affected), [caching](/concepts/how-caching-works), and [optimized CI setups](/ci/features/distribute-task-execution).
@@ -180,7 +180,7 @@ Check out the following video walkthrough on using these features for modularizi
## Storybook
Nx now generates stories using [Component Storybook Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). If you are using our `@nrwl/react:storybook-configuration`, `@nrwl/angular:storybook-configuration`, `@nrwl/react:stories` and `@nrwl/angular:stories` generators, you will notice that the stories are now generated in the new format. You can check out our documentation for [Storybook and Angular](/recipes/storybook/overview-angular) or [Storybook and React](/recipes/storybook/overview-react) to see the new syntax.
Nx now generates stories using [Component Storybook Format 3 (CSF3)](https://storybook.js.org/blog/storybook-csf3-is-here/). If you are using our `@nrwl/react:storybook-configuration`, `@nrwl/angular:storybook-configuration`, `@nrwl/react:stories` and `@nrwl/angular:stories` generators, you will notice that the stories are now generated in the new format. You can check out our documentation for [Storybook and Angular](/technologies/test-tools/storybook/recipes/overview-angular) or [Storybook and React](/technologies/test-tools/storybook/recipes/overview-react) to see the new syntax.
As the Storybook doc mentions, CSF3 _reduces boilerplate code and improves ergonomics. This makes stories more concise, faster to write and easier to maintain._
@@ -70,11 +70,11 @@ This creates a new application in your Nx monorepo that uses Rspack as the bundl
Go and learn more on the
- official Rspack website: [https://rspack.dev](https://rspack.dev/)
- learn about the Nx Rspack plugin: [/nx-api/rspack](/nx-api/rspack)
- learn about the Nx Rspack plugin: [/technologies/build-tools/rspack/introduction](/technologies/build-tools/rspack/introduction)
## Learn more
- 🦀 [Rspack and Nx docs](/nx-api/rspack)
- 🦀 [Rspack and Nx docs](/technologies/build-tools/rspack/introduction)
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
+3 -3
View File
@@ -13,7 +13,7 @@ We're proud to announce the release of Nx version 16! In this article, we'll go
But before we jump into the new features of Nx 16, let's recap some of the recent features from our Nx 15 minor releases!
- We introduced simpler presets for React, Angular, and [Node starter applications](https://youtu.be/K4f-fMuAoRY)
- We added official support for [Vite](/nx-api/vite) and Vitest for integrated Nx monorepos
- We added official support for [Vite](/technologies/build-tools/vite/introduction) and Vitest for integrated Nx monorepos
- We introduced an [official Deno plugin](https://youtu.be/NpH8cFSp51E), including integration for Node and Deno project collocation and project graph support for Deno imports
- We added Rust into the Nx codebase to speed up core functionality
- We added support for [non-npm workspaces](https://youtu.be/QOhdL02f6BY) to support workspaces focused on other languages like C#, Java, and Kotlin, and saw some of those in action with community plugins for [.NET](https://www.nx-dotnet.com/) and [Java/Kotlin](https://github.com/tinesoft/nxrocks)
@@ -81,8 +81,8 @@ Nx has had support for developing Node-based backends for a while. It was a popu
Its all about **Edge functions** recently (and, well, serverless in general). Especially when developing with Node it is common that you might want to deploy to the Edge or some serverless environment. Therefore, we..
- created a brand new `@nx/netlify` package (currently [in labs](https://github.com/nrwl/nx-labs/tree/main/packages/netlify)) which allows you to set up a brand new project for developing and pushing Netlify functions, or you can add serverless deployment support to an existing project, using the `@nx/netlify:setup-serverless` generator. Check out our in-depth recipe on the topic: [/recipes/node/node-serverless-functions-netlify](/recipes/node/node-serverless-functions-netlify)
- published anew `@nx/aws-lambda` for deploying [Lambda functions](https://aws.amazon.com/lambda/) to AWS. All details in our latest recipe: [/recipes/node/node-aws-lambda](/recipes/node/node-aws-lambda)
- created a brand new `@nx/netlify` package (currently [in labs](https://github.com/nrwl/nx-labs/tree/main/packages/netlify)) which allows you to set up a brand new project for developing and pushing Netlify functions, or you can add serverless deployment support to an existing project, using the `@nx/netlify:setup-serverless` generator. Check out our in-depth recipe on the topic: [/technologies/node/recipes/node-serverless-functions-netlify](/technologies/node/recipes/node-serverless-functions-netlify)
- published anew `@nx/aws-lambda` for deploying [Lambda functions](https://aws.amazon.com/lambda/) to AWS. All details in our latest recipe: [/technologies/node/recipes/node-aws-lambda](/technologies/node/recipes/node-aws-lambda)
- Improved our existing Deno package to add support for serverless deployment to both Deno Deploy as well as Netlify. Such support can be added to an existing app using the `@nx/deno:setup-serverless` generator and providing the `--platform` flag that either point to `deno-deploy` or `netlify`.
## Cypress Feature Testing
@@ -101,8 +101,8 @@ By following these steps, you've successfully used `@nx/netlify` serverless func
### Wrapping up
Never used Nx before? Learn more about Nx [here](/getting-started/why-nx).
[Official recipe from Nx](/recipes/node/node-serverless-functions-netlify)
Never used Nx before? Learn more about Nx [here](/getting-started/intro).
[Official recipe from Nx](/technologies/node/recipes/node-serverless-functions-netlify)
[Github example](https://github.com/ndcunningham/nx-netlify-serverless)
### Learn more
+2 -2
View File
@@ -274,7 +274,7 @@ Using it, you get the native look, a11y, and theme-aware styling for free! Thank
One big upside of using a webview is the huge Javascript ecosystem is available to you! To make sure that no regressions are introduced later on, we use [Cypress](https://www.cypress.io/). We can mock the editor communication and provide different schemas, make sure the form is rendered correctly and the right messages are sent back to the IDE.
While there's no particular Lit integration for Cypress, the tool itself is framework agnostic so it still works perfectly fine. Using the [`@nx/cypress`](/nx-api/cypress) executors did most of the work for us so setup was pretty quick too.
While there's no particular Lit integration for Cypress, the tool itself is framework agnostic so it still works perfectly fine. Using the [`@nx/cypress`](/technologies/test-tools/cypress/introduction) executors did most of the work for us so setup was pretty quick too.
### Results: Comparing Performance
@@ -610,7 +610,7 @@ Using it, you get the native look, a11y, and theme-aware styling for free! Thank
One big upside of using a webview is the huge Javascript ecosystem is available to you! To make sure that no regressions are introduced later on, we use [Cypress](https://www.cypress.io/). We can mock the editor communication and provide different schemas, make sure the form is rendered correctly and the right messages are sent back to the IDE.
While theres no particular Lit integration for Cypress, the tool itself is framework agnostic so it still works perfectly fine. Using the [`@nx/cypress`](/nx-api/cypress) executors did most of the work for us so setup was pretty quick too.
While theres no particular Lit integration for Cypress, the tool itself is framework agnostic so it still works perfectly fine. Using the [`@nx/cypress`](/technologies/test-tools/cypress/introduction) executors did most of the work for us so setup was pretty quick too.
### Results: Comparing Performance
+3 -3
View File
@@ -19,13 +19,13 @@ Be sure to mark your calendars for our Nx 16.5 livestream as well! We'll highlig
Our first major feature actually comes to us from the community. Nx has supported a tags property in your project.json file for awhile now — and it's main purpose has been to be used in conjuncture with the [Nx Module Boundary lint rule](/features/enforce-module-boundaries) to define which projects in your Nx workspace can depend on what — for example, you don't want your frontend applications to depend on any backend-specific code.
With this new feature, you can add the `--tag` option to the [`nx affected`](/nx-api/nx/documents/affected) and [`nx run-many`](/nx-api/nx/documents/run-many) commands to specify to Nx to only run commands for projects that match the given tags.
With this new feature, you can add the `--tag` option to the [`nx affected`](/reference/core-api/nx/documents/affected) and [`nx run-many`](/reference/core-api/nx/documents/run-many) commands to specify to Nx to only run commands for projects that match the given tags.
{% youtube src="https://youtu.be/enQDQmFquGU" /%}
## NextJS 13 Support
React Server Components and the new NextJS app router are here, and Nx is here to support them. We've added support for the latest versions of Next — complete with generators and executors. We've also made sure that our [`withNx` NextJS plugin](/recipes/next/next-config-setup), which allows you to import from your other projects in your workspace while still working with the NextJS build scripts, works both for workspaces using our executors in an Integrated Monorepo approach, as well as for those using a Package-Based approach that are simply using the `next dev` command directly to start their dev server.
React Server Components and the new NextJS app router are here, and Nx is here to support them. We've added support for the latest versions of Next — complete with generators and executors. We've also made sure that our [`withNx` NextJS plugin](/technologies/react/next/recipes/next-config-setup), which allows you to import from your other projects in your workspace while still working with the NextJS build scripts, works both for workspaces using our executors in an Integrated Monorepo approach, as well as for those using a Package-Based approach that are simply using the `next dev` command directly to start their dev server.
There's also built-in support for the new turbopack builder option via the `--turbo` command, for example: `nx serve webapp --turbo`
@@ -60,7 +60,7 @@ Angular is continuing their pattern of releasing new and exciting features — a
As usual, we provide migrations to the most recent Angular version to cover your codebase for any breaking changes going to Angular 16.
And in case you missed it, Nx is no longer tied to your Angular version — the most recent version of Nx will now always [support all currently LTS versions of Angular](/nx-api/angular/documents/angular-nx-version-matrix), meaning you DON'T have to upgrade your Angular version in order to get all these latest Nx Features. Be sure to use the `--interactive` flag to take advantage of this feature: `nx migrate latest --interactive`. You can find more details in [our docs for choosing optional packages to apply](/recipes/tips-n-tricks/advanced-update).
And in case you missed it, Nx is no longer tied to your Angular version — the most recent version of Nx will now always [support all currently LTS versions of Angular](/technologies/angular/recipes/angular-nx-version-matrix), meaning you DON'T have to upgrade your Angular version in order to get all these latest Nx Features. Be sure to use the `--interactive` flag to take advantage of this feature: `nx migrate latest --interactive`. You can find more details in [our docs for choosing optional packages to apply](/recipes/tips-n-tricks/advanced-update).
{% youtube src="https://youtu.be/AQV4WFldwlY" /%}
@@ -148,7 +148,7 @@ Nxs modular design helps as each plugin is responsible for a particular area
![](/blog/images/2023-07-26/LNYWLmdgxQ07bqyt.avif)
_(Source:_ [_/getting-started/why-nx_](/getting-started/why-nx)_)_
_(Source:_ [_/getting-started/intro_](/getting-started/intro)_)_
These plugins are usually technology-specific, like a plugin to help you manage React, Next, Remix, or Angular projects and tooling like ESLint, Cypress, Playwright, Vite, Jest, and so on. There are no limits as you can [create your own](/extending-nx/intro/getting-started). They are **optional**, in that you can use Nx and React and set everything up on your own. But it might be worth relying on them for some better DX and automation, such as the update mechanism were currently looking at.
@@ -25,7 +25,7 @@ You write a story to set up the component's initial state, simulate user behavio
## Setting Up Storybook Interaction Tests on Nx
You can read our detailed guide on how to set up Storybook interaction tests on Nx, here: [/recipes/storybook/storybook-interaction-tests](/recipes/storybook/storybook-interaction-tests).
You can read our detailed guide on how to set up Storybook interaction tests on Nx, here: [/technologies/test-tools/storybook/recipes/storybook-interaction-tests](technologies/test-tools/storybook/recipes/storybook-interaction-tests).
## Writing Interaction Tests in Storybook
@@ -63,7 +63,7 @@ Moreover, since Storybook isolates each component, you can ensure that the tests
## Useful Links
- [https://storybook.js.org/docs/react/writing-tests/interaction-testing](https://storybook.js.org/docs/react/writing-tests/interaction-testing)
- [/recipes/storybook/storybook-interaction-tests](/recipes/storybook/storybook-interaction-tests)
- [/technologies/test-tools/storybook/recipes/storybook-interaction-tests](technologies/test-tools/storybook/recipes/storybook-interaction-tests)
## Learn more
@@ -188,7 +188,7 @@ The preset generator does 2 things:
![](/blog/images/2023-08-10/38RvkLIwUAvVDDrEp5sFPQ.avif)
_preset generator_
The `addProjectConfiguration` and `generateFiles` functions are from [@nx/devkit](/nx-api/devkit/documents/nx_devkit), a library that contains utility functions for writing plugins for Nx. For the future, see the [complete list of utility functions](/nx-api/devkit/documents/nx_devkit).
The `addProjectConfiguration` and `generateFiles` functions are from [@nx/devkit](/reference/core-api/devkit/documents/nx_devkit), a library that contains utility functions for writing plugins for Nx. For the future, see the [complete list of utility functions](/reference/core-api/devkit/documents/nx_devkit).
1. Change the project which is created with `addProjectConfiguration`:
@@ -311,7 +311,7 @@ And finally, another file to host the actual HTML template: `src/generators/pres
</html>
```
3\. Our application uses some npm dependencies so add those to the workspace as well with the [addDependenciesToPackageJson](/nx-api/devkit/documents/nx_devkit) function to the end of the export default function in `src/generators/preset/generator.ts`:
3\. Our application uses some npm dependencies so add those to the workspace as well with the [addDependenciesToPackageJson](/reference/core-api/devkit/documents/nx_devkit) function to the end of the export default function in `src/generators/preset/generator.ts`:
```
import {
+1 -1
View File
@@ -11,7 +11,7 @@ In the ever-evolving web development landscape, efficiency and modularity have b
Qwik is a modern web framework that focuses on application performance by reducing the amount of JavaScript that needs to be shipped to the browser. You can learn more about how Qwik achieves this with [Resumability in their docs](https://qwik.dev/docs/concepts/resumable/).
Nx is a powerful tool that helps you build extensible and maintainable codebases that scale as your application and team grows. Nx utilises computation cache and workspace analysis to ensure maximum efficiency and developer experience. You can [learn more about Nx here](/getting-started/why-nx).
Nx is a powerful tool that helps you build extensible and maintainable codebases that scale as your application and team grows. Nx utilises computation cache and workspace analysis to ensure maximum efficiency and developer experience. You can [learn more about Nx here](/getting-started/intro).
In this blog post, we'll explore how to combine the strengths of Nx and Qwik to create a todo app. To do this, we'll take advantage of an Nx Plugin that was created by the Qwikifiers team to maximise the integration between Qwik and Nx, called [`qwik-nx`](https://github.com/qwikifiers/qwik-nx).
@@ -294,7 +294,7 @@ If you want to create a build locally using your own infrastructure:
npx nx build cats --local
```
Here is the complete list of flags for the build command: [/nx-api/expo/executors/build](/nx-api/expo/executors/build).
Here is the complete list of flags for the build command: [/technologies/react/expo/executors/build](/technologies/react/expo/api/executors/build).
## Submit to the App Store
+2 -2
View File
@@ -282,7 +282,7 @@ Towards the start of the year, we added support for Nx standalone applications.
Ever since we introduced these, we've had requests from the community to add a generator to convert your standalone workspace to a monorepo setup — to support repos that grew to emcompass more than just the 1 application.
This is where our new [`convert-to-monorepo` generator](/nx-api/workspace/generators/convert-to-monorepo) comes into play!
This is where our new [`convert-to-monorepo` generator](/reference/core-api/workspace/generators/convert-to-monorepo) comes into play!
```shell
nx g convert-to-monorepo
@@ -332,7 +332,7 @@ You can find all of the examples and more on our "Showcase" section: [/showcase]
ESLint has announced a new config system — nicknamed "flat config" — whose intent is to be be familiar and much simpler than the current config system. You can read more about this [in their blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/).
As part of our continued support for ESLint, we've introduced [a new generator](/nx-api/eslint/generators/convert-to-flat-config) to convert your Nx monorepo to this new system:
As part of our continued support for ESLint, we've introduced [a new generator](/technologies/eslint/api/generators/convert-to-flat-config) to convert your Nx monorepo to this new system:
```
> nx g convert-to-flat-config
@@ -300,7 +300,7 @@ In this blog, we have:
- Used Nx to run Playwright tests
- Set up a Playwright configuration for an existing Nx app
Hopefully, this gives you good insight into how to get started with Playwright. The Playwright configuration in this example is pretty simple, to learn more about `@nx/playwright` plugin, check out the Nx documentation: [/nx-api/playwright](/nx-api/playwright).
Hopefully, this gives you good insight into how to get started with Playwright. The Playwright configuration in this example is pretty simple, to learn more about `@nx/playwright` plugin, check out the Nx documentation: [/technologies/test-tools/playwright/introduction](/technologies/test-tools/playwright/introduction).
## Learn more
+1 -1
View File
@@ -17,7 +17,7 @@ The 3rd edition of [Nx Conf](/conf), this year live from New York City. If you m
{% youtube src="https://www.youtube.com/watch?v=WSqivWlEDFw" /%}
Juri Strumpflohner (me 😅) opens the keynote. He focuses on the Nx ecosystem, how it is [much more than monorepos](/getting-started/why-nx) by helping you integrate your framework of choice (whether that is Angular, React, or Vue) with tooling such as ESLint, Playwright, Cypress, Webpack, ESBuild, Vite etc.
Juri Strumpflohner (me 😅) opens the keynote. He focuses on the Nx ecosystem, how it is [much more than monorepos](/getting-started/intro) by helping you integrate your framework of choice (whether that is Angular, React, or Vue) with tooling such as ESLint, Playwright, Cypress, Webpack, ESBuild, Vite etc.
![](/blog/images/2023-10-13/bodyimg1.webp)
+2 -2
View File
@@ -226,7 +226,7 @@ In Nx 17, we removed any remaining traces of `tslint` from our linter package, s
As we solidify this command, we intend to bring robust support for various versioning and publishing strategies, as well as built-in support for publishing packages or modules to a variety of languages, registries, and platforms.
For more [checkout our API docs](/nx-api/nx/documents/release), and be sure to catch James Henry's announcement of this new command at [Nx Conf](/blog/nx-conf-2023-recap):
For more [checkout our API docs](/reference/core-api/nx/documents/release), and be sure to catch James Henry's announcement of this new command at [Nx Conf](/blog/nx-conf-2023-recap):
{% youtube src="https://www.youtube.com/embed/p5qW5-2nKqI?si=FzpGMJwPVINc1hgL" /%}
@@ -234,7 +234,7 @@ For more [checkout our API docs](/nx-api/nx/documents/release), and be sure to c
At Nx, we're OBSESSED with building a better, more robust experience for our developers. Towards this end, we're now in [v2 of our Project Inference API](/extending-nx/recipes/project-graph-plugins).
This API is a way of extending the Nx project graph, which can be particularly helpful for extending Nx to support other languages, allowing Nx to determine where to find and draw boundaries around projects in your workspace. A great example is our very own [Vue plugin](/nx-api/vue).
This API is a way of extending the Nx project graph, which can be particularly helpful for extending Nx to support other languages, allowing Nx to determine where to find and draw boundaries around projects in your workspace. A great example is our very own [Vue plugin](/technologies/vue/introduction).
Interestingly, v2 includes support for dynamic targets as well. This opens up exciting new doors to reducing configuration, and we hope to expand on this to better support our first-party plugins in the near future.
+2 -2
View File
@@ -706,8 +706,8 @@ Here is a simple app that uses TanStack Query and Redux for state management. Th
Nx is a powerful monorepo tool. Together with Nx and these 2 state management tools, it will be very easy to scale up any app.
- TanStack Query site: [https://tanstack.com/query/latest](https://tanstack.com/query/latest)
- Official @nx/expo plugin: [/nx-api/expo](/nx-api/expo)
- Official @nx/react-native plugin: [/nx-api/react-native](/nx-api/react-native)
- Official @nx/expo plugin: [/technologies/react/expo/introduction](/technologies/react/expo/introduction)
- Official @nx/react-native plugin: [/technologies/react/react-native/introduction](/technologies/react/react-native/introduction)
---
+2 -2
View File
@@ -15,7 +15,7 @@ It's been a bit since we launched [Nx 17](/blog/nx-17-release)! In this article,
- [Module Federation Updates](#module-federation-updates)
- [Nx Release Updates](#nx-release-updates)
- [Angular 17 (AND NgRx 17) Support](#angular-17-and-ngrx-17-support)
- [Smart Monorepos — Fast CI](#smart-monorepos-fast-ci)
- [Smart Repos — Fast Builds](#smart-repos-fast-builds)
- [New Canary Releases](#new-canary-releases)
- [Upcoming Release Livestream](#upcoming-release-livestream)
- [Automatically Update Nx](#automatically-update-nx)
@@ -139,7 +139,7 @@ nx migrate latest --interactive
- Run 'nx migrate --run-migrations'
```
## Smart Monorepos — Fast CI
## Smart Repos — Fast Builds
We just gave our Nx homepage a small facelift, including a new tagline, subtagline and illustration to better reflect Nx's mission statement.
+10 -10
View File
@@ -25,7 +25,7 @@ It is that time again: getting flooded by Year of Review blog posts. We did it l
- [Many OSS repos adopt Nx](#many-oss-repos-adopt-nx)
- [Nx Community](#nx-community)
- [New Content & Improved Docs](#new-content-improved-docs)
- [New Tagline: Smart Monorepos — Fast CI](#new-tagline-smart-monorepos-fast-ci)
- [New Tagline: Smart Repos — Fast Builds](#new-tagline-smart-repos-fast-builds)
- [Nx Conf](#nx-conf)
- [Looking ahead — 2024](#looking-ahead-2024)
- [Solving CI](#solving-ci)
@@ -57,7 +57,7 @@ Our collaboration with our friends in the Vite core team has been incredibly fru
![](/blog/images/2023-12-28/bodyimg1.webp)
We also built some powerful code generators that not only facilitate a seamless [transition from Webpack to Vite](/nx-api/vite/generators/configuration#nxviteconfiguration) but also pave the way for an effortless [migration from a CRA-based setup](/recipes/adopting-nx/adding-to-existing-project) to a modern Nx + Vite based workspace. To see this process in action, [check out this short video](https://www.youtube.com/watch?v=zvYb7XCLQzU).
We also built some powerful code generators that not only facilitate a seamless [transition from Webpack to Vite](/technologies/build-tools/vite/api/generators/configuration#nxviteconfiguration) but also pave the way for an effortless [migration from a CRA-based setup](/recipes/adopting-nx/adding-to-existing-project) to a modern Nx + Vite based workspace. To see this process in action, [check out this short video](https://www.youtube.com/watch?v=zvYb7XCLQzU).
[AnalogJS](https://analogjs.org/) — the fullstack Angular meta-framework which also heavily builds on top of Vite — is using the `@nx/vite` plugin to power its Angular and Nx based workspaces.
@@ -220,7 +220,7 @@ And you'll then have access to Nx generators so you can create Vue applications,
![](/blog/images/2023-12-28/bodyimg6.gif)
Checkout out our [Vue API docs](/nx-api/vue), and stay tuned as Nx prepares to offer more Vue support (including support for [Nuxt](https://nuxt.com/), a full-stack framework built around Vue) in the near future!
Checkout out our [Vue docs](/technologies/vue/introduction), and stay tuned as Nx prepares to offer more Vue support (including support for [Nuxt](https://nuxt.com/), a full-stack framework built around Vue) in the near future!
### Extending Nx: Local Generators, Build your Own CLI, Verdaccio Support
@@ -252,7 +252,7 @@ Simply put, Module Federation allows a Javascript application running in a brows
This is an exciting development as it allows a paradigm shift in how you can architect, build, and deploy Javascript applications! And this is especially exciting for monorepo fans, as Nx has best-in-class support for module federation that makes a Module Federation approach easy to adopt and simple to understand!
Currently, our `@nx/angular` and `@nx/react` plugins both have generators to [create a "host" application](/recipes/module-federation/create-a-host) that will load and consume federated modules from ["remote" applications](/recipes/module-federation/create-a-remote), which you can also generate using Nx. Then, by running a simple command with Nx, you can serve all applications required for your host application with the command:
Currently, our `@nx/angular` and `@nx/react` plugins both have generators to [create a "host" application](/technologies/module-federation/recipes/create-a-host) that will load and consume federated modules from ["remote" applications](/technologies/module-federation/recipes/create-a-remote), which you can also generate using Nx. Then, by running a simple command with Nx, you can serve all applications required for your host application with the command:
```shell
nx serve host-application --devRemotes=remote-application
@@ -260,9 +260,9 @@ nx serve host-application --devRemotes=remote-application
Where in the example above your host application is named "host-application" and a remote application that you want live updates on as you're developing is named "remote-application".
Throughout 2023, we've continued to increase Nx's support and general dev experience around Module Federation, including [adding a generator to federate an existing module](/recipes/module-federation/federate-a-module), improving the local developer experience by improving local webserver performance, and introducing the concept of [Dynamic Module Federation](/recipes/angular/dynamic-module-federation-with-angular#advanced-angular-micro-frontends-with-dynamic-module-federation) which will allow you to dynamically specify the location of your remote applications via a "module-federation.manifest.json" file!
Throughout 2023, we've continued to increase Nx's support and general dev experience around Module Federation, including [adding a generator to federate an existing module](/technologies/module-federation/recipes/federate-a-module), improving the local developer experience by improving local webserver performance, and introducing the concept of [Dynamic Module Federation](/technologies/angular/recipes/dynamic-module-federation-with-angular#advanced-angular-micro-frontends-with-dynamic-module-federation) which will allow you to dynamically specify the location of your remote applications via a "module-federation.manifest.json" file!
At Nx, we're excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nx's CI capabilities, in particular allowing for [much shorter build times](/concepts/module-federation/faster-builds-with-module-federation) especially for larger Angular applications.
At Nx, we're excited about the Module Federation support we offer for our users, and think that it has many interesting applications when paired with Nx's CI capabilities, in particular allowing for [much shorter build times](/technologies/module-federation/concepts/faster-builds-with-module-federation) especially for larger Angular applications.
## Many OSS repos adopt Nx
@@ -316,9 +316,9 @@ We also poured a lot of [effort into the docs](/getting-started/intro). We restr
- [**Concept docs**](/concepts) — which explain some of the inner workings and mental model behind certain features. Like [how caching works](/concepts/how-caching-works).
- [**Recipes**](/recipes) — which are solution oriented. You already know how to cook, we provide the exact recipe for it.
- [**Tutorials**](/getting-started/tutorials) — for when you just want to sit down and follow along, step by step to learn how to use Nx in a certain context.
- [**Reference**](/reference) and [**API docs**](/nx-api) — pure, raw and to the point.
- [**Reference**](/reference) and [**API docs**](/reference/core-api) — pure, raw and to the point.
We created a brand new ["Why Nx"](/getting-started/why-nx) page explaining the overall architecture of Nx including a [brand new video](https://www.youtube.com/watch?v=-_4WMl-Fn0w) giving you a holistic overview of what Nx is capable of.
We created a brand new ["Why Nx"](/getting-started/intro) page explaining the overall architecture of Nx including a [brand new video](https://www.youtube.com/watch?v=-_4WMl-Fn0w) giving you a holistic overview of what Nx is capable of.
We also refreshed our [entry pages](/getting-started/intro), including dedicated examples of using Nx with popular stacks:
@@ -330,11 +330,11 @@ You can also browse them in the [nx-recipes](https://github.com/nrwl/nx-recipes)
And obviously, we jumped on the AI train as well. A couple of months ago, we added the [Nx Assistant](/ai-chat). A ChatGPT-powered interface trained in our docs. [Katerina](https://twitter.com/psybercity) wrote about it [on our blog](/blog/nx-docs-ai-assistant). The AI chat allows to interactively ask questions about Nx and will give you relevant answers from our docs (including linking to the sources).
## New Tagline: Smart Monorepos — Fast CI
## New Tagline: Smart Repos — Fast Builds
Nx stands out for its flexibility, accommodating for both monorepo and non-monorepo project structures. This approach allows users to begin with simpler project configurations, leveraging the benefits of Nx's robust tooling, and later, when the need arises, seamlessly [migrate to a monorepo](/recipes/tips-n-tricks/standalone-to-monorepo).
However, Nx's true strength becomes most apparent at scale, typically within a monorepo setup. We wanted to capture it in our new tagline: **Smart Monorepos — Fast CI**.
However, Nx's true strength becomes most apparent at scale, typically within a monorepo setup. We wanted to capture it in our new tagline: **Smart Repos — Fast Builds**.
{% tweet url="https://twitter.com/juristr/status/1734558895547568634" /%}
+1 -1
View File
@@ -18,7 +18,7 @@ In 2014, the state of the art for running tests and builds in your repository we
Nx was created in 2017 to address this problem. Nx is a build system that operates on a **higher level** where developers define the relationships between tasks and then Nx to decides the optimal way to run those tasks. In the same way, developers can define the inputs and outputs of tasks, then Nx automatically caches those task results. Developers tell Nx what a task does and then Nx can decide how best to run that task.
With [Nx Agents](/ci/features/distribute-task-execution), Nx is applying this same mindset to the problem of slow and costly CI pipelines. Nx gives you both **Smart Monorepos** and **Fast CI**.
With [Nx Agents](/ci/features/distribute-task-execution), Nx is applying this same mindset to the problem of slow and costly CI pipelines. Nx gives you both **Smart Repos** and **Fast Builds**.
## Why is CI So Hard?
+1 -1
View File
@@ -141,7 +141,7 @@ And after running the generator, you can expect your project detail view to look
Notice that in addition to reducing the configuration in your `project.json` file, this generator will also turn on the Nx Atomizer for your Cypress and Playwright projects, so Nx will allow sharding for your end-to-end tasks in CI based on the tests present in your workspace going forward. Note that Nx Agents are very highly highly encouraged as a way of taking advantage of this sharding capability.
As a note, if you cannot see `e2e-ci` tasks after converting your cypress projects, you can [take a closer look here](/nx-api/cypress/documents/overview#splitting-e2e-tasks-by-file) at how to configure them correctly.
As a note, if you cannot see `e2e-ci` tasks after converting your cypress projects, you can [take a closer look here](/technologies/test-tools/cypress/introduction#splitting-e2e-tasks-by-file) at how to configure them correctly.
## BREAKING CHANGE: Updating Bundled Environment Variables: `NX_` to `NX_PUBLIC_`
@@ -16,4 +16,4 @@ In this episode, welcome Nx Champion and Nx Expert, Tine Kondo. Our discussion h
We touch on the difficulties larger organizations face when merging PRs in a timely manner, emphasizing how a monorepo alleviates the headache of coordinating multiple PRs across various repositories, and share firsthand experiences and frustrations with traditional multi-repo setups, underscoring the benefits of a unified approach.
In particular, Nx's new plugin: [@nx/gradle](/nx-api/gradle) is of interest, and Tine provides some valuable insight on the impact this plugin can make, as well as the importance for Maven support.
In particular, Nx's new plugin: [@nx/gradle](/technologies/java/introduction) is of interest, and Tine provides some valuable insight on the impact this plugin can make, as well as the importance for Maven support.
+9 -9
View File
@@ -106,7 +106,7 @@ Note that the new, free [hobby tier for Nx Cloud](#new-nx-cloud-hobby-tier) incl
## Pattern Support for `targetDefaults`
When using the [Atomizer features](/ci/features/split-e2e-tasks) of plugins like [`@nx/playwright`](/nx-api/playwright) and [`@nx/cypress`](/nx-api/cypress), you end up creating tasks with dynamic but predictable names.
When using the [Atomizer features](/ci/features/split-e2e-tasks) of plugins like [`@nx/playwright`](/technologies/test-tools/playwright/introduction) and [`@nx/cypress`](/technologies/test-tools/cypress/introduction), you end up creating tasks with dynamic but predictable names.
![Tasks Created With Atomizer](/blog/images/2024-08-01/e2e-task-names.avif)
@@ -169,7 +169,7 @@ nx affected --targets=lint,test,build,e2e-ci
In CI, Nx Agents will allow all tasks to run in parallel on the same machine, except for the atomized end-to-end tasks, which will only run in isolation.
Learn more about how you can [Parallelize Tasks Across Multiple Machines Using Nx Agents](/ci/intro/tutorials/github-actions#parallelize-tasks-across-multiple-machines-using-nx-agents):
Learn more about how you can [Parallelize Tasks Across Multiple Machines Using Nx Agents](/ci/features/split-e2e-tasks):
{% youtube
src="https://youtu.be/0YxcxIR7QU0"
@@ -178,7 +178,7 @@ width="100%" /%}
## Support For Incremental Builds For Vite
Nx now supports incremental builds with our [`vite` plugin](/nx-api/vite). Incremental builds in Nx workspaces allow you to build any package in your workspace individually, and will then automatically use that built artifact when then building any project or application that consumes the package. This way you can speed up your build and CI times through optimizations like [only building packages that were affected](/nx-api/nx/documents/affected), using [Nx Replay](/ci/features/remote-cache) to effortlessly cache and share your built artifacts, and allowing you to run builds of your various packages in parallel using [Nx Agents](/ci/features/distribute-task-execution).
Nx now supports incremental builds with our [`vite` plugin](/technologies/build-tools/vite/introduction). Incremental builds in Nx workspaces allow you to build any package in your workspace individually, and will then automatically use that built artifact when then building any project or application that consumes the package. This way you can speed up your build and CI times through optimizations like [only building packages that were affected](/reference/core-api/nx/documents/affected), using [Nx Replay](/ci/features/remote-cache) to effortlessly cache and share your built artifacts, and allowing you to run builds of your various packages in parallel using [Nx Agents](/ci/features/distribute-task-execution).
Read more about [buildable libraries and incremental builds](/concepts/buildable-and-publishable-libraries).
@@ -194,11 +194,11 @@ npx nx g convert-to-inferred
The important thing to note here is that while this generator will make adjustments to the `project.json` file of the projects you convert, the behavior of your tasks should remain the same. You can see project details via the [Nx Console](/getting-started/editor-setup) plugin of your IDE, or in a browser by running the command: `nx show project [projectName]`.
In Nx 19, we were focused on adding `convert-to-inferred` to our [Playwright](/nx-api/playwright), [Cypress](/nx-api/cypress), and [ESLint](/nx-api/eslint) plugins - where bringing the [Nx Atomizer](/ci/features/split-e2e-tasks) provided the greatest value. Since then, we've added this generator to most other plugins. Currently, our React native plugins (react native, expo, detox) are the only plugins that are outstanding, and we'll be providing `convert-to-inferred` generators here in the near future.
In Nx 19, we were focused on adding `convert-to-inferred` to our [Playwright](/technologies/test-tools/playwright/introduction), [Cypress](/technologies/test-tools/cypress/introduction), and [ESLint](/technologies/eslint/introduction) plugins - where bringing the [Nx Atomizer](/ci/features/split-e2e-tasks) provided the greatest value. Since then, we've added this generator to most other plugins. Currently, our React native plugins (react native, expo, detox) are the only plugins that are outstanding, and we'll be providing `convert-to-inferred` generators here in the near future.
## Gradle Composite Builds Support
In [Nx 19.0](/blog/nx-19-release), we introduced support for Gradle through our [Gradle plugin](/nx-api/gradle). With the latest update, this plugin now also supports [Gradle Composite builds](https://docs.gradle.org/current/userguide/composite_builds.html), in addition to multi-project builds.
In [Nx 19.0](/blog/nx-19-release), we introduced support for Gradle through our [Gradle plugin](/technologies/java/introduction). With the latest update, this plugin now also supports [Gradle Composite builds](https://docs.gradle.org/current/userguide/composite_builds.html), in addition to multi-project builds.
Gradle Composite builds are commonly used in larger workspaces to manage dependencies across multiple projects. With this new support, Nx can now leverage composite builds to enhance the Nx Task Graph. For example, consider the following `settings.gradle.kts` file:
@@ -217,7 +217,7 @@ You can read more on composite builds in the [Gradle documentation](https://docs
## Experimental: Gradle Test Atomization
The new [`@nx/gradle` plugin](/nx-api/gradle) now includes experimental support for [Test Atomization](/ci/features/split-e2e-tasks).
The new [`@nx/gradle` plugin](/technologies/java/introduction) now includes experimental support for [Test Atomization](/ci/features/split-e2e-tasks).
![Gradle Atomized](/blog/images/2024-08-01/gradle-atomized.avif)
@@ -225,7 +225,7 @@ With Test Atomization, as you add tests to your Gradle projects, Nx will automat
## Experimental: Nx Release Adds File Based Versioning Support
Currently with [Nx release](/nx-api/nx/documents/release), you already have two different ways of figuring out the how to modify the current version of a package to get its updated version:
Currently with [Nx release](/reference/core-api/nx/documents/release), you already have two different ways of figuring out the how to modify the current version of a package to get its updated version:
- Imperatively via the CLI/prompt by telling it your desired relative (semver keyword) or absolute (e.g. `1.2.3`) version.
- Declaratively by letting Nx inspect your git history and determine the semver bump to apply based on the conventional commits specification.
@@ -259,9 +259,9 @@ Fetching @angular/core@18.1.2
NX The migrate command has run successfully.
```
Our `@nx/react` package will now create new React applications using version 18.3, and we now support the new experimental `reactCompiler`. Users can install the [`babel-plugin-react-compiler` package](https://www.npmjs.com/package/babel-plugin-react-compiler) and you can follow [this guide for how to enable it with Nx](/recipes/react/react-compiler#react-compiler-with-nx).
Our `@nx/react` package will now create new React applications using version 18.3, and we now support the new experimental `reactCompiler`. Users can install the [`babel-plugin-react-compiler` package](https://www.npmjs.com/package/babel-plugin-react-compiler) and you can follow [this guide for how to enable it with Nx](/technologies/react/recipes/react-compiler#react-compiler-with-nx).
Note that due to the extent of breaking changes coming with React 19, we will not be providing a automated migration to React 19 via [`nx migrate`](/nx-api/nx/documents/migrate).
Note that due to the extent of breaking changes coming with React 19, we will not be providing a automated migration to React 19 via [`nx migrate`](/reference/core-api/nx/documents/migrate).
## Automatically Update Nx
@@ -81,7 +81,7 @@ Next, we'll want to navigate into our new workspace:
cd myorg
```
And finally, we'll add the [`@nx/react`](/nx-api/react) plugin to our workspace.
And finally, we'll add the [`@nx/react`](/technologies/react/introduction) plugin to our workspace.
```shell
npx nx add @nx/react
@@ -94,7 +94,7 @@ generator now to scaffold out Module Federation projects.
{% callout type="note" title="Generating host applications" %}
If you'd like a more indepth recipe for scaffolding `host` and `remote` generators you can take a look through
our [Module Federation Recipes](/recipes/module-federation).
our [Module Federation Recipes](/technologies/module-federation/recipes).
{% /callout %}
```{% command="npx nx g @nx/react:host apps/shell --remotes=remote1 --bundler=rspack" path="~/myorg" %}
@@ -173,7 +173,7 @@ Nx itself has employed this strategy to solve a long-standing issue with shared
the possibility that a shared library would be served from a static remote. This in turn would prevent HMR updates to
the library from being reflected in the locally served application.
You can learn more about the
`NxRuntimeLibraryControlPlugin` [here](/concepts/module-federation/nx-module-federation-technical-overview).
`NxRuntimeLibraryControlPlugin` [here](/technologies/module-federation/concepts/nx-module-federation-technical-overview).
{% /callout %}
## Step 4: Building and Serving
@@ -203,7 +203,7 @@ Serving statically means that we can reuse the build artifacts for the `remotes`
that is scalable. Combined with Nx caching, this works well to ensure a great developer experience.
You can learn more about how this works in
our [Nx Module Federation Technical Overview](/concepts/module-federation/nx-module-federation-technical-overview#what-happens-when-you-serve-your-host)
our [Nx Module Federation Technical Overview](/technologies/module-federation/concepts/nx-module-federation-technical-overview#what-happens-when-you-serve-your-host)
document.
{% /callout %}
+4 -4
View File
@@ -28,11 +28,11 @@ In this blog post:
## Nx Import
In Nx 19.8, [`nx import`](/nx-api/nx/documents/import) has now moved from beta support to now generally available!
In Nx 19.8, [`nx import`](/reference/core-api/nx/documents/import) has now moved from beta support to now generally available!
Nx Import is a new [top-level command of the Nx CLI](/reference/nx-commands) which allows you to import projects along with its git history from some other repository into your current Nx workspace.
Keep an eye out for more on Nx Import on our [YouTube Channel](https://www.youtube.com/@nxdevtools) coming soon, and in the meantime be sure to check [the documentation](/nx-api/nx/documents/import) as this is now fully documented!
Keep an eye out for more on Nx Import on our [YouTube Channel](https://www.youtube.com/@nxdevtools) coming soon, and in the meantime be sure to check [the documentation](/reference/core-api/nx/documents/import) as this is now fully documented!
## Improved Task Scheduling!
@@ -62,7 +62,7 @@ With Nx 19.8, we've added a [`infer-targets`](/recipes/running-tasks/convert-to-
When creating a new workspace with the command: `npx create-nx-workspace`, those workspaces will now be created with [`eslint`](https://www.npmjs.com/package/eslint) v9, and [`typescript-eslint`](https://www.npmjs.com/package/typescript-eslint) v8 - their most recent versions respectively.
Keep in mind as well that ESLint v8 faces end-of-life on October 5th, meaning only [flat config](https://eslint.org/docs/latest/use/configure/migration-guide) is supported moving forward. Nx users should migrate to this new config format using [our flat config generator](/recipes/tips-n-tricks/flat-config#switching-to-eslints-flat-config-format).
Keep in mind as well that ESLint v8 faces end-of-life on October 5th, meaning only [flat config](https://eslint.org/docs/latest/use/configure/migration-guide) is supported moving forward. Nx users should migrate to this new config format using [our flat config generator](/technologies/eslint/recipes/flat-config#switching-to-eslints-flat-config-format).
For more on eslint's flat config, and how to use our generator to get to flat config checkout this video:
@@ -73,7 +73,7 @@ title="ESLint Config Automation With Nx"
## Nx Release Enhancements
[`nx release`](/nx-api/nx/documents/release) is a framework/language/platform agnostic solution to versioning, publishing, and changelogs for your monorepo. We've been continuing to invest in Nx Release in 19.8, adding support specifically for [`pnpm publish`](https://pnpm.io/cli/publish) and [Github Enterprise Server](https://github.com/nrwl/nx/pull/26482)!
[`nx release`](/reference/core-api/nx/documents/release) is a framework/language/platform agnostic solution to versioning, publishing, and changelogs for your monorepo. We've been continuing to invest in Nx Release in 19.8, adding support specifically for [`pnpm publish`](https://pnpm.io/cli/publish) and [Github Enterprise Server](https://github.com/nrwl/nx/pull/26482)!
We also have a new feature from Nx Champion, Jonathan Gelin - which allows you to use `groupPreVersionCommand` in addition to the `preVersionCommand` when using the release groups feature to support [building before versioning](/recipes/nx-release/build-before-versioning).
@@ -130,8 +130,8 @@ Read all about how to [configure Codeowners for your project in our docs](/nx-en
We're releasing the `@nx/conformance` plugin in an early preview. This new package focuses specifically on the maintainability of your monorepo. It allows you to encode your organization's standards so they can be enforced automatically. In this first version, the workspace conformance package ships with:
- [Enforce Module Boundaries](/nx-api/conformance#enforce-module-boundaries): Similar to the Nx ESLint [Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
- [Ensure Owners](/nx-api/conformance#ensure-owners): Requires every project to have an owner defined for the `@nx/owners` plugin.
- [Enforce Module Boundaries](/reference/core-api/conformance#enforce-module-boundaries): Similar to the Nx ESLint [Enforce Module Boundaries rule](/features/enforce-module-boundaries), but enforces boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
- [Ensure Owners](/reference/core-api/conformance#ensure-owners): Requires every project to have an owner defined for the `@nx/owners` plugin.
To get started, install the following package:
+2 -2
View File
@@ -65,7 +65,7 @@ npx nx e2e myapp-e2e
In [Nx 19.8](/blog/nx-19-8-update#new-nx-workspaces-created-with-eslint-v9), we highlighted that workspaces will now be created with [`eslint`](https://www.npmjs.com/package/eslint) v9, and [`typescript-eslint`](https://www.npmjs.com/package/typescript-eslint) v8.
This not only brings us inline with the latest version of eslint and typescript-eslint, but also that [flat config](https://eslint.org/docs/latest/use/configure/migration-guide) is only supported moving forward. Nx users should migrate to this new config format using [our flat config generator](/recipes/tips-n-tricks/flat-config#switching-to-eslints-flat-config-format).
This not only brings us inline with the latest version of eslint and typescript-eslint, but also that [flat config](https://eslint.org/docs/latest/use/configure/migration-guide) is only supported moving forward. Nx users should migrate to this new config format using [our flat config generator](/technologies/eslint/recipes/flat-config#switching-to-eslints-flat-config-format).
For more on eslint's flat config, and how to use our generator to get to flat config checkout this video:
@@ -141,7 +141,7 @@ There's a lot more in Nx 20, so be sure to check the full changelog for all the
[gradle-atomizer]: /blog/nx-19-5-adds-stackblitz-new-features-and-more#experimental-gradle-test-atomization
[nx-gradle]: /blog/nx-19-release#new-plugin-nxgradle
[file-based-versioning]: /recipes/nx-release/file-based-versioning-version-plans
[nx-rspack]: /nx-api/rspack
[nx-rspack]: /technologies/build-tools/rspack/introduction
[crystalize-command]: /blog/nx-19-8-update#crystalize-your-entire-workspace-in-one-command
[nx-import]: /recipes/adopting-nx/import-project
[migration-step]: /features/automate-updating-dependencies
+1 -1
View File
@@ -23,7 +23,7 @@ However, while we've always had a great story for starting up a fresh monorepo f
Prior to this work, it was always possible to do manually - but it takes some finessing both in terms of copying/pasting files over, and (as we'll see later) maintaining combining git history from the old project into its new home.
We always wanted to make this better - and now, we've now added a new top-level command to Nx specifically to address this: [`nx import`](http://localhost:4200/nx-api/nx/documents/import).
We always wanted to make this better - and now, we've now added a new top-level command to Nx specifically to address this: [`nx import`](http://localhost:4200/reference/core-api/nx/documents/import).
## How It Works
@@ -84,7 +84,7 @@ Sometimes the second part of the problem simply builds on top of the first. On t
### New Feature for 2.0.0: File Watching!
We've also added file watching (using [`nx watch`](/nx-api/nx/documents/watch) behind the scenes!)
We've also added file watching (using [`nx watch`](/reference/core-api/nx/documents/watch) behind the scenes!)
Simply add `watch-` to the start of any of the commands and aliases listed above to start any of them in watch mode, so they automatically re-run as soon as any changes to the file system are detected! Example:
@@ -47,7 +47,7 @@ Once installed, run the following generator that ships with the `@nx/plugin` pac
nx g plugin packages/nx-plugin --importPath=@org/nx-plugin
```
Also, make sure to check out our [extensive instructions in our docs for building plugins](/extending-nx/intro/getting-started), or you can jump right to the API for [@nx/plugin](/nx-api/plugin).
Also, make sure to check out our [extensive instructions in our docs for building plugins](/extending-nx/intro/getting-started), or you can jump right to the API for [@nx/plugin](/reference/core-api/plugin).
## Setting up custom generators
@@ -137,7 +137,7 @@ To support consistency across your org, you can publish this plugin so that all
nx release --first-release
```
If you want to test your package by publishing locally, your project will also be set up with a [Verdaccio configuration](/nx-api/js/executors/verdaccio) that allows you to run a local registry for testing your new plugin locally:
If you want to test your package by publishing locally, your project will also be set up with a [Verdaccio configuration](/technologies/typescript/api/executors/verdaccio) that allows you to run a local registry for testing your new plugin locally:
```bash
nx local-registry
@@ -171,7 +171,7 @@ Your plugin can provide _anything an existing Nx plugin provides._ This includes
- [Generators](/extending-nx/recipes/local-generators)
- [Task inference](/extending-nx/tutorials/tooling-plugin)
- [Custom eslint rules](/nx-api/eslint/generators/workspace-rule#nxeslintworkspacerule)
- [Custom eslint rules](/technologies/eslint/api/generators/workspace-rule#nxeslintworkspacerule)
- [Migrations](/extending-nx/recipes/migration-generators)
- Shared tool configs
- CI pipeline starters
+1 -1
View File
@@ -147,7 +147,7 @@ We also adopted **Module Federation 2.0**, adding runtime plugins and key enhanc
To simplify setup, we launched **@nx/module-federation**, a package that streamlines configuration and management of federated apps in Nx workspaces. Nx's approach to Module Federation has been highlighted by the community and is now featured on [module-federation.io](https://module-federation.io/practice/monorepos/nx-for-module-federation.html).
For more details on how Module Federation works in Nx, check out the [technical overview](/concepts/module-federation/nx-module-federation-technical-overview) or catch one of our [live streams on Rspack and Module Federation](https://www.youtube.com/watch?v=_c4zjYm0pYE).
For more details on how Module Federation works in Nx, check out the [technical overview](/technologies/module-federation/concepts/nx-module-federation-technical-overview) or catch one of our [live streams on Rspack and Module Federation](https://www.youtube.com/watch?v=_c4zjYm0pYE).
### Nx Console
+5 -5
View File
@@ -123,11 +123,11 @@ And we will continue to add this as the default to all our official presets soon
## Rspack updates
Our [`@nx/rspack`](/nx-api/rspack) plugin has moved from labs into our main repo now, and we now have [a dedicated plugin](/nx-api/rsbuild) for [Rsbuild](https://rsbuild.dev/) (a vite-like build tool with streamlined config built on top of Rspack) as well.
Our [`@nx/rspack`](/technologies/build-tools/rspack/introduction) plugin has moved from labs into our main repo now, and we now have [a dedicated plugin](/technologies/build-tools/rsbuild/introduction) for [Rsbuild](https://rsbuild.dev/) (a vite-like build tool with streamlined config built on top of Rspack) as well.
With the latest improvements, our Rspack plugin is now at feature parity with our [`@nx/webpack`](/nx-api/webpack) plugin, which should make it easier for teams to migrate from Webpack to Rspack now and take advantage of the significant performance gains.
With the latest improvements, our Rspack plugin is now at feature parity with our [`@nx/webpack`](/technologies/build-tools/webpack/introduction) plugin, which should make it easier for teams to migrate from Webpack to Rspack now and take advantage of the significant performance gains.
Our new [Rsbuild plugin](/nx-api/rsbuild) will bring support for React and Vue applications, and we have measured a massive performance increase here over webpack. Running the command:
Our new [Rsbuild plugin](/technologies/build-tools/rsbuild/introduction) will bring support for React and Vue applications, and we have measured a massive performance increase here over webpack. Running the command:
```shell
nx g @nx/rsbuild:configuration
@@ -195,9 +195,9 @@ We've also introduced spinners into the terminal ui for instances where a task i
> Update: Self-hosted cache was previously part of Powerpack. But no more, it is no free for everyone to use.
We just improved support for our [self-hosted caching packages](/recipes/running-tasks/self-hosted-caching) by adding adapters for [Azure](/nx-api/azure-cache) and [Google Cloud Storage](/nx-api/gcs-cache) as supported storage providers (in addition to [S3](/nx-api/s3-cache) or [simply using a shared file system](/nx-api/shared-fs-cache)).
We just improved support for our [self-hosted caching packages](/recipes/running-tasks/self-hosted-caching) by adding adapters for [Azure](/reference/core-api/azure-cache/overview) and [Google Cloud Storage](/reference/core-api/gcs-cache/overview) as supported storage providers (in addition to [S3](/reference/core-api/s3-cache/overview) or [simply using a shared file system](/reference/core-api/shared-fs-cache/overview)).
We've also [added support for S3 compatible providers](/nx-api/s3-cache#s3-compatible-providers) such as:
We've also [added support for S3 compatible providers](/reference/core-api/s3-cache#s3-compatible-providers) such as:
- [MinIO](https://min.io/product/s3-compatibility)
- [LocalStack](https://www.localstack.cloud)
+1 -1
View File
@@ -39,7 +39,7 @@ export function isEven(n: number): boolean {
}
```
```ts {% fileName="is-even/index.ts" %}
```ts {% fileName="is-odd/index.ts" %}
import { isEven } from 'is-even';
export function isOdd(n: number): boolean {
@@ -663,7 +663,7 @@ npx create-nx-workspace mymonorepo --workspaces
Also check out our docs:
- [TypeScript Project Linking](/concepts/typescript-project-linking)
- [Switching to Workspaces and Project References](/recipes/tips-n-tricks/switch-to-workspaces-project-references)
- [Switching to Workspaces and Project References](/technologies/typescript/recipes/switch-to-workspaces-project-references)
---
@@ -7,7 +7,7 @@ cover_image: /blog/images/2025-01-31/cover-image.jpg
description: 'Deploy React Native app updates instantly with Module Federation and Zephyr Cloud, skipping app store review processes.'
---
Module Federation is an exciting and continually evolving technology. The use cases for Module Federation have expanded from [Micro Frontends](/concepts/module-federation/micro-frontend-architecture) and [Faster Builds](/concepts/module-federation/faster-builds-with-module-federation) to also include something that should be extremely interesting for React Native users.
Module Federation is an exciting and continually evolving technology. The use cases for Module Federation have expanded from [Micro Frontends](/technologies/module-federation/concepts/micro-frontend-architecture) and [Faster Builds](/technologies/module-federation/concepts/faster-builds-with-module-federation) to also include something that should be extremely interesting for React Native users.
Thanks to the wonderful work from the [Re.Pack](https://re-pack.dev/) team at [Callstack](https://www.callstack.com/) and [Zephyr Cloud](https://www.zephyr-cloud.io/) now you can provide over-the-air (OTA) updates to your deployed native mobile apps by running a build from your laptop - without having to deal with the difficulties or time-consuming process of deploying a new binary to each of the app stores your application is deployed to.
@@ -60,7 +60,7 @@ Beyond just mitigating risk of changing dependencies that can cause runtime erro
If you sprinkle [Nx Cloud](/ci/intro/why-nx-cloud) on top - you can ensure your CI remains fast as you scale out your application through [Nx Replay](/ci/features/remote-cache#use-remote-caching-nx-replay) and [Nx Agents](/ci/features/distribute-task-execution). Increased scalability does not come with an increased maintenance cost of managing CI machines manually thanks to declarative [config files](/ci/recipes/set-up/monorepo-ci-github-actions).
You can learn more about Why to use Nx beyond Module Federation support [here](/getting-started/why-nx).
You can learn more about Why to use Nx beyond Module Federation support [here](/getting-started/intro).
## Setting up a Super App with Nx
@@ -48,7 +48,7 @@ Hetzner Cloud needed a solution that would streamline their development process,
After evaluating Nx and Turborepo, Hetzner Cloud selected Nx for its advanced monorepo management capabilities. They started a [Nx Enterprise](/enterprise) contract and closely collaborated with the Nx Developer Productivity Engineers to assess Hetzner's current software landscape and evaluate the best strategy. Their goal was not necessarily to create a monorepo in the first place, but to modularize their monolithic application. Nx provided the right tools to:
- **Break down the monolith** into modular packages without affecting deployment.
- **Define clear domain boundaries** using [module boundary rules](/features/enforce-module-boundaries) and [conformance rules](/nx-api/conformance).
- **Define clear domain boundaries** using [module boundary rules](/features/enforce-module-boundaries) and [conformance rules](/reference/core-api/conformance).
- **Improve ownership management** by having a more modular structure with clear boundaries allowing for easier allocaton of owernship. Something that could further be improved in the future by using [CodeOwners](/nx-enterprise/powerpack/owners).
Beyond modularization, Nx helped consolidate fragmented projects into a single, structured workspace. This reduced the overhead of maintaining multiple repositories and simplified dependency management. Using the [Nx Graph](/features/explore-graph), the team gained visibility into their project relationships, making it easier to coordinate work and optimize collaboration.
@@ -15,6 +15,11 @@ youtubeUrl: https://youtu.be/RNilYmJJzdk
- [Nx MCP Now Available for VS Code Copilot](/blog/nx-mcp-vscode-copilot)
- [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- [Save Time: Connecting Your Editor, CI and LLMs](/blog/nx-editor-ci-llm-integration)
- [Enhancing Nx Generators with AI: Predictability Meets Intelligence](/blog/nx-generators-ai-integration)
- [Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing](/blog/nx-terminal-integration-ai)
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
@@ -138,7 +143,7 @@ And this is just the beginning. While Nx already understands your local monorepo
## Try It Out Yourself
If you want to test this out, [create a new Nx workspace](/getting-started/intro#try-nx-yourself) and make sure you have [Nx Console](/getting-started/editor-setup) installed or updated to the latest version.
If you want to test this out, [create a new Nx workspace](/getting-started/start-new-project) and make sure you have [Nx Console](/getting-started/editor-setup) installed or updated to the latest version.
> If you already have an existing NPM/Yarn/PNPM workspace, you can add Nx with `nx init`. Check out [our free course](/courses/pnpm-nx-next) to learn more.
@@ -15,6 +15,11 @@ youtubeUrl: https://youtu.be/V2W94Sq_v6A
- [Nx MCP Now Available for VS Code Copilot](/blog/nx-mcp-vscode-copilot)
- [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- [Save Time: Connecting Your Editor, CI and LLMs](/blog/nx-editor-ci-llm-integration)
- [Enhancing Nx Generators with AI: Predictability Meets Intelligence](/blog/nx-generators-ai-integration)
- [Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing](/blog/nx-terminal-integration-ai)
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
+9 -9
View File
@@ -8,13 +8,13 @@ description: Discover the latest in Nx 20.5, featuring TypeScript project refere
youtubeUrl: https://youtu.be/IujhR3-Iidk
---
Time moves fast, and so do Nx releases. Lets catch up with the latest development on Nx since our [last release post for 20.3](/blog/nx-update-20-3#rfc-for-infinite-tasks).
Time moves fast, and so do Nx releases. Let's catch up with the latest development on Nx since our [last release post for 20.3](/blog/nx-update-20-3#rfc-for-infinite-tasks).
{% toc /%}
## LLM improvements galore
We think that monorepos are the solution to better AI-assisted development, and were doing the work to support that. Weve recently released updates that enhance the LLM experience for both [Copilot](/blog/nx-just-made-your-llm-smarter) and [Cursor](/blog/nx-made-cursor-smarter).
We think that monorepos are the solution to better AI-assisted development, and we're doing the work to support that. We've recently released updates that enhance the LLM experience for both [Copilot](/blog/nx-just-made-your-llm-smarter) and [Cursor](/blog/nx-made-cursor-smarter).
AI-powered coding assistants can edit files, but they're blind to the bigger picture they don't understand how your entire codebase fits together. Nx changes that. With full visibility into your monorepo's project relationships, dependencies, and ownership, Nx enables your LLM to move beyond local file changes by providing this essential monorepo context.
@@ -24,7 +24,7 @@ Take each of these for a spin and then [sign up for our webinar](/blog/are-monor
## TypeScript project references improvements
ICYMI, we announced a [new experience for TypeScript monorepos](/blog/new-nx-experience-for-typescript-monorepos) in January. The new setup is [faster, more efficient in memory use](/blog/new-nx-experience-for-typescript-monorepos#key-highlight-performance), and fixes common issues with TypeScript editor support for large monorepos. Since then, weve steadily improved this experience with many performance and quality-of-life improvements.
ICYMI, we announced a [new experience for TypeScript monorepos](/blog/new-nx-experience-for-typescript-monorepos) in January. The new setup is [faster, more efficient in memory use](/blog/new-nx-experience-for-typescript-monorepos#key-highlight-performance), and fixes common issues with TypeScript editor support for large monorepos. Since then, we've steadily improved this experience with many performance and quality-of-life improvements.
One of the significant improvements is that you can now run tasks with a partial match of the project name rather than needing to use the full name every time. Say you have these projects:
@@ -48,27 +48,27 @@ By default, Nx will use the `name` property from the `package.json` for a projec
We have also made projects inferred by `@nx/js` more efficient by eliminating the duplicate typechecks that were occurring. Previously, when `@nx/js` inferred tasks in a workspace using TypeScript project references, buildable libraries would have both a `build` and `typecheck` target inferred. However, since typechecking occurs as part of `build`, this resulted in typechecking being run twice. Now, buildable projects will only have the `build` target, saving time.
[See more details on how `@nx/js` infers tasks](/nx-api/js#how-nxjs-infers-tasks)
[See more details on how `@nx/js` infers tasks](/technologies/typescript/introduction#how-nxjs-infers-tasks)
{% youtube src="https://www.youtube.com/watch?v=O2xBQJMTs9E" /%}
## Migration docs
When `nx migrate` is run, Nx determines what migrations need to be run, but it hasn't been easy for users to understand what the migrations do. The first step we're taking to address this is providing migrations docs for each plugin, going back to version 20 of Nx. [See the Angular plugin migration for an example](/nx-api/angular/migrations).
When `nx migrate` is run, Nx determines what migrations need to be run, but it hasn't been easy for users to understand what the migrations do. The first step we're taking to address this is providing migrations docs for each plugin, going back to version 20 of Nx. [See the Angular plugin migration for an example](/technologies/angular/api/migrations).
Additionally, when running migrations, the terminal will provide links for each migration with richer information about what is actually happening. This is just our first step in addressing confusion during migrations, keep an eye out for more development here.
## ESM support for eslint config
`@nx/eslint` now uses ESM for configuration by default. This means that new workspaces will use ESM. Existing workspaces will continue to use CommonJS. We dont currently have a migration path between CommonJS and ESM because of the possibility to break something in your lint rules. Both CommonJS and ESM will be supported for the near future.
`@nx/eslint` now uses ESM for configuration by default. This means that new workspaces will use ESM. Existing workspaces will continue to use CommonJS. We don't currently have a migration path between CommonJS and ESM because of the possibility to break something in your lint rules. Both CommonJS and ESM will be supported for the near future.
## React 19 support for new workspaces
New Nx workspaces now default to React 19. Note that due to the extent of breaking changes coming with React 19, we will not be providing an automated migration to React 19 via [**`nx migrate`**](/nx-api/nx/documents/migrate). If youre ready to make this migration on your own, [see our docs about using the new `reactCompiler`](/recipes/react/react-compiler#react-compiler-with-nx)
New Nx workspaces now default to React 19. Note that due to the extent of breaking changes coming with React 19, we will not be providing an automated migration to React 19 via [**`nx migrate`**](/reference/core-api/nx/documents/migrate). If you're ready to make this migration on your own, [see our docs about using the new `reactCompiler`](/technologies/react/recipes/react-compiler#react-compiler-with-nx)
## Angular 19.2 support
`@nx/angular` now supports up to Angular 19.2 Time to give their new experimental [Resources API](https://angular.dev/guide/signals/resource) a try! If youre not quite ready to upgrade your version of Angular, remember that you can migrate to the latest Nx while keeping your current version of Angular using the `--interactive` flag during migration. [See our docs for more details](/recipes/tips-n-tricks/advanced-update#choosing-optional-package-updates-to-apply).
`@nx/angular` now supports up to Angular 19.2 Time to give their new experimental [Resources API](https://angular.dev/guide/signals/resource) a try! If you're not quite ready to upgrade your version of Angular, remember that you can migrate to the latest Nx while keeping your current version of Angular using the `--interactive` flag during migration. [See our docs for more details](/recipes/tips-n-tricks/advanced-update#choosing-optional-package-updates-to-apply).
## Vite 6 + Vitest 3 support
@@ -76,7 +76,7 @@ New Nx workspaces now default to React 19. Note that due to the extent of breaki
## Update on Infinite Tasks/Continuous Tasks
In our [20.3 release post](/blog/nx-update-20-3#rfc-for-infinite-tasks), we introduced an RFC for Infinite Tasks (now called [Continuous Tasks](https://github.com/nrwl/nx/discussions/29025)). Nx will add the concept of **Continuous tasks** which Nx will orchestrate as part of the task graph. This will allow for tasks to depend on other running tasks in addition how it already allows depending on other completed tasks. This will allow for better support of long-running tasks like backend servers for frontend applications that depend on them, or tools that run in a watch mode. Weve been hard at work implementing this feature, and you can look forward to a beta version before the release of Nx 21.
In our [20.3 release post](/blog/nx-update-20-3#rfc-for-infinite-tasks), we introduced an RFC for "Infinite Tasks" (now called [Continuous Tasks](https://github.com/nrwl/nx/discussions/29025)). Nx will add the concept of **Continuous tasks** which Nx will orchestrate as part of the task graph. This will allow for tasks to depend on other running tasks in addition how it already allows depending on other completed tasks. This will allow for better support of long-running tasks like backend servers for frontend applications that depend on them, or tools that run in a watch mode. We've been hard at work implementing this feature, and you can look forward to a beta version before the release of Nx 21.
## Fixes and improvements
@@ -109,7 +109,7 @@ When run on a single machine, `e2e-ci` will be slower because it starts multiple
npx nx connect
```
Follow the onboarding steps and you should be connected within five minutes. For more information, check out our [GitHub Actions Tutorial](/ci/intro/tutorials/github-actions) or our [guides](/ci/recipes/set-up) for all supported CI providers (GitHub, GitLab, Azure, etc.).
Follow the onboarding steps and you should be connected within five minutes. For more information, check out our [setup guides](/ci/recipes/set-up) for all supported CI providers (GitHub, GitLab, Azure, etc.).
Now, let's take a look at a concrete example to get an idea of how much time-saving you can unlock with Nx Atomizer. I created [this repo](https://github.com/jaysoo/angular-testing-demo) that contains a simple Angular application and a UI package. It also has 40 Playwright test files.
@@ -158,7 +158,7 @@ It uses Nx for running and building your project. Nx relies on the Angular Devki
}
```
If you have an existing Angular CLI project, you can also [add Nx support to it](/recipes/angular/migration/angular) by running:
If you have an existing Angular CLI project, you can also [add Nx support to it](/technologies/angular/migration/angular) by running:
```shell
npx nx init
@@ -71,7 +71,7 @@ The steps are very simple:
1. Run `nx migrate latest` to update your workspace to the latest version of Nx.
2. Run `nx g @nx/angular:convert-to-rspack` to migrate your Angular application to Rspack.
There is also a [guide in our documentation](/recipes/angular/rspack/migrate-from-webpack) that walks you through the process step-by-step.
There is also a [guide in our documentation](/technologies/angular/angular-rspack/recipes/migrate-from-webpack) that walks you through the process step-by-step.
Even if you're currently using the Angular CLI, it's as simple as first running `npx nx init` in your workspace and then running `npx nx g convert-to-rspack`.
## Using Angular Rspack
@@ -121,7 +121,7 @@ export default createConfig(
{% callout type="deepdive" title="createConfig Information" %}
The `createConfig` function is used to create an Rspack configuration object setup for Angular applications.
You can read more about it [here](/nx-api/angular-rspack/documents/create-config).
You can read more about it [here](/technologies/angular/angular-rspack/api/create-config).
{% /callout %}
### Building and Serving your Application
@@ -226,7 +226,7 @@ Exciting times ahead! You can follow our progress by starring the [Angular Rspac
## Further Reading
- [Nx Angular Rspack](/recipes/angular/rspack/introduction)
- [Nx Angular Rspack](/technologies/angular/angular-rspack/introduction)
- [Angular](https://angular.dev)
- [Rspack](https://rspack.dev)
- 🧠 [Nx Docs](/getting-started/intro)
@@ -34,7 +34,7 @@ Docusaurus has even [reported that switching to Rspack has resulted in a 2x-4x f
However, Angulars Webpack build pipeline proved to be an issue. It had not been possible to use Rspack as a drop-in replacement for Angular applications.
Which is why [Angular Rspack](/recipes/angular/rspack/introduction) was created.
Which is why [Angular Rspack](/technologies/angular/angular-rspack/introduction) was created.
## Angular Rspack
@@ -46,7 +46,7 @@ Angular Rspack provides Rspack Plugins and Loaders that makes it possible to bui
You can learn more about Angular Rspack from the resources below:
- [Angular Rspack - Introduction](/recipes/angular/rspack/introduction)
- [Angular Rspack - Introduction](/technologies/angular/angular-rspack/introduction)
- [Using Rspack with Angular](/blog/using-rspack-with-angular)
{% /callout %}
@@ -64,7 +64,7 @@ From the benchmark results below, you can see the vast improvement using Angular
You can see that the results from Rspack are comparable to the results provided by Angulars Esbuild build pipeline.
That said, it is worth noting that there are still currently some [known limitations and missing features](/recipes/angular/rspack/introduction#known-limitations-and-missing-features).
That said, it is worth noting that there are still currently some [known limitations and missing features](/technologies/angular/angular-rspack/introduction#known-limitations-and-missing-features).
## Why Choose Rspack for New Projects?
@@ -121,7 +121,7 @@ npx nx g @nx/angular:app myapp --bundler=rspack
### Converting an Existing Angular Webpack Application
If you have an existing Angular Webpack application you can easily migrate it to use Angular Rspack by using the `@nx/angular:convert-to-rspack` generator. The [Migrate Angular with Webpack to Rspack](/recipes/angular/rspack/migrate-from-webpack) guide explains more on this.
If you have an existing Angular Webpack application you can easily migrate it to use Angular Rspack by using the `@nx/angular:convert-to-rspack` generator. The [Migrate Angular with Webpack to Rspack](/technologies/angular/angular-rspack/recipes/migrate-from-webpack) guide explains more on this.
## Future Work
@@ -6,7 +6,6 @@ tags: ['nx', 'nx-console', 'ai']
cover_image: /blog/images/articles/bg-copilot-nx-mcp.avif
description: 'Learn how to enhance VS Code Copilot with Nx MCP integration, providing rich monorepo context for smarter AI assistance.'
youtubeUrl: https://youtu.be/dRQq_B1HSLA
pinned: true
---
{% callout type="deepdive" title="Series: Making your LLM smarter" expanded=true %}
@@ -16,6 +15,11 @@ pinned: true
- **Nx MCP Now Available for VS Code Copilot**
- [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- [Save Time: Connecting Your Editor, CI and LLMs](/blog/nx-editor-ci-llm-integration)
- [Enhancing Nx Generators with AI: Predictability Meets Intelligence](/blog/nx-generators-ai-integration)
- [Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing](/blog/nx-terminal-integration-ai)
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
@@ -14,6 +14,11 @@ description: 'Explore how Nx monorepos amplify AI benefits by providing complete
- [Nx MCP Now Available for VS Code Copilot](/blog/nx-mcp-vscode-copilot)
- **Nx and AI: Why They Work so Well Together**
- [Save Time: Connecting Your Editor, CI and LLMs](/blog/nx-editor-ci-llm-integration)
- [Enhancing Nx Generators with AI: Predictability Meets Intelligence](/blog/nx-generators-ai-integration)
- [Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing](/blog/nx-terminal-integration-ai)
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
@@ -103,7 +103,7 @@ Or more generically:
- `{ciTargetName}--{path/to/test/file}`
You can find more information on how to configure the Atomizer on the respective [Jest](/nx-api/jest#splitting-e2e-tests), [Cypress](/nx-api/cypress#nxcypress-configuration), [Playwright](/nx-api/playwright#nxplaywright-configuration), [Gradle](/nx-api/gradle/documents/overview#nxgradle-configuration) or follow [this recipe](/extending-nx/recipes/project-graph-plugins) to create your own inferred plugin.
You can find more information on how to configure the Atomizer on the respective [Jest](/technologies/test-tools/jest/introduction#splitting-e2e-tests), [Cypress](/technologies/test-tools/cypress/introduction#nxcypress-configuration), [Playwright](/technologies/test-tools/playwright/introduction#nxplaywright-configuration), [Gradle](/technologies/java/introduction#nxgradle-configuration) or follow [this recipe](/extending-nx/recipes/project-graph-plugins) to create your own inferred plugin.
## Manual E2E Project Splitting
+5
View File
@@ -15,6 +15,11 @@ youtubeUrl: https://youtu.be/fPqPh4h8RJg
- [Nx MCP Now Available for VS Code Copilot](/blog/nx-mcp-vscode-copilot)
- [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- **Save Time: Connecting Your Editor, CI and LLMs**
- [Enhancing Nx Generators with AI: Predictability Meets Intelligence](/blog/nx-generators-ai-integration)
- [Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing](/blog/nx-terminal-integration-ai)
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
+3 -4
View File
@@ -6,7 +6,6 @@ tags: ['nx', 'release']
cover_image: /blog/images/2025-05-05/header.avif
description: 'Discover the latest in Nx 21, featuring continuous tasks and the new Terminal UI'
youtubeUrl: https://youtu.be/9zsncTxfcl4
pinned: true
---
{% callout type="deepdive" title="Nx 21 Launch Week" expanded=true %}
@@ -128,13 +127,13 @@ To test how performance improved, we forked the Spring Boot repo and converted i
These two changes make the `@nx/gradle` plugin better than ever for managing your Gradle plugins. Be sure to explore this new plugin if you're using Gradle, and watch out for what else we're bringing to the Java ecosystem, later this year.
[Check out the docs for more details.](/nx-api/gradle)
[Check out the docs for more details.](/technologies/java/introduction)
## Migrate UI in Nx Console makes migrations easier than ever
![Screenshot of Nx Console's Migrate UI showing a list of migrations to approve.](/blog/images/2025-05-05/migrate-ui.avif)
[Automated migrations](/features/automate-updating-dependencies) have always been a massively valuable part of Nx. Previously, we [added migration docs](/nx-api/angular/migrations) to better inform you of what's happening during these migrations. Now, we're bringing the migration process to the Nx Console so that you can step through migrations even easier than before.
[Automated migrations](/features/automate-updating-dependencies) have always been a massively valuable part of Nx. Previously, we [added migration docs](/technologies/angular/api/migrations) to better inform you of what's happening during these migrations. Now, we're bringing the migration process to the Nx Console so that you can step through migrations even easier than before.
After updating to the latest version of Nx Console, you'll see a **new Migrate UI panel**. Through this, you'll be able to start a migration, install packages, and then individually approve different migrations. You'll be able to see the change before approving and moving on to the next one. This allows for better visibility into each change and helps you stay informed. As always, you'll have an option to commit after each change or squash them together into a single commit.
@@ -146,7 +145,7 @@ This is another item we're excited to talk about more later this week.
If you're using React Router in declarative or data mode, you can continue using the existing workflows that build your React app.
However, if you're ready to start a new app using the framework mode in React Router or need to migrate a Remix app to React Router, we've got you covered. Our new [inferred task plugin](/recipes/react/react-router) will handle running the React Router CLI based on projects with a React Router config file. If you're migrating from Remix, follow the React Router team's [migration guidance](https://reactrouter.com/upgrading/remix). Once migrated, you can remove the Remix plugin and use the React Router plugin.
However, if you're ready to start a new app using the framework mode in React Router or need to migrate a Remix app to React Router, we've got you covered. Our new [inferred task plugin](/technologies/react/recipes/react-router) will handle running the React Router CLI based on projects with a React Router config file. If you're migrating from Remix, follow the React Router team's [migration guidance](https://reactrouter.com/upgrading/remix). Once migrated, you can remove the Remix plugin and use the React Router plugin.
## Updated release versioning
@@ -27,9 +27,9 @@ However, before even being able to contemplate that, a different feature needed
We have introduced three new [Rspack](https://rspack.dev) Plugins for Module Federation that can be used with Nx.
- [NxModuleFederationPlugin](/nx-api/module-federation/documents/nx-module-federation-plugin): Gathers information from the Nx Workspace to correctly configure `rspack.ModuleFederationPlugin`
- [NxModuleFederationDevServerPlugin](/nx-api/module-federation/documents/nx-module-federation-dev-server-plugin): Used to handle the static-serving of non-dev remotes for CSR applications
- [NxModuleFederationSSRDevServerPlugin](/nx-api/module-federation/documents/nx-module-federation-dev-server-plugin#server-side-rendering): Used to handle the static-serving of non-dev remotes for SSR applications
- [NxModuleFederationPlugin](/technologies/module-federation/recipes/nx-module-federation-plugin): Gathers information from the Nx Workspace to correctly configure `rspack.ModuleFederationPlugin`
- [NxModuleFederationDevServerPlugin](/technologies/module-federation/recipes/nx-module-federation-dev-server-plugin): Used to handle the static-serving of non-dev remotes for CSR applications
- [NxModuleFederationSSRDevServerPlugin](/technologies/module-federation/recipes/nx-module-federation-dev-server-plugin#server-side-rendering): Used to handle the static-serving of non-dev remotes for SSR applications
These are true Rspack Plugins that should be added to the `plugins: []` of an `rspack.config` file.
@@ -133,8 +133,8 @@ With the new [Terminal UI](/recipes/running-tasks/terminal-ui) you can very easi
## Further Reading
- [Module Federation and Nx](/concepts/module-federation/module-federation-and-nx)
- [Nx Module Federation Technical Overview](/concepts/module-federation/nx-module-federation-technical-overview)
- [Module Federation and Nx](/technologies/module-federation/concepts/module-federation-and-nx)
- [Nx Module Federation Technical Overview](/technologies/module-federation/concepts/nx-module-federation-technical-overview)
- 🧠 [**Nx Docs**](/getting-started/intro)
- 👩‍💻 [**Nx GitHub**](https://github.com/nrwl/nx)
- 💬 [**Nx Official Discord Server**](https://go.nx.dev/community)
-1
View File
@@ -6,7 +6,6 @@ tags: ['nx']
cover_image: /blog/images/2025-05-09/terminal-ui.avif
description: 'Nx 21 introduces the new Terminal UI, an elegant way of viewing log output from multiple running tasks.'
youtubeUrl: https://youtu.be/ykaMAh83fPM
pinned: true
---
{% callout type="deepdive" title="Nx 21 Launch Week" expanded=true %}
@@ -16,6 +16,10 @@ youtubeUrl: https://youtu.be/PXNjedYhZDs
- [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- [Save Time: Connecting Your Editor, CI and LLMs](/blog/nx-editor-ci-llm-integration)
- **Enhancing Nx Generators with AI: Predictability Meets Intelligence**
- [Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing](/blog/nx-terminal-integration-ai)
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
@@ -118,7 +122,7 @@ To use this feature, you'll need:
Once set up, you can start leveraging this powerful combination of predictable generators and intelligent AI assistance.
This integration is just one example of our broader vision for AI-enhanced development with Nx, providing useful and deep integration of LLMs into your development workflow. Currently we're looking into integrating our [new Nx terminal UI](blog/nx-21-terminal-ui) with your coding assistant, allowing for some interesting new AI powered workflows.
This integration is just one example of our broader vision for AI-enhanced development with Nx, providing useful and deep integration of LLMs into your development workflow. Currently we're looking into integrating our [new Nx terminal UI](/blog/nx-21-terminal-ui) with your coding assistant, allowing for some interesting new AI powered workflows.
That said, don't forget to subscribe to our [YouTube channel](https://www.youtube.com/@nxdevtools) or [subscribe to our newsletter](https://go.nx.dev/nx-newsletter) for future announcements and demonstrations.
@@ -0,0 +1,292 @@
---
title: 'A Practical Guide on Effective AI Use - AI as Your Peer Programmer'
slug: practical-guide-effective-ai-coding
authors: ['Victor Savkin']
tags: ['ai', 'development', 'productivity', 'best-practices']
cover_image: /blog/images/articles/bg-practical-ai-guide-part-1.avif
description: 'Learn how to effectively use AI coding assistants beyond simple prompts. Discover proven workflows, best practices, and strategies that transform AI from a novelty into a powerful development multiplier.'
pinned: false
---
> _"Tools amplify your talent. The better your skills, the better the tools serve you."_ — Andrew Hunt, The Pragmatic Programmer
_This is the first post in the series. Much of it aggregates the insights of colleagues at Nx (Juri Strumpflohner, James Henry, and others)
and other developers I frequently discuss this topic with (special thanks to Matt Briggs, who is a de-facto co-author of this post)._
**The main takeaway from this guide**: Being intentional and investing in workflows instead of just "using Cursor" or "chatting with GPT" is what separates effective AI-assisted development from impressive demos that don't translate to real productivity gains.
AI can supercharge your development process, but it's not a magic wand. It's like learning to use power tools - requiring practice to master but transformative once you do. The difference between developers who get 10-30% productivity gains and those who struggle with AI comes down to **having proper procedures and workflows** rather than shooting random prompts at their LLM.
{% toc /%}
## Setting Realistic Expectations
AI can enhance your development process significantly. It's useful for:
- Coding
- Thinking
- Content creation
- Learning
Depending on the company you work at and your position, how you use AI will be drastically different. A web developer at a startup spends much of their day coding. A VP at a financial organization may not have written code in years and would benefit more from content creation and thinking. Regardless, you'll find useful patterns here.
For software engineers, expected outcomes with proper AI implementation:
- Faster coding on real projects (10-30% in my personal experience)
- Faster content creation (30-50% in my personal experience)
- Improved code quality
- Accelerated skill acquisition
Getting there requires patience and experimentation. We're all figuring this out together as tools improve every few months. No one has mastered AI-assisted development yet. Give yourself room to build this skill - the learning curve is real but worth climbing.
However, set your expectations right. **The total output of your team won't go up by 30%, especially in large organizations.** Engineers in large organizations spend only a fraction of their time coding, creating content, and learning new skills. Smaller teams will get much more leverage out of using AI.
## Tool Categories, Agents and Some Recommendations
The AI space is awash with investment, making any list quickly outdated. Effective workflows typically combine tools from multiple categories.
### Main Tool Categories
- **AI-integrated Editors** - VSCode, Cursor, Windsurf, Roo Code, Intellij, Zed. Most developers' primary coding environment with integrated AI capabilities.
- **Terminal-based AI Agents** - Claude Code, Codex, Aider. Command-line tools for delegating coding tasks directly from terminal.
- **Dedicated Web/Desktop Applications** - Offer unrestricted model capabilities and features like research agents and web search, despite lacking codebase context.
- **Cloud-based Agents** - Devin, Copilot, Codex. Finally reaching reliability for simple task delegation on real projects.
- **Code Review Tools** - Graphite Diamond, Copilot. Provide early PR feedback and are increasingly useful.
For tasks outside specific coding work - research, planning, documentation, and general problem-solving - I rely on dedicated web/desktop applications that offer broader capabilities:
- **Claude Desktop** - Large context, web search, research capabilities, robust MCP support (some features require expensive Claude Max)
- **ChatGPT** - Image creation, web search, research capabilities (less code-proficient than competitors)
- **AI Studio (Gemini)** - Massive context window, code-optimized models, Google search integration
- **T3 Chat** - A fast web-based chat client that allows you to switch between multiple models and comes with a competitive, convenient pricing approach.
- **ChatWise** - A desktop-based chat client that uses a bring-your-own-key strategy, allowing you to integrate with all the models out there. You can provision a key via [OpenRouter](https://openrouter.ai/) or directly plug in the key.
All five are comparable - consistency matters more than choice. I personally value MCP integrations, so primarily use Claude Desktop.
**Model Control Protocols (MCPs)** are plug-and-play tools that AI can use to fulfill requests. They're remarkably quick to create and integrate with most agent-based tools and Claude desktop. MCPs are particularly valuable as they can enhance any of the above tool categories, providing specialized capabilities and integrations that extend the base functionality of AI coding assistants. This is exactly how we integrate Nx's capabilities with existing coding assistants like VS Code Copilot and Cursor - [learn more about our MCP implementation](/blog/nx-mcp-vscode-copilot).
### Agent Types
The most important type of tool you would use while coding is an Agent. Most of the AI work you do in Cursor, Windsurf or JetBrains is done via Agents. You can chat with agents to instruct it to do several things to your code base. Agents have built-in capabilities (integrating with your editor) and can be extended via MCP.
**There are two styles of agents:** interactive and non-interactive
### Interactive Agents (Quick Doers)
These are your everyday workhorses for AI-assisted coding. They're quick, cost-effective, but with some capability limitations.
**Recommended options:**
- **Cursor** (VSCode fork)
- **Windsurf** (Available as VSCode fork or JetBrains plugin)
- **Copilot** (VSCode native integration; almost as effective as Cursor/Windsurf and improving fast)
### Non-interactive Agents (Deep Thinkers)
More precise than interactive assistants but slower and pricier - like precision power tools versus hand tools. These excel at widespread codebase changes requiring sub-agents or extensive context.
**Recommended options:**
- **Claude Code** (terminal-based interface)
- **OpenAI Codex** (terminal-based interface)
- **JetBrains Junie**
They get less attention online because most streamers do work that works well with interactive agents. Any agent can put together a web page. "Deep Thinkers" can spend many minutes performing an operation which doesn't make for impressive videos, but they're very valuable when working on real complex systems.
Most of my work involves distributed systems, where interactive agents aren't particularly effective. In these systems, application behavior isn't easily derivable from source code—things operate at a higher level of abstraction.
I get significantly more leverage from tools like Claude Code (or Junie) than Cursor/Copilot, which creates more robust plans and provide real value in my domain. But even with Claude Code I use specific patterns and prompt and keep it on a short leash.
For tasks like writing new scripts or building web UIs, I find Copilot or Cursor work better.
## The Main Rule: Understanding and Quality over Speed
> Never commit code you don't understand.
While AI may write it, you are responsible for every character. Understanding your code completely is essential. Read, understand, investigate the code that AI generates.
If AI generates subpar code, improve it and learn how to get better results. The goal is AI that produces what you would have written yourself.
**Effective AI use means:**
- More thinking and reading
- Less typing
One of the greatest risks of using AI is generating large amounts of code that are poorly understood and do not integrate well with the overall system architecture. Mitigate this risk. **AI tools create space for better engineering practices - not just cramming in more features. **
**Critical thinking and deep codebase familiarity remain essential. They're the foundation for effective AI use.**
### Beyond "Vibing" with AI
AI is much better at being impressive compared to being correct. There's a lot of excitement in creating quick prototypes using AI without understanding what the code does. This can be useful but it is not software engineering. It's closer to sketching, wireframing, exploring.
Although impressive demos get attention, the vast majority of effort is spent on non-prototypes. And there is a lot more gain to be had in optimizing actual engineering workflows.
## The Core Workflow
The most effective AI-assisted development follows a structured approach: **Plan → Act → Review → Repeat**. This isn't just good practice - it's essential for avoiding the common pitfalls that lead to frustration and wasted time.
### Plan
![Planning Phase Workflow](/blog/images/articles/ai-flow-planning-phase.avif)
Keep the agent in discussion mode - no code execution yet. Provide necessary context. For complex features, thorough planning preserves the necessary context between executions.
The amount of planning needed depends on the task. Small tasks require minimal planning, but skipping planning for large tasks virtually guarantees poor results.
Planning needs substantial context. This is where tools like [Nx's AI integration](/features/enhance-AI) shine by providing agents with derived context about your codebase architecture, team responsibilities, and organizational boundaries. All of these helps LLMs and humans operate from the same architectural and organizational context.
For large changes, it's a good idea to persist the created plan to disk.
### Act
![Acting Phase Workflow](/blog/images/articles/ai-flow-acting-phase.avif)
Ask the agent to execute the plan.
Stay engaged. Monitor execution and check work in progress. Halt immediately if problems arise or new information emerges, then return to planning. Sometimes Agents can get stuck. If this happens, remind them of their original objective. A useful technique is to break the current task into smaller subtasks and have the agent focus on the first one.
An Agent's effectiveness increases dramatically when it can use higher-level operations. Without these, ensuring consistency and adherence to best practices becomes much harder. This primarily affects real organizations, not demo projects, as demos don't need to be correct or follow best practices. That was a big focus for us when developing Nx MCP (which provides many tools that help guarantee consistency and compliance with standards) because of us working with a lot of large companies with 1000s of engineers working in the same org.
Agents excel at being almost right but struggle with executing exactly what's required. Good interactions should include requesting user input for high-impact operations that are difficult to adjust later (like creating a new package). For instance, when using Nx, an Agent would open a UI with pre-filled generator options that users can modify and confirm. The Agent then continues the work from that point. Have a look at our [latest blog post for a deeper dive into what this looks like](/blog/nx-generators-ai-integration).
If things go sideways, don't hesitate to reset: dump context, revert changes, and start fresh. These tools drastically reduce "grunt work" costs, making restarts practical.
### Review
![Review Phase Workflow](/blog/images/articles/ai-flow-review-phase.avif)
Even though I try to keep a document where I note things that will require a follow-up, most likely won't keep pace with the agent's output. That's why it's important to do a thorough review afterward. Most often I make small changes directly, but sometimes I ask the agent to make them for me.
### Repeat
The process can vary, but it follows this general pattern.
**Common mistakes**: skipping either "Plan" or "Repeat" - both are essential. Do not skip them when working on real projects.
## Using Rules and Persistent Context
Every AI coding assistant offers automatic prompt inclusion: Cursor rules, Windsurf rules etc. These are essential for consistent output.
Keep it manageable - a few hundred lines work well. Your rules should document coding style, recurring patterns, and in some cases architecture. If you repeat yourself during development, encode it in rules.
For persistent prompts, create a human-readable version and let AI optimize it for machines. AI excels at prompt engineering - focus on tweaking, not creating from scratch.
### Example Workflow for Rules
1. Create `STANDARDS.md` with coding standards
2. Review with AI and request clarifications
3. Identify gaps (AI can help) and address them
4. Format standards appropriately
5. Update rules files
I have a Claude project where I discuss coding standards and other topics that often end up in rules files.
### For Working on Features
For every major PR I worked on, I often kept a notes document with the issue description, my thoughts, architecture notes, specs, TODOs, and progress. Turns out, wonderful things happen when you let AI see it.
Maintain a `PR.md` at project root. Start with issue instructions and update it with any relevant information about the PR you are working on. With this, you can instantly provide context in any chat.
Create implementation steps and save the checklist in `PR.md`. Start separate chats for each step, checking off as you complete them. Add new steps as things become clearer.
## Quick Recommendations
### Documentation & Planning
- Use AI to document - documentation costs drop 10x with AI assistance
- Leverage AI for planning - preparation costs decrease drastically
- Explicitly reference examples to produce consistent documents
- Use Claude Projects (or other similar affordances) to improve repeatability
### Debugging & Fixing
- Always plan/ask before fixing a non-trivial issue
- Paste a stack trace and ask to explain what caused it. AI is very good at this.
- When dealing with non-trivial problems, ask for several solutions
### Session Management
- Commit code frequently (you will undo often)
- Keep chat sessions short to prevent context drift
- Start fresh chats for each issue/task
- If you use Claude Code, use "/compact" to keep a summary in the context.
- If not available, do an ad-hoc compact by requesting a summary before starting a new chat
### Task Structure
- Plan first, then divide into incremental tasks
- Keep individual tasks straightforward and simple
- Focus on iterative tasks - AI performs better with focused objectives
### Coding Approach
- Maintain consistent code style - AI generates better matches when surrounding code is consistent
- Avoid clever solutions - AI is much better at dealing with boring code
- Use well-known idioms - AI knows them and can process them very effectively
- Use AI to generate or modify tests. Tests are often linear, simple and formulaic. AI excels at manipulating such code.
## Handling Hallucinations
Hallucinations remain a significant challenge for LLMs, though the problem has improved over the past year. If a solution seems suspiciously perfect, prompting the AI with "are you sure?" often triggers self-correction. This issue is diminishing as more tools provide MCP servers with access to current documentation. The Nx MCP server, for example, reduces hallucinations by providing direct access to up-to-date documentation.
## Understand What Models are Good At
Every AI journey follows the same arc: initial awe at its superhuman abilities, then disillusionment when it fails at basic math or fabricates facts, before finally reaching a balanced understanding of AI's strengths and limitations.
## AI as a Mighty Refactoring Tool
AI excels with formulaic, pattern-based code - much like a powerful template engine. **Tests represent the perfect application**: developers can achieve higher quality and greater coverage while investing significantly less time.
Similarly, AI transforms documentation from time-consuming to nearly effortless. The cost approaches zero for both inline module comments and comprehensive documentation files, eliminating any practical excuse for poor documentation.
Code translation tasks - converting between natural language and programming syntax - also benefit tremendously from AI assistance, dramatically accelerating these previously tedious processes.
Once you recognize that AI can make some operations almost free while others remain beyond its reach, you start structuring your work differently. You divide tasks into units where AI can handle specific parts in isolation. It's like refactoring tools—knowing they can make certain transformations free changes how you approach large code changes.
## AI as a Debugger
When I work on distributed systems and hit a problem, AI rarely offers an immediate solution, but it's still invaluable. Explaining complex problems to a system capable of understanding often reveals connections your mind hasn't made.
Effective AI debugging strategies:
- Ask "What is missing?" when evaluating a theory
- Ask for alternative theories
- Use AI to organize and format disorganized thoughts
- Also, AI excels at pattern matching, so feed it logs and see what it finds.
Nx 21+ can pipe its terminal output (and other information) to your AI agent, so you can simply ask "Why is my command failing?"
## AI as Stack Overflow
AI delivers immense value as an educational tool. Unlike static resources, AI enables true dialogue. You can:
- Ask questions in any format
- Request simplified explanations when confused
- Test your understanding by explaining concepts back
- Take personalized quizzes
- Receive evaluations of your comprehension
- Get recommendations for logical next learning steps
Make sure the AI gets this information through web search to provide up-to-date results.
Another technique I use is when learning a new tool, I provide the website URL and ask Claude to review the entire site to answer a set of questions. This saves me hours of research and lets me explore documentation in a very different way.
Similar to Stack Overflow, AI can have a negative effect on learning because it provides answers without the supporting information needed to build a mental model and understand why the answer makes sense. For me, it's not a replacement for a good book or course, but a good complementary tool.
## The Long View: Building Sustainable AI Workflows
The trajectory is clear: developers who invest in proper AI workflows and understand the tools' capabilities will have a growing competitive advantage. **The key is being intentional about your approach rather than hoping that better prompts will magically solve workflow problems.**
Start small, experiment with the patterns outlined here, and gradually build your AI-assisted development skills. The investment in learning proper workflows pays dividends as the technology continues to evolve.
---
Learn more:
- 🧠 [Nx AI Docs](/features/enhance-AI)
- 📖 [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- 📖 [Combining Predictability and Intelligence With Nx Generators and AI](/blog/nx-generators-ai-integration)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 👩‍💻 [Nx Console GitHub](https://github.com/nrwl/nx-console)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -1,16 +1,16 @@
---
title: "**Build Better,Ship ****Faster: ****Monorepos, Apps, & Component Libraries **with Nx Cloud"
title: "Build Better, Ship Faster: Monorepos, Apps, & Component Libraries with Nx Cloud"
description: "Unlock faster development and more efficient CI/CD workflows with Nx and Bitovi.
Bitovi's Ilyass Elfouih and Nx's Jordan Powell will walk through a **real-world scenario** where a frontend team updates a shared component, faces a classic code owner approval challenge, and uses Nx Cloud to fix and validate the change without triggering a full test suite."
date: 2025-05-14
slug: 'build-bettershipfaster-monorepos-apps-component-libraries-with-nx-cloud'
slug: 'build-better-shipfaster-monorepos-apps-component-libraries-with-nx-cloud'
authors: ['Jordan Powell (Nx)', 'Ilyass Elfouih (Bitovi)']
tags: [webinar]
cover_image: /blog/images/2025-05-28/Nx-Partner-Webinar---May-2025.avif
time: 1pm ET/5pm UTC
status: Upcoming
registrationUrl: https://bit.ly/4jQLCqp
status: Past - Ungated
registrationUrl: https://bit.ly/4kv5tfb
---
**May 28, 2025 - 1pm ET/5pm UTC**
@@ -21,4 +21,4 @@ Unlock faster development and more efficient CI/CD workflows with Nx and Bitovi.
Bitovi's Ilyass Elfouih and Nx's Jordan Powell will walk through a **real-world scenario** where a frontend team updates a shared component, faces a classic code owner approval challenge, and uses Nx Cloud to fix and validate the change without triggering a full test suite.
{% call-to-action title="Register today!" url="https://bit.ly/4jQLCqp" description="Save your spot" /%}
{% call-to-action title="View the recording" url="https://bit.ly/4kv5tfb" description="Watch on youtube" /%}
@@ -0,0 +1,115 @@
---
title: 'Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing'
slug: nx-terminal-integration-ai
authors: ['Juri Strumpflohner']
tags: ['nx', 'nx-console', 'ai', 'terminal']
cover_image: /blog/images/articles/bg-nx-tui-llm-integration.avif
description: 'Learn how Nx Console now enables AI assistants to read your terminal output in real-time, automatically detecting and fixing development errors as they happen.'
youtubeUrl: https://youtu.be/Cbc9_W5J6DA
pinned: false
---
{% callout type="deepdive" title="Series: Making your LLM smarter" expanded=true %}
- [Nx Just Made Your LLM Way Smarter](/blog/nx-just-made-your-llm-smarter)
- [Making Cursor Smarter with an MCP Server For Nx Monorepos](/blog/nx-made-cursor-smarter)
- [Nx MCP Now Available for VS Code Copilot](/blog/nx-mcp-vscode-copilot)
- [Nx and AI: Why They Work so Well Together](/blog/nx-and-ai-why-they-work-together)
- [Save Time: Connecting Your Editor, CI and LLMs](/blog/nx-editor-ci-llm-integration)
- [Enhancing Nx Generators with AI: Predictability Meets Intelligence](/blog/nx-generators-ai-integration)
- **Your AI Assistant Can Now Read Your Terminal: Real-Time Development Error Fixing**
- [Introducing Self-Healing CI for Nx and Nx Cloud](/blog/nx-self-healing-ci)
- [Analyze Your Nx Cloud Runs With Your AI Assistant](/blog/nx-cloud-analyze-via-nx-mcp)
- [Automatically Fix your CI Failures with JetBrains AI Assistant](/blog/jetbrains-ci-autofix)
{% /callout %}
One of the most frustrating aspects of working with AI coding assistants has been **their inability to see what's happening in your terminal**. When your development server crashes with an error, you'd have to manually copy the error message, paste it into your chat, and explain the context.
**Not anymore.** We've just shipped an integration that allows your AI assistant to access your [Nx terminal](/blog/nx-21-terminal-ui), the tasks that are currently running as well as their output. This opens up a whole new interaction workflow where you don't have to provide context: the LLM "would just know" about it. Let's dive in.
{% toc /%}
## Let's backtrack for a second - what's this actually about?
Besides helping you write new code, LLMs are also great at helping you debug issues. Stacktraces are ideal for that because they provide a lot of information. To involve your AI assistant, you'd usually copy & paste the stacktrace to your chat window, or use the "Add to Chat" functionalities of editors.
![](/blog/images/articles/llm-add-to-chat.avif)
While this works perfectly, **we figured we can do better**. We want to open up the workflow so that the LLM can independently - even as part of a separate interaction - just grab the necessary context from the terminal to satisfy a user request with more precision.
To demo that, I can just ask `What's currently running in my terminal` or even more concretely `Help me fix my broken dev server`:
![](/blog/images/articles/nx-tui-llm-fix-my-broken-code.avif)
As a side note, for convenience, we also added a shortcut directly to our Nx terminal UI that allows you to send the output to a new LLM chat conversation.
![](/blog/images/articles/nx-tui-send-to-llm.avif)
## Technical architecture: How does this actually work?
![](/blog/images/articles/nx-llm-terminal-integration.avif)
This integration leverages several components working together:
- **Nx Console as the MCP Host**: [Nx Console](/getting-started/editor-setup) acts as the Model Context Protocol (MCP) host, providing the communication bridge between your AI assistant and the Nx ecosystem.
- **JSON RPC Communication**: When you launch the new Nx terminal UI, Nx Console establishes a JSON RPC server that creates a communication channel between the terminal running your tasks, the Nx Console instance in your editor, and your AI assistant through the MCP.
- **Nx Terminal UI**: The new [Nx Terminal UI](/blog/nx-21-terminal-ui) connects to this RPC server to send updates on the current tasks that are run, their state and output.
When the LLM assistant requires knowledge about the tasks or terminal output, it communicates via the Nx MCP hosted by Nx Console, which in turn returns the relevant data.
Some things to point out here:
- **This also works if you run the Nx TUI in another terminal, like Warp.** It doesn't have to run within VSCode or Cursor. As long as Nx Console runs in one of the editors (for this workspace), the Nx TUI would be able to connect to it.
- All of this is also **made in a way that it is "workspace-aware"**, ensuring that the terminal communication is tied to the correct workspace instance, so you don't get confused data if you have multiple Nx workspaces running simultaneously.
## Why this integration is powerful
This terminal integration gives your AI assistant **complete visibility into the three critical areas of your development workflow**:
- **Source Code**: Your LLM already has access to your codebase, which gets significantly enhanced by the [Nx MCP's higher-level structural understanding](/blog/nx-mcp-vscode-copilot) of workspace architecture, project relationships, and monorepo organization.
- **Browser Environment**: For web applications, you can combine this with browser monitoring tools like [Playwright MCP or BrowserTools MCP](https://github.com/AgentDeskAI/browser-tools-mcp) to give your AI assistant access to console logs, network requests, and browser dev tools data.
- **Terminal Output**: And now, with this new feature, your AI assistant has direct access to terminal processes, build outputs, error logs, and running tasks.
**But this isn't just about convenience** (though never having to copy-paste stack traces again is pretty amazing). The real power lies in **autonomous context retrieval**: your LLM can now independently call into terminal processes and output logs whenever it determines this information might be useful to satisfy your request, without you explicitly saying "fix my terminal" or "look at the terminal."
## Getting started
To use this feature, you'll need:
1. **[Nx Console](/getting-started/editor-setup)** installed in your editor
2. **The [Nx MCP server configured](/features/enhance-AI)** for your AI assistant
3. **The new Nx terminal UI** (available in the latest version of Nx)
Once set up, simply run your development tasks through Nx and start asking your AI assistant for help when issues arise.
## Looking forward
This terminal integration represents another crucial step in our core mission at Nx: **improving developer experience and making LLMs truly usable for large-scale workspaces**. The key to achieving this lies in providing LLMs with comprehensive context, enabling them to make better-informed decisions rather than operating in isolation.
Large monorepos present unique challenges that generic AI assistants simply can't handle effectively without deep contextual understanding. By systematically exposing different layers of your development environment to LLMs, we're building a complete picture that enables truly intelligent assistance:
- **Workspace Structure Context**: Through our [MCP integration](/blog/nx-mcp-vscode-copilot), LLMs gain architectural awareness of your monorepo - understanding project relationships, dependencies, and organizational patterns that are crucial for making informed development decisions.
- **CI Pipeline Context**: Our [CI integration](/blog/nx-editor-ci-llm-integration) provides LLMs with real-time visibility into build failures, test results, and deployment status, enabling proactive problem-solving before issues compound.
- **Terminal Context**: And now, with this terminal integration, LLMs have access to local development processes, build outputs, and runtime errors - completing the picture of your development environment.
This isn't just about convenience (though never having to copy-paste stack traces is pretty amazing). **It's about fundamentally changing how AI assistants understand and interact with complex development workflows.** When an LLM has visibility into your workspace architecture, your CI pipeline status, and your local terminal output, it can provide contextually relevant assistance that actually scales with your codebase complexity.
We're already working on even more "agentic" features that will further enhance this integrated experience, **making your AI assistant a reliable peer programmer** that actually provides value.
---
Learn more:
- 🧠 [Nx AI Docs](/features/enhance-AI)
- 🛠️ [Nx Terminal UI](/blog/nx-21-terminal-ui)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 👩‍💻 [Nx Console GitHub](https://github.com/nrwl/nx-console)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
+370
View File
@@ -0,0 +1,370 @@
---
title: 'Building an MCP Server with Nx'
slug: building-mcp-server-with-nx
authors: ['Max Kless']
tags: ['nx', 'mcp', 'ai', 'node']
cover_image: /blog/images/articles/bg-building-mcp-server.avif
description: 'Learn how to build a Model Context Protocol (MCP) server using Nx to make your applications AI-ready.'
---
Since the Model Context Protocol (MCP) [was released by Anthropic in late 2024](https://www.anthropic.com/news/model-context-protocol), it has quickly become an important part of the AI ecosystem. The [MCP provides an open standard](https://modelcontextprotocol.io/introduction) for connecting AI agents to the rest of the world - the web, software systems and developer tools, just to name a few examples.
We've been busy building the [Nx MCP server](/features/enhance-AI), which gives LLMs deep access to your monorepo's structure. It helps AI tools to better understand your workspace architecture, browse the Nx docs and even trigger actions in your IDE like executing generators or visualizing the graph.
{% youtube
src="https://www.youtube.com/watch?v=fPqPh4h8RJg"
title="The MCP Server that fixes CI for you"
width="100%" /%}
There are many examples of MCP servers for popular tools popping up all over the place. [Check out the official MCP repo](https://github.com/modelcontextprotocol/servers) to see a long list of reference servers as well as official and community integrations.
Whatever you're building, it's becoming more and more important to ensure that AI systems can interact with your software. So let's learn how to build your very own MCP server to make your technology be usable for AI - all from an Nx monorepo!
{% toc /%}
---
In this series of blog posts, we'll be using a fictional startup as an example: Astra Arcana - a bewitched SaaS company that lets you cast spells from anywhere with a few simple clicks.
![Screenshot of the Astra Arcana app visualizing a spell](/blog/images/2025-05-29/astra-arcana-screenshot.avif)
You can go and try casting some spells right away at [https://astra-arcana.pages.dev/](https://astra-arcana.pages.dev/)
Of course, like any modern software company, they need to be ready for the coming shift towards AI - let's help them by building an MCP server that lets you browse ingredients and cast spells directly from your AI chat!
---
## Setting up the Server
{% callout type="info" title="Code Along" %}
If you want to code along and build your own mcp server, clone the [https://github.com/MaxKless/astra-arcana](https://github.com/MaxKless/astra-arcana) repo on GitHub to get started.
{% /callout %}
Astra Arcana is built in an Nx monorepo, where the web app and api live. There's also a shared types library as well as the Typescript SDK, which lets users programmatically cast spells.
```
apps
├── web
└── api
libs
├── spellcasting-types
└── spellcasting-sdk
```
We will create a new Node application that contains our MCP server and use the Typescript SDK to power it.
### Creating the MCP Server
MCP are JSON-RPC servers that communicate with clients via stdio or http. Thankfully, [the official Typescript SDK](https://github.com/modelcontextprotocol/typescript-sdk) abstracts away large pieces of the implementation, making it easier to get started - let's get started by installing it.
```shell
npm install @modelcontextprotocol/sdk
```
We'll continue by installing the `@nx/node` plugin and using it to generate a new Node application:
```shell
npx nx add @nx/node
```
```shell
npx nx generate @nx/node:application --directory=apps/mcp-server --framework=none --no-interactive
```
This generates a basic node application:
```
UPDATE package.json
CREATE apps/mcp-server/src/assets/.gitkeep
CREATE apps/mcp-server/src/main.ts
CREATE apps/mcp-server/tsconfig.app.json
CREATE apps/mcp-server/tsconfig.json
UPDATE nx.json
CREATE apps/mcp-server/package.json
UPDATE tsconfig.json
```
In `package.json`, you'll see that Nx has configured a build and serve target for our app that uses `webpack`. Now that our setup is ready, let's implement the actual server.
First, let's import some things and set up an instance of `McpServer`. This is part of the MCP SDK and will take care of actually implementing the [Protocol Layer](https://modelcontextprotocol.io/docs/concepts/architecture#core-components) of the [MCP specification](https://modelcontextprotocol.io/specification/2025-03-26), for example how to communicate with the client.
```ts {% fileName="apps/mcp-server/src/main.ts" %}
import { SpellcastingSDK } from '@astra-arcana/spellcasting-sdk';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = new McpServer({
name: 'Astra Arcana',
version: '1.0.0',
});
```
Next, we'll register a set of MCP tools. A tool is essentially a function that the AI model can call, passing some input parameters if necessary. Instead of constructing API calls manually, our tools will expose three main parts of casting a spell with the Spellcasting SDK: Ingredients, Incantations and Recipes. This is really the core piece of the MCP server, as it defines what it can do. There are [other features you can implement](https://modelcontextprotocol.io/docs/concepts/resources), but currently, tools are by far the most widely supported and important part.
```ts {% fileName="apps/mcp-server/src/main.ts" %}
const sdk = new SpellcastingSDK();
server.tool('get-ingredients', async () => {
const ingredients = await sdk.getIngredients();
return {
content: [{ type: 'text', text: JSON.stringify(ingredients) }],
};
});
server.tool('get-incantations', async () => {
const incantations = await sdk.getIncantations();
return {
content: [{ type: 'text', text: JSON.stringify(incantations) }],
};
});
server.tool('get-recipes', async () => {
const recipes = await sdk.getRecipes();
return {
content: [{ type: 'text', text: JSON.stringify(recipes) }],
};
});
```
Finally, let's implement the Transport Layer, letting the MCP server listen to and send messages via process inputs and outputs (stdio). It's only a few lines of code:
```ts {% fileName="apps/mcp-server/src/main.ts" %}
const transport = new StdioServerTransport();
(async () => {
await server.connect(transport);
})();
```
And just like that, we've built our very own MCP server! Let's make sure it works.
## Testing with the MCP Inspector
Anthropic has not just come up with the protocol, they've also created [a great ecosystem around it](https://github.com/modelcontextprotocol): Various SDKs, reference servers and a visual testing tool: [The MCP Inspector](https://github.com/modelcontextprotocol/inspector).
Let's modify our serve target to use the Inspector, letting us explore our newly created server. First, delete the existing `serve` target in `apps/mcp-server/package.json` , as it doesn't really apply to our use case. Replace it with this
```json {% fileName="apps/mcp-server/package.json" %}
"serve": {
"command": "npx -y @modelcontextprotocol/inspector node ./apps/mcp-server/dist/main.js",
"dependsOn": ["build"],
"continuous": true
}
```
Let's break it down:
- the command runs the Inspector, pointing to the build output location of our MCP server
- `"dependsOn": ["build"]` tells nx to always run the build before this target, making sure that the bundled javascript is available
- `"continuous": true` marks the serve as a [continuous task](/recipes/running-tasks/defining-task-pipeline#continuous-task-dependencies) so that will work properly in more complex task pipelines
You can see the result by running `npx nx serve mcp-server` and looking at the website it spins up (usually on [`http://localhost:6274`](http://127.0.0.1:6274/) ).
The sidebar contains all the information required to start the server - here the `STDIO` transport is correctly preselected as well as the command needed to start the server.
![Screenshot of the MCP Inspector sidebar](/blog/images/2025-05-29/mcp-inspector-sidebar.avif)
After clicking on the Connect button, the server is started in the background and you'll be able to see the available tools and call them under the `Tools` tab.
![Screenshot of the MCP Inspector showing the available tools](/blog/images/2025-05-29/mcp-inspector-tools.avif)
## Agents that can take actions
The `get-*` tools that we've built are already super useful and budding spellcasters will be glad to have help in perfecting their concoctions and learning ancient incantations. However, where the power of AI agents really starts to shine is when they go beyond just reading data and start taking actions. Let's give AI the ability to cast spells. 🪄
We'll register another tool in `apps/mcp-server/src/main.ts`
```ts {% fileName="apps/mcp-server/src/main.ts" %}
import { z } from 'zod';
// ... previous tools
server.tool(
'cast-spell',
'Lets the user cast a spell via the Astra Arcana API.',
{ ingredients: z.array(z.string()), incantations: z.array(z.string()) },
async ({ ingredients, incantations }) => {
const result = await sdk.castSpell(ingredients, incantations);
return {
content: [{ type: 'text', text: JSON.stringify(result) }],
};
}
);
```
There are two key differences in this tool definition:
- We've passed a description string as the second argument. You can do this for every tool in order to describe what to use it for and what will happen when the agent calls it. `cast-spell` is sort of self-explanatory but it's still good practice to add a description and increase the model's chances of picking the right tool for the job. You can even add more annotations to mark a tool as read-only, destructive or more.
- We've passed an object that defines the shape of the input using [`zod`](https://zod.dev/). This lets the agent know how to structure the inputs that are passed to the tool. `ingredients` and `incantations` as arrays of strings aren't very complicated, but you could also add descriptions to each individual option to explain what it does. The full feature set of `zod` is available to define exactly what's possible with each tool.
Now, let's try it out in an actual agent. I'll use VSCode & GitHub Copilot for this but any agent implementation with MCP support will do. I really like [Windsurf](https://docs.windsurf.com/windsurf/getting-started) or [Cursor](https://www.cursor.com/), for example.
Register the MCP server by editing `.vscode/mcp.json` (or using the built-in command):
```json {% fileName=".vscode/mcp.json" %}
{
"servers": {
"astra-arcana": {
"command": "node",
"args": ["/path/astra-arcana/apps/mcp-server/dist/main.js"]
}
}
}
```
Once you open a Copilot chat in Agent mode, the MCP server will start automatically and you should see all four tools available
![Screenshot of the VSCode quickinput listing available MCP tools](/blog/images/2025-05-29/mcp-list-vscode.avif)
Let's try to cast a spell! For obvious reasons, I want to make sure that I'm writing high-quality blog posts and could use a magic boost. You can see that the AI agent uses all the tools to figure out what's available and then tries to cast the spell. Some models might ask for permission first or ask follow up questions to make sure they're getting it right.
![Screenshot of a conversation with Copilot that uses the built MCP tools](/blog/images/2025-05-29/copilot-using-tools.avif)
After casting, you can head over to [https://astra-arcana.pages.dev/](https://astra-arcana.pages.dev/) and check the logs to see your spell! 🎉
![Screenshot of the Astra Arcana app showing the cast spell in the browser](/blog/images/2025-05-29/astra-arcana-logs.avif)
## Publishing to npm
Of course, now that we've built our magical MCP server, we want to make sure people can use it easily. Let's go through the process of publishing an executable file to the npm registry. In the future, anyone will be able to run `npx @astra-arcana/mcp-server` and spin it up immediately!
{% callout type="note" title="Learn More About nx release" %}
This section goes over the release process of this specific example. If you want to learn how to use `nx release` in detail, I recommend checking out Juri's great course on the topic: https://www.epicweb.dev/tutorials/versioning-and-releasing-npm-packages-with-nx
{% /callout %}
### Publishing Pre-Requisites
In order to have our bundled code be executable via npx, we need to add a shebang (`#!/usr/bin/env node`) to the first line of the file. We'll make sure this is added in a new script in the `apps/mcp-server` directory called `setup-publish.js`.
```js {% fileName="apps/mcp-server/setup-publish.js" %}
import path from 'path';
import fs from 'fs';
const distDir = path.resolve(import.meta.dirname, './dist');
const distMainJsPath = path.resolve(distDir, 'main.js');
const mainJsContent = fs.readFileSync(distMainJsPath, 'utf8');
const shebang = '#!/usr/bin/env node\n';
if (!mainJsContent.startsWith(shebang)) {
fs.writeFileSync(distMainJsPath, shebang + mainJsContent);
console.log('Shebang added');
}
console.log('Setup completed successfully!');
```
We'll also set up a target that calls this script after making sure the main bundle is built.
```json {% fileName="apps/mcp-server/package.json" %}
"setup-publish": {
"command": "node apps/mcp-server/setup-publish.js",
"dependsOn": ["build"]
}
```
While we're in `package.json` , let's also make sure that our package is publishable and let `npx` and similar tools know where to find the executable javascript file.
```diff {% fileName="apps/mcp-server/package.json" %}
{
"name": "@astra-arcana/mcp-server",
"version": "0.0.1",
- "private": true,
+ "private": false,
+ "bin": "./main.js",
// ...
```
### Local Publishing with Verdaccio
{% callout type="warning" title="Publishing" %}
Keep in mind that the `@astra-arcana/mcp-server` package already exists on the official npm registry, so we will only publish to a local registry.
{% /callout %}
At Nx, we use an awesome open-source tool called [Verdaccio](https://verdaccio.org/). It's a lightweight implementation of a local npm registry - let's use it to test out our publishing flow.
You can add verdaccio to the repo by running the `setup-verdaccio` generator:
```shell
npx nx g @nx/js:setup-verdaccio
```
This will create a verdaccio config and an nx target to spin it up at the root of our workspace. Start the local registry by running.
```shell
npx nx run @astra-arcana/source:local-registry
```
On [`http://localhost:4873/`](http://localhost:4873/) , you'll see an instance of verdaccio running with no packages published yet. Let's change that!
### Configuring Nx Release
Now that everything is set up, let's configure `nx release` to actually version our package, generate changelogs and publish to npm.
There are a couple of things we want to configure. Check out [the comprehensive release documentation](/features/manage-releases) to learn more about the different configuration options.
- Since we're in a monorepo with different kinds of packages, we have to let `nx release` know which ones to configure releases for - in this case, only the `mcp-server` app
- When releasing, we need to make sure that not only is the version in the repo's `package.json` is incremented, but also the version in the `dist` folder that we'll actually release from. We can do this by setting `manifestRootsToUpdate`.
- We have to make sure the `dist` folder exists, so we'll run our new `setup-publish` action first by specifying the command in `preVersionCommand` .
- Since our mcp server will be released independently, we configure the changelogs to be generated per-project instead of for the entire workspace.
```json {% fileName="nx.json" %}
"release": {
"projects": ["mcp-server"],
"version": {
"manifestRootsToUpdate": [
"{projectRoot}",
"{projectRoot}/dist"
],
"preVersionCommand": "npx nx run mcp-server:setup-publish"
},
"changelog": {
"projectChangelogs": true,
"workspaceChangelog": false
}
}
```
This is enough to configure `nx release` for our exact use case. With this, we can run `npx nx release --dry-run` . Nx will run the `setup-publish` target, prompt you for the kind of version change that's happening and give you a preview of what the result would be.
![Screenshot of the version prompt asked by nx release](/blog/images/2025-05-29/nx-release-prompt.avif)
If you're happy with the results, rerun the command without `--dry-run` and watch as `nx release` does its _magic_. The versions will be updated across both `package.json` files, and a changelog file, a git commit and tag will be created.
In order to release to npm, we have to add some final configuration to `nx.json` .
```json {% fileName="nx.json" %}
"targetDefaults": {
// ... other config
"nx-release-publish": {
"options": {
"packageRoot": "{projectRoot}/dist"
}
}
}
```
This will tell the automatically generated `nx-release-publish` target where to find the built files so that it can publish them to npm (or verdaccio, in our case). After running `npx nx release publish` , refresh Verdaccio to see the successfully published package! 🎉 You can spin up the MCP server using the published version by running `npx @astra-arcana/mcp-server` and try it out.
That's it! You can view the `@astra-arcana/mcp-server` package on npm here: https://www.npmjs.com/package/@astra-arcana/mcp-server
## Looking back and into the Future
We've come a long way. Looking back, we've
- learned about the Model Context Protocol
- set up a node application and built an MCP server with it
- used the MCP Inspector to test and debug our implementation
- used AI agents to cast spells 🪄
- learned how to publish an executable package to npm
The next post in this series will dive into implementing a different MCP transport layer in streamable HTTP and hosting our server on Cloudflare!
---
Learn more:
- 📖️ [Blog: AI Series](/blog/nx-mcp-vscode-copilot)
- 🧠 [Nx AI Docs](/features/enhance-AI)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 👩‍💻 [Nx Console GitHub](https://github.com/nrwl/nx-console)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,101 @@
---
title: 'CVE-2025-36852: Critical Cache Poisoning Vulnerability Affects Multiple Build Systems'
slug: cve-2025-36852-critical-cache-poisoning-vulnerability-creep
authors: ['Victor Savkin']
tags: ['caching', 'security']
cover_image: /blog/images/2025-06-12/header.avif
description: 'A critical security vulnerability called CREEP (Cache Race-condition Exploit Enables Poisoning) has been published as CVE-2025-36852. This vulnerability affects remote cache plugins across numerous build systems, including Nx.'
---
A critical security vulnerability called **CREEP** (Cache Race-condition Exploit Enables Poisoning) has been published as **CVE-2025-36852**. This vulnerability affects remote cache plugins across numerous build systems, including Nx.
The CREEP vulnerability allows any contributor with pull request privileges to inject compromised artifacts into production environments without detection. While it primarily impacts bucket-based caching solutions (such as S3, GCS, or similar object storage), it can also affect other build systems with similar caching architectures.
**Key Points:**
- Nx without remote cache is **NOT** affected
- Nx Cloud is **NOT** affected due to its security architecture
- Review this post to determine if your self-hosted cache solution is vulnerable
{% callout type="warning" title="DIY implementations are vulnerable" %}
DIY remote caches are likely vulnerable. Scanners won't catch all affected implementations, so understanding the vulnerability is crucial.
{% /callout %}
## **Understanding the Vulnerability**
A typical remote-cache flow using storage services follows these steps:
1. Artifact construction (via bundler, compiler, etc.)
2. Artifact packaging (by Nx or similar tool)
3. Encryption and hashing of the packaged artifact
4. Uploading the encrypted artifact to storage (transit)
5. Storing artifacts until needed (at rest)
6. Downloading from storage (transit)
7. Decryption of the packaged artifact
8. Unpacking
Traditional cache poisoning attacks occur during transit or storage. The CREEP vulnerability is fundamentally different—it exploits the artifact construction phase itself, before any transit or storage security measures take effect. Because poisoning happens during construction, malicious data is sent and inserted into the cache through the system's own protected mechanisms.
The security threat comes from creating a branch with the same file system state and simplified CI setup, such that it can execute the build before the main branch and upload the artifacts. It's caused by a race condition where the "first-to-cache-wins" principle applies. Whichever branch or PR first uploads a build artifact for a particular source file state will have its version used everywhere that source state appears, including production deployments.
**Critical implications:**
- Correct and poisoned artifacts are identical from a validation perspective
- Checksums always match because poisoning occurs before hashing
- No direct remote cache access is required to execute the attack
- Standard detection methods cannot identify compromised artifacts
- Traditional security protections (encryption, access control, key management) do not address this vulnerability
## **Severity**
CVE-2025-36852 has a severity score of 9.4 (Critical). It requires only low privileges and enables attackers to perform:
- Code execution
- Data exfiltration
- Lateral movement
- Additional attack vectors
## **How Nx Cloud Prevents This Attack**
Nx Cloud's architecture inherently prevents this vulnerability through:
### **1\. Hierarchical Caching System**
Nx Cloud implements a two-tier caching hierarchy:
- Protected branches (like main) can write to the shared cache
- Feature branches can only write to their own isolated, branch-scoped caches
- All branches can read from the shared cache, but write privileges are strictly controlled
### **2\. VCS Integration**
Nx Cloud integrates directly with version control systems to enforce proper cache scoping, ensuring cache permissions align with code permissions.
### **3\. Trust Boundaries**
By establishing clear trust boundaries between different branch types, Nx Cloud eliminates the race condition that makes CVE-2025-36852 possible.
## **What Organizations Should Do**
### **For Nx Cloud users:**
- No action required
- Continue following security best practices for your CI/CD pipeline
### **For systems using self-hosted cache:**
1. Read and understand [CVE-2025-36852](https://www.cve.org/CVERecord?id=CVE-2025-36852)
2. Review the detailed analysis at [https://nx.app/files/cve-2025-06](https://nx.app/files/cve-2025-06)
3. Assess your exposure—any system where PRs and main branches share the same cache is vulnerable
## **Conclusion**
CVE-2025-36852 represents a serious threat to organizations using vulnerable caching systems. The "first-to-cache-wins" principle many build systems rely on creates an exploitable race condition that traditional security measures cannot address.
**Action Required:**
- If your organization uses bucket-based remote caching: immediate action is required
- If your organization uses other self-hosted remote cache solutions: immediate review required (most self-hosted caching solutions across many build systems—not just JavaScript, but also Java—are affected)
- If your organization uses custom tasks runners to implement remote caching: immediate review required
- If using Nx without remote caching: no action is required
- If using Nx with Nx Cloud: [Review your settings](/ci/concepts/cache-security#use-scoped-tokens-in-ci). If you are using default settings, no actions should be required.
+78
View File
@@ -0,0 +1,78 @@
---
title: 'Nx 21.2 Release: Big upgrades to Angular 20, NestJS 11, and Storybook 9'
slug: nx-21-2-release
authors: ['Philip Fulcher']
tags: ['nx', 'release']
cover_image: /blog/images/2025-06-13/header.avif
description: 'Discover the latest in Nx 21.2, featuring Angular 20, NestJS 11, and Storybook 9'
---
Nx 21.2 is here! This release is focused on migrating to newer versions of some of our favorite technologies: Angular 20, Storybook 9, and NestJS 11.
{% toc /%}
## What's new in Angular 20
![Angular logo on a dark background](/blog/images/2025-06-13/angular.avif)
We'll leave it to the Angular team for [all the details](https://blog.angular.dev/announcing-angular-v20-b5c9c06cf301), but we wanted to call out a few changes that may impact Nx workspaces.
### Structural directives deprecated
It's time to part ways with structural directives like `*ngIf` and `*ngFor` and move on to control flow with `@if` and `@for`.
Your workspace will be migrated to control flow by default during migration to Nx 21.2. If youd like to hang on to that syntax a little longer, see our docs on [running migration in interactive mode](/recipes/tips-n-tricks/advanced-update) to skip this migration. Or use the newly introduced [Migrate UI in Nx Console](/recipes/nx-console/console-migrate-ui) to skip the migration.
If you choose not to migrate now, youll be able to re-run the migration later:
```shell
nx g @angular/core control-flow
```
### Experimental support for Vitest from the Angular team
Angular 20 introduces experimental support for [vitest](https://vitest.dev/) as a unit test runner. This is a fantastic addition to the core set of tools offered by the Angular team. Nx already offers vitest as an option when creating Angular apps and libraries, which is enabled by installing the [Analog plugin](https://analogjs.org/docs/features/testing/overview). You can choose between vitest support via the Analog plugin or through the new experimental vitest support. Nx generators will continue to use the Analog plugin. See the [Angular documentation](https://angular.dev/guide/testing/unit-tests) on how to use the vitest builder.
### New style guide changes
Last year, the Angular team opened [an RFC for changes to the style guide](https://github.com/angular/angular/discussions/58412), and Angular 20 implements the changes discussed. One of the bigger changes is that the Angular CLI has changed the format of filenames used when generating code. Generators provided by Nx will also follow the new style guide for new workspaces using Angular, but **the previous behavior will be retained for existing workspaces**. This is the same process the Angular CLI is following.
As part of migrating to Nx 21.2, generator and schematic defaults will be set for your workspace so that filename suffixes continue to be added. You can see what that change looks like in the [migration documentation](/technologies/angular/api/migrations#setgeneratordefaultsforpreviousstyleguide).
### BREAKING CHANGE: Angular 17 support removed
Following our [support schedule](/technologies/angular/recipes/angular-nx-version-matrix), Angular 17 is no longer supported in Nx 21.2. If you want to continue with Angular 17, you'll need to postpone upgrading to Nx 21.2 for now.
## NestJS 11 is here!
![NestJS logo on a dark background](/blog/images/2025-06-13/nest.avif)
Angular isn't the only framework getting attention with this release: we've also added support for [NestJS 11](https://trilon.io/blog/announcing-nestjs-11-whats-new)! This release brings better logging, more flexible microservices, and faster application startup. Your workspace will automatically be migrated to this new version as part of migrating to Nx 21.2.
## Storybook 9 makes testing components better than ever
![Storybook logo on a dark background](/blog/images/2025-06-13/storybook.avif)
[Storybook 9 is here](https://storybook.js.org/blog/storybook-9/) with faster, leaner component tests powered by vitest. By default, your workspace will be automatically migrated to Storybook 9 as part of Nx 21.2. If you choose to skip that migration, you can re-run it later using our [Storybook 9 setup guide](/technologies/test-tools/storybook/recipes/storybook-9-setup).
### BREAKING CHANGE: Deprecated Storybook generators removed
Deprecated Storybook generators have been removed: `@nx/storybook:cypress-project`, `@nx/react-native:storybook-configuration`, `@nx/react-native:stories`, `@nx/react-native:component-story`. Use [`@nx/storybook:configuration`](/technologies/test-tools/storybook/api/generators/configuration) instead.
## Migrating to latest version
As always, to migrate to the latest version of Nx, you can use the `migrate` command:
```shell
nx migrate latest
```
Or if you're using Nx Console, you can use the recently introduced [Migrate UI](/recipes/nx-console/console-migrate-ui).
Learn more:
- 👩‍💻 [Automate updating dependencies](/features/automate-updating-dependencies)
- 👩‍💻 [Nx GitHub](https://github.com/nrwl/nx)
- 👩‍💻 [Nx Console GitHub](https://github.com/nrwl/nx-console)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
@@ -0,0 +1,24 @@
---
title: "Polygraph Launch Preview: Conformance, Workspace Graph, and Custom Workflows"
description: "Join us for a demo of the new polygraph features in Nx Cloud, launching this month with Nx Enterprise!
These features are designed to extend some of the powerful benefits of an Nx workspace to multi-workspace environments and take Nx Cloud beyond CI. We'll cover our updated conformance dashboard, how to visualize dependencies across your repos, the new onboarding experience for workspaces that arent yet a part of Nx Cloud, and preview how Nx Cloud will be able to fix your code automatically via agentic AI."
date: 2025-06-09
slug: 'polygraph-launch-preview-conformance-workspace-graph-and-custom-workflows'
authors: ['James Henry']
tags: [webinar]
cover_image: /blog/images/2025-06-18/June-2025-Webinar-Card.avif
time: 10am ET/2pm UTC
status: Past - Gated
registrationUrl: https://go.nx.dev/june2025-webinar
---
**Jun 18, 2025 - 10am ET/2pm UTC**
Presented by James Henry
Join us for a demo of the new polygraph features in Nx Cloud, launching this month with Nx Enterprise!
These features are designed to extend some of the powerful benefits of an Nx workspace to multi-workspace environments and take Nx Cloud beyond CI. We'll cover our updated conformance dashboard, how to visualize dependencies across your repos, the new onboarding experience for workspaces that arent yet a part of Nx Cloud, and preview how Nx Cloud will be able to fix your code automatically via agentic AI.
{% call-to-action title="Download the recording" url="https://go.nx.dev/june2025-webinar" description="Sign up to gain access" /%}
@@ -0,0 +1,238 @@
---
title: 'Configure Tailwind 4 with Vite in an NPM Workspace: The Complete Guide'
slug: setup-tailwind-4-npm-workspace
authors: ['Juri Strumpflohner']
tags: ['nx', 'tailwind', 'vite', 'npm-workspaces', 'sync-generators']
cover_image: /blog/images/articles/bg-tailwind-4-guide.avif
description: 'Learn how to set up Tailwind CSS v4 with Vite in an NPM workspace monorepo, and automate your configuration with Nx Sync Generators for optimal performance.'
youtubeUrl: https://youtu.be/tg3LnqhNNws
---
Tailwind CSS v4 brings revolutionary changes to how we configure and use the popular utility-first framework. The simplified setup eliminates configuration files and complex PostCSS setups - you just install, import, and start building. But when working in NPM workspaces or monorepos, there's still one crucial challenge: **how do you tell Tailwind which packages to scan for classes?**
This guide walks you through setting up Tailwind v4 with Vite in an NPM workspace, then shows you how to automate the configuration using Nx Sync Generators to **eliminate manual maintenance**.
{% github-repository url="https://github.com/juristr/tailwind4-vite-npm-workspaces" /%}
{% toc /%}
## Setting up Tailwind v4
[Tailwind v4](https://tailwindcss.com/blog/tailwindcss-v4) introduced some nice simplifications when it comes to configuring Tailwind:
- **No more `tailwind.config.js`** - The framework works out of the box
- **Minimal dependencies** - Just `tailwindcss` and `@tailwindcss/vite` for Vite projects
- **Simple CSS import** - Add `@import "tailwindcss"` to your stylesheet and you're ready
Since we're using Vite in this workspace, we can leverage the dedicated Tailwind Vite plugin instead of PostCSS configuration. Here's what you need:
Install the required packages at your workspace root:
```json {% fileName="package.json" %}
{
"devDependencies": {
"tailwindcss": "^4.0.0",
"@tailwindcss/vite": "^4.0.0"
}
}
```
Configure your Vite setup:
```typescript {% fileName="apps/shop/vite.config.ts" %}
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [react(), tailwindcss()],
// ... rest of your config
});
```
Add the import to your main CSS file:
```css {% fileName="apps/shop/src/styles.css" %}
@import 'tailwindcss';
```
## The NPM workspace challenge
Consider a typical e-commerce application structured as an NPM workspace:
```plain
apps/
shop/
src <<<< where tailwind is configured
packages/
products/
feat-product-list/
feat-product-detail/
data-access-products/
shared/
ui/
utils/
```
At this point, your application will build and serve, but you'll notice that styles from your `packages/` are missing. In this modular setup, your main application (`shop`) depends on various feature packages, but **Tailwind only scans the main app by default**. This means styles defined in your packages won't be included in the final bundle, leading to missing styles and broken layouts.
## Solving the scanning problem with @source directives
Tailwind v4 introduces the `@source` directive to address exactly this problem. You can explicitly tell Tailwind which directories to scan by adding these directives to your CSS file:
```css {% fileName="apps/shop/src/styles.css" %}
@import 'tailwindcss';
@source "../../../packages/products/feat-product-list";
@source "../../../packages/products/feat-product-detail";
@source "../../../packages/shared/ui";
...
```
With these directives in place, Tailwind will scan the specified packages and include any utility classes found there. Your application styles will now work correctly across all packages.
## Automating @source entries - enter Nx sync generators
While `@source` directives solve the technical problem, they introduce a maintenance challenge:
- **manual updates required** when adding or removing dependencies,
- **easy to forget updating** the directives,
- **hard-to-debug issues** since missing styles don't break builds (just cause visual problems), and
- **team coordination** since every developer needs to remember to update these paths.
This is where automation becomes crucial and where Nx can help. [Nx Sync Generators](/concepts/sync-generators) provide a powerful solution for **automating configuration that needs to stay in sync with your project structure**.
For our specific use case we can automate the generation of the `@source` directives by
- analyzing and traversing all of the `shop` application's dependencies (leveraging the [Nx project graph](/features/explore-graph))
- generating the `@source` entries into the correct `styles.css` file
You can follow [the guide on the Nx docs](/extending-nx/recipes/create-sync-generator) for all the details on how to implement your own Nx sync generator. At a high level these are the steps you'll need:
**Step 1: Add Nx Plugin development support**
```shell
npx nx add @nx/plugin
```
**Step 2: Generate a new plugin into your workspace**
```shell
npx nx g @nx/plugin:plugin tools/tailwind-sync-plugin
```
Note, you can choose whatever folder you like. I happen to use the `tools/` folder for this example.
**Step 3: Generate a sync generator**
```shell
npx nx g @nx/plugin:generator --name=update-tailwind-globs --path=tools/tailwind-sync-plugin/src/generators/update-tailwind-globs
```
With that you have the infrastructure in place and we can look at the actual implementation of the sync generator:
```typescript
import { Tree, createProjectGraphAsync, joinPathFragments } from '@nx/devkit';
import { SyncGeneratorResult } from 'nx/src/utils/sync-generators';
export async function updateTailwindGlobsGenerator(
tree: Tree
): Promise<SyncGeneratorResult> {
const appName = '@aishop/shop';
const projectGraph = await createProjectGraphAsync();
// Traverse all dependencies of the shop app
const dependencies = new Set<string>();
const queue = [appName];
const visited = new Set<string>();
while (queue.length > 0) {
const current = queue.shift()!;
if (visited.has(current)) continue;
visited.add(current);
const deps = projectGraph.dependencies[current] || [];
deps.forEach((dep) => {
dependencies.add(dep.target);
queue.push(dep.target);
});
}
// Generate @source directives for each dependency
const sourceDirectives: string[] = [];
dependencies.forEach((dep) => {
const project = projectGraph.nodes[dep];
if (project && project.data.root) {
const relativePath = joinPathFragments('../../../', project.data.root);
sourceDirectives.push(`@source "${relativePath}";`);
}
});
// Update the styles.css file
const stylesPath = 'apps/shop/src/styles.css';
const currentContent = tree.read(stylesPath)?.toString() || '';
// Insert the @source directives after @import "tailwindcss"
// ... (implementation details)
return {
outOfSyncMessage: 'Tailwind @source directives updated',
};
}
```
_(Check out the [Github repo for the full implementation](https://github.com/juristr/tailwind4-vite-npm-workspaces))_
You can manually run sync generators with `nx sync`, but we want this to run automatically whenever we build or serve our application. As such we can register the sync generator in the app's `package.json`:
```json {% fileName="apps/shop/package.json" %}
{
"name": "@aishop/shop",
...
"nx": {
"targets": {
"build": {
"syncGenerators": ["@aishop/tailwind-sync-plugin:update-tailwind-globs"]
},
"serve": {
"syncGenerators": ["@aishop/tailwind-sync-plugin:update-tailwind-globs"]
}
}
}
}
```
## Nx sync generators in action
When you run your development server with `nx serve shop`, the sync generator automatically checks if your `@source` directives are up to date:
![Tailwind Nx sync generator in action](/blog/images/articles/tailwind-sync-generator.avif)
Your CSS file is automatically updated with the correct directives based on your actual project dependencies. If you add or remove dependencies later, the next build or serve will **detect the changes and update the configuration automatically**.
You can find the complete implementation in this [GitHub repository](https://github.com/juristr/tailwind4-vite-npm-workspaces).
## Using Tailwind v3?
If you're currently using Tailwind v3, the concept is similar but the implementation differs. Instead of updating `@source` directives, you'd modify the `tailwind.config.js` file with glob patterns.
Check out the following video which explains the same approach for Tailwind v3:
{% youtube src="https://www.youtube.com/watch?v=huTmV-F8c0A" title="Optimizing Tailwind with Nx Sync Generators (v3)" /%}
The [Tailwind v3 demo repository](https://github.com/juristr/tailwind-sync-demo) shows how to implement this approach for older versions.
## Conclusion
While Tailwind v4's simplified setup is a significant improvement, manually maintaining `@source` directives creates a maintenance burden in monorepos. Nx Sync Generators solve this by automatically keeping your Tailwind configuration in sync with your project dependencies, eliminating manual updates and preventing hard-to-debug styling issues.
This approach transforms configuration maintenance into a completely automated process, letting you focus on building features rather than managing paths.
## Learn more
- 🧠 [Nx Docs](/getting-started/intro)
- 👩‍💻 [Tailwind v4 Vite NPM Workspace Demo](https://github.com/juristr/tailwind4-vite-npm-workspaces)
- 📖 [Nx Sync Generators Documentation](/extending-nx/recipes/create-sync-generator)
- 📹 [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- 💬 [Nx Official Discord Server](https://go.nx.dev/community)
- 🐦 [Follow me on Twitter/X](https://twitter.com/juristr)

Some files were not shown because too many files have changed in this diff Show More