Compare commits

...

116 Commits

Author SHA1 Message Date
Louie Weng 154fbd0626 chore(gradle): bump plugin for gradle version to 0.1.9 (#33419)
<!-- 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 plugin for Gradle is at version 0.1.8

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

Nx plugin for Gradle is at version 0.1.9

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

Fixes #

(cherry picked from commit a0a3289112)
2025-11-10 09:54:20 -05:00
Caleb Ukle 4ea13b36cf docs(nx-cloud): document new flaky tasks analytics (#33253)
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
(cherry picked from commit 7458b52b4e)
2025-11-10 09:48:40 -05:00
Jack Hsu 6b1e914b99 docs(js): update node compat matrix (#33415)
Update it for v22.

(cherry picked from commit 4170c2f82b)
2025-11-10 09:48:39 -05:00
Caleb Ukle f676797246 cleanup(repo): use mise for agent toolchain installs (#33299)
also dedupe agent launch templates with yaml anchors for better
readability

(cherry picked from commit 2182cea451)
2025-11-10 09:48:38 -05:00
Philip Fulcher 51b494e8b4 docs(nx-dev): add task analytics article (#33407)
https://nx-dev-git-philip-task-analytics-article-nrwl.vercel.app/blog/nx-cloud-release-introducing-enterprise-task-analytics
(cherry picked from commit 777217618e)
2025-11-10 09:48:14 -05:00
Jason Jean d92d8911e9 feat(maven): bump version from 0.0.8 to 0.0.9 (#33405)
## Current Behavior

Maven plugin is currently at version 0.0.8.

## Expected Behavior

Maven plugin should be bumped to version 0.0.9 with a corresponding
migration for users.

## Changes Made

- Updated parent POM version to 0.0.9
- Updated package.json version to 0.0.9
- Updated mavenPluginVersion constant to 0.0.9
- Added new migration (0-0-9) to update user pom.xml files from 0.0.8 to
0.0.9
- Scheduled migration for Nx v22.1.0-beta.6

## Testing

-  Maven package tests pass
-  Build succeeds
-  Linting passes

(cherry picked from commit 746b89a901)
2025-11-10 09:48:05 -05:00
MaxKless 97d25a7392 feat(maven): add ci-workflow generator (#33346)
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
(cherry picked from commit b395cec4cd)
2025-11-10 09:48:05 -05:00
James Henry 2d53ffdb9e fix(core): correctly identify local workspace dependencies on windows (#33408)
(cherry picked from commit a6948665e6)
2025-11-10 09:48:04 -05:00
Philip Fulcher 5e42dafee5 docs(nx-dev): add november 2025 webinar (#33403)
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: philipjfulcher <philipjfulcher@users.noreply.github.com>
(cherry picked from commit 790358af91)
2025-11-10 09:48:03 -05:00
MaxKless 2a082f8701 fix(core): prevent args from being split by spaces when executing through nx wrapper (#33362)
<!-- 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
Because `./nx` is passing args with `$@`, args are being split by
spaces. Reference for this behaviour:
https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html#Special-Parameters-1

This results in this set of process args when running `./nx start-ci-run
--distribute-on="3 linux-medium-jvm"`

```
[
  "<user path>/.nvm/versions/node/v22.19.0/bin/node",
  "<user path>/Projects/OTW/mm-test/.nx/nxw.js",
  "start-ci-run",
  "--distribute-on=3",
  "linux-medium-jvm",
]
```

## Expected Behavior
the arg with whitespace should not be split before being passed to nx:
```
[
  "<user path>/.nvm/versions/node/v22.19.0/bin/node",
  "<user path>/.nx/nxw.js",
  "start-ci-run",
  "--distribute-on=3 linux-medium-jvm",
]
```

(cherry picked from commit e9146c7862)
2025-11-10 09:48:03 -05:00
Jack Hsu 8801be32dd chore(repo): rename jest.config.ts to jest.config.cts to be compat with Node 24 strip types (#33401)
This PR is just for the repo itself to use `.cts` to explicitly use CJS
for jest config. Node 24 strip types so having `.ts` files with ESM
syntax even though we're previously transpiling them to CJS is a
problem.

(cherry picked from commit 62d0ad7f25)
2025-11-10 09:48:01 -05:00
Leosvel Pérez Espinosa c03434cfe2 feat(core): disable interactivity by default for run-one task outputs in tui (#33358)
Make run-one task terminal outputs in the TUI non-interactive by
default. Most tasks don't need interactivity, and it causes TUI to
ignore all its key bindings because it forwards them to the underlying
program. If interactivity is needed, users can press `i` to enable it.

(cherry picked from commit e470b2c64a)
2025-11-10 09:48:01 -05:00
Louie Weng f0e86e7fec feat(gradle): use gitignore to determine dependant task output files (#33402)
<!-- 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 we detect if inputs are found in the build directory to
determine if they are considered dependent task output files. We can use
a simpler heuristic instead.

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

If an input is gitignored (and therefore not hashed by Nx), then we
consider it a dependant task output file. This gitignore classifier will
be a mirror of the class used within the Maven plugin. There will be
another PR to move this classifier into a shared kotlin project that can
be used between both projects.

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

Fixes #

(cherry picked from commit 28e778a1f9)
2025-11-10 09:48:00 -05:00
Jason Jean 629c17981f fix(maven): forward parameters through target dependencies (#33365)
## Current Behavior

Maven target dependencies are defined as simple strings that reference
other targets. Currently, parameters are not forwarded through these
dependencies when Maven goals are executed.

## Expected Behavior

Target dependencies in Maven should forward parameters (args) to their
dependency targets, enabling better parameter propagation through the
build pipeline.

## Changes Made

Modified `NxTargetFactory.kt` to transform simple string dependency
references into structured dependency objects with explicit parameter
forwarding:

- Install dependencies now forward parameters
- Phase dependencies now forward parameters
- Test dependencies now forward parameters
- CI target dependencies now forward parameters

This ensures that when a Maven goal executes, any parameters passed to
it are properly forwarded to all transitive target dependencies.

## Related Issue(s)

This change enables parameter passing through Maven target dependencies
via the new dependency object format with `"params": "forward"`.

(cherry picked from commit 61442118cf)
2025-11-10 09:47:52 -05:00
Jack Hsu f958ebc056 fix(testing): use .cts config files for Jest 30+ to fix __dirname issues (#33349)
When using Jest 30 with SWC, users are seeing an error where `__dirname`
is not defined for ESM modules. This is because the `.ts` extension is
type-stripped by Node 22.17/24+ via checking for
[`process.features.typescript`](https://github.com/jestjs/jest/blob/fe7f28c9d1941f5c2726831cd9d9e479b401610e/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L46).

This means that instead of using the `commonjs` we set for `ts-node`,
normal Node resolution kicks in, and is now treating `jest.config.ts` as
ESM.

This PR fixes this issue by using an explicit `.cts` extension, which
forces CommonJS that we assume for Jest configs.

Note: For Jest 29 or earlier we need to keep `jest.config.ts` since the
`.cts` extension is not supported prior to Jest 30.

There's also a fix for an existing issue where using `module.exports` of
anything else from `@types/node` will error out if `tsconfig.json` has a
`types` field but does not include `node`. See:
https://www.loom.com/share/7ebe3c90a70e4ec7bfa53cbcccaaea7d

Fixes #32236

---------

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 9b5768e7fe)
2025-11-10 09:47:51 -05:00
MaxKless 513cc4f3ab docs(misc): add information about nx console debug logging (#33398)
(cherry picked from commit cde5ee8c83)
2025-11-10 09:47:51 -05:00
Juri 7e28def88f docs(module-federation): change terminal output to shell frame
(cherry picked from commit 2e5844c61b)
2025-11-10 09:47:45 -05:00
Juri 48d6f15d95 docs(nx-dev): link nx 22 release video
(cherry picked from commit 58cbbf20bd)
2025-11-10 09:47:45 -05:00
Jack Hsu ec7c80d526 docs(misc): fix ToC overflow and height stretching issues (#33384)
This PR fixes the ToC so it does not overflow to the footer. It adjusts
the height calculation such that it takes up the entire height of the
main frame.

The extra top margin is removed from the footer to remove the extra gap
between main frame and footer.

BEFORE:

<img width="1387" height="915" alt="image"
src="https://github.com/user-attachments/assets/e7f4d31c-a206-48ab-81e6-9fddfee11b18"
/>

AFTER:

<img width="1385" height="916" alt="image"
src="https://github.com/user-attachments/assets/cf6e2662-3c3d-4d37-9769-235b901cc188"
/>

<img width="1382" height="918" alt="image"
src="https://github.com/user-attachments/assets/9e142edf-259b-482a-b676-9333857ed776"
/>

Fixes DOC-224

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 603e7c0bb6)
2025-11-10 09:47:41 -05:00
Jack Hsu 036edb89be fix(nx-dev): fix GitHub star button styling in mobile view (#33385)
This PR fixes the GitHub star widget in the left sidebar such that it
only shows in smaller screens (e.g. mobile). For desktop we have it in
the ToC.

Also styles it to be consistent with the login and sign up buttons.

Large screen, don't show:

<img width="1483" height="881" alt="image"
src="https://github.com/user-attachments/assets/d3c88d87-4905-4c3f-85c4-b7b4c14546d4"
/>

Smaller screen, show:

<img width="1136" height="811" alt="image"
src="https://github.com/user-attachments/assets/22aa652f-c523-493f-a01e-87e55934e1c9"
/>

Mobile view, show:

<img width="511" height="880" alt="image"
src="https://github.com/user-attachments/assets/283ffca2-4e4e-4706-811f-ce27b02e607b"
/>

Fixes DOC-325

(cherry picked from commit f5d97e3047)
2025-11-10 09:47:41 -05:00
Juri ca791f84a7 docs(dotnet): add paragraph about adding a .net app
(cherry picked from commit a032099138)
2025-11-10 09:47:40 -05:00
Colum Ferry 66a50ed7cf feat(vite): add vitest 4 to peerDep range to prevent conflicts (#33394)
## Current Behavior
`@nx/vite` has a peerDep range of only `1 | 2 | 3` for `vitest`.
This will cause peer dep conflicts for using wishing to use Vitest 4.

## Expected Behavior
Add Vitest 4 to the peerDep range of `@nx/vite` to prevent conflicts.

(cherry picked from commit f549ef290f)
2025-11-10 09:47:39 -05:00
MaxKless e46a7e16fd fix(core): handle various directories when importing prettier (#33383)
<!-- 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 trying to format with prettier while outside of the workspace (for
example in a `tmp` nx installation like is created during
`configure-ai-agents`), resolving prettier could fail even though it's
present in the actual workspace.

## Expected Behavior
resolving prettier works if it's available in either the proper
workspace or the tmp one by specifying `paths` in `require.resolve`

(cherry picked from commit a020954987)
2025-11-10 09:47:27 -05:00
Jason Jean 6bfedfffbb chore(repo): update nx to 22.1.0-beta.5 (#33386)
Updating Nx from 22.1.0-beta.4 to 22.1.0-beta.5

(cherry picked from commit ba6ca6c5ae)
2025-11-10 09:46:58 -05:00
Craigory Coppola 686cec19d2 chore(repo): remove --fix-tasks config that exists to exclude removed task (#33371)
This pull request makes a minor update to the CI workflow configuration.
The change simplifies the `Start CI Run` step by removing the
`--fix-tasks="!*check-commit*"` option from the `npx nx-cloud@next
start-ci-run` command.

(cherry picked from commit b97f666a4e)
2025-11-10 09:46:22 -05:00
Colum Ferry 7c4a69db45 fix(module-federation): update @module-federation packages to fix Koa vulnerability (#33285) (#33380)
Updates @module-federation packages from 0.18.0 to 0.21.2 and
@module-federation/node from 2.7.11 to 2.7.21 to address Koa Open
Redirect vulnerability (CVE: GHSA-g8mr-fgfg-5qpc).

The vulnerability was in transitive dependencies:
@nx/react → @nx/module-federation → @module-federation/enhanced →
@module-federation/dts-plugin → koa@3.0.1-3.0.2

Changes:
- Updated package.json dependencies in @nx/module-federation and
@nx/rspack
- Updated version constants in Angular and React utils/versions.ts
- Added 22.2.0 migrations to all affected packages

Fixes #33285

(cherry picked from commit 1b7d0955a2)
2025-11-10 09:46:21 -05:00
Jack Hsu 11719666dc docs(react): update SVGR documentation for Nx 22 (#33370)
This PR clarifies that Nx 22 removed SVGR support from Next.js and React
(Webpack/Rspack).

<img width="942" height="1185" alt="image"
src="https://github.com/user-attachments/assets/6ea8393f-b037-489f-804b-eb06d8d07e4c"
/>

Previously we had this option `svgr: true` but was configurable and
didn't align with current best practices like `import Logo from
'./logo.svg?react'`. We removed it from Nx 22, provided a migration, but
users will be confused by the docs.

Fixes DOC-326

(cherry picked from commit bc47ab8ce9)
2025-11-10 09:46:20 -05:00
Juri Strumpflohner 9891235672 docs(nx-dev): fix broken URL to monorepo tools (#33381)
<!-- 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 #

(cherry picked from commit 26aca9e5ec)
2025-11-10 09:46:19 -05:00
Juri Strumpflohner 386c771033 docs(misc): various updates embedding videos in docs pages
(cherry picked from commit 18557f8af4)
2025-11-10 09:46:19 -05:00
Leosvel Pérez Espinosa 657c398294 cleanup(core): remove unused mouse event listeners from tui (#33368)
Cleans up unused mouse event listeners from the TUI.

(cherry picked from commit c933660b88)
2025-11-10 09:46:18 -05:00
Jason Jean be1d475aa1 chore(repo): update nx to 22.1.0-beta.4 (#33350)
Updating Nx from 22.1.0-beta.3 to 22.1.0-beta.4

(cherry picked from commit 2d78f571b4)
2025-11-10 09:46:00 -05:00
Jason Jean 6d2389db73 feat(core): add OSC 9;4 progress indicator support to TUI (#33325)
## Current Behavior

The Nx TUI doesn't provide any visual feedback about task progress
outside of the terminal window itself. Users need to keep the terminal
visible to see task completion status.

## Expected Behavior

With this PR, the TUI now displays real-time task completion progress in
the terminal window chrome (tabs, title bars, dock icons) using the OSC
9;4 escape sequence. This provides at-a-glance progress feedback even
when the terminal is minimized or in the background.

## Related Issue(s)

N/A - This is a new feature enhancement

## Implementation Details

### What is OSC 9;4?
OSC 9;4 is a terminal escape sequence for displaying progress
indicators, originally from ConEmu and now supported by multiple modern
terminals.

### Key Changes
- Added `update_ghostty_progress()` method to calculate and display task
completion percentage
- Added `clear_ghostty_progress()` method to hide progress when done
- Integrated progress updates into task lifecycle (start, status update,
exit)
- Uses ST terminator (`\x1b\\`) for maximum terminal compatibility
- Writes to stderr to avoid conflicts with TUI rendering on stdout

### Supported Terminals
- **Ghostty** - Full support
- **Windows Terminal** (v1.6+) - Full support
- **VTE-based terminals** (GNOME Terminal, Ptyxis) - Full support
- **Other terminals** - Gracefully ignore sequences (no errors)

### Terminal Compatibility Note
The implementation uses the ST (String Terminator) escape sequence
rather than BEL, as this is preferred by Ghostty and required by
VTE-based terminals, while remaining compatible with Windows Terminal.

## Testing

Tested with:
- Building the native module successfully
- Rust formatting and linting passes
- Running nx commands with the TUI active

The progress indicator updates in real-time as tasks complete and clears
automatically when the TUI exits.

(cherry picked from commit 4017b61ede)
2025-11-10 09:45:34 -05:00
Jason Jean f07d064b87 feat(core): batch hash tasks without custom hashers (#33327)
## Current Behavior

When processing scheduled batches, tasks are hashed one at a time even
though the hasher has a `hashTasks` method for batch hashing.

Results from a batch with 109 tasks.
```
hash batch: 8.297s
```

## Expected Behavior

Tasks without custom hashers should be batch-hashed using the hasher's
`hashTasks` method for better performance.

Results from a batch with 109 tasks.
```
hash batch: 991.725ms
```

## Related Issue(s)

This is a performance optimization for task hashing.

---

**Changes:**

- Added a new `hashTasks` function that intelligently separates tasks
with custom hashers from those without
- Tasks with custom hashers are hashed individually using `Promise.all`
- Tasks without custom hashers are batch-hashed using the hasher's
`hashTasks` method
- The function automatically filters out tasks that already have a hash
- Updated `processScheduledBatch` in task-orchestrator to use this new
function

(cherry picked from commit 0acc8b0988)
2025-11-10 09:45:34 -05:00
Jason Jean 7140c07041 chore(repo): update nx to 22.1.0-beta.3 (#33341)
Updating Nx from 22.1.0-beta.2 to 22.1.0-beta.3

(cherry picked from commit 8cc052f351)
2025-11-10 09:44:44 -05:00
Jason Jean ab9639b67e fix(maven): set migration version to 22.1.0-beta.4 (#33345)
## Current Behavior

The Maven migration version was incorrectly set to `0.0.8-beta.0` in the
migrations.json file.

## Expected Behavior

The migration version should be set to `22.1.0-beta.4` to align with the
Nx release version.

## Related Issue(s)

Fixes the migration version discrepancy in the Maven plugin.

(cherry picked from commit d64f45879b)
2025-11-10 09:36:54 -05:00
Juri Strumpflohner 0bddeeed4d docs(nx-cloud): embed self-healing ci videos (#33338)
Embeds videos about self-healing CI into the corresponding feature doc

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
(cherry picked from commit 8f7c635894)
2025-11-10 09:36:53 -05:00
Jason Jean 3e87b78a58 feat(maven): upgrade to version 0.0.8 with automated migration (#33315)
## Current Behavior

The Maven plugin is at version 0.0.7 with no automated migration path
for users to upgrade their pom.xml files.

## Expected Behavior

Users can upgrade to Maven plugin 0.0.8 and have their pom.xml files
automatically updated via the Nx migration system.

## Changes Made

- Updated Maven plugin version from 0.0.7 to 0.0.8 in:
  - `packages/maven/package.json`
  - `packages/maven/src/utils/versions.ts`
  - `packages/maven/maven-plugin/pom.xml`

- Created `updateNxMavenPluginVersion()` utility function with:
  - Proper XML parsing using `@xmldom/xmldom` DOM API
  - Targeted updates only for `dev.nx.maven:nx-maven-plugin` elements
- Safe handling of all other version elements (dependencies, parent,
project, etc.)
  - Comprehensive error handling

- Added migration `0-0-8/update-pom-xml-version.ts` that:
  - Automatically runs when users upgrade to 0.0.8
  - Updates root pom.xml files via the utility function
  - Logs status of migrations performed

- Registered migration in `migrations.json`

- Added comprehensive unit tests (9 test cases):
  - Updates only the nx-maven-plugin version
  - Does not update other plugin versions
  - Handles missing files gracefully
  - Preserves XML formatting and structure
  - Handles multiple plugin references
  - Handles whitespace correctly
  - Only updates plugins, not parent/project versions
  - All tests passing (27/27)

## Test Plan

- [x] Unit tests pass (27 passing tests)
- [x] XML parsing correctly identifies and updates only
`dev.nx.maven:nx-maven-plugin`
- [x] Other version elements remain untouched
- [x] Migration registration validated

(cherry picked from commit 7e0f66dbf3)
2025-11-10 09:36:52 -05:00
Craigory Coppola 7368452163 chore(repo): add .NET format check + codeowners and unify native target handling (#33323)
## Current Behavior
Maven and .NET use a bespoke script to handle skipping an optional
native target in case a system is not setup on a dev's machine.

.NET isn't in codeowners

## Expected Behavior
This pull request introduces improvements to the build and formatting
workflows for the `.NET` and Maven plugins, streamlining the execution
of native targets and updating code ownership assignments. The changes
focus on refactoring build scripts to use a unified runner, adding new
formatting capabilities for .NET projects, and updating the CODEOWNERS
file for clearer team responsibilities.

**Build and Format Workflow Improvements**

* Refactored the `.NET` analyzer build command in
`packages/dotnet/project.json` to use the new `run-native-target.js`
script, replacing the previous direct script invocation.
[[1]](diffhunk://#diff-036c1a7f2e7d98f5a3207441f2ff1cb25b5b5a03343672ce473f4ff0189a5946L25-R25)
[[2]](diffhunk://#diff-42d990ddcbf8d3585553503097ee8b8d1fff8cb6e25e0cd545a87e11d64c03a8L1-L7)
* Added new `format-native` and `_format-native` targets to
`packages/dotnet/project.json`, enabling verification and fixing of code
formatting for the .NET analyzer using `dotnet format`.

**Unified Native Target Runner**

* Introduced the `scripts/run-native-target.js` script to standardize
running native build and install targets, controlled by environment
variables for skipping builds.

**Maven Plugin Build Refactor**

* Updated the Maven plugin's install workflow in
`packages/maven/maven-plugin/project.json` to use the new native target
runner, and removed the obsolete `scripts/build-maven-analyzer.js`
script.
[[1]](diffhunk://#diff-2763fe8a7c2989643f53370a14a08c06616e85c29340fd5bcfa1a67d0deaee7aL11-R11)
[[2]](diffhunk://#diff-972edab06956ad35145cbc20b8e250e7067fbb288b1f99c92661c24f64d3e69dL1-L7)

**Ownership Updates**

* Updated the `CODEOWNERS` file to assign `.NET`-related directories to
`@FrozenPandaz` and `@AgentEnder`, clarifying team responsibilities.

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

Fixes #

(cherry picked from commit a5d34fd9f9)
2025-11-10 09:36:52 -05:00
Colum Ferry c75e38d98d chore(repo): add vitest scope (#33317)
(cherry picked from commit d7c8f6e772)
2025-11-10 09:36:46 -05:00
Jason Jean dceed642ba fix(maven): resolve maven dependencies from project roots (#33313)
## Current Behavior

Maven dependencies were not being resolved correctly from project roots,
which affected the dependency analysis in monorepos with Maven projects.

## Expected Behavior

Maven dependencies should be properly resolved from each project's root,
allowing Nx to correctly understand the project graph for Maven-based
projects.

## Changes Made

- Updated Maven plugin Kotlin code to properly resolve dependencies from
project roots
- Fixed devkit internal utilities to properly handle Maven dependency
resolution
- Updated TypeScript dependencies plugin to align with the new
resolution logic

## Files Changed

-
`packages/maven/maven-plugin/src/main/kotlin/dev/nx/maven/NxProjectAnalyzer.kt`
-
`packages/maven/maven-plugin/src/main/kotlin/dev/nx/maven/NxProjectAnalyzerMojo.kt`
- `packages/maven/src/plugins/dependencies.ts`
- `packages/dotnet/src/plugins/create-dependencies.ts`
- `packages/devkit/internal.ts`
- `packages/nx/src/devkit-internals.ts`

Fixes #XXXXX

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
(cherry picked from commit 4fcdc9542e)
2025-11-10 09:36:45 -05:00
Craigory Coppola 64d05e872b chore(repo): enable codeql for csharp code (#33301)
## Current Behavior
CodeQL is not enabled for C#, but C# is in the nx repo

## Expected Behavior
CodeQL is enabled on C#

## 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>
(cherry picked from commit 29a61429a5)
2025-11-10 09:36:44 -05:00
Jack Hsu 16b8eeac90 fix(vite): prevent race-condition when importing @vitejs/plugin-vue (#33307)
This PR primes the cache for `@vitejs/plugin-vue`, similar to how we
already do for `esbuild`. When `vite.config.ts` is compiled into CJS,
then doing `require('@vitejs/plugin-vue')` may error with a race
condition if an `import` of the same module is in progress.

Fixes #NXC-3289

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
(cherry picked from commit b28366395f)
2025-11-10 09:36:44 -05:00
Colum Ferry 3f5631e96c chore(node): do not have assertions around killPorts (#33294)
(cherry picked from commit 4ec3a99544)
2025-11-10 09:36:43 -05:00
Jack Hsu d1105855a8 chore(repo): use vitest.config.mts to force ESM (#33310)
If it is resolved as CJS it may run into issues?

(cherry picked from commit 9c326bb8e9)
2025-11-10 09:36:42 -05:00
MaxKless 15c567c8a3 feat(misc): remove CI investigation recommendations from agent rules (#33309)
<!-- 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
there are recommendations for using the CIPE fixing tools but they are
being removed

## Expected Behavior
removed tools should not be mentioned anymore.

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

Fixes #

(cherry picked from commit 0347e67334)
2025-11-10 09:36:42 -05:00
Copilot 0853c5fd0d docs(maven): add nx show projects, update command example to nx verify, and simplify configuration (#33302)
Completed Maven documentation updates:

- [x] Add `nx show projects` command to display Maven projects after
initialization
- [x] Change example from `nx build` to `nx verify`
- [x] Simplify configuration section to use `plugins: ["@nx/maven"]`
with defaults
- [x] Update configuration description to accurately explain how targets
are created

## Summary

Successfully updated the Maven plugin documentation:

1. **Added `nx show projects` command** - Shows users how to list
discovered Maven projects after running `nx init`
2. **Changed example to `nx verify`** - Uses a more appropriate Maven
lifecycle phase that includes tests and verification
3. **Simplified configuration** - Updated the configuration section to
show the simpler string array syntax `plugins: ["@nx/maven"]`
4. **Corrected target creation description** - Updated the text to
accurately explain that `@nx/maven` automatically retrieves information
about projects from Maven and creates targets for each phase, goal, and
some additional targets for CI

<!-- START COPILOT CODING AGENT SUFFIX -->

<details>

<summary>Original prompt</summary>

> Expand this section
https://nx.dev/docs/technologies/java/maven/introduction#add-nx-to-a-maven-workspace
>
> With instructions to run the following
>
> nx show projects
>
> To see a list of Maven projects
>
> And change nx build Maven project to nx verify Maven project
>

</details>

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: FrozenPandaz <8104246+FrozenPandaz@users.noreply.github.com>
(cherry picked from commit ad0b44f05f)
2025-11-10 09:36:41 -05:00
MaxKless 3d7f49a6d1 chore(repo): refactor dev container setup to work with mise (#33291)
<!-- 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
devcontainer wasn't working reliably

## Expected Behavior
devcontainer should work reliably and reuse the configuration setup we
have for all these different tools that are needed

(cherry picked from commit ac8b58191a)
2025-11-10 09:36:40 -05:00
MaxKless fed069ba52 fix(core): also look in .nx installation when reading nx.json extends (#33306)
<!-- 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 a `.nx` installation, `require.resolve` won't find the `extends`
preset nx.json file because there are no root `node_modules`

## Expected Behavior
in a `.nx` installation, the nested `.nx/installation/node_modules` are
also used to try and resolve the preset.

(cherry picked from commit 56633a7b1b)
2025-11-10 09:36:40 -05:00
Eric Büttner cfead32fb5 fix(nextjs): ensure eslint-config-next matches Next.js 14 and 15 versions (#30259)
This PR builds on the previous fix that ensured `eslint-config-next` was
correctly installed when using Next.js 15. #30258

Now, the logic has been further refined to dynamically determine the
installed Next.js version and install the corresponding
`eslint-config-next` version accordingly.

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

- `next@~15.1.4` is installed
- `eslint-config-next@14.2.16` is installed (incorrect for Next.js 15)

### Expected Behavior

If Next.js 15 is detected -> eslint-config-next@15.1.4 is installed
If Next.js 14 is detected -> eslint-config-next@14.2.16 is installed

### GitHub Repo

https://github.com/tuffz/new-nx-with-preset-nextjs

### Steps to Reproduce

1. Run the following command from the official documentation:
`npx create-nx-workspace@latest --preset=next`
3. Open `package.json` and check the installed dependencies

- `next@~15.1.4` is installed
- `eslint-config-next@14.2.16` is installed

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

Fixes #30257 (& #30258)

(cherry picked from commit 2f3b7d09b5)
2025-11-10 09:36:39 -05:00
Copilot f24b97b3de docs(nx-dev): add GitHub star widget back to documentation sidebar (#33289)
Adds the "Give us a star" CTA back to the Astro documentation in both
the left navigation sidebar and right table of contents sidebar.

## Implementation

- **Middleware** (`github-stars.middleware.ts`): Fetches star count from
`nrwl/nx` via GitHub GraphQL API with 1-hour cache. Exports
`DEFAULT_STAR_COUNT` (23k) for fallback when `GITHUB_TOKEN` unavailable.

- **Components**: Integrated existing `GitHubStarWidget` React component
into `Sidebar.astro` (bottom of nav) and `TableOfContents.astro` (above
"On this page") using `client:load` hydration.

- **Configuration**: Added middleware to `astro.config.mjs` route
middleware chain.

## Screenshot

![GitHub star widget in
documentation](https://github.com/user-attachments/assets/3d746408-d05b-429d-98ec-1fc8c886646d)

Widget appears in both sidebars showing star count and linking to
https://github.com/nrwl/nx with analytics tracking.

Fixes https://linear.app/nxdev/issue/DOC-268/add-give-us-a-star-cta-back

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `api.npmjs.org`
> - `repo.gradle.org`
> - `staging.nx.app`
> - `telemetry.astro.build`
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/nrwl/nx/settings/copilot/coding_agent)
(admins only)
>
> </details>

<!-- START COPILOT CODING AGENT SUFFIX -->

<details>

<summary>Original prompt</summary>

> Issue Title: Add "Give us a star" CTA Back
> Issue Description: e.g.
`nx-dev/ui-common/src/lib/github-star-widget.tsx`
>
> This goes in the sidebar, but we can also see if we want to put it
elsewhere in the new docs.
> Fixes
https://linear.app/nxdev/issue/DOC-268/add-give-us-a-star-cta-back
>
>
> Comment by User 5261ea6c-c70c-4295-a64f-a792be93af22:
> [https://github.com/nrwl/nx](https://github.com/nrwl/nx)
>
> Comment by User d484ef82-7f7d-4a95-be09-9d82ca3905dc:
> 📋 I wasn't able to determine which GitHub repository to work in.
>
> I think it's one of these, but can you tell me which one is right?
>
> Comment by User d484ef82-7f7d-4a95-be09-9d82ca3905dc:
> Waiting for https://linear.app/nxdev/profiles/james to link their
GitHub account. [Click to authorize
→](https://linear.business.githubcopilot.com/linear/auth)
>
> Comment by User :
> This thread is for an agent session with githubcopilot.
>
>

</details>

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/nrwl/nx/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JamesHenry <900523+JamesHenry@users.noreply.github.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
(cherry picked from commit 4a07faf15c)
2025-11-10 09:36:38 -05:00
Caleb Ukle 2f12f5e260 docs(nx-cloud): re-split out vcs guides to prevent header overlap in ToC (#33282)
guides couldn't be merged into one page w/ tabs and keep consistent
headers. so we're back to splitting them out. but all under a
source-control-integration parent route. so we don't need to do any
redirects and such as the index route will contain the links to each one

(cherry picked from commit 84b0debba8)
2025-11-10 09:36:34 -05:00
Philip Fulcher 53333ea539 docs(nx-dev): revise Nx 22 release article (#33287)
---------

Co-authored-by: Juri <juri.strumpflohner@gmail.com>
(cherry picked from commit b876ced24f)
2025-11-10 09:36:33 -05:00
Philip Fulcher 906162374d docs(nx-dev): remove webinar notifier for October webinar (#33295)
(cherry picked from commit f52d58675a)
2025-11-10 09:36:32 -05:00
Ajit Panigrahi 34dede0b8b docs(core): remove duplicate install instructions (#33278)
Removed duplicate information about installing Nx globally.

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

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

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

Fixes #

(cherry picked from commit e56abcf517)
2025-11-10 09:36:31 -05:00
Juri 30e2fb35ac docs(nx-dev): add article about Storybook and watching buildable libs
(cherry picked from commit 6b95de3ede)
2025-11-10 09:36:29 -05:00
Craigory Coppola cc58c7ee46 chore(repo): remove files accidentally committed while investigating socket issues (#33284)
Some investigation files were accidentally included in a merge

(cherry picked from commit 3e6e0681d0)
2025-11-10 09:36:26 -05:00
Jason Jean ec9b131a22 chore(repo): update nx to 22.1.0-beta.2 (#33283)
Updating Nx from 22.1.0-beta.1 to 22.1.0-beta.2

(cherry picked from commit e97b3fa0e3)
2025-11-10 09:36:25 -05:00
Caleb Ukle ca793a8653 docs(nx-cloud): document missing env vars (#33281)
- add `NX_CLOUD_API` (and nxCloudUrl for nx.json)
- add `NX_NO_CLOUD`

https://6900e6fdb1379200085c29ca--nx-docs.netlify.app/docs/reference/environment-variables#nx-cloud-environment-variables
(cherry picked from commit 221ad580d8)
2025-10-28 16:13:05 -04:00
MaxKless 266bb1a9f3 fix(core): make sure that gemini contextFileName is string before trying to resolve (#33280)
<!-- 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 implementation is brittle and will fail if `contextFileName` is not
a string

## Expected Behavior
we should just not handle other things that folks are putting in there.
but not fail

---------

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
(cherry picked from commit eb4281d7dd)
2025-10-28 16:13:04 -04:00
Leosvel Pérez Espinosa 6e9869231b chore(repo): dogfood pnpm catalogs (#33232)
Dogfoods the Pnpm Catalogs feature in the Nx repo. This is the first
step to move all dependencies to Pnpm Catalogs definitions. More work
will be done incrementally later as we consolidate package versions
across the repository.

The initial list of dependencies moved to Pnpm Catalogs is:

- Angular packages
- React packages
- TypeScript packages
- Jest packages
- Rspack packages
- Some common utilities

(cherry picked from commit f76f1ce3df)
2025-10-28 16:13:03 -04:00
Jason Jean 4f83a0025b chore(repo): update nx to 22.1.0-beta.1 (#33271)
Updating Nx from 22.1.0-beta.0 to 22.1.0-beta.1

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
(cherry picked from commit 54a4eb4da7)
2025-10-28 16:13:03 -04:00
Craigory Coppola 54a269c5bd fix(core): turn v8 serializer off by default but fallback to it if json serialization fails (#33274)
## Current Behavior
We have tried to enable v8 serialization again... but it still seems
problematic. We don't want to revert again... so we evaluated some
options:

1. Disable by default
2. Disable for the single client method we think may be problematic
3. Fall back to JSON if v8 fails
4. Disable by default and still fall back if JSON fails

## Expected Behavior
We decided to update Nx such that the default behavior will be a
combination of #4, and #2. So by default we use JSON, if that
serialization fails we'll try v8... but there's an exception so the
method we know to be an issue will never try v8.

If you opt in to v8 by default, the combo changes to #3 + #2. So, by
default we'd use v8... if it fails try json... never try v8 for
processInBackground

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

Fixes #

(cherry picked from commit d1653eca05)
2025-10-28 16:13:02 -04:00
Juri Strumpflohner 4b6009764a feat(nx-dev): add downloadable resources page and React book blog post
(cherry picked from commit 160b4cce34)
2025-10-28 16:13:01 -04:00
Emilio Heinzmann b31f22b73f fix(docker): guard commitSha null in plugin interpolation (#33275)
## Current Behavior
Docker plugin assumed `commitSha` was always non-null; when `null`,
`shortCommitSha.slice` caused a runtime error during target
interpolation.

## Expected Behavior
Plugin should succeed even if latest commit SHA cannot be resolved,
simply omitting shortCommitSha-based substitutions.

## Changes
- Added null guard: `shortCommitSha` now set to `commitSha ?
commitSha.slice(0,7) : null`.
- Added test "should not throw when commitSha is null" verifying node /
target creation succeeds.
- No breaking changes; only broadens safe input surface.

## Additional notes
Logic only executes when `commitSha` was previously null (error case);
normal paths unchanged. If consumers interpolate `{shortCommitSha}`,
they should handle possible null (unchanged if interpolation is already
optional).

(cherry picked from commit 1089ffc41b)
2025-10-28 16:13:00 -04:00
Juri d5202f635d docs(nx-cloud): self-healing CI classification customization
(cherry picked from commit 43a5e163ce)
2025-10-28 16:12:53 -04:00
Jack Hsu 8e9a7a2eb2 chore(nx-dev): remove link checker from build so it is only checked during CI not deploy (#33272)
This PR removes the need to check links during deploy and instead
enforces it in CI. This removes the need to build astro-docs when
building next.js app.

Reduces Vercel build from 10-11 mins to 6.5 mins.

<img width="1231" height="94" alt="image"
src="https://github.com/user-attachments/assets/ad5d4459-f917-4609-8c00-151f61dc29d6"
/>

(cherry picked from commit 39df8c9b76)
2025-10-28 16:12:52 -04:00
Louie Weng af1d714199 docs(nx-cloud): edit release notes for 2025.07.3 (#33270)
<!-- 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
-->

Update release notes entry tor 2025.07.3 - short link support for DTE
summary

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

Fixes #

(cherry picked from commit 29467dac05)
2025-10-28 16:12:52 -04:00
Rares Matei bf45a8b82a chore(repo): run workspace create and rollup tests serially (#33252)
<!-- 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 -->

You can see the issue here:
https://staging.nx.app/cipes/68fba96042d3126ee8ec0d19/analysis?runGroup=18785923031-1-linux

## 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 BAC-1387

(cherry picked from commit 18b3c52a3c)
2025-10-28 16:12:51 -04:00
Jack Hsu 58d8eb1d9f fix(webpack): prevent errors when importing @nx/webpack before typescript is installed (#33251)
This PR wraps one of the exports of `@nx/webpack` within a dynamic
function that ultimately requires `tsquery`. This causes an issue in
yarn v1 where `typescript` cannot be resolved thus causing an error when
`@nx/webpack` is imported.

The errors happens on every new workspace that starts from empty:

```
npx create-nx-workspace --preset=ts --pm=yarn
nx add @nx/web
nx g @nx/web:app apps/demo --bundler=webpack
```

Results in:

```

 NX   Cannot find module 'typescript'

Require stack:
- /private/var/folders/p4/6tvkdn_11xlc_2j999ybhbkr0000gn/T/tmp-59809-4kedkj5a1XsO/node_modules/@phenomnomnominal/tsquery/dist/src/ast.js
- /private/var/folders/p4/6tvkdn_11xlc_2j999ybhbkr0000gn/T/tmp-59809-4kedkj5a1XsO/node_modules/@phenomnomnominal/tsquery/dist/src/index.js
- /private/var/folders/p4/6tvkdn_11xlc_2j999ybhbkr0000gn/T/tmp-59809-4kedkj5a1XsO/node_modules/@nx/webpack/src/generators/convert-config-to-webpack-plugin/lib/extract-webpack-options.js
- /private/var/folders/p4/6tvkdn_11xlc_2j999ybhbkr0000gn/T/tmp-59809-4kedkj5a1XsO/node_modules/@nx/webpack/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.js
- /private/var/folders/p4/6tvkdn_11xlc_2j999ybhbkr0000gn/T/tmp-59809-4kedkj5a1XsO/node_modules/@nx/webpack/index.js
- /private/tmp/web4/node_modules/@nx/devkit/src/utils/package-json.js
- /private/tmp/web4/node_modules/@nx/devkit/src/generators/to-js.js
- /private/tmp/web4/node_modules/@nx/devkit/public-api.js
- /private/tmp/web4/node_modules/@nx/devkit/index.js
- /private/tmp/web4/node_modules/@nx/web/src/generators/application/application.js
- /private/tmp/web4/node_modules/nx/src/config/schema-utils.js
- /private/tmp/web4/node_modules/nx/src/command-line/run/executor-utils.js
- /private/tmp/web4/node_modules/nx/src/project-graph/utils/project-configuration-utils.js
- /private/tmp/web4/node_modules/nx/src/utils/package-json.js
- /private/tmp/web4/node_modules/nx/bin/nx.js
Pass --verbose to see the stacktrace.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```

Note: Other generators like React/Vue are fine since they have
dependency on tsquery, which installs typescript.

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
(cherry picked from commit f36c61f530)
2025-10-28 16:12:50 -04:00
Craigory Coppola e07b73a55e Reapply "fix(core): add option to use v8 for daemon message serialization (#33192)
This reverts commit 54db861b72.

## Current Behavior
Daemon messaging is all done over JSON messages

## Expected Behavior
Daemon messages use v8 serialization to avoid string length issues

## 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>
Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit a52e7b0f6e)
2025-10-28 16:12:30 -04:00
Craigory Coppola bd219b60eb fix(core): ensure daemon writes project graph cache to disk consistently (#33217)
## Current Behavior

When the Nx daemon returns a cached project graph from memory (without
recomputing), it does not write the graph to disk. This creates a
cache/daemon mismatch scenario:

1. Daemon has valid project graph in memory
2. A non-daemon process (fallback when daemon fails) encounters errors
and writes cache to disk with those errors
3. Parent process gets clean graph from daemon
4. Forked executor processes read from disk cache which contains errors
5. The errors cause `readProjectGraphCache()` to return `null` (when no
`minimumComputedAt` is provided)
6. This triggers a misleading "No cached ProjectGraph is available"
error instead of surfacing the actual errors

This issue manifests intermittently in CI environments, especially when:
- Daemon connection timeouts occur
- Multiple concurrent processes are running (DTE scenarios)
- File system latency is high

## Expected Behavior

The daemon should always write its current project graph to disk
whenever it returns it, ensuring the disk cache stays synchronized with
the daemon's in-memory cache. This prevents stale or errored caches from
persisting when the daemon has a valid graph.

## Related Issue(s)

Fixes NXC-3030

## Implementation Details

Modified `getCachedSerializedProjectGraphPromise()` in
`packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts`
to write the project graph cache to disk after retrieving the result,
even when reusing the in-memory cached graph.

The fix ensures that:
- Any errored cache written by a non-daemon process gets overwritten by
the daemon's valid graph
- Forked executor processes always read a consistent cache that matches
what the daemon served to the parent process
- Real errors are properly surfaced instead of being hidden by a generic
"no cache available" message

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

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 7021056fae)
2025-10-28 16:12:23 -04:00
Craigory Coppola 8df823a3e9 fix(core): split lockfile cache and other performance improvements (#33256)
## Summary
This PR includes three performance and correctness improvements:

1. **Split lockfile cache into separate node and dependency caches** -
Previously, both createNodes and createDependencies would read/write the
entire cache. Now each manages its own cache independently:
   - `parsed-lock-file.nodes.json` for external nodes
   - `parsed-lock-file.dependencies.json` for dependencies

2. **Prevent duplicate plugin resolution calls with promise cache** -
Added a promise cache to prevent concurrent duplicate calls to
`retrieveProjectConfigurationsWithoutPluginInference` when multiple
plugins fail to resolve simultaneously

3. **Normalize targets in separate loop after validation** - Moved
target normalization out of the validation loop to ensure proper
sequencing

## Test plan
- [ ] Tests pass (currently failing in CI - needs investigation)
- [ ] Build succeeds
- [ ] Lint passes

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 98e510b47e)
2025-10-27 16:04:07 -04:00
Jack Hsu 686e973215 fix(core): prevent undefined importer crash in pnpm lockfile parsing (#33223)
When stringifying a pnpm v9 lockfile with workspace packages, Nx crashes
with: "Cannot destructure property 'specifiers' of 'projectSnapshot' as
it is undefined."

This occurs when:
- The lockfile has a root importer with `link:` references to workspace
packages
- But the lockfile is missing the workspace package importer entries
- The code tries to access `importers[importerPath]` which returns
undefined
- This undefined value gets added to the output lockfile
- During serialization, it crashes when trying to destructure undefined

Workspace packages with missing importers are now silently skipped
during lockfile serialization. This prevents the crash and allows Nx to
continue operating with out-of-sync lockfiles.

The fix adds a null check before adding workspace dependency importers
to the output lockfile.

Closes NXC-3244

(cherry picked from commit 514005a7c9)
2025-10-27 16:04:07 -04:00
Sander Boelhouwers 988f7f80c7 fix(core): add accept header to http remote cache get (#33093)
With the Accept header in place during the retrieval of cache, the
client always expects an octet-stream from the server.

<!-- 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 the `Accept` header is missing, you might not get the correct data
depending on the underlying implementation of a self hosted cache
solution. We use AWS API Gateway which has a hard requirement for
`Accept` to determine how it should convert the data.

Fixes #33092

(cherry picked from commit 3f7119a821)
2025-10-27 16:04:07 -04:00
Juri 94b8180e4e docs(misc): add webinar banner to astro docs
(cherry picked from commit a082693838)
2025-10-27 16:04:06 -04:00
Caleb Ukle a7a33c3f40 docs(gradle): update gradle links and improve graph comps (#33255)
- **docs(gradle): make sure gradle refs point to /java/gradle now**
- **docs(gradle): add syntax highlighting for diff codeblock**
- **fix(nx-dev): improve graph loading behavior to prevent pop-in
flash**

(cherry picked from commit 630d227a5f)
2025-10-27 16:04:06 -04:00
Jack Hsu eb0a662676 docs(misc): add nx-cloud start-agent command to CLI reference (#33250)
This PR adds the `nx-cloud start-agent` command used for manual DTEs to
the reference page.

Also update table code elements such that they don't wrap.

<img width="872" height="584" alt="image"
src="https://github.com/user-attachments/assets/b73a038d-e0de-421a-b430-2d76c0ec4345"
/>

Closes DOC-273, DOC-310

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 66a437a42a)
2025-10-27 16:04:06 -04:00
Philip Fulcher b3cd15f4d8 docs(nx-dev): update Nx 22 release article (#33245)
(cherry picked from commit 7712d2a656)
2025-10-27 16:04:06 -04:00
Louie Weng 66bce4df1e feat(gradle): add custom installation path to options (#33187)
<!-- 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 -->

We search for the gradle wrapper of a project by first looking at the
project root, then traversing upwards to the workspace root. If a
workspace has a separate gradle project defined that does not contain a
wrapper, then Nx will error.

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

Add a field to the gradle plugin that will allow users to specify a
custom gradle installation within their workspace. Nx will check for a
gradle wrapper that the specified location when executing gradle tasks.

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

Fixes NXC-3147

(cherry picked from commit 215876c398)
2025-10-27 16:04:06 -04:00
Jack Hsu 4f3b544481 fix(vite): nxViteTsPaths supports local path aliases (#33241)
<!-- 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
Local `tsconfig.app.json` is never picked up due to wrong resolved path.

## Expected Behavior
Local `tsconfig.app.json` is picked up and the path aliases are added to
Vite.

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

Fixes #33231

(cherry picked from commit 442f745b23)
2025-10-27 11:51:52 -04:00
Benjamin Cabanes 65192612f8 docs(nx-dev): sunset Explain with AI for Self-Healing CI (#33243)
Removed "Explain with AI" feature documentation and redirected all URLs
to Self-Healing CI. Added sunset notice to blog posts, updated
configuration files, and preserved historical content for reference.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
(cherry picked from commit 7c978ed8c9)
2025-10-27 11:51:51 -04:00
Colum Ferry 8b03d5f2f5 fix(docker): handle dockerfile at project root tag (#33236)
## Current Behavior
When `Dockerfile` is at project root, we attempt to append `--tag .`
which is invalid for docker.

## Expected Behavior
Ensure that if `Dockerfile` is at project root, we use `workspaceRoot`
to determine the `--tag`.
Note, this tag is primarily used as a deterministic method for Nx to
find the correct docker image when calling `docker run` and `nx release`

(cherry picked from commit e57c8a71b2)
2025-10-27 11:51:51 -04:00
Hugo Burton db10e7599a fix(core): stream without prefixes showing tui (#33194)
<!-- 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 using `--output-style=stream-without-prefixes` nx incorrectly shows
the TUI instead of streaming

## Expected Behavior
When using `--output-style=stream-without-prefixes`, nx should stream
with no prefixes just like it does with `--output-style=stream`

## Related Issue(s)

Fixes #32535

Co-authored-by: Hugo Burton <hugo.burton@westpac.com.au>
(cherry picked from commit 4a4b780685)
2025-10-27 11:51:50 -04:00
Jason Jean 8c30e71006 chore(core): improvements to native build and error handling (#33238)
## Current Behavior

`node_modules` are being copied during copy-local-native

## Expected Behavior

`node_modules` are not being copied during `copy-local-native`

(cherry picked from commit 1cf2c6665f)
2025-10-27 11:51:49 -04:00
Jason Jean 9205b88766 chore(repo): update nx to 22.1.0-beta.0 (#33244)
Updating Nx from 22.0.0-rc.0 to 22.1.0-beta.0

(cherry picked from commit 2f1712f894)
2025-10-27 11:51:49 -04:00
Jason Jean 20c1de79c3 chore(maven): only run nx-maven-plugin:install for maven e2e tests (#33242)
## Current Behavior

Maven is installed as a global dependency for all e2e targets
(`e2e-local`, `e2e-ci--**/**`, and `e2e-macos-ci--**/*`), even when only
the Maven e2e tests need it.

## Expected Behavior

Maven should only be installed as a dependency for the Maven e2e tests
that actually use it, avoiding unnecessary installations for other e2e
test projects.

## Changes Made

- Removed `nx-maven-plugin:install` from the global e2e target defaults
in `nx.json`
- Added `nx-maven-plugin:install` as a specific dependency to the Maven
e2e project targets in `e2e/maven/project.json`

This optimization ensures Maven is only installed when needed, reducing
unnecessary build overhead for other e2e tests.

(cherry picked from commit 81fd8b4170)
2025-10-27 11:51:48 -04:00
Colum Ferry 52d4a8efa5 fix(core): should find dockerfiles to suggest installing docker plugin (#33234)
## Current Behavior
`nx init` does not search for `Dockerfile` patterns to suggest adding
the `@nx/docker` plugin.

## Expected Behavior
`nx init` finds and suggests `@nx/docker` plugin

Fixes NXC-3319

(cherry picked from commit 3047fbda9e)
2025-10-27 11:51:48 -04:00
Colum Ferry 0bd7b9f29b chore(repo): update codeowners for docker (#33240)
(cherry picked from commit 09fb0b693a)
2025-10-27 11:51:47 -04:00
Leosvel Pérez Espinosa d9424bcd99 fix(core): fix swapped arguments when resolving catalog references from the filesystem (#33237)
Fixes the order of the arguments in invocations to
`resolveCatalogReference` when resolving catalog references from the
filesystem (not using a `Tree`).

(cherry picked from commit 6788fccbd6)
2025-10-27 11:51:46 -04:00
Leosvel Pérez Espinosa 465a188996 fix(misc): handle null exit codes from crashed child processes (#33163)
## Current Behavior

In some scenarios, when some processes terminate unexpectedly (e.g.
crashed due to OOM), the task runner will incorrectly determine their
exit code to be 0. This results in Nx storing the task results as a
success, which can cause cache hits with false positive successes.

## Expected Behavior

When processes terminate unexpectedly (e.g. crashed due to OOM), the
task runner should correctly determine their exit code from the signal,
and it should never be 0. The stored task result should not be marked as
successful.

## Related Issue(s)

Fixes #29204

(cherry picked from commit f1fe6c0e24)
2025-10-27 11:51:46 -04:00
Colum Ferry 6e34433639 fix(docker): handle undefined options when creating graph (#33235)
## Current Behavior
When `@nx/docker` is registered via string only (`nxJson.plugins:
["@nx/docker"]`, project graph creation fails because we try to access
`options.buildTarget`.

## Expected Behavior
Handle undefined `options` gracefully, and still create the default
target.

## Related Issue(s)

Fixes NXC-3320

(cherry picked from commit 54bd3c498f)
2025-10-27 11:51:46 -04:00
Craigory Coppola 11df0ebdf3 chore(repo): remove check commit (#33227)
check-commit is superceded by the pr title target

(cherry picked from commit fa45d79e55)
2025-10-27 11:51:45 -04:00
Craigory Coppola a89645ac44 docs(dotnet): add migration guide from @nx-dotnet/core (#33206)
## Current Behavior
No docs describing migration path

## Expected Behavior
Docs describing migration path

## 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>
Co-authored-by: Caleb Ukle <caleb@nrwl.io>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit b9af6a74b8)
2025-10-27 11:50:40 -04:00
Craigory Coppola 5659e55c51 chore(repo): mark dotnet e2e as parallel 1 (#33226)
## Current Behavior
.NET sometimes bails on a failed mutex in e2e

## Expected Behavior
it runs only 1 at a time

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

Fixes #

(cherry picked from commit c4f1f53b70)
2025-10-27 11:50:40 -04:00
Craigory Coppola 3695bd6f56 chore(gradle): format files (#33225)
(cherry picked from commit a4d9ad9c66)
2025-10-27 11:50:39 -04:00
Jack Hsu 85a5a3aeb0 docs(core): update search filter on createnodes compat page (#33216)
This PR updates one filter from `Reference` to `References` to keep
consistency with our other pages.

Before (Both Reference and References show up):

<img width="137" height="206" alt="image"
src="https://github.com/user-attachments/assets/729379b6-0315-4b99-af90-fd96b3e96830"
/>

After (Just References, and every filter is plural):

<img width="736" height="535" alt="image"
src="https://github.com/user-attachments/assets/9c2ecbcd-67c4-4923-9d05-e2081b0e9dba"
/>

Closes DOC-309

(cherry picked from commit d3058a726f)
2025-10-27 11:50:39 -04:00
Jack Hsu 377bd571f2 fix(nx-dev): add copy-docs back as a dep of serve (#33215)
It was removed when the scripts were cleaned up during next.js->astro
migration. Adding this back since blog posts need to be synced first
before serving.

(cherry picked from commit 97d38f75ee)
2025-10-27 11:50:38 -04:00
Craigory Coppola 69c1db3d4a fix(core): prevent error message containing [object Object] for invalid {workspaceRoot} placement (#33203)
## Current Behavior

When project configuration errors occur due to invalid token usage
(e.g., `{workspaceRoot}` in the middle of a path), error messages don't
provide sufficient context about where the error occurred.

## Expected Behavior

Error messages should include:
- For project-level errors: the project and target context (e.g.,
"libs/my-app:build")
- For nx.json targetDefaults errors: the nx.json context (e.g.,
"nx.json[targetDefaults]:test")

This makes it much easier for users to locate and fix the configuration
issue.

## Changes

This PR adds comprehensive integration tests to verify the improved
error messaging:
- Test for project-level invalid token usage showing project:target
context
- Test for nx.json targetDefaults invalid token usage showing nx.json
context

Tests use mock plugins to simulate realistic scenarios where invalid
`{workspaceRoot}` token usage would occur, ensuring the error messages
contain the expected context information.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
(cherry picked from commit d717414ec2)
2025-10-27 11:50:38 -04:00
Chau Tran 99d8c802a4 docs(nx-cloud): add SCIM section for SAML Okta (#33222)
- [x] add SCIM for SAML okta
- [x] break up SAML Auth into Azure SAML Auth and Okta SAML Auth

---
Azure SAML Auth and Okta SAML Auth as cards under Single Tenant
<img width="777" height="649" alt="image"
src="https://github.com/user-attachments/assets/3353e804-ea03-468b-82e5-acf28a76bddd"
/>

---
Azure SAML Auth and Okta SAML Auth on sidebar
<img width="242" height="286" alt="image"
src="https://github.com/user-attachments/assets/27365e7f-82ba-4335-9f8d-45b4d61aa3a4"
/>

---
Okta SCIM docs ToC
<img width="1023" height="872" alt="image"
src="https://github.com/user-attachments/assets/9221b31f-004b-4026-9430-9ed12fa7d0dc"
/>

(cherry picked from commit b59fb033b9)
2025-10-27 11:50:36 -04:00
Caleb Ukle 319f343aba fix(nx-dev): update docs code blocks usage (#32998)
by default code blocks will get text as the lang if not set or the lang
is not supported
but we should be so I don't have to look at the warnings in the terminal
output 😅
also remove the frame=none since the team preferred to have the terminal
frame

Example of invalid codeblock messages

![wm_2025-10-15T11-26-05@2x](https://github.com/user-attachments/assets/33161287-3fa3-4897-a5dd-0de3a47b37fe)

Also added conformance rule for validating image pages for public and
src/assets/ directory

examples of incorrect absolute path ref from "public" folder and
incorrect absolute path:

![wm_2025-10-15T10-23-41@2x](https://github.com/user-attachments/assets/354800a4-6628-4236-87d9-2590cb56fe54)

fixes DOC-242
fixes DOC-259

(cherry picked from commit 4073537270)
2025-10-27 11:50:35 -04:00
Philip Fulcher 9df2d7daf1 docs(nx-dev): add nx 22 release article (#33219)
(cherry picked from commit 59cf495fe1)
2025-10-27 11:50:34 -04:00
Colum Ferry bdc341d17d feat(docker): support inferring additional args for targets with interpolation support (#32892)
## Current Behavior
Currently, when configuring the `@nx/docker` plugin, we only set the
target name and a basic command.
The intention was that targetDefaults might be able to be used to
configure additional args, but this falls short in some places.

## Expected Behavior
Allow setting additional args when configuring the `@nx/docker` plugin
that supports interpolated values, similar to `versionSchemes`.

This will allow additional flexibility when setting up the docker build
command such as:

```json
{
  "plugin": "@nx/docker",
  "options": {
     "buildTarget": {
       "name": "docker:build",
       "args": ["-t {projectName}"]
     }
  }
}
```

This means that we can use `nx run-many -t docker:build` and it will
successfully add the name of the projects into the tag.

This is one example, other examples include being able to set individual
Docker Layer Caching where each registry needs a unique name.

(cherry picked from commit 0a8272d7e7)
2025-10-27 11:50:34 -04:00
Jason Jean 1697825b7f fix(maven): use File.isAbsolute for cross-platform path detection (#33195)
## Current Behavior

The Maven plugin currently checks if a path is absolute by using
`outputFile.startsWith("/")`. This only works on Unix-like systems and
fails on Windows where absolute paths start with a drive letter (e.g.,
`C:\`).

## Expected Behavior

The Maven plugin should correctly identify absolute paths on all
platforms (Windows, macOS, Linux) using the platform-agnostic
`File.isAbsolute()` method.

## Related Issue(s)

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

N/A - This is a proactive bug fix for cross-platform compatibility.

---

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

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit 500a4c92ee)
2025-10-27 11:50:33 -04:00
Emilio Heinzmann 114f90c8ef feat(release): support {versionActionsVersion} in docker version scheme (#33178)
(cherry picked from commit b2ba8c2770)
2025-10-27 11:50:32 -04:00
Colum Ferry 2089972d79 fix(core): continue execution when cloud client is unavailable (#33214)
## Current Behavior
When Nx Cloud is used, but the Nx Cloud client is unavailable, an error
is thrown and commands are not run.

## Expected Behavior
When Nx Cloud is used, but the client is unavailable, continue execution
without Nx Cloud.

## Related Issue(s)

Fixes NXC-3175

(cherry picked from commit 87c8d49b7e)
2025-10-27 11:50:32 -04:00
Rares Matei af4c8d2638 chore(repo): fix task flakiness (#33109)
<!-- 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 -->

Tests either cause agents to run out of memory:
<img width="956" height="358" alt="image"
src="https://github.com/user-attachments/assets/e55bae05-7757-46e7-88ed-158f72411195"
/>
<img width="1278" height="336" alt="image"
src="https://github.com/user-attachments/assets/40dc8dd6-4409-461e-b75a-5c1c36551da5"
/>

Or setup tasks fail due to network flakiness:
https://staging.nx.app/runs/J1qWVZA7K5

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

A fully affected, cache busted task graph should run without any
failures.

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

Fixes #

(cherry picked from commit 516db5c43d)
2025-10-27 11:50:31 -04:00
MaxKless 0c550039f3 fix(misc): add explanatory footer to ai agents prompts (#33182)
(cherry picked from commit 44187bde41)
2025-10-27 11:50:31 -04:00
Craigory Coppola 5914e4bded docs(dotnet): improve dotnet docs around option types (#33210)
This pull request updates the documentation for configuring .NET target
types in the `nx.json` file to provide clearer instructions and
examples. The changes make it easier to understand how to customize
target names and configurations for the `@nx/dotnet` plugin.

Improvements to configuration documentation:

* Added a section describing how each target type can be configured,
including renaming targets, customizing options, disabling targets, and
specifying additional properties.
* Updated the example configuration to show how to rename targets (e.g.,
"build" to "compile"), add configurations (e.g., production
optimization), set dependencies between targets, and disable targets
(e.g., disabling "pack").
* Clarified that targets are created with the configuration specified in
the `nx.json` `plugins` array, rather than just with custom names.

(cherry picked from commit a8d6b0ad65)
2025-10-27 11:50:30 -04:00
Colum Ferry 1f1d45c0bb fix(node): migrate to koa 3.0.3 (#33208)
Update `koa` to `3.0.3`

(cherry picked from commit 1002ad5198)
2025-10-27 11:50:30 -04:00
Jack Hsu 5430558d1d docs(misc): update nx release documentation for v22 changes (#33189)
Changes:
- Update all Nx Release guides to show the config for v22 and prior
verisons
- Update `nx.json` reference page to show `releaseTag` property and what
they are prior to v22
- Add example showing all releaseTag options in v22 and < v22 (pattern,
requireSemver, strictPreid, preferDockerVersion, checkAllBranchesWhen)
- Update asides to use "Nx 22 Changes" instead of "Breaking Changes"
(properties deprecated, not breaking until v23)
- Fix `version.generatorOptions.updateDependents` →
`version.updateDependents` reference

Closes DOC-261

<img width="781" height="513" alt="image"
src="https://github.com/user-attachments/assets/3b8a13c4-e863-40da-87cb-ae5a6264bb9e"
/>

<img width="866" height="626" alt="image"
src="https://github.com/user-attachments/assets/e02fd179-80d7-42ea-993c-5da0ed793eaa"
/>

<img width="796" height="408" alt="image"
src="https://github.com/user-attachments/assets/14bb5c54-089c-4ed3-8774-731cbdaa37a5"
/>

---------

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit b3c3e40490)
2025-10-27 11:50:29 -04:00
James Henry e43687078a docs(nx-dev): add guides for Release Groups and Update Dependents (#33200)
<!-- 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: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
(cherry picked from commit ab82c7b1be)
2025-10-27 11:50:28 -04:00
James Henry 6b49dc2271 docs(nx-dev): add dedicated guide for nx release programmatic API (#33198)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

The first-class programmatic API of nx release is only documented within
the manage releases introduction and is incomplete (`ReleaseClient` is
not covered at all).

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

The programmatic API has its own in depth guide, which is then
cross-referenced from the manage releases guide. `ReleaseClient` is now
documented including its new Nx 22 features.

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

Fixes #

(cherry picked from commit 7c2f3511e2)
2025-10-27 11:50:27 -04:00
Colum Ferry 23ad793b4d docs(release): update docs to use correct releaseTag object notation (#33202)
Update docs to match new API

---------

Co-authored-by: James Henry <james@henry.sc>
(cherry picked from commit 2402ecb576)
2025-10-27 11:50:26 -04:00
James Henry dae7ca17e0 chore(repo): remove unused typedoc-theme (#33196)
Deletes the unused typedoc-theme project from the root of the workspace

(cherry picked from commit 3847528d44)
2025-10-27 11:50:26 -04:00
James Henry 6807b5819c chore(repo): clean up images (#33197)
(cherry picked from commit b92df85b97)
2025-10-27 11:50:08 -04:00
Craigory Coppola 1aec22f27f docs(dotnet): refresh docs after adding run / watch config (#33190)
## Current Behavior
`run`/`watch` are not mentioned in docs

## Expected Behavior
`run`/`watch` docs are accurate

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

Fixes #

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
(cherry picked from commit 083b97255a)
2025-10-27 11:50:08 -04:00
832 changed files with 15412 additions and 6866 deletions
+87
View File
@@ -0,0 +1,87 @@
---
name: run-nx-generator
description: Run Nx generators with prioritization for workspace-plugin generators. Use this when generating code, scaffolding new features, or automating repetitive tasks in the monorepo.
allowed-tools: Bash, Read, Glob, Grep, mcp__nx-mcp__nx_generators, mcp__nx-mcp__nx_generator_schema
---
# Run Nx Generator
This skill helps you execute Nx generators efficiently, with special focus on workspace-plugin generators from your internal tooling.
## Generator Priority List
Use the `mcp__nx-mcp__nx_generator_schema` tool to get more information about how to use the generator
Choose which generators to run in this priority order:
### 🔥 Workspace-Plugin Generators (High Priority)
These are your custom internal tools in `tools/workspace-plugin/`
### 📦 Core Nx Generators (Standard)
Only use these if workspace-plugin generators don't fit:
- `nx generate @nx/devkit:...` - DevKit utilities
- `nx generate @nx/node:...` - Node.js libraries
- `nx generate @nx/react:...` - React components and apps
- Framework-specific generators
## How to Run Generators
1. **List available generators**:
2. **Get generator schema** (to see available options):
Use the `mcp__nx-mcp__nx_generator_schema` tool to get more information about how to use the generator
3. **Run the generator**:
```bash
nx generate [generator-path] [options]
```
4. **Verify the changes**:
- Review generated files
- Run tests: `nx affected -t test`
- Format code: `npx prettier --write [files]`
## Best Practices
- ✅ Always check workspace-plugin first - it has your custom solutions
- ✅ Use `--dry-run` flag to preview changes before applying
- ✅ Format generated code immediately with Prettier
- ✅ Test affected projects after generation
- ✅ Commit generator changes separately from manual edits
## Examples
### Bumping Maven Version
When updating the Maven plugin version, use the workspace-plugin generator:
```bash
nx generate @nx/workspace-plugin:bump-maven-version \
--newVersion 0.0.10 \
--nxVersion 22.1.0-beta.7
```
This automates all the version bumping instead of manual file edits.
### Creating a New Plugin
For creating a new create-nodes plugin:
```bash
nx generate @nx/workspace-plugin:create-nodes-plugin \
--name my-custom-plugin
```
## When to Use This Skill
Use this skill when you need to:
- Generate new code or projects
- Scaffold new features or libraries
- Automate repetitive setup tasks
- Update internal tools and configurations
- Create migrations or version updates
+4 -4
View File
@@ -8,11 +8,11 @@
// Try a more recent distribution, if your are having build issues related to GLIBC version
// Here we use 'bookworm', which is based on `Debian-12`, which comes with `GLIBC v2.36`
// (Nx tools currenlty requires `GLIBC v2.33` or higher)
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-bookworm",
// Note: Using base debian image instead of typescript-node since mise will manage all tools
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
},
// All tools (Node, Java, Rust, Dotnet) are managed by mise via mise.toml
"features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// 4211 = nx graph port
+23 -5
View File
@@ -1,12 +1,30 @@
#!/bin/sh
#!/bin/bash
# Update the underlying (Debian) OS, to make sure we have the latest security patches and libraries like 'GLIBC'
# Update the underlying (Debian) OS, to make sure we have the latest security patches and libraries like 'GLIBC'
echo "⚙️ Updating the underlying OS..."
sudo apt-get update && sudo apt-get -y upgrade
# Uninstall globally installed PNPM (required version will be reinstalled through corepack)
echo "❌ Uninstalling globally installed PNPM..."
npm uninstall -g pnpm
# Install mise for managing development tools (Node, Java, Rust, Dotnet)
echo "⚙️ Installing mise..."
curl https://mise.run | sh
# Add mise to PATH
export PATH="$HOME/.local/bin:$PATH"
# Trust the mise.toml configuration file
echo "⚙️ Trusting mise.toml configuration..."
mise trust
# Install all tools from mise.toml (node, java, rust, dotnet)
echo "⚙️ Installing tools via mise (node, java, rust, dotnet)..."
mise install
# Activate mise to make tools available in current shell
eval "$(mise activate bash)"
# Add mise activation to bashrc for future shell sessions
echo "⚙️ Configuring mise activation in shell..."
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
# Prevent corepack from prompting user before downloading PNPM
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
+2 -2
View File
@@ -46,7 +46,7 @@ jobs:
main-branch-name: 'master'
- name: Start CI Run
run: npx nx-cloud@next start-ci-run --fix-tasks="!*check-commit*" --auto-apply-fixes="*format:check*,*sync:check*,*conformance:check*,*format-native*,*lint-native*,*lint*,*astro-docs:validate-links*" --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
run: npx nx-cloud@next start-ci-run --auto-apply-fixes="*format:check*,*sync:check*,*conformance:check*,*format-native*,*lint-native*,*lint*,*astro-docs:validate-links*" --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
- name: Install dependencies
run: |
@@ -104,7 +104,7 @@ jobs:
pnpm nx-cloud record -- nx-cloud conformance:check
pids+=($!)
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners --parallel=1 --no-dte &
pnpm nx run-many -t check-imports check-lock-files check-codeowners --parallel=1 --no-dte &
pids+=($!)
pnpm nx affected --targets=lint,test,test-kt,build,e2e,e2e-ci,format-native,lint-native &
+5
View File
@@ -51,6 +51,8 @@ jobs:
build-mode: none
- language: rust
build-mode: none
- language: csharp
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
@@ -63,6 +65,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Language Tooling
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
+5
View File
@@ -46,6 +46,8 @@ jobs:
build-mode: none
- language: rust
build-mode: none
- language: csharp
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
@@ -58,6 +60,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Language Tooling
uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
+1
View File
@@ -0,0 +1 @@
NX_USE_V8_SERIALIZER=false
+68 -176
View File
@@ -1,184 +1,76 @@
common-env-vars: &common-env-vars
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NX_NATIVE_LOGGING: 'nx::native::db'
# These are need for build and link validation for next.js and astro apps
NEXT_PUBLIC_ASTRO_URL: 'https://master--nx-docs.netlify.app'
NX_DEV_URL: 'https://canary.nx.dev'
common-init-steps: &common-init-steps
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: .pnpm-store
base-branch: 'master'
# reads mise.toml and installs toolchains needed for repo
- name: Setup toolchains
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/install-mise/main.yaml'
- name: Verify toolchain versions
script: |
echo "mise: $(mise --version)"
echo "node: $(node --version)"
echo "pnpm: $(pnpm --version)"
echo "bun: $(bun --version)"
echo "rust: $(rustc --version) - $(cargo --version)"
echo "dotnet: $(dotnet --version)"
echo "java: $(javac --version)"
- name: Install system deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev zip unzip
- name: Pnpm Install from lockfile
script: |
pnpm install --frozen-lockfile
- name: Install browsers
script: |
pnpm exec cypress install
pnpm exec playwright install --with-deps
- name: Install rust deps
script: |
cargo fetch
- name: Setup gradle
script: |
./gradlew wrapper
./gradlew --version
- name: Configure git metadata (needed for lerna smoke tests)
script: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
launch-templates:
linux-large:
resource-class: 'docker_linux_amd64/large'
image: 'us-east1-docker.pkg.dev/nxcloudoperations/nx-cloud/nx-agents-base-images:ubuntu22.04-node20.19-v1'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NX_NATIVE_LOGGING: 'nx::native::db'
# These are need for build and link validation for next.js and astro apps
NEXT_PUBLIC_ASTRO_URL: 'https://master--nx-docs.netlify.app'
NX_DEV_URL: 'https://canary.nx.dev'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
- name: Check Node Version
script: node --version
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: .pnpm-store
base-branch: 'master'
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Install bun
script: |
curl -fsSL https://bun.sh/install | bash
echo "BUN_INSTALL=$HOME/.bun" >> $NX_CLOUD_ENV
echo "PATH=$HOME/.bun/bin:$PATH" >> $NX_CLOUD_ENV
- name: Check bun
script: |
bun --version
- name: Install e2e deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Pnpm Install from lockfile
script: |
pnpm install --frozen-lockfile
- name: Install Browsers
script: |
pnpm exec cypress install
pnpm exec playwright install --with-deps
- name: Install Rust
script: |
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install 1.70.0
- name: Configure git metadata (needed for lerna smoke tests)
script: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- name: Load Cargo Env
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
- name: Install Rust Dependencies
script: |
cargo fetch
- name: Setup Java 21
script: |
sudo apt update
sudo apt install -y openjdk-21-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
java -version
- name: Setup Gradle
script: |
./gradlew wrapper
./gradlew --version
- name: Setup .NET 9
script: |
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-9.0
dotnet --version
env: *common-env-vars
init-steps: *common-init-steps
linux-extra-large:
resource-class: 'docker_linux_amd64/extra_large'
image: 'us-east1-docker.pkg.dev/nxcloudoperations/nx-cloud/nx-agents-base-images:ubuntu22.04-node20.19-v1'
env:
GIT_AUTHOR_EMAIL: test@test.com
GIT_AUTHOR_NAME: Test
GIT_COMMITTER_EMAIL: test@test.com
GIT_COMMITTER_NAME: Test
SELECTED_PM: 'pnpm'
NX_NATIVE_LOGGING: 'nx::native::db'
# These are need for build and link validation for next.js and astro apps
NEXT_PUBLIC_ASTRO_URL: 'https://master--nx-docs.netlify.app'
NX_DEV_URL: 'https://canary.nx.dev'
init-steps:
- name: Checkout
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
- name: Check Node Version
script: node --version
- name: Cache restore
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
inputs:
key: 'pnpm-lock.yaml'
paths: .pnpm-store
base-branch: 'master'
- name: Install zip and unzip
script: sudo apt-get -yqq install zip unzip
- name: Install bun
script: |
curl -fsSL https://bun.sh/install | bash
echo "BUN_INSTALL=$HOME/.bun" >> $NX_CLOUD_ENV
echo "PATH=$HOME/.bun/bin:$PATH" >> $NX_CLOUD_ENV
- name: Check bun
script: |
bun --version
- name: Install e2e deps
script: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Pnpm Install from lockfile
script: |
pnpm install --frozen-lockfile
- name: Install Browsers
script: |
pnpm exec cypress install
pnpm exec playwright install --with-deps
- name: Install Rust
script: |
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup toolchain install 1.70.0
- name: Configure git metadata (needed for lerna smoke tests)
script: |
git config --global user.email test@test.com
git config --global user.name "Test Test"
- name: Load Cargo Env
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
- name: Install Rust Dependencies
script: |
cargo fetch
- name: Setup Java 21
script: |
sudo apt update
sudo apt install -y openjdk-21-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
java -version
- name: Setup Gradle
script: |
./gradlew wrapper
./gradlew --version
- name: Setup .NET 9
script: |
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-9.0
dotnet --version
env: *common-env-vars
init-steps: *common-init-steps
+27 -18
View File
@@ -1,19 +1,22 @@
distribute-on:
default: auto linux-large, 1 linux-extra-large
default: auto linux-large, 3 linux-extra-large
assignment-rules:
# e2e-release tests must run sequentially due to shared git state and publishing operations
- projects:
- e2e-release
targets:
- e2e-ci**
run-on:
- agent: linux-large
parallelism: 1
- projects:
- e2e-gradle
targets:
- e2e-ci**
run-on:
- agent: linux-extra-large
parallelism: 1
- projects:
- nx
- workspace
- remix
- nx-maven-plugin
targets:
- install
- test
run-on:
- agent: linux-large
parallelism: 1
@@ -21,18 +24,22 @@ assignment-rules:
parallelism: 1
- projects:
- e2e-release
- e2e-angular
- e2e-react
- e2e-next
- e2e-web
- e2e-eslint
- e2e-remix
- e2e-cypress
- e2e-docker
- e2e-js
- e2e-nx-init
- e2e-dotnet
- e2e-workspace-create
- e2e-rollup
targets:
- e2e-ci**react-package**
- e2e-ci**react.test**
- e2e-ci**react-router-ts-solution**
- e2e-ci**next-e2e-and-snapshots**
- e2e-ci**next-generation**
- e2e-ci**next-ts-solutions**
- e2e-ci**next-webpack**
- e2e-ci**web**
- e2e-ci**
run-on:
- agent: linux-large
parallelism: 1
@@ -70,6 +77,8 @@ assignment-rules:
run-on:
- agent: linux-large
parallelism: 6
- agent: linux-extra-large
parallelism: 6
- targets:
- "*"
+6 -2
View File
@@ -14,7 +14,6 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
/graph/** @philipjfulcher @FrozenPandaz @bcabanes @MaxKless @Coly010 @jaysoo @nartc
/images @nrwl/nx-docs-reviewers
/nx-dev/** @nrwl/nx-docs-reviewers
/typedoc-theme @nrwl/nx-docs-reviewers
# Plugin Verticals
@@ -100,7 +99,7 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
/e2e/storybook/** @nrwl/nx-storybook-reviewers
# Docker
/packages/docker/** @nrwl/nx-core-reviewers @Coly010
/packages/docker/** @nrwl/nx-core-reviewers @Coly010 @jaysoo
## Devkit
/packages/devkit/** @nrwl/nx-devkit-reviewers
@@ -134,6 +133,10 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
/e2e/workspace-create/** @nrwl/nx-core-reviewers
/e2e/release/** @nrwl/nx-core-reviewers
# .NET
/packages/dotnet/** @FrozenPandaz @AgentEnder
/e2e/dotnet/** @FrozenPandaz @AgentEnder
# Misc
/e2e/lerna-smoke-tests/** @vsavkin @JamesHenry
/e2e/utils/** @meeroslav @nrwl/nx-testing-tools-reviewers @vsavkin
@@ -149,6 +152,7 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
# CI
/.nx/workflows/** @nrwl/nx-pipelines-reviewers
mise.toml @nrwl/nx-pipelines-reviewers @FrozenPandaz
/.github/** @nrwl/nx-pipelines-reviewers
/.husky/** @nrwl/nx-pipelines-reviewers
/packages/workspace/src/generators/ci-workflow/** @nrwl/nx-pipelines-reviewers
+1 -1
View File
@@ -7,7 +7,7 @@ We would love for you to contribute to Nx! Read this document to see how to do i
Watch this 5-minute video:
<a href="https://www.youtube.com/watch?v=8LCA_4qxc08" target="_blank" rel="noreferrer">
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/how-to-contribute.png" width="600" alt="Nx - How to contribute"></p>
<p style="text-align: center;"><img src="./images/how-to-contribute.png" width="600" alt="Nx - How to contribute"></p>
</a>
## Got a Question?
+3 -3
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 Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
<source media="(prefers-color-scheme: dark)" srcset="./images/nx-dark.svg">
<img alt="Nx - Smart Repos · Fast Builds" src="./images/nx-light.svg" width="100%">
</picture>
</p>
@@ -67,7 +67,7 @@ our [guidelines for contributing](https://github.com/nrwl/nx/blob/master/CONTRIB
help you get started.
<a href="https://www.youtube.com/watch?v=8LCA_4qxc08" target="_blank" rel="noreferrer">
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/how-to-contribute.png" width="600" alt="Nx - How to contribute video"></p>
<p style="text-align: center;"><img src="./images/how-to-contribute.png" width="600" alt="Nx - How to contribute video"></p>
</a>
## Core Team
+1
View File
@@ -90,6 +90,7 @@ export default defineConfig({
'./src/plugins/sidebar-reference-updater.middleware.ts',
'./src/plugins/sidebar-icons.middleware.ts',
'./src/plugins/og.middleware.ts',
'./src/plugins/github-stars.middleware.ts',
],
markdown: {
// this breaks the renderMarkdown function in the plugin loader due to starlight path normalization
+1
View File
@@ -19,6 +19,7 @@
"astro": "^5.10.1",
"astro-og-canvas": "^0.7.0",
"canvaskit-wasm": "^0.40.0",
"octokit": "^2.0.14",
"tailwindcss": "4.1.11"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

+74 -1
View File
@@ -262,6 +262,75 @@ const currentVersion = versions.find((v) => v.current);
>Discord</span
>
</a>
<a
href={`${nxDevUrl}/resources-library?filterBy=book`}
class="flex items-center gap-3 px-2 py-2 rounded-md no-underline hover:bg-slate-50 transition-colors dark:hover:bg-slate-800/60"
>
<svg
class="w-5 h-5 text-slate-400 dark:text-slate-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"
></path>
</svg>
<span
class="text-sm font-medium text-slate-900 dark:text-slate-200"
>Books</span
>
</a>
<a
href={`${nxDevUrl}/resources-library?filterBy=case-study`}
class="flex items-center gap-3 px-2 py-2 rounded-md no-underline hover:bg-slate-50 transition-colors dark:hover:bg-slate-800/60"
>
<svg
class="w-5 h-5 text-slate-400 dark:text-slate-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
></path>
</svg>
<span
class="text-sm font-medium text-slate-900 dark:text-slate-200"
>Case Studies</span
>
</a>
<a
href={`${nxDevUrl}/resources-library?filterBy=whitepaper`}
class="flex items-center gap-3 px-2 py-2 rounded-md no-underline hover:bg-slate-50 transition-colors dark:hover:bg-slate-800/60"
>
<svg
class="w-5 h-5 text-slate-400 dark:text-slate-500"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
></path>
</svg>
<span
class="text-sm font-medium text-slate-900 dark:text-slate-200"
>Whitepapers</span
>
</a>
</div>
<!-- Right Column -->
<div class="space-y-4">
@@ -445,7 +514,11 @@ const currentVersion = versions.find((v) => v.current);
const tryNxCloudBtn = document.getElementById('header-try-nx-cloud-btn');
docsHomeLink?.addEventListener('click', () => {
sendCustomEvent('documentation-click', 'header-navigation', 'documentation-header');
sendCustomEvent(
'documentation-click',
'header-navigation',
'documentation-header'
);
});
contactBtn?.addEventListener('click', () => {
@@ -1,9 +1,11 @@
---
// Copied from https://github.com/withastro/starlight/blob/f14eb0c/packages/starlight/components/PageFrame.astro with modifications.
import MobileMenuToggle from '@astrojs/starlight/components/MobileMenuToggle.astro';
import { Footer } from '@nx/nx-dev-ui-common';
import { Footer, GitHubStarWidget } from '@nx/nx-dev-ui-common';
import { WebinarNotifier } from '@nx/nx-dev-ui-common/src/lib/webinar-notifier';
const { hasSidebar } = Astro.locals.starlightRoute;
const githubStarsCount = Astro.locals.githubStarsCount ?? 0;
---
<div class="page sl-flex">
@@ -18,22 +20,25 @@ const { hasSidebar } = Astro.locals.starlightRoute;
<!-- CTA Buttons for Mobile Menu - Show when not in header (below xl breakpoint) -->
<div class="mobile-cta-buttons xl:hidden mt-auto pt-4 pb-4 border-t border-slate-800 dark:border-slate-700">
<div class="flex flex-col gap-2">
<a
href="https://nx.dev/contact"
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 shadow-sm"
title="Contact Us"
>
Contact
</a>
<a
href="https://cloud.nx.app?utm_source=nx-dev&utm_medium=header"
target="_blank"
rel="noopener noreferrer"
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline bg-blue-500 dark:bg-sky-500 text-white hover:bg-blue-600 dark:hover:bg-sky-600 shadow-sm"
title="Login to Nx Cloud"
>
Login
</a>
<GitHubStarWidget starsCount={githubStarsCount} client:load />
<div class="flex flex-col mx-2 gap-2">
<a
href="https://nx.dev/contact"
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 shadow-sm"
title="Contact Us"
>
Contact
</a>
<a
href="https://cloud.nx.app?utm_source=nx-dev&utm_medium=header"
target="_blank"
rel="noopener noreferrer"
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline bg-blue-500 dark:bg-sky-500 text-white hover:bg-blue-600 dark:hover:bg-sky-600 shadow-sm"
title="Login to Nx Cloud"
>
Login
</a>
</div>
</div>
</div>
</div>
@@ -42,7 +47,8 @@ const { hasSidebar } = Astro.locals.starlightRoute;
)
}
<div class="main-frame"><slot /></div>
<Footer disableThemeSwitcher={true} useDomainPrefix={true} className="mt-32 dark:bg-slate-900" />
<Footer disableThemeSwitcher={true} useDomainPrefix={true} className="dark:bg-slate-900" />
<WebinarNotifier client:load />
</div>
<style>
@@ -2,8 +2,10 @@
import MobileMenuFooter from '@astrojs/starlight/components/MobileMenuFooter.astro'
import SidebarPersister from '@astrojs/starlight/components/SidebarPersister.astro'
import SidebarSublist from './SidebarSublist.astro'
import { GitHubStarWidget } from '@nx/nx-dev-ui-common';
const { sidebar } = Astro.locals.starlightRoute
const githubStarsCount = Astro.locals.githubStarsCount ?? 0;
---
<div class="sidebar-wrapper" data-testid="sidebar-wrapper">
@@ -1,13 +1,18 @@
---
// recreated from https://github.com/withastro/starlight/blob/main/packages/starlight/components/TableOfContents.astro
import TableOfContentsList from './TableOfContentsList.astro';
import { GitHubStarWidget } from '@nx/nx-dev-ui-common';
const { toc } = Astro.locals.starlightRoute;
const githubStarsCount = Astro.locals.githubStarsCount ?? 0;
---
{
toc && (
<custom-toc data-min-h={toc.minHeadingLevel} data-max-h={toc.maxHeadingLevel}>
<div class="github-star-widget-container">
<GitHubStarWidget starsCount={githubStarsCount} client:load />
</div>
<nav aria-labelledby="starlight__on-this-page">
<h2 id="starlight__on-this-page">{Astro.locals.t('tableOfContents.onThisPage')}</h2>
<div class="toc-container">
@@ -163,18 +168,17 @@ const { toc } = Astro.locals.starlightRoute;
padding: 0;
}
/* GitHub star widget styling */
.github-star-widget-container {
margin-bottom: 1rem;
}
/* Container with proper scrolling */
.toc-container {
/* Calculate height based on viewport minus nav and footer with padding */
max-height: calc(100vh - var(--sl-nav-height) - 25rem);
/*
* prevent ToC from going to 0 height.
* if this overlaps the footer it's not a huge issue for such small viewport
* */
min-height: 300px;
/* Allow ToC to be its natural height - parent sticky container handles viewport constraints */
max-height: calc(100vh - var(--sl-nav-height) - 4rem);
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 1rem;
}
/* Only enable smooth scrolling if user doesn't prefer reduced motion */
@@ -24,21 +24,27 @@ const { data} = Astro.locals.starlightRoute.entry;
}
@media (min-width: 72rem) {
.lg\:sl-flex {
align-items: stretch;
}
.right-sidebar-container {
order: 2;
position: relative;
width: calc(
var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
);
display: flex;
flex-direction: column;
}
.right-sidebar {
position: fixed;
top: 0;
position: sticky;
top: var(--sl-nav-height);
border-inline-start: 1px solid var(--sl-color-hairline);
padding-top: var(--sl-nav-height);
padding-top: 1rem;
width: 100%;
height: auto; // MODIFIED: full height conflicts with footer
max-height: calc(100vh - var(--sl-nav-height));
overflow-y: auto;
scrollbar-width: none;
}
@@ -3,4 +3,4 @@ import { type GraphProps, Graph as Default } from '@nx/nx-dev-ui-markdoc/src/lib
type Props = GraphProps;
---
<Default client:visible {...Astro.props} />
<Default client:visible={{rootMargin:"100px"}} {...Astro.props} />
@@ -14,7 +14,7 @@ Don't be too anxious about choosing the exact right folder structure from the be
For instance, if a project under the `booking` folder is now being shared by multiple apps, you can move it to the shared folder like this:
```shell {% frame="none" %}
```shell
nx g move --project booking-some-project shared/some-project
```
@@ -22,7 +22,7 @@ nx g move --project booking-some-project shared/some-project
Similarly, if you no longer need a project, you can remove it with the [`@nx/workspace:remove` generator](/docs/reference/workspace/generators#remove).
```shell {% frame="none" %}
```shell
nx g remove booking-some-project
```
@@ -44,7 +44,7 @@ Each executor definition has an `executor` property and, optionally, an `options
Once configured, you can run an executor the same way you would [run any target](/docs/features/run-tasks):
```shell {% frame="none" %}
```shell
nx [command] [project]
nx build cart
```
@@ -79,7 +79,7 @@ Nx comes with a Devkit that allows you to build your own executor to automate yo
You can use a specific configuration preset like this:
```shell {% frame="none" %}
```shell
nx [command] [project] --configuration=[configuration]
nx build cart --configuration=production
```
@@ -190,7 +190,7 @@ results.
Note, only the flags passed to the npm scripts itself affect results of the computation. For instance, the following
commands are identical from the caching perspective.
```shell {% frame="none" %}
```shell
npx nx build remixapp
npx nx run-many -t build -p remixapp
```
@@ -201,13 +201,13 @@ If you build/test/lint… multiple projects, each individual build has its own h
from
cache or run. This means that from the caching point of view, the following command:
```shell {% frame="none" %}
```shell
npx nx run-many -t build -p header footer
```
is identical to the following two commands:
```shell {% frame="none" %}
```shell
npx nx build header
npx nx build footer
```
@@ -51,7 +51,7 @@ Plugins are processed in the order that they appear in the `plugins` array in `n
To view the task settings for projects in your workspace, [show the project details](/docs/features/explore-graph) either from the command line or using Nx Console.
```shell {% frame="none" %}
```shell
nx show project my-project --web
```
@@ -50,7 +50,7 @@ In CI, the sync generator is run in `--dry-run` mode and if files would be chang
Use the project details view to **find registered sync generators** for a given task.
```shell {% frame="none" %}
```shell
nx show project <name>
```
@@ -32,7 +32,7 @@ There are two different methods that Nx supports for linking TypeScript projects
Create a new Nx workspace that links projects with package manager workspaces:
```shell {% frame="none" %}
```shell
npx create-nx-workspace
```
@@ -8,13 +8,13 @@ filter: 'type:Guides'
Let's create a custom rule which we can then publish to Nx Cloud. We will first create a new library project to contain our rule (and any others we might create in the future):
```shell {% frame="none" %}
```shell
nx generate @nx/js:library cloud-conformance-rules
```
The Nx Cloud distribution mechanism expects each rule to be created in a named subdirectory in the `src/` directory of our new project, and each rule directory to contain an `index.ts` and a `schema.json` file. You can read more about [creating a conformance rule](/docs/reference/powerpack/conformance/create-conformance-rule) in the dedicated guide. For this recipe, we'll generate a default rule to use in the publishing process.
```shell {% frame="none" %}
```shell
nx g @nx/conformance:create-rule --name=test-cloud-rule --directory=cloud-conformance-rules/src --category=reliability --description="A test cloud rule" --reporter=non-project-files-reporter
```
@@ -50,7 +50,7 @@ We can now run `nx build cloud-conformance-rules` to build our rule and create t
Our final step is to publish the rule artifacts to Nx Cloud. We achieve this by running the `publish-conformance-rules` command on the `nx-cloud` CLI, passing the output path location as the first positional argument:
```shell {% frame="none" %}
```shell
nx-cloud publish-conformance-rules cloud-conformance-rules/dist
```
@@ -26,7 +26,7 @@ And create a new consumer.
Give the app a name. The callback URL is the important bit. It needs to be in this form:
```
```text
[your-nx-cloud-url]/auth-callback
# for example
@@ -26,7 +26,7 @@ And create a new OAuth app:
Give it a name, and a homepage URL. The authorization callback is the important bit. It needs to be in this form:
```
```text
[your-nx-cloud-url]/auth-callback
# for example
@@ -18,7 +18,7 @@ Then "Applications" from the left-hand menu:
Give the app a name. The authorization callback is the important bit. It needs to be in this form:
```
```text
[your-nx-cloud-url]/auth-callback
# for example
@@ -1,160 +0,0 @@
---
title: SAML Auth
description: Configure SAML authentication for Nx Cloud Enterprise with Azure AD or Okta
filter: 'type:Guides'
---
{% tabs syncKey="saml-idp" %}
{% tabitem label="Azure AD" %}
{% steps %}
1. Create a new enterprise app
![Step 1](../../../../assets/enterprise/single-tenant/saml/azure_1.png)
![Step 2](../../../../assets/enterprise/single-tenant/saml/azure_2.png)
2. Choose “Create your own”:
![Step 3](../../../../assets/enterprise/single-tenant/saml/azure_3.png)
3. Give it a name
![Step 4](../../../../assets/enterprise/single-tenant/saml/azure_4.png)
4. Assign your users and/or groups to it:
![Step 5](../../../../assets/enterprise/single-tenant/saml/azure_5.png)
5. Then set-up SSO
![Step 6](../../../../assets/enterprise/single-tenant/saml/azure_6.png)
6. And choose SAML:
![Step 7](../../../../assets/enterprise/single-tenant/saml/azure_7.png)
7. Add these configuration options
1. Configure the Identifier **exactly** as `nx-private-cloud`
2. For the **Reply URL**, it should point to your Private Cloud instance URL. Make sure it ends with `/auth-callback`
![Step 8](../../../../assets/enterprise/single-tenant/saml/azure_8.png)
8. Scroll down and manage claims:
![Step 9](../../../../assets/enterprise/single-tenant/saml/azure_9.png)
9. The first row should be the `email` claim, click to Edit it:
![Step 10](../../../../assets/enterprise/single-tenant/saml/azure_10.png)
10. Configure it as per below
1. **“Namespace”** needs to be blank
2. **“Name:”** needs to be “email”
3. See screenshot below. This is an important step, because Nx Cloud will expect the “email” property on each profile that logs in.
![Step 11](../../../../assets/enterprise/single-tenant/saml/azure_11.png)
Make sure your application user profile exposes the email address under `user.mail`. This can be configured in `Users and Groups` in the Azure portal. Alternatively, you can always configure the `email` claim to use a different property under the `user` object.
11. Under `SAML Certificates`, click the pencil icon to edit
![Step 12](../../../../assets/enterprise/single-tenant/saml/azure_12.png)
For **Signing Option**, select **Sign SAML response and assertion**
![Step 13](../../../../assets/enterprise/single-tenant/saml/azure_13.png)
Then click **Save** and close the popover.
12. Download the certificate in **Base64**:
![Step 14](../../../../assets/enterprise/single-tenant/saml/azure_14.png)
13. Extract the downloaded certificate value as a one-line string:
1. `awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' azure_cert_file.cer`
2. Well use this later
14. Copy the Login URL:
![Step 15](../../../../assets/enterprise/single-tenant/saml/azure_15.png)
15. Save the following information to send to your DPE:
1. `SAML_CERT=<your-cert-string-from-above>`
2. `SAML_ENTRY_POINT=<your-login-url-from-above>`
{% /steps %}
{% /tabitem %}
{% tabitem label="Okta" %}
{% steps %}
1. Create a new Okta App Integration:
![Okta 1](../../../../assets/enterprise/single-tenant/saml/okta_1.png)
![Okta 2](../../../../assets/enterprise/single-tenant/saml/okta_2.png)
2. Give it a name:
![Okta 3](../../../../assets/enterprise/single-tenant/saml/okta_3.png)
3. On the Next page, configure it as below:
1. The Single Sign On URL needs to point to your Nx Cloud instance URL and ends with `/auth-callback`
2. The Audience should be `nx-private-cloud`
![Okta 4](../../../../assets/enterprise/single-tenant/saml/okta_4.png)
4. Under **Advanced Settings**, make sure both **Response** and **Assertion** are set to **Signed**
![Okta Advanced Configuration](../../../../assets/enterprise/single-tenant/saml/okta_11.png)
5. Scroll down to attribute statements and configure them as per below:
![Okta 5](../../../../assets/enterprise/single-tenant/saml/okta_5.png)
6. Click “Next”, and select the first option on the next screen.
7. Go to the assignments tab and assign the users that can login to the Nx Cloud WebApp:
1. **Note:** This just gives them permission to use the Nx Cloud web app with their own workspace. Users will still need to be invited manually through the web app to your main workspace.
![Okta 6](../../../../assets/enterprise/single-tenant/saml/okta_6.png)
8. Then in the Sign-On tab scroll down:
![Okta 7](../../../../assets/enterprise/single-tenant/saml/okta_7.png)
9. Scroll down and from the list of certificates, download the one with the “Active” status:
![Okta 8](../../../../assets/enterprise/single-tenant/saml/okta_8.png)
10. Extract the downloaded certificate value as a one-line string:
1. `awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' okta.cert`
2. We'll use this later
11. Then view the ldP metadata:
![Okta 9](../../../../assets/enterprise/single-tenant/saml/okta_9.png)
12. Then find the row similar to the below, and copy the highlighted URL (see screenshot as well):
1. ```html
<md:SingleSignOnService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://trial-xxxxx.okta.com/app/trial-xxxxx_nxcloudtest_1/xxxxxxxxx/sso/saml"
/>
```
![Okta 10](../../../../assets/enterprise/single-tenant/saml/okta_10.png)
{% /steps %}
{% /tabitem %}
{% /tabs %}
## Connect Your Nx Cloud Installation to Your SAML Set Up
Contact your developer productivity engineer to connect your Nx Cloud instance to the SAML configuration.
@@ -0,0 +1,85 @@
---
title: Azure SAML Auth
description: Configure SAML authentication for Nx Cloud Enterprise with Azure
filter: 'type:Guides'
---
1. Create a new enterprise app
![Create new enterprise application in Azure](../../../../assets/enterprise/single-tenant/saml/azure_1.png)
![Select create your own application](../../../../assets/enterprise/single-tenant/saml/azure_2.png)
2. Choose "Create your own":
![Choose create your own application option](../../../../assets/enterprise/single-tenant/saml/azure_3.png)
3. Give it a name
![Enter enterprise application name](../../../../assets/enterprise/single-tenant/saml/azure_4.png)
4. Assign your users and/or groups to it:
![Assign users and groups to application](../../../../assets/enterprise/single-tenant/saml/azure_5.png)
5. Then set-up SSO
![Set up single sign-on](../../../../assets/enterprise/single-tenant/saml/azure_6.png)
6. And choose SAML:
![Select SAML authentication method](../../../../assets/enterprise/single-tenant/saml/azure_7.png)
7. Add these configuration options
1. Configure the Identifier **exactly** as `nx-private-cloud`
2. For the **Reply URL**, it should point to your Private Cloud instance URL. Make sure it ends with `/auth-callback`
![Configure SAML identifier and reply URL](../../../../assets/enterprise/single-tenant/saml/azure_8.png)
8. Scroll down and manage claims:
![Manage SAML attribute claims](../../../../assets/enterprise/single-tenant/saml/azure_9.png)
9. The first row should be the `email` claim, click to Edit it:
![Edit email claim configuration](../../../../assets/enterprise/single-tenant/saml/azure_10.png)
10. Configure it as per below
1. **"Namespace"** needs to be blank
2. **"Name:"** needs to be "email"
3. See screenshot below. This is an important step, because Nx Cloud will expect the "email" property on each profile that logs in.
![Set email claim name and namespace](../../../../assets/enterprise/single-tenant/saml/azure_11.png)
Make sure your application user profile exposes the email address under `user.mail`. This can be configured in `Users and Groups` in the Azure portal. Alternatively, you can always configure the `email` claim to use a different property under the `user` object.
11. Under `SAML Certificates`, click the pencil icon to edit
![Edit SAML certificate signing options](../../../../assets/enterprise/single-tenant/saml/azure_12.png)
For **Signing Option**, select **Sign SAML response and assertion**
![Select sign SAML response and assertion](../../../../assets/enterprise/single-tenant/saml/azure_13.png)
Then click **Save** and close the popover.
12. Download the certificate in **Base64**:
![Download Base64 certificate](../../../../assets/enterprise/single-tenant/saml/azure_14.png)
13. Extract the downloaded certificate value as a one-line string:
1. `awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' azure_cert_file.cer`
2. We'll use this later
14. Copy the Login URL:
![Copy login URL from Azure portal](../../../../assets/enterprise/single-tenant/saml/azure_15.png)
15. Save the following information to send to your DPE:
1. `SAML_CERT=<your-cert-string-from-above>`
2. `SAML_ENTRY_POINT=<your-login-url-from-above>`
## Connect Your Nx Cloud Installation to Your SAML Set Up
Contact your developer productivity engineer to connect your Nx Cloud instance to the SAML configuration.
@@ -26,7 +26,7 @@ And create a new GitHub app:
Give it a name, and a homepage URL. The callback URL is the important bit. It needs to be in this form:
```
```text
[your-nx-cloud-url]/callbacks/github-user
# for example
@@ -0,0 +1,146 @@
---
title: Okta SAML Auth
description: Configure SAML authentication for Nx Cloud Enterprise with Okta
filter: 'type:Guides'
---
1. Create a new Okta App Integration:
![Create new app integration in Okta admin console](../../../../assets/enterprise/single-tenant/saml/okta_1.png)
![Select SAML 2.0 integration type](../../../../assets/enterprise/single-tenant/saml/okta_2.png)
2. Give it a name:
![Enter SAML application name](../../../../assets/enterprise/single-tenant/saml/okta_3.png)
3. On the Next page, configure it as below:
1. The Single Sign On URL needs to point to your Nx Cloud instance URL and ends with `/auth-callback`
2. The Audience should be `nx-private-cloud`
![Configure Single Sign On URL and Audience settings](../../../../assets/enterprise/single-tenant/saml/okta_4.png)
4. Under **Advanced Settings**, make sure both **Response** and **Assertion** are set to **Signed**
![Set Response and Assertion signature settings to Signed](../../../../assets/enterprise/single-tenant/saml/okta_11.png)
5. Scroll down to attribute statements and configure them as per below:
![Configure SAML attribute statements](../../../../assets/enterprise/single-tenant/saml/okta_5.png)
6. Click “Next”, and select the first option on the next screen.
7. Go to the assignments tab and assign the users that can login to the Nx Cloud WebApp:
1. **Note:** This just gives them permission to use the Nx Cloud web app with their own workspace. Users will still need to be invited manually through the web app to your main workspace.
![Assign users to SAML application](../../../../assets/enterprise/single-tenant/saml/okta_6.png)
8. Then in the Sign-On tab scroll down:
![Navigate to Sign-On tab for certificate download](../../../../assets/enterprise/single-tenant/saml/okta_7.png)
9. Scroll down and from the list of certificates, download the one with the "Active" status:
![Download active SAML signing certificate](../../../../assets/enterprise/single-tenant/saml/okta_8.png)
10. Extract the downloaded certificate value as a one-line string:
1. `awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' okta.cert`
2. We'll use this later
11. Then view the ldP metadata:
![View identity provider metadata](../../../../assets/enterprise/single-tenant/saml/okta_9.png)
12. Then find the row similar to the below, and copy the highlighted URL (see screenshot as well):
1. ```html
<md:SingleSignOnService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://trial-xxxxx.okta.com/app/trial-xxxxx_nxcloudtest_1/xxxxxxxxx/sso/saml"
/>
```
![Copy SingleSignOnService location URL from metadata](../../../../assets/enterprise/single-tenant/saml/okta_10.png)
## SCIM Provisioning
SCIM (System for Cross-domain Identity Management) provisioning enables automatic user lifecycle management for Nx Cloud through Okta.
Once configured, Okta will automatically:
- **Provision new users** when they're added to designated groups
- **Update user permissions** when group memberships change
- **Deprovision users** when they're removed from groups or deactivated
### Enable SCIM provisioning
Select the SAML application you created in the above setup steps.
1. Navigate to **General** then click **Edit**
2. Check **Enable SCIM Provisioning**
3. Click **Save**
![Enable SCIM provisioning in general settings](../../../../assets/enterprise/single-tenant/saml/okta_scim_1.jpg)
### Configure SCIM
After SCIM provisioning is enabled, **Provisioning** tab will become available for the SAML application.
1. Navigate to **Provisioning** then click **Edit**
2. Enter `{NX_CLOUD_APP_URL}/v1/scim` for connector base URL
- `NX_CLOUD_APP_URL` is provided by your DPE
3. Enter `email` for unique identifier field
4. Check **Push New Users** and **Push Profile Updates**
5. Select **HTTP Header** for authentication mode
6. Enter the JWT token
- JWT token is provided by your DPE
7. Click **Save**
![Configure SCIM connector base URL and authentication](../../../../assets/enterprise/single-tenant/saml/okta_scim_2.jpg)
After SCIM provision is configured, **To App** settings will become available under **Provisioning** tab
1. Navigate to **Provisioning**
2. Click **To App** then click **Edit**
3. Enable **Create Users**
4. Enable **Update User Attributes**
5. Enable **Deactivate Users**
6. Click **Save**
![Enable SCIM provisioning features to app](../../../../assets/enterprise/single-tenant/saml/okta_scim_3.jpg)
### Add custom attribute for access specification
1. Under **Directory** section, navigate to **Profile Editor**
2. Select your SAML application
![Select SAML application in Profile Editor](../../../../assets/enterprise/single-tenant/saml/okta_scim_4.jpg)
1. Click **Add Attribute**
![Click Add Attribute button](../../../../assets/enterprise/single-tenant/saml/okta_scim_5.jpg)
1. Select `string array` for data type
2. Enter `Nx Cloud Access Spec` for display name
3. Enter `nxCloudAccessSpec` for variable name
- External name will be populated automatically
4. Enter `urn:ietf:params:scim:schemas:extension:nxcloud:2.0:User` for external namespace
5. Check **Enum**
6. Define enum values
- `Read` with `nxcloud:organization:{organization_id}:read`
- `Write` with `nxcloud:organization:{organization_id}:write`
- `organization_id` can be provided by your DPE
7. Check **Attribute required**
8. Select **Group** for attribute type
9. Click **Save**
![Configure Nx Cloud access specification attribute](../../../../assets/enterprise/single-tenant/saml/okta_scim_6.jpg)
### Provision users
Select the appropriate `nxCloudAccessSpec` value when you assign your SAML application to your Groups.
![Select access specification when assigning application to groups](../../../../assets/enterprise/single-tenant/saml/okta_scim_7.jpg)
## Connect Your Nx Cloud Installation to Your SAML Set Up
Contact your developer productivity engineer to connect your Nx Cloud instance to the SAML configuration.
@@ -38,7 +38,7 @@ If you are unsure how to proceed, starting with a trial process is recommended,
To register the activation key in your repository, run the `nx register` command.
```shell {% frame="none" %}
```shell
nx register YOUR_ACTIVATION_KEY
```
@@ -17,7 +17,7 @@ These packages are used to set up a new project in some form.
Customizing your initial project setup is already possible with an [Nx Preset generator](/docs/extending-nx/create-preset). By creating and shipping a generator named `preset` in your Nx plugin, you can then pass it via the `--preset` flag to the `create-nx-workspace` command:
```shell {% frame="none" %}
```shell
npx create-nx-workspace --preset my-plugin
```
@@ -29,13 +29,13 @@ There are a few methods to create a package that will work with `create-nx-works
You can setup a new Nx plugin workspace and immediately pass the `--create-package-name`:
```shell {% frame="none" %}
```shell
npx create-nx-plugin my-plugin --create-package-name create-my-plugin
```
Alternatively, if you already have an existing Nx plugin workspace, you can run the following generator to set up a new create package:
```shell {% frame="none" %}
```shell
nx g create-package create-my-plugin --project my-plugin
```
@@ -118,7 +118,7 @@ _(If you don't have such a `local-registry` target, refer to the following [docs
By running
```shell {% frame="none" %}
```shell
npx nx local-registry
```
@@ -130,7 +130,7 @@ Note, after terminating the terminal window where the `nx local-registry` comman
Next, you can **publish** your packages to your new local registry. All of the generated packages can use `nx release` to publish whatever is in your `build` output folder, so you can simply run:
```shell {% frame="none" %}
```shell
npx nx run-many --targets build
npx nx release version 1.0.0
npx nx release publish --tag latest
@@ -138,7 +138,7 @@ npx nx release publish --tag latest
Once the packages are published, you should be able to test the behavior of your "create package" as follows:
```shell {% frame="none" %}
```shell
npx create-my-plugin test-workspace
```
@@ -146,7 +146,7 @@ npx create-my-plugin test-workspace
When setting up the workspace, you should also have gotten a `my-plugin-e2e` package. This package contains the e2e tests for your plugin, and can be run with the following command:
```shell {% frame="none" %}
```shell
npx nx e2e my-plugin-e2e
```
@@ -20,7 +20,7 @@ All first-party Nx presets are built into Nx itself, but you can [create your ow
To use a concrete example, let's look at the [`qwik-nx`](https://www.npmjs.com/package/qwik-nx) Nx community plugin. They include a [preset generator](https://github.com/qwikifiers/qwik-nx/tree/main/packages/qwik-nx/src/generators/preset) that you can use to create a new Nx workspace with Qwik support.
```shell {% frame="none" %}
```shell
npx create-nx-workspace --preset=qwik-nx
```
@@ -28,7 +28,7 @@ npx create-nx-workspace --preset=qwik-nx
If you **don't** have an existing plugin you can create one by running
```shell {% frame="none" %}
```shell
npx create-nx-plugin my-org --pluginName my-plugin
```
@@ -36,7 +36,7 @@ npx create-nx-plugin my-org --pluginName my-plugin
To create our preset inside of our plugin we can run
```shell {% frame="none" %}
```shell
nx generate @nx/plugin:generator packages/happynrwl/src/generators/preset
```
@@ -104,6 +104,6 @@ Before you are able to use your newly created preset you must package and publis
After you have published your plugin to a registry you can now use your preset when creating a new workspace
```shell {% frame="none" %}
```shell
npx create-nx-workspace my-workspace --preset=my-plugin-name
```
@@ -18,7 +18,7 @@ You can create a new sync generator by hand or use the built-in generator that N
Make sure you have `@nx/plugin` installed or add it to your workspace:
```shell {% frame="none" %}
```shell
nx add @nx/plugin
```
@@ -26,7 +26,7 @@ nx add @nx/plugin
Create a new local plugin where we can add our new sync generator. You can also add it to an existing local plugin if you already have one. In that case you can skip this step.
```shell {% frame="none" %}
```shell
nx g @nx/plugin:plugin tools/my-plugin
```
@@ -34,7 +34,7 @@ nx g @nx/plugin:plugin tools/my-plugin
Create a sync generator the same way you would [create any generator](/docs/extending-nx/local-generators).
```shell {% frame="none" %}
```shell
nx g @nx/plugin:generator --path=tools/my-plugin/src/generators/my-sync-generator
```
@@ -181,7 +181,7 @@ For projects using [inferred targets](/docs/concepts/inferred-tasks) (no project
{% aside type="caution" title="Verify the name of your plugin" %}
You might have to adjust the name of your plugin based on your specific workspace scope. Verify the name in `tools/my-plugin/package.json`. If the name there is `@myorg/my-plugin` you have to register it as:
```
```jsonc
{
"syncGenerators": ["@myorg/my-plugin:my-sync-generator"]
}
@@ -1,7 +1,7 @@
---
title: CreateNodes API Compatibility
description: Understand which createNodes API version is used by different Nx versions and how to write plugins that support multiple Nx versions.
filter: 'type:Reference'
filter: 'type:References'
---
This is a reference for knowing how Nx versions and the `createNodes`/`createNodesV2` APIs interact. If you plan on supporting multiple Nx versions with a custom plugin, then it's important to know which APIs to use.
@@ -82,7 +82,7 @@ nx generate my-generator mylib
The following information will be displayed.
```{% title="nx generate my-generator mylib" %}
```text {% title="nx generate my-generator mylib" %}
CREATE libs/mylib/README.md
CREATE libs/mylib/.babelrc
CREATE libs/mylib/src/index.ts
@@ -23,7 +23,7 @@ Get started developing your own plugin with a few terminal commands:
{% tabs %}
{% tabitem label="Create a plugin in a new workspace" %}
```shell {% frame="none" %}
```shell
npx create-nx-plugin my-plugin
```
@@ -31,7 +31,7 @@ npx create-nx-plugin my-plugin
{% tabitem label="Add a plugin to an existing workspace" %}
```shell {% frame="none" %}
```shell
npx nx add @nx/plugin
npx nx g plugin tools/my-plugin
```
@@ -59,7 +59,7 @@ You can follow along with one of the step by step tutorials below that is focuse
Wire up a new generator with this terminal command:
```shell {% frame="none" %}
```shell
npx nx g generator my-plugin/src/generators/library-with-readme
```
@@ -110,7 +110,7 @@ The template files that are used in the `generateFiles` function can inject vari
You can test your generator in dry-run mode with the following command:
```shell {% frame="none" %}
```shell
npx nx g my-plugin:library-with-readme mylib --dry-run
```
@@ -12,14 +12,14 @@ This guide shows you how to create, run, and customize executors within your Nx
If you don't already have a plugin, use Nx to generate one:
```shell {% frame="none" %}
```shell
nx add @nx/plugin
nx g @nx/plugin:plugin tools/my-plugin
```
Use the Nx CLI to generate the initial files needed for your executor.
```shell {% frame="none" %}
```shell
nx generate @nx/plugin:executor tools/my-plugin/src/executors/echo
```
@@ -126,13 +126,13 @@ If your package.json has a different name, adjust the command accordingly.
Finally, you run the executor via the CLI as follows:
```shell {% frame="none" %}
```shell
nx run my-project:echo
```
To which we'll see the console output:
```{% title="nx run my-project:echo" frame="terminal" %}
```text {% title="nx run my-project:echo" frame="terminal" %}
Executing "echo"...
Options: {
"textToEcho": "Hello World"
@@ -18,7 +18,7 @@ caption="Demoes how to use Nx generators in a PNPM workspace to automate the cre
If you don't already have a local plugin, use Nx to generate one:
```shell {% frame="none" %}
```shell
nx add @nx/plugin
nx g @nx/plugin:plugin tools/my-plugin
```
@@ -101,7 +101,7 @@ The `$default` object is used to read arguments from the command-line that are p
To run a generator, invoke the `nx generate` command with the name of the generator.
```shell {% frame="none" %}
```shell
nx generate @myorg/my-plugin:my-generator mylib
```
@@ -14,7 +14,7 @@ For this example, we'll create a new migration generator that updates repos to u
### 1. Generate a migration
```shell {% frame="none" %}
```shell
nx generate @nx/plugin:migration libs/pluginName/src/migrations/change-executor-name \
--name='Change Executor Name' \
--packageVersion=2.0.1 \
@@ -17,13 +17,13 @@ In this tutorial, we will create a generator that helps enforce the follow best
Let's first create a new workspace with the `create-nx-workspace` command:
```shell {% frame="none" %}
```shell
npx create-nx-workspace myorg --preset=react-monorepo --ci=github
```
Then we , install the `@nx/plugin` package and generate a plugin:
```shell {% frame="none" %}
```shell
npx nx add @nx/plugin
npx nx g @nx/plugin:plugin tools/recommended
```
@@ -34,7 +34,7 @@ This will create a `recommended` project that contains all your plugin code.
To create a new generator run:
```shell {% frame="none" %}
```shell
npx nx generate @nx/plugin:generator tools/recommended/src/generators/library
```
@@ -70,7 +70,7 @@ We're returning the `callbackAfterFilesUpdated` function because the `@nx/react:
To try out the generator in dry-run mode, use the following command:
```shell {% frame="none" %}
```shell
npx nx g @myorg/recommended:library test-library --dry-run
```
@@ -139,7 +139,7 @@ The schema files not only provide structure to the CLI, but also allow [Nx Conso
Notice how we made the `description` argument optional in both the JSON and type files. If we call the generator without passing a directory, the project will be created in a directory with same name as the project. We can test the changes to the generator with the following command:
```shell {% frame="none" %}
```shell
npx nx g @myorg/recommended:library test-library --directory=nested/directory/test-library --dry-run
```
@@ -245,7 +245,7 @@ export default libraryGenerator;
We can check that the scope logic is being applied correctly by running the generator again and specifying a scope.
```shell {% frame="none" %}
```shell
npx nx g @myorg/recommended:library test-library --scope=shared --dry-run
```
@@ -316,7 +316,7 @@ We updated the generator to use some new helper functions from the Nx devkit. He
Now let's check to make sure that the `clearMocks` property is set correctly by the generator. First, we'll commit our changes so far. Then, we'll run the generator without the `--dry-run` flag so we can inspect the file contents.
```shell {% frame="none" %}
```shell
git add .
git commit -am "library generator"
npx nx g @myorg/recommended:library store-test --scope=store
@@ -12,7 +12,7 @@ In order to use your plugin in other workspaces or share it with the community,
After that, you can then install your plugin like any other Nx plugin -
```shell {% frame="none" %}
```shell
nx add nx-cfonts
```
@@ -10,7 +10,7 @@ In this tutorial, we'll create a plugin that helps to integrate the _Astro_ fram
To create a plugin in a brand new repository, use the `create-nx-plugin` command:
```shell {% frame="none" %}
```shell
npx create-nx-plugin nx-astro
```
@@ -197,7 +197,7 @@ If you create a generator named `init`, Nx will automatically run that generator
To create the generator run the following command:
```shell {% frame="none" %}
```shell
npx nx g generator src/generators/init
```
@@ -269,7 +269,7 @@ export interface InitGeneratorSchema {}
Let's make one more generator to automatically create a simple Astro application. First we'll create the generator:
```shell {% frame="none" %}
```shell
npx nx g generator src/generators/application
```
@@ -211,7 +211,7 @@ This drastically improves the speed of your CI and reduces the amount of compute
To leverage this feature, use the following command when running your tasks, particularly on CI:
```shell {% frame="none" %}
```shell
nx affected -t <task>
```
@@ -225,7 +225,7 @@ Once the projects are identified, Nx runs the tasks you specified on that subset
You can also visualize the affected projects using the [Nx graph](/docs/features/explore-graph). Simply run:
```shell {% frame="none" %}
```shell
nx graph --affected
```
@@ -244,14 +244,14 @@ To understand which projects are affected, Nx uses the Git history and the [proj
The affected command takes a `base` and `head` commit. The default `base` is your `main` branch, and the default `head` is your current file system. This is generally what you want when developing locally, but in CI, you need to customize these values.
```shell {% frame="none" %}
```shell
nx affected -t build --base=origin/main --head=$PR_BRANCH_NAME # where PR_BRANCH_NAME is defined by your CI system
nx affected -t build --base=origin/main~1 --head=origin/main # rerun what is affected by the last commit in main
```
You can also set the base and head SHAs as environment variables:
```shell {% frame="none" %}
```shell
NX_BASE=origin/main~1
NX_HEAD=origin/main
```
@@ -29,7 +29,7 @@ Nx Agents offer several key advantages:
To enable task distribution with Nx Agents, make sure your Nx workspace is connected to Nx Cloud. If you haven't connected your workspace to Nx Cloud yet, run the following command:
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -37,7 +37,7 @@ Check out the [connect to Nx Cloud recipe](/docs/guides/nx-cloud/setup-ci) for m
Then, adjust your CI pipeline configuration to **enable task distribution**. If you don't have a CI config yet, you can generate a new one using the following command:
```shell {% frame="none" %}
```shell
npx nx g ci-workflow
```
@@ -1,64 +0,0 @@
---
title: Explain with AI
description: Get AI-powered explanations and resolution steps for failed tasks in Nx Cloud
sidebar:
order: 17
badge: beta
filter: 'type:Features'
---
{% youtube
src="https://youtu.be/g2m9cHp-O-Q"
title="Explain with AI"
/%}
"Explain with AI" helps you understand complex errors more quickly by providing AI-powered error resolution steps. This is made possible by using additional context from Nx targets and metadata, allowing for more accurate and relevant responses.
![explain with ai](../../../../assets/features/ci-features/explain-with-ai.avif)
## Enable Explain with AI
To use the "Explain with AI" feature, you need to [enable AI features for your organization](/docs/guides/nx-cloud/enable-ai-features). In the **settings** menu, locate the "AI Features" section and toggle it to "On".
![enable ai features](../../../../assets/features/ci-features/ai-features.avif)
{% aside type="note" title="AI Features Availability" %}
AI features are available on Hobby, Team and Enterprise [Nx Cloud plans](https://nx.dev/pricing).
{% /aside %}
## Using Explain with AI
{% aside type="tip" title="Authentication Required" %}
If you don't see the "Explain with AI" button, ensure you are logged into the application.
{% /aside %}
1. **Access the Task**:
- Navigate to the Nx Cloud dashboard and locate the task that failed.
- Click on the task to open the detailed view.
2. **Initiate AI Explanation**:
- In the task details, find the "Explain with AI" button.
- Click on this button to start the AI analysis.
![explain with ai button](../../../../assets/features/ci-features/explain-with-ai-1.png)
3. **Review the Explanation**:
- The AI will analyze the error log with additional context from the project task and provide a detailed explanation of the failure.
- It will also offer suggestions on how to resolve the issue.
![explain response](../../../../assets/features/ci-features/explain-with-ai-2.png)
4. **Implement the Suggestions**:
- Review the AI-generated suggestions carefully.
- Apply the recommended changes to your codebase.
5. **Verify the Fix**:
- After making the changes, rerun the task to see if the issue is resolved.
6. **Mark Answer as Not Helpful** (Optional):
- If the suggested changes did not help, click on "Set answer as not helpful." This helps us continuously improve the responses.
@@ -16,7 +16,7 @@ Flaky Task Detection is enabled by default if your workspace is connected to Nx
To connect your workspace to Nx Cloud run:
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -39,12 +39,60 @@ In this image, the `e2e-ci--src/e2e/app.cy.ts` task is a flaky task that has bee
When a flaky task fails in CI with [distributed task execution](/docs/features/ci-features/distribute-task-execution) enabled, Nx will **automatically send that task to a different agent** and run it again (up to 2 tries in total). Its important to run the task on a different agent to ensure that the agent itself or the other tasks that were run on that agent are not the reason for the flakiness.
## Manually Mark a Task as Flaky or Not Flaky
## Flaky Task Analytics
If you suspect that a task is flaky, but Nx has not confirmed it yet, you can manually **mark it as likely flaky** from the run details screen. Failed tasks that are not flaky will have a button that says **"Mark task as likely flaky"**.
{% aside type="note" title="Enterprise Feature" %}
Workspace flaky task analytics is currently available for organizations on the Enterprise plan. Reach out if your organization is [interested in Nx Enterprise](https://nx.dev/enterprise?utm_source=nx.dev&utm_medium=callout&utm_campaign=flaky-task-analytics).
{% /aside %}
![Mark task as likely flaky button](../../../../assets/features/ci-features/mark-task-as-likely-flaky.png)
Nx Cloud provides analytics to help you understand and manage flaky tasks across your workspace. The analytics dashboard gives you insights into which tasks are flaky, how often they fail, and how much time is being wasted on reruns.
Once you've resolved the issue that caused a task to be flaky, you can immediately mark the task as not flaky by clicking on **"Mark task as no longer flaky"** on the same run details screen.
![Flaky Tasks dashboard](../../../../assets/features/ci-features/nx-cloud-flaky-tasks-metrics-chart.avif)
![Mark task as no longer flaky button](../../../../assets/features/ci-features/mark-task-as-no-longer-flaky.png)
The dashboard displays key metrics over the time range selected (7 days vs 30 days) to give you a quick overview of your workspace health.
- **Active flaky tasks** - The total number of tasks in your workspace that have a flake rate greater than 0 within the selected time window.
- **Average flake rate** - A weighted average flake rate across all tasks in your workspace. This metric uses the sample size to weight each task's flake rate proportionally, so a task that ran 1000 times with 5% flake rate has more impact than one that ran 10 times with 50% flake rate.
- **High risk tasks** - The number of tasks with a flake rate higher than 20%, indicating severe reliability issues that need immediate attention.
The chart shown provides a visual representation of your flaky tasks, helping you quickly identify which tasks need the most attention.
Tasks are plotted based on their **impact score**, which is calculated as `flake_rate × sample_size`. This means frequently-run flaky tasks are weighted higher than rarely-run flaky tasks.
Priority levels are determined using percentile-based thresholds that scale across organizations of any size:
- **High priority** (red) - Top 10% of tasks by impact score (90th percentile and above). These tasks have severe flakiness and should be addressed immediately.
- **Medium priority** (yellow) - Next 23% of tasks by impact score (67th-90th percentile). These tasks have moderate flakiness with sufficient data.
- **Low priority** (gray) - Bottom 67% of tasks by impact score. These tasks have minor flakiness or not enough data to be concerning.
Tasks on the right side of the chart typically represent the highest priority items that need attention. The scatter plot shows up to 50 results, sorted by most recent flaked tasks.
### Flaky Task Table
The table provides detailed information about each flaky task in your workspace:
![Flaky Tasks Analytics Table](../../../../assets/features/ci-features/nx-cloud-flaky-tasks-table.avif)
By default, the table loads your most recent flaky tasks. Each row includes:
- **Task** - The project and target combination (e.g., `my-app:test`)
- **Flake rate** - Measures how often a task succeeds due to flakiness. Specifically, it represents the percentage of total successes that came from unreliable (flaky) task hashes: `flaky_successes / (flaky_successes + non_flaky_successes)`. This tells you: "Of all the times this task succeeded, how many successes came from unreliable code?"
- **Total reruns** - The number of times a task was executed more than once due to flakiness. This counts the "extra" executions that happened because the task failed and needed to be retried. Calculated as: `total_executions - unique_hash_count`
- **Time wasted** - An estimate of the total time spent on reruns, calculated by multiplying the total reruns by the average task duration
- **Last failure** - The timestamp of the most recent failure across all contributing task hashes
#### Flaky Task Detail View
Click on any row in the table to view detailed information about a specific flaky task.
The **Overview** tab shows summary statistics and trends for the selected task such as flake rate, time wasted and automatic deflake counts
![Flaky Task Detail Overview](../../../../assets/features/ci-features/nx-cloud-flaky-tasks-details.avif)
The **Activity** tab displays a timeline of all executions, showing when the task failed and succeeded to jump directly into the runs.
![Flaky Task Detail Activity](../../../../assets/features/ci-features/nx-cloud-flaky-tasks-detail-activity.avif)
The **Environments** tab provides insights into the different environments where the task was executed, helping identify if certain environments contribute to flakiness.
![Flaky Task Detail Environments](../../../../assets/features/ci-features/nx-cloud-flaky-tasks-detail-environment.avif)
@@ -27,7 +27,7 @@ Nx **restores terminal output, along with the files and artifacts** created from
To use **Nx Replay**, you need to connect your workspace to Nx Cloud (if you haven't already).
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -29,7 +29,7 @@ To enable Self-Healing CI in your workspace, you'll need to connect to Nx Cloud
If you haven't already connected to Nx Cloud, run the following command:
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -56,6 +56,11 @@ jobs:
### Enable Auto-fixing
{% youtube
src="https://youtu.be/EmZcENiCG64"
title="Enable Auto-fixing"
/%}
By default, Self-Healing CI proposes a fix for you to review and only applies it automatically to your PR after you confirm it. However, for some tasks, it makes sense to have them be auto-fixed without waiting for manual approval. Auto-fixes are only applied if the verification phase passes.
Below is an example of enabling auto-fixing for the Nx `format` command and `lint` tasks using the [`--auto-apply-fixes`](/docs/reference/nx-cloud-cli#--auto-apply-fixes) flag:
@@ -78,6 +83,11 @@ Tasks are passed to the `--auto-apply-fixes` as `<project>:<task-name>:<configur
### Specify Which Tasks to Fix
{% youtube
src="https://youtu.be/KSb48zHbaHg"
title="Specify Which Tasks to Fix"
/%}
By using the [`--fix-tasks`](/docs/reference/nx-cloud-cli#--fix-tasks) flag you can fine-tune which tasks should be considered by the Nx Cloud self-healing CI. Below is an example of running self-healing on all tasks except `deploy` and `test` tasks.
```yaml
@@ -99,6 +109,48 @@ Similarly, if you only want to self-heal linting tasks you'd use `--fix-tasks="*
Tasks are passed to the `--fix-tasks` as `<project>:<task-name>:<configuration>`. Commands like `nx format` which you configure with `nx-cloud record --` are passed as `nx-cloud record -- <params>`.
### Customize Self-Healing Behavior
You can customize how Self-Healing CI behaves in your workspace by creating a `CLAUDE.md` file in your repository root. This file allows you to define custom classification rules and predefined fixes tailored to your project's specific needs.
#### Customize Failure Classification
Before proposing a fix, the Self-Healing CI agent classifies each failure into one of three categories:
- **`code_change`** - Failures directly caused by PR changes. Self-Healing will _propose and implement code fixes_.
- **`environment_state`** - Failures caused by environmental issues (network errors, service outages, resource constraints). Self-Healing will _not propose fixes_.
- **`flaky_task`** - Non-deterministic failures from timing issues or race conditions. Self-Healing _detects the flakiness and retriggers a pipeline run for the flaky task_.
You can override the default classification behavior with custom rules in `CLAUDE.md` by describing the nature of the error as well as one of the before mentioned categories:
```markdown
// CLAUDE.md
## Self-Healing CI
### Classification Customization
When analyzing failures, override the default classification in these cases:
- If there are errors about missing environment variables (like API_KEY, DATABASE_URL, etc.) classify them as 'environment_state'.
```
#### Define Predefined Fixes
For common, deterministic failures, you can define predefined fixes that Self-Healing CI should apply automatically. This is particularly useful for tasks that have standard, repeatable solutions. Here's an example to trigger `lint --fix` instead of having the AI attempt to implement the fix:
```markdown
// CLAUDE.md
## Self-Healing CI
Predefined fix:
- If a failed task id contains ":lint", fix it by running linting on the project where it failed with the `--fix` flag. Example: `nx run myapp:lint --fix` where "myapp" is the app the task failed on.
```
These predefined fixes allow Self-Healing CI to apply deterministic solutions without needing to analyze the code, speeding up the fix generation process for common scenarios.
## How Self-Healing CI works
Here's what happens when you push a PR with Self-Healing CI enabled:
@@ -26,7 +26,7 @@ Manually splitting these slow tasks can be complex and require ongoing maintenan
To use **automated task splitting**, you need to connect your workspace to Nx Cloud (if you haven't already).
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -39,28 +39,28 @@ Run this command to set up inferred tasks and enable task splitting for each plu
{% tabs syncKey="test-runner" %}
{% tabitem label="Cypress" %}
```shell {% frame="none" %}
```shell
nx add @nx/cypress
```
{% /tabitem %}
{% tabitem label="Playwright" %}
```shell {% frame="none" %}
```shell
nx add @nx/playwright
```
{% /tabitem %}
{% tabitem label="Jest" %}
```shell {% frame="none" %}
```shell
nx add @nx/jest
```
{% /tabitem %}
{% tabitem label="Gradle" %}
```shell {% frame="none" %}
```shell
nx add @nx/gradle
```
@@ -87,7 +87,7 @@ If you are already using the `@nx/cypress`, `@nx/playwright`, `@nx/jest`, or `@n
- [Configure Cypress Task Splitting](/docs/technologies/test-tools/cypress/introduction#nxcypress-configuration)
- [Configure Playwright Task Splitting](/docs/technologies/test-tools/playwright/introduction#nxplaywright-configuration)
- [Configure Jest Task Splitting](/docs/technologies/test-tools/jest/introduction#splitting-e2e-tests)
- [Configure Gradle Testing Task Splitting](/docs/technologies/java/introduction#test-distribution)
- [Configure Gradle Testing Task Splitting](/docs/technologies/java/gradle/introduction#test-distribution)
## Verify Automated Task Splitting Works
@@ -96,7 +96,7 @@ Run the following command to open the project detail view for your test project:
{% tabs %}
{% tabitem label="CLI" %}
```shell {% frame="none" %}
```shell
nx show project my-project-e2e
```
@@ -422,7 +422,7 @@ If you configured Nx Atomizer properly, you'll see that there are tasks named `e
During local development, you'll want to continue using the base task (e.g., `e2e`, `test`) as it is more efficient on a single machine.
```shell {% frame="none" %}
```shell
nx e2e my-project-e2e
```
@@ -20,7 +20,7 @@ Keeping your tooling up to date is crucial for the health of your project. Tooli
To update your workspace, run:
```shell {% frame="none" %}
```shell
npx nx@latest migrate latest
```
@@ -66,7 +66,7 @@ You can intervene at each step and make adjustments as needed for your specific
First, run the `migrate` command:
```shell {% frame="none" %}
```shell
nx migrate latest
```
@@ -89,7 +89,7 @@ Now, you can **inspect `package.json` to see if the changes make sense**. Someti
You can now run the actual code migrations that were generated in the `migrations.json` in the previous step.
```shell {% frame="none" %}
```shell
nx migrate --run-migrations
```
@@ -109,13 +109,13 @@ Note: You may want to keep the `migrations.json` until every branch that was cre
If you have any [Nx community plugins](/docs/plugin-registry) installed you need to migrate them individually (assuming they provide migration scripts) by using the following command:
```shell {% frame="none" %}
```shell
nx migrate my-plugin
```
For a list of all the plugins you currently have installed, run:
```shell {% frame="none" %}
```shell
nx report
```
@@ -70,7 +70,7 @@ By default, Nx caches task results locally. The biggest benefit of caching comes
To enable remote caching, connect your workspace to [Nx Cloud](https://nx.dev/nx-cloud) by running the following command:
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -157,7 +157,7 @@ When using [Nx plugins](/docs/concepts/nx-plugins), many tasks have caching conf
For example, if you add the `@nx/vite` plugin using the following command...
```shell {% frame="none" %}
```shell
npx nx add @nx/vite
```
@@ -167,7 +167,7 @@ This means **you don't need to manually specify cacheable operations for Vite ta
To view the task settings that have been automatically configured by a plugin, use the following command:
```shell {% frame="none" %}
```shell
nx show project <project-name> --web
```
@@ -103,7 +103,7 @@ Once you have tagged your projects, configure the dependency constraints based o
For JavaScript/TypeScript projects, configure the `@nx/enforce-module-boundaries` ESLint rule:
```shell {% frame="none" %}
```shell
nx add @nx/eslint-plugin @nx/devkit
```
@@ -201,7 +201,7 @@ Read more about [ESLint rule options](/docs/technologies/eslint/eslint-plugin/gu
For any project type or to enforce boundaries on the complete dependency graph, use the Conformance plugin:
```shell {% frame="none" %}
```shell
nx add @nx/conformance
```
@@ -43,7 +43,7 @@ These are some of the available tools which the Nx MCP server exposes:
To configure Nx for AI agents and AI-Assistants, run the following command:
```shell {% frame="none" %}
```shell
npx nx configure-ai-agents
```
@@ -79,7 +79,7 @@ For other MCP-compatible clients (that do not have Nx Console available) like Cl
Here's an example of how to register it for Claude Code:
```shell {% frame="none" %}
```shell
claude mcp add nx-mcp npx nx-mcp@latest
```
@@ -91,7 +91,7 @@ claude mcp add nx-mcp npx nx-mcp@latest
Ask your AI assistant about your workspace structure and get detailed, accurate responses about projects, their types, and relationships:
```
```text
What is the structure of this workspace?
How are the projects organized?
```
@@ -107,7 +107,7 @@ With Nx MCP, your AI assistant can:
You can also get informed suggestions about where to implement new functionality:
```
```text
Where should I implement a feature for adding products to cart?
```
@@ -140,7 +140,7 @@ Learn more about CI integration in our blog post [Save Time: Connecting Your Edi
Nx generators provide predictable code scaffolding, while AI adds intelligence and contextual understanding. Instead of having the AI generate everything from scratch, you get the best of both worlds:
```
```text
Create a new React library into the packages/orders/feat-cancel-orders folder
and call the library with the same name of the folder structure. Afterwards,
also connect it to the main shop application.
@@ -163,7 +163,7 @@ This approach ensures consistent code that follows your organization's best prac
Get accurate guidance on Nx configuration without worrying about hallucinations or outdated information:
```
```text
Can you configure Nx release for the packages of this workspace?
Update nx.json with the necessary configuration using conventional commits
as the versioning strategy.
@@ -184,7 +184,7 @@ Learn more about documentation-aware configuration in our blog post [Making Curs
Understand the impact of changes across your monorepo with questions like:
```
```text
If I change the public API of feat-product-detail, which other projects
might be affected by that change?
```
@@ -282,7 +282,7 @@ It always stays up to date without having to actively maintain a document as it
To launch the project graph visualization for your workspace, use [Nx Console](/docs/getting-started/editor-setup) or run:
```shell {% frame="none" %}
```shell
npx nx graph
```
@@ -545,7 +545,7 @@ Try playing around with a [fully interactive graph on a sample repo](https://nrw
If you prefer to analyze the underlying data of the project graph with a script or some other tool, you can run:
```shell {% frame="none" %}
```shell
nx graph --file=output.json
```
@@ -566,7 +566,7 @@ Some moments which you may want to share these images are:
Nx uses the project graph of your workspace to determine the order in which to [run tasks](/docs/features/run-tasks). Pass the `--graph` flag to view the **task graph** which is executed by Nx when running a command.
```shell {% frame="none" %}
```shell
nx build myreactapp --graph # View the graph for building myreactapp
nx run-many --targets build --graph # View the graph for building all projects
nx affected --targets build --graph # View the graph for building the affected projects
@@ -20,13 +20,13 @@ Generators come as part of [Nx plugins](/docs/concepts/nx-plugins) and can be in
Here's an example of generating a React library:
```shell {% frame="none" %}
```shell
nx g @nx/react:lib packages/mylib
```
You can also specify just the generator name and Nx will prompt you to pick between the installed plugins that provide a generator with that name.
```shell {% frame="none" %}
```shell
nx g lib packages/mylib
```
@@ -34,7 +34,7 @@ When running this command, you could be prompted to choose between the `@nx/reac
To see a list of available generators in a given plugin, run `nx list <plugin-name>`. As an example, to list all generators in the @nx/react plugin:
```shell {% frame="none" %}
```shell
nx list @nx/react
```
@@ -14,7 +14,7 @@ Nx provides a set of tools to help you manage your releases called `nx release`.
> We recommend always starting with --dry-run, because publishing is difficult to undo
```shell {% frame="none" %}
```shell
nx release --dry-run
```
@@ -34,12 +34,12 @@ By default, when you run `nx release` it will prompt you for a version keyword (
When trying it out for the first time, you need to pass the `--first-release` flag since there is no previous release to compare against for changelog purposes. It is strongly recommended to use the `--dry-run` flag to see what will be published in the first release without actually pushing anything to the registry.
```shell {% frame="none" %}
```shell
nx release --first-release --dry-run
```
{% aside type="tip" title="Semantic Versioning" %}
By default, the version follows semantic versioning (semver) rules. To disable this behavior, set `release.releaseTagPatternRequireSemver` to `false` in your `nx.json` file. This allows you to use custom versioning schemes.
By default, the version follows semantic versioning (semver) rules. To disable this behavior, set `release.releaseTag.requireSemver` to `false` in your `nx.json` file. This allows you to use custom versioning schemes.
{% /aside %}
## Set Up Your Workspace
@@ -75,73 +75,18 @@ See the [configuration reference](/docs/reference/nx-json#release) for all avail
## Using the Programmatic API for Nx Release
For maximum control, use the programmatic API to create custom release workflows:
A powerful feature of Nx Release is the fact that it is designed to be used via a Node.js programmatic API in addition to the `nx release` CLI.
```ts
// tools/scripts/release.ts
import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release';
import * as yargs from 'yargs';
Releases are a hugely complex and nuanced process, filled with many special cases and idiosyncratic preferences, and it is impossible for a CLI to be able to support all of them out of the box. By having a first-class programmatic API, you can go beyond the CLI and create custom release workflows that are highly dynamic and tailored to your specific needs.
(async () => {
const options = await yargs
.version(false) // don't use the default meaning of version in yargs
.option('version', {
description:
'Explicit version specifier to use, if overriding conventional commits',
type: 'string',
})
.option('dryRun', {
alias: 'd',
description:
'Whether or not to perform a dry-run of the release process, defaults to true',
type: 'boolean',
default: true,
})
.option('verbose', {
description:
'Whether or not to enable verbose logging, defaults to false',
type: 'boolean',
default: false,
})
.parseAsync();
const { workspaceVersion, projectsVersionData, releaseGraph } =
await releaseVersion({
specifier: options.version,
dryRun: options.dryRun,
verbose: options.verbose,
});
await releaseChangelog({
releaseGraph, // Re-use the existing release graph to avoid recomputing in each subcommand
versionData: projectsVersionData,
version: workspaceVersion,
dryRun: options.dryRun,
verbose: options.verbose,
});
// publishResults contains a map of project names and their exit codes
const publishResults = await releasePublish({
releaseGraph, // Re-use the existing release graph to avoid recomputing in each subcommand
dryRun: options.dryRun,
verbose: options.verbose,
// You can optionally pass through the version data (e.g. if you are using a custom publish executor that needs to be aware of versions)
// It will then be provided to the publish executor options as `nxReleaseVersionData`
// This is not required for the default @nx/js publish executor
versionData: projectsVersionData,
});
process.exit(
Object.values(publishResults).every((result) => result.code === 0) ? 0 : 1
);
})();
```
See our dedicated guide on the [programmatic API](/docs/guides/nx-release/programmatic-api) to learn more and see some example release scripts.
## Learn More
### Configuration & Customization
- **[Release Groups](/docs/guides/nx-release/release-projects-independently)** - Version projects independently or together
- **[Version Projects Independently](/docs/guides/nx-release/release-projects-independently)** - Version projects independently or together
- **[Release Groups](/docs/guides/nx-release/release-groups)** - Organize projects into release groups with specific configuration for each group
- **[Conventional Commits](/docs/guides/nx-release/automatically-version-with-conventional-commits)** - Automate versioning based on commit messages
- **[Custom Registries](/docs/guides/nx-release/configure-custom-registries)** - Publish to private or alternative registries
- **[CI/CD Integration](/docs/guides/nx-release/publish-in-ci-cd)** - Automate releases in your pipeline
@@ -114,7 +114,7 @@ In Nx 21, task output is displayed in an [interactive terminal UI](/docs/guides/
To run the `test` task for the `header` project run this command:
```shell {% frame="none" %}
```shell
npx nx test header
```
@@ -124,19 +124,19 @@ You can use the `run-many` command to run a task for multiple projects. Here are
Run the `build` task for all projects in the repo:
```shell {% frame="none" %}
```shell
npx nx run-many -t build
```
Run the `build`, `lint` and `test` task for all projects in the repo:
```shell {% frame="none" %}
```shell
npx nx run-many -t build lint test
```
Run the `build`, `lint`, and `test` tasks only on the `header` and `footer` projects:
```shell {% frame="none" %}
```shell
npx nx run-many -t build lint test -p header footer
```
@@ -148,7 +148,7 @@ Learn more about the [run-many](/docs/reference/nx-commands#nx-run-many) command
You can also run a command for all the projects affected by your PR like this:
```shell {% frame="none" %}
```shell
npx nx affected -t test
```
@@ -290,7 +290,7 @@ If you want Nx to cache the task, but prefer to use npm (or pnpm/yarn) to run th
To invoke the task, use:
```shell {% frame="none" %}
```shell
npx nx docs
```
@@ -38,14 +38,14 @@ Please verify closely that you have the following setup:
Clone your repository to your local machine:
```shell {% frame="none" %}
```shell
git clone <your-repository-url>
cd <your-repository-name>
```
Install dependencies:
```shell {% frame="none" %}
```shell
npm install
```
@@ -84,7 +84,7 @@ Now, let's build some features and see how Nx helps get us to production faster.
To serve your new Angular app, run:
```shell {% frame="none" %}
```shell
npx nx serve angular-demo
```
@@ -151,7 +151,7 @@ The most critical parts are:
To view all tasks for a project, look in the [Nx Console](/docs/getting-started/editor-setup) project detail view or run:
```shell {% frame="none" %}
```shell
npx nx show project angular-demo
```
@@ -256,7 +256,7 @@ Nx allows you to separate this logic into "local libraries." The main benefits i
Let's create a reusable design system library called `ui` that we can use across our workspace. This library will contain reusable components such as buttons, inputs, and other UI elements.
```shell {% frame="none" %}
```shell
npx nx g @nx/angular:library packages/ui --unitTestRunner=vitest
```
@@ -281,13 +281,13 @@ Running the above command should lead to the following directory structure:
Just as with the `angular-demo` app, Nx automatically infers the tasks for the `ui` library from its configuration files. You can view them by running:
```shell {% frame="none" %}
```shell
npx nx show project ui
```
In this case, we have the `lint` and `test` tasks available, among other inferred tasks.
```shell {% frame="none" %}
```shell
npx nx lint ui
npx nx test ui
```
@@ -433,7 +433,7 @@ Nx automatically detects the dependencies between the various parts of your work
Just run:
```shell {% frame="none" %}
```shell
npx nx graph
```
@@ -475,7 +475,7 @@ You should be able to see something similar to the following in your browser.
Let's create a git branch with the new hero component so we can open a pull request later:
```shell {% frame="none" %}
```shell
git checkout -b add-hero-component
git add .
git commit -m 'add hero component'
@@ -485,14 +485,14 @@ git commit -m 'add hero component'
Our current setup not only has targets for serving and building the Angular application, but also has targets for unit testing, e2e testing and linting. The `test` and `lint` targets are defined in the application `project.json` file. We can use the same syntax as before to run these tasks:
```shell {% frame="none" %}
```shell
npx nx test angular-demo # runs the tests for angular-demo
npx nx lint ui # runs the linter on ui
```
More conveniently, we can also run tasks in parallel using the following syntax:
```shell {% frame="none" %}
```shell
npx nx run-many -t test lint
```
@@ -575,7 +575,7 @@ You will also need to install the [Nx Console](/docs/getting-started/editor-setu
Now, let's push the `add-hero-component` branch to GitHub and open a new pull request.
```shell {% frame="none" %}
```shell
git push origin add-hero-component
# Don't forget to open a pull request on GitHub
```
@@ -30,7 +30,7 @@ are specific to your operating system.
To verify that Gradle was installed correctly, run this command:
```shell {% frame="none" %}
```shell
gradle --version
```
@@ -41,21 +41,21 @@ To streamline this tutorial, we'll install Nx globally on your system. You can u
Make sure [Homebrew is installed](https://brew.sh/), then install Nx globally with these commands:
```shell {% frame="none" %}
```shell
brew install nx
```
{% /tabitem %}
{% tabitem label="Chocolatey (Windows)" %}
```shell {% frame="none" %}
```shell
choco install nx
```
{% /tabitem %}
{% tabitem label="apt (Ubuntu)" %}
```shell {% frame="none" %}
```shell
sudo add-apt-repository ppa:nrwl/nx
sudo apt update
sudo apt install nx
@@ -67,7 +67,7 @@ sudo apt install nx
Install node from the [NodeJS website](https://nodejs.org/en/download), then install Nx globally with this command:
```shell {% frame="none" %}
```shell
npm install --global nx
```
@@ -80,7 +80,7 @@ This tutorial picks up where [Spring framework](https://spring.io/)'s guide for
Fork [the sample repository](https://github.com/nrwl/gradle-tutorial/fork), and then clone it on your local machine:
```shell {% frame="none" %}
```shell
git clone https://github.com/<your-username>/gradle-tutorial.git
```
@@ -111,7 +111,7 @@ both locally and on CI. We will explore the features of Nx in this tutorial by a
To add Nx, run
```shell {% frame="none" %}
```shell
nx init
```
@@ -152,7 +152,7 @@ The `@nx/gradle` plugin reflects the graph of projects in Gradle into the Nx Pro
are created, deleted, and change their dependencies, Nx will automatically recalculate the graph. Exploring this graph
visually is vital to understanding how your code is structured and how Nx and Gradle behaves.
```shell {% frame="none" %}
```shell
nx graph
```
@@ -1132,7 +1132,7 @@ computation caching to reuse the results of tasks. We will explore how Nx adds t
Before we start running tasks, let's explore the tasks available for the `application` project. The `@nx/gradle` plugin
that we've installed reflects Gradle's tasks to Nx, which allows it to run any of the Gradle tasks defined for that project. You can view the available tasks either through [Nx Console](/docs/getting-started/editor-setup) or from the terminal:
```shell {% frame="none" %}
```shell
nx show project application
```
@@ -2374,7 +2374,7 @@ nx show project application
The Nx command to run the `build` task for the `application` project is:
```shell {% frame="none" %}
```shell
nx run application:build
```
@@ -2457,7 +2457,7 @@ With Nx Cloud connected, your task results are now cached remotely. This means t
Try running the build again after making a small change to see how Nx intelligently determines which tasks need to be re-run:
```shell {% frame="none" %}
```shell
nx run-many -t build
```
@@ -2517,13 +2517,13 @@ You will also need to install the [Nx Console](/docs/getting-started/editor-setu
Start by making a new branch to work on.
```shell {% frame="none" %}
```shell
git checkout -b self-healing-ci
```
Now for demo purposes, we'll make a mistake in our `DemoApplication` class that will cause the build to fail.
```diff
```diff {% meta="lang='java'" %}
// application/src/main/java/com/example/multimodule/application/DemoApplication.java
@GetMapping("/")
public String home() {
@@ -2534,7 +2534,7 @@ Now for demo purposes, we'll make a mistake in our `DemoApplication` class that
Commit the changes and open a new PR on GitHub.
```shell {% frame="none" %}
```shell
git add .
git commit -m 'demo self-healing ci'
git push origin self-healing-ci
@@ -79,7 +79,7 @@ Now, let's build some features and see how Nx helps get us to production faster.
To serve your new React app, run:
```shell {% frame="none" %}
```shell
npx nx serve demo
```
@@ -120,7 +120,7 @@ In `nx.json` there's already the `@nx/vite` plugin registered which automaticall
To view the tasks that Nx has detected, look in the [Nx Console](/docs/getting-started/editor-setup) project detail view or run:
```shell {% frame="none" %}
```shell
npx nx show project demo
```
@@ -235,7 +235,7 @@ Nx allows you to separate this logic into "local libraries." The main benefits i
Let's create a reusable design system library called `ui` that we can use across our workspace. This library will contain reusable components such as buttons, inputs, and other UI elements.
```shell {% frame="none" %}
```shell
npx nx g @nx/react:library packages/ui --unitTestRunner=vitest --bundler=none
```
@@ -262,13 +262,13 @@ Running the above commands should lead to the following directory structure:
Just as with the `demo` app, Nx automatically infers the tasks for the `ui` library from its configuration files. You can view them by running:
```shell {% frame="none" %}
```shell
npx nx show project ui
```
In this case, we have the `lint` and `test` tasks available, among other inferred tasks.
```shell {% frame="none" %}
```shell
npx nx lint ui
npx nx test ui
```
@@ -391,7 +391,7 @@ Nx automatically detects the dependencies between the various parts of your work
Just run:
```shell {% frame="none" %}
```shell
npx nx graph
```
@@ -433,7 +433,7 @@ You should be able to see something similar to the following in your browser.
Let's create a git branch with the new hero component so we can open a pull request later:
```shell {% frame="none" %}
```shell
git checkout -b add-hero-component
git add .
git commit -m 'add hero component'
@@ -443,14 +443,14 @@ git commit -m 'add hero component'
Our current setup doesn't just come with targets for serving and building the React application, but also has targets for testing and linting. We can use the same syntax as before to run these tasks:
```shell {% frame="none" %}
```shell
npx nx test demo # runs the tests for demo
npx nx lint ui # runs the linter on ui
```
More conveniently, we can also run tasks in parallel using the following syntax:
```shell {% frame="none" %}
```shell
npx nx run-many -t test lint
```
@@ -533,7 +533,7 @@ You will also need to install the [Nx Console](/docs/getting-started/editor-setu
Now, let's push the `add-hero-component` branch to GitHub and open a new pull request.
```shell {% frame="none" %}
```shell
git push origin add-hero-component
# Don't forget to open a pull request on GitHub
```
@@ -11,11 +11,16 @@ Nx provides deep integration with AI coding assistants through the **Nx Model Co
## Configure Nx AI Integration
{% youtube
src="https://youtu.be/8gdvIz2r_QM"
title="Set Up AI Agents in Nx"
/%}
### Automatic AI Setup
To automatically configure your Nx workspace to work best with AI agents and assistants, run the following command:
```shell {% frame="none" %}
```shell
npx nx configure-ai-agents
```
@@ -41,7 +46,7 @@ You can of course manually configure the Nx MCP for MCP-compatible clients using
For Claude Code:
```shell {% frame="none" %}
```shell
claude mcp add nx-mcp npx nx-mcp@latest
```
@@ -14,6 +14,8 @@ Nx Console editor extensions make your developer experience richer. The extensio
- visualize dependencies between projects and tasks
- and more!
You can explore more of the features [in our dedicated Nx Console guides](/docs/guides/nx-console).
## Download
### Official Integrations
@@ -33,3 +35,7 @@ If you are using [VSCode](https://code.visualstudio.com/) or a [JetBrains IDE](h
If you are using [Neovim](https://neovim.io/), you can install [Equilibris/nx.nvim](https://github.com/Equilibris/nx.nvim) with your favorite package manager.
This plugin is **NOT** built or maintained by the Nx team. They are maintained by independent community contributors.
## Troubleshooting
If you encounter issues with Nx Console, see the [Nx Console troubleshooting guide](/docs/guides/nx-console/console-troubleshooting) for detailed steps including how to enable debug logging.
@@ -10,7 +10,7 @@ To install Nx on your machine, choose one of the following methods based on your
{% tabs syncKey="install-method" %}
{% tabitem label="npm" %}
```shell {% frame="none" %}
```shell
npm add --global nx
```
@@ -19,7 +19,7 @@ npm add --global nx
{% tabitem label="Homebrew (macOS, Linux)" %}
```shell {% frame="none" %}
```shell
brew install nx
```
@@ -27,7 +27,7 @@ brew install nx
{% tabitem label="Chocolatey (Windows)" %}
```shell {% frame="none" %}
```shell
choco install nx
```
@@ -35,7 +35,7 @@ choco install nx
{% tabitem label="apt (Ubuntu)" %}
```shell {% frame="none" %}
```shell
sudo add-apt-repository ppa:nrwl/nx
sudo apt update
sudo apt install nx
@@ -48,7 +48,7 @@ sudo apt install nx
To add Nx to an existing repository, run:
```shell {% frame="none" %}
```shell
nx init
```
@@ -59,7 +59,7 @@ Learn more about [adopting Nx in an existing project](/docs/guides/adopting-nx)
To create a starter repository, you can use the `create-nx-workspace` command. This will create a new Nx workspace with a default configuration and example applications.
```shell {% frame="none" %}
```shell
npx create-nx-workspace@latest
```
@@ -67,13 +67,13 @@ npx create-nx-workspace@latest
When you update Nx, Nx will also [automatically update your dependencies](/docs/features/automate-updating-dependencies) if you have an [Nx plugin](/docs/concepts/nx-plugins) installed for that dependency. To update Nx, run:
```shell {% frame="none" %}
```shell
nx migrate latest
```
This will create a `migrations.json` file with any update scripts that need to be run. Run them with:
```shell {% frame="none" %}
```shell
nx migrate --run-migrations
```
@@ -47,7 +47,7 @@ Then you can simply add Nx to your root `package.json`:
And once that's done, you can run your tasks via Nx.
```shell {% frame="none" %}
```shell
nx build my-project
```
@@ -4,7 +4,7 @@ description: Get started with using Nx Cloud and improve your PRs time to green.
filter: 'type:Features'
---
{% youtube src="https://youtu.be/4VI-q943J3o" title="Fast CI for monorepos" width="100%" /%}
{% youtube src="https://www.youtube.com/watch?v=cDBihpB3SbI" title="Nx and Nx Cloud" width="100%" /%}
CI is challenging and it's **not your fault**. It's a fundamental issue with how the current, traditional CI execution model works. Nx Cloud adopts a new **task-based** CI model which allows you to overcome slowness and unreliability of the current VM-based CI model.
_(Dive deeper into the [task based CI execution model](https://nx.dev/blog/reliable-ci-a-new-execution-model-fixing-both-flakiness-and-slowness))_
@@ -15,7 +15,19 @@ Nx Cloud improves many aspects of the CI/CD process:
- **Cost** - 40% - 75% reduction in CI costs (observed on the Nx OSS monorepo)
- **Reliability** - by automatically identifying flaky tasks (e2e tests in particular) and re-running them
{% call_to_action variant="default" title="Recover lost time with Nx Cloud" url="https://cloud.nx.app/get-started?utm_source=nx-dev&utm_medium=nx-cloud_intro&utm_campaign=try-nx-cloud" description="Setup takes less than 2 minutes" /%}
## Connect your workspace to Nx Cloud
The most straightforward way to connect your Nx workspace with Nx Cloud is via the web application:
{% call_to_action variant="default" title="Create a new or connect an existing repo" url="https://cloud.nx.app/get-started?utm_source=nx-dev&utm_medium=nx-cloud_intro&utm_campaign=try-nx-cloud" description="Setup takes less than 2 minutes" /%}
Alternatively, you can also run the following command in your Nx workspace (make sure you have it pushed to a remote repository first):
```shell
nx connect
```
For more details, [follow our in-depth guide](/docs/guides/nx-cloud/setup-ci) for setting up CI with Nx.
## How Nx Cloud improves CI
@@ -31,7 +43,7 @@ For example:
- More work needs to run in CI - Add more agent machines, Nx Cloud automatically assigns available work to extra agent machines.
- Known flaky tasks waste CI time on needed reruns - Nx Cloud automatically detects flaky tasks and reruns automatically in the current CI execution.
[Read more customer stories](https://nx.dev/blog?filterBy=customer+story)
[Learn how our customers use Nx Cloud](https://nx.dev/blog?filterBy=customer+story) to help them scale their workspaces and be more efficient.
## Learn more
@@ -27,7 +27,7 @@ Let's take the example of an NPM workspace. Create a new root-level `package.jso
Then you can add Nx to it by using:
```shell {% frame="none" %}
```shell
nx@latest init
```
@@ -35,7 +35,7 @@ nx@latest init
Make sure you have [Nx installed globally](/docs/getting-started/installation) or use `npx` if you're in a JavaScript environment
{% /aside %}
Nx will detect the underlying workspace configuration, ask you a couple of questions and install itself into the workspace. As you keep going, you can incrementally add functionality, like:
Nx will detect the underlying workspace configuration, ask you a couple of questions and install itself into the workspace. You can now [run tasks with Nx](/docs/features/run-tasks) and incrementally add functionality, like:
- [Configure caching](/docs/features/cache-task-results)
- [Adding Nx plugins to help refine your workflows](/docs/plugin-registry)
@@ -47,7 +47,7 @@ Alternatively, you can choose a more guided approach by leveraging some of the p
Run the following command to get started:
```shell {% frame="none" %}
```shell
npx create-nx-workspace@latest
```
@@ -55,12 +55,12 @@ This interactive command will guide you through the setup process, allowing you
- **Choose your workspace name** - This will be the name of your root directory
- **Select your preferred package manager** - npm, yarn, or pnpm
- **Pick a preset** - Choose from various technology stacks and configurations
- **Pick a preset** - Choose from [various technology stacks and configurations](/docs/reference/create-nx-workspace#presets)
- **Configure additional options** - Such as styling solutions, testing frameworks, and more
Choose a preset that matches your technology stack. This gives you a fully configured workspace.
You can also choose **an empty workspace preset** which sets up the bare minimum configuration including Nx itself. This allows you to add technologies and features incrementally over time as you need them.
You can also choose **an empty workspace preset** (`--preset=ts`) which sets up the bare minimum configuration for TypeScript and Nx. This allows you to add technologies and features incrementally over time as you need them.
## Option 3: Get the complete Nx platform experience
@@ -7,13 +7,15 @@ sidebar:
filter: 'type:Guides'
---
{% course_video src="https://youtu.be/3hW53b1IJ84" courseTitle="From PNPM Workspaces to Distributed CI" courseUrl="https://nx.dev/courses/pnpm-nx-next/lessons-01-nx-init" /%}
In many situations, you have an existing codebase and want to improve it with Nx using an **incremental adoption approach**.
Thanks to [Nx's modular architecture](/docs/getting-started/intro), you can start with just **Nx Core** and then gradually add [technology-specific plugins](/docs/technologies), [CI integrations](/docs/getting-started/nx-cloud), or other capabilities as your requirements evolve.
Getting started is remarkably simple. You can add Nx to any existing project with a single command:
```shell {% frame="none" %}
```shell
nx@latest init
```
@@ -25,12 +27,13 @@ Whether a monorepo, single project or something in between, `nx init` walks you
## Next Steps
After initializing Nx, you can explore your workspace with the following commands:
After initializing Nx, you can [run tasks](/docs/features/run-tasks) with `nx <task> <project-name>` (e.g. `nx build myproject`) or run one or many tasks across all projects with `nx run-many -t <task1> <task2>`.
You can also explore your codebase using:
- `nx graph` to view an interactive graph
- `nx show projects` to see a list of all projects
- `nx show project <project-name>` to view an interactive project detailed view
- `nx run-many -t <target>` to run tasks with Nx, e.g. `nx run-many -t build`
### Update CI Configurations
@@ -31,7 +31,7 @@ Additionally, Nx also [speeds up your CI ⚡](#fast-ci) with [remote caching](/d
Run the following command:
```shell {% frame="none" %}
```shell
npx nx@latest init
```
@@ -114,7 +114,7 @@ configuring the plugins on the [`@nx/next/plugin`](/docs/technologies/react/next
To view all available tasks, open the Project Details view with Nx Console or use the terminal to launch the project
details in a browser window.
```shell {% frame="none" %}
```shell
nx show project my-workspace --web
```
@@ -317,7 +317,7 @@ Now that we're working on the CI pipeline, it is important for your changes to b
Now connect your repository to Nx Cloud with the following command:
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -331,7 +331,7 @@ Once the PR is created, merge it into your main branch.
And make sure you pull the latest changes locally:
```shell {% frame="none" %}
```shell
git pull
```
@@ -341,7 +341,7 @@ You should now have an `nxCloudId` property specified in the `nx.json` file.
Use the following command to generate a CI workflow file.
```shell {% frame="none" %}
```shell
npx nx generate ci-workflow --ci=github
```
@@ -381,7 +381,7 @@ jobs:
Commit the changes and open a new PR on GitHub.
```shell {% frame="none" %}
```shell
git add .
git commit -m 'add CI workflow file'
git push origin add-workflow
@@ -29,7 +29,7 @@ add an `nx.json` for configuring caching and task pipelines.
Run the following command to automatically set up Nx:
```shell {% frame="none" %}
```shell
npx nx@latest init
```
@@ -112,7 +112,7 @@ configuring the plugins on the [`@nx/next/plugin`](/docs/technologies/react/next
To view all available tasks, open the Project Details view with Nx Console or use the terminal to launch the project
details in a browser window.
```shell {% frame="none" %}
```shell
nx show project my-workspace --web
```
@@ -301,14 +301,14 @@ initially using Nx just for a subset of your scripts and then gradually adding m
For example, use Nx to run your builds:
```shell {% frame="none" %}
```shell
npx nx run-many -t build
```
But instead keep using NPM/Yarn/PNPM workspace commands for your tests and other scripts. Here's an example of using
PNPM commands to run tests across packages
```shell {% frame="none" %}
```shell
pnpm run -r test
```
@@ -335,7 +335,7 @@ Now that we're working on the CI pipeline, it is important for your changes to b
Now connect your repository to Nx Cloud with the following command:
```shell {% frame="none" %}
```shell
npx nx@latest connect
```
@@ -349,7 +349,7 @@ Once the PR is created, merge it into your main branch.
And make sure you pull the latest changes locally:
```shell {% frame="none" %}
```shell
git pull
```
@@ -359,7 +359,7 @@ You should now have an `nxCloudId` property specified in the `nx.json` file.
Use the following command to generate a CI workflow file.
```shell {% frame="none" %}
```shell
npx nx generate ci-workflow --ci=github
```
@@ -399,7 +399,7 @@ jobs:
Commit the changes and open a new PR on GitHub.
```shell {% frame="none" %}
```shell
git add .
git commit -m 'add CI workflow file'
git push origin add-workflow
@@ -129,13 +129,13 @@ The simplest way to understand the concepts is to see a basic migration example.
1. Let's create a new Turborepo workspace using the recommended `create-turbo` command:
```shell {% frame="none" %}
```shell
npx create-turbo@latest
```
2. Once that is finished, literally all we need to do make it a valid Nx workspace is run `nx init`:
```shell {% frame="none" %}
```shell
npx nx@latest init
```
@@ -57,7 +57,7 @@ Nx can help with the process of moving an existing project from another reposito
In this example, the source repository contains a single application while the destination repository is already a monorepo. You can also import a project from a sub-directory of the source repository (if the source repository is a monorepo, for instance). The `nx import` command can be run with no arguments and you will be prompted to for the required arguments:
```shell {% frame="none" %}
```shell
nx import
```
@@ -65,7 +65,7 @@ Make sure to run `nx import` from within the **destination repository**.
You can also directly specify arguments from the terminal, like one of these commands:
```shell {% frame="none" %}
```shell
nx import [sourceRepository] [destinationDirectory]
nx import ../inventory-app apps/inventory
nx import https://github.com/myorg/inventory-app.git apps/inventory
@@ -8,7 +8,7 @@ sidebar:
The easiest way to start using Nx is to run the `nx init` command.
```shell {% frame="none" %}
```shell
npx nx@latest init
```
@@ -21,28 +21,28 @@ We'll start by installing the `nx` package:
{% tabs syncKey="install-type" %}
{% tabitem label="npm" %}
```shell {% frame="none" %}
```shell
npm add -D nx@latest
```
{% /tabitem %}
{% tabitem label="yarn" %}
```shell {% frame="none" %}
```shell
yarn add -D nx@latest
```
{% /tabitem %}
{% tabitem label="pnpm" %}
```shell {% frame="none" %}
```shell
pnpm add -D nx@latest
```
{% /tabitem %}
{% tabitem label="bun" %}
```shell {% frame="none" %}
```shell
bun add -D nx@latest
```
@@ -26,7 +26,7 @@ If your standalone project was not an Nx workspace, it's likely that your migrat
In order to avoid merge conflicts later, it's best to first do the folder reorganization in the _standalone project repo_. For example, assuming you want the standalone app to end up at `apps/my-standalone-app` in the monorepo and your main branch is called `master`:
```shell {% frame="none" %}
```shell
cd my-standalone-app
git checkout main
git fetch
@@ -38,21 +38,21 @@ git ls-files | sed 's!/.*!!'| uniq | xargs -i git mv {} apps/my-standalone-app
Check if you need to move back the `.gitignore` file to the root and/or update any paths so you don't commit previously ignored files/folders.
If all is well proceed with the commit and push.
```shell {% frame="none" %}
```shell
git commit -m "Move files in preparation for monorepo migration"
git push --set-upstream origin monorepo-migration
```
Next, in your monorepo, we'll add a remote repository url for where the standalone app is located:
```shell {% frame="none" %}
```shell
git remote add my-standalone-app <repository url>
git fetch my-standalone-app
```
Then we'll run
```shell {% frame="none" %}
```shell
git merge my-standalone-app/monorepo-migration --allow-unrelated-histories
```
@@ -17,7 +17,7 @@ First globally install Nx using Homebrew (Mac and Linux) or with a manually inst
If you have [Homebrew installed](https://brew.sh/), you can install Nx globally with these commands:
```shell {% frame="none" %}
```shell
brew install nx
```
@@ -26,7 +26,7 @@ brew install nx
If you have [Node installed](https://nodejs.org/en/download), you can install Nx globally with this command:
```shell {% frame="none" %}
```shell
npm install --global nx
```
@@ -37,7 +37,7 @@ npm install --global nx
You can install Nx in the `.nx/installation` directory of your repository by running `nx init` in a directory without a `package.json` file.
```shell {% frame="none" %}
```shell
nx init
```
@@ -46,7 +46,7 @@ When Nx is installed in `.nx`, you can run Nx via a global Nx installation or th
{% tabs %}
{% tabitem label="Global Install" %}
```shell {% frame="none" %}
```shell
nx build my-project
nx generate application
nx graph
@@ -55,7 +55,7 @@ nx graph
{% /tabitem %}
{% tabitem label="nx shell script" %}
```shell {% frame="none" %}
```shell
./nx build my-project
./nx generate application
./nx graph
@@ -64,7 +64,7 @@ nx graph
{% /tabitem %}
{% tabitem label="nx.bat" %}
```shell {% frame="none" %}
```shell
./nx.bat build my-project
./nx.bat generate application
./nx.bat graph
@@ -18,7 +18,7 @@ If you cannot remember which package manager you installed Nx globally with or a
{% tabs syncKey="install-type" %}
{% tabitem label="npm" %}
```shell {% frame="none" %}
```shell
npm list --global nx
```
@@ -27,20 +27,20 @@ npm list --global nx
**yarn 2+**
```shell {% frame="none" %}
```shell
yarn dlx list nx
```
yarn 1.x
```shell {% frame="none" %}
```shell
yarn global list nx
```
{% /tabitem %}
{% tabitem label="pnpm" %}
```shell {% frame="none" %}
```shell
pnpm list --global nx
```
@@ -52,21 +52,21 @@ You can then remove the extra global installations by running the following comm
{% tabs syncKey="install-type" %}
{% tabitem label="npm" %}
```shell {% frame="none" %}
```shell
npm rm --global nx
```
{% /tabitem %}
{% tabitem label="yarn" %}
```shell {% frame="none" %}
```shell
yarn global remove nx
```
{% /tabitem %}
{% tabitem label="pnpm" %}
```shell {% frame="none" %}
```shell
pnpm rm --global nx
```
@@ -0,0 +1,48 @@
---
title: Azure DevOps Integration
description: Learn how to integrate Nx Cloud with Azure DevOps for PR integration.
filter: 'type:Guides'
sidebar:
label: Azure DevOps
---
The Nx Cloud + Azure Devops Integration lets you access the result of every run—with all its logs and build insights—straight from your PR.
## Connecting Your Workspace
![Access VCS Setup](../../../../../assets/nx-cloud/set-up/access-vcs-setup.webp)
Once on the VCS Integrations setup page, select "Azure DevOps". You will be prompted to enter the name of your organization and project.
Identifying your organization and project can be done by looking at the URL of your project summary page.
```text
// URL format
https://dev.azure.com/[organization]/[project]
```
For example, the url `https://dev.azure.com/nrwl/my-monorepo-project` has an organization name of "nrwl", and a project name of "large-monorepo".
You will also need to provide the id of your Azure Git repository, this can either be the internal GUID identifier, if known, or you can use the name of the repository from the URL you use to access it.
For example, a URL of `https://dev.azure.com/nrwl/_git/large-monorepo` has the repository id of "large-monorepo".
![Add Azure DevOps Repository](../../../../../assets/nx-cloud/set-up/add-azure-devops-repository.webp)
### Configuring Authentication
#### Using a Personal Access Token
To use a Personal Access Token for authentication, one must be generated with proper permissions. The minimum required permissions are shown in the screenshot below.
![Work Items - Read, Code - Read, Build - Read & execute, Release - Read, write, & execute](../../../../../assets/nx-cloud/set-up/minimal-ado-access-token.webp)
Once this token is created paste the value and then click "Connect".
This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved, and setup is complete.
Please note that Azure DevOps will impose rate limits which can degrade the performance of the integration leading to missing data or functionality. To mitigate the impact, we recommend you assign the [Basic + Test plan](https://learn.microsoft.com/en-us/azure/devops/organizations/billing/buy-basic-access-add-users?view=azure-devops#assign-basic-or-basic--test-plans) to the user whose token you utilise for this integration.
### Advanced Configuration
If your company runs a self-hosted Azure DevOps installation, you may need to override the default URL that Nx Cloud uses to connect to the Azure Devops API. To do so, check the box labeled "Override Azure DevOps API URL" and enter the correct URL for your organization.
@@ -0,0 +1,48 @@
---
title: Bitbucket Integration
description: Learn how to integrate Nx Cloud with Bitbucket for PR integration.
filter: 'type:Guides'
sidebar:
label: Bitbucket
---
The Nx Cloud + Bitbucket Integration lets you access the result of every run—with all its logs and build insights—straight from your PR.
### Using an App Password
If you are using BitBucket Cloud (bitbucket.org) and are not self-hosting it, you can enable an ["app password" for authentication](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password).
The minimum required permissions are write access to PRs:
![Create App Password](../../../../../assets/nx-cloud/set-up/minimal-bitbucket-cloud-app-password.webp)
Once the app password is created, save it in a secure location and then head back to your workspace settings on NxCloud and let's set up a BitBucket integration:
![Access VCS Setup](../../../../../assets/nx-cloud/set-up/access-vcs-setup.webp)
1. Fill-in all the required fields for selecting your Bitbucket repository
2. Username is found on the [account settings](https://bitbucket.org/account/settings/) screen (it is not your email address)
3. Paste your app password created earlier into the Access Token box
4. That's it!
### Using an HTTP Access Tokens
If you are using BitBucket Data Center (on-prem) you need to enable ["HTTP Access Tokens" for authentication](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html).
{% aside type="note" title="User linked access tokens" %}
Due to the type of APIs NxCloud needs to call, we need to create an access [**at the user level**](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html). Repo level access tokens will not work.
{% /aside %}
The minimum required permissions are write access to the repository:
![Create an HTTP Access Token](../../../../../assets/nx-cloud/set-up/bitbucket-data-center-access-token.png)
Once the token is created, save it in a secure location and then head back to your workspace settings on NxCloud and let's set up a BitBucket integration:
![Access VCS Setup](../../../../../assets/nx-cloud/set-up/access-vcs-setup.webp)
1. Fill-in all the required fields for selecting your Bitbucket repository
2. Username is found on the [account settings](https://your-bitbucket-instance.com/profile) screen (it is not your email address)
3. Paste your access token created earlier into the Access Token box
4. Make sure you give NxCloud the URL of your BitBucket instance (this can be in the simple form of `https://your-bitbucket-instance.com`)
5. That's it!
@@ -0,0 +1,91 @@
---
title: GitHub Integration
description: Learn how to integrate Nx Cloud with GitHub for PR integration.
filter: 'type:Guides'
sidebar:
label: GitHub
---
The [Nx Cloud GitHub App](https://github.com/marketplace/official-nx-cloud-app) lets you access the result of every run—with all its logs and build insights—straight from your PR.
## Install the App
For the best experience, install the [Nx Cloud GitHub App](https://github.com/marketplace/official-nx-cloud-app). Using the app provides the most seamless authentication experience. This is not required if you wish to authenticate with a personal access token that you generate yourself.
## Connecting Your Workspace
Once you have installed the Nx Cloud GitHub App, you must link your workspace to the installation. To do this, sign in to Nx Cloud and navigate to the VCS Integrations setup page. This page can be found in your workspace settings, you need to be admin of the organization in order to access it.
Once on the VCS Integrations setup page, you can choose what VCS you want to connect to your workspace.
![Access VCS Setup](../../../../../assets/nx-cloud/set-up/access-vcs-setup.webp)
### Choosing an Authentication Method
It is easier to configure the Nx Cloud GitHub Integration to use its GitHub App to authenticate, and this method should be preferred for users on Nx Public Cloud. Advanced users or Nx Enterprise clients may instead wish to generate a personal access token instead.
#### Using the GitHub App
To use the Nx Cloud GitHub App for authentication, select the radio button and then click "Connect".
This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved.
Check the "_CI Platform Considerations_" section below and if there are no additional instructions for your platform of choice, setup is complete.
![Use GitHub App for Authentication](../../../../../assets/nx-cloud/set-up/use-github-app-auth.webp)
#### Using a Personal Access Token
Github supports two [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens) types: Classic and Fine-grained.
To use a Personal Access Token for authentication, one must be generated with proper permissions. The minimum required permissions are shown in the screenshot below.
{% tabs %}
{% tabitem label="Classic Token" %}
![Minimum GitHub Personal Access Token Permissions](../../../../../assets/nx-cloud/set-up/minimal-github-access-token.webp)
{% /tabitem %}
{% tabitem label="Fine-grained Token" %}
![Minimum GitHub Fine-grained Personal Access Token Permissions](../../../../../assets/nx-cloud/set-up/fine-grained-gh-pat-permissions.avif)
{% /tabitem %}
{% /tabs %}
Once this token is created, select the radio button for providing a personal access token, paste the value, and then click "Connect". This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved. Check the "_CI Platform Considerations_" section below, and if there are no additional instructions for your platform of choice, setup is complete.
### Advanced Configuration
If your company runs a self-hosted GitHub installation, you may need to override the default URL that Nx Cloud uses to connect to the GitHub API. To do so, check the box labeled "Override GitHub API URL" and enter the correct URL for your organization.
## CI Platform Considerations
If you are using CircleCI, TravisCI, GitHub Actions or GitHub, there is nothing else you need to do. If you are using other CI providers, you need to set the `NX_BRANCH` environment variable in your CI configuration. The variable has to be set to a PR number.
For instance, this is an example of doing it in Azure pipelines.
### Azure Pipelines
```yml
// azure-pipelines.yml
variables:
NX_BRANCH: $(System.PullRequest.PullRequestNumber)
```
### CircleCI
Make sure [GitHub checks are enabled](https://circleci.com/docs/2.0/enable-checks/#to-enable-github-checks).
### Jenkins
[Install the Jenkins plugin](https://plugins.jenkins.io/github-checks/).
Ensure this step from the plugin instructions is followed:
Prerequisite: only GitHub App with proper permissions can publish checks, this guide helps you authenticate your Jenkins as a GitHub App.
## Github Status Checks
The Nx Cloud GitHub Integration updates your PR with commit statuses that reflect the real-time progress of your runs. These statuses are generated dynamically based on your running commands. Enforcing these dynamically-named checks within your branch protection rules is not recommended, as it can result in stuck checks displaying `Waiting for status to be reported`.
From your repository, go to `Settings -> Branches -> Protect matching branches` and ensure that no Nx Cloud status checks are listed in the `Require status checks to pass before merging` list. Enforcing that status checks pass on your default branch is sufficient.
![Ensure that any NxCloud status check is deselected from your branch protection rules](../../../../../assets/nx-cloud/set-up/do-not-enforce-nx-cloud-status-checks.webp)
@@ -0,0 +1,35 @@
---
title: GitLab Integration
description: Learn how to integrate Nx Cloud with GitLab for MR integration.
filter: 'type:Guides'
sidebar:
label: GitLab
---
The Nx Cloud GitLab Integration lets you access the result of every run—with all its logs and build insights—straight from your Merge Requests.
### Connecting Your Workspace
![Access VCS Setup](../../../../../assets/nx-cloud/set-up/access-vcs-setup.webp)
Once on the VCS Integrations setup page, select "GitLab". You will be prompted to enter your project's ID.
![Locate Gitlab Project ID](../../../../../assets/nx-cloud/set-up/find-gitlab-project-id.avif)
To locate the ID for your project, visit the home page of your repository on GitLab. Click the three-dot menu button in the upper right corner and select "Copy project ID" to copy the value to your clipboard.
![Add GitLab Repository](../../../../../assets/nx-cloud/set-up/add-gitlab-repository.webp)
### Using a Personal Access Token
To use a Personal Access Token for authentication, one must be generated with proper permissions. The minimum required permissions are shown in the screenshot below.
![Minimum GitLab Personal Access Token Permissions](../../../../../assets/nx-cloud/set-up/minimal-gitlab-access-token.webp)
Once this token is created, select the radio button for providing a personal access token, paste the value, and then click "Connect".
This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved, and setup is complete.
### Advanced Configuration
If your company runs a self-hosted GitLab installation, you may need to override the default URL that Nx Cloud uses to connect to the GitLab API. To do so, check the box labeled "Override GitLab API URL" and enter the correct URL for your organization.
@@ -0,0 +1,9 @@
---
title: Source Control Integration
sidebar:
hidden: true
description: How to integrate Nx Cloud with your source control platform
pagefind: false
---
{% index_page_cards path="guides/nx-cloud/source-control-integration" /%}
@@ -66,33 +66,6 @@ For manual DTE configurations, the `nx fix-ci` command must be included in the a
For non-DTE setups, refer to the [Self-Healing CI documentation](/docs/features/ci-features/self-healing-ci) for detailed configuration instructions.
## Explain with AI for Enterprise On-Prem Installations
To enable the Explain with AI feature for enterprise on-prem installations, add the following configuration to your `helm-values.yaml` file:
```yaml
nxApi
deployment:
env:
- name: NX_CLOUD_AI_ENABLED
value: 'true'
frontend
deployment:
env:
- name: OPENAI_SECRET_KEY
valueFrom:
secretKeyRef:
name: open-ai-secrets
key: OPENAI_SECRET_KEY
- name: NX_CLOUD_AI_ENABLED
value: 'true'
```
_(We use gpt-4o for the Explain with AI feature)_
Then, enable AI features in the [organization settings](https://cloud.nx.app/go/organization/edit).
## Regional Availability
AI features are not available for the EU cluster in public cloud installations due to regional restrictions. However, on-prem customers in the EU can still use these features by providing their own OpenAI secret key (for Explain with AI) or Anthropic API key (for Self-Healing CI) and enabling the required environment variables.
AI features are not available for the EU cluster in public cloud installations due to regional restrictions. However, on-prem customers in the EU can still use these features by providing their own Anthropic API key (for Self-Healing CI) and enabling the required environment variables.

Some files were not shown because too many files have changed in this diff Show More