microsoft/rushstack

[rush] rush update can not handle dependenciesMeta in pnpm

Closed this issue · 0 comments

Summary

The PNPM has a setting called dependenciesMeta, see more details on PNPM
It is used to set up the injected settings for packages.

Right now, when users set up this in package.json, rush update does not update the pnpm-lock.yaml

Repro steps

This is a bug I found when I working on pnpm-sync-prototype
So, we can use this repo to reproduce the bug.

  1. Change the injected settings for any workspace dependencies. In this example, let's modify package.json for apps/app3 , add "dependenciesMeta": { "lib1": { "injected": true } }
  2. Run rush update
  3. Check pnpm-lock.yaml under common/config/rush, you will see there is no change for pnpm-lock.yaml
  4. However, if you check common/temp folder, you will see pnpm-lock.yaml and pnpm-lock-preinstall.yaml are different
  5. Now, delete the common/temp folder, and run rush install, you will the see PNPM complains ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with ../../apps/app3/package.json

The expected behavior is that after we make some changes to dependenciesMeta in package.json, rush update should update the pnpm-lock.yaml under common/config/rush. So that, the rush install will not fail later.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.109.1
rushVersion from rush.json? 5.109.1
useWorkspaces from rush.json? pnpm workspace
Operating system? Mac
Would you consider contributing a PR? Yes
Node.js version (node -v)? v16.20.2