From eccd79311d1374337a99c6d77a735ca3b20efdb5 Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Thu, 3 Oct 2024 17:35:47 -0400 Subject: [PATCH] feat(devkit): bump compatibility to Nx 19 - 21.x (#28243) BREAKING CHANGE * `@nx/devkit` supports Nx 17 - 20. * Node 18 - 22 is supported * `ExecutorContext.projectGraph`, `ExecutorContext.nxJsonConfiguration`, and `ExecutorContext.projectsConfigurations` is marked as optional because `ExecutorContext` in some versions of Nx did not have them. * `ExecutorContext.workspace` is marked as optional because `ExecutorContext` in some versions of Nx did not have the above properties which contain the same information. * `ProjectGraphNode` is deprecated. * `NxPluginV1.processProjectGraph` was deprecated long ago and there has been a warning since. * `appRootPath` has been deprecated for a long time. * `parseTargetString` had a variant that did not take either the project graph or the executor context. * `readNxJson` has a variant which does not take a tree. This was not clearly deprecated. * There are handlers to require from `@nx/` instead of `@nrwl` * Nx tries to get a root install from `@nrwl/cli` * `@nx/devkit` supports Nx 19 - 21. * Node 20 - 22 is supported * `ExecutorContext.projectGraph`, `ExecutorContext.nxJsonConfiguration`, and `ExecutorContext.projectsConfigurations` is marked as required because `ExecutorContext` in Nx 19+ is guaranteed to have them. * `ExecutorContext.workspace` is removed because the same information is available in the above properties * `ProjectGraphNode` is removed. * `NxPluginV1` is no more. All plugins should be `NxPluginV2`. * `workspaceRoot` is the replacement for `appRootPath`. `appRootPath` is removed. * `parseTargetString` no longer has a variant that did not take either the project graph or the executor context. * `readNxJson` still has a variant which does not take a tree but it's clearly deprecated to be removed in Nx 21. * `@nrwl` packages are no more so we don't have to redirect requires anymore. * `@nrwl/cli` is no more so Nx shouldn't try to get a root install there * Fixes # --- packages/devkit/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devkit/package.json b/packages/devkit/package.json index b40a777f6a381..22122669636fe 100644 --- a/packages/devkit/package.json +++ b/packages/devkit/package.json @@ -38,7 +38,7 @@ "minimatch": "9.0.3" }, "peerDependencies": { - "nx": ">= 17 <= 20" + "nx": ">= 19 <= 21" }, "publishConfig": { "access": "public"