From bf202e32d1c86cc310c7840304f76dea11b1901f Mon Sep 17 00:00:00 2001 From: noys Date: Wed, 22 Nov 2023 11:17:09 +0200 Subject: [PATCH] :bug: Fixed issue regarding Yarn workspaces feature eliminating _project_ dependency --- src/main/java/com/jfrog/ide/common/yarn/YarnTreeBuilder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jfrog/ide/common/yarn/YarnTreeBuilder.java b/src/main/java/com/jfrog/ide/common/yarn/YarnTreeBuilder.java index 8ffddbc..a834c7c 100644 --- a/src/main/java/com/jfrog/ide/common/yarn/YarnTreeBuilder.java +++ b/src/main/java/com/jfrog/ide/common/yarn/YarnTreeBuilder.java @@ -105,7 +105,10 @@ private List extractSinglePath(String projectRootId, String packageFullN List pathResult = new ArrayList<>(); pathResult.add(projectRootId); // The root project is guaranteed to be the first element in the path - rawDependency = StringUtils.lowerCase(rawDependency); // the word specified can be in upper or lower case + rawDependency = StringUtils.lowerCase(rawDependency); // The word specified can be in upper or lower case + // remove any "_project_" strings (can be generated as part of a Yarn workspace in Yarn Monorepo feature) + rawDependency = StringUtils.remove(rawDependency, "_project_"); + if (StringUtils.contains(rawDependency, "specified in")) { // This is a direct dependency pathResult.add(packageFullName); return pathResult;