diff --git a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm-workspaces/pnpm-workspace.yaml b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm-workspaces/pnpm-workspace.yaml index a025f91f7c188..31dbaad46d954 100644 --- a/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm-workspaces/pnpm-workspace.yaml +++ b/plugins/package-managers/node/src/funTest/assets/projects/synthetic/pnpm-workspaces/pnpm-workspace.yaml @@ -1,3 +1,3 @@ packages: + - 'src/app/' - 'src/packages/**' - - 'src/app/**' diff --git a/plugins/package-managers/node/src/main/kotlin/utils/NpmDetection.kt b/plugins/package-managers/node/src/main/kotlin/utils/NpmDetection.kt index d4c683efff26b..d99cff990d729 100644 --- a/plugins/package-managers/node/src/main/kotlin/utils/NpmDetection.kt +++ b/plugins/package-managers/node/src/main/kotlin/utils/NpmDetection.kt @@ -51,7 +51,9 @@ class NpmDetection(private val definitionFiles: Collection) { definitionFiles.associate { file -> val projectDir = file.parentFile val patterns = NodePackageManager.entries.mapNotNull { it.getWorkspaces(projectDir) }.flatten() - projectDir to patterns.map { FileSystems.getDefault().getPathMatcher("glob:$it") } + projectDir to patterns.map { + FileSystems.getDefault().getPathMatcher("glob:${it.removeSuffix("/")}") + } } } diff --git a/plugins/package-managers/node/src/test/kotlin/utils/NpmDetectionTest.kt b/plugins/package-managers/node/src/test/kotlin/utils/NpmDetectionTest.kt index 6f9913b387672..858a244e0d246 100644 --- a/plugins/package-managers/node/src/test/kotlin/utils/NpmDetectionTest.kt +++ b/plugins/package-managers/node/src/test/kotlin/utils/NpmDetectionTest.kt @@ -184,7 +184,7 @@ class NpmDetectionTest : WordSpec({ PNPM.getWorkspaces(projectDir) shouldNotBeNull { mapNotNull { it.withoutPrefix(projectDir.path) - }.shouldContainExactly("/src/packages/**", "/src/app/**") + }.shouldContainExactly("/src/app/", "/src/packages/**") } }