Open ingun37 opened 3 days ago
Local versions aren't supposed to be in the pnpm-lock file. Can you share a repro repo?
@iclanton In this repro repo
rush publish ...
package.json
s.rush install
fails from main
because the pnpm-lock.yaml
's not updated. It would only succeed after rush update
and pnpm-lock.yaml
is updated.Enabling useWorkspaces
should resolve this issue. Non-workspace mode is deprecated, and in workspace mode your package.json
files should just contain workspace:*
as the version specifier for packages within the repository, which means they won't change in a way that impacts pnpm-lock.yaml
on version bump.
@dmichon-msft Thanks that fiix it but there's a preceding problem. I didn't change the workspace version but Rush did. I also reproduced in the same repository and this is the step.
rush change
rush publish ... --prerelease-name prerelease --target-branch some-pr-6
.to
workspace:1.0.8-prerelease`**rush publish
workspace:1.0.8-prerelease
to workspace:1.0.8
I wanted to publish prerelease from PR for some integration test with other external projects. But by doing so the workspace version changes. Should I do the prerelease publish process differently?
Summary
Version bumping does not automatically update
pnpm-lock.yaml
. Therefore it needs to be updated manually. Otherwise, subsequent PRs fail atrush install
or suffers frompnpm-lock.yaml
conflict.Details
When I do
rush publish --publish --apply ...
, the following version bump commit updates all the versions in the package.json files of the target branch. But since it doesn't updatepnpm-lock.yaml
, any subsequent PRs that is stemming from the target branch will suffer from the inconsistency betweenpackage.json
andpnpm-lock.yaml
. For examplerush install
won't work so they will have to run rush update by themselves. Shouldn't version bumping updatepnpm-lock.yaml
too?Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?