Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
respect pnpm-workspaces.yaml
Browse files Browse the repository at this point in the history
mmews committed Jan 4, 2024
1 parent 61288c2 commit 9b81c11
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -293,8 +293,15 @@ private void setInformationFromPnpmWorkspace(FileURI location, ProjectDescriptio
Multimap<String, String> pnpmWorkspacesYaml = YamlUtil.loadYamlAtLocation(path);
Collection<String> packagesEntries = pnpmWorkspacesYaml.get("packages");
if (!packagesEntries.isEmpty()) {
target.setPnpmWorkspaceRoot(true);
target.getWorkspaces().addAll(packagesEntries);
// check for property discussed here: https://github.com/pnpm/pnpm/issues/2255#issuecomment-576866891
Collection<String> useYarnConfigEntries = pnpmWorkspacesYaml.get("useYarnConfig");
if (useYarnConfigEntries.isEmpty()
|| !"true".equals(useYarnConfigEntries.iterator().next().toString().toLowerCase())) {

target.setPnpmWorkspaceRoot(true);
target.getWorkspaces().clear();
target.getWorkspaces().addAll(packagesEntries);
}
}
}

0 comments on commit 9b81c11

Please sign in to comment.