Nx¶
Nx is the build system and monorepo orchestration tool that manages the petfolio-fe workspace. It coordinates builds, tests, and linting across all projects, and enforces architectural boundaries between them.
Why Nx?¶
A monorepo without tooling quickly becomes slow and hard to maintain. Nx solves this by:
- Dependency graph awareness: Nx understands which projects depend on which, so it can determine the minimum set of work needed when code changes.
- Computation caching: build, test, and lint results are cached locally. If nothing relevant has changed, Nx skips the work entirely.
- Parallel task execution: independent tasks run in parallel across available CPU cores, reducing overall pipeline time.
- Module boundary enforcement: ESLint rules powered by Nx prevent libraries from importing things they should not, keeping the architecture clean.
Common commands¶
In this section¶
- Applications and libraries - the difference between apps and libs in an Nx workspace.
- Module boundaries - how Nx enforces dependency rules between projects.
- What is Nx Affected? - how Nx determines the minimum set of projects to rebuild and retest.
- What is Nx Graph? - how to visualise and explore project dependencies.