Skip to content

Commit

Permalink
chore(core): rename noop to dummy task
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli committed Oct 1, 2024
1 parent 3117438 commit 5f52ce8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/nx/src/tasks-runner/create-task-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TargetDefaults, TargetDependencies } from '../config/nx-json';
import { TargetDependencyConfig } from '../devkit-exports';
import { output } from '../utils/output';

const NOOP_TASK_TARGET = '__nx__noop';
const DUMMY_TASK_TARGET = '__nx_dummy_task__';

export class ProcessTasks {
private readonly seen = new Set<string>();
Expand Down Expand Up @@ -83,7 +83,7 @@ export class ProcessTasks {
}
}

this.filterNoopTasks();
this.filterDummyTasks();

for (const projectName of Object.keys(this.dependencies)) {
if (this.dependencies[projectName].length > 1) {
Expand Down Expand Up @@ -284,7 +284,11 @@ export class ProcessTasks {
);
}
} else {
const noopId = this.getId(depProject.name, NOOP_TASK_TARGET, undefined);
const noopId = this.getId(
depProject.name,
DUMMY_TASK_TARGET,
undefined
);
this.dependencies[task.id].push(noopId);
this.dependencies[noopId] = [];
const noopTask = this.createNoopTask(noopId, task);
Expand Down Expand Up @@ -371,14 +375,14 @@ export class ProcessTasks {
return id;
}

private filterNoopTasks() {
private filterDummyTasks() {
for (const [key, deps] of Object.entries(this.dependencies)) {
const normalizedDeps = [];
for (const dep of deps) {
if (dep.endsWith(NOOP_TASK_TARGET)) {
if (dep.endsWith(DUMMY_TASK_TARGET)) {
normalizedDeps.push(
...this.dependencies[dep].filter(
(d) => !d.endsWith(NOOP_TASK_TARGET)
(d) => !d.endsWith(DUMMY_TASK_TARGET)
)
);
} else {
Expand All @@ -390,7 +394,7 @@ export class ProcessTasks {
}

for (const key of Object.keys(this.dependencies)) {
if (key.endsWith(NOOP_TASK_TARGET)) {
if (key.endsWith(DUMMY_TASK_TARGET)) {
delete this.dependencies[key];
}
}
Expand Down

0 comments on commit 5f52ce8

Please sign in to comment.