Nx Documentation

website·Indexed 41 days ago

https://19.nx.dev/

Documentation for Nx, including the Nx Devkit API for building plugins, generators, and executors, as well as guides on deprecated features such as workspace.json, cacheableOperations, and global implicit dependencies.

Tokens
268.6K
Snippets
1.8K
Records
2.5K
Agent score
60%

What's inside Nx

  1. Overview of Nx Atomizer for E2E Task Splitting

    Nx Atomizer automatically generates runnable targets for e2e tests for each spec file. Instead of one large monolithic e2e task, it creates multiple smaller tasks. This enables parallelization across multiple machines using Nx Agents and allows for faster flakiness detection and retries by isolating and re-running only the failed tests.
  2. Overview of Nx Plugins

    Nx plugins are npm packages used to extend an Nx workspace. They primarily consist of generators (for code generation) and executors (for running tasks). Nx provides a dedicated tooling package to assist plugin authors in creating and maintaining these plugins.
  3. Overview of @nx/powerpack-s3-cache

    The @nx/powerpack-s3-cache plugin allows you to use an Amazon S3 bucket as a remote cache instead of Nx Cloud. Note that this plugin only provides remote caching; it does not include Nx Cloud features like distributed task execution, flaky task re-running, or automatic task splitting. Using a self-hosted S3 bucket may expose the workspace to cache poisoning. This plugin requires an active Nx Powerpack license; without one, the cache will fall back to local-only.
  4. Overview of the Nx Powerpack License package

    The @nx/powerpack-license package provides the necessary functionality to activate and read licenses for Nx Powerpack features.
  5. Overview of Nx build system features

    Nx is an open-source build system designed to improve developer productivity and CI performance. Its core capabilities include:

    • Task Execution: Runs tasks in parallel and orders them based on project dependencies.
    • CI Scaling: Distributes tasks across multiple VMs to maintain speed in large repositories.
    • Caching: Supports both local and remote caching to prevent redundant task execution.
    • E2E Testing: Automatically splits large end-to-end tests across VMs and identifies/reruns flaky tests.
    • Automation: Provides code generation and automated dependency updates via Nx plugins.
    • Extensibility: Allows organizations to create custom tooling or organization-specific plugins.
  6. Overview of Nx Sync Generators

    Introduced in Nx 19.8, sync generators ensure a repository is maintained in a correct state by using the project graph to update files. This allows the project graph to influence the behavior of tools outside the Nx ecosystem. Common use cases include updating custom CI scripts with binning strategies, updating TypeScript config files with project references, or ensuring specific code formatting before CI runs.
  7. Overview of @nx/powerpack-shared-fs-cache

    The @nx/powerpack-shared-fs-cache plugin allows an Nx workspace to use a shared file system directory as a remote cache. While it enables remote caching, it does not provide Nx Cloud features such as distributed task execution, re-running flaky tasks, or automatic task splitting.

    Important Considerations:

    • Licensing: Requires an active Nx Powerpack license. Without a valid license, the cache will not be shared, and machines will revert to local caching.
    • Security: Using a shared file system folder exposes the workspace to potential cache poisoning. To mitigate this, Nx Replay is recommended.
    • Responsibility: The plugin manages task metadata association with file artifacts, but the user is responsible for the actual sharing mechanism (e.g., a shared network drive or CI provider's save/restore mechanism).
  8. Overview of Module Federation in Nx

    Module Federation is a technique that allows code to be split into smaller deployable modules shared and consumed at runtime between applications. This enables a Micro Frontend architecture, reducing team coordination and allowing independent release cadences. As of Nx 19.5, Nx uses the @module-federation/enhanced package for its implementation, ensuring alignment with the latest features and bug fixes from the creators of Module Federation.
  9. Overview of Nx Cloud AI features

    Nx Cloud AI provides AI-driven capabilities to enhance development workflows. Key features include:

    • Explain with AI: Provides detailed explanations for failed tasks to assist in troubleshooting.
    • Automatic Resource Allocation (Coming Soon): Uses AI/ML models to dynamically allocate Nx Agents to optimize performance and achieve target durations for main and PR branches.
  10. Overview of Nx Powerpack for Enterprises

    Nx Powerpack is a suite of paid extensions for the Nx CLI designed for enterprise use. It is available for Nx version 19.8 and higher. To use Powerpack features, a license must be activated.
  11. Overview of Automated E2E Task Splitting (Atomizer)

    Nx Atomizer automatically generates runnable targets for e2e tests for each individual spec file. This transforms a single large e2e task into multiple smaller tasks, enabling parallelization across multiple machines via Nx Agents and faster flakiness detection by isolating and re-running only failed tests.
  12. Overview of @nx/powerpack-shared-fs-cache

    The @nx/powerpack-shared-fs-cache plugin allows you to use a shared file system directory as a remote cache instead of Nx Cloud. While it enables remote caching, it does not provide advanced Nx Cloud features like distributed task execution, re-running flaky tasks, or automatic task splitting.

    Important Considerations:

    • Licensing: Requires an active Nx Powerpack license. Without a valid license, the cache will not be shared, and machines will revert to local caching.
    • Security: Using a shared file system folder exposes the workspace to potential cache poisoning. To mitigate this, Nx Replay is recommended.
    • Responsibility: The plugin manages task metadata association with file artifacts, but the user is responsible for the actual sharing mechanism (e.g., CI provider cache restoration or a shared network drive).