From 25ce9c0297f746d1fef7a4da038b3f590d49f5ee Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Wed, 10 May 2023 23:28:08 -0400 Subject: [PATCH] =?UTF-8?q?fix(task-graph):=20fix=20handling=20of=20simple?= =?UTF-8?q?=20dependsOn=20target=20string=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=E2=94=80=E2=95=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #16931 - if a project has a `dependsOn` string with only a target that has the same name as another project, it is now treated correctly as a reference to a target in the same project --- packages/nx/src/tasks-runner/utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/nx/src/tasks-runner/utils.ts b/packages/nx/src/tasks-runner/utils.ts index a2127db4f89935..96bab4d1666cef 100644 --- a/packages/nx/src/tasks-runner/utils.ts +++ b/packages/nx/src/tasks-runner/utils.ts @@ -69,6 +69,13 @@ export function expandDependencyConfigSyntaxSugar( // Support for both `project:target` and `target:with:colons` syntax const [maybeProject, ...segments] = splitByColons(targetString); + + // if no additional segments are provided, then the string references + // a target of the same project + if (!segments.length) { + return { target: maybeProject }; + } + return { // Only the first segment could be a project. If it is, the rest is a target. // If its not, then the whole targetString was a target with colons in its name.