Skip to content

Commit 1016929

Browse files
Saadnajmiclaude
andcommitted
fix: use 1000.0.0 for private @react-native-macos/ package versions
Update the enforceReactNativeMacosPrivatePackageVersion constraint to use 1000.0.0 instead of 0.1.0, matching the upstream convention. Also remove the isMainBranch guard so the constraint applies on all branches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 86827dc commit 1016929

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

yarn.config.cjs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,6 @@ 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-
156140
/**
157141
* Enforce that all @react-native-macos/ scoped dependencies use the same version
158142
* as the react-native-macos
@@ -174,13 +158,29 @@ function enforceReactNativeMacOSDependencyConsistency({Yarn}) {
174158
}
175159
}
176160

161+
/**
162+
* Enforce that all private @react-native-macos/ scoped packages use a fixed
163+
* version of 1000.0.0, so they are decoupled from release versioning.
164+
* @param {Context} context
165+
*/
166+
function enforceReactNativeMacosPrivatePackageVersion({Yarn}) {
167+
for (const workspace of Yarn.workspaces()) {
168+
const isReactNativeMacosScoped = workspace.ident?.startsWith('@react-native-macos/');
169+
const isPrivate = workspace.manifest.private;
170+
171+
if (isReactNativeMacosScoped && isPrivate) {
172+
workspace.set('version', '1000.0.0');
173+
}
174+
}
175+
}
176+
177177
module.exports = defineConfig({
178178
constraints: async ctx => {
179179
enforcePrivateReactNativeScopedPackages(ctx);
180180
enforceReactNativeVersionConsistency(ctx);
181181
enforceReactNativeDependencyConsistency(ctx);
182182
enforceReactNativeMacosVersionConsistency(ctx);
183-
enforceReactNativeMacosPrivatePackageVersion(ctx);
184183
enforceReactNativeMacOSDependencyConsistency(ctx);
184+
enforceReactNativeMacosPrivatePackageVersion(ctx);
185185
},
186186
});

0 commit comments

Comments
 (0)