Skip to content

Commit

Permalink
fix(turbo): make targets optional so we do not need to return them yet
Browse files Browse the repository at this point in the history
  • Loading branch information
yharaskrik committed Nov 23, 2023
1 parent 63f71bd commit a4fa2c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface TrueAffectedProject {
sourceRoot: string;
tsConfig?: string;
implicitDependencies?: string[];
targets: string[];
targets?: string[];
}

export interface TrueAffected {
Expand Down
7 changes: 5 additions & 2 deletions libs/nx/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ export const affectedAction = async ({
let projects = await getNxTrueAffectedProjects(cwd);

if (target.length) {
projects = projects.filter((project) =>
project.targets.some((projectTarget) => target.includes(projectTarget))
projects = projects.filter(
(project) =>
!!project.targets?.some((projectTarget) =>
target.includes(projectTarget)
)
);
}

Expand Down

0 comments on commit a4fa2c2

Please sign in to comment.