From 1d848dda6215cd59fbf05ad5dc19256f45662fea Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Thu, 17 Nov 2022 11:53:53 -0500 Subject: [PATCH] fix(core): fix parsing of npm workspace patterns (#13206) --- packages/nx/src/config/workspaces.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nx/src/config/workspaces.ts b/packages/nx/src/config/workspaces.ts index bc971e592573a..541905d88d35e 100644 --- a/packages/nx/src/config/workspaces.ts +++ b/packages/nx/src/config/workspaces.ts @@ -28,6 +28,7 @@ import { import { PackageJson } from '../utils/package-json'; import { sortObjectByKeys } from '../utils/object-sort'; import { output } from '../utils/output'; +import { joinPathFragments } from '../utils/path'; export function workspaceConfigName( root: string @@ -655,7 +656,9 @@ export function getGlobPatternsFromPackageManagerWorkspaces( function normalizePatterns(patterns: string[]): string[] { return patterns.map((pattern) => removeRelativePath( - pattern.endsWith('/package.json') ? pattern : `${pattern}/package.json` + pattern.endsWith('/package.json') + ? pattern + : joinPathFragments(pattern, 'package.json') ) ); }