Fix set-version script not updating dependencies under private/ (#55083)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55083

D86534510 broke our release workflow, as the intentionally narrowed package set for `set-version` unintentionally meant that `dependencies`/`devDependencies` were no longer completely applied — breaking `yarn` install.

Fix and add clarification comments.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D90268470

fbshipit-source-id: ba731edc0f248cccf44b34f746236d383c318768
This commit is contained in:
Alex Hunt authored and meta-codesync[bot] committed 2026-01-08 02:25:26 -08:00
1 parent 9c4b92f822
commit 24c126da9f
1 file changed
+13 -3
+13 -3
View File
@@ -71,12 +71,14 @@ async function setVersion(
version /*: string */,
skipReactNativeVersion /*: boolean */ = false,
) /*: Promise<void> */ {
const packages = await getPackages({
// Packages to set the new versions of. This excludes packages under
// private/, which are not versioned.
const packagesToVersion = await getPackages({
includeReactNative: true,
forceIncludeRNTester: true,
});
const newPackageVersions = Object.fromEntries(
Object.keys(packages).map(packageName => [
Object.keys(packagesToVersion).map(packageName => [
packageName,
packageName === 'react-native' && skipReactNativeVersion
? '1000.0.0'
@@ -84,9 +86,17 @@ async function setVersion(
]),
);
// Packages to apply updated versions in (dependencies/devDependencies). This
// is all packages and the workspace root.
const packagesToUpdate = [
await getWorkspaceRoot(),
...Object.values(packages),
...Object.values(
await getPackages({
includeReactNative: true,
includePrivate: true,
forceIncludeRNTester: true,
}),
),
];
// Update all workspace packages