intermediate

Nx

Use Nx project graph, generators, affected commands, caching, and plugin ecosystem for structured monorepos.

Nx models a project graph with plugins, generators, executors, and affected commands (`nx affected -t test`). It suits structured monorepos with repeatable architecture and multi-team ownership.

Generators scaffold libraries and apps with consistent boundaries; executors run builds/tests with shared caching configuration. The graph includes implicit dependencies (e.g., shared global config files).

On interviews: affected workflows, generator conventions, cache inputs, plugin ecosystem, and when Nx is heavier than necessary.

Common pitfalls: adopting Nx for a two-package repo; generators without team buy-in; implicit deps not modeled causing wrong affected results.

The trade-off is graph-aware conventions and scale versus onboarding and tool complexity.

Checklist:

  • Use affected commands in CI.
  • Maintain explicit project boundaries.
  • Model implicit inputs in graph config.
  • Justify Nx with scale or multi-team needs.