Replies: 2 comments 8 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.yamlfor them, which means there are ~1000pnpm-lock.yamlinside 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.yamlusingpnpm updatefor 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,convertToInlineSpecifiersFormatfunctions from @pnpm/lockfile-file to help me convert lockfile version from v5 to v6.pnpm-lock.yamlversion is5-inlineSpecifiers, also, the version format is still old ones, which means, if you runpnpm installfor thesepnpm-lock.yaml, it will complain about format error.pnpm-lock.yaml, like change5-inlineSpecifiersto6.0, change version format (eg,[email protected][email protected] => 3.0.9([email protected])([email protected])), and other fixes to make surepnpm installdoes not complain the format error.pnpm installcan 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.yamlbetween 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-runwill only regenerate thepnpm-lock.yamlfor 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