Skip to content

Commit

Permalink
Add third-parties to sync-react and ensure only listed react dependen…
Browse files Browse the repository at this point in the history
…cies are updated
  • Loading branch information
mobeigi committed Oct 14, 2024
1 parent 3811693 commit d547837
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/sync-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const filesReferencingReactPeerDependencyVersion = [
'test/lib/next-modes/base.ts',
]
const appManifestsInstallingNextjsPeerDependencies = [
'packages/third-parties/package.json',
'examples/reproduction-template/package.json',
'test/.stats-app/package.json',
// TODO: These should use the usual test helpers that automatically install the right React version
Expand Down Expand Up @@ -344,8 +345,12 @@ Or, run this command with no arguments to use the most recently published versio
const packageJsonPath = path.join(cwd, fileName)
const packageJson = await fsp.readFile(packageJsonPath, 'utf-8')
const manifest = JSON.parse(packageJson)
manifest.dependencies['react'] = newVersionStr
manifest.dependencies['react-dom'] = newVersionStr
if (manifest.dependencies['react']) {
manifest.dependencies['react'] = newVersionStr
}
if (manifest.dependencies['react-dom']) {
manifest.dependencies['react-dom'] = newVersionStr
}
await fsp.writeFile(
packageJsonPath,
JSON.stringify(manifest, null, 2) +
Expand Down

0 comments on commit d547837

Please sign in to comment.