From bdaffaeb970c9553d2a31526f4bb4c51447643cf Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Thu, 25 Jul 2024 17:07:46 -0400 Subject: [PATCH] docs(core): document projectsAffectedByDependencyUpdates --- docs/shared/using-nx/affected.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/shared/using-nx/affected.md b/docs/shared/using-nx/affected.md index b42ec698cef14..d05e9421a22f8 100644 --- a/docs/shared/using-nx/affected.md +++ b/docs/shared/using-nx/affected.md @@ -244,6 +244,22 @@ Nx provides two methods to exclude glob patterns (files and folders) from `affec - Glob patterns defined in your `.gitignore` file are ignored. - Glob patterns defined in an optional `.nxignore` file are ignored. +## Marking Projects Affected by Dependency Updates + +By default, Nx will mark all projects as affected whenever your package manager's lock file changes. This behavior is a failsafe in case Nx misses a project that should be affected by a dependency update. If you'd like to opt in to a smarter behavior you can configure Nx to only mark projects as affected if they actually depend on the updated packages. + +```json {% fileName="nx.json" %} +{ + "pluginsConfig": { + "@nx/js": { + "projectsAffectedByDependencyUpdates": "auto" + } + } +} +``` + +The flag `projectsAffectedByDependencyUpdates` can be set to `auto`, `all`, or an array that contains project specifiers. The default value is `all`. + ## Not Using Git If you aren't using Git, you can pass `--files` to any affected command to indicate what files have been changed.