Skip to content

Commit 86827dc

Browse files
Saadnajmiclaude
andcommitted
fix(0.81): fix yarn constraints failures after release bumps
Mark root monorepo and nx-release-version packages as private with a fixed version of 1000.0.0, decoupling them from the release versioning. Add a yarn constraint to enforce this. Previously, nx release only bumped packages/react-native and packages/virtualized-lists, leaving these internal packages behind and causing yarn constraints to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 98b3d58 commit 86827dc

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@react-native-macos/monorepo",
3-
"version": "0.81.2",
3+
"private": true,
4+
"version": "1000.0.0",
45
"license": "MIT",
56
"packageManager": "yarn@4.12.0",
67
"scripts": {

packages/nx-release-version/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@react-native-macos/nx-release-version",
3-
"version": "0.81.2",
3+
"private": true,
4+
"version": "1000.0.0",
45
"description": "Nx Release Version Actions for React Native macOS",
56
"homepage": "https://github.com/microsoft/react-native-macos/tree/HEAD/packages/nx-release-version#readme",
67
"license": "MIT",

yarn.config.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,22 @@ function enforceReactNativeMacosVersionConsistency({Yarn}) {
137137
}
138138
}
139139

140+
/**
141+
* Enforce that all private @react-native-macos/ scoped packages use a fixed
142+
* version of 1000.0.0, so they are decoupled from release versioning.
143+
* @param {Context} context
144+
*/
145+
function enforceReactNativeMacosPrivatePackageVersion({Yarn}) {
146+
for (const workspace of Yarn.workspaces()) {
147+
const isReactNativeMacosScoped = workspace.ident && workspace.ident.startsWith('@react-native-macos/');
148+
const isPrivate = workspace.manifest.private;
149+
150+
if (isReactNativeMacosScoped && isPrivate) {
151+
workspace.set('version', '1000.0.0');
152+
}
153+
}
154+
}
155+
140156
/**
141157
* Enforce that all @react-native-macos/ scoped dependencies use the same version
142158
* as the react-native-macos
@@ -164,6 +180,7 @@ module.exports = defineConfig({
164180
enforceReactNativeVersionConsistency(ctx);
165181
enforceReactNativeDependencyConsistency(ctx);
166182
enforceReactNativeMacosVersionConsistency(ctx);
183+
enforceReactNativeMacosPrivatePackageVersion(ctx);
167184
enforceReactNativeMacOSDependencyConsistency(ctx);
168185
},
169186
});

0 commit comments

Comments
 (0)