Replies: 1 comment 5 replies
-
@Mufasa eg: if you have 2 packages in your workspace named pnpm --filter @my-monorepo/pkg-1 add @my-monorepo/pkg-2 to add |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been using npm for many years and have now started to move over to use pnpm. My initial feedback on pnpm is that it is indeed far superior to npm and I absolutely love it. However, I have spotted a strange issue which I have described below.
When I add a workspace dependency using
pnpm add myWorkspaceLibA --workspace --filter myWorkspaceLibB
, pnpm generates this inmyWorkspaceLibB
'spackage.json
file:It also generates this in the root
pnpm-lock.yaml
file:From the various articles and videos that I have seen on this, I understand that after running the
pnpm add
command I should change thepackage.json
entry inmyWorkspaceLibB
to:in order to ensure that it always picks up the latest version of
myWorkspaceLibA
in my monorepo.However, this leaves the
pnpm-lock.yaml
file inconsistent with thepackage.json
file.I have the following questions on this:
pnpm-lock.yaml
file to make it consistent with thepackage.json
file?My gut feeling tells me that it is not a good idea for me to be manually changing the
pnpm-lock.yaml
file. I would therefore like to suggest that thepnpm add
command be enhanced in some way so that it automagically setsworkspace:*
in both thepackage.json
andpnpm-lock.yaml
files.Is this a reasonable request or have I misunderstood something here?
Beta Was this translation helpful? Give feedback.
All reactions