First of all, thanks for adding the pnpm workspace support so quickly! I've been beating my head trying to patch packages in pnpm workspaces for quite a while now.
I did come across a minor issue with the package detection logic. The following code is causing the pnpm workspace detection to never get executed.
} else if (yarnLockExists || findWorkspaceRoot()) {
return "yarn"
} else if (isFileInPnpmRoot(appRootPath, "pnpm-lock.yaml")) {
// (fs.existsSync(join(appRootPath, "pnpm-lock.yaml"))) {
return "pnpm"
What is interesting is I do not even have yarn installed on my machine. It looks like findWorkspaceRoot() (from the find-yarn-workspace-root package) doesn't test if you have yarn, it just returns what it thinks is the workspace root. So that always seems to return a string if you're using workspaces, regardless of yarn being used or even installed.
I'm not sure if that needs to be changed to yarnLockExists && findWorkspaceRoot() or just swap the order of the else if blocks so that it has a chance to detect pnpm first.
I simply commented out the logic block that uses findWorkspaceRoot() and the pnpm workspace was detected.
First of all, thanks for adding the pnpm workspace support so quickly! I've been beating my head trying to patch packages in pnpm workspaces for quite a while now.
I did come across a minor issue with the package detection logic. The following code is causing the pnpm workspace detection to never get executed.
What is interesting is I do not even have yarn installed on my machine. It looks like
findWorkspaceRoot()(from the find-yarn-workspace-root package) doesn't test if you have yarn, it just returns what it thinks is the workspace root. So that always seems to return a string if you're using workspaces, regardless of yarn being used or even installed.I'm not sure if that needs to be changed to
yarnLockExists && findWorkspaceRoot()or just swap the order of theelse ifblocks so that it has a chance to detect pnpm first.I simply commented out the logic block that uses findWorkspaceRoot() and the pnpm workspace was detected.