Fix: Don't skip writing updated package.json

Another fix to previous commit. The special case for
use-sync-external-store still needs to write out the updated
package.json, because we also use that branch to update the
version field.
This commit is contained in:
Andrew Clark 2021-12-08 02:55:46 -05:00
parent e39b2c8998
commit 72e48b8e16
No known key found for this signature in database
GPG Key ID: 542E2C5D4AD706D4
1 changed files with 8 additions and 8 deletions

View File

@ -250,14 +250,14 @@ function updatePackageVersions(
// we don't override to the latest version. We should figure out some
// better way to handle this.
// TODO: Remove this special case.
continue;
}
for (const dep of Object.keys(packageInfo.peerDependencies)) {
const depVersion = versionsMap.get(dep);
if (depVersion !== undefined) {
packageInfo.peerDependencies[dep] = pinToExactVersion
? depVersion
: '^' + depVersion;
} else {
for (const dep of Object.keys(packageInfo.peerDependencies)) {
const depVersion = versionsMap.get(dep);
if (depVersion !== undefined) {
packageInfo.peerDependencies[dep] = pinToExactVersion
? depVersion
: '^' + depVersion;
}
}
}
}