diff --git a/e2e/nx-run/src/affected-graph.test.ts b/e2e/nx-run/src/affected-graph.test.ts index 115a3bc0973684..79e398287406ef 100644 --- a/e2e/nx-run/src/affected-graph.test.ts +++ b/e2e/nx-run/src/affected-graph.test.ts @@ -258,6 +258,21 @@ describe('Nx Affected and Graph Tests', () => { expect(runCLI('affected:apps')).toContain(myapp2); expect(runCLI('affected:libs')).not.toContain(mylib); }); + + it('should detect changes to implicitly dependant projects', () => { + generateAll(); + updateProjectConfig(myapp, (config) => ({ + ...config, + implicitDependencies: ['*', `!${myapp2}`], + })); + + const affectedApps = runCLI('affected:apps'); + const affectedLibs = runCLI('affected:libs'); + + expect(affectedApps).toContain(myapp); + expect(affectedApps).not.toContain(myapp2); + expect(affectedLibs).toContain(mylib); + }); }); describe('print-affected', () => { diff --git a/packages/nx/src/utils/assert-workspace-validity.ts b/packages/nx/src/utils/assert-workspace-validity.ts index 7ebbd6d218d813..b16a9aa6ce0583 100644 --- a/packages/nx/src/utils/assert-workspace-validity.ts +++ b/packages/nx/src/utils/assert-workspace-validity.ts @@ -90,7 +90,7 @@ function detectAndSetInvalidProjectValues( const projectName = implicit.startsWith('!') ? implicit.substring(1) : implicit; - return !validProjects[projectName]; + return !(implicit === '*' || validProjects[projectName]); }); if (invalidProjects.length > 0) {