diff --git a/scripts/sync-react.js b/scripts/sync-react.js index a8387f516940d..1719d16d0aa97 100644 --- a/scripts/sync-react.js +++ b/scripts/sync-react.js @@ -57,6 +57,7 @@ Or, run this command with no arguments to use the most recently published versio await fsp.readFile(path.join(cwd, 'package.json'), 'utf-8') ) const devDependencies = pkgJson.devDependencies + const resolutions = pkgJson.resolutions const baseVersionStr = devDependencies[ useExperimental ? 'react-experimental-builtin' : 'react-builtin' ].replace(/^npm:react@/, '') @@ -93,6 +94,14 @@ Or, run this command with no arguments to use the most recently published versio ) } } + for (const [dep, version] of Object.entries(resolutions)) { + if (version.endsWith(`${baseReleaseLabel}-${baseSha}-${baseDateString}`)) { + resolutions[dep] = version.replace( + `${baseReleaseLabel}-${baseSha}-${baseDateString}`, + `${newReleaseLabel}-${newSha}-${newDateString}` + ) + } + } await fsp.writeFile( path.join(cwd, 'package.json'), JSON.stringify(pkgJson, null, 2) +