Skip to content

Commit

Permalink
fix(core): affect all projects when nx.json is touched (#23036)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored Apr 26, 2024
1 parent 4d3b988 commit c36e246
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,26 @@ describe('getImplicitlyTouchedProjects', () => {
[]
);
});

it('should return every project when nx.json is touched', () => {
const graph = buildProjectGraphNodes({
a: {
root: 'a',
namedInputs: {
files: ['{workspaceRoot}/a.txt'],
},
targets: {},
},
b: {
root: 'b',
},
});
let fileChanges = getFileChanges(['nx.json']);
expect(getImplicitlyTouchedProjects(fileChanges, graph, nxJson)).toEqual([
'a',
'b',
]);
});
});

function buildProjectGraphNodes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const getImplicitlyTouchedProjects: TouchedProjectLocator = (
projectGraphNodes,
nxJson
): string[] => {
const implicits = {};
const implicits = {
'nx.json': '*',
};

Object.values(projectGraphNodes || {}).forEach((node) => {
const namedInputs = {
Expand Down

0 comments on commit c36e246

Please sign in to comment.