From d4f7c17eae2f63a08a59964fc12e8bc097b4707f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Fri, 25 Nov 2022 20:07:42 +0100 Subject: [PATCH] fix(core): set the right project graph node type for e2e project with name e2e --- .../build-nodes/workspace-projects.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/nx/src/project-graph/build-nodes/workspace-projects.ts b/packages/nx/src/project-graph/build-nodes/workspace-projects.ts index a6ac9a9894dcc8..7b0de57a1cdc18 100644 --- a/packages/nx/src/project-graph/build-nodes/workspace-projects.ts +++ b/packages/nx/src/project-graph/build-nodes/workspace-projects.ts @@ -11,7 +11,10 @@ import { ProjectGraphBuilder } from '../project-graph-builder'; import { PackageJson } from '../../utils/package-json'; import { readJsonFile } from '../../utils/fileutils'; import { NxJsonConfiguration } from '../../config/nx-json'; -import { TargetConfiguration } from '../../config/workspace-json-project-json'; +import { + ProjectType, + TargetConfiguration, +} from '../../config/workspace-json-project-json'; import { NX_PREFIX } from '../../utils/logger'; export function buildWorkspaceProjectNodes( @@ -51,12 +54,14 @@ export function buildWorkspaceProjectNodes( loadNxPlugins(ctx.workspace.plugins) ); - const projectType = - p.projectType === 'application' - ? key.endsWith('-e2e') - ? 'e2e' - : 'app' - : 'lib'; + // TODO: remove in v16 + let projectType: ProjectType | 'e2e' = p.projectType; + if ( + p.projectType === 'application' && + (key.endsWith('-e2e') || key === 'e2e') + ) { + projectType = 'e2e'; + } const tags = ctx.workspace.projects && ctx.workspace.projects[key] ? ctx.workspace.projects[key].tags || []