nx-examples

repository·master·Indexed 21 days ago

https://github.com/nrwl/nx-examples

A demonstration workspace generated using Nx that showcases how to manage multiple applications and libraries within a single monorepo. It serves as a template for using Nx plugins, generators, and task running for modern web development, featuring examples of React applications, Rsbuild configuration, and Cypress E2E testing.

Tokens
10.6K
Snippets
61
Records
66
Agent score
75%

What's inside nx-examples

  1. Run unit and end-to-end tests

    master

    Nx provides commands to run tests for specific projects or only for projects affected by recent changes.

    Unit Tests (Jest)

    • Run all tests for a project: nx test <project-name>
    • Run only affected tests: nx affected:test

    End-to-End Tests (Cypress)

    • Run all E2E tests for a project: nx e2e <project-name>
    • Run only affected E2E tests: nx affected:e2e
    # Unit tests
    nx test my-app
    nx affected:test
    
    # End-to-end tests
    nx e2e my-app
    nx affected:e2e
  2. Install Nx plugins for different frameworks

    master

    Nx uses plugins to add capabilities for specific frameworks and environments. You can install these plugins via npm to enable generation and build tools for your chosen stack.

    Core plugins include:

    • React: @nx/react
    • Web (no framework): @nx/web
    • Angular: @nx/angular
    • Nest: @nrwl/nest
    • Express: @nrwl/express
    • Node: @nrwl/node
    npm install --save-dev @nx/react
    npm install --save-dev @nx/web
    npm install --save-dev @nx/angular
    npm install --save-dev @nrwl/nest
    npm install --save-dev @nrwl/express
    npm install --save-dev @nrwl/node