Compare commits
116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 154fbd0626 | |||
| 4ea13b36cf | |||
| 6b1e914b99 | |||
| f676797246 | |||
| 51b494e8b4 | |||
| d92d8911e9 | |||
| 97d25a7392 | |||
| 2d53ffdb9e | |||
| 5e42dafee5 | |||
| 2a082f8701 | |||
| 8801be32dd | |||
| c03434cfe2 | |||
| f0e86e7fec | |||
| 629c17981f | |||
| f958ebc056 | |||
| 513cc4f3ab | |||
| 7e28def88f | |||
| 48d6f15d95 | |||
| ec7c80d526 | |||
| 036edb89be | |||
| ca791f84a7 | |||
| 66a50ed7cf | |||
| e46a7e16fd | |||
| 6bfedfffbb | |||
| 686cec19d2 | |||
| 7c4a69db45 | |||
| 11719666dc | |||
| 9891235672 | |||
| 386c771033 | |||
| 657c398294 | |||
| be1d475aa1 | |||
| 6d2389db73 | |||
| f07d064b87 | |||
| 7140c07041 | |||
| ab9639b67e | |||
| 0bddeeed4d | |||
| 3e87b78a58 | |||
| 7368452163 | |||
| c75e38d98d | |||
| dceed642ba | |||
| 64d05e872b | |||
| 16b8eeac90 | |||
| 3f5631e96c | |||
| d1105855a8 | |||
| 15c567c8a3 | |||
| 0853c5fd0d | |||
| 3d7f49a6d1 | |||
| fed069ba52 | |||
| cfead32fb5 | |||
| f24b97b3de | |||
| 2f12f5e260 | |||
| 53333ea539 | |||
| 906162374d | |||
| 34dede0b8b | |||
| 30e2fb35ac | |||
| cc58c7ee46 | |||
| ec9b131a22 | |||
| ca793a8653 | |||
| 266bb1a9f3 | |||
| 6e9869231b | |||
| 4f83a0025b | |||
| 54a269c5bd | |||
| 4b6009764a | |||
| b31f22b73f | |||
| d5202f635d | |||
| 8e9a7a2eb2 | |||
| af1d714199 | |||
| bf45a8b82a | |||
| 58d8eb1d9f | |||
| e07b73a55e | |||
| bd219b60eb | |||
| 8df823a3e9 | |||
| 686e973215 | |||
| 988f7f80c7 | |||
| 94b8180e4e | |||
| a7a33c3f40 | |||
| eb0a662676 | |||
| b3cd15f4d8 | |||
| 66bce4df1e | |||
| 4f3b544481 | |||
| 65192612f8 | |||
| 8b03d5f2f5 | |||
| db10e7599a | |||
| 8c30e71006 | |||
| 9205b88766 | |||
| 20c1de79c3 | |||
| 52d4a8efa5 | |||
| 0bd7b9f29b | |||
| d9424bcd99 | |||
| 465a188996 | |||
| 6e34433639 | |||
| 11df0ebdf3 | |||
| a89645ac44 | |||
| 5659e55c51 | |||
| 3695bd6f56 | |||
| 85a5a3aeb0 | |||
| 377bd571f2 | |||
| 69c1db3d4a | |||
| 99d8c802a4 | |||
| 319f343aba | |||
| 9df2d7daf1 | |||
| bdc341d17d | |||
| 1697825b7f | |||
| 114f90c8ef | |||
| 2089972d79 | |||
| af4c8d2638 | |||
| 0c550039f3 | |||
| 5914e4bded | |||
| 1f1d45c0bb | |||
| 5430558d1d | |||
| e43687078a | |||
| 6b49dc2271 | |||
| 23ad793b4d | |||
| dae7ca17e0 | |||
| 6807b5819c | |||
| 1aec22f27f |
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
main-branch-name: 'master'
|
||||
|
||||
- name: Start CI Run
|
||||
run: npx nx-cloud@next start-ci-run --fix-tasks="!*check-commit*" --auto-apply-fixes="*format:check*,*sync:check*,*conformance:check*,*format-native*,*lint-native*,*lint*,*astro-docs:validate-links*" --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
|
||||
run: npx nx-cloud@next start-ci-run --auto-apply-fixes="*format:check*,*sync:check*,*conformance:check*,*format-native*,*lint-native*,*lint*,*astro-docs:validate-links*" --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
pnpm nx-cloud record -- nx-cloud conformance:check
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners --parallel=1 --no-dte &
|
||||
pnpm nx run-many -t check-imports check-lock-files check-codeowners --parallel=1 --no-dte &
|
||||
pids+=($!)
|
||||
|
||||
pnpm nx affected --targets=lint,test,test-kt,build,e2e,e2e-ci,format-native,lint-native &
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
NX_USE_V8_SERIALIZER=false
|
||||
@@ -1,184 +1,76 @@
|
||||
common-env-vars: &common-env-vars
|
||||
GIT_AUTHOR_EMAIL: test@test.com
|
||||
GIT_AUTHOR_NAME: Test
|
||||
GIT_COMMITTER_EMAIL: test@test.com
|
||||
GIT_COMMITTER_NAME: Test
|
||||
SELECTED_PM: 'pnpm'
|
||||
NX_NATIVE_LOGGING: 'nx::native::db'
|
||||
# These are need for build and link validation for next.js and astro apps
|
||||
NEXT_PUBLIC_ASTRO_URL: 'https://master--nx-docs.netlify.app'
|
||||
NX_DEV_URL: 'https://canary.nx.dev'
|
||||
|
||||
common-init-steps: &common-init-steps
|
||||
- name: Checkout
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
|
||||
|
||||
- name: Cache restore
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
|
||||
inputs:
|
||||
key: 'pnpm-lock.yaml'
|
||||
paths: .pnpm-store
|
||||
base-branch: 'master'
|
||||
|
||||
# reads mise.toml and installs toolchains needed for repo
|
||||
- name: Setup toolchains
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/install-mise/main.yaml'
|
||||
|
||||
- name: Verify toolchain versions
|
||||
script: |
|
||||
echo "mise: $(mise --version)"
|
||||
echo "node: $(node --version)"
|
||||
echo "pnpm: $(pnpm --version)"
|
||||
echo "bun: $(bun --version)"
|
||||
echo "rust: $(rustc --version) - $(cargo --version)"
|
||||
echo "dotnet: $(dotnet --version)"
|
||||
echo "java: $(javac --version)"
|
||||
|
||||
- name: Install system deps
|
||||
script: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev zip unzip
|
||||
|
||||
- name: Pnpm Install from lockfile
|
||||
script: |
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install browsers
|
||||
script: |
|
||||
pnpm exec cypress install
|
||||
pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Install rust deps
|
||||
script: |
|
||||
cargo fetch
|
||||
|
||||
- name: Setup gradle
|
||||
script: |
|
||||
./gradlew wrapper
|
||||
./gradlew --version
|
||||
|
||||
- name: Configure git metadata (needed for lerna smoke tests)
|
||||
script: |
|
||||
git config --global user.email test@test.com
|
||||
git config --global user.name "Test Test"
|
||||
|
||||
launch-templates:
|
||||
linux-large:
|
||||
resource-class: 'docker_linux_amd64/large'
|
||||
image: 'us-east1-docker.pkg.dev/nxcloudoperations/nx-cloud/nx-agents-base-images:ubuntu22.04-node20.19-v1'
|
||||
env:
|
||||
GIT_AUTHOR_EMAIL: test@test.com
|
||||
GIT_AUTHOR_NAME: Test
|
||||
GIT_COMMITTER_EMAIL: test@test.com
|
||||
GIT_COMMITTER_NAME: Test
|
||||
SELECTED_PM: 'pnpm'
|
||||
NX_NATIVE_LOGGING: 'nx::native::db'
|
||||
# These are need for build and link validation for next.js and astro apps
|
||||
NEXT_PUBLIC_ASTRO_URL: 'https://master--nx-docs.netlify.app'
|
||||
NX_DEV_URL: 'https://canary.nx.dev'
|
||||
init-steps:
|
||||
- name: Checkout
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
|
||||
|
||||
- name: Check Node Version
|
||||
script: node --version
|
||||
|
||||
- name: Cache restore
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
|
||||
inputs:
|
||||
key: 'pnpm-lock.yaml'
|
||||
paths: .pnpm-store
|
||||
base-branch: 'master'
|
||||
|
||||
- name: Install zip and unzip
|
||||
script: sudo apt-get -yqq install zip unzip
|
||||
|
||||
- name: Install bun
|
||||
script: |
|
||||
curl -fsSL https://bun.sh/install | bash
|
||||
echo "BUN_INSTALL=$HOME/.bun" >> $NX_CLOUD_ENV
|
||||
echo "PATH=$HOME/.bun/bin:$PATH" >> $NX_CLOUD_ENV
|
||||
|
||||
- name: Check bun
|
||||
script: |
|
||||
bun --version
|
||||
|
||||
- name: Install e2e deps
|
||||
script: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
|
||||
|
||||
- name: Pnpm Install from lockfile
|
||||
script: |
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Browsers
|
||||
script: |
|
||||
pnpm exec cypress install
|
||||
pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Install Rust
|
||||
script: |
|
||||
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup toolchain install 1.70.0
|
||||
|
||||
- name: Configure git metadata (needed for lerna smoke tests)
|
||||
script: |
|
||||
git config --global user.email test@test.com
|
||||
git config --global user.name "Test Test"
|
||||
|
||||
- name: Load Cargo Env
|
||||
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
|
||||
|
||||
- name: Install Rust Dependencies
|
||||
script: |
|
||||
cargo fetch
|
||||
|
||||
- name: Setup Java 21
|
||||
script: |
|
||||
sudo apt update
|
||||
sudo apt install -y openjdk-21-jdk
|
||||
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
|
||||
java -version
|
||||
|
||||
- name: Setup Gradle
|
||||
script: |
|
||||
./gradlew wrapper
|
||||
./gradlew --version
|
||||
|
||||
- name: Setup .NET 9
|
||||
script: |
|
||||
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
||||
sudo dpkg -i packages-microsoft-prod.deb
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y dotnet-sdk-9.0
|
||||
dotnet --version
|
||||
env: *common-env-vars
|
||||
init-steps: *common-init-steps
|
||||
|
||||
linux-extra-large:
|
||||
resource-class: 'docker_linux_amd64/extra_large'
|
||||
image: 'us-east1-docker.pkg.dev/nxcloudoperations/nx-cloud/nx-agents-base-images:ubuntu22.04-node20.19-v1'
|
||||
env:
|
||||
GIT_AUTHOR_EMAIL: test@test.com
|
||||
GIT_AUTHOR_NAME: Test
|
||||
GIT_COMMITTER_EMAIL: test@test.com
|
||||
GIT_COMMITTER_NAME: Test
|
||||
SELECTED_PM: 'pnpm'
|
||||
NX_NATIVE_LOGGING: 'nx::native::db'
|
||||
# These are need for build and link validation for next.js and astro apps
|
||||
NEXT_PUBLIC_ASTRO_URL: 'https://master--nx-docs.netlify.app'
|
||||
NX_DEV_URL: 'https://canary.nx.dev'
|
||||
init-steps:
|
||||
- name: Checkout
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/checkout/main.yaml'
|
||||
|
||||
- name: Check Node Version
|
||||
script: node --version
|
||||
|
||||
- name: Cache restore
|
||||
uses: 'nrwl/nx-cloud-workflows/v5/workflow-steps/cache/main.yaml'
|
||||
inputs:
|
||||
key: 'pnpm-lock.yaml'
|
||||
paths: .pnpm-store
|
||||
base-branch: 'master'
|
||||
|
||||
- name: Install zip and unzip
|
||||
script: sudo apt-get -yqq install zip unzip
|
||||
|
||||
- name: Install bun
|
||||
script: |
|
||||
curl -fsSL https://bun.sh/install | bash
|
||||
echo "BUN_INSTALL=$HOME/.bun" >> $NX_CLOUD_ENV
|
||||
echo "PATH=$HOME/.bun/bin:$PATH" >> $NX_CLOUD_ENV
|
||||
|
||||
- name: Check bun
|
||||
script: |
|
||||
bun --version
|
||||
|
||||
- name: Install e2e deps
|
||||
script: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
|
||||
|
||||
- name: Pnpm Install from lockfile
|
||||
script: |
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Browsers
|
||||
script: |
|
||||
pnpm exec cypress install
|
||||
pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Install Rust
|
||||
script: |
|
||||
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup toolchain install 1.70.0
|
||||
|
||||
- name: Configure git metadata (needed for lerna smoke tests)
|
||||
script: |
|
||||
git config --global user.email test@test.com
|
||||
git config --global user.name "Test Test"
|
||||
|
||||
- name: Load Cargo Env
|
||||
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
|
||||
|
||||
- name: Install Rust Dependencies
|
||||
script: |
|
||||
cargo fetch
|
||||
|
||||
- name: Setup Java 21
|
||||
script: |
|
||||
sudo apt update
|
||||
sudo apt install -y openjdk-21-jdk
|
||||
sudo update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
|
||||
java -version
|
||||
|
||||
- name: Setup Gradle
|
||||
script: |
|
||||
./gradlew wrapper
|
||||
./gradlew --version
|
||||
|
||||
- name: Setup .NET 9
|
||||
script: |
|
||||
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
||||
sudo dpkg -i packages-microsoft-prod.deb
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y dotnet-sdk-9.0
|
||||
dotnet --version
|
||||
env: *common-env-vars
|
||||
init-steps: *common-init-steps
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
distribute-on:
|
||||
default: auto linux-large, 1 linux-extra-large
|
||||
default: auto linux-large, 3 linux-extra-large
|
||||
assignment-rules:
|
||||
# e2e-release tests must run sequentially due to shared git state and publishing operations
|
||||
- projects:
|
||||
- e2e-release
|
||||
targets:
|
||||
- e2e-ci**
|
||||
run-on:
|
||||
- agent: linux-large
|
||||
parallelism: 1
|
||||
|
||||
- projects:
|
||||
- e2e-gradle
|
||||
targets:
|
||||
- e2e-ci**
|
||||
run-on:
|
||||
- agent: linux-extra-large
|
||||
parallelism: 1
|
||||
|
||||
- projects:
|
||||
- nx
|
||||
- workspace
|
||||
- remix
|
||||
- nx-maven-plugin
|
||||
targets:
|
||||
- install
|
||||
- test
|
||||
run-on:
|
||||
- agent: linux-large
|
||||
parallelism: 1
|
||||
@@ -21,18 +24,22 @@ assignment-rules:
|
||||
parallelism: 1
|
||||
|
||||
- projects:
|
||||
- e2e-release
|
||||
- e2e-angular
|
||||
- e2e-react
|
||||
- e2e-next
|
||||
- e2e-web
|
||||
- e2e-eslint
|
||||
- e2e-remix
|
||||
- e2e-cypress
|
||||
- e2e-docker
|
||||
- e2e-js
|
||||
- e2e-nx-init
|
||||
- e2e-dotnet
|
||||
- e2e-workspace-create
|
||||
- e2e-rollup
|
||||
targets:
|
||||
- e2e-ci**react-package**
|
||||
- e2e-ci**react.test**
|
||||
- e2e-ci**react-router-ts-solution**
|
||||
- e2e-ci**next-e2e-and-snapshots**
|
||||
- e2e-ci**next-generation**
|
||||
- e2e-ci**next-ts-solutions**
|
||||
- e2e-ci**next-webpack**
|
||||
- e2e-ci**web**
|
||||
- e2e-ci**
|
||||
run-on:
|
||||
- agent: linux-large
|
||||
parallelism: 1
|
||||
@@ -70,6 +77,8 @@ assignment-rules:
|
||||
run-on:
|
||||
- agent: linux-large
|
||||
parallelism: 6
|
||||
- agent: linux-extra-large
|
||||
parallelism: 6
|
||||
|
||||
- targets:
|
||||
- "*"
|
||||
|
||||
@@ -14,7 +14,6 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
|
||||
/graph/** @philipjfulcher @FrozenPandaz @bcabanes @MaxKless @Coly010 @jaysoo @nartc
|
||||
/images @nrwl/nx-docs-reviewers
|
||||
/nx-dev/** @nrwl/nx-docs-reviewers
|
||||
/typedoc-theme @nrwl/nx-docs-reviewers
|
||||
|
||||
# Plugin Verticals
|
||||
|
||||
@@ -100,7 +99,7 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
|
||||
/e2e/storybook/** @nrwl/nx-storybook-reviewers
|
||||
|
||||
# Docker
|
||||
/packages/docker/** @nrwl/nx-core-reviewers @Coly010
|
||||
/packages/docker/** @nrwl/nx-core-reviewers @Coly010 @jaysoo
|
||||
|
||||
## Devkit
|
||||
/packages/devkit/** @nrwl/nx-devkit-reviewers
|
||||
@@ -134,6 +133,10 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
|
||||
/e2e/workspace-create/** @nrwl/nx-core-reviewers
|
||||
/e2e/release/** @nrwl/nx-core-reviewers
|
||||
|
||||
# .NET
|
||||
/packages/dotnet/** @FrozenPandaz @AgentEnder
|
||||
/e2e/dotnet/** @FrozenPandaz @AgentEnder
|
||||
|
||||
# Misc
|
||||
/e2e/lerna-smoke-tests/** @vsavkin @JamesHenry
|
||||
/e2e/utils/** @meeroslav @nrwl/nx-testing-tools-reviewers @vsavkin
|
||||
@@ -149,6 +152,7 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
|
||||
|
||||
# CI
|
||||
/.nx/workflows/** @nrwl/nx-pipelines-reviewers
|
||||
mise.toml @nrwl/nx-pipelines-reviewers @FrozenPandaz
|
||||
/.github/** @nrwl/nx-pipelines-reviewers
|
||||
/.husky/** @nrwl/nx-pipelines-reviewers
|
||||
/packages/workspace/src/generators/ci-workflow/** @nrwl/nx-pipelines-reviewers
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 204 KiB |
|
After Width: | Height: | Size: 171 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 101 KiB |
@@ -262,6 +262,75 @@ const currentVersion = versions.find((v) => v.current);
|
||||
>Discord</span
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
href={`${nxDevUrl}/resources-library?filterBy=book`}
|
||||
class="flex items-center gap-3 px-2 py-2 rounded-md no-underline hover:bg-slate-50 transition-colors dark:hover:bg-slate-800/60"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-slate-400 dark:text-slate-500"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"
|
||||
></path>
|
||||
</svg>
|
||||
<span
|
||||
class="text-sm font-medium text-slate-900 dark:text-slate-200"
|
||||
>Books</span
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
href={`${nxDevUrl}/resources-library?filterBy=case-study`}
|
||||
class="flex items-center gap-3 px-2 py-2 rounded-md no-underline hover:bg-slate-50 transition-colors dark:hover:bg-slate-800/60"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-slate-400 dark:text-slate-500"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
|
||||
></path>
|
||||
</svg>
|
||||
<span
|
||||
class="text-sm font-medium text-slate-900 dark:text-slate-200"
|
||||
>Case Studies</span
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
href={`${nxDevUrl}/resources-library?filterBy=whitepaper`}
|
||||
class="flex items-center gap-3 px-2 py-2 rounded-md no-underline hover:bg-slate-50 transition-colors dark:hover:bg-slate-800/60"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5 text-slate-400 dark:text-slate-500"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
|
||||
></path>
|
||||
</svg>
|
||||
<span
|
||||
class="text-sm font-medium text-slate-900 dark:text-slate-200"
|
||||
>Whitepapers</span
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Right Column -->
|
||||
<div class="space-y-4">
|
||||
@@ -445,7 +514,11 @@ const currentVersion = versions.find((v) => v.current);
|
||||
const tryNxCloudBtn = document.getElementById('header-try-nx-cloud-btn');
|
||||
|
||||
docsHomeLink?.addEventListener('click', () => {
|
||||
sendCustomEvent('documentation-click', 'header-navigation', 'documentation-header');
|
||||
sendCustomEvent(
|
||||
'documentation-click',
|
||||
'header-navigation',
|
||||
'documentation-header'
|
||||
);
|
||||
});
|
||||
|
||||
contactBtn?.addEventListener('click', () => {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
---
|
||||
// Copied from https://github.com/withastro/starlight/blob/f14eb0c/packages/starlight/components/PageFrame.astro with modifications.
|
||||
import MobileMenuToggle from '@astrojs/starlight/components/MobileMenuToggle.astro';
|
||||
import { Footer } from '@nx/nx-dev-ui-common';
|
||||
import { Footer, GitHubStarWidget } from '@nx/nx-dev-ui-common';
|
||||
import { WebinarNotifier } from '@nx/nx-dev-ui-common/src/lib/webinar-notifier';
|
||||
|
||||
const { hasSidebar } = Astro.locals.starlightRoute;
|
||||
const githubStarsCount = Astro.locals.githubStarsCount ?? 0;
|
||||
---
|
||||
|
||||
<div class="page sl-flex">
|
||||
@@ -18,22 +20,25 @@ const { hasSidebar } = Astro.locals.starlightRoute;
|
||||
<!-- CTA Buttons for Mobile Menu - Show when not in header (below xl breakpoint) -->
|
||||
<div class="mobile-cta-buttons xl:hidden mt-auto pt-4 pb-4 border-t border-slate-800 dark:border-slate-700">
|
||||
<div class="flex flex-col gap-2">
|
||||
<a
|
||||
href="https://nx.dev/contact"
|
||||
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 shadow-sm"
|
||||
title="Contact Us"
|
||||
>
|
||||
Contact
|
||||
</a>
|
||||
<a
|
||||
href="https://cloud.nx.app?utm_source=nx-dev&utm_medium=header"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline bg-blue-500 dark:bg-sky-500 text-white hover:bg-blue-600 dark:hover:bg-sky-600 shadow-sm"
|
||||
title="Login to Nx Cloud"
|
||||
>
|
||||
Login
|
||||
</a>
|
||||
<GitHubStarWidget starsCount={githubStarsCount} client:load />
|
||||
<div class="flex flex-col mx-2 gap-2">
|
||||
<a
|
||||
href="https://nx.dev/contact"
|
||||
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 shadow-sm"
|
||||
title="Contact Us"
|
||||
>
|
||||
Contact
|
||||
</a>
|
||||
<a
|
||||
href="https://cloud.nx.app?utm_source=nx-dev&utm_medium=header"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="w-full inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition no-underline bg-blue-500 dark:bg-sky-500 text-white hover:bg-blue-600 dark:hover:bg-sky-600 shadow-sm"
|
||||
title="Login to Nx Cloud"
|
||||
>
|
||||
Login
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,7 +47,8 @@ const { hasSidebar } = Astro.locals.starlightRoute;
|
||||
)
|
||||
}
|
||||
<div class="main-frame"><slot /></div>
|
||||
<Footer disableThemeSwitcher={true} useDomainPrefix={true} className="mt-32 dark:bg-slate-900" />
|
||||
<Footer disableThemeSwitcher={true} useDomainPrefix={true} className="dark:bg-slate-900" />
|
||||
<WebinarNotifier client:load />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
import MobileMenuFooter from '@astrojs/starlight/components/MobileMenuFooter.astro'
|
||||
import SidebarPersister from '@astrojs/starlight/components/SidebarPersister.astro'
|
||||
import SidebarSublist from './SidebarSublist.astro'
|
||||
import { GitHubStarWidget } from '@nx/nx-dev-ui-common';
|
||||
|
||||
const { sidebar } = Astro.locals.starlightRoute
|
||||
const githubStarsCount = Astro.locals.githubStarsCount ?? 0;
|
||||
---
|
||||
|
||||
<div class="sidebar-wrapper" data-testid="sidebar-wrapper">
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
---
|
||||
// recreated from https://github.com/withastro/starlight/blob/main/packages/starlight/components/TableOfContents.astro
|
||||
import TableOfContentsList from './TableOfContentsList.astro';
|
||||
import { GitHubStarWidget } from '@nx/nx-dev-ui-common';
|
||||
|
||||
const { toc } = Astro.locals.starlightRoute;
|
||||
const githubStarsCount = Astro.locals.githubStarsCount ?? 0;
|
||||
---
|
||||
|
||||
{
|
||||
toc && (
|
||||
<custom-toc data-min-h={toc.minHeadingLevel} data-max-h={toc.maxHeadingLevel}>
|
||||
<div class="github-star-widget-container">
|
||||
<GitHubStarWidget starsCount={githubStarsCount} client:load />
|
||||
</div>
|
||||
<nav aria-labelledby="starlight__on-this-page">
|
||||
<h2 id="starlight__on-this-page">{Astro.locals.t('tableOfContents.onThisPage')}</h2>
|
||||
<div class="toc-container">
|
||||
@@ -163,18 +168,17 @@ const { toc } = Astro.locals.starlightRoute;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* GitHub star widget styling */
|
||||
.github-star-widget-container {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Container with proper scrolling */
|
||||
.toc-container {
|
||||
/* Calculate height based on viewport minus nav and footer with padding */
|
||||
max-height: calc(100vh - var(--sl-nav-height) - 25rem);
|
||||
/*
|
||||
* prevent ToC from going to 0 height.
|
||||
* if this overlaps the footer it's not a huge issue for such small viewport
|
||||
* */
|
||||
min-height: 300px;
|
||||
/* Allow ToC to be its natural height - parent sticky container handles viewport constraints */
|
||||
max-height: calc(100vh - var(--sl-nav-height) - 4rem);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Only enable smooth scrolling if user doesn't prefer reduced motion */
|
||||
|
||||
@@ -24,21 +24,27 @@ const { data} = Astro.locals.starlightRoute.entry;
|
||||
}
|
||||
|
||||
@media (min-width: 72rem) {
|
||||
.lg\:sl-flex {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.right-sidebar-container {
|
||||
order: 2;
|
||||
position: relative;
|
||||
width: calc(
|
||||
var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2
|
||||
);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.right-sidebar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
position: sticky;
|
||||
top: var(--sl-nav-height);
|
||||
border-inline-start: 1px solid var(--sl-color-hairline);
|
||||
padding-top: var(--sl-nav-height);
|
||||
padding-top: 1rem;
|
||||
width: 100%;
|
||||
height: auto; // MODIFIED: full height conflicts with footer
|
||||
max-height: calc(100vh - var(--sl-nav-height));
|
||||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@ import { type GraphProps, Graph as Default } from '@nx/nx-dev-ui-markdoc/src/lib
|
||||
type Props = GraphProps;
|
||||
---
|
||||
|
||||
<Default client:visible {...Astro.props} />
|
||||
<Default client:visible={{rootMargin:"100px"}} {...Astro.props} />
|
||||
|
||||
@@ -14,7 +14,7 @@ Don't be too anxious about choosing the exact right folder structure from the be
|
||||
|
||||
For instance, if a project under the `booking` folder is now being shared by multiple apps, you can move it to the shared folder like this:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g move --project booking-some-project shared/some-project
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ nx g move --project booking-some-project shared/some-project
|
||||
|
||||
Similarly, if you no longer need a project, you can remove it with the [`@nx/workspace:remove` generator](/docs/reference/workspace/generators#remove).
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g remove booking-some-project
|
||||
```
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ Each executor definition has an `executor` property and, optionally, an `options
|
||||
|
||||
Once configured, you can run an executor the same way you would [run any target](/docs/features/run-tasks):
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx [command] [project]
|
||||
nx build cart
|
||||
```
|
||||
@@ -79,7 +79,7 @@ Nx comes with a Devkit that allows you to build your own executor to automate yo
|
||||
|
||||
You can use a specific configuration preset like this:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx [command] [project] --configuration=[configuration]
|
||||
nx build cart --configuration=production
|
||||
```
|
||||
|
||||
@@ -190,7 +190,7 @@ results.
|
||||
Note, only the flags passed to the npm scripts itself affect results of the computation. For instance, the following
|
||||
commands are identical from the caching perspective.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx build remixapp
|
||||
npx nx run-many -t build -p remixapp
|
||||
```
|
||||
@@ -201,13 +201,13 @@ If you build/test/lint… multiple projects, each individual build has its own h
|
||||
from
|
||||
cache or run. This means that from the caching point of view, the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t build -p header footer
|
||||
```
|
||||
|
||||
is identical to the following two commands:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx build header
|
||||
npx nx build footer
|
||||
```
|
||||
|
||||
@@ -51,7 +51,7 @@ Plugins are processed in the order that they appear in the `plugins` array in `n
|
||||
|
||||
To view the task settings for projects in your workspace, [show the project details](/docs/features/explore-graph) either from the command line or using Nx Console.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project my-project --web
|
||||
```
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ In CI, the sync generator is run in `--dry-run` mode and if files would be chang
|
||||
|
||||
Use the project details view to **find registered sync generators** for a given task.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project <name>
|
||||
```
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ There are two different methods that Nx supports for linking TypeScript projects
|
||||
|
||||
Create a new Nx workspace that links projects with package manager workspaces:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace
|
||||
```
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ filter: 'type:Guides'
|
||||
|
||||
Let's create a custom rule which we can then publish to Nx Cloud. We will first create a new library project to contain our rule (and any others we might create in the future):
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx generate @nx/js:library cloud-conformance-rules
|
||||
```
|
||||
|
||||
The Nx Cloud distribution mechanism expects each rule to be created in a named subdirectory in the `src/` directory of our new project, and each rule directory to contain an `index.ts` and a `schema.json` file. You can read more about [creating a conformance rule](/docs/reference/powerpack/conformance/create-conformance-rule) in the dedicated guide. For this recipe, we'll generate a default rule to use in the publishing process.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g @nx/conformance:create-rule --name=test-cloud-rule --directory=cloud-conformance-rules/src --category=reliability --description="A test cloud rule" --reporter=non-project-files-reporter
|
||||
```
|
||||
|
||||
@@ -50,7 +50,7 @@ We can now run `nx build cloud-conformance-rules` to build our rule and create t
|
||||
|
||||
Our final step is to publish the rule artifacts to Nx Cloud. We achieve this by running the `publish-conformance-rules` command on the `nx-cloud` CLI, passing the output path location as the first positional argument:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx-cloud publish-conformance-rules cloud-conformance-rules/dist
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ And create a new consumer.
|
||||
|
||||
Give the app a name. The callback URL is the important bit. It needs to be in this form:
|
||||
|
||||
```
|
||||
```text
|
||||
[your-nx-cloud-url]/auth-callback
|
||||
|
||||
# for example
|
||||
|
||||
@@ -26,7 +26,7 @@ And create a new OAuth app:
|
||||
|
||||
Give it a name, and a homepage URL. The authorization callback is the important bit. It needs to be in this form:
|
||||
|
||||
```
|
||||
```text
|
||||
[your-nx-cloud-url]/auth-callback
|
||||
|
||||
# for example
|
||||
|
||||
@@ -18,7 +18,7 @@ Then "Applications" from the left-hand menu:
|
||||
|
||||
Give the app a name. The authorization callback is the important bit. It needs to be in this form:
|
||||
|
||||
```
|
||||
```text
|
||||
[your-nx-cloud-url]/auth-callback
|
||||
|
||||
# for example
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
---
|
||||
title: SAML Auth
|
||||
description: Configure SAML authentication for Nx Cloud Enterprise with Azure AD or Okta
|
||||
filter: 'type:Guides'
|
||||
---
|
||||
|
||||
{% tabs syncKey="saml-idp" %}
|
||||
{% tabitem label="Azure AD" %}
|
||||
|
||||
{% steps %}
|
||||
|
||||
1. Create a new enterprise app
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
2. Choose “Create your own”:
|
||||
|
||||

|
||||
|
||||
3. Give it a name
|
||||
|
||||

|
||||
|
||||
4. Assign your users and/or groups to it:
|
||||
|
||||

|
||||
|
||||
5. Then set-up SSO
|
||||
|
||||

|
||||
|
||||
6. And choose SAML:
|
||||
|
||||

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

|
||||
|
||||
8. Scroll down and manage claims:
|
||||
|
||||

|
||||
|
||||
9. The first row should be the `email` claim, click to Edit it:
|
||||
|
||||

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

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

|
||||
|
||||
For **Signing Option**, select **Sign SAML response and assertion**
|
||||
|
||||

|
||||
|
||||
Then click **Save** and close the popover.
|
||||
|
||||
12. Download the certificate in **Base64**:
|
||||
|
||||

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

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

|
||||
|
||||

|
||||
|
||||
2. Give it a name:
|
||||
|
||||

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

|
||||
|
||||
4. Under **Advanced Settings**, make sure both **Response** and **Assertion** are set to **Signed**
|
||||
|
||||

|
||||
|
||||
5. Scroll down to attribute statements and configure them as per below:
|
||||
|
||||

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

|
||||
|
||||
8. Then in the Sign-On tab scroll down:
|
||||
|
||||

|
||||
|
||||
9. Scroll down and from the list of certificates, download the one with the “Active” status:
|
||||
|
||||

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

|
||||
|
||||
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"
|
||||
/>
|
||||
```
|
||||
|
||||

|
||||
|
||||
{% /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
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
2. Choose "Create your own":
|
||||
|
||||

|
||||
|
||||
3. Give it a name
|
||||
|
||||

|
||||
|
||||
4. Assign your users and/or groups to it:
|
||||
|
||||

|
||||
|
||||
5. Then set-up SSO
|
||||
|
||||

|
||||
|
||||
6. And choose SAML:
|
||||
|
||||

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

|
||||
|
||||
8. Scroll down and manage claims:
|
||||
|
||||

|
||||
|
||||
9. The first row should be the `email` claim, click to Edit it:
|
||||
|
||||

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

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

|
||||
|
||||
For **Signing Option**, select **Sign SAML response and assertion**
|
||||
|
||||

|
||||
|
||||
Then click **Save** and close the popover.
|
||||
|
||||
12. Download the certificate in **Base64**:
|
||||
|
||||

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

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

|
||||
|
||||

|
||||
|
||||
2. Give it a name:
|
||||
|
||||

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

|
||||
|
||||
4. Under **Advanced Settings**, make sure both **Response** and **Assertion** are set to **Signed**
|
||||
|
||||

|
||||
|
||||
5. Scroll down to attribute statements and configure them as per below:
|
||||
|
||||

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

|
||||
|
||||
8. Then in the Sign-On tab scroll down:
|
||||
|
||||

|
||||
|
||||
9. Scroll down and from the list of certificates, download the one with the "Active" status:
|
||||
|
||||

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

|
||||
|
||||
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"
|
||||
/>
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 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**
|
||||
|
||||

|
||||
|
||||
### 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**
|
||||
|
||||

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

|
||||
|
||||
### Add custom attribute for access specification
|
||||
|
||||
1. Under **Directory** section, navigate to **Profile Editor**
|
||||
2. Select your SAML application
|
||||
|
||||

|
||||
|
||||
1. Click **Add Attribute**
|
||||
|
||||

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

|
||||
|
||||
### Provision users
|
||||
|
||||
Select the appropriate `nxCloudAccessSpec` value when you assign your SAML application to your Groups.
|
||||
|
||||

|
||||
|
||||
## Connect Your Nx Cloud Installation to Your SAML Set Up
|
||||
|
||||
Contact your developer productivity engineer to connect your Nx Cloud instance to the SAML configuration.
|
||||
@@ -38,7 +38,7 @@ If you are unsure how to proceed, starting with a trial process is recommended,
|
||||
|
||||
To register the activation key in your repository, run the `nx register` command.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx register YOUR_ACTIVATION_KEY
|
||||
```
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ These packages are used to set up a new project in some form.
|
||||
|
||||
Customizing your initial project setup is already possible with an [Nx Preset generator](/docs/extending-nx/create-preset). By creating and shipping a generator named `preset` in your Nx plugin, you can then pass it via the `--preset` flag to the `create-nx-workspace` command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace --preset my-plugin
|
||||
```
|
||||
|
||||
@@ -29,13 +29,13 @@ There are a few methods to create a package that will work with `create-nx-works
|
||||
|
||||
You can setup a new Nx plugin workspace and immediately pass the `--create-package-name`:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-plugin my-plugin --create-package-name create-my-plugin
|
||||
```
|
||||
|
||||
Alternatively, if you already have an existing Nx plugin workspace, you can run the following generator to set up a new create package:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g create-package create-my-plugin --project my-plugin
|
||||
```
|
||||
|
||||
@@ -118,7 +118,7 @@ _(If you don't have such a `local-registry` target, refer to the following [docs
|
||||
|
||||
By running
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx local-registry
|
||||
```
|
||||
|
||||
@@ -130,7 +130,7 @@ Note, after terminating the terminal window where the `nx local-registry` comman
|
||||
|
||||
Next, you can **publish** your packages to your new local registry. All of the generated packages can use `nx release` to publish whatever is in your `build` output folder, so you can simply run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many --targets build
|
||||
npx nx release version 1.0.0
|
||||
npx nx release publish --tag latest
|
||||
@@ -138,7 +138,7 @@ npx nx release publish --tag latest
|
||||
|
||||
Once the packages are published, you should be able to test the behavior of your "create package" as follows:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-my-plugin test-workspace
|
||||
```
|
||||
|
||||
@@ -146,7 +146,7 @@ npx create-my-plugin test-workspace
|
||||
|
||||
When setting up the workspace, you should also have gotten a `my-plugin-e2e` package. This package contains the e2e tests for your plugin, and can be run with the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx e2e my-plugin-e2e
|
||||
```
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ All first-party Nx presets are built into Nx itself, but you can [create your ow
|
||||
|
||||
To use a concrete example, let's look at the [`qwik-nx`](https://www.npmjs.com/package/qwik-nx) Nx community plugin. They include a [preset generator](https://github.com/qwikifiers/qwik-nx/tree/main/packages/qwik-nx/src/generators/preset) that you can use to create a new Nx workspace with Qwik support.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace --preset=qwik-nx
|
||||
```
|
||||
|
||||
@@ -28,7 +28,7 @@ npx create-nx-workspace --preset=qwik-nx
|
||||
|
||||
If you **don't** have an existing plugin you can create one by running
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-plugin my-org --pluginName my-plugin
|
||||
```
|
||||
|
||||
@@ -36,7 +36,7 @@ npx create-nx-plugin my-org --pluginName my-plugin
|
||||
|
||||
To create our preset inside of our plugin we can run
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx generate @nx/plugin:generator packages/happynrwl/src/generators/preset
|
||||
```
|
||||
|
||||
@@ -104,6 +104,6 @@ Before you are able to use your newly created preset you must package and publis
|
||||
|
||||
After you have published your plugin to a registry you can now use your preset when creating a new workspace
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace my-workspace --preset=my-plugin-name
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ You can create a new sync generator by hand or use the built-in generator that N
|
||||
|
||||
Make sure you have `@nx/plugin` installed or add it to your workspace:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/plugin
|
||||
```
|
||||
|
||||
@@ -26,7 +26,7 @@ nx add @nx/plugin
|
||||
|
||||
Create a new local plugin where we can add our new sync generator. You can also add it to an existing local plugin if you already have one. In that case you can skip this step.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g @nx/plugin:plugin tools/my-plugin
|
||||
```
|
||||
|
||||
@@ -34,7 +34,7 @@ nx g @nx/plugin:plugin tools/my-plugin
|
||||
|
||||
Create a sync generator the same way you would [create any generator](/docs/extending-nx/local-generators).
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g @nx/plugin:generator --path=tools/my-plugin/src/generators/my-sync-generator
|
||||
```
|
||||
|
||||
@@ -181,7 +181,7 @@ For projects using [inferred targets](/docs/concepts/inferred-tasks) (no project
|
||||
{% aside type="caution" title="Verify the name of your plugin" %}
|
||||
You might have to adjust the name of your plugin based on your specific workspace scope. Verify the name in `tools/my-plugin/package.json`. If the name there is `@myorg/my-plugin` you have to register it as:
|
||||
|
||||
```
|
||||
```jsonc
|
||||
{
|
||||
"syncGenerators": ["@myorg/my-plugin:my-sync-generator"]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: CreateNodes API Compatibility
|
||||
description: Understand which createNodes API version is used by different Nx versions and how to write plugins that support multiple Nx versions.
|
||||
filter: 'type:Reference'
|
||||
filter: 'type:References'
|
||||
---
|
||||
|
||||
This is a reference for knowing how Nx versions and the `createNodes`/`createNodesV2` APIs interact. If you plan on supporting multiple Nx versions with a custom plugin, then it's important to know which APIs to use.
|
||||
|
||||
@@ -82,7 +82,7 @@ nx generate my-generator mylib
|
||||
|
||||
The following information will be displayed.
|
||||
|
||||
```{% title="nx generate my-generator mylib" %}
|
||||
```text {% title="nx generate my-generator mylib" %}
|
||||
CREATE libs/mylib/README.md
|
||||
CREATE libs/mylib/.babelrc
|
||||
CREATE libs/mylib/src/index.ts
|
||||
|
||||
@@ -23,7 +23,7 @@ Get started developing your own plugin with a few terminal commands:
|
||||
{% tabs %}
|
||||
{% tabitem label="Create a plugin in a new workspace" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-plugin my-plugin
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ npx create-nx-plugin my-plugin
|
||||
|
||||
{% tabitem label="Add a plugin to an existing workspace" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx add @nx/plugin
|
||||
npx nx g plugin tools/my-plugin
|
||||
```
|
||||
@@ -59,7 +59,7 @@ You can follow along with one of the step by step tutorials below that is focuse
|
||||
|
||||
Wire up a new generator with this terminal command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g generator my-plugin/src/generators/library-with-readme
|
||||
```
|
||||
|
||||
@@ -110,7 +110,7 @@ The template files that are used in the `generateFiles` function can inject vari
|
||||
|
||||
You can test your generator in dry-run mode with the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g my-plugin:library-with-readme mylib --dry-run
|
||||
```
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ This guide shows you how to create, run, and customize executors within your Nx
|
||||
|
||||
If you don't already have a plugin, use Nx to generate one:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/plugin
|
||||
nx g @nx/plugin:plugin tools/my-plugin
|
||||
```
|
||||
|
||||
Use the Nx CLI to generate the initial files needed for your executor.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx generate @nx/plugin:executor tools/my-plugin/src/executors/echo
|
||||
```
|
||||
|
||||
@@ -126,13 +126,13 @@ If your package.json has a different name, adjust the command accordingly.
|
||||
|
||||
Finally, you run the executor via the CLI as follows:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx run my-project:echo
|
||||
```
|
||||
|
||||
To which we'll see the console output:
|
||||
|
||||
```{% title="nx run my-project:echo" frame="terminal" %}
|
||||
```text {% title="nx run my-project:echo" frame="terminal" %}
|
||||
Executing "echo"...
|
||||
Options: {
|
||||
"textToEcho": "Hello World"
|
||||
|
||||
@@ -18,7 +18,7 @@ caption="Demoes how to use Nx generators in a PNPM workspace to automate the cre
|
||||
|
||||
If you don't already have a local plugin, use Nx to generate one:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/plugin
|
||||
nx g @nx/plugin:plugin tools/my-plugin
|
||||
```
|
||||
@@ -101,7 +101,7 @@ The `$default` object is used to read arguments from the command-line that are p
|
||||
|
||||
To run a generator, invoke the `nx generate` command with the name of the generator.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx generate @myorg/my-plugin:my-generator mylib
|
||||
```
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ For this example, we'll create a new migration generator that updates repos to u
|
||||
|
||||
### 1. Generate a migration
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx generate @nx/plugin:migration libs/pluginName/src/migrations/change-executor-name \
|
||||
--name='Change Executor Name' \
|
||||
--packageVersion=2.0.1 \
|
||||
|
||||
@@ -17,13 +17,13 @@ In this tutorial, we will create a generator that helps enforce the follow best
|
||||
|
||||
Let's first create a new workspace with the `create-nx-workspace` command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace myorg --preset=react-monorepo --ci=github
|
||||
```
|
||||
|
||||
Then we , install the `@nx/plugin` package and generate a plugin:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx add @nx/plugin
|
||||
npx nx g @nx/plugin:plugin tools/recommended
|
||||
```
|
||||
@@ -34,7 +34,7 @@ This will create a `recommended` project that contains all your plugin code.
|
||||
|
||||
To create a new generator run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx generate @nx/plugin:generator tools/recommended/src/generators/library
|
||||
```
|
||||
|
||||
@@ -70,7 +70,7 @@ We're returning the `callbackAfterFilesUpdated` function because the `@nx/react:
|
||||
|
||||
To try out the generator in dry-run mode, use the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g @myorg/recommended:library test-library --dry-run
|
||||
```
|
||||
|
||||
@@ -139,7 +139,7 @@ The schema files not only provide structure to the CLI, but also allow [Nx Conso
|
||||
|
||||
Notice how we made the `description` argument optional in both the JSON and type files. If we call the generator without passing a directory, the project will be created in a directory with same name as the project. We can test the changes to the generator with the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g @myorg/recommended:library test-library --directory=nested/directory/test-library --dry-run
|
||||
```
|
||||
|
||||
@@ -245,7 +245,7 @@ export default libraryGenerator;
|
||||
|
||||
We can check that the scope logic is being applied correctly by running the generator again and specifying a scope.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g @myorg/recommended:library test-library --scope=shared --dry-run
|
||||
```
|
||||
|
||||
@@ -316,7 +316,7 @@ We updated the generator to use some new helper functions from the Nx devkit. He
|
||||
|
||||
Now let's check to make sure that the `clearMocks` property is set correctly by the generator. First, we'll commit our changes so far. Then, we'll run the generator without the `--dry-run` flag so we can inspect the file contents.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git add .
|
||||
git commit -am "library generator"
|
||||
npx nx g @myorg/recommended:library store-test --scope=store
|
||||
|
||||
@@ -12,7 +12,7 @@ In order to use your plugin in other workspaces or share it with the community,
|
||||
|
||||
After that, you can then install your plugin like any other Nx plugin -
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add nx-cfonts
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ In this tutorial, we'll create a plugin that helps to integrate the _Astro_ fram
|
||||
|
||||
To create a plugin in a brand new repository, use the `create-nx-plugin` command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-plugin nx-astro
|
||||
```
|
||||
|
||||
@@ -197,7 +197,7 @@ If you create a generator named `init`, Nx will automatically run that generator
|
||||
|
||||
To create the generator run the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g generator src/generators/init
|
||||
```
|
||||
|
||||
@@ -269,7 +269,7 @@ export interface InitGeneratorSchema {}
|
||||
|
||||
Let's make one more generator to automatically create a simple Astro application. First we'll create the generator:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g generator src/generators/application
|
||||
```
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ This drastically improves the speed of your CI and reduces the amount of compute
|
||||
|
||||
To leverage this feature, use the following command when running your tasks, particularly on CI:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx affected -t <task>
|
||||
```
|
||||
|
||||
@@ -225,7 +225,7 @@ Once the projects are identified, Nx runs the tasks you specified on that subset
|
||||
|
||||
You can also visualize the affected projects using the [Nx graph](/docs/features/explore-graph). Simply run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx graph --affected
|
||||
```
|
||||
|
||||
@@ -244,14 +244,14 @@ To understand which projects are affected, Nx uses the Git history and the [proj
|
||||
|
||||
The affected command takes a `base` and `head` commit. The default `base` is your `main` branch, and the default `head` is your current file system. This is generally what you want when developing locally, but in CI, you need to customize these values.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx affected -t build --base=origin/main --head=$PR_BRANCH_NAME # where PR_BRANCH_NAME is defined by your CI system
|
||||
nx affected -t build --base=origin/main~1 --head=origin/main # rerun what is affected by the last commit in main
|
||||
```
|
||||
|
||||
You can also set the base and head SHAs as environment variables:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
NX_BASE=origin/main~1
|
||||
NX_HEAD=origin/main
|
||||
```
|
||||
|
||||
@@ -29,7 +29,7 @@ Nx Agents offer several key advantages:
|
||||
|
||||
To enable task distribution with Nx Agents, make sure your Nx workspace is connected to Nx Cloud. If you haven't connected your workspace to Nx Cloud yet, run the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
@@ -37,7 +37,7 @@ Check out the [connect to Nx Cloud recipe](/docs/guides/nx-cloud/setup-ci) for m
|
||||
|
||||
Then, adjust your CI pipeline configuration to **enable task distribution**. If you don't have a CI config yet, you can generate a new one using the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g ci-workflow
|
||||
```
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
---
|
||||
title: Explain with AI
|
||||
description: Get AI-powered explanations and resolution steps for failed tasks in Nx Cloud
|
||||
sidebar:
|
||||
order: 17
|
||||
badge: beta
|
||||
filter: 'type:Features'
|
||||
---
|
||||
|
||||
{% youtube
|
||||
src="https://youtu.be/g2m9cHp-O-Q"
|
||||
title="Explain with AI"
|
||||
/%}
|
||||
|
||||
"Explain with AI" helps you understand complex errors more quickly by providing AI-powered error resolution steps. This is made possible by using additional context from Nx targets and metadata, allowing for more accurate and relevant responses.
|
||||
|
||||

|
||||
|
||||
## 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".
|
||||
|
||||

|
||||
|
||||
{% 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.
|
||||

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

|
||||
|
||||
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 %}
|
||||
|
||||

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

|
||||
|
||||

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

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

|
||||
|
||||
The **Activity** tab displays a timeline of all executions, showing when the task failed and succeeded to jump directly into the runs.
|
||||
|
||||

|
||||
|
||||
The **Environments** tab provides insights into the different environments where the task was executed, helping identify if certain environments contribute to flakiness.
|
||||
|
||||

|
||||
|
||||
@@ -27,7 +27,7 @@ Nx **restores terminal output, along with the files and artifacts** created from
|
||||
|
||||
To use **Nx Replay**, you need to connect your workspace to Nx Cloud (if you haven't already).
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ To enable Self-Healing CI in your workspace, you'll need to connect to Nx Cloud
|
||||
|
||||
If you haven't already connected to Nx Cloud, run the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
@@ -56,6 +56,11 @@ jobs:
|
||||
|
||||
### Enable Auto-fixing
|
||||
|
||||
{% youtube
|
||||
src="https://youtu.be/EmZcENiCG64"
|
||||
title="Enable Auto-fixing"
|
||||
/%}
|
||||
|
||||
By default, Self-Healing CI proposes a fix for you to review and only applies it automatically to your PR after you confirm it. However, for some tasks, it makes sense to have them be auto-fixed without waiting for manual approval. Auto-fixes are only applied if the verification phase passes.
|
||||
|
||||
Below is an example of enabling auto-fixing for the Nx `format` command and `lint` tasks using the [`--auto-apply-fixes`](/docs/reference/nx-cloud-cli#--auto-apply-fixes) flag:
|
||||
@@ -78,6 +83,11 @@ Tasks are passed to the `--auto-apply-fixes` as `<project>:<task-name>:<configur
|
||||
|
||||
### Specify Which Tasks to Fix
|
||||
|
||||
{% youtube
|
||||
src="https://youtu.be/KSb48zHbaHg"
|
||||
title="Specify Which Tasks to Fix"
|
||||
/%}
|
||||
|
||||
By using the [`--fix-tasks`](/docs/reference/nx-cloud-cli#--fix-tasks) flag you can fine-tune which tasks should be considered by the Nx Cloud self-healing CI. Below is an example of running self-healing on all tasks except `deploy` and `test` tasks.
|
||||
|
||||
```yaml
|
||||
@@ -99,6 +109,48 @@ Similarly, if you only want to self-heal linting tasks you'd use `--fix-tasks="*
|
||||
|
||||
Tasks are passed to the `--fix-tasks` as `<project>:<task-name>:<configuration>`. Commands like `nx format` which you configure with `nx-cloud record --` are passed as `nx-cloud record -- <params>`.
|
||||
|
||||
### Customize Self-Healing Behavior
|
||||
|
||||
You can customize how Self-Healing CI behaves in your workspace by creating a `CLAUDE.md` file in your repository root. This file allows you to define custom classification rules and predefined fixes tailored to your project's specific needs.
|
||||
|
||||
#### Customize Failure Classification
|
||||
|
||||
Before proposing a fix, the Self-Healing CI agent classifies each failure into one of three categories:
|
||||
|
||||
- **`code_change`** - Failures directly caused by PR changes. Self-Healing will _propose and implement code fixes_.
|
||||
- **`environment_state`** - Failures caused by environmental issues (network errors, service outages, resource constraints). Self-Healing will _not propose fixes_.
|
||||
- **`flaky_task`** - Non-deterministic failures from timing issues or race conditions. Self-Healing _detects the flakiness and retriggers a pipeline run for the flaky task_.
|
||||
|
||||
You can override the default classification behavior with custom rules in `CLAUDE.md` by describing the nature of the error as well as one of the before mentioned categories:
|
||||
|
||||
```markdown
|
||||
// CLAUDE.md
|
||||
|
||||
## Self-Healing CI
|
||||
|
||||
### Classification Customization
|
||||
|
||||
When analyzing failures, override the default classification in these cases:
|
||||
|
||||
- If there are errors about missing environment variables (like API_KEY, DATABASE_URL, etc.) classify them as 'environment_state'.
|
||||
```
|
||||
|
||||
#### Define Predefined Fixes
|
||||
|
||||
For common, deterministic failures, you can define predefined fixes that Self-Healing CI should apply automatically. This is particularly useful for tasks that have standard, repeatable solutions. Here's an example to trigger `lint --fix` instead of having the AI attempt to implement the fix:
|
||||
|
||||
```markdown
|
||||
// CLAUDE.md
|
||||
|
||||
## Self-Healing CI
|
||||
|
||||
Predefined fix:
|
||||
|
||||
- If a failed task id contains ":lint", fix it by running linting on the project where it failed with the `--fix` flag. Example: `nx run myapp:lint --fix` where "myapp" is the app the task failed on.
|
||||
```
|
||||
|
||||
These predefined fixes allow Self-Healing CI to apply deterministic solutions without needing to analyze the code, speeding up the fix generation process for common scenarios.
|
||||
|
||||
## How Self-Healing CI works
|
||||
|
||||
Here's what happens when you push a PR with Self-Healing CI enabled:
|
||||
|
||||
@@ -26,7 +26,7 @@ Manually splitting these slow tasks can be complex and require ongoing maintenan
|
||||
|
||||
To use **automated task splitting**, you need to connect your workspace to Nx Cloud (if you haven't already).
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
@@ -39,28 +39,28 @@ Run this command to set up inferred tasks and enable task splitting for each plu
|
||||
{% tabs syncKey="test-runner" %}
|
||||
{% tabitem label="Cypress" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/cypress
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="Playwright" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/playwright
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="Jest" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/jest
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="Gradle" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/gradle
|
||||
```
|
||||
|
||||
@@ -87,7 +87,7 @@ If you are already using the `@nx/cypress`, `@nx/playwright`, `@nx/jest`, or `@n
|
||||
- [Configure Cypress Task Splitting](/docs/technologies/test-tools/cypress/introduction#nxcypress-configuration)
|
||||
- [Configure Playwright Task Splitting](/docs/technologies/test-tools/playwright/introduction#nxplaywright-configuration)
|
||||
- [Configure Jest Task Splitting](/docs/technologies/test-tools/jest/introduction#splitting-e2e-tests)
|
||||
- [Configure Gradle Testing Task Splitting](/docs/technologies/java/introduction#test-distribution)
|
||||
- [Configure Gradle Testing Task Splitting](/docs/technologies/java/gradle/introduction#test-distribution)
|
||||
|
||||
## Verify Automated Task Splitting Works
|
||||
|
||||
@@ -96,7 +96,7 @@ Run the following command to open the project detail view for your test project:
|
||||
{% tabs %}
|
||||
{% tabitem label="CLI" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project my-project-e2e
|
||||
```
|
||||
|
||||
@@ -422,7 +422,7 @@ If you configured Nx Atomizer properly, you'll see that there are tasks named `e
|
||||
|
||||
During local development, you'll want to continue using the base task (e.g., `e2e`, `test`) as it is more efficient on a single machine.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx e2e my-project-e2e
|
||||
```
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Keeping your tooling up to date is crucial for the health of your project. Tooli
|
||||
|
||||
To update your workspace, run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest migrate latest
|
||||
```
|
||||
|
||||
@@ -66,7 +66,7 @@ You can intervene at each step and make adjustments as needed for your specific
|
||||
|
||||
First, run the `migrate` command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx migrate latest
|
||||
```
|
||||
|
||||
@@ -89,7 +89,7 @@ Now, you can **inspect `package.json` to see if the changes make sense**. Someti
|
||||
|
||||
You can now run the actual code migrations that were generated in the `migrations.json` in the previous step.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx migrate --run-migrations
|
||||
```
|
||||
|
||||
@@ -109,13 +109,13 @@ Note: You may want to keep the `migrations.json` until every branch that was cre
|
||||
|
||||
If you have any [Nx community plugins](/docs/plugin-registry) installed you need to migrate them individually (assuming they provide migration scripts) by using the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx migrate my-plugin
|
||||
```
|
||||
|
||||
For a list of all the plugins you currently have installed, run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx report
|
||||
```
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ By default, Nx caches task results locally. The biggest benefit of caching comes
|
||||
|
||||
To enable remote caching, connect your workspace to [Nx Cloud](https://nx.dev/nx-cloud) by running the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
@@ -157,7 +157,7 @@ When using [Nx plugins](/docs/concepts/nx-plugins), many tasks have caching conf
|
||||
|
||||
For example, if you add the `@nx/vite` plugin using the following command...
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx add @nx/vite
|
||||
```
|
||||
|
||||
@@ -167,7 +167,7 @@ This means **you don't need to manually specify cacheable operations for Vite ta
|
||||
|
||||
To view the task settings that have been automatically configured by a plugin, use the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project <project-name> --web
|
||||
```
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ Once you have tagged your projects, configure the dependency constraints based o
|
||||
|
||||
For JavaScript/TypeScript projects, configure the `@nx/enforce-module-boundaries` ESLint rule:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/eslint-plugin @nx/devkit
|
||||
```
|
||||
|
||||
@@ -201,7 +201,7 @@ Read more about [ESLint rule options](/docs/technologies/eslint/eslint-plugin/gu
|
||||
|
||||
For any project type or to enforce boundaries on the complete dependency graph, use the Conformance plugin:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx add @nx/conformance
|
||||
```
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ These are some of the available tools which the Nx MCP server exposes:
|
||||
|
||||
To configure Nx for AI agents and AI-Assistants, run the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx configure-ai-agents
|
||||
```
|
||||
|
||||
@@ -79,7 +79,7 @@ For other MCP-compatible clients (that do not have Nx Console available) like Cl
|
||||
|
||||
Here's an example of how to register it for Claude Code:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
claude mcp add nx-mcp npx nx-mcp@latest
|
||||
```
|
||||
|
||||
@@ -91,7 +91,7 @@ claude mcp add nx-mcp npx nx-mcp@latest
|
||||
|
||||
Ask your AI assistant about your workspace structure and get detailed, accurate responses about projects, their types, and relationships:
|
||||
|
||||
```
|
||||
```text
|
||||
What is the structure of this workspace?
|
||||
How are the projects organized?
|
||||
```
|
||||
@@ -107,7 +107,7 @@ With Nx MCP, your AI assistant can:
|
||||
|
||||
You can also get informed suggestions about where to implement new functionality:
|
||||
|
||||
```
|
||||
```text
|
||||
Where should I implement a feature for adding products to cart?
|
||||
```
|
||||
|
||||
@@ -140,7 +140,7 @@ Learn more about CI integration in our blog post [Save Time: Connecting Your Edi
|
||||
|
||||
Nx generators provide predictable code scaffolding, while AI adds intelligence and contextual understanding. Instead of having the AI generate everything from scratch, you get the best of both worlds:
|
||||
|
||||
```
|
||||
```text
|
||||
Create a new React library into the packages/orders/feat-cancel-orders folder
|
||||
and call the library with the same name of the folder structure. Afterwards,
|
||||
also connect it to the main shop application.
|
||||
@@ -163,7 +163,7 @@ This approach ensures consistent code that follows your organization's best prac
|
||||
|
||||
Get accurate guidance on Nx configuration without worrying about hallucinations or outdated information:
|
||||
|
||||
```
|
||||
```text
|
||||
Can you configure Nx release for the packages of this workspace?
|
||||
Update nx.json with the necessary configuration using conventional commits
|
||||
as the versioning strategy.
|
||||
@@ -184,7 +184,7 @@ Learn more about documentation-aware configuration in our blog post [Making Curs
|
||||
|
||||
Understand the impact of changes across your monorepo with questions like:
|
||||
|
||||
```
|
||||
```text
|
||||
If I change the public API of feat-product-detail, which other projects
|
||||
might be affected by that change?
|
||||
```
|
||||
|
||||
@@ -282,7 +282,7 @@ It always stays up to date without having to actively maintain a document as it
|
||||
|
||||
To launch the project graph visualization for your workspace, use [Nx Console](/docs/getting-started/editor-setup) or run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx graph
|
||||
```
|
||||
|
||||
@@ -545,7 +545,7 @@ Try playing around with a [fully interactive graph on a sample repo](https://nrw
|
||||
|
||||
If you prefer to analyze the underlying data of the project graph with a script or some other tool, you can run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx graph --file=output.json
|
||||
```
|
||||
|
||||
@@ -566,7 +566,7 @@ Some moments which you may want to share these images are:
|
||||
|
||||
Nx uses the project graph of your workspace to determine the order in which to [run tasks](/docs/features/run-tasks). Pass the `--graph` flag to view the **task graph** which is executed by Nx when running a command.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx build myreactapp --graph # View the graph for building myreactapp
|
||||
nx run-many --targets build --graph # View the graph for building all projects
|
||||
nx affected --targets build --graph # View the graph for building the affected projects
|
||||
|
||||
@@ -20,13 +20,13 @@ Generators come as part of [Nx plugins](/docs/concepts/nx-plugins) and can be in
|
||||
|
||||
Here's an example of generating a React library:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g @nx/react:lib packages/mylib
|
||||
```
|
||||
|
||||
You can also specify just the generator name and Nx will prompt you to pick between the installed plugins that provide a generator with that name.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx g lib packages/mylib
|
||||
```
|
||||
|
||||
@@ -34,7 +34,7 @@ When running this command, you could be prompted to choose between the `@nx/reac
|
||||
|
||||
To see a list of available generators in a given plugin, run `nx list <plugin-name>`. As an example, to list all generators in the @nx/react plugin:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx list @nx/react
|
||||
```
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Nx provides a set of tools to help you manage your releases called `nx release`.
|
||||
|
||||
> We recommend always starting with --dry-run, because publishing is difficult to undo
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx release --dry-run
|
||||
```
|
||||
|
||||
@@ -34,12 +34,12 @@ By default, when you run `nx release` it will prompt you for a version keyword (
|
||||
|
||||
When trying it out for the first time, you need to pass the `--first-release` flag since there is no previous release to compare against for changelog purposes. It is strongly recommended to use the `--dry-run` flag to see what will be published in the first release without actually pushing anything to the registry.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx release --first-release --dry-run
|
||||
```
|
||||
|
||||
{% aside type="tip" title="Semantic Versioning" %}
|
||||
By default, the version follows semantic versioning (semver) rules. To disable this behavior, set `release.releaseTagPatternRequireSemver` to `false` in your `nx.json` file. This allows you to use custom versioning schemes.
|
||||
By default, the version follows semantic versioning (semver) rules. To disable this behavior, set `release.releaseTag.requireSemver` to `false` in your `nx.json` file. This allows you to use custom versioning schemes.
|
||||
{% /aside %}
|
||||
|
||||
## Set Up Your Workspace
|
||||
@@ -75,73 +75,18 @@ See the [configuration reference](/docs/reference/nx-json#release) for all avail
|
||||
|
||||
## Using the Programmatic API for Nx Release
|
||||
|
||||
For maximum control, use the programmatic API to create custom release workflows:
|
||||
A powerful feature of Nx Release is the fact that it is designed to be used via a Node.js programmatic API in addition to the `nx release` CLI.
|
||||
|
||||
```ts
|
||||
// tools/scripts/release.ts
|
||||
import { releaseChangelog, releasePublish, releaseVersion } from 'nx/release';
|
||||
import * as yargs from 'yargs';
|
||||
Releases are a hugely complex and nuanced process, filled with many special cases and idiosyncratic preferences, and it is impossible for a CLI to be able to support all of them out of the box. By having a first-class programmatic API, you can go beyond the CLI and create custom release workflows that are highly dynamic and tailored to your specific needs.
|
||||
|
||||
(async () => {
|
||||
const options = await yargs
|
||||
.version(false) // don't use the default meaning of version in yargs
|
||||
.option('version', {
|
||||
description:
|
||||
'Explicit version specifier to use, if overriding conventional commits',
|
||||
type: 'string',
|
||||
})
|
||||
.option('dryRun', {
|
||||
alias: 'd',
|
||||
description:
|
||||
'Whether or not to perform a dry-run of the release process, defaults to true',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
})
|
||||
.option('verbose', {
|
||||
description:
|
||||
'Whether or not to enable verbose logging, defaults to false',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
})
|
||||
.parseAsync();
|
||||
|
||||
const { workspaceVersion, projectsVersionData, releaseGraph } =
|
||||
await releaseVersion({
|
||||
specifier: options.version,
|
||||
dryRun: options.dryRun,
|
||||
verbose: options.verbose,
|
||||
});
|
||||
|
||||
await releaseChangelog({
|
||||
releaseGraph, // Re-use the existing release graph to avoid recomputing in each subcommand
|
||||
versionData: projectsVersionData,
|
||||
version: workspaceVersion,
|
||||
dryRun: options.dryRun,
|
||||
verbose: options.verbose,
|
||||
});
|
||||
|
||||
// publishResults contains a map of project names and their exit codes
|
||||
const publishResults = await releasePublish({
|
||||
releaseGraph, // Re-use the existing release graph to avoid recomputing in each subcommand
|
||||
dryRun: options.dryRun,
|
||||
verbose: options.verbose,
|
||||
// You can optionally pass through the version data (e.g. if you are using a custom publish executor that needs to be aware of versions)
|
||||
// It will then be provided to the publish executor options as `nxReleaseVersionData`
|
||||
// This is not required for the default @nx/js publish executor
|
||||
versionData: projectsVersionData,
|
||||
});
|
||||
|
||||
process.exit(
|
||||
Object.values(publishResults).every((result) => result.code === 0) ? 0 : 1
|
||||
);
|
||||
})();
|
||||
```
|
||||
See our dedicated guide on the [programmatic API](/docs/guides/nx-release/programmatic-api) to learn more and see some example release scripts.
|
||||
|
||||
## Learn More
|
||||
|
||||
### Configuration & Customization
|
||||
|
||||
- **[Release Groups](/docs/guides/nx-release/release-projects-independently)** - Version projects independently or together
|
||||
- **[Version Projects Independently](/docs/guides/nx-release/release-projects-independently)** - Version projects independently or together
|
||||
- **[Release Groups](/docs/guides/nx-release/release-groups)** - Organize projects into release groups with specific configuration for each group
|
||||
- **[Conventional Commits](/docs/guides/nx-release/automatically-version-with-conventional-commits)** - Automate versioning based on commit messages
|
||||
- **[Custom Registries](/docs/guides/nx-release/configure-custom-registries)** - Publish to private or alternative registries
|
||||
- **[CI/CD Integration](/docs/guides/nx-release/publish-in-ci-cd)** - Automate releases in your pipeline
|
||||
|
||||
@@ -114,7 +114,7 @@ In Nx 21, task output is displayed in an [interactive terminal UI](/docs/guides/
|
||||
|
||||
To run the `test` task for the `header` project run this command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx test header
|
||||
```
|
||||
|
||||
@@ -124,19 +124,19 @@ You can use the `run-many` command to run a task for multiple projects. Here are
|
||||
|
||||
Run the `build` task for all projects in the repo:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t build
|
||||
```
|
||||
|
||||
Run the `build`, `lint` and `test` task for all projects in the repo:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t build lint test
|
||||
```
|
||||
|
||||
Run the `build`, `lint`, and `test` tasks only on the `header` and `footer` projects:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t build lint test -p header footer
|
||||
```
|
||||
|
||||
@@ -148,7 +148,7 @@ Learn more about the [run-many](/docs/reference/nx-commands#nx-run-many) command
|
||||
|
||||
You can also run a command for all the projects affected by your PR like this:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx affected -t test
|
||||
```
|
||||
|
||||
@@ -290,7 +290,7 @@ If you want Nx to cache the task, but prefer to use npm (or pnpm/yarn) to run th
|
||||
|
||||
To invoke the task, use:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx docs
|
||||
```
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ Please verify closely that you have the following setup:
|
||||
|
||||
Clone your repository to your local machine:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git clone <your-repository-url>
|
||||
cd <your-repository-name>
|
||||
```
|
||||
|
||||
Install dependencies:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
@@ -84,7 +84,7 @@ Now, let's build some features and see how Nx helps get us to production faster.
|
||||
|
||||
To serve your new Angular app, run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx serve angular-demo
|
||||
```
|
||||
|
||||
@@ -151,7 +151,7 @@ The most critical parts are:
|
||||
|
||||
To view all tasks for a project, look in the [Nx Console](/docs/getting-started/editor-setup) project detail view or run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx show project angular-demo
|
||||
```
|
||||
|
||||
@@ -256,7 +256,7 @@ Nx allows you to separate this logic into "local libraries." The main benefits i
|
||||
|
||||
Let's create a reusable design system library called `ui` that we can use across our workspace. This library will contain reusable components such as buttons, inputs, and other UI elements.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g @nx/angular:library packages/ui --unitTestRunner=vitest
|
||||
```
|
||||
|
||||
@@ -281,13 +281,13 @@ Running the above command should lead to the following directory structure:
|
||||
|
||||
Just as with the `angular-demo` app, Nx automatically infers the tasks for the `ui` library from its configuration files. You can view them by running:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx show project ui
|
||||
```
|
||||
|
||||
In this case, we have the `lint` and `test` tasks available, among other inferred tasks.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx lint ui
|
||||
npx nx test ui
|
||||
```
|
||||
@@ -433,7 +433,7 @@ Nx automatically detects the dependencies between the various parts of your work
|
||||
|
||||
Just run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx graph
|
||||
```
|
||||
|
||||
@@ -475,7 +475,7 @@ You should be able to see something similar to the following in your browser.
|
||||
|
||||
Let's create a git branch with the new hero component so we can open a pull request later:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git checkout -b add-hero-component
|
||||
git add .
|
||||
git commit -m 'add hero component'
|
||||
@@ -485,14 +485,14 @@ git commit -m 'add hero component'
|
||||
|
||||
Our current setup not only has targets for serving and building the Angular application, but also has targets for unit testing, e2e testing and linting. The `test` and `lint` targets are defined in the application `project.json` file. We can use the same syntax as before to run these tasks:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx test angular-demo # runs the tests for angular-demo
|
||||
npx nx lint ui # runs the linter on ui
|
||||
```
|
||||
|
||||
More conveniently, we can also run tasks in parallel using the following syntax:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t test lint
|
||||
```
|
||||
|
||||
@@ -575,7 +575,7 @@ You will also need to install the [Nx Console](/docs/getting-started/editor-setu
|
||||
|
||||
Now, let's push the `add-hero-component` branch to GitHub and open a new pull request.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git push origin add-hero-component
|
||||
# Don't forget to open a pull request on GitHub
|
||||
```
|
||||
|
||||
@@ -30,7 +30,7 @@ are specific to your operating system.
|
||||
|
||||
To verify that Gradle was installed correctly, run this command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
gradle --version
|
||||
```
|
||||
|
||||
@@ -41,21 +41,21 @@ To streamline this tutorial, we'll install Nx globally on your system. You can u
|
||||
|
||||
Make sure [Homebrew is installed](https://brew.sh/), then install Nx globally with these commands:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
brew install nx
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="Chocolatey (Windows)" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
choco install nx
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="apt (Ubuntu)" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
sudo add-apt-repository ppa:nrwl/nx
|
||||
sudo apt update
|
||||
sudo apt install nx
|
||||
@@ -67,7 +67,7 @@ sudo apt install nx
|
||||
|
||||
Install node from the [NodeJS website](https://nodejs.org/en/download), then install Nx globally with this command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm install --global nx
|
||||
```
|
||||
|
||||
@@ -80,7 +80,7 @@ This tutorial picks up where [Spring framework](https://spring.io/)'s guide for
|
||||
|
||||
Fork [the sample repository](https://github.com/nrwl/gradle-tutorial/fork), and then clone it on your local machine:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git clone https://github.com/<your-username>/gradle-tutorial.git
|
||||
```
|
||||
|
||||
@@ -111,7 +111,7 @@ both locally and on CI. We will explore the features of Nx in this tutorial by a
|
||||
|
||||
To add Nx, run
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx init
|
||||
```
|
||||
|
||||
@@ -152,7 +152,7 @@ The `@nx/gradle` plugin reflects the graph of projects in Gradle into the Nx Pro
|
||||
are created, deleted, and change their dependencies, Nx will automatically recalculate the graph. Exploring this graph
|
||||
visually is vital to understanding how your code is structured and how Nx and Gradle behaves.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx graph
|
||||
```
|
||||
|
||||
@@ -1132,7 +1132,7 @@ computation caching to reuse the results of tasks. We will explore how Nx adds t
|
||||
Before we start running tasks, let's explore the tasks available for the `application` project. The `@nx/gradle` plugin
|
||||
that we've installed reflects Gradle's tasks to Nx, which allows it to run any of the Gradle tasks defined for that project. You can view the available tasks either through [Nx Console](/docs/getting-started/editor-setup) or from the terminal:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project application
|
||||
```
|
||||
|
||||
@@ -2374,7 +2374,7 @@ nx show project application
|
||||
|
||||
The Nx command to run the `build` task for the `application` project is:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx run application:build
|
||||
```
|
||||
|
||||
@@ -2457,7 +2457,7 @@ With Nx Cloud connected, your task results are now cached remotely. This means t
|
||||
|
||||
Try running the build again after making a small change to see how Nx intelligently determines which tasks need to be re-run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx run-many -t build
|
||||
```
|
||||
|
||||
@@ -2517,13 +2517,13 @@ You will also need to install the [Nx Console](/docs/getting-started/editor-setu
|
||||
|
||||
Start by making a new branch to work on.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git checkout -b self-healing-ci
|
||||
```
|
||||
|
||||
Now for demo purposes, we'll make a mistake in our `DemoApplication` class that will cause the build to fail.
|
||||
|
||||
```diff
|
||||
```diff {% meta="lang='java'" %}
|
||||
// application/src/main/java/com/example/multimodule/application/DemoApplication.java
|
||||
@GetMapping("/")
|
||||
public String home() {
|
||||
@@ -2534,7 +2534,7 @@ Now for demo purposes, we'll make a mistake in our `DemoApplication` class that
|
||||
|
||||
Commit the changes and open a new PR on GitHub.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git add .
|
||||
git commit -m 'demo self-healing ci'
|
||||
git push origin self-healing-ci
|
||||
|
||||
@@ -79,7 +79,7 @@ Now, let's build some features and see how Nx helps get us to production faster.
|
||||
|
||||
To serve your new React app, run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx serve demo
|
||||
```
|
||||
|
||||
@@ -120,7 +120,7 @@ In `nx.json` there's already the `@nx/vite` plugin registered which automaticall
|
||||
|
||||
To view the tasks that Nx has detected, look in the [Nx Console](/docs/getting-started/editor-setup) project detail view or run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx show project demo
|
||||
```
|
||||
|
||||
@@ -235,7 +235,7 @@ Nx allows you to separate this logic into "local libraries." The main benefits i
|
||||
|
||||
Let's create a reusable design system library called `ui` that we can use across our workspace. This library will contain reusable components such as buttons, inputs, and other UI elements.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx g @nx/react:library packages/ui --unitTestRunner=vitest --bundler=none
|
||||
```
|
||||
|
||||
@@ -262,13 +262,13 @@ Running the above commands should lead to the following directory structure:
|
||||
|
||||
Just as with the `demo` app, Nx automatically infers the tasks for the `ui` library from its configuration files. You can view them by running:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx show project ui
|
||||
```
|
||||
|
||||
In this case, we have the `lint` and `test` tasks available, among other inferred tasks.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx lint ui
|
||||
npx nx test ui
|
||||
```
|
||||
@@ -391,7 +391,7 @@ Nx automatically detects the dependencies between the various parts of your work
|
||||
|
||||
Just run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx graph
|
||||
```
|
||||
|
||||
@@ -433,7 +433,7 @@ You should be able to see something similar to the following in your browser.
|
||||
|
||||
Let's create a git branch with the new hero component so we can open a pull request later:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git checkout -b add-hero-component
|
||||
git add .
|
||||
git commit -m 'add hero component'
|
||||
@@ -443,14 +443,14 @@ git commit -m 'add hero component'
|
||||
|
||||
Our current setup doesn't just come with targets for serving and building the React application, but also has targets for testing and linting. We can use the same syntax as before to run these tasks:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx test demo # runs the tests for demo
|
||||
npx nx lint ui # runs the linter on ui
|
||||
```
|
||||
|
||||
More conveniently, we can also run tasks in parallel using the following syntax:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t test lint
|
||||
```
|
||||
|
||||
@@ -533,7 +533,7 @@ You will also need to install the [Nx Console](/docs/getting-started/editor-setu
|
||||
|
||||
Now, let's push the `add-hero-component` branch to GitHub and open a new pull request.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git push origin add-hero-component
|
||||
# Don't forget to open a pull request on GitHub
|
||||
```
|
||||
|
||||
@@ -11,11 +11,16 @@ Nx provides deep integration with AI coding assistants through the **Nx Model Co
|
||||
|
||||
## Configure Nx AI Integration
|
||||
|
||||
{% youtube
|
||||
src="https://youtu.be/8gdvIz2r_QM"
|
||||
title="Set Up AI Agents in Nx"
|
||||
/%}
|
||||
|
||||
### Automatic AI Setup
|
||||
|
||||
To automatically configure your Nx workspace to work best with AI agents and assistants, run the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx configure-ai-agents
|
||||
```
|
||||
|
||||
@@ -41,7 +46,7 @@ You can of course manually configure the Nx MCP for MCP-compatible clients using
|
||||
|
||||
For Claude Code:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
claude mcp add nx-mcp npx nx-mcp@latest
|
||||
```
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ Nx Console editor extensions make your developer experience richer. The extensio
|
||||
- visualize dependencies between projects and tasks
|
||||
- and more!
|
||||
|
||||
You can explore more of the features [in our dedicated Nx Console guides](/docs/guides/nx-console).
|
||||
|
||||
## Download
|
||||
|
||||
### Official Integrations
|
||||
@@ -33,3 +35,7 @@ If you are using [VSCode](https://code.visualstudio.com/) or a [JetBrains IDE](h
|
||||
If you are using [Neovim](https://neovim.io/), you can install [Equilibris/nx.nvim](https://github.com/Equilibris/nx.nvim) with your favorite package manager.
|
||||
|
||||
This plugin is **NOT** built or maintained by the Nx team. They are maintained by independent community contributors.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you encounter issues with Nx Console, see the [Nx Console troubleshooting guide](/docs/guides/nx-console/console-troubleshooting) for detailed steps including how to enable debug logging.
|
||||
|
||||
@@ -10,7 +10,7 @@ To install Nx on your machine, choose one of the following methods based on your
|
||||
{% tabs syncKey="install-method" %}
|
||||
{% tabitem label="npm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm add --global nx
|
||||
```
|
||||
|
||||
@@ -19,7 +19,7 @@ npm add --global nx
|
||||
|
||||
{% tabitem label="Homebrew (macOS, Linux)" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
brew install nx
|
||||
```
|
||||
|
||||
@@ -27,7 +27,7 @@ brew install nx
|
||||
|
||||
{% tabitem label="Chocolatey (Windows)" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
choco install nx
|
||||
```
|
||||
|
||||
@@ -35,7 +35,7 @@ choco install nx
|
||||
|
||||
{% tabitem label="apt (Ubuntu)" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
sudo add-apt-repository ppa:nrwl/nx
|
||||
sudo apt update
|
||||
sudo apt install nx
|
||||
@@ -48,7 +48,7 @@ sudo apt install nx
|
||||
|
||||
To add Nx to an existing repository, run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx init
|
||||
```
|
||||
|
||||
@@ -59,7 +59,7 @@ Learn more about [adopting Nx in an existing project](/docs/guides/adopting-nx)
|
||||
|
||||
To create a starter repository, you can use the `create-nx-workspace` command. This will create a new Nx workspace with a default configuration and example applications.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace@latest
|
||||
```
|
||||
|
||||
@@ -67,13 +67,13 @@ npx create-nx-workspace@latest
|
||||
|
||||
When you update Nx, Nx will also [automatically update your dependencies](/docs/features/automate-updating-dependencies) if you have an [Nx plugin](/docs/concepts/nx-plugins) installed for that dependency. To update Nx, run:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx migrate latest
|
||||
```
|
||||
|
||||
This will create a `migrations.json` file with any update scripts that need to be run. Run them with:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx migrate --run-migrations
|
||||
```
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ Then you can simply add Nx to your root `package.json`:
|
||||
|
||||
And once that's done, you can run your tasks via Nx.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx build my-project
|
||||
```
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ description: Get started with using Nx Cloud and improve your PRs time to green.
|
||||
filter: 'type:Features'
|
||||
---
|
||||
|
||||
{% youtube src="https://youtu.be/4VI-q943J3o" title="Fast CI for monorepos" width="100%" /%}
|
||||
{% youtube src="https://www.youtube.com/watch?v=cDBihpB3SbI" title="Nx and Nx Cloud" width="100%" /%}
|
||||
|
||||
CI is challenging and it's **not your fault**. It's a fundamental issue with how the current, traditional CI execution model works. Nx Cloud adopts a new **task-based** CI model which allows you to overcome slowness and unreliability of the current VM-based CI model.
|
||||
_(Dive deeper into the [task based CI execution model](https://nx.dev/blog/reliable-ci-a-new-execution-model-fixing-both-flakiness-and-slowness))_
|
||||
@@ -15,7 +15,19 @@ Nx Cloud improves many aspects of the CI/CD process:
|
||||
- **Cost** - 40% - 75% reduction in CI costs (observed on the Nx OSS monorepo)
|
||||
- **Reliability** - by automatically identifying flaky tasks (e2e tests in particular) and re-running them
|
||||
|
||||
{% call_to_action variant="default" title="Recover lost time with Nx Cloud" url="https://cloud.nx.app/get-started?utm_source=nx-dev&utm_medium=nx-cloud_intro&utm_campaign=try-nx-cloud" description="Setup takes less than 2 minutes" /%}
|
||||
## Connect your workspace to Nx Cloud
|
||||
|
||||
The most straightforward way to connect your Nx workspace with Nx Cloud is via the web application:
|
||||
|
||||
{% call_to_action variant="default" title="Create a new or connect an existing repo" url="https://cloud.nx.app/get-started?utm_source=nx-dev&utm_medium=nx-cloud_intro&utm_campaign=try-nx-cloud" description="Setup takes less than 2 minutes" /%}
|
||||
|
||||
Alternatively, you can also run the following command in your Nx workspace (make sure you have it pushed to a remote repository first):
|
||||
|
||||
```shell
|
||||
nx connect
|
||||
```
|
||||
|
||||
For more details, [follow our in-depth guide](/docs/guides/nx-cloud/setup-ci) for setting up CI with Nx.
|
||||
|
||||
## How Nx Cloud improves CI
|
||||
|
||||
@@ -31,7 +43,7 @@ For example:
|
||||
- More work needs to run in CI - Add more agent machines, Nx Cloud automatically assigns available work to extra agent machines.
|
||||
- Known flaky tasks waste CI time on needed reruns - Nx Cloud automatically detects flaky tasks and reruns automatically in the current CI execution.
|
||||
|
||||
[Read more customer stories](https://nx.dev/blog?filterBy=customer+story)
|
||||
[Learn how our customers use Nx Cloud](https://nx.dev/blog?filterBy=customer+story) to help them scale their workspaces and be more efficient.
|
||||
|
||||
## Learn more
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ Let's take the example of an NPM workspace. Create a new root-level `package.jso
|
||||
|
||||
Then you can add Nx to it by using:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx@latest init
|
||||
```
|
||||
|
||||
@@ -35,7 +35,7 @@ nx@latest init
|
||||
Make sure you have [Nx installed globally](/docs/getting-started/installation) or use `npx` if you're in a JavaScript environment
|
||||
{% /aside %}
|
||||
|
||||
Nx will detect the underlying workspace configuration, ask you a couple of questions and install itself into the workspace. As you keep going, you can incrementally add functionality, like:
|
||||
Nx will detect the underlying workspace configuration, ask you a couple of questions and install itself into the workspace. You can now [run tasks with Nx](/docs/features/run-tasks) and incrementally add functionality, like:
|
||||
|
||||
- [Configure caching](/docs/features/cache-task-results)
|
||||
- [Adding Nx plugins to help refine your workflows](/docs/plugin-registry)
|
||||
@@ -47,7 +47,7 @@ Alternatively, you can choose a more guided approach by leveraging some of the p
|
||||
|
||||
Run the following command to get started:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-nx-workspace@latest
|
||||
```
|
||||
|
||||
@@ -55,12 +55,12 @@ This interactive command will guide you through the setup process, allowing you
|
||||
|
||||
- **Choose your workspace name** - This will be the name of your root directory
|
||||
- **Select your preferred package manager** - npm, yarn, or pnpm
|
||||
- **Pick a preset** - Choose from various technology stacks and configurations
|
||||
- **Pick a preset** - Choose from [various technology stacks and configurations](/docs/reference/create-nx-workspace#presets)
|
||||
- **Configure additional options** - Such as styling solutions, testing frameworks, and more
|
||||
|
||||
Choose a preset that matches your technology stack. This gives you a fully configured workspace.
|
||||
|
||||
You can also choose **an empty workspace preset** which sets up the bare minimum configuration including Nx itself. This allows you to add technologies and features incrementally over time as you need them.
|
||||
You can also choose **an empty workspace preset** (`--preset=ts`) which sets up the bare minimum configuration for TypeScript and Nx. This allows you to add technologies and features incrementally over time as you need them.
|
||||
|
||||
## Option 3: Get the complete Nx platform experience
|
||||
|
||||
|
||||
@@ -7,13 +7,15 @@ sidebar:
|
||||
filter: 'type:Guides'
|
||||
---
|
||||
|
||||
{% course_video src="https://youtu.be/3hW53b1IJ84" courseTitle="From PNPM Workspaces to Distributed CI" courseUrl="https://nx.dev/courses/pnpm-nx-next/lessons-01-nx-init" /%}
|
||||
|
||||
In many situations, you have an existing codebase and want to improve it with Nx using an **incremental adoption approach**.
|
||||
|
||||
Thanks to [Nx's modular architecture](/docs/getting-started/intro), you can start with just **Nx Core** and then gradually add [technology-specific plugins](/docs/technologies), [CI integrations](/docs/getting-started/nx-cloud), or other capabilities as your requirements evolve.
|
||||
|
||||
Getting started is remarkably simple. You can add Nx to any existing project with a single command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx@latest init
|
||||
```
|
||||
|
||||
@@ -25,12 +27,13 @@ Whether a monorepo, single project or something in between, `nx init` walks you
|
||||
|
||||
## Next Steps
|
||||
|
||||
After initializing Nx, you can explore your workspace with the following commands:
|
||||
After initializing Nx, you can [run tasks](/docs/features/run-tasks) with `nx <task> <project-name>` (e.g. `nx build myproject`) or run one or many tasks across all projects with `nx run-many -t <task1> <task2>`.
|
||||
|
||||
You can also explore your codebase using:
|
||||
|
||||
- `nx graph` to view an interactive graph
|
||||
- `nx show projects` to see a list of all projects
|
||||
- `nx show project <project-name>` to view an interactive project detailed view
|
||||
- `nx run-many -t <target>` to run tasks with Nx, e.g. `nx run-many -t build`
|
||||
|
||||
### Update CI Configurations
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ Additionally, Nx also [speeds up your CI ⚡](#fast-ci) with [remote caching](/d
|
||||
|
||||
Run the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest init
|
||||
```
|
||||
|
||||
@@ -114,7 +114,7 @@ configuring the plugins on the [`@nx/next/plugin`](/docs/technologies/react/next
|
||||
To view all available tasks, open the Project Details view with Nx Console or use the terminal to launch the project
|
||||
details in a browser window.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project my-workspace --web
|
||||
```
|
||||
|
||||
@@ -317,7 +317,7 @@ Now that we're working on the CI pipeline, it is important for your changes to b
|
||||
|
||||
Now connect your repository to Nx Cloud with the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
@@ -331,7 +331,7 @@ Once the PR is created, merge it into your main branch.
|
||||
|
||||
And make sure you pull the latest changes locally:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git pull
|
||||
```
|
||||
|
||||
@@ -341,7 +341,7 @@ You should now have an `nxCloudId` property specified in the `nx.json` file.
|
||||
|
||||
Use the following command to generate a CI workflow file.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx generate ci-workflow --ci=github
|
||||
```
|
||||
|
||||
@@ -381,7 +381,7 @@ jobs:
|
||||
|
||||
Commit the changes and open a new PR on GitHub.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git add .
|
||||
git commit -m 'add CI workflow file'
|
||||
git push origin add-workflow
|
||||
|
||||
@@ -29,7 +29,7 @@ add an `nx.json` for configuring caching and task pipelines.
|
||||
|
||||
Run the following command to automatically set up Nx:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest init
|
||||
```
|
||||
|
||||
@@ -112,7 +112,7 @@ configuring the plugins on the [`@nx/next/plugin`](/docs/technologies/react/next
|
||||
To view all available tasks, open the Project Details view with Nx Console or use the terminal to launch the project
|
||||
details in a browser window.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx show project my-workspace --web
|
||||
```
|
||||
|
||||
@@ -301,14 +301,14 @@ initially using Nx just for a subset of your scripts and then gradually adding m
|
||||
|
||||
For example, use Nx to run your builds:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx run-many -t build
|
||||
```
|
||||
|
||||
But instead keep using NPM/Yarn/PNPM workspace commands for your tests and other scripts. Here's an example of using
|
||||
PNPM commands to run tests across packages
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
pnpm run -r test
|
||||
```
|
||||
|
||||
@@ -335,7 +335,7 @@ Now that we're working on the CI pipeline, it is important for your changes to b
|
||||
|
||||
Now connect your repository to Nx Cloud with the following command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest connect
|
||||
```
|
||||
|
||||
@@ -349,7 +349,7 @@ Once the PR is created, merge it into your main branch.
|
||||
|
||||
And make sure you pull the latest changes locally:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git pull
|
||||
```
|
||||
|
||||
@@ -359,7 +359,7 @@ You should now have an `nxCloudId` property specified in the `nx.json` file.
|
||||
|
||||
Use the following command to generate a CI workflow file.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx generate ci-workflow --ci=github
|
||||
```
|
||||
|
||||
@@ -399,7 +399,7 @@ jobs:
|
||||
|
||||
Commit the changes and open a new PR on GitHub.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git add .
|
||||
git commit -m 'add CI workflow file'
|
||||
git push origin add-workflow
|
||||
|
||||
@@ -129,13 +129,13 @@ The simplest way to understand the concepts is to see a basic migration example.
|
||||
|
||||
1. Let's create a new Turborepo workspace using the recommended `create-turbo` command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx create-turbo@latest
|
||||
```
|
||||
|
||||
2. Once that is finished, literally all we need to do make it a valid Nx workspace is run `nx init`:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest init
|
||||
```
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ Nx can help with the process of moving an existing project from another reposito
|
||||
|
||||
In this example, the source repository contains a single application while the destination repository is already a monorepo. You can also import a project from a sub-directory of the source repository (if the source repository is a monorepo, for instance). The `nx import` command can be run with no arguments and you will be prompted to for the required arguments:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx import
|
||||
```
|
||||
|
||||
@@ -65,7 +65,7 @@ Make sure to run `nx import` from within the **destination repository**.
|
||||
|
||||
You can also directly specify arguments from the terminal, like one of these commands:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx import [sourceRepository] [destinationDirectory]
|
||||
nx import ../inventory-app apps/inventory
|
||||
nx import https://github.com/myorg/inventory-app.git apps/inventory
|
||||
|
||||
@@ -8,7 +8,7 @@ sidebar:
|
||||
|
||||
The easiest way to start using Nx is to run the `nx init` command.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npx nx@latest init
|
||||
```
|
||||
|
||||
@@ -21,28 +21,28 @@ We'll start by installing the `nx` package:
|
||||
{% tabs syncKey="install-type" %}
|
||||
{% tabitem label="npm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm add -D nx@latest
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="yarn" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
yarn add -D nx@latest
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="pnpm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
pnpm add -D nx@latest
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="bun" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
bun add -D nx@latest
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ If your standalone project was not an Nx workspace, it's likely that your migrat
|
||||
|
||||
In order to avoid merge conflicts later, it's best to first do the folder reorganization in the _standalone project repo_. For example, assuming you want the standalone app to end up at `apps/my-standalone-app` in the monorepo and your main branch is called `master`:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
cd my-standalone-app
|
||||
git checkout main
|
||||
git fetch
|
||||
@@ -38,21 +38,21 @@ git ls-files | sed 's!/.*!!'| uniq | xargs -i git mv {} apps/my-standalone-app
|
||||
Check if you need to move back the `.gitignore` file to the root and/or update any paths so you don't commit previously ignored files/folders.
|
||||
If all is well proceed with the commit and push.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git commit -m "Move files in preparation for monorepo migration"
|
||||
git push --set-upstream origin monorepo-migration
|
||||
```
|
||||
|
||||
Next, in your monorepo, we'll add a remote repository url for where the standalone app is located:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git remote add my-standalone-app <repository url>
|
||||
git fetch my-standalone-app
|
||||
```
|
||||
|
||||
Then we'll run
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
git merge my-standalone-app/monorepo-migration --allow-unrelated-histories
|
||||
```
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ First globally install Nx using Homebrew (Mac and Linux) or with a manually inst
|
||||
|
||||
If you have [Homebrew installed](https://brew.sh/), you can install Nx globally with these commands:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
brew install nx
|
||||
```
|
||||
|
||||
@@ -26,7 +26,7 @@ brew install nx
|
||||
|
||||
If you have [Node installed](https://nodejs.org/en/download), you can install Nx globally with this command:
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm install --global nx
|
||||
```
|
||||
|
||||
@@ -37,7 +37,7 @@ npm install --global nx
|
||||
|
||||
You can install Nx in the `.nx/installation` directory of your repository by running `nx init` in a directory without a `package.json` file.
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx init
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ When Nx is installed in `.nx`, you can run Nx via a global Nx installation or th
|
||||
{% tabs %}
|
||||
{% tabitem label="Global Install" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
nx build my-project
|
||||
nx generate application
|
||||
nx graph
|
||||
@@ -55,7 +55,7 @@ nx graph
|
||||
{% /tabitem %}
|
||||
{% tabitem label="nx shell script" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
./nx build my-project
|
||||
./nx generate application
|
||||
./nx graph
|
||||
@@ -64,7 +64,7 @@ nx graph
|
||||
{% /tabitem %}
|
||||
{% tabitem label="nx.bat" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
./nx.bat build my-project
|
||||
./nx.bat generate application
|
||||
./nx.bat graph
|
||||
|
||||
@@ -18,7 +18,7 @@ If you cannot remember which package manager you installed Nx globally with or a
|
||||
{% tabs syncKey="install-type" %}
|
||||
{% tabitem label="npm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm list --global nx
|
||||
```
|
||||
|
||||
@@ -27,20 +27,20 @@ npm list --global nx
|
||||
|
||||
**yarn 2+**
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
yarn dlx list nx
|
||||
```
|
||||
|
||||
yarn 1.x
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
yarn global list nx
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="pnpm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
pnpm list --global nx
|
||||
```
|
||||
|
||||
@@ -52,21 +52,21 @@ You can then remove the extra global installations by running the following comm
|
||||
{% tabs syncKey="install-type" %}
|
||||
{% tabitem label="npm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
npm rm --global nx
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="yarn" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
yarn global remove nx
|
||||
```
|
||||
|
||||
{% /tabitem %}
|
||||
{% tabitem label="pnpm" %}
|
||||
|
||||
```shell {% frame="none" %}
|
||||
```shell
|
||||
pnpm rm --global nx
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: Azure DevOps Integration
|
||||
description: Learn how to integrate Nx Cloud with Azure DevOps for PR integration.
|
||||
filter: 'type:Guides'
|
||||
sidebar:
|
||||
label: Azure DevOps
|
||||
---
|
||||
|
||||
The Nx Cloud + Azure Devops Integration lets you access the result of every run—with all its logs and build insights—straight from your PR.
|
||||
|
||||
## Connecting Your Workspace
|
||||
|
||||

|
||||
|
||||
Once on the VCS Integrations setup page, select "Azure DevOps". You will be prompted to enter the name of your organization and project.
|
||||
|
||||
Identifying your organization and project can be done by looking at the URL of your project summary page.
|
||||
|
||||
```text
|
||||
// URL format
|
||||
https://dev.azure.com/[organization]/[project]
|
||||
```
|
||||
|
||||
For example, the url `https://dev.azure.com/nrwl/my-monorepo-project` has an organization name of "nrwl", and a project name of "large-monorepo".
|
||||
|
||||
You will also need to provide the id of your Azure Git repository, this can either be the internal GUID identifier, if known, or you can use the name of the repository from the URL you use to access it.
|
||||
|
||||
For example, a URL of `https://dev.azure.com/nrwl/_git/large-monorepo` has the repository id of "large-monorepo".
|
||||
|
||||

|
||||
|
||||
### Configuring Authentication
|
||||
|
||||
#### Using a Personal Access Token
|
||||
|
||||
To use a Personal Access Token for authentication, one must be generated with proper permissions. The minimum required permissions are shown in the screenshot below.
|
||||
|
||||

|
||||
|
||||
Once this token is created paste the value and then click "Connect".
|
||||
|
||||
This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved, and setup is complete.
|
||||
|
||||
Please note that Azure DevOps will impose rate limits which can degrade the performance of the integration leading to missing data or functionality. To mitigate the impact, we recommend you assign the [Basic + Test plan](https://learn.microsoft.com/en-us/azure/devops/organizations/billing/buy-basic-access-add-users?view=azure-devops#assign-basic-or-basic--test-plans) to the user whose token you utilise for this integration.
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
If your company runs a self-hosted Azure DevOps installation, you may need to override the default URL that Nx Cloud uses to connect to the Azure Devops API. To do so, check the box labeled "Override Azure DevOps API URL" and enter the correct URL for your organization.
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: Bitbucket Integration
|
||||
description: Learn how to integrate Nx Cloud with Bitbucket for PR integration.
|
||||
filter: 'type:Guides'
|
||||
sidebar:
|
||||
label: Bitbucket
|
||||
---
|
||||
|
||||
The Nx Cloud + Bitbucket Integration lets you access the result of every run—with all its logs and build insights—straight from your PR.
|
||||
|
||||
### Using an App Password
|
||||
|
||||
If you are using BitBucket Cloud (bitbucket.org) and are not self-hosting it, you can enable an ["app password" for authentication](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password).
|
||||
|
||||
The minimum required permissions are write access to PRs:
|
||||
|
||||

|
||||
|
||||
Once the app password is created, save it in a secure location and then head back to your workspace settings on NxCloud and let's set up a BitBucket integration:
|
||||
|
||||

|
||||
|
||||
1. Fill-in all the required fields for selecting your Bitbucket repository
|
||||
2. Username is found on the [account settings](https://bitbucket.org/account/settings/) screen (it is not your email address)
|
||||
3. Paste your app password created earlier into the Access Token box
|
||||
4. That's it!
|
||||
|
||||
### Using an HTTP Access Tokens
|
||||
|
||||
If you are using BitBucket Data Center (on-prem) you need to enable ["HTTP Access Tokens" for authentication](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html).
|
||||
|
||||
{% aside type="note" title="User linked access tokens" %}
|
||||
Due to the type of APIs NxCloud needs to call, we need to create an access [**at the user level**](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html). Repo level access tokens will not work.
|
||||
{% /aside %}
|
||||
|
||||
The minimum required permissions are write access to the repository:
|
||||
|
||||

|
||||
|
||||
Once the token is created, save it in a secure location and then head back to your workspace settings on NxCloud and let's set up a BitBucket integration:
|
||||
|
||||

|
||||
|
||||
1. Fill-in all the required fields for selecting your Bitbucket repository
|
||||
2. Username is found on the [account settings](https://your-bitbucket-instance.com/profile) screen (it is not your email address)
|
||||
3. Paste your access token created earlier into the Access Token box
|
||||
4. Make sure you give NxCloud the URL of your BitBucket instance (this can be in the simple form of `https://your-bitbucket-instance.com`)
|
||||
5. That's it!
|
||||
@@ -0,0 +1,91 @@
|
||||
---
|
||||
title: GitHub Integration
|
||||
description: Learn how to integrate Nx Cloud with GitHub for PR integration.
|
||||
filter: 'type:Guides'
|
||||
sidebar:
|
||||
label: GitHub
|
||||
---
|
||||
|
||||
The [Nx Cloud GitHub App](https://github.com/marketplace/official-nx-cloud-app) lets you access the result of every run—with all its logs and build insights—straight from your PR.
|
||||
|
||||
## Install the App
|
||||
|
||||
For the best experience, install the [Nx Cloud GitHub App](https://github.com/marketplace/official-nx-cloud-app). Using the app provides the most seamless authentication experience. This is not required if you wish to authenticate with a personal access token that you generate yourself.
|
||||
|
||||
## Connecting Your Workspace
|
||||
|
||||
Once you have installed the Nx Cloud GitHub App, you must link your workspace to the installation. To do this, sign in to Nx Cloud and navigate to the VCS Integrations setup page. This page can be found in your workspace settings, you need to be admin of the organization in order to access it.
|
||||
Once on the VCS Integrations setup page, you can choose what VCS you want to connect to your workspace.
|
||||
|
||||

|
||||
|
||||
### Choosing an Authentication Method
|
||||
|
||||
It is easier to configure the Nx Cloud GitHub Integration to use its GitHub App to authenticate, and this method should be preferred for users on Nx Public Cloud. Advanced users or Nx Enterprise clients may instead wish to generate a personal access token instead.
|
||||
|
||||
#### Using the GitHub App
|
||||
|
||||
To use the Nx Cloud GitHub App for authentication, select the radio button and then click "Connect".
|
||||
This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved.
|
||||
Check the "_CI Platform Considerations_" section below and if there are no additional instructions for your platform of choice, setup is complete.
|
||||
|
||||

|
||||
|
||||
#### Using a Personal Access Token
|
||||
|
||||
Github supports two [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens) types: Classic and Fine-grained.
|
||||
|
||||
To use a Personal Access Token for authentication, one must be generated with proper permissions. The minimum required permissions are shown in the screenshot below.
|
||||
|
||||
{% tabs %}
|
||||
{% tabitem label="Classic Token" %}
|
||||
|
||||

|
||||
|
||||
{% /tabitem %}
|
||||
|
||||
{% tabitem label="Fine-grained Token" %}
|
||||
|
||||

|
||||
|
||||
{% /tabitem %}
|
||||
{% /tabs %}
|
||||
|
||||
Once this token is created, select the radio button for providing a personal access token, paste the value, and then click "Connect". This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved. Check the "_CI Platform Considerations_" section below, and if there are no additional instructions for your platform of choice, setup is complete.
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
If your company runs a self-hosted GitHub installation, you may need to override the default URL that Nx Cloud uses to connect to the GitHub API. To do so, check the box labeled "Override GitHub API URL" and enter the correct URL for your organization.
|
||||
|
||||
## CI Platform Considerations
|
||||
|
||||
If you are using CircleCI, TravisCI, GitHub Actions or GitHub, there is nothing else you need to do. If you are using other CI providers, you need to set the `NX_BRANCH` environment variable in your CI configuration. The variable has to be set to a PR number.
|
||||
|
||||
For instance, this is an example of doing it in Azure pipelines.
|
||||
|
||||
### Azure Pipelines
|
||||
|
||||
```yml
|
||||
// azure-pipelines.yml
|
||||
variables:
|
||||
NX_BRANCH: $(System.PullRequest.PullRequestNumber)
|
||||
```
|
||||
|
||||
### CircleCI
|
||||
|
||||
Make sure [GitHub checks are enabled](https://circleci.com/docs/2.0/enable-checks/#to-enable-github-checks).
|
||||
|
||||
### Jenkins
|
||||
|
||||
[Install the Jenkins plugin](https://plugins.jenkins.io/github-checks/).
|
||||
|
||||
Ensure this step from the plugin instructions is followed:
|
||||
|
||||
Prerequisite: only GitHub App with proper permissions can publish checks, this guide helps you authenticate your Jenkins as a GitHub App.
|
||||
|
||||
## Github Status Checks
|
||||
|
||||
The Nx Cloud GitHub Integration updates your PR with commit statuses that reflect the real-time progress of your runs. These statuses are generated dynamically based on your running commands. Enforcing these dynamically-named checks within your branch protection rules is not recommended, as it can result in stuck checks displaying `Waiting for status to be reported`.
|
||||
|
||||
From your repository, go to `Settings -> Branches -> Protect matching branches` and ensure that no Nx Cloud status checks are listed in the `Require status checks to pass before merging` list. Enforcing that status checks pass on your default branch is sufficient.
|
||||

|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
title: GitLab Integration
|
||||
description: Learn how to integrate Nx Cloud with GitLab for MR integration.
|
||||
filter: 'type:Guides'
|
||||
sidebar:
|
||||
label: GitLab
|
||||
---
|
||||
|
||||
The Nx Cloud GitLab Integration lets you access the result of every run—with all its logs and build insights—straight from your Merge Requests.
|
||||
|
||||
### Connecting Your Workspace
|
||||
|
||||

|
||||
|
||||
Once on the VCS Integrations setup page, select "GitLab". You will be prompted to enter your project's ID.
|
||||
|
||||

|
||||
|
||||
To locate the ID for your project, visit the home page of your repository on GitLab. Click the three-dot menu button in the upper right corner and select "Copy project ID" to copy the value to your clipboard.
|
||||
|
||||

|
||||
|
||||
### Using a Personal Access Token
|
||||
|
||||
To use a Personal Access Token for authentication, one must be generated with proper permissions. The minimum required permissions are shown in the screenshot below.
|
||||
|
||||

|
||||
|
||||
Once this token is created, select the radio button for providing a personal access token, paste the value, and then click "Connect".
|
||||
|
||||
This will verify that Nx Cloud can connect to your repo. Upon a successful test, your configuration is saved, and setup is complete.
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
If your company runs a self-hosted GitLab installation, you may need to override the default URL that Nx Cloud uses to connect to the GitLab API. To do so, check the box labeled "Override GitLab API URL" and enter the correct URL for your organization.
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: Source Control Integration
|
||||
sidebar:
|
||||
hidden: true
|
||||
description: How to integrate Nx Cloud with your source control platform
|
||||
pagefind: false
|
||||
---
|
||||
|
||||
{% index_page_cards path="guides/nx-cloud/source-control-integration" /%}
|
||||
@@ -66,33 +66,6 @@ For manual DTE configurations, the `nx fix-ci` command must be included in the a
|
||||
|
||||
For non-DTE setups, refer to the [Self-Healing CI documentation](/docs/features/ci-features/self-healing-ci) for detailed configuration instructions.
|
||||
|
||||
## Explain with AI for Enterprise On-Prem Installations
|
||||
|
||||
To enable the Explain with AI feature for enterprise on-prem installations, add the following configuration to your `helm-values.yaml` file:
|
||||
|
||||
```yaml
|
||||
nxApi
|
||||
deployment:
|
||||
env:
|
||||
- name: NX_CLOUD_AI_ENABLED
|
||||
value: 'true'
|
||||
|
||||
frontend
|
||||
deployment:
|
||||
env:
|
||||
- name: OPENAI_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: open-ai-secrets
|
||||
key: OPENAI_SECRET_KEY
|
||||
- name: NX_CLOUD_AI_ENABLED
|
||||
value: 'true'
|
||||
```
|
||||
|
||||
_(We use gpt-4o for the Explain with AI feature)_
|
||||
|
||||
Then, enable AI features in the [organization settings](https://cloud.nx.app/go/organization/edit).
|
||||
|
||||
## Regional Availability
|
||||
|
||||
AI features are not available for the EU cluster in public cloud installations due to regional restrictions. However, on-prem customers in the EU can still use these features by providing their own OpenAI secret key (for Explain with AI) or Anthropic API key (for Self-Healing CI) and enabling the required environment variables.
|
||||
AI features are not available for the EU cluster in public cloud installations due to regional restrictions. However, on-prem customers in the EU can still use these features by providing their own Anthropic API key (for Self-Healing CI) and enabling the required environment variables.
|
||||
|
||||