Compare commits

..

281 Commits

Author SHA1 Message Date
Jack Hsu 731aba377a fix(testing): remove --no-experimental-strip-types flag from @nx/jest/plugin + migrate to jest.config.cts if needed (#33657)
## Current Behavior
On Node.js v24+, the `@nx/jest/plugin` sets
`--no-experimental-strip-types` in NODE_OPTIONS which causes an error:
"node: --no-experimental-strip-types is not allowed in NODE_OPTIONS".

Additionally, `jest.config.ts` files using ESM syntax (`export default`,
`import`) fail to load correctly under Node.js type-stripping when the
project is configured for CommonJS.

## Expected Behavior
- Remove the NODE_OPTIONS manipulation that adds
`--no-experimental-strip-types`
- Add a migration (22.2.0-beta.2) that converts `jest.config.ts` files
from ESM to CJS syntax for projects using `@nx/jest/plugin`
- The migration only runs when `@nx/jest/plugin` is registered in
`nx.json`
- Projects with `type: module` are warned as they're incompatible with
the plugin
- Files using ESM-only features (import.meta, top-level await) are
skipped with a warning for manual conversion

## Demo

https://www.loom.com/share/8a157a0b01d144ae8d6ae48b9b0cd0e4


## Related Issue(s)
Closes NXC-3541

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-01 09:43:26 -05:00
Colum Ferry 8ff2768aaa feat(vite): add migration to add @nx/vitest (#33669)
## Current Behavior
We don't have a migration to migrate users to use the new @nx/vitest
package if they're currently using @nx/vite
Given that we have Vitest-related operations marked as deprecated when
used via @nx/vite, we should have a migration.

## Expected Behavior
Add a migration that:
1. Installs @nx/vitest
2. Switches @nx/vite:test executor usage to use @nx/vitest:test executor
usage
3. Splits `@nx/vite/plugin` in nx.json that sets up vitest test targets
to use `@nx/vitest` instead
2025-12-01 13:37:24 +00:00
Colum Ferry 637daf5343 fix(vite): vitest executor to return the async iterable #33588 (#33668)
## Current Behavior
The `@nx/vite:test` executor is not returning the async iterable. This
causes a destructuring issue.

## Expected Behavior
Ensure the `@nx/vite:test` executor returns the async iterable.

## Related Issue(s)

Fixes #33588
2025-12-01 10:33:58 +00:00
Jason Jean 6df1d8891a chore(repo): update nx to 22.2.0-beta.1 (#33650)
Updating Nx from 22.2.0-beta.0 to 22.2.0-beta.1

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-28 16:53:05 -05:00
Jack Hsu ba5b78e910 chore(repo): disable docker from macos nightlies since it does not work without vm-in-vm (#33659)
Disable but add a comment that we could enable it on macos intel if we
need to. For now it's covered by linux.
2025-11-28 15:06:27 -05:00
Jack Hsu f8f05b4086 fix(linter): update generators to use ESLint v9 compatible versions (#33633)
This PR updates the `workspace-rule` generator so use ESLint v9 by
default. It currently forces the unsupported ESLint v8.

In theory this is only useful if not using workspaces and you need
tsconfig paths to be mapped and resolved correctly. For workspaces, you
can easily just generate any library to be used to contain custom rules.

Closes NXC-3500

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-28 11:00:11 -05:00
Jack Hsu 7ff4f19529 docs(misc): update blog post links to new enterprise paths (#33654)
## Current Behavior
Blog posts contain broken links pointing to old `/powerpack` and
`/docs/enterprise/powerpack/*` paths that no longer exist.

## Expected Behavior
Links should point to the new enterprise documentation paths:
- `/powerpack` → `/enterprise`
- `/docs/enterprise/powerpack/*` → `/docs/enterprise/*`
- `/docs/reference/powerpack/*` → `/docs/reference/*`

## Related Issue(s)
Closes DOC-354

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-28 10:43:33 -05:00
James Henry f161603d37 fix(core): nx-schema default value for preserveMatchingDependencyRanges should have changed in v22 (#33587)
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-11-28 15:42:18 +00:00
Jason Jean 191e492c05 fix(core): ensure perf logs are flushed before exit in graph command (#33621)
## Current Behavior

When running `NX_PERF_LOGGING=true nx graph --file graph.json`, many
performance logs are missing (e.g., `create-project-graph-async`,
`retrieve-project-configurations`).
  Only plugin-specific logs like `createDependencies` appear.

  ## Expected Behavior

All performance timing logs should appear, matching the output of
`NX_PERF_LOGGING=true nx show projects`.

  ## Related Issue(s)

  N/A - Internal improvement for debugging/profiling.

  ## Solution

The `graph.ts` file had `process.exit(0)` calls that terminated the
process immediately, not giving the async `PerformanceObserver` callback
time to fire.

Added `await new Promise((res) => setImmediate(res))` before
`process.exit(0)` to give the event loop one tick to process pending
callbacks. This follows the existing
  pattern in `show/projects.ts` and `show/project.ts`.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-28 15:28:08 +00:00
Jason Jean 9ffe2fd715 fix(core): prevent Nx Console prompt from blocking non-interactive commands (#33646)
## Current Behavior

The Nx Console installation prompt blocks commands when run in
non-interactive contexts such as:
- CI environments
- AI agents
- Piped commands

The prompt only checked `process.stdout.isTTY` but not
`process.stdin.isTTY`, causing it to wait indefinitely for input that
would never arrive.

## Expected Behavior

Commands should complete without prompting when run in non-interactive
environments.

## Related Issue(s)

Fixes #33552

## Solution

Updated the check to verify:
1. Both `stdin` and `stdout` are TTY (truly interactive terminal)
2. Not running in a CI environment (using existing `isCI()` utility)

This ensures the prompt only appears when the user can actually provide
input.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-28 09:53:46 -05:00
Jason Jean 3ca0e475ab fix(core): suppress git stderr output in parseGitOutput (#33645)
## Current Behavior

Since Nx 21.6.1, running `nx graph` or other commands that calculate
affected projects prints git errors to stderr when the default branch is
not fetched:

```
fatal: ambiguous argument 'main': unknown revision or path not in the working tree.
```

This causes CI pipelines with strict stderr checking to fail, even
though the nx commands succeed.

## Expected Behavior

Git error messages should not be printed to stderr. The errors are
already caught and handled gracefully - they just shouldn't be visible
to the user.

## Related Issue(s)

Fixes #33330

## Solution

Added `stdio: 'pipe'` to the `execSync` call in `parseGitOutput()`. This
suppresses stderr output while still allowing the command to throw on
failure (which is already caught by the try-catch in `graph.ts`).

This matches the pattern used in `getMergeBase()` which already uses
`stdio: 'pipe'`.
2025-11-28 14:52:46 +00:00
Jason Jean 2c1bfa30b1 fix(core): include create-nx-workspace in migration package group (#33643)
## Current Behavior

When running `nx migrate latest`, the `create-nx-workspace` package is
not updated along with other Nx packages, even though it's a core part
of the Nx ecosystem that users may have as a dependency (especially when
extending the install package pattern).

## Expected Behavior

The `create-nx-workspace` package should be updated to the same version
as `nx` and other `@nx/*` packages when running migrations.

## Related Issue(s)

Fixes #33585

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-28 14:46:13 +00:00
Jason Jean 2cfb746272 fix(nuxt): update preset test for v4 app directory structure (#33648)
## Current Behavior

The nuxt preset test was checking for `apps/${name}/src/app.vue`, but
since the generator now defaults to Nuxt v4 which uses the app directory
structure, this file is no longer created at that path.

## Expected Behavior

Tests should pass on master.

## Solution

Updated the test to check for `apps/${name}/app/app.vue` which is the
correct path for Nuxt v4's app directory structure.
2025-11-28 12:19:04 +04:00
Jack Hsu 363457c2a8 fix(nuxt): do not import base eslint config for root project (#33642)
If you generate a standalone/root project then there's no
`eslint.config.mjs` to import from base.

<img width="1269" height="355" alt="image"
src="https://github.com/user-attachments/assets/b9658f08-48ff-48e7-bab8-fcd7ff5c349a"
/>
2025-11-27 14:52:19 -05:00
Jack Hsu 49fc6d54ff chore(misc): fix e2e tests for CNW + Nuxt 2025-11-27 14:01:20 -05:00
Caleb Ukle 5071217c30 docs(nx-dev): powerpack docs cleanup/deprecations (#33635)
closes: DOC-338

---------

Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2025-11-27 12:10:47 -05:00
Leosvel Pérez Espinosa 21783402b7 fix(core): kill child process tree in different running tasks (#33636)
## Current Behavior

When Nx commands finish or receive termination signals (SIGINT, SIGTERM,
SIGHUP), child processes spawned by continuous tasks (such as `nx
serve`) can remain orphaned in certain scenarios. This happens because
only the direct child process is killed using `childProcess.kill()`,
leaving grandchild processes running.

## Expected Behavior

When Nx terminates, all processes in the spawned process tree should be
properly terminated and no orphaned processes should remain.

## Related Issue(s)

Fixes #32438
Fixes #33460 

## Changes

- Updated signal handlers in `RunningNodeProcess` to use `this.kill()`
instead of `this.childProcess.kill()`, leveraging the existing
`tree-kill` implementation
- Added `tree-kill` to `NodeChildProcessWithNonDirectOutput` and
`NodeChildProcessWithDirectOutput` kill methods to ensure entire process
trees are terminated
2025-11-27 11:53:47 -05:00
Jack Hsu c08e83c73d chore(repo): remove hack that enables legacy peer deps so we can catch errors (#33634)
We missed a peer dep error in the Nuxt 4 PR since CI allowed install to
go through, but in a real repo it would have failed.

We _may_ need to still have the `prefer-frozen-lockfile=false` option,
but let's let CI run with this first.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-27 09:57:55 -05:00
Benjamin Cabanes 9fecf1416a docs(nx-dev): rename "Nx Enterprise" to "Enterprise" (#33641)
Rename "Nx Enterprise" to "Enterprise" across UI Header components.
2025-11-27 09:54:19 -05:00
Colum Ferry a0581d717f feat(nuxt): support nuxt v4 (#33611)
## Current Behavior
We currently do not support Nuxt 4. We still generate Nuxt 3.

## Expected Behavior
Support Nuxt 4.
New workspaces will get Nuxt 4.
Existing Workspaces that use Nuxt 3 intentionally will continue to use
Nuxt 3.
Add a migration to update users to Nuxt 4
Handle ESLint flat config

## Related Issue(s)

Closes NXC-3525
Closes NXC-3497

---------

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>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-27 09:17:29 -05:00
Colum Ferry f87e20fe75 fix(linter): base eslint config should ignore out-tsc directories (#33639)
## Current Behavior
The base `eslint` config will ignore `**/dist` but not `**/out-tsc`.
This can cause issues if lint is run after a `typecheck` which has
placed `.d.ts` files into an `out-tsc` directory.

## Expected Behavior
Base eslint config should ignore `**/out-tsc`

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-27 13:50:15 +00:00
Colum Ferry 25b8550adc feat(storybook): support storybook 10.1 (#33637)
## Current Behavior
Storybook support is not explicitly set to 10.1 which has just been
released.

## Expected Behavior
Explicitly set storybook version to 10.1 to ensure support for Angular
21

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-27 13:13:26 +00:00
Jack Hsu 3558a4cdfe docs(testing): update atomizer documentation for Vite and Vitest plugins (#33620)
## Current Behavior

The atomizer/task splitting documentation for Vite and Vitest was
incomplete:
- The @nx/vite/plugin introduction page was missing the dual
configuration example for both E2E and unit tests
- The @nx/vitest introduction page was missing all atomizer-related
sections (splitting E2E tests, ciTargetName, ciGroupName)
- The split-e2e-tasks feature page only referenced @nx/vite for Vitest,
not the dedicated @nx/vitest plugin
- The @nx/vitest docs had incorrect option name (targetName instead of
testTargetName)

## Expected Behavior

- @nx/vitest introduction page now have complete atomizer documentation
- The split-e2e-tasks page now references both @nx/vitest and @nx/vite
options for Vitest users
- Configuration examples use the correct option names matching the
actual plugin interfaces
- Users can easily find how to configure task splitting for Vitest
whether they use @nx/vite or @nx/vitest
---

Affected pages:
-
https://deploy-preview-33620--nx-docs.netlify.app/docs/features/ci-features/split-e2e-tasks#update-an-existing-project-to-use-automated-task-splitting
-
https://deploy-preview-33620--nx-docs.netlify.app/docs/technologies/build-tools/vite/introduction
-
https://deploy-preview-33620--nx-docs.netlify.app/docs/technologies/test-tools/vitest/introduction

Closes DOC-346

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-26 09:49:56 -05:00
Jack Hsu e3a4233cfe chore(repo): add Node 24 to e2e nightly matrix (#33542)
- E2E nightly tests only run on Node 20 and 22.
- E2E nightly tests now also run on Node 24, 22, and 20 for linux. For
Windows and Mac run only 24.

Did a test run from this branch, and Node 24 passes where other versions
pass, and fails where other versions fail. It shouldn't make any golden
tests fail just due to Node 24, but it's possible that things will flake
more since the matrix has expanded. We just have to make them more
robust.

<img width="920" height="1089" alt="image"
src="https://github.com/user-attachments/assets/90ee4d04-68d5-4d0d-9729-60cacfbc99db"
/>


Close NXC-3491
2025-11-26 09:43:08 -05:00
Colum Ferry 1ecbd8082c fix(nextjs): make migration to next 16 optional (#33627)
## Current Behavior
The Next 16 AI Migration Instructions are always created, regardless of
existing Next version

## Expected Behavior
Make the Next 16 Migration optional

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-26 14:22:46 +00:00
Jack Hsu b6958b3e88 docs(linter): add custom workspace eslint rules guide (#33618)
There is no documentation on how to create and use custom ESLint rules
in Nx workspaces.

Users can follow a guide to create custom ESLint rules using either:
1. Package Manager Workspaces (npm/yarn/pnpm/bun) - create a dedicated
ESLint plugin package that's symlinked via the package manager
2. `loadWorkspaceRules` utility from `@nx/eslint-plugin` - load rules
from any directory with automatic TypeScript transpilation

The guide includes:
- Comparison table for choosing the right approach
- Step-by-step instructions for both approaches
- TypeScript execution options (build first, Node.js native support,
tsx)
- Rule testing with `@typescript-eslint/rule-tester`
- Best practices and troubleshooting tips

Page:
https://deploy-preview-33618--nx-docs.netlify.app/docs/technologies/eslint/guides/custom-workspace-rules

Closes DOC-339

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: jaysoo <jaysoo@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-11-26 09:20:25 -05:00
Colum Ferry 00e4c0c69a feat(vite): add vitest 4 migration for users using @nx/vite (#33630)
## Current Behavior
Despite @nx/vite depending on @nx/vitest it only does so in the same
version that introduces the migration for Vitest 4.
This means the user does not get any migrations for Vitest 4

## Expected Behavior
Add the Vitest 4 migrations to the @nx/vite package to allow users to
migrate.
2025-11-26 14:05:19 +00:00
Jack Hsu 017ad93d35 fix(bundling): replace rollup-plugin-copy with nx copy assets plugin (#33601)
There's a problem when `@nx/rollup` is installed with yarn@1.22, and
typechecks.

This is caused by the transitive dependency chain:

```
rollup-plugin-copy@3.5.0 -> globby@10.0.1 -> @types/glob@7.2.0 -> @types/minimatch
```

When users run tsc without explicit `types` configuration, TypeScript
auto-discovers `@types/minimatch` from `node_modules` but can't properly
resolve it.

Note: This doesn't happen with NPM and PNPM, nor newer yarn versions.

Verified fix with this repro: https://github.com/jaysoo/rollup-251124

Fixes #32398

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: jaysoo <jaysoo@users.noreply.github.com>
2025-11-26 08:55:46 -05:00
Philip Fulcher 081bec53cf docs(nx-dev): add 22.1 article and changlog (#33617)
https://nx-dev-git-philip-nx22-1-article-nrwl.vercel.app/blog/nx-22-1-release
2025-11-25 18:42:57 -05:00
Jack Hsu 67059ccf10 docs(storybook): update Storybook docs for version 10 (#33619)
## Current Behavior
- Storybook generator docs banner says "Nx uses Storybook 7"
- Separate storybook-9-setup.mdoc page exists
- No documentation for migrate-10 generator

## Expected Behavior
- Update banner to "Nx uses Storybook 10"
- Consolidate storybook-9-setup into upgrading-storybook guide
- Add migrate-10-generator-examples.md with AI-assisted migration docs
- Update all references to point to new consolidated guide

---

Main content is here:
https://deploy-preview-33619--nx-docs.netlify.app/docs/technologies/test-tools/storybook/guides/upgrading-storybook

Need to follow-up on the sidebar ordering as it doesn't seem to take it
into account for technologies section.

Fixes DOC-347
2025-11-25 18:42:05 -05:00
Colum Ferry 098d3ed9c9 fix(storybook): remove upper bound of migration requires (#33613)
## Current Behavior
The upper bound of the requires is too restrictive and causing issues

## Expected Behavior
Remove the upper bound
2025-11-25 18:41:10 -05:00
Jason Jean 9eb254c964 chore(repo): update nx to 22.2.0-beta.0 (#33614)
Updating Nx from 22.1.0-rc.5 to 22.2.0-beta.0

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-25 17:11:12 -05:00
Leosvel Pérez Espinosa 7e00ec431f fix(core): propagate continuous task failures to dependent tasks (#33492)
## Current Behavior

When a continuous task depends on another continuous task and the
dependent task exits with an error, the parent task continues running
indefinitely. The task execution never terminates, leaving processes
running in the background.

For example, if task `a` (continuous) depends on task `b` (continuous),
and task `b` exits with error code 1, task `a` will continue running
even though its dependency failed.

## Expected Behavior

When a continuous task exits (with any exit code), the failure should be
propagated to dependent tasks:

1. The failed continuous task should be marked as failed
2. Dependent continuous tasks should be marked as skipped
3. All affected continuous tasks should be killed
4. Task execution should terminate with an error

---

## Changes Made

### 1. Restore Error Handling in Continuous Task Exit Handlers

- Re-added the `cleaningUp` flag that was removed in a previous
TUI-related commit
- Modified `onExit` handlers for both regular and shared continuous
tasks to:
  - Check if the task exited during normal cleanup vs. unexpectedly
  - Call `complete()` with 'failure' status for unexpected exits
  - Log error messages for debugging

### 2. Fix `cleanUpUnneededContinuousTasks()` Logic

The previous implementation always added `initializingTaskIds` to the
needed set, even when those tasks were already completed. This prevented
dependency tasks from being killed when the top-level task exited.

Fixed by:

- Only adding tasks from `initializingTaskIds` if they are still
incomplete
- Keeping dependencies of incomplete tasks alive
- This ensures continuous tasks are killed when no longer needed,
whether a dependency fails or a top-level task exits

### 3. Prevent Status Overwrites

Added a check in `onExit` handlers to only set status to `Stopped` if
the task hasn't already been completed. This prevents the async `onExit`
callback from overwriting the correct status (like 'skipped' or
'failure') with 'Stopped'.

### 4. Fix Signal Handling in `PseudoTtyProcess.kill()`

The Rust pseudo-terminal defaults to SIGINT when no signal is provided,
which does not reliably terminate child processes in PTY sessions.

Fixed by:

- Defaulting to SIGTERM in the JavaScript wrapper (rather than changing
the Rust default)
- The JS wrapper is the API boundary that should match Node.js
semantics, where `childProcess.kill(undefined)` defaults to SIGTERM
- The Rust default of SIGINT is appropriate for interactive use
(Ctrl-C), while programmatic cleanup needs SIGTERM
- This ensures child processes are properly killed when
`runningTask.kill()` is called

**File:** `packages/nx/src/tasks-runner/pseudo-terminal.ts`

## Technical Details

The fix leverages the existing task failure propagation mechanism in
`complete()` instead of using `process.exit(1)`, which:

- Allows proper cleanup through normal execution flow
- Respects the `--bail` flag configuration
- Works correctly with both TUI and non-TUI modes
- Maintains consistency with how other task failures are handled
2025-11-25 09:49:11 -05:00
MaxKless 80322f921f fix(core): use nx-mcp for older nx versions instead of nx mcp (#33553)
<!-- 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
Older versions don't support the `nx mcp` command yet - but they CAN use
the `nx-mcp` package via npx

## Expected Behavior
We generatee the proper command into their MCP config by matching on
their version

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

Fixes #
2025-11-25 09:47:20 -05:00
Jason Jean 71470480bb feat(core): add multiple Nx version detection to nx report (#33599)
## Current Behavior

When multiple versions of the `nx` package are installed in a workspace
(e.g., due to a third-party package incorrectly depending on nx), users
have no visibility into
  this issue through `nx report`.

  ## Expected Behavior

The `nx report` command now detects when other packages depend on a
different version of nx than the workspace version and reports this
clearly:

  ⚠️ Multiple Nx versions detected

Your workspace uses nx@20.0.0, but other packages depend on a different
version:
  - some-package → @scope/tool → nx@19.0.0

These packages should not have nx as a dependency. Please report this
issue to the package maintainers.
  Run pnpm why nx@19.0.0 for more details.

This helps users identify and report problematic packages that bundle
their own version of nx.

  ## Related Issue(s)

N/A - This is a proactive improvement to help users diagnose workspace
issues.
2025-11-25 09:41:53 -05:00
MaxKless 7e51d85b1b cleanup(gradle): fix nightly e2e test where verbose was being called (#33610)
<!-- 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
nightly tests fail on gradle because of gradle parsing

## Expected Behavior
nightly tests should pass
2025-11-25 09:35:30 -05:00
Colum Ferry 1eea5edb50 feat(nextjs): add migration to add AI instructions for upgrading to Next 16 (#33608)
## Current Behavior
We do not generate AI Instructions to aid with upgrading from Next 15 to
Next 16

## Expected Behavior
Add a migration generator to create a file containing instructions for
an LLM to upgrade Next 15 to Next 16

## Related Issue(s)

Closes NXC-3418

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-11-25 13:33:03 +00:00
Colum Ferry cac7f6c3e8 fix(node): set generatePackageJson:false for TS Solution workspaces (#33606)
## Current Behavior
In TS Solution setups, we generate webpack config with
`generatePackageJson: true`. This is confusing and unneeded.
It should be set to false in TS Solution repos.

## Expected Behavior
Set `generatePackageJson: false` in webpack config for TS Solution
Setups


Closes NXC-3521
2025-11-25 08:13:22 -05:00
Kasper Christensen 3c5e40be68 fix(nest): set moduleResolution to node to prevent TS5095 error (#33607)
When generating NestJS applications in Angular workspaces, the base
tsconfig sets moduleResolution to 'bundler' which causes TS5095 errors
because 'bundler' requires module to be 'preserve' or 'es2015+'.

NestJS applications should use Node.js module resolution instead. This
fix sets moduleResolution to 'node' for NestJS applications (except when
using TS solution setup, which uses 'nodenext').

Fixes #33589
2025-11-25 12:23:25 +00:00
Colum Ferry 6c2b3ee37d fix(release): ensure emoji is not repeated in breaking changes summary (#33605)
## Current Behavior
The ⚠️ emoji at the beginning of bc commits is duplicated in the bc
section of the changelog.
This is unneeded.

## Expected Behavior
Ensure the ⚠️ is not repeated in the bc section of the changelog

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-25 11:14:48 +00:00
Chau Tran d70c888a93 fix(graph): surface task graph client error via error toast (#33600)
Close NXC-3516

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

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

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

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

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

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

Fixes #
2025-11-25 09:12:40 +01:00
Jason Jean f31bef701a fix(core): make daemon socket path unique per process to prevent race condition (#33580)
## Current Behavior

1. **Socket Race Condition**: All daemon servers listen on the same
socket path, causing a race condition where shutting down daemons remove
sockets that newly started
  daemons are listening on.

2. **Daemon Console Check Blocks**: The daemon availability check runs
synchronously and blocks the main thread.

3. **Version Mismatch Issues**: Packages using a different nx version
than what's installed in the workspace could still use the daemon,
leading to potential issues.

  ## Expected Behavior

1. Each daemon server creates a unique socket path based on its process
ID, preventing race conditions.

  2. The daemon console check runs in the background without blocking.

3. The daemon is disabled when there's a version mismatch between the
running nx and the workspace's installed version.

  ## Changes

  ### 1. Unique Daemon Socket Paths
- Include `process.pid` in the socket directory hash to make each
daemon's path unique
- Store the socket path in `server-process.json` so clients know where
to connect
  - Clients read the socket path from the file instead of calculating it

  ### 2. Backgroundable Daemon Check
- Reapplied #33491 which makes the Nx Console install check run on the
daemon in the background
- This was previously reverted due to the socket race condition (now
fixed by change 1.)
- Running in background also allows pulling the latest check logic from
npm

  ### 3. Version Mismatch Check
  - Added `isNxVersionMismatch()` check in `DaemonClient.enabled()`
- Created shared utility `is-nx-version-mismatch.ts` for version
comparison
  - Refactored server.ts to use the shared utility
- Uses `require.resolve('nx/package.json', { paths: [workspaceRoot] })`
to properly resolve the workspace's installed nx version

  ## Related Issue(s)

Fixes daemon socket path race condition and improves daemon reliability.
2025-11-24 23:45:28 +00:00
Philip Fulcher 12f42ca798 chore(nx-dev): remove november webinar (#33598) 2025-11-24 16:17:39 -05:00
Colum Ferry 70bbbe9ff6 fix(js): ensure copy-workspace-modules copies transitive workspace dependencies (#33570)
## Current Behavior
`copy-workspace-modules` executor only copies workspace dependencies 1
level deep.
If that workspace library depends on another workspace library, it is
not copied correctly.

## Expected Behavior
Copy transitive workspace modules

## Related Issue(s)

Fixes NXC-3466
2025-11-24 09:16:37 -05:00
Jack Hsu b7cfee16e2 fix(testing): remove declare global wrapper from cypress commands.ts template (#33573)
When adding Cypress to a library, the generated commands.ts causes
TS2669 error because declare global requires the file to be a module.
Changed to use declare namespace Cypress directly.

Fixes #32930
2025-11-24 08:35:51 -05:00
Juri 8fcef1e81a docs(misc): fix listing of oxlint community plugin 2025-11-24 10:46:48 +01:00
Laney Pouzet 5fd57badb9 fix(core): filter out automated release commits in getCommitsRelevantToProjects (#33482) 2025-11-23 16:19:51 +04:00
Jason Jean 626fb0873e Revert "feat(core): make console daemon check backgroundable and pull… (#33578)
## Current Behavior
PR #33491 introduced a daemon call into every command and caused
unexpected issues...

  ## Expected Behavior
the change is reverted while we investigate a proper fix

  ## Changes
This reverts commit 9471207767 from PR
#33491.

  ## Related Issue(s)
  Fixes #33472
2025-11-21 23:14:11 +00:00
Austin Fahsl 68eee382dc docs(nx-cloud): use GitHub's default ref in manual DTE workflow (#33575)
## Current Behavior

The manual DTE workflow explicitly sets the `ref` parameter to `${{
github.event.pull_request.head.sha }}` to checkout the actual branch
HEAD instead of the merge commit.

## Expected Behavior

Use GitHub's default ref behavior instead of explicitly overriding it,
as the default behavior now handles this correctly.

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-21 14:47:52 -07:00
Jack Hsu 8750521b32 fix(react): exclude tailwind from CSS modules syntax in component generator (#33574)
## Current Behavior
When generating a React component with --style=tailwind, the component
template incorrectly includes `className={styles['container']}` and
attempts to import CSS modules.

## Expected Behavior
Components generated with --style=tailwind should not include CSS
modules imports or `styles['container']` references, since Tailwind
doesn't use CSS modules.

## Related Issue(s)
Closes NXC-3511

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-21 16:18:30 -05:00
Jason Jean 9a6c7adddf feat(nx-cloud): prepend nx version to stats metadata (#33568)
<!-- 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 -->

Stats don't come along with versions which makes it hard to see if it
was specific changes that make a difference.

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

Stats are tagged with the version so we can compare stats between
versions

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

Fixes #

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-21 12:19:58 -05:00
Jack Hsu 57f28bac5e fix(storybook): remove STORYBOOK_PROJECT_ROOT when running automigrate to prevent hanging (#33567)
This PR fixes an issue where migrations can hang due to out invocation
of `storybook automigrate`. We are passing both `--config-dir` and
`STORYBOOK_PROJECT_ROOT`, the latter causes hanging with Storybook v9.

https://www.loom.com/share/39bbb350595c4a13aef86ec29f4b748f

## Current Behavior
Hangs

## Expected Behavior
Does not hang

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

Fixes #32492
2025-11-21 11:34:29 -05:00
Jack Hsu 1c8796a4d7 docs(misc): update migration docs to use supported markdown syntax (#33563)
This PR cleans up the markdown files under `packages/`. We previously
had to support Next.js docs and translate it for astro docs with proper
markdown syntax. This applies to generators, executors, and migrations.

Also removes the function to do the translation in astro app since it's
no longer needed.

## Code block (migrations)
<img width="1086" height="800" alt="Screenshot 2025-11-20 at 1 23 53 PM"
src="https://github.com/user-attachments/assets/bd9acb9b-7960-4e41-9d26-22d29da6658e"
/>

## Aside (generators)
<img width="802" height="443" alt="Screenshot 2025-11-20 at 1 43 17 PM"
src="https://github.com/user-attachments/assets/e2999821-8783-46ed-a984-2193f6f8eafa"
/>
2025-11-21 09:25:34 -05:00
Craigory Coppola 1eecf46e4a fix(core): provide error when nested graph construction would occur invoked during createNodes (#33541)
## Current Behavior
During createNodes, if a file is imported and a function in said file
invokes the Nx project graph creation process, there's an infinite loop
that results in all nx commands hanging with little feedback.
Theoretically this loop would terminate at around the 10 minute mark,
but throughout the loop we would be digging deeper and deeper into
recursive territory so its possible that the node process could become
overwhelmed and hang.

## Expected Behavior
If recursive graph creation is detected, Nx terminates and logs the call
stack so it can be investigated properly.

## Related Issue(s)

Fixes #29618

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: AgentEnder <AgentEnder@users.noreply.github.com>
2025-11-21 01:37:19 -05:00
Jack Hsu 239a4dbb2d feat(linter): add util to load eslint rules from a directory (#33543)
This PR adds the ability for users to import ESLint rules from arbitrary
location in the workspace rather than storing them in
`tools/eslint-rules`. This is useful for monorepo not using
npm/yarn/pnpm workspaces and need a mechanism to load from any custom
rules location without them being installed/symlinked.

It also handles TS files automatically.

Demo: https://www.loom.com/share/3c32af4555614eeab4f81fce8db0c955

Example:

```js
import baseConfig from "../../eslint.config.mjs";
import { loadWorkspaceRules } from "@nx/eslint-plugin";

const customRules = await loadWorkspaceRules("foo/bar/eslint-rules");

export default [
  ...baseConfig,
  {
    ignores: ["**/out-tsc"],
  },
  {
    files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
    plugins: {
      custom: { rules: customRules },
    },
    rules: {
      "custom/valid-command-object": "error",
    },
  },
];
```

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2025-11-20 17:16:03 -05:00
Craigory Coppola 9f7414e32a fix(core): daemon command should exit at end (#33547)
## Current Behavior
Daemon command hangs at end instead of exiting

## Expected Behavior
Daemon command exits

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

Fixes #
2025-11-20 16:54:32 -05:00
Craigory Coppola 236177b8a3 chore(repo): fixup some issues with jest config (#33549)
## Current Behavior
There's some issues with the jest configs in the repo, CJS files having
`import` in them, etc.

## Expected Behavior
CJS files don't have `import`

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

Fixes #
2025-11-20 16:49:18 -05:00
Craigory Coppola 0e500dc64f fix(core): don't presume a task is long running if its marked cacheable (#33545)
## Current Behavior
`cache: true` is overridden if task name is dev

## Expected Behavior
`cache: true` has priority

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

Fixes #32610

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-20 16:48:28 -05:00
MaxKless aa38b256a7 fix(graph): align exclude flag with others by using findMatchingProjects (#33550) 2025-11-19 18:18:51 -05:00
Jack Hsu 618c3344af fix(vite): generate .mts config files to force ESM (#33518)
Using .mts extension forces files to always be treated as ESM modules,
ensuring consistent behavior regardless of package.json or tsconfig
settings.

This matters for Node 24 because by default Node will strip types from
`.ts` files and then they are resolved through normal Node resolution.
In the past we can control CJS/ESM through tsconfig options, but now
only extension or `type` in `package.json` matters.

Changes:
- Updated all createOrEditViteConfig calls to pass useEsmExtension: true
- Updated normalizeViteConfigFilePathWithTree to check for .mts files
first
- Updated test files to expect .mts config files
- Updated snapshots to reflect new .mts extension

Closes NXC-3446
2025-11-19 16:49:25 -05:00
Jack Hsu 05bd3a4c16 fix(linter): handle various flat config override structures (#33548)
Flat config overrides util may fail when it isn't a plain JS object.
This PR makes the `hasOverrides` function more robust against these
cases.


Fixes #31796
2025-11-19 16:40:46 -05:00
MaxKless 3401c7ec78 cleanup(gradle): fix gradle dsl e2e test in verbose mode (#33546)
<!-- 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 JSON parsing is broken because in verbose mode, the gradle plugin
returns more than just JSON.

## Expected Behavior
JSON parsing in the test should work

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

Fixes #
2025-11-19 14:59:07 -05:00
Colum Ferry 7b9970f499 fix(release): ensure file change calculation matches nx affected #33413 (#33539)
## Current Behavior
We naively mark WholeFileChange for commits when getting the relevant
commits for projects.
There is already logic to perform better diff checking for lock files,
especially in the case of pnpm catalog usage

## Expected Behavior
Reuse existing logic to determine file changes more accurately

## Related Issue(s)

Fixes #33413
2025-11-19 17:35:09 +00:00
Craigory Coppola 219e82d4cd fix(core): default input should indeed be default (#33533)
<!-- 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

If no inputs or named inputs are defined, this area of code was hit:

```
const DEFAULT_INPUTS: ReadonlyArray<InputDefinition> = [
  {
    fileset: '{projectRoot}/**/*',
  },
  {
    dependencies: true,
    input: 'default',
  },
];

export function getNamedInputs(
  nxJson: NxJsonConfiguration,
  project: ProjectGraphProjectNode
) {
  return {
    default: [{ fileset: '{projectRoot}/**/*' }],
    ...nxJson.namedInputs,
    ...project.data.namedInputs,
  };
}
```

This resulted in weird behavior when the user would define `default` in
named inputs, but it would seemingly only be applied to the project's
deps and not the project itself

## Expected Behavior
The `default` input is the default for both

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

Fixes #https://github.com/nrwl/nx/issues/32924
2025-11-19 10:28:58 -05:00
Craigory Coppola f5c876b82e fix(core): avoid leaking memory due by creating an unref'd interval for each daemon connection (#33532)
## Current Behavior
Every time a daemon connection is opened, we create a new interval and
unref it. This results in the daemon checking its process termination at
an ever increasing rate, which presents as increased memory usage and
practically means the daemon is just doing a lot more work than it needs
to in this area.

## Expected Behavior
The interval is registered only on initial server startup.

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

Fixes #29836
2025-11-19 10:28:30 -05:00
Jack Hsu 6b56665857 docs(js): update dual format guide with correct types and hint to check arethetypeswrong tool (#33531)
This PR updates the guide here to also include type entries (which we
generate by default):
https://nx.dev/docs/technologies/typescript/guides/compile-multiple-formats

Update the content to account for the new inferred `@nx/rollup/plugin`
setup, but still mentions the executor. And also link to a tool that can
be used to check for types correctness.

Closes #33258

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: jaysoo <jaysoo@users.noreply.github.com>
2025-11-18 18:22:41 -05:00
Caleb Ukle f5915fa165 docs(nx-cloud): update private registry example script (#33528) 2025-11-18 23:14:42 +00:00
Caleb Ukle e418217dde fix(nx-dev): error out when failing to parse plugin manifests (#33498)
if there is an error parsing a schema file for generators/executors then
we should fully error out to prevent caching a "bad" build even if the
site techincally works with missing plugin info.
2025-11-18 16:19:54 -06:00
Jason Jean 3206c35fb2 chore(repo): re-enable metrics collection (#33508)
## Current Behavior

Metrics collection is currently disabled in the CI workflow via the
`NX_CLOUD_ENABLE_METRICS_COLLECTION` environment variable set to
'false'.

## Expected Behavior

Metrics collection should be enabled to gather build and performance
data from CI runs.

## Related Issue(s)

Reverts the change from #33497

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-18 13:36:49 -05:00
Rares Matei 40b99940f9 chore(repo): use recommended pnpm cache location (#33529)
This also fixes pnpm caching on the nx repo.
2025-11-18 18:07:20 +00:00
Caleb Ukle 0d84a6788f docs(webpack): update externalDependencies comment to correct reflect the defalt value (#33461)
default is not 'none' is now 'all'

https://github.com/nrwl/nx/blob/master/packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-base-config.ts#L53
2025-11-18 17:57:46 +00:00
Leosvel Pérez Espinosa 6b3b0c679b fix(js): sync external references to project's tsconfig.json file if it includes any files (#33524)
## Current Behavior

The `@nx/js:typescript-sync` generator never syncs external project
references to `tsconfig.json` files if a runtime tsconfig file exists.

## Expected Behavior

The `@nx/js:typescript-sync` generator should sync external project
references to `tsconfig.json` files if it includes any files or a
runtime tsconfig file doesn't exist.
2025-11-18 14:24:43 +01:00
Jason Jean 2dc4cb53ac chore(repo): update nx to 22.1.0-rc.5 (#33519)
Updating Nx from 22.1.0-rc.3 to 22.1.0-rc.5

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-17 19:49:59 -05:00
Jason Jean 41dec8ee78 fix(core): resolve all lock ordering deadlocks in metrics collector (#33513)
## Summary
This PR fixes a critical deadlock issue in the metrics collector that
occurred due to inconsistent lock acquisition order between the
collection thread and registration threads. The fix involved
restructuring lock scopes across multiple functions to maintain a
consistent lock hierarchy.

## Changes
- Fixed lock acquisition order in 4 registration functions
(register_main_cli_process, register_main_cli_subprocess,
register_task_process, register_batch)
- Restructured collect_metrics() to minimize system lock scope and
release it before acquiring other locks
- Fixed collection helper methods to read PIDs in scoped blocks without
holding system lock
- Added comprehensive trace logging for debugging lock contentions
- Added concurrent test case to verify no deadlocks occur under stress

## Testing
- All 12 metrics tests pass
- Comprehensive concurrent stress test added:
test_concurrent_group_creation_with_subprocess_updates
- Lock ordering consistency test added:
test_lock_order_consistency_across_registration_threads

## Lock Ordering Rule
Established and enforced this hierarchy across all threads:
1. Acquire system lock first
2. Release system lock
3. Then acquire registration/PID locks

This prevents circular wait conditions (A→B / B→A) that cause deadlocks.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2025-11-17 17:02:52 -05:00
Benjamin Cabanes 02e5c4af8e docs(nx-dev): add click event to header navigation links (#33516)
Added `sendCustomEvent` calls to track clicks on primary header and
mobile header navigation links.
2025-11-17 15:38:20 -05:00
Jack Hsu ed3ddebde5 fix(storybook): normalize version range before comparison (#33515)
When Storybook is installed with a version range like `^10.0.0` or
`~8.5.3`, the configuration generator fails with error:
```
NX   Invalid Version: ^10.0.0
TypeError: Invalid Version: ^10.0.0
```

This occurs because `gte()` from semver doesn't accept version ranges on
the left-hand side - only valid semver versions are allowed there.

The Storybook configuration generator should work with version ranges by
extracting the actual version number before comparison.

Fixes #33514
2025-11-17 14:55:30 -05:00
Jack Hsu e8576a8bb2 docs(angular): update dynamic module federation to use enhanced modules (#33512)
This updates the MF dynamic remotes docs for Angular to match new setup.

Closes DOC-327
2025-11-17 13:48:10 -05:00
Miroslav Jonaš 4bfc1e8e29 feat(core): apply parent env to atomized target (#33013)
<!-- 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
Env variables from the parent target are not propagated to the atomized
target e.g.
`.test-ci.env` will be only applied to **no-op** `test-ci` but not to
`test-ci--path/to/test/file`.

## Expected Behavior
Running an atomized target will load from the parent's env files.

## 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>
2025-11-17 17:30:07 +01:00
Nas3nmann 961e2379fe chore(core): nx plugin submission nx-oxlint 2025-11-17 17:10:10 +01:00
MaxKless de8a0205fd feat(gradle): allow specifying project and task configuration from gradle build files (#33264)
## Current Behavior 
Gradle projects in Nx workspaces can only configure metadata through
Gradle's built-in mechanisms. There's no way to specify Nx-specific
project metadata (like tags) or customize task target configurations
other than overriding with `project.json`

 ## Expected Behavior

Developers can now configure Nx-specific metadata for both projects and
tasks using a type-safe Kotlin/Groovy DSL:

 ### Project-level metadata (in build.gradle.kts):
  ```
nx {
    set("name", "my-service")
    array("tags", "scope:backend", "type:api")
    set("description", "Payment processing service")
  }
```

 ### Task-level metadata (in build.gradle.kts):
```
  tasks.named("integrationTest") {
    nx {
      set("cache", false)
      array("tags", "integration", "slow")
    }
  }
```

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: MaxKless <MaxKless@users.noreply.github.com>
2025-11-17 10:44:46 -05:00
Craigory Coppola d86fb5d244 fix(core): prevent hanging between command end and process exit (#33500)
## Current Behavior

In certain scenarios, Nx commands would hang between command completion
and process exit. This was caused by inefficient message end detection
in the
daemon socket communication, where the check for `MESSAGE_END_SEQ` could
fail when TCP packets were fragmented.

  ## Expected Behavior

With this PR, the message end detection is more robust and handles TCP
packet fragmentation correctly, preventing the hanging issue. The
changes also
add better performance tracking and logging to help diagnose similar
issues in the future.

  ## Changes Made

- **Improved message end detection**
(`consume-messages-from-socket.ts`): Added a preliminary check of the
last character's code point before checking
the full MESSAGE_END_SEQ, which prevents false negatives when TCP
packets are fragmented
- **Enhanced performance tracking** (`daemon/client/client.ts`,
`daemon-socket-messenger.ts`): Added message-type-specific performance
marks and
  measures for better debugging
- **Added server-side logging** (`daemon/server/server.ts`): Added
logging for message receipt, serialization, and response to help
diagnose
  communication issues

  ## Related Issue(s)

This fix addresses hanging issues observed in daemon communication when
commands complete but the process doesn't exit.
2025-11-17 09:57:34 -05:00
Colum Ferry b96b8e32e3 feat(docker): add skipDefaultTag option to build target (#33477) (#33506)
Add a skipDefaultTag option to the DockerTargetOptions interface that
allows users to opt out of the automatic default tag that is prepended
to build targets.

This is useful for multi-platform builds that need to push during build
(e.g., using --platform linux/amd64,linux/arm64 --push), where the
default tag causes build failures because it attempts to push a tag that
was not configured.

- Add skipDefaultTag?: boolean to DockerTargetOptions interface
- Modify buildTargetOptions to conditionally skip default tag when
skipDefaultTag is true
- Inherit skipDefaultTag from parent target in configurations
- Add comprehensive unit tests for skipDefaultTag functionality
- Add e2e test to verify skipDefaultTag works end-to-end
- Maintains backward compatibility (default behavior unchanged when
option not specified)

Fixes #33477
2025-11-17 09:55:31 -05:00
Jason Jean f54364eb67 chore(repo): update nx to 22.1.0-rc.3 (#33496)
Updating Nx from 22.1.0-rc.2 to 22.1.0-rc.3

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
2025-11-15 11:29:32 -05:00
Craigory Coppola c1b942fd1c fix(core): include require paths when resolving specified plugins (#33495)
## Current Behavior
Loading local plugins that are relative paths from workspace root, that
point to a JS file, still require preliminary data from default plugins
despite being resolvable. This is because we aren't passing `paths` to
`require.resolve`, so it is trying to resolve relative to the nx package
instead of the workspace.

## Expected Behavior
The straight JS path resolves

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

Fixes #
2025-11-14 21:27:26 -05:00
Philip Fulcher a9def426a1 docs(nx-dev): add monorepo myths article (#32944)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-11-14 16:35:05 -05:00
Chau Tran a1dcd09172 chore(repo): disable metrics collection (#33497)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #
2025-11-14 16:09:16 -05:00
Jason Jean b3e6b03d82 chore(core): restructure metrics collector for performance and maintainability (#33483)
## Current Behavior

The metrics collector has several inefficiencies and architectural
issues:
- Complex hierarchical data structure (`ProcessTreeMetrics`) that
doesn't align with how the data is consumed
- Separate `MetadataStore` struct with unnecessary indirection
- Full metadata resent to all subscribers on every collection cycle
- Mutable parameters passed through collection functions instead of
functional return values
- Repeated allocations and clones across collection cycles
- `CollectionRunner` tightly coupled to NAPI, making it untestable in
pure Rust

## Expected Behavior

This PR restructures the metrics collector for better performance,
testability, and maintainability:

### Architectural Changes

1. **Flat Process Model**: Replaced hierarchical `ProcessTreeMetrics`
with a flat `Vec<ProcessMetrics>`, simplifying data flow

2. **Group-Based Organization**: Introduced `GroupInfo` and `GroupType`
to logically organize processes:
   - `MainCLI` - Nx CLI process and its subprocesses
   - `Daemon` - Nx daemon and its children
   - `Task` - Individual task execution processes
   - `Batch` - Batch execution with multiple tasks

3. **Incremental Metadata Updates**:
- Track which groups and processes have been sent using
`Arc<DashMap<String, GroupInfo>>` and `Arc<DashMap<String,
ProcessMetadata>>`
- Only send new metadata to subscribers instead of full state every
cycle
- New subscribers receive full metadata on first update via
`needs_full_metadata` flag
   - Automatic cleanup of dead process/group metadata

4. **Shared State with Arc**:
- Metadata maps shared between `ProcessMetricsCollector` and
`CollectionRunner` using `Arc<DashMap>`
   - Eliminated duplicate metadata storage
   - Single source of truth for all metadata

5. **Functional Programming Pattern**:
- Collection functions now return `Result<MetricsCollectionResult>`
instead of mutating parameters
   - Cleaner error handling with `inspect_err` and `map`
   - Easier to reason about data flow
   - Removed ~100 lines of code by consolidating logic

6. **Channel-Based Communication**:
   - Decoupled `CollectionRunner` from NAPI using `crossbeam_channel`
   - Collection thread sends metrics via channel to listener thread
   - Listener thread receives metrics and notifies NAPI subscribers
   - `CollectionRunner` is now NAPI-free and fully testable in pure Rust
- Non-blocking collection (subscriber callbacks don't block metrics
collection)

### Performance Optimizations

- Pre-allocated `Vec` capacity when combining metrics from different
sources
- Eliminated unnecessary `HashMap` clones during metadata updates
- Single-pass insertion into `DashMap` during string key conversion
- Reduced memory allocations in hot paths
- Collection thread never blocks on JavaScript callbacks

### Code Quality Improvements

- **Testability**: Added 7 pure Rust unit tests for `CollectionRunner`:
  - Group creation with different registration types
  - Incremental metadata updates
  - Dead group cleanup
  - All tests pass without requiring NAPI/Node.js runtime
- Clearer separation of concerns between collection and notification
- Better comments explaining incremental update strategy
- More idiomatic Rust patterns throughout
- Updated TypeScript type exports to match new structure

### Threading Model

**Before:**
```
CollectionRunner (mixed collection + NAPI notification)
```

**After:**
```
CollectionRunner (pure Rust, testable)
  └─> Channel
      └─> Listener Thread
          └─> NAPI ThreadsafeFunction
              └─> Subscribers
```

## Testing

-  241 Rust tests passing (including 7 new `CollectionRunner` tests)
-  Native module builds successfully
-  TypeScript types updated and exports verified

## Related Issue(s)

Part of ongoing metrics collector optimization work.
2025-11-14 16:56:51 +00:00
MaxKless 9471207767 feat(core): make console daemon check backgroundable and pulling from latest (#33491)
## Current Behavior
The Nx Console install check for the prompt happens in the main process,
adding some overhead to each invocation of nx.

## Expected Behavior
We want this check to happen on the daemon so that it's running in the
background. If it's still running when nx is invoked, we can just skip
the prompt since it's non-critical.
Running it in the background also allows us to pull the latest version
of the logic from npm when executing - that way we can keep the logic
older versions up-to-date even when ppl don't migrate to latest.
2025-11-14 16:14:13 +00:00
Jason Jean 7fd2cb4e3b chore(maven): bump Maven plugin version to 0.0.10 (#33485)
## Current Behavior

The Maven plugin is currently at version 0.0.9.

## Expected Behavior

This PR bumps the Maven plugin to version 0.0.10 and creates the
necessary migration for users to automatically update their pom.xml
files.

## Related Issue(s)

N/A - Routine version bump
2025-11-14 10:59:05 -05:00
MaxKless 2088eaaf22 fix(maven): skip maven plugin computation on vercel/netlify (#33486)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #
2025-11-14 09:28:59 -05:00
Jack Hsu 001e2ba4bb fix(misc): handle ERR_USE_AFTER_CLOSE gracefully in nx init and create-nx-workspace (#33469)
https://www.loom.com/share/560ceccdad45462e9fd3e3f185fc9fa5

Node 24 has stricter readline behavior, and enquirer is not checking for
closed state when invoking operations, resulting in an
ERR_USE_AFTER_CLOSE error when users press Ctrl+C during interactive
prompts.

This commit fixes the issue by adding uncaughtException handler to
ignore ERR_USE_AFTER_CLOSE errors.

When users press Ctrl+C, the process now exits cleanly without showing
an ugly error stack trace.

Fixes NXC-3412

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-14 09:28:50 -05:00
Nicole Oliver 1ef2614519 docs(nx-cloud): remove references to standalone powerpack (#33471)
Updates the Nx Powerpack docs and marketing page to make it clear that
Powerpack packages are included with Nx Enterprise, and cannot be
purchased separately, and remove references to the Nx Powerpack trial.

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

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Caleb Ukle <caleb@nrwl.io>
2025-11-13 14:37:40 -08:00
Jack Hsu 54f6206f1b docs(js): clarify non-buildable libs can be in devDependencies for TS… (#33481)
The recipe for switching to TS project references states "If you
reference a local library project with its own `build` task" which
caused confusion. Users thought only buildable libraries should be
included in devDependencies, leading them to create unnecessary path
aliases for non-buildable libraries.

Closes DOC-149

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-13 17:29:34 -05:00
Jason Jean 20653ab15a chore(misc): record stat for initial invocation of create-nx-workspace (#33480)
## Current Behavior
Currently, telemetry stats are only recorded when `create-nx-workspace`
completes successfully. This doesn't capture how many times the command
is invoked vs completed.

## Expected Behavior
Record a stat when `create-nx-workspace` is first invoked (before any
prompts), enabling analysis of drop-off between initial invocation and
workspace completion.

## Changes Made

### Telemetry
- Added `recordStat()` call in `normalizeArgsMiddleware()` immediately
after welcome message and before any user prompts
- Records with command name `create-nx-workspace` and metadata
`['start']` to distinguish from completion stat
- Allows correlation of invocation and completion events for drop-off
analysis

### AI Agents Prompt
- This is being temporarily disabled because we noticed a dip in
create-nx-workspace completions that lines up when this was released.
Disabling it temporarily to see if the dip is recovered by disabling the
prompt.

### React Framework Selection
- Added early returns in `determineReactFramework()` for cases where
framework is already provided or interactive mode is disabled
- Improves performance by avoiding unnecessary prompt interactions

### Code Quality
- Reorganized imports in alphabetical order for better maintainability
- Removed unused import (`printSocialInformation`)

## Related Issue(s)
WIP - Draft for discussion
2025-11-13 20:16:58 +00:00
Louie Weng 0014ae66d8 fix(gradle): bump gradle migration version (#33479)
Ensure that we bump up Nx plugin for Gradle version to 0.1.9 when going
from 22.1.0-rc.3
2025-11-13 10:43:09 -08:00
Jack Hsu 4e3f475f63 fix(vite): support vitest v4 (#33478)
This PR ports the vitest v4 logic back to `@nx/vite` even though users
should be using `@nx/vitest`, we still support it until v23. Otherwise
running `@nx/vite:configuration --includeVitest` will always fail.

Generator working:
https://www.loom.com/share/246c401e114348818b998e0abed8754e
Suppressing warning:
https://www.loom.com/share/f769507de6684d4e9cb720cdc277e56a
2025-11-13 12:44:17 -05:00
Jason Jean 76c030a82e fix(core): capture stderr in nx add command for better error messages (#33462)
## Current Behavior

When `nx add @nx/s3-cache` fails due to incompatible peer dependencies
or other installation errors, users see only a generic error message
without the actual error details from the package manager.

## Expected Behavior

The command should display complete error messages from the package
manager (both stdout and stderr), including peer dependency conflicts
and other important diagnostic information.

## Changes

Fixed the exec callback in the `installPackage` function to:
1. Capture the `stderr` parameter (was previously ignored)
2. Log both stdout and stderr with a newline separator for clarity
3. Ensure users see all error information from package managers

## Why It Matters

Package managers write installation errors and peer dependency warnings
to stderr. By ignoring stderr, users had no visibility into what
actually failed, making it difficult to diagnose and fix issues.

Fixes issue with `nx add` not showing proper error messages.
2025-11-13 09:25:42 -05:00
Jason Jean 50cf84f758 chore(repo): update nx to 22.1.0-rc.2 (#33464)
Updating Nx from 22.1.0-beta.8 to 22.1.0-rc.2
2025-11-13 08:53:58 -05:00
Rares Matei 37cbdee1a2 docs(nx-cloud): recommend set sha action in manual dte (#33476)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

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

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

Fixes #
2025-11-13 14:38:28 +01:00
Jason Jean 455891eaf5 fix(js): skip TS project references migration for non-TS-solution workspaces (#33467)
## Current Behavior

The `remove-redundant-ts-project-references` migration fails with an
error when run on workspaces that don't have a root `tsconfig.json`
file, such as nx-examples.

## Expected Behavior

The migration should skip workspaces that are not using TypeScript
solution setup instead of throwing an error.

## Related Issue(s)

Fixes the issue encountered when running the migration on
nrwl/nx-examples repo.

## Changes

- Added check to skip migration if workspace is not using TS solution
setup
- Updated test setup to properly configure TS solution for existing
tests
- Added new test cases to verify skip behavior

The migration now uses `isUsingTsSolutionSetup()` to detect if:
- `tsconfig.base.json` exists
- `tsconfig.json` exists and extends the base
- Package manager workspaces are configured
- Proper TS solution structure is in place

Workspaces missing any of these requirements will have the migration
skip silently.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-12 22:58:31 +00:00
Jack Hsu 1997d950af docs(misc): replace Java cup logo with Duke mascot (#33466)
Use Duke logo rather than the cup logo. Also fix an alignment issue for
sidebar icons.

<img width="1352" height="707" alt="image"
src="https://github.com/user-attachments/assets/dff634e8-3b51-48c6-bbdb-7898e671e118"
/>

<img width="1067" height="596" alt="image"
src="https://github.com/user-attachments/assets/3c2075fd-8577-4a99-bb6b-66f901dd8f1e"
/>


Closes DOC-297

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-12 16:37:14 -05:00
Jason Jean 26df170c54 chore(js): update migration version to 22.1.0-rc.1 (#33465)
## Current Behavior

The migration for removing redundant TypeScript project references is
set to version `22.1.0-beta.8`.

## Expected Behavior

The migration should be updated to version `22.1.0-rc.1` to align with
the release candidate version.

## Related Issue(s)

N/A - Version update as requested.
2025-11-12 20:17:27 +00:00
Leosvel Pérez Espinosa 36b9f7ab32 fix(js): remove redundant typescript project references (#33438)
## Current Behavior

The `@nx/js:typescript-sync` generator adds project dependencies as
TypeScript project references to each project's `tsconfig.json` and
runtime tsconfig file (e.g., `tsconfig.app.json`, `tsconfig.lib.json`,
etc.). This is redundant since projects' `tsconfig.json` files already
reference the runtime tsconfig file, which would reference the
dependencies.

## Expected Behavior

The `@nx/js:typescript-sync` generator should add project dependencies
as TypeScript project references to each project's runtime tsconfig file
(e.g., `tsconfig.app.json`, `tsconfig.lib.json`, etc.). If the project
only has a `tsconfig.json` file, it should add them to it.

We've observed some performance improvement with this change while
running the `typecheck` tasks.
2025-11-12 17:48:26 +00:00
Jason Jean 5c565ad37f fix(core): optimize batch task scheduling to prevent redundant traversals (#33455)
## Summary

This PR combines two critical performance optimizations for batch task
scheduling and task hashing:

### 1. Batch Scheduling Fix

Fixed a correctness bug in the batch scheduling optimization where the
`visitedInBatch` tracking happened too early. Now tasks are only marked
as visited AFTER all scheduling checks pass, ensuring tasks can be added
to the batch from any valid dependency path.

**Files Modified:**
- `packages/nx/src/tasks-runner/tasks-schedule.ts`

**Impact:**
- Prevents task splitting across unnecessary batch boundaries
- Maintains correctness while optimizing performance
- All batch scheduling tests pass

### 2. Task Output Hashing Optimization

Added a DashMap-based cache to the Rust TaskHasher to prevent redundant
hashing when multiple tasks depend on the same outputs.

**Files Modified:**
- `packages/nx/src/native/tasks/task_hasher.rs` - Added
task_output_cache field
- `packages/nx/src/native/tasks/hashers/hash_task_output.rs` - Implement
cache logic

## Root Cause of Issue #33366

Large project graphs with high dependency fanout exhibit slow
`hashMultipleTasks` because:
- 100+ tasks may depend on the same 10 build tasks' outputs  
- This generates 1,000+ separate `TaskOutput` hash instructions
- Each instruction independently:
  - Lists output files from disk (filesystem I/O)
  - Builds glob patterns
  - Hashes the same files
- Result: Same files hashed 100× redundantly

## Solution: Task Output Cache

The cache key combines glob pattern and sorted output paths. When
identical outputs are hashed with the same pattern:
- First task: computes hash (~milliseconds) and stores in cache
- Remaining 99 tasks: cache hits (~nanoseconds each)

### Cache Lifetime
- `TaskHasher` instantiated once per `hashMultipleTasks` call
- Cache persists for entire hashing session
- Discarded when `hashMultipleTasks` completes
- Optimal scope for cache hit maximization

## Performance Impact

**Expected Improvements:**
- Best case (100 tasks, 10 shared deps): 100× speedup
- Typical monorepo: 10-20× speedup
- No shared deps: No regression (cache lookup negligible)

**Issue #33366 Analysis:**
- Current: `Time for 'hashMultipleTasks' 49351.488518` (49 seconds)
- Expected with optimization: ~5-10 seconds (depending on actual
dependency structure)

## Testing

-  All task scheduling tests pass (2262 passed, 0 new failures)
-  Batch mode tests pass (6/6)
-  Native build completed successfully
-  No regressions in existing functionality

## Design Notes

- Task output cache follows same pattern as `workspace_files_cache`,
`external_cache`, `runtime_cache`
- Thread-safe using DashMap with Arc for Rayon parallel processing
- Instrumented with trace-level logging for cache hits/misses
- Cache automatically cleaned up when TaskHasher is dropped
2025-11-12 12:08:18 -05:00
Leosvel Pérez Espinosa ba893a13b0 cleanup(angular): handle ng-packagr changes to browserslist (#33457)
Updates the `ng-packagr` executors to support a breaking change in v21.
This needs to be done in advance because we use the published
`@nx/angular` executors to build the `@nx/angular` source code. To
update to Angular v21, we need this change to be merged, released, and
installed in the Nx repository so that we can build the `@nx/angular`
package containing the support for Angular v21.
2025-11-12 10:44:41 -05:00
Leosvel Pérez Espinosa 19dbf55206 fix(core): remove system metrics collection and reporting (#33456)
Removes system metrics collection and reporting.
2025-11-12 09:55:09 -05:00
Jack Hsu 3d48b75202 feat(core): export TypeScript schema definitions via wildcard patterns (#33454)
Users cannot import TypeScript schema definitions or schema.json files
from Nx packages due to strict package exports introduced in Nx 21.0.0.

Users can now import both TypeScript definitions and JSON schemas from
generator/executor/builder paths using wildcard export patterns. Both
first-level (`*`) and second-level (`*/*`) patterns are supported to
handle different import depths.

Note: For old plugins that had `src/...` deep imports we keep those in
`exports`, but for newer plugins that always used `exports` we skip
`src/` in the export path. So `@nx/nuxt/generators` instead of
`@nx/nuxt/src/generators`.

Fixes #33336
2025-11-12 09:43:12 -05:00
MaxKless 26a7e4fca7 feat(core): pull nx init from latest before executing (#33446)
## Current Behavior
nx init is executed with whatever version is installed globally by npm
(might be outdated)

## Expected Behavior
we pull down the latest version from npm (if it has provenance) and run
that when executing.
Also introduced a new `NX_USE_LOCAL` env var that will be respected by
all commands that have this pulling-from-latest behaviour.
2025-11-12 12:01:37 +01:00
Benjamin Cabanes 7ca6680e03 docs(nx-dev): add Pricing link to Nx Cloud navigation menus (#33452)
Added a "Pricing" link to the Nx Cloud navigation sections.
2025-11-11 20:11:11 +00:00
Jack Hsu 5fa1c18dea chore(repo): bump to Node 24 (#33441)
Update CI to Node 24. Note that the e2e-release changes are pulled from
the original PR.

Note: There are changes to NPM 11 (Node 24) to make it run slower than
NPM 10 (Node 20/22) for publish. (https://github.com/nrwl/nx/pull/31934)

e.g. https://github.com/npm/cli/releases/tag/v11.0.0-pre.1 (`Upon
publishing, in order to apply a default "latest" dist tag, the command
now retrieves all prior versions of the package.` which incurs more
network cost)
2025-11-11 15:10:09 -05:00
Jason Jean 647d75116b chore(repo): update nx to 22.1.0-beta.8 (#33451)
Updating Nx from 22.1.0-beta.7 to 22.1.0-beta.8
2025-11-11 14:26:09 -05:00
Jason Jean 12422ae3ea fix(graph): add nx:build-native dependency to typecheck target (#33428)
## Current Behavior

The typecheck target in graph/client/project.json only depends on
^typecheck targets from other projects.

## Expected Behavior

The typecheck target now includes nx:build-native as a dependency to
ensure native dependencies are built before type checking.

## Related Issue(s)

This fix resolves typecheck failures caused by missing native
dependencies.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
2025-11-11 13:38:11 -05:00
Philip Fulcher db09e106e9 docs(nx-dev): add video link to task analytics article (#33450) 2025-11-11 12:20:24 -06:00
MaxKless ab7db78b04 feat(maven): add option to prefix all maven targets (#33420)
## Current Behavior
there is no way to generally influence how maven goals/phases are
represented as targets in nx. This could be useful though for organizing
targets in nx, for example through nx.json `targetDefaults`

## Expected Behavior
There's a `targetNamePrefix` plugin option that can be passed.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: MaxKless <MaxKless@users.noreply.github.com>
2025-11-11 13:16:01 -05:00
Jason Jean 6121a12368 chore(repo): update nx to 22.1.0-beta.7 (#33431)
Updating Nx from 22.1.0-beta.6 to 22.1.0-beta.7
2025-11-11 17:07:01 +00:00
Leosvel Pérez Espinosa 8f3b0b22a7 fix(core): resolve lockfile cache regression with keyMap state (#33448)
After PR #33256 split lockfile parsing into separate node and dependency
caches, a regression occurred where dependencies could be regenerated
without nodes, leaving a shared module-level variable (`keyMap`) empty
and causing incorrect dependency resolution.

Changes:
- Serialize `keyMap` with nodes cache to maintain state between phases
- Remove module-level shared state from pnpm, npm, and yarn parsers
- Move `keyMap` creation inside `getNodes` functions for better
encapsulation
- Update `readCachedExternalNodes` to deserialize `keyMap` internally
2025-11-11 16:52:05 +00:00
Jack Hsu 3c85af93af chore(misc): upgrade macOS GitHub Actions runners (#33444)
Update from the macos-13 is in brownout and will be gone soon.

- macos-15-intel for x86_64-apple-darwin (Intel) builds
- macos-latest for aarch64-apple-darwin (ARM64) builds

Closes NXC-3444
2025-11-11 11:51:49 -05:00
Colum Ferry 00a247be3f feat(vitest): support vitest 4 (#33424)
## Current Behavior
We currently only generate vitest projects using Vitest 3

## Expected Behavior
Use Vitest 4 when generating new projects

## Related Issue(s)

Closes NXC-3343
Closes NXC-3379

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-11-11 10:20:14 -05:00
Leosvel Pérez Espinosa 6d0523e326 fix(core): clean up dead processes from metrics (#33437)
Fixes a regression where dead processes were not being cleaned up from
the metrics reporting.
2025-11-11 09:53:37 -05:00
James Henry 3439ff10e7 feat(release): add resolveVersionPlans option to changelog CLI and API (#33435) 2025-11-11 18:53:14 +04:00
Nicole Oliver 806e9a83af docs(nx-cloud): clarify Github integration details (#33433)
Clarifies some details of the Nx Cloud GitHub integration, such as which
features are available when you use the base integration vs a GitHub
powered organization.

<!-- 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` -->
2025-11-11 09:33:43 -05:00
Colum Ferry 4509d95b3b fix(release): changelog renderer should render commit title with breaking changes (#33439)
## Current Behavior
We do not render the commit title in the BC section of generated
changelogs.

## Expected Behavior
We should render the commit title in the BC section of generated
changelogs along with the Remote Release Client reference to the commit.

## Related Issue(s)

Closes NXC-3290
2025-11-11 13:20:46 +00:00
Colum Ferry 9513a1f89c fix(vitest): do not fail when cleanedAngularVersion is of incorrect type (#33436)
## Current Behavior
There may be a scenario when `cleanedAngularVersion` is of type `object`
rather than `string` which proceeds to error when passed to
`semver.major()`.

## Expected Behavior
If `cleanedAngularVersion` is not `string`, assume the latest version
will be installed. Similar to how no found angular version is handled.

## Related Issue(s)

Fixes #33347
2025-11-11 11:25:33 +00:00
Leosvel Pérez Espinosa 843c041396 fix(js): improve typescript plugin performance (#33425)
- Fix for a bug with the external project references cache
- Add more caching for repeated operations
- Skip tsconfig files processing based on which targets should be
inferred

Fixes #33076
2025-11-11 10:04:43 +01:00
Jason Jean 93e0b21d97 fix(js): update vitest generator import in library generator (#33430)
## Current Behavior
The library generator has an unused import and incorrect import pattern
for the vitest generator.

## Expected Behavior
Clean imports with the correct way to access the configurationGenerator
from @nx/vitest.

## Changes
- Removed unused imports (logger, readJson)
- Updated vitest generator import to use direct require instead of
ensurePackage pattern for accessing the generator

Fixes #
2025-11-10 22:31:21 +00:00
Jack Hsu 98b2ab42e6 chore(repo): force storybook@9 so types resolve (#33429)
Master has v9 in lockfile, but it's not a guarantee. This forces v9
until we have a better solution to resolve v10 types.
2025-11-10 16:47:16 -05:00
Colum Ferry 6b54d6acf6 fix(storybook): remove optional nature of migration (#33427)
## Current Behavior
The Storybook 10 migration was originally intended to be optional.

## Expected Behavior
Make Storybook 10 migration add the migration generator to
migrations.json always. Users can remove it from here if they do not
want it, or they can use the Migrate UI from Nx Console to choose not to
run it.
2025-11-10 20:11:43 +00:00
Jason Jean 73ecb30491 chore(repo): update nx to 22.1.0-beta.6 (#33423)
Updating Nx from 22.1.0-beta.5 to 22.1.0-beta.6
2025-11-10 19:11:25 +00:00
Colum Ferry e581c3c437 feat(vitest): split entrypoint into plugin, generators, executors (#33426)
Split entry point of `@nx/vitest` into `index.ts` for the Inference
Plugin, `generators.ts` for Generators, `executors.ts` for the
Executors.
Ensure the `README.md` is copied to the correct output directory

---------

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>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-10 18:29:37 +00:00
Colum Ferry 685e497c4f feat(vitest): split vitest into @nx/vitest plugin (#33311)
Split `vitest` out of `@nx/vite` and create a new `@nx/vitest`.

This allows for each plugin to have a single responsibility. One for
bundling, one for testing.

It should allow for lighter setups where Vite for Bundling is not
required, but users still want to use vitest for testing.

---------

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>
Co-authored-by: Coly010 <Coly010@users.noreply.github.com>
2025-11-10 16:22:47 +00:00
Jason Jean 7a3179241e chore(repo): update storybook (#33422)
<!-- 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 -->

Storybook was accidentally downgraded to 9.1.9

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

Storybook is upgraded back to 10.0

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

Fixes #
2025-11-10 10:51:17 -05:00
Leosvel Pérez Espinosa 22618b6be9 feat(testing): support cypress v15 (#33393)
## Current Behavior

Cypress v15 is not supported.

## Expected Behavior

Cypress v15 should be supported.

## Related Issue(s)

Fixes #33304

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: leosvelperez <leosvelperez@users.noreply.github.com>
2025-11-10 10:50:50 -05:00
Jack Hsu 60089cc998 chore(expo): run export before e2e to mitigate timeout (#33414)
CI and nightlies can flake out during expo test if cypress or playwright
times out waiting for webserver. This makes is to the `export` that
powers `static-serve` is run before running e2e.

This is not usually a problem in new workspaces with inference, but this
legacy test uses executors so continuous task dependency isn't set up.
2025-11-10 10:19:57 -05:00
Louie Weng a0a3289112 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 #
2025-11-10 09:53:48 -05:00
Leosvel Pérez Espinosa 373066a379 feat(core): track system metrics and link plugins to workers when possible (#33411)
- Track relevant CPU and memory system metrics.
- Link plugins to workers when possible.
- Refactor collector code by splitting it into two separate structs.
2025-11-07 23:29:36 +00:00
Caleb Ukle 7458b52b4e 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>
2025-11-07 16:10:30 -05:00
Jack Hsu 4170c2f82b docs(js): update node compat matrix (#33415)
Update it for v22.
2025-11-07 16:10:03 -05:00
Caleb Ukle 2182cea451 cleanup(repo): use mise for agent toolchain installs (#33299)
also dedupe agent launch templates with yaml anchors for better
readability
2025-11-07 14:01:48 -06:00
Philip Fulcher 777217618e 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
2025-11-07 13:37:39 -06:00
Jason Jean 746b89a901 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
2025-11-07 13:07:36 -05:00
MaxKless b395cec4cd feat(maven): add ci-workflow generator (#33346)
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2025-11-07 16:21:15 +00:00
James Henry a6948665e6 fix(core): correctly identify local workspace dependencies on windows (#33408) 2025-11-07 15:08:45 +04:00
Philip Fulcher 790358af91 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>
2025-11-06 14:13:29 -06:00
MaxKless e9146c7862 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",
]
```
2025-11-06 13:42:07 -05:00
Jack Hsu 62d0ad7f25 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.
2025-11-06 13:36:44 -05:00
Leosvel Pérez Espinosa e470b2c64a 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.
2025-11-06 13:25:07 -05:00
Louie Weng 28e778a1f9 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 #
2025-11-06 13:20:06 -05:00
Jason Jean 61442118cf 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"`.
2025-11-06 11:56:14 -05:00
Jack Hsu 9b5768e7fe 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>
2025-11-06 10:25:39 -05:00
MaxKless cde5ee8c83 docs(misc): add information about nx console debug logging (#33398) 2025-11-06 15:42:01 +01:00
Colum Ferry f2072f01f2 feat(storybook): generate ai instructions for converting from CJS to ESM after migration (#33395)
## Current Behavior
Storybook 10 Changelog states that CJS is no longer supported.
The migration does not do this automatically.

https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#the-storybookmain-file-and-other-presets-must-be-valid-esm

## Expected Behavior
Generate instructions for an AI Agent to find and convert CJS Storybook
Config files to ESM.

## Related Issue(s)

Fixes NXC-3409
Fixes NXC-3336
2025-11-06 14:28:18 +00:00
Juri 2e5844c61b docs(module-federation): change terminal output to shell frame 2025-11-06 14:52:17 +01:00
Juri 58cbbf20bd docs(nx-dev): link nx 22 release video 2025-11-06 14:51:56 +01:00
Jack Hsu 603e7c0bb6 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>
2025-11-06 08:43:56 -05:00
Jack Hsu f5d97e3047 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
2025-11-06 08:43:26 -05:00
Juri a032099138 docs(dotnet): add paragraph about adding a .net app 2025-11-06 14:40:40 +01:00
Colum Ferry f549ef290f 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.
2025-11-06 10:36:10 +00:00
MaxKless a020954987 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`
2025-11-05 17:02:32 -05:00
Jason Jean cfcf109450 chore(repo): enable NX_CLOUD_ENABLE_METRICS_COLLECTION in CI (#33387)
Enables NX_CLOUD_ENABLE_METRICS_COLLECTION in the CI workflow.
2025-11-05 16:48:03 -05:00
Jason Jean ba6ca6c5ae 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
2025-11-05 15:40:45 -05:00
Leosvel Pérez Espinosa a98b524f06 feat(core): collect resource usage (#32946)
Adds resource usage collection while running tasks.
2025-11-05 18:56:12 +00:00
Colum Ferry f6bc122c0b feat(nextjs): add support for next 16 (#33296)
## Current Behavior
We currently support Next 14 and 15.

## Expected Behavior
Add support for Next 16, bringing support to 14, 15, 16.
Existing workspaces will continue to use the version they are on.
New workspaces will use Next 16.

Refer to Next 16 Migration Guide for migrating from Next 15 to 16

## Related Issue(s)

Fixes #33207

---------

Co-authored-by: Eric Büttner <eric.buettner@tuffz.com>
2025-11-05 17:31:31 +00:00
Craigory Coppola b97f666a4e 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.
2025-11-05 10:46:31 -05:00
Colum Ferry 1b7d0955a2 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
2025-11-05 10:41:28 -05:00
Jack Hsu bc47ab8ce9 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
2025-11-05 10:21:50 -05:00
Juri Strumpflohner 26aca9e5ec 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 #
2025-11-05 09:32:30 -05:00
Juri Strumpflohner 18557f8af4 docs(misc): various updates embedding videos in docs pages 2025-11-04 21:54:36 +01:00
Leosvel Pérez Espinosa c933660b88 cleanup(core): remove unused mouse event listeners from tui (#33368)
Cleans up unused mouse event listeners from the TUI.
2025-11-04 13:21:10 -05:00
MaxKless c2fba1f6fc cleanup(core): update the nx orb version used in circle ci generators (#33364) 2025-11-04 14:47:56 +00:00
Colum Ferry 83051c5c62 fix(vite): ensure createVitest looks only from projectRoot (#33361)
## Current Behavior
`createVitest` is looking at the full workspace every time. It should
only look at the directory with the config file.

## Expected Behavior
Pass the root as the projectRoot of the config file found.
2025-11-04 09:11:45 -05:00
Jason Jean 2d78f571b4 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
2025-11-03 17:56:26 -05:00
Jason Jean 4017b61ede 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.
2025-11-03 13:27:18 -05:00
Jason Jean 0acc8b0988 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
2025-11-03 13:27:06 -05:00
Colum Ferry a084f205f9 fix(vite): ensure atomizer does not consider projects outside the project root (#33344)
## Current Behavior
Vitest's `createVitest` can be over-eager and include other projects in
the workspace when finding relevant test specifications.
This leads atomizer to look at relative paths outside the project root.

## Expected Behavior
Ensure that the plugin does not look at projects outside the project
root.
2025-11-03 16:46:57 +00:00
Jason Jean 8cc052f351 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
2025-11-03 11:30:25 -05:00
Jason Jean d64f45879b 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.
2025-11-03 11:30:12 -05:00
Juri Strumpflohner 8f7c635894 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>
2025-11-03 11:25:03 -05:00
Jason Jean 7e0f66dbf3 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
2025-11-03 10:49:18 -05:00
Craigory Coppola b401e6e348 feat(core): enable tui by default on windows (#33314)
## Current Behavior:

Tui is working, but only able to be enabled on windows via env vars or
explicit command line config

## Expected Behavior:

Tui is default on
2025-11-03 09:56:26 -05:00
Craigory Coppola a5d34fd9f9 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 #
2025-11-01 13:30:41 -04:00
Colum Ferry 4507b5a03b feat(storybook): add support for storybook 10 (#33277)
## Current Behavior
We support Storybook 8 and 9


## Expected Behavior
Add support for Storybook 10, bringing Storybook support to 8, 9 and 10

## Related Issue(s)

Fixes #33141
2025-10-31 17:11:22 +00:00
Colum Ferry d7c8f6e772 chore(repo): add vitest scope (#33317) 2025-10-31 17:05:10 +04:00
Jason Jean 4fcdc9542e 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>
2025-10-30 18:17:48 -04:00
Craigory Coppola 29a61429a5 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>
2025-10-30 17:33:30 -04:00
Jack Hsu b28366395f 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>
2025-10-30 12:33:47 -04:00
Colum Ferry 4ec3a99544 chore(node): do not have assertions around killPorts (#33294) 2025-10-30 10:35:33 -04:00
Jack Hsu 9c326bb8e9 chore(repo): use vitest.config.mts to force ESM (#33310)
If it is resolved as CJS it may run into issues?
2025-10-30 10:34:26 -04:00
MaxKless 0347e67334 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 #
2025-10-30 10:33:14 -04:00
Copilot ad0b44f05f 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>
2025-10-30 10:05:00 -04:00
MaxKless ac8b58191a 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
2025-10-30 09:45:13 -04:00
MaxKless 56633a7b1b 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.
2025-10-30 09:10:50 -04:00
Eric Büttner 2f3b7d09b5 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)
2025-10-29 22:53:04 +00:00
Copilot 4a07faf15c 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>
2025-10-29 14:50:12 -04:00
Caleb Ukle 84b0debba8 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
2025-10-29 13:15:19 -05:00
Philip Fulcher b876ced24f docs(nx-dev): revise Nx 22 release article (#33287)
---------

Co-authored-by: Juri <juri.strumpflohner@gmail.com>
2025-10-29 11:59:59 -04:00
Philip Fulcher f52d58675a docs(nx-dev): remove webinar notifier for October webinar (#33295) 2025-10-29 10:06:29 -05:00
Ajit Panigrahi e56abcf517 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 #
2025-10-29 08:37:31 -05:00
Juri 6b95de3ede docs(nx-dev): add article about Storybook and watching buildable libs 2025-10-29 14:30:34 +01:00
Craigory Coppola 3e6e0681d0 chore(repo): remove files accidentally committed while investigating socket issues (#33284)
Some investigation files were accidentally included in a merge
2025-10-28 18:40:27 -04:00
Jason Jean e97b3fa0e3 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
2025-10-28 18:24:29 -04:00
Caleb Ukle 221ad580d8 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
2025-10-28 15:56:49 -04:00
MaxKless eb4281d7dd 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>
2025-10-28 19:34:07 +00:00
Leosvel Pérez Espinosa f76f1ce3df 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
2025-10-28 19:09:07 +00:00
Jason Jean 54a4eb4da7 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>
2025-10-28 14:04:53 -04:00
Craigory Coppola d1653eca05 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 #
2025-10-28 14:03:58 -04:00
Juri Strumpflohner 160b4cce34 feat(nx-dev): add downloadable resources page and React book blog post 2025-10-28 16:12:39 +01:00
Emilio Heinzmann 1089ffc41b 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).
2025-10-28 13:43:06 +00:00
James Henry f2649cbaa6 feat(vite): add atomizer support for vitest (#33265) 2025-10-28 15:52:34 +04:00
Juri 43a5e163ce docs(nx-cloud): self-healing CI classification customization 2025-10-27 21:44:12 +01:00
Jack Hsu 39df8c9b76 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"
/>
2025-10-27 15:58:15 -04:00
Louie Weng 29467dac05 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 #
2025-10-27 17:08:15 +00:00
Rares Matei 18b3c52a3c 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
2025-10-27 16:35:43 +00:00
Jack Hsu f36c61f530 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>
2025-10-27 12:31:56 -04:00
Craigory Coppola 98e510b47e 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>
2025-10-27 10:33:18 -04:00
Jack Hsu 514005a7c9 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
2025-10-27 10:27:38 -04:00
Craigory Coppola a52e7b0f6e 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>
2025-10-27 10:11:54 -04:00
Sander Boelhouwers 3f7119a821 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
2025-10-26 20:52:04 -04:00
Juri a082693838 docs(misc): add webinar banner to astro docs 2025-10-25 19:06:57 +02:00
Caleb Ukle 630d227a5f 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**
2025-10-24 19:48:48 -04:00
Jack Hsu 66a437a42a 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>
2025-10-24 16:08:49 -05:00
Philip Fulcher 7712d2a656 docs(nx-dev): update Nx 22 release article (#33245) 2025-10-24 13:35:31 -04:00
Louie Weng 215876c398 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
2025-10-24 17:14:33 +00:00
Craigory Coppola 7021056fae 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>
2025-10-24 16:56:40 +00:00
Jack Hsu 442f745b23 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
2025-10-24 12:53:57 -04:00
Benjamin Cabanes 7c978ed8c9 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>
2025-10-24 12:45:27 -04:00
Colum Ferry e57c8a71b2 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`
2025-10-24 17:36:49 +01:00
Hugo Burton 4a4b780685 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>
2025-10-24 12:31:31 -04:00
Jason Jean 1cf2c6665f 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`
2025-10-24 12:13:18 -04:00
Jason Jean 2f1712f894 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
2025-10-24 12:11:44 -04:00
Jason Jean 81fd8b4170 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.
2025-10-24 11:39:20 -04:00
Colum Ferry 3047fbda9e 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
2025-10-24 11:23:50 -04:00
Colum Ferry 09fb0b693a chore(repo): update codeowners for docker (#33240) 2025-10-24 15:45:13 +01:00
Leosvel Pérez Espinosa 6788fccbd6 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`).
2025-10-24 13:52:58 +00:00
Leosvel Pérez Espinosa f1fe6c0e24 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
2025-10-24 09:26:34 -04:00
Colum Ferry 54bd3c498f 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
2025-10-24 09:13:08 -04:00
Craigory Coppola fa45d79e55 chore(repo): remove check commit (#33227)
check-commit is superceded by the pr title target
2025-10-23 22:51:23 +00:00
Jason Jean b1a33ee608 feat(core): update rust (#33220)
## Current Behavior
Dependencies are outdated and Rust tooling needs to be updated.

## Expected Behavior
Rust dependencies are updated to their latest compatible versions.

## Changes
- Updated Rust dependencies
- Rebased with latest `origin/master`
- Updated pnpm lock file

## Related Issue(s)
None
2025-10-23 18:45:00 -04:00
Craigory Coppola b9af6a74b8 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>
2025-10-23 18:20:14 -04:00
Craigory Coppola c4f1f53b70 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 #
2025-10-23 17:27:22 -04:00
Craigory Coppola a4d9ad9c66 chore(gradle): format files (#33225) 2025-10-23 21:10:47 +00:00
Jack Hsu d3058a726f 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
2025-10-23 16:47:53 -04:00
Jack Hsu 97d38f75ee 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.
2025-10-23 16:47:46 -04:00
Craigory Coppola d717414ec2 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>
2025-10-23 20:41:38 +00:00
Chau Tran b59fb033b9 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"
/>
2025-10-23 15:27:45 -05:00
Caleb Ukle 4073537270 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
2025-10-23 16:22:20 -04:00
Philip Fulcher 59cf495fe1 docs(nx-dev): add nx 22 release article (#33219) 2025-10-23 19:09:10 +00:00
Colum Ferry 0a8272d7e7 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.
2025-10-23 14:48:47 -04:00
Jason Jean 500a4c92ee 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>
2025-10-23 14:04:48 -04:00
Emilio Heinzmann b2ba8c2770 feat(release): support {versionActionsVersion} in docker version scheme (#33178) 2025-10-23 21:00:47 +04:00
Colum Ferry 87c8d49b7e 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
2025-10-23 17:48:47 +01:00
Rares Matei 516db5c43d 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 #
2025-10-23 12:32:07 -04:00
MaxKless 44187bde41 fix(misc): add explanatory footer to ai agents prompts (#33182) 2025-10-23 18:08:39 +02:00
Craigory Coppola a8d6b0ad65 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.
2025-10-23 11:55:59 -04:00
Colum Ferry 1002ad5198 fix(node): migrate to koa 3.0.3 (#33208)
Update `koa` to `3.0.3`
2025-10-23 16:10:45 +01:00
Jack Hsu b3c3e40490 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>
2025-10-23 10:30:29 -04:00
James Henry ab82c7b1be 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>
2025-10-23 09:08:57 -04:00
James Henry 7c2f3511e2 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 #
2025-10-23 08:47:17 -04:00
Colum Ferry 2402ecb576 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>
2025-10-23 13:37:49 +01:00
James Henry 3847528d44 chore(repo): remove unused typedoc-theme (#33196)
Deletes the unused typedoc-theme project from the root of the workspace
2025-10-23 08:15:29 -04:00
James Henry b92df85b97 chore(repo): clean up images (#33197) 2025-10-23 15:55:12 +04:00
Craigory Coppola 083b97255a 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>
2025-10-22 18:29:37 -04:00
Jason Jean b9a0f36d5f fix(maven): add support for unbound goals in plugin targets (#33191)
## Current Behavior

Maven plugin targets are only created for goals explicitly bound to
executions in the POM. Goals defined in a plugin but not bound to any
execution are not available as Nx targets.

## Expected Behavior

All available Maven goals should be accessible as Nx targets, including:
- Goals bound to executions (existing behavior)
- Unbound goals defined in the plugin (new behavior)

## Changes Made

1. **Added unbound goal support**: The `NxTargetFactory` now creates
targets for goals defined in a plugin but not bound to any execution.
These targets are created with the format `goalPrefix:goalName` without
an execution ID.

2. **Added continuous build tracking**: 
- Added `continuous` property to `NxTarget` data class to track whether
a goal supports continuous builds
- Updated `MojoAnalyzer` to detect continuous goals from the cache
configuration
   - All targets now properly propagate continuous mode information

3. **Code improvements**:
   - Improved formatting and indentation for consistency
- Made `execution` parameter optional in `createSimpleGoalTarget` to
support both bound and unbound goals
   - Updated command generation to work with or without execution IDs

## Related Issue(s)

This change enables better Maven goal discovery and execution in Nx
monorepos.
2025-10-22 18:16:50 -04:00
Zachary DeRose 4fcd1d22b2 fix(core): adding output error reason (#33159)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

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

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

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

When an invalid output exists we report:

```
 NX   The following outputs are invalid: 

 - foo.txt

Run `nx repair` to fix this.
```

Without specifying the reason, we tell to run `nx repair`.

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

More feedback provided to the user as to the error with their output:

```
 NX   The following outputs are invalid: 

 - foo.txt
   ** Reason: Outputs must start with either "{workspaceRoot}/" or "{projectRoot}/".

Run `nx repair` to fix this.
```

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

Fixes #
2025-10-22 16:04:37 -04:00
Jack Hsu 681825e6be docs(dotnet): add experimental warning for @nx/dotnet (#33188)
Closes DOC-308
2025-10-22 14:36:17 -04:00
Jack Hsu 1c3434fc32 docs(misc): update GitLab project ID location in integration guide (#33186)
This PR updates the GitLab integration guide to reflect where `Copy
Project ID` is in the updated GitLab UI.
<img width="758" height="572" alt="image"
src="https://github.com/user-attachments/assets/ea400064-f3d4-4cd8-b5ba-a6b0bc884e81"
/>

## Related Issue(s)
Closes DOC-269
2025-10-22 12:32:45 -04:00
Jack Hsu ce2586aed8 docs(misc): fix bad line higlighting in docs (#33185)
This PR fixes some pages that don't use the proper markdoc syntax for
line lighting in code blocks. The `{% meta %}` tag is needed and it is
missing in some places.

Closes DOC-2790
2025-10-22 12:32:37 -04:00
James Henry 420091d9df fix(release): breaking change contents extraction (#33184) 2025-10-22 15:11:45 +00:00
Jason Jean cddb2ef2d0 fix(core): store reason when marking daemon as disabled (#33172)
## Current Behavior

When the daemon is disabled due to an error, the reason isn't captured,
making it harder to debug why the daemon was disabled.

## Expected Behavior

The error message/reason is now stored when marking the daemon as
disabled, allowing better visibility into what caused the daemon to be
disabled.

## Related Issue(s)
2025-10-22 10:40:36 -04:00
Andrew Ovens 28e681b99c fix(js): ensure node execute completes before exit (#32629)
Node tool executions (non-watch) were exiting before completing. This
change ensures they complete before exit.

closes #32385

<!-- 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
Node tool executions are not completing since #32356 

## Expected Behavior
Node tool executions complete before exit

## Related Issue(s)
#32385 

Fixes #32385
2025-10-22 15:01:23 +01:00
Colum Ferry c9d20c78f1 chore(repo): update daily canary releases schedule to 1 hour earlier (#33181)
Update canary release schedule to 1 hour earlier
2025-10-22 09:22:49 -04:00
Colum Ferry da88c80a7f fix(angular-rspack): bubble errors correctly (#33183)
## Current Behavior
When errors happen in earlier stages of compilation process, such as
processing global styles, these errors are not printed and the rspack
build process hangs at the Sealing phase.

## Expected Behavior
Ensure that errors that have occurred that would cause the process to
hang are printed and process exits correctly.

Part of this happens because the usual printing of errors happens in the
`afterDone` hook, which is never reached when the above occurs.

## Related Issue(s)

Fixes NXC-3268
2025-10-22 13:14:43 +01:00
Philip Fulcher 585a8ef1a9 docs(nx-dev): fixes for blog and webinar banner (#33179)
- **docs(nx-dev): update copy on webinar banner**
- **fix(nx-dev): handle missing profile links for blog authors**
2025-10-22 07:42:57 -04:00
MaxKless 03cde99faa chore(repo): drop unused and outdated nx-mcp hard dependency in package.json (#33180) 2025-10-22 13:04:23 +02:00
James Henry 8819dccb94 fix(release)!: better respect version plan file contents for changelog entries (#33166)
BREAKING CHANGE: config.conventionalCommitsConfig for `DefaultChangelogRenderer` is no longer nullable.
2025-10-22 09:27:35 +00:00
Jason Jean bbfd0a3c12 chore(repo): prevent readme templates from being published (#33177)
## Current Behavior
Readme template files are being published to npm with inconsistent
naming conventions.

## Expected Behavior
Readme template files should be excluded from npm publication and
consistently named as `readme-template.md`.

## Changes
- Renamed all readme template files to `readme-template.md` across
angular-rspack-compiler, angular-rspack, dotnet, and maven packages
- Updated .npmignore files to exclude readme-template.md from npm
publication
- Updated package.json build commands to reference the new
readme-template.md paths
- Removed `!README.md__tpl__` exceptions from package.json files array
entries
2025-10-21 23:11:24 -04:00
Caleb Ukle 3d8658cbcd docs(devkit): document the createNodes compat for Nx versions (#33102)
add new page for the createNodes api compat
add callouts to extending project graph and tooling plugin page

fixes DOC-255

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-10-21 19:08:34 -05:00
Caleb Ukle 8dacb26ea1 docs(core): correctly parse alias args with single dash (#33176)
@alberturria fixed this issue for the old docs as we migrated to astro,
so applied their change to the astro part of the docs as well. Original
PR: https://github.com/nrwl/nx/pull/33085
made sure to co-author alberturria as well

Thanks! 

![wm_2025-10-21T16-07-56@2x](https://github.com/user-attachments/assets/8bfb8a8c-d8eb-4892-8642-06c3c882e958)

Fixes #32723

Co-authored-by: alberturria <albertoherreravargas@gmail.com>
2025-10-21 23:32:09 +00:00
Colum Ferry 042915418c chore(repo): remove unused @rspack/plugin-minify from root (#33161)
Remove unused @rspack/plugin-minify from root package.json
2025-10-21 18:06:26 -04:00
Leosvel Pérez Espinosa c4b063d403 chore(repo): fix the pnpm caching in the main-macos job (#33162)
Fixes the pnpm caching setup for the `main-macos` job. It can currently
fail when the pnpm cache directory doesn't exist. We need to handle the
pnpm cache conditionally and separately from the node setup.
2025-10-21 21:21:55 +00:00
Jason Jean 10c64c804d chore(repo): update nx to 22.0.0-rc.0 (#33165)
Updating Nx from 22.0.0-beta.8 to 22.0.0-rc.0
2025-10-21 16:43:46 -04:00
Craigory Coppola 6934445fd9 fix(dotnet): fixup various issues + missing functionality (#33132)
…as testing projects<!-- 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
- Microsoft.Testing.Platform projects are not detected as having a test
target
- `serve` does not have an equivalent

## Expected Behavior
- Test projects are properly detected
- `serve` has been split into 2 targets:
  -  `watch`
  - `run`
  
The split of `serve` mirrors the`dotnet` cli in the same way that we
mirrored `vite` when adding `preview` and `dev` targets when we moved
with project crystal. `watch` can be used for a variety of cases, but
provides hot reload + run a 'la `dev` / `serve`. `run` is more of a fire
and forget target that starts up the app. Both targets would only really
be used in local dev.

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

Fixes #
…as testing projects

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-21 16:31:55 -04:00
1607 changed files with 49338 additions and 19929 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
+27 -11
View File
@@ -11,6 +11,7 @@ on:
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_ENABLE_METRICS_COLLECTION: 'true'
PNPM_HOME: ~/.pnpm
jobs:
@@ -46,7 +47,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: |
@@ -64,7 +65,7 @@ jobs:
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20
node-version: 24
cache: 'pnpm'
- name: Install Rust
@@ -104,7 +105,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 &
@@ -149,16 +150,10 @@ jobs:
run: git fetch origin master:master
if: ${{ github.event_name == 'pull_request' }}
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d # v4.1.0
name: Install pnpm
with:
version: 10.11.1
run_install: false
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20
cache: 'pnpm'
node-version: 24
package-manager-cache: false
- name: Set SHAs
uses: nrwl/nx-set-shas@1859e66a83ac9be0dceecbd9a023702e27ac47f4 # v4.3.3
@@ -294,6 +289,27 @@ jobs:
~/Library/Caches/Homebrew
key: nrwl-nx-homebrew-packages
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d # v4.1.0
if: steps.check-changes.outputs.has_changes == 'true'
name: Install pnpm
with:
version: 10.11.1
run_install: false
- name: Get pnpm store directory
if: steps.check-changes.outputs.has_changes == 'true'
id: pnpm-cache
run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm store
if: steps.check-changes.outputs.has_changes == 'true'
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ${{ steps.pnpm-cache.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Rust
if: steps.check-changes.outputs.has_changes == 'true'
uses: actions-rust-lang/setup-rust-toolchain@ac90e63697ac2784f4ecfe2964e1a285c304003a # v1
+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.
+9 -8
View File
@@ -28,19 +28,20 @@ jobs:
# - windows-latest Windows fails to build gradle wrapper which always runs when we build nx.
## https://staging.nx.app/runs/LgD4vxGn8w?utm_source=pull-request&utm_medium=comment
node_version:
# TODO(v23): remove node 20 - EOL April 2026
- 20
- 22
# - 23
- 24
exclude:
# run just node v20 on macos and windows
# run just node v24 on macos and windows
- os: macos-latest
node_version: 20
- os: macos-latest
node_version: 22
# - os: macos-latest
# node_version: 23
# - os: windows-latest TODO (emily): Windows fails to build gradle wrapper which always runs when we build nx. Re-enable when we fix this.
# node_version: 22
# - os: windows-latest TODO (emily): Windows fails to build gradle wrapper which always runs when we build nx. Re-enable when we fix this.
# node_version: 23
# - os: windows-latest TODO(Jack): Windows fails to build gradle wrapper which always runs when we build nx. Re-enable when we fix this.
# node_version: 20
# - os: windows-latest TODO (Jack): Windows fails to build gradle wrapper which always runs when we build nx. Re-enable when we fix this.
# node_version: 22
name: Cache install (${{ matrix.os }}, node v${{ matrix.node_version }})
steps:
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.19.0']
node-version: ['24']
steps:
- name: Checkout
@@ -19,7 +19,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: '20.19.0'
node-version: '24'
package-manager-cache: false
- name: Install pnpm
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: '20.19.0'
node-version: '24'
cache: 'pnpm'
- name: Cache node_modules
+8 -4
View File
@@ -67,6 +67,7 @@ const matrixData: MatrixData = {
{ name: 'e2e-storybook', codeowners: 'S04SVQ8H0G5' },
{ name: 'e2e-nuxt', codeowners: 'S04SJ6PL98X' }
],
// TODO(v23): remove node 20 - EOL April 2026
nodeTLS: 20,
setup: [
{
@@ -74,12 +75,15 @@ const matrixData: MatrixData = {
os_name: 'Linux',
os_timeout: 60,
package_managers: ['npm', 'pnpm', 'yarn'],
node_versions: ['20.19.0', '22.12.0'],
node_versions: ['20.19.0', '22.12.0', '24.0.0'],
excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo']
},
{ os: 'macos-latest', os_name: 'MacOS', os_timeout: 90, package_managers: ['npm'], node_versions: ['20.19.0'] }
// TODO (emily): Fix Windows support as gradle fails when running nx build https://staging.nx.app/runs/LgD4vxGn8w?utm_source=pull-request&utm_medium=comment
// { os: 'windows-latest', os_name: 'WinOS', os_timeout: 180, package_managers: ['npm'], node_versions: ['20.19.0'], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] }
// Docker is not supported on ARM-based macOS runners (no nested virtualization)
// See: https://github.com/docker/setup-docker-action and https://github.com/douglascamata/setup-docker-macos-action
// We may want to look into adding intel only for this docker case, at least until vm-in-vm works on latest macos
{ os: 'macos-latest', os_name: 'MacOS', os_timeout: 90, package_managers: ['npm'], node_versions: ['24.0.0'], excluded: ['e2e-docker'] }
// TODO (Jack): Fix Windows support as gradle fails when running nx build https://staging.nx.app/runs/LgD4vxGn8w?utm_source=pull-request&utm_medium=comment
// { os: 'windows-latest', os_name: 'WinOS', os_timeout: 180, package_managers: ['npm'], node_versions: ['24.0.0'], excluded: ['e2e-detox', 'e2e-react-native', 'e2e-expo'] }
]
};
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20
node-version: 24
package-manager-cache: false
- name: Validate PR title
+3 -3
View File
@@ -3,7 +3,7 @@ name: publish
on:
# Automated schedule - canary releases from master
schedule:
- cron: "0 20 * * 1-5" # Monday - Friday, at 20:00 UTC (8pm UTC)
- cron: "0 19 * * 1-5" # Monday - Friday, at 19:00 UTC (7pm UTC)
# Manual trigger - PR releases or dry-runs (based on workflow inputs)
workflow_dispatch:
inputs:
@@ -120,7 +120,7 @@ jobs:
fail-fast: false
matrix:
settings:
- host: macos-13
- host: macos-latest
target: x86_64-apple-darwin
setup: |-
rustup target add aarch64-apple-darwin
@@ -199,7 +199,7 @@ jobs:
rustup target add x86_64-unknown-linux-musl
pnpm nx run-many --verbose --target=build-native -- --target=x86_64-unknown-linux-musl
"
- host: macos-13
- host: macos-latest
target: aarch64-apple-darwin
setup: |-
rustup target add aarch64-apple-darwin
+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: ~/.local/share/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
+24 -2
View File
@@ -3,6 +3,27 @@ distribute-on:
assignment-rules:
- 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
- agent: linux-extra-large
parallelism: 1
- projects:
- e2e-release
- e2e-angular
- e2e-react
@@ -14,10 +35,11 @@ assignment-rules:
- e2e-docker
- e2e-js
- e2e-nx-init
- nx-maven-plugin
- e2e-dotnet
- e2e-workspace-create
- e2e-rollup
targets:
- e2e-ci**
- install
run-on:
- agent: linux-large
parallelism: 1
+7 -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
@@ -77,6 +76,7 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
/e2e/rollup/** @nrwl/nx-js-reviewers
/packages/vite/** @nrwl/nx-js-reviewers
/e2e/vite/** @nrwl/nx-js-reviewers
/packages/vitest/** @nrwl/nx-js-reviewers
## Module Federation
/packages/module-federation/** @nrwl/nx-js-reviewers
@@ -100,7 +100,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 +134,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 +153,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
+6
View File
@@ -1,4 +1,10 @@
# Permanent redirects (301 by default)
# Storybook docs consolidation
[[redirects]]
from = "/docs/technologies/test-tools/storybook/guides/storybook-9-setup"
to = "/docs/technologies/test-tools/storybook/guides/upgrading-storybook"
[[redirects]]
from = "/"
to = "/docs/getting-started/intro"
+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"
}
}
+1 -9
View File
@@ -1,9 +1 @@
<svg
role="img"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
>
<title>Java</title>
<path d="m16.5093 4.9869-.0607-.0347c-1.1014.369-4.4915 1.707-4.4915 4.202 0 1.411 1.378 2.1925 1.378 3.5158 0 .472-.2666.9146-.4836 1.1791l.1091.063c.5735-.3728 1.589-1.18 1.589-2.2222 0-.8825-1.2216-1.943-1.2216-3.0774 0-1.7875 2.357-3.1899 3.1813-3.6256zm-1.6642-3.27c0 3.6925-5.0604 5.1055-5.0604 7.7309 0 1.843 1.2222 2.9987 1.8983 3.7293l-.055.0317c-.8536-.534-3.0995-1.876-3.0995-4.0927 0-3.112 5.8123-4.599 5.8123-8.134 0-.435-.0644-.7683-.1095-.9482L14.2901 0c.1842.2315.555.8102.555 1.7168m.514 14.9392c-.5962.1688-1.9389.4441-3.859.4441-1.8844 0-3.424-.3226-3.4289-.7024-.0032-.2527.3024-.3628.3024-.3628l-.0544-.0316c-.9023.1595-1.7406.406-1.7357.7752.0084.6698 2.5697 1.1728 4.9129 1.1728 1.992 0 3.9053-.3343 4.7684-.7722zm-6.368 2.0708c-.4185.0832-1.3305.2926-1.3305.7361 0 .6144 1.9513 1.085 3.835 1.085 2.5922 0 3.6539-.667 3.702-.7016l-1.078-.6235c-.4583.1092-1.2306.2808-2.6214.2808-1.5521 0-2.5634-.2658-2.5634-.5569 0-.0617.0386-.135.1106-.1886zm10.5923-4.1337c-.0725 1.3911-1.3577 2.2573-2.6423 2.9893l.1164.067c1.3708-.3855 3.8166-1.5085 3.6144-3.2346-.1007-.8608-.8875-1.4758-1.9133-1.4758-.3194 0-.6036.0563-.834.1265l-.0007.0022-.0486.1224c.9175-.1796 1.7558.4904 1.7082 1.403zm-8.1232 8.1638c3.6058-.0313 7.6402-.737 7.6298-1.9232-.0019-.215-.1418-.3622-.2635-.4513l-.0592.034c-.3333.9188-3.1508 1.5977-7.3132 1.634-2.6859.0234-6.4063-.62-6.4128-1.3636-.0065-.7455 1.7625-1.1552 1.7625-1.1552l-.125-.0714c-1.1854.1632-3.3697.731-3.3625 1.5506.0104 1.185 5.0304 1.7734 8.1439 1.7461zm-.375.847c-1.4333.0126-3.1833-.1061-4.6555-.3535l-.1363.0784c1.4664.43 3.508.6896 5.7514.6702 4.4059-.0386 7.9779-1.1311 8.0485-2.446l-.051-.0297c-.2953.3604-2.2009 2.0216-8.9572 2.0806zm-5.5195-9.328c0-.6646 2.521-1.0374 3.6947-1.1277l.112.0647c-.451.082-2.26.401-2.26.8172 0 .4532 2.7747.7501 4.3853.7501 2.7355 0 4.595-.414 5.095-.5505l.6997.4072c-.4792.2346-2.5362.8495-5.7945.8495-3.6214 0-5.9322-.7086-5.9322-1.2105" />
</svg>
<svg fill="#000000" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M 16.921875 2.25 C 16.71679725 2.26171875 16.4970705 2.3408205 16.2890625 2.5078125 C 15.40722675 3.2138669999999996 15.541992 3.5771482499999996 15.1171875 4.4296875 C 14.973633 4.9248045 14.736328499999999 4.962891 14.53125 4.5234375 C 14.28515625 4.08691425 14.16503925 3.5419919999999996 13.78125 3.2109375 C 13.16308575 2.67773475 12.4658205 3.0791017500000004 12.84375 3.6796875 C 13.2216795 4.28027325 13.376953499999999 4.91308575 13.5234375 5.90625 C 13.74316425 7.3857420000000005 13.125 9.03222675 12.3046875 9.8203125 C 10.822266 6.7880857500000005 8.885742 4.53808575 7.5234375 3.84375 C 7.1103517499999995 3.6328125 6.984375 3.80859375 6.984375 4.0078125 C 7.2421875 6.978516000000001 7.3359375 9.02929725 7.171875 10.546875 C 7.0986329999999995 11.2265625 5.49609375 13.734375 5.578125 14.3203125 C 5.66015625 14.9033205 6.12890625 15.817383 6.4453125 16.2890625 C 6.31640625 16.1953125 5.99121075 16.4091795 6.0703125 16.7109375 C 5.49902325 17.03027325 5.551758 17.51953125 6.140625 17.6484375 C 6.29296875 18.0439455 6.3251954999999995 18.24023475 6.75 18.421875 C 6.66796875 19.25683575 6.580078500000001 20.11523475 6.4921875 21.046875 C 6.873047250000001 22.921875 9.776367 19.67871075 10.1484375 19.40625 C 12.161133 17.9296875 12.46875 21.15234375 13.875 21.65625 C 16.2421875 22.5029295 15.474609749999999 17.52246075 13.5703125 12.6328125 C 13.34472675 9.489258 14.40234375 8.59277325 15.421875 8.1796875 C 15.958008 8.00390625 16.3564455 7.96875 17.0859375 8.1796875 C 18.33984375 8.54003925 18.60058575 7.11328125 17.484375 6.9375 C 17.0595705 6.8701170000000005 16.7519535 6.8759767499999995 16.359375 6.703125 C 16.5175785 6.0732420000000005 17.14453125 6.041016000000001 17.765625 5.953125 C 19.17773475 5.75390625 19.0546875 4.23046875 17.484375 4.59375 C 16.7988285 4.754883 16.49121075 5.16210975 16.2421875 5.15625 C 16.56152325 4.573242 17.10058575 4.072266 17.625 3.328125 C 18.0175785 2.7685545 17.5341795 2.21484375 16.921875 2.25 Z M 9.6328125 7.734375 C 9.817383 7.7109375 9.978516 7.72265625 10.1484375 7.78125 C 10.8251955 8.009766 11.05371075 8.87109375 10.640625 9.6796875 C 10.22753925 10.48828125 9.3251955 10.9394535 8.6484375 10.7109375 C 7.9716795000000005 10.48242225 7.7666017499999995 9.64453125 8.1796875 8.8359375 C 8.49023475 8.229492 9.07910175 7.8076170000000005 9.6328125 7.734375 Z M 8.90625 8.8359375 C 8.80371075 8.838867 8.698242 8.89746075 8.6015625 9 C 8.4082035 9.208008 8.34375 9.55078125 8.4609375 9.75 C 8.5810545 9.94921875 8.8300785 9.9345705 9.0234375 9.7265625 C 9.21679725 9.5185545 9.2841795 9.17578125 9.1640625 8.9765625 C 9.10546875 8.8769535 9.00878925 8.833008 8.90625 8.8359375 Z M 11.390625 10.7578125 C 12.521484749999999 12.919922249999999 13.587890999999999 15.48046875 13.8046875 18.3984375 C 13.90722675 19.78710975 12.791015999999999 18.28710975 12.65625 18.046875 C 10.359375 13.91015625 7.4091795000000005 22.40625 7.9921875 17.0859375 C 8.2939455 14.89453125 8.4404295 14.604492 8.5078125 12.046875 C 8.5078125 12.046875 10.265625 12.963867 11.390625 10.7578125 Z M 7.21875 13.2890625 C 7.1630857500000005 14.0126955 7.1484375 14.490234749999999 7.078125 15.234375 C 6.9228517499999995 14.830078499999999 6.7177732500000005 14.7890625 6.609375 14.4140625 C 6.8349607500000005 14.16796875 6.990234750000001 13.6875 7.21875 13.2890625 Z"/></svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

+5
View File
@@ -197,6 +197,11 @@ export const sidebar: StarlightUserConfig['sidebar'] = [
collapsed: true,
items: getPluginItems('cypress', 'test-tools'),
},
{
label: 'Vitest',
collapsed: true,
items: getPluginItems('vitest', 'test-tools'),
},
{
label: 'Jest',
collapsed: true,
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

+121 -2
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">
@@ -379,23 +448,33 @@ const currentVersion = versions.find((v) => v.current);
<div class="h-6 w-px bg-slate-200 mx-1 dark:bg-slate-700"></div>
<a
id="header-ai-link"
href={`${nxDevUrl}/ai`}
class="px-3 py-2 text-sm font-medium text-slate-600 hover:text-blue-500 rounded-md transition-colors whitespace-nowrap no-underline dark:text-slate-200 dark:hover:text-sky-500"
>
AI
</a>
<a
id="header-nx-cloud-link"
href={`${nxDevUrl}/nx-cloud`}
class="px-3 py-2 text-sm font-medium text-slate-600 hover:text-blue-500 rounded-md transition-colors whitespace-nowrap no-underline dark:text-slate-200 dark:hover:text-sky-500"
>
Nx Cloud
</a>
<a
id="header-pricing-link"
href={`${nxDevUrl}/nx-cloud#plans`}
class="px-3 py-2 text-sm font-medium text-slate-600 hover:text-blue-500 rounded-md transition-colors whitespace-nowrap no-underline dark:text-slate-200 dark:hover:text-sky-500"
>
Pricing
</a>
<div class="h-6 w-px bg-slate-200 mx-1 dark:bg-slate-700"></div>
<a
id="header-enterprise-link"
href={`${nxDevUrl}/enterprise`}
class="px-3 py-2 text-sm font-semibold text-slate-600 hover:text-blue-500 rounded-md transition-colors whitespace-nowrap no-underline dark:text-slate-200 dark:hover:text-sky-500"
>
Nx Enterprise
Enterprise
</a>
</nav>
<div class="flex-1 max-w-sm mx-4 print:hidden">
@@ -441,11 +520,51 @@ const currentVersion = versions.find((v) => v.current);
function setupAnalyticsTracking() {
const docsHomeLink = document.getElementById('header-docs-home-link');
const aiLink = document.getElementById('header-ai-link');
const nxCloudLink = document.getElementById('header-nx-cloud-link');
const pricingLink = document.getElementById('header-pricing-link');
const enterpriseLink = document.getElementById('header-enterprise-link');
const contactBtn = document.getElementById('header-contact-btn');
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'
);
});
aiLink?.addEventListener('click', () => {
sendCustomEvent(
'ai-click',
'header-navigation',
'documentation-header'
);
});
nxCloudLink?.addEventListener('click', () => {
sendCustomEvent(
'nx-cloud-click',
'header-navigation',
'documentation-header'
);
});
pricingLink?.addEventListener('click', () => {
sendCustomEvent(
'pricing-click',
'header-navigation',
'documentation-header'
);
});
enterpriseLink?.addEventListener('click', () => {
sendCustomEvent(
'enterprise-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} />
@@ -533,5 +533,10 @@
"name": "@aws/nx-plugin",
"description": "Nx Plugin for AWS: Accelerate building cloud-native applications with AWS",
"url": "https://github.com/awslabs/nx-plugin-for-aws"
},
{
"name": "nx-oxlint",
"description": "Nx plugin for oxlint - a fast linter written in Rust",
"url": "https://github.com/Nas3nmann/nx-oxlint"
}
]
@@ -55,7 +55,7 @@ In order to guarantee that cache poisoning will never affect your end users, [sk
### Do Not Manually Share Your Local Cache
Nx implicitly trusts the local cache which is stored by default in the `.nx/cache` folder. You can change the location of that folder in the `nx.json` file, so it could be tempting to place it on a network drive and easily share your cache with everyone on the company network. However, by doing this you've voided the guarantee of immutability from your cache. If someone has direct access to the cached files, they could directly poison the cache. Nx will automatically detect if a cache entry has been created in your local cache using a different machine and warn you with an [Unknown Local Cache Error](/docs/troubleshooting/unknown-local-cache). Instead, use Nx Cloud [remote caching](/docs/features/ci-features/remote-cache). If you want share your local cache anyway, you can [activate Nx Powerpack](/docs/enterprise/activate-powerpack) and use the [`@nx/shared-fs-cache`](/docs/reference/remote-cache-plugins/shared-fs-cache) plugin.
Nx implicitly trusts the local cache which is stored by default in the `.nx/cache` folder. You can change the location of that folder in the `nx.json` file, so it could be tempting to place it on a network drive and easily share your cache with everyone on the company network. However, by doing this you've voided the guarantee of immutability from your cache. If someone has direct access to the cached files, they could directly poison the cache. Nx will automatically detect if a cache entry has been created in your local cache using a different machine and warn you with an [Unknown Local Cache Error](/docs/troubleshooting/unknown-local-cache). Instead, use Nx Cloud [remote caching](/docs/features/ci-features/remote-cache). If you want share your local cache anyway, you can use the [`@nx/shared-fs-cache`](/docs/reference/remote-cache-plugins/shared-fs-cache) plugin.
### Configure End to End Encryption
@@ -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
```
@@ -1,20 +0,0 @@
---
title: 'Nx Powerpack Features'
description: 'Explore the enterprise-focused features available in Nx Powerpack, including conformance rules and code ownership management.'
sidebar:
order: 5
pagefind: false
---
Nx PowerPack is a suite of paid extensions for the Nx CLI specifically designed for enterprises. Powerpack is available for Nx version 19.8 and higher.
The following features are available after you [activate a Powerpack license](/docs/enterprise/activate-powerpack):
- [Conformance](/docs/enterprise/powerpack/conformance)
- [Owners](/docs/enterprise/powerpack/owners)
{% aside title="Looking for self-hosted caching?" type="note" %}
Self-hosted caching has previously been part of Powerpack, but no more. It is now free for everyone to use. [Learn more about our self-hosted caching options.](/docs/guides/tasks--caching/self-hosted-caching)
{% /aside %}
@@ -1,31 +0,0 @@
---
title: 'Free Licenses and Trials'
description: 'Learn about Nx Powerpack free licenses for small teams and open source projects, as well as trial options and extended evaluation periods.'
sidebar:
order: 7
filter: 'type:Features'
---
{% callout type="deepdive" title="Looking for self-hosted caching?" %}
Self-hosted caching is now free for everyone. [Read more about remote caching options here](/docs/guides/tasks--caching/self-hosted-caching).
{% /callout %}
## Free Trial Licenses
You can get a free, 30-day license immediately if you want to try Nx Powerpack. We're here to support you—whether that means extending your trial or helping with the installation. [Learn more about Nx Powerpack trials.](/docs/powerpack/NxPowerpack-Trial-v1.1.pdf)
[Get Your Trial License Immediately](https://cloud.nx.app/powerpack/request/trial?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-trial&utm_content=link&utm_term=free-trial-license)
If you're having trouble, [reach out for help.](mailto:powerpack-support@nrwl.io)
## Extended Trial Periods
Nx Powerpack does not make any requests to external APIs, and activating Powerpack can be completed in just a few minutes. However, we understand that in many large organizations, approval processes can take a long time. We're here to help you. Need a trial extension or help with your business case? [Reach out and we'll help.](mailto:powerpack-support@nrwl.io)
## Powerpack for OSS Projects
We offer free, full-featured Nx Powerpack licenses to open source projects. This happens through Nx Cloud (which is free for OSS projects). Just apply [here](https://nx.dev/pricing#oss) and in the application form, make sure to confirm the Powerpack question.
If you're primarily looking for remote caching, then Nx Cloud is a great fit as it comes with a fully managed remote cache solution (among other CI features), free for OSS projects.
@@ -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.
@@ -0,0 +1,63 @@
---
title: Activate Enterprise License
description: Learn how to obtain and register an Nx Enterprise plan extensions license to unlock enterprise features like conformance rules and code ownership.
sidebar:
order: 4
filter: 'type:Guides'
---
{% aside type="caution" title="Enterprise Plan Required" %}
The enterprise features, including Conformance and Owners, require an Nx Enterprise license.
{% /aside %}
Nx Enterprise plan includes features of Nx that are particularly useful for larger organizations. The features include the ability to:
- [Run language-agnostic conformance rules](/docs/enterprise/conformance)
- [Define code ownership at the project level](/docs/enterprise/owners)
{% callout type="deepdive" title="Looking for self-hosted caching?" %}
Self-hosted caching is now free for everyone. [Read more about remote caching options here](/docs/guides/tasks--caching/self-hosted-caching).
{% /callout %}
Activating your enterprise license is a two-step process.
## Step 1: Get an Activation Key
Talk to your Developer Productivity Engineer to get a license key for your workspaces.
## Step 2: Register the Activation Key
{% tabs %}
{% tabitem label="Closed Source Repository" %}
To register the activation key in your repository, run the `nx register` command.
```shell
nx register YOUR_ACTIVATION_KEY
```
The key will be saved in your repository and should be committed so that every developer has access to the enterprise features. **Only one developer needs to run this. The rest of the team will gain access to Nx Enterprise plan features once they pull the changes including the checked-in file.**
Another option is to use an environment variable in CI.
```ini
// .env
NX_KEY=YOUR_ACTIVATION_KEY
```
**Whether you use the `nx register <your-key>` command or set the environment variable, Nx does not make any requests to external APIs. No data is collected or sent anywhere.**
{% /tabitem %}
{% tabitem label="Open Source Repository" %}
Use an environment variable for your activation key such that it is not committed to the repository.
```ini
// .env
NX_KEY=YOUR_ACTIVATION_KEY
```
{% /tabitem %}
{% /tabs %}
@@ -1,67 +0,0 @@
---
title: Activate Nx Powerpack
description: Learn how to obtain and register an Nx Powerpack license to unlock enterprise features like conformance rules and code ownership.
sidebar:
order: 4
filter: 'type:Guides'
---
Nx Powerpack unlocks features of Nx that are particularly useful for larger organizations. Powerpack is available for Nx version 19.8 and higher. The features include the ability to:
- [Run language-agnostic conformance rules](/docs/enterprise/powerpack/conformance)
- [Define code ownership at the project level](/docs/enterprise/powerpack/owners)
{% callout type="deepdive" title="Looking for self-hosted caching?" %}
Self-hosted caching is now free for everyone. [Read more about remote caching options here](/docs/guides/tasks--caching/self-hosted-caching).
{% /callout %}
Activating Powerpack is a two-step process.
## Step 1: Get an Activation Key
You can [purchase a license](https://cloud.nx.app/powerpack/purchase?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-purchase&utm_content=link&utm_term=purchase-license) online.
If you're an existing Nx Cloud user, you can buy Nx Powerpack on [the Nx Cloud organization settings page](https://cloud.nx.app/go/organization/powerpack). The license will be available automatically.
{% callout type="deepdive" title="Need a trial?" %}
If you are unsure how to proceed, starting with a trial process is recommended, and we will accommodate your organization's needs. You can reach out here to [get a free trial license](https://cloud.nx.app/powerpack/request/trial?utm_source=nx-docs&utm_medium=referral&utm_campaign=powerpack-trial&utm_content=link&utm_term=free-trial-license-for-larger-teams) or read more [about how trials work](/docs/enterprise/powerpack/licenses-and-trials).
{% /callout %}
## Step 2: Register the Activation Key
{% tabs %}
{% tabitem label="Closed Source Repository" %}
To register the activation key in your repository, run the `nx register` command.
```shell {% frame="none" %}
nx register YOUR_ACTIVATION_KEY
```
The key will be saved in your repository and should be committed so that every developer has access to the Powerpack features. **Only one developer needs to run this. The rest of the team will gain access to Nx Powerpack features once they pull the changes including the checked-in file.**
Another option is to use an environment variable in CI.
```ini
// .env
NX_KEY=YOUR_ACTIVATION_KEY
```
**Whether you use the `nx register <your-key>` command or set the environment variable, Nx Powerpack does not make any requests to external APIs. No data is collected or sent anywhere.**
{% /tabitem %}
{% tabitem label="Open Source Repository" %}
Use an environment variable for your activation key such that it is not committed to the repository.
```ini
// .env
NX_KEY=YOUR_ACTIVATION_KEY
```
{% /tabitem %}
{% /tabs %}
@@ -4,9 +4,9 @@ description: Configure and manage Nx Conformance rules across workspaces using t
filter: 'type:Features'
---
[Nx Cloud Enterprise](https://nx.dev/enterprise) allows you to publish your organization's [Nx Conformance](/docs/enterprise/powerpack/conformance) rules to your Nx Cloud Organization, and consume them in any of your other Nx Workspaces without having to deal with the complexity and friction of dealing with a private NPM registry or similar. Authentication is handled automatically through your Nx Cloud connection and rules are downloaded and applied based on your preferences configured in the Nx Cloud UI.
[Nx Cloud Enterprise](https://nx.dev/enterprise) allows you to publish your organization's [Nx Conformance](/docs/enterprise/conformance) rules to your Nx Cloud Organization, and consume them in any of your other Nx Workspaces without having to deal with the complexity and friction of dealing with a private NPM registry or similar. Authentication is handled automatically through your Nx Cloud connection and rules are downloaded and applied based on your preferences configured in the Nx Cloud UI.
To learn about how to create and publish custom rules to your Nx Cloud Organization, please refer to the [Publish Conformance Rules to Nx Cloud](/docs/enterprise/powerpack/publish-conformance-rules-to-nx-cloud) recipe.
To learn about how to create and publish custom rules to your Nx Cloud Organization, please refer to the [Publish Conformance Rules to Nx Cloud](/docs/enterprise/publish-conformance-rules-to-nx-cloud) recipe.
Once you have one or more rules published to your Nx Cloud Organization, you can configure your Nx Cloud Organization to use them in the Nx Cloud UI by visiting:
@@ -85,4 +85,4 @@ When `nx-cloud conformance` or `nx-cloud conformance:check` are run, any configu
By design, the workspace cannot choose to disable the rules configured in Nx Cloud - any conflict between local and cloud rules will result in the local configuration being overridden by the cloud configuration.
{% /aside %}
If the cloud rules were written to depend on a different version of Nx or Nx Powerpack than is installed within the current workspace, Nx Cloud will handle installing applicable versions dynamically at runtime.
If the cloud rules were written to depend on a different version of Nx than is installed within the current workspace, Nx Cloud will handle installing applicable versions dynamically at runtime.
@@ -1,15 +1,15 @@
---
title: 'Run Language-Agnostic Conformance Rules'
description: 'Learn how to use Nx Powerpack and Nx Enterprise conformance rules to enforce organizational standards, maintain consistency, and ensure security across your workspace.'
description: 'Learn how to use Nx Enterprise conformance rules to enforce organizational standards, maintain consistency, and ensure security across your workspace.'
sidebar:
order: 8
filter: 'type:Guides'
---
{% youtube src="https://youtu.be/6wg23sLveTQ" title="Nx Powerpack workspace conformance" /%}
{% youtube src="https://youtu.be/6wg23sLveTQ" title="Nx Conformance" /%}
The [`@nx/conformance`](/docs/reference/powerpack/conformance/overview) plugin allows [Nx Powerpack](https://nx.dev/powerpack) and [Nx Enterprise](https://nx.dev/enterprise) users to write and apply rules for your entire workspace that help with **consistency**, **maintainability**, **reliability** and **security**. Powerpack is available for Nx version 19.8 and higher.
The [`@nx/conformance`](/docs/reference/conformance/overview) plugin allows [Nx Enterprise plan](https://nx.dev/enterprise) users to write and apply rules for your entire workspace that help with **consistency**, **maintainability**, **reliability** and **security**.
## Why Conformance?
@@ -22,21 +22,21 @@ The `@nx/conformance` plugin lets you write custom rules in TypeScript that enfo
The plugin also provides the following pre-written rules:
- **Enforce Project Boundaries**: Similar to the Nx [ESLint Enforce Module Boundaries rule](/docs/technologies/eslint/eslint-plugin/guides/enforce-module-boundaries), but enforces the boundaries on every project dependency, not just those created from TypeScript imports or `package.json` dependencies.
- **Ensure Owners**: Require every project to have an owner defined for the [`@nx/owners` plugin](/docs/reference/powerpack/owners)
- **Ensure Owners**: Require every project to have an owner defined for the [`@nx/owners` plugin](/docs/reference/owners)
## Setup
The `@nx/conformance` plugin requires an Nx Powerpack or [Nx Enterprise license](https://nx.dev/enterprise) to function. [Activating Powerpack](/docs/enterprise/activate-powerpack) is a simple process.
The `@nx/conformance` plugin requires an [Nx Enterprise plan](https://nx.dev/enterprise) to function. [Activating your license](/docs/enterprise/activate-license) is a simple process.
{% call_to_action title="Get a License and Activate Powerpack or Nx Enterprise" icon="nx" description="Unlock all the features of the Nx CLI" url="/docs/enterprise/activate-powerpack" /%}
{% call_to_action title="Get a License and Activate Nx Enterprise" icon="nx" description="Unlock all the features of the Nx CLI" url="/docs/enterprise/activate-license" /%}
Then, add the Conformance plugin to your workspace.
{% linkcard title="Conformance Overview" href="/docs/reference/powerpack/conformance/overview" /%}
{% linkcard title="Conformance Overview" href="/docs/reference/conformance/overview" /%}
## Configure Conformance Rules
Conformance rules are configured in the `conformance` property of the `nx.json` file. You can use the pre-defined rules or reference [your own custom rule](/docs/reference/powerpack/conformance#custom-conformance-rules). See the [plugin documentation](/docs/reference/powerpack/conformance) for more details.
Conformance rules are configured in the `conformance` property of the `nx.json` file. You can use the pre-defined rules or reference [your own custom rule](/docs/reference/conformance#custom-conformance-rules). See the [plugin documentation](/docs/reference/conformance) for more details.
```jsonc
// nx.json
@@ -101,18 +101,18 @@ Use `npx nx-cloud record --` to capture the logs for `nx conformance:check` in t
run: npx nx-cloud record -- npx nx-cloud conformance:check
```
Here we are using the `nx-cloud` CLI to run the `conformance:check` command so that we can hook into the power of Conformance rules configured in your Nx Cloud Enterprise organization. Learn more about [conformance rules in Nx Cloud](/docs/enterprise/powerpack/configure-conformance-rules-in-nx-cloud).
Here we are using the `nx-cloud` CLI to run the `conformance:check` command so that we can hook into the power of Conformance rules configured in your Nx Cloud Enterprise organization. Learn more about [conformance rules in Nx Cloud](/docs/enterprise/configure-conformance-rules-in-nx-cloud).
{% /tabitem %}
{% /tabs %}
If a valid Powerpack license is not available to the workspace (either locally or via Nx Cloud), the `nx conformance` and `nx conformance:check` commands will fail without checking any rules.
If a valid license is not available to the workspace (either locally or via Nx Cloud), the `nx conformance` and `nx conformance:check` commands will fail without checking any rules.
## Taking things further with Nx Cloud Enterprise
Organizations on the Nx Cloud Enterprise plan can [publish custom conformance rules](/docs/enterprise/powerpack/publish-conformance-rules-to-nx-cloud) to their Nx Cloud organization without the friction of a custom registry, and then [configure the rules](/docs/enterprise/powerpack/configure-conformance-rules-in-nx-cloud) to apply to the workspaces in their organization automatically when `nx-cloud conformance` or `nx-cloud conformance:check` is run (note that the `nx-cloud` CLI is used in this case in order to handle the authentication with Nx Cloud).
Organizations on the Nx Cloud Enterprise plan can [publish custom conformance rules](/docs/enterprise/publish-conformance-rules-to-nx-cloud) to their Nx Cloud organization without the friction of a custom registry, and then [configure the rules](/docs/enterprise/configure-conformance-rules-in-nx-cloud) to apply to the workspaces in their organization automatically when `nx-cloud conformance` or `nx-cloud conformance:check` is run (note that the `nx-cloud` CLI is used in this case in order to handle the authentication with Nx Cloud).
The Powerpack license will be applied automatically via Nx Cloud in all contexts, and so there is zero setup required for the end developer.
The license will be applied automatically via Nx Cloud in all contexts, and so there is zero setup required for the end developer.
Simply add an appropriate invocation of the `nx-cloud conformance:check` command to your CI process and all cloud configured rules will be applied and merged with any local rules:
@@ -121,13 +121,13 @@ Simply add an appropriate invocation of the `nx-cloud conformance:check` command
run: npx nx-cloud record -- npx nx-cloud conformance:check
```
Learn more about [publishing](/docs/enterprise/powerpack/publish-conformance-rules-to-nx-cloud) and [configuring conformance rules in Nx Cloud](/docs/enterprise/powerpack/configure-conformance-rules-in-nx-cloud).
Learn more about [publishing](/docs/enterprise/publish-conformance-rules-to-nx-cloud) and [configuring conformance rules in Nx Cloud](/docs/enterprise/configure-conformance-rules-in-nx-cloud).
## Learn More
- [Conformance Plugin API Reference](/docs/reference/powerpack/conformance/overview) - Detailed documentation on configuration options and provided rules
- [Create a Custom Conformance Rule](/docs/reference/powerpack/conformance/create-conformance-rule) - Step-by-step guide to writing your own rules
- [Testing Conformance Rules](/docs/reference/powerpack/conformance/test-conformance-rule) - Learn how to test your conformance rules
- [Publish Conformance Rules to Nx Cloud](/docs/enterprise/powerpack/publish-conformance-rules-to-nx-cloud) - Share rules across your organization
- [Configure Conformance Rules in Nx Cloud](/docs/enterprise/powerpack/configure-conformance-rules-in-nx-cloud) - Manage rules via the Nx Cloud dashboard
- [Conformance Plugin API Reference](/docs/reference/conformance/overview) - Detailed documentation on configuration options and provided rules
- [Create a Custom Conformance Rule](/docs/reference/conformance/create-conformance-rule) - Step-by-step guide to writing your own rules
- [Testing Conformance Rules](/docs/reference/conformance/test-conformance-rule) - Learn how to test your conformance rules
- [Publish Conformance Rules to Nx Cloud](/docs/enterprise/publish-conformance-rules-to-nx-cloud) - Share rules across your organization
- [Configure Conformance Rules in Nx Cloud](/docs/enterprise/configure-conformance-rules-in-nx-cloud) - Manage rules via the Nx Cloud dashboard
- [Blog: Automating Consistency with Nx Cloud Conformance](https://nx.dev/blog/nx-cloud-conformance-automate-consistency) - Learn about the philosophy and benefits of conformance
@@ -45,7 +45,7 @@ Conformance based workflows allow running the pre-defined conformance rules for
1. Click **Polygraph** or **Conformance** for your repeating workflows provided by Nx Cloud
- if using **Conformance** action, then make sure you've already configured and [published a conformance rule](/docs/enterprise/powerpack/publish-conformance-rules-to-nx-cloud)
- if using **Conformance** action, then make sure you've already configured and [published a conformance rule](/docs/enterprise/publish-conformance-rules-to-nx-cloud)
![Polygraph overview](../../../assets/enterprise/custom-workflows/org-polygraph-overview.avif)
2. Click **Apply workflow** and select the workspace you wish to use for the custom workflow.
@@ -1,28 +1,28 @@
---
title: 'Define Code Ownership at the Project Level'
description: 'Learn how to use Nx Powerpack owners plugin to manage code ownership at the project level and automatically generate CODEOWNERS files for GitHub, Bitbucket, or GitLab.'
description: 'Learn how to use Nx owners plugin to manage code ownership at the project level and automatically generate CODEOWNERS files for GitHub, Bitbucket, or GitLab.'
filter: 'type:Guides'
---
{% youtube src="https://youtu.be/mor6urvw-L0" title="Nx Powerpack Codeowners" /%}
{% youtube src="https://youtu.be/mor6urvw-L0" title="Nx Codeowners" /%}
This plugin provides [Nx Powerpack](https://nx.dev/powerpack) users the ability to configure and maintain code owners for projects in an Nx workspace. Powerpack is available for Nx version 19.8 and higher.
This plugin provides [Nx Enterprise plan](https://nx.dev/enterprise) users the ability to configure and maintain code owners for projects in an Nx workspace.
The atomic unit of code in an Nx workspace is a project. Tasks, module boundaries and the Nx graph all train us to conceptualize the workspace as a collection of projects. The CODEOWNERS file, however, requires you to switch from a project mental model to a more low-level definition based on the folder structure of your workspace. The `@nx/owners` plugin enables you to stay in the mental model that your workspace is a collection of projects as you define the ownership rules for your workspace. Nx will take care of compiling the project ownership rules into file-based ownership rules that [GitHub](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners), [Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/) or [GitLab](https://docs.gitlab.com/ee/user/project/codeowners/) can understand in the CODEOWNERS file.
## Setup
The `@nx/owners` plugin requires an Nx Powerpack license to function. [Activating Powerpack](/docs/enterprise/activate-powerpack) is a simple process.
The `@nx/owners` plugin requires an Nx Enterprise plan to function. [Activating your license](/docs/enterprise/activate-license) is a simple process.
{% call_to_action title="Get a License and Activate Powerpack" icon="nx" description="Unlock all the features of the Nx CLI" url="/docs/enterprise/activate-powerpack" /%}
{% call_to_action title="Get a License and Activate Nx Enterprise plan extensions" icon="nx" description="Unlock all the features of the Nx CLI" url="/docs/enterprise/activate-license" /%}
Then, add the Owners plugin to your workspace.
{% linkcard title="Owners Overview" href="/docs/reference/powerpack/owners/overview" /%}
{% linkcard title="Owners Overview" href="/docs/reference/owners/overview" /%}
## Project or File-based Configuration
The ownership configuration is defined in the `nx.json` file or in individual project configuration files. Nx then uses a [sync generator](/docs/concepts/sync-generators) to automatically compile those settings into a valid CODEOWNERS file for GitHub, Bitbucket or GitLab. See the [plugin documentation](/docs/reference/powerpack/owners) for more details.
The ownership configuration is defined in the `nx.json` file or in individual project configuration files. Nx then uses a [sync generator](/docs/concepts/sync-generators) to automatically compile those settings into a valid CODEOWNERS file for GitHub, Bitbucket or GitLab. See the [plugin documentation](/docs/reference/owners) for more details.
**Define Project Owners**:
@@ -63,7 +63,7 @@ You can setup notifications for teams, so they're always kept in the loop
![Conformance notifications](../../../assets/enterprise/polygraph/conformance-notifications.avif)
Ready to write your first conformance rule? [See our conformance guide](/docs/enterprise/powerpack/conformance) to start.
Ready to write your first conformance rule? [See our conformance guide](/docs/enterprise/conformance) to start.
## Custom Workflows
@@ -82,7 +82,7 @@ Custom workflows enable proactive monitoring and automated compliance checking,
Gain quick visibility across your organization's repositories without needing to migrate each repository as an Nx Workspace.
Easily onboard any repository as a **metadata-only** to immediately start contributing to the [Workspace Graph](#workspace-graph).
Metadata-only workspaces can still leverage [custom workflows](/docs/enterprise/polygraph#custom-workflows) and [conformance rules](/docs/enterprise/powerpack/conformance).
Metadata-only workspaces can still leverage [custom workflows](/docs/enterprise/polygraph#custom-workflows) and [conformance rules](/docs/enterprise/conformance).
Read more about [onboarding a workspace as metadata-only](/docs/enterprise/metadata-only-workspace).
@@ -108,9 +108,9 @@ Yes, rules can be set to _evaluate_ mode before enforcement, and you can schedul
- **Disabled**: Rule is turned off and won't run in any workspaces.
**Q: If I have Powerpack, can I use Conformance with Nx Cloud?**
**Q: Can I use Conformance with Nx Cloud?**
Powerpack enables conformance rules within individual workspaces. Polygraph extends this by publishing rules across your entire organization, configuring them across multiple workspaces, and tracking results at the organizational level. An Nx Cloud Enterprise license is required for Polygraph features.
Yes! Nx Enterprise plan enable conformance rules within individual workspaces. Polygraph extends this by publishing rules across your entire organization, configuring them across multiple workspaces, and tracking results at the organizational level. An Nx Cloud Enterprise license is required for Polygraph features.
{% aside type="tip" title="Ready to start using Polygraph? " %}
Existing enterprise customers should contact their assigned developer productivity engineer to get setup. Otherwise, reach out to us about [Nx Enterprise](https://nx.dev/enterprise) to unlock Polygraph's organizational scaling features.
@@ -4,17 +4,17 @@ description: Create and publish custom Nx Conformance rules to your Nx Cloud org
filter: 'type:Guides'
---
[Nx Cloud Enterprise](https://nx.dev/enterprise) allows you to publish your organization's [Nx Conformance](/docs/enterprise/powerpack/conformance) rules to your Nx Cloud Organization, and consume them in any of your other Nx Workspaces without having to deal with the complexity and friction of dealing with a private NPM registry or similar. Authentication is handled automatically through your Nx Cloud connection and rules are downloaded and applied based on your preferences configured in the Nx Cloud UI.
[Nx Cloud Enterprise](https://nx.dev/enterprise) allows you to publish your organization's [Nx Conformance](/docs/enterprise/conformance) rules to your Nx Cloud Organization, and consume them in any of your other Nx Workspaces without having to deal with the complexity and friction of dealing with a private NPM registry or similar. Authentication is handled automatically through your Nx Cloud connection and rules are downloaded and applied based on your preferences configured in the Nx Cloud UI.
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.
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/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
```
@@ -22,7 +22,7 @@ nx g @nx/conformance:create-rule --name=test-cloud-rule --directory=cloud-confor
If you get an error resolving the `@nx/conformance` plugin, you may need to add it. You can do this by running `nx add @nx/conformance` in your workspace.
{% /aside %}
We now have a valid implementation of a rule and we are ready to build it and publish it to Nx Cloud. The [`@nx/conformance` plugin](/docs/reference/powerpack/conformance) provides a [dedicated executor called `bundle-rules`](/docs/reference/powerpack/conformance/executors#bundle-rules) for creating appropriate build artifacts for this purpose. We will replace the existing build target and wire up that executor in our `cloud-conformance-rules` project's `project.json` file:
We now have a valid implementation of a rule and we are ready to build it and publish it to Nx Cloud. The [`@nx/conformance` plugin](/docs/reference/conformance) provides a [dedicated executor called `bundle-rules`](/docs/reference/conformance/executors#bundle-rules) for creating appropriate build artifacts for this purpose. We will replace the existing build target and wire up that executor in our `cloud-conformance-rules` project's `project.json` file:
```jsonc
// cloud-conformance-rules/project.json
@@ -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
```
@@ -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"]
}
@@ -0,0 +1,173 @@
---
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: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.
## Which CreateNodes Version Does Nx Call?
The following table shows which export Nx will call based on the Nx version:
| Nx Version | Calls `createNodes` | Calls `createNodesV2` | Nx Call Preference |
| ------------- | ------------------- | --------------------- | ---------------------------- |
| 17.x - 19.1.x | Yes | No | Only v1 supported |
| 19.2.x - 20.x | Yes (fallback) | Yes (preferred) | Prefers v2, falls back to v1 |
| 21.x | No | Yes | Only v2 supported |
| 22.x+ | Yes (v2 signature) | Yes | Both use v2 signature |
## Which Nx Versions Does My Plugin Support?
> Note this is the same information as above, but presented as a lookup table for plugin authors.
If you're a plugin author, this table shows which Nx versions your plugin will support based on which exports you provide:
| Plugin Exports | Nx 17-19.1 | Nx 19.2-20 | Nx 21-21.x | Nx 22+ |
| ----------------------------------------- | ---------------- | ---------------- | ---------------- | ---------------- |
| Only `createNodes` (v1) | ✅ Supported | ✅ Supported | ❌ Not Supported | ❌ Not Supported |
| Only `createNodesV2` | ❌ Not Supported | ✅ Supported | ✅ Supported | ✅ Supported |
| Both `createNodes` (v1) & `createNodesV2` | ✅ Supported | ✅ Supported | ✅ Supported | ✅ Supported |
| Both with v2 signature (Nx 22+) | ❌ Not Supported | ❌ Not Supported | ✅ Supported | ✅ Supported |
## Recommended Implementation Pattern
### Plugin Support for Nx 21 and later
For plugins targeting **Nx 21 and later**, the recommended pattern is to export both `createNodes` and `createNodesV2` using the same v2 implementation:
```typescript
// my-plugin/index.ts
import {
CreateNodesV2,
CreateNodesContextV2,
createNodesFromFiles,
} from '@nx/devkit';
export interface MyPluginOptions {
// your options
}
// Export createNodes with v2 signature
export const createNodes: CreateNodesV2<MyPluginOptions> = [
'**/some-config.json',
async (configFiles, options, context) => {
return await createNodesFromFiles(
(configFile, options, context) =>
createNodesInternal(configFile, options, context),
configFiles,
options,
context
);
},
];
// Re-export as createNodesV2
export const createNodesV2 = createNodes;
async function createNodesInternal(
configFilePath: string,
options: MyPluginOptions,
context: CreateNodesContextV2
) {
// Your plugin logic here
return {
projects: {
// ...
},
};
}
```
This pattern ensures your plugin works with both Nx 21 and Nx 22+.
### Plugin Support for Nx 17 Through Nx 20
If you need to support Nx versions 17-20, you'll need to provide separate implementations.
In Nx 22 the type for v1 of the create nodes api are removed, you can inline the type to maintain type safety.
```typescript
// my-plugin/index.ts
import {
CreateNodesV2,
CreateNodesContextV2,
CreateNodesResult,
createNodesFromFiles,
} from '@nx/devkit';
// inlined types for backwards compat to v1 of createNodes
// removed in Nx 22
export interface OldCreateNodesContext extends CreateNodesContextV2 {
/**
* The subset of configuration files which match the createNodes pattern
*/
readonly configFiles: readonly string[];
}
type OldCreateNodes<T = unknown> = readonly [
projectFilePattern: string,
createNodesFunction: OldCreateNodesFunction<T>
];
export type OldCreateNodesFunction<T = unknown> = (
projectConfigurationFile: string,
options: T | undefined,
context: OldCreateNodesContext
) => CreateNodesResult | Promise<CreateNodesResult>;
export interface MyPluginOptions {
// your options
}
// V1 API for Nx 17-20
export const createNodes: OldCreateNodes<MyPluginOptions> = [
'**/my-config.json',
(configFile, options, context: OldCreateNodesContext) => {
// V1 implementation - processes one file at a time
return createNodesInternal(configFile, options, context);
},
];
// V2 API for Nx 19.2+
export const createNodesV2: CreateNodesV2<MyPluginOptions> = [
'**/my-config.json',
async (configFiles, options, context: CreateNodesContextV2) => {
return await createNodesFromFiles(
(configFile, options, context) =>
createNodesInternal(configFile, options, context),
configFiles,
options,
context
);
},
];
function createNodesInternal(
configFilePath: string,
options: MyPluginOptions,
context: OldCreateNodesContext | CreateNodesContextV2
) {
// Shared logic that works with both APIs
return {
projects: {
// ...
},
};
}
```
## Future Deprecation Timeline
Nx is standardizing on the v2 API. Here's the planned timeline:
- **Nx 22**: Both `createNodes` and `createNodesV2` can be exported with v2 signature. `createNodes` re-exported as `createNodesV2`.
- **Nx 23**: The `createNodesV2` export will be marked as deprecated in TypeScript types. Use `createNodes` with v2 signature instead.
## Related Documentation
- [Extending the Project Graph](/docs/extending-nx/project-graph-plugins) - Learn how to create project graph plugins
- [Integrate a New Tool with a Tooling Plugin](/docs/extending-nx/tooling-plugin) - Tutorial for creating a complete plugin
- [CreateNodesV2 API Reference](/docs/reference/devkit/CreateNodesV2) - Detailed API documentation
@@ -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
@@ -35,6 +35,10 @@ You can register a plugin by adding it to the plugins array in `nx.json`:
You can add nodes to the project graph with [`createNodesV2`](/docs/reference/devkit/CreateNodesV2). This is the API that Nx uses under the hood to identify Nx projects coming from a `project.json` file or a `package.json` that's listed in a package manager's workspaces section.
{% aside type="note" title="CreateNodes API Versions" %}
Nx has evolved its plugin API over time. Different Nx versions call different `createNodes` exports (`createNodes` vs `createNodesV2`). If you need to support multiple Nx versions see the [CreateNodes Compatibility Guide](/docs/extending-nx/createnodes-compatibility).
{% /aside %}
### Identifying Projects
Looking at the tuple, you can see that the first element is a file pattern. This is a glob pattern that Nx will use to find files in your workspace. The second element is a function that will be called for each file that matches the pattern. The function will be called with the path to the file and a context object. Your plugin can then return a set of projects and external nodes.
@@ -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
```
@@ -75,6 +75,10 @@ If the `astro.config.mjs` for a project looks like our example in the previous s
To create an inferred task, we need to export a `createNodesV2` function from the plugin's `index.ts` file. The entire file is shown below with inline comments to explain what is happening in each section.
{% aside type="note" title="Supporting Multiple Nx Versions" %}
Different Nx versions call different `createNodes` exports. If you need to support Nx versions before 21 see the [CreateNodes Compatibility Guide](/docs/extending-nx/createnodes-compatibility).
{% /aside %}
```ts
// src/index.ts
import {
@@ -193,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
```
@@ -265,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)
@@ -8,11 +8,15 @@ filter: 'type:Features'
Any CI tool requires tight integration with your existing version control system. Nx Cloud offers first class integration with GitHub in the following ways.
## Easy Onboarding
## Easy Workspace Setup
![Screenshot of Nx Cloud connecting a GitHub repository](../../../../assets/features/ci-features/github-onboarding.avif)
Get started with Nx Cloud in no time with our GitHub connection process. Connect your workspace, and Nx Cloud will create a pull request with everything you need. Select your workspace and organization, and Nx Cloud takes care of the rest. User access is automatically connected to GitHub, and a PR is created to connect your workspace. Your repo now has [distributed caching](/docs/features/ci-features/remote-cache) in less than 5 minutes.
Get started quickly with Nx Cloud with our GitHub connection process. Connect your workspace by selecting your repo and organization from GitHub, and Nx Cloud will create a pull request with all the necessary configuration. User access is automatically connected to GitHub, and a PR is created to connect your workspace. Your repo now has [distributed caching](/docs/features/ci-features/remote-cache) in less than 5 minutes.
You can also create a new workspace from a template for experimentation. This workspace will come pre-configured with Nx Cloud and examples of core Nx concepts. [Create a new Nx workspace](https://cloud.nx.app/create-nx-workspace) to get started.
[Connect your Nx Cloud account to GitHub](/docs/features/ci-features/github-integration#connect-to-github) to use this feature.
## Pull Request Insights
@@ -20,21 +24,27 @@ Get started with Nx Cloud in no time with our GitHub connection process. Connect
Good CI checks require fast and easy access to results. That's why Nx Cloud will update your PR with the current running status of your tasks and a convenient link to your Nx Cloud results and logs. Take advantage of the enhanced developer experience of structured and searchable logs. Quick insight to PR task progress, so you're not stuck waiting for every task to complete. And with Nx Replay, developers can quickly replay tasks locally to avoid running tasks that CI has already completed.
This feature is available in workspaces with the [Nx Cloud GitHub App installed](/docs/guides/nx-cloud/source-control-integration/github#install-the-app).
## Access Control
![Diagram showing users syncing from GitHub to Nx Cloud](../../../../assets/features/ci-features/github-user-management.avif)
Nx Cloud organizations can use their existing GitHub access controls to manage Nx Cloud as well. This allows Nx Cloud to fit in to any existing on-boarding or off-boarding process. There's no need to manually manage users separately. Get your engineers Nx Cloud access right alongside their GitHub access so they can get to work fast. Use [personal access tokens](/docs/guides/nx-cloud/personal-access-tokens) to further enhance your security.
Nx Cloud organization access can be linked to a Github organization, so that memberships are automatically synced. This allows Nx Cloud to fit in to any existing on-boarding or off-boarding process. There's no need to manually manage users separately. Get your engineers Nx Cloud access right alongside their GitHub access so they can get to work fast. Use [personal access tokens](/docs/guides/nx-cloud/personal-access-tokens) to further enhance your security.
## Get Started
[Connect your Nx Cloud account to GitHub](/docs/features/ci-features/github-integration#connect-to-github) to use this feature. Members of your GitHub organization will also need to connect their GitHub accounts to access the organization.
First, you'll want to connect your Nx Cloud account to GitHub. You can use your regular username and password or log in via Google or GitHub, connecting to GitHub is a separate step.
## Connect to GitHub
{% call_to_action title="Connect to GitHub" url="https://cloud.nx.app/profile/vcs-integrations" icon="nxcloud" description="Connect your Nx Cloud account to GitHub via your profile settings" %}
Get started by connecting your Nx Cloud account to GitHub. This will allow you to access GitHub-powered organizations that you're a member of, easily connect workspaces, and configure automatic access control through GitHub.
{% call_to_action title="Connect to GitHub" url="https://cloud.nx.app/profile/vcs-integrations" icon="nxcloud" description="Connect your Nx Cloud account to GitHub in your profile settings" %}
Connect to GitHub
{% /call_to_action %}
## Connect a New Workspace and Organization
Note that it doesn't matter what method you use to log into Nx Cloud, connecting your GitHub account is a separate step.
## Connect to GitHub during Initial Setup
1. Visit [Nx Cloud](https://cloud.nx.app) and click **Connect a workspace** at the top.
2. Select **Connect existing repository** from the dropdown.
@@ -46,15 +56,15 @@ Connect to GitHub
Connect an Nx workspace in GitHub to Nx Cloud
{% /call_to_action %}
## Connect an Existing Organization
## Connect an Organization to GitHub after Initial Setup
If you've already created an organization in Nx Cloud, and you'd like to use your GitHub organization to manage access to it:
If you already have an organization in Nx Cloud, and you'd like to use your GitHub organization to manage access to it:
1. Go to the organization in Nx Cloud while logged in as an admin user.
2. Click on **Settings** in the top menu
3. Go to **Connect GitHub organization in the sidebar**
4. Follow the prompts there to connect to GitHub.
4. Follow the prompts there to connect to GitHub. Note that for every workspace in the Nx Cloud organization, there must be a corresponding repo in the GitHub organization.
## Connect an Existing Workspace
## Connect a Workspace to GitHub after Initial Setup
If you already have a workspace connected to Nx Cloud, and you'd like to connect it to a GitHub repo to enable PR insights, [see our recipe for more details.](/docs/guides/nx-cloud/source-control-integration)
If you already have a workspace connected to Nx Cloud, and you'd like to connect it to a GitHub repo to enable PR insights, [install the Nx Cloud GitHub App](/docs/guides/nx-cloud/source-control-integration/github#install-the-app).
@@ -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,35 @@ 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="Vitest" %}
```shell
nx add @nx/vitest
```
{% /tabitem %}
{% tabitem label="Gradle" %}
```shell {% frame="none" %}
```shell
nx add @nx/gradle
```
@@ -82,12 +89,13 @@ If you upgraded Nx from an older version, ensure that [inferred tasks](/docs/con
## Update an Existing Project to use Automated Task Splitting
If you are already using the `@nx/cypress`, `@nx/playwright`, `@nx/jest`, or `@nx/gradle` plugin, you need to manually add the appropriate configuration to the `plugins` array of `nx.json`. Follow the instructions for the plugin you are using:
If you are already using the `@nx/cypress`, `@nx/playwright`, `@nx/jest`, `@nx/vitest`, or `@nx/gradle` plugin, you need to manually add the appropriate configuration to the `plugins` array of `nx.json`. Follow the instructions for the plugin you are using:
- [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 Vitest Task Splitting](/docs/technologies/test-tools/vitest/introduction#splitting-e2e-tests)
- [Configure Gradle Testing Task Splitting](/docs/technologies/java/gradle/introduction#test-distribution)
## Verify Automated Task Splitting Works
@@ -96,7 +104,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 +430,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
```
@@ -21,7 +21,7 @@ Nx offers two complementary approaches to enforce module boundaries:
**ESLint Integration** - For JavaScript/TypeScript projects, enforce boundaries on code imports using the `@nx/enforce-module-boundaries` ESLint rule. This checks TypeScript imports and `package.json` dependencies during linting.
**Language-Agnostic Conformance** - For any project type (e.g. Java, Python, PHP, JavaScript, etc.), use the [Conformance plugin's Enforce Project Boundaries rule](/docs/enterprise/powerpack/conformance). This rule checks dependencies in the Nx graph during `nx conformance:check`. Requires [Nx Powerpack or Enterprise](https://nx.dev/enterprise).
**Language-Agnostic Conformance** - For any project type (e.g. Java, Python, PHP, JavaScript, etc.), use the [Conformance plugin's Enforce Project Boundaries rule](/docs/enterprise/conformance). This rule checks dependencies in the Nx graph during `nx conformance:check`. Requires [Nx Enterprise plan](https://nx.dev/enterprise).
Both approaches use the same tag-based constraint system described below.
@@ -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
```
@@ -243,7 +243,7 @@ Run conformance checks in CI:
run: npx nx conformance:check
```
Learn more about [Conformance rules](/docs/enterprise/powerpack/conformance).
Learn more about [Conformance rules](/docs/enterprise/conformance).
{% /tabitem %}
{% /tabs %}
@@ -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
```
@@ -533,7 +533,7 @@ In this section, we'll explore how Nx Cloud can help your pull request get to gr
The `npx nx fix-ci` command that is already included in your GitHub Actions workflow (`github/workflows/ci.yml`) is responsible for enabling self-healing CI and will automatically suggest fixes to your failing tasks.
```yaml {32,33}
```yaml {% meta="{32,33}" %}
# .github/workflows/ci.yml
name: CI
@@ -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
```

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