Replies: 2 comments 4 replies
-
@zkochan is there no official solution for migrating to a newer lockfile version? (In our use case, it is very important that adopting a new release of PNPM does not force lockfile dependencies to get upgraded, since that would be potentially disruptive for app teams and validation can be time consuming. In other words, we'd like for lockfile upgrades and dependency upgrades to be separate steps that can be validated in isolation.) |
Beta Was this translation helpful? Give feedback.
-
The lockfile format is the same in pnpm v6 and v7. pnpm v8 automatically converts the older lockfile format to the newer one without updating dependencies. You should be able just to run |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I have a problem when upgrading pnpm version for a Monorepo project, and want to see if the community has a better idea.
Here is the background, our Monorepo (based on Rush) is huge and has ~1000 projects. And, due to historical reasons, there is no common
pnpm-lock.yaml
for them, which means there are ~1000pnpm-lock.yaml
inside our Monorepo. We used pnpm 6.x now, and want to upgrade to pnpm 8.x.It's very time consuming if we regenerate
pnpm-lock.yaml
usingpnpm update
for all projects. So I wrote a custom script to convert the lockfile version from v5 to v6Here is link to the script
In the script:
readWantedLockfile
,writeWantedLockfile
,convertToInlineSpecifiersFormat
functions from @pnpm/lockfile-file to help me convert lockfile version from v5 to v6.pnpm-lock.yaml
version is5-inlineSpecifiers
, also, the version format is still old ones, which means, if you runpnpm install
for thesepnpm-lock.yaml
, it will complain about format error.pnpm-lock.yaml
, like change5-inlineSpecifiers
to6.0
, change version format (eg,3.0.9_react-dom@17.0.2+react@17.0.2 => 3.0.9(react-dom@17.0.2)(react@17.0.2)
), and other fixes to make surepnpm install
does not complain the format error.pnpm install
can install the dependenciesOk, that's all I did to solve the problem. Here, want to see if you guys have a better idea here.
pnpm-lock.yaml
between different versions? I am not supper confident on the script I wrote, cause they are many edge cases. So if there are exiting tools, I am very happy to try it.pnpm update --dry-run
will only regenerate thepnpm-lock.yaml
for you, but don't do the installation, post-install scripting, etc. So It will save huge amount of time when working a pnpm upgrade in a Monorepo situation.Beta Was this translation helpful? Give feedback.
All reactions