I followed the instructions for Hybrid PnP + node_modules mono-repo: from the Recipes.
Does that support referencing other packages in the same repository from the workspace for which the node-modules linker is enabled?
Whenever I provide the yarn.lock file as instructed, local packages cannot be resolved any more:
➤ YN0001: │ Error: @local/lib@workspace:^: Workspace not found (@local/lib@workspace:^)
at St.getWorkspaceByDescriptor (C:\Users\Max\repos\yarn-pnp-react-native\.yarn\releases\yarn-4.0.2.cjs:210:3520)
Sample repository here: yarn-pnp-react-native
Note when configuring the repository as suggested in https://github.com/yarnpkg/berry/issues/4232 local dependencies are resolved correctly. However, then when running yarn in the node-modules linked workspaces, node_module resolution is provided for all workspaces (which I understand as per #4323 to be the intended behaviour).
In any case, I can see only the following options:
- Do not provide a yarn.lock: Local dependency resolution works, but one gets
node_modulesall over when runningyarn installfrom the wrong place - Provide a yarn.lock:
node-moduleslinker isolated to provided project, but local dependency resolution does not work
Both of these don't solve the requirement of local dependency resolution without 'leaking' the node-modules linker into the other workspaces. Is that possible?