Skip to content

Commit

Permalink
fix(task-graph): fix handling of simple dependsOn target string ─╯
Browse files Browse the repository at this point in the history
closes nrwl#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
  • Loading branch information
acburdine committed May 11, 2023
1 parent 09525e8 commit 25ce9c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nx/src/tasks-runner/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 25ce9c0

Please sign in to comment.