Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@react-native-macos/monorepo",
"version": "0.81.5",
"private": true,
"version": "1000.0.0",
"license": "MIT",
"packageManager": "yarn@4.13.0",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/nx-release-version/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@react-native-macos/nx-release-version",
"version": "0.1.0",
"private": true,
"version": "1000.0.0",
"description": "Nx Release Version Actions for React Native macOS",
"homepage": "https://github.com/microsoft/react-native-macos/tree/HEAD/packages/nx-release-version#readme",
"license": "MIT",
Expand Down
37 changes: 17 additions & 20 deletions yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ function enforceReactNativeMacosVersionConsistency({Yarn}) {
}
}

/**
* Enforce that all private @react-native-macos/ scoped packages use a fixed
* version of 1000.0.0, so they are decoupled from release versioning.
* @param {Context} context
*/
function enforceReactNativeMacosPrivatePackageVersion({Yarn}) {
for (const workspace of Yarn.workspaces()) {
const isReactNativeMacosScoped = workspace.ident && workspace.ident.startsWith('@react-native-macos/');
const isPrivate = workspace.manifest.private;

if (isReactNativeMacosScoped && isPrivate) {
workspace.set('version', '1000.0.0');
}
}
}

/**
* Enforce that all @react-native-macos/ scoped dependencies use the same version
* as the react-native-macos
Expand All @@ -158,32 +174,13 @@ function enforceReactNativeMacOSDependencyConsistency({Yarn}) {
}
}

/**
* Enforce that private @react-native-macos/ scoped packages (i.e. internal
* tooling that is not forked from upstream) have a fixed version of 0.1.0.
* These packages do not track the react-native-macos release version.
* @param {Context} context
*/
function enforceReactNativeMacosPrivatePackageVersion({Yarn}) {
if (!isMainBranch({Yarn})) {
for (const workspace of Yarn.workspaces()) {
const isReactNativeMacosScoped = workspace.ident?.startsWith('@react-native-macos/');
const isPrivate = workspace.manifest.private;

if (isReactNativeMacosScoped && isPrivate) {
workspace.set('version', '0.1.0');
}
}
}
}

module.exports = defineConfig({
constraints: async ctx => {
enforcePrivateReactNativeScopedPackages(ctx);
enforceReactNativeVersionConsistency(ctx);
enforceReactNativeDependencyConsistency(ctx);
enforceReactNativeMacosVersionConsistency(ctx);
enforceReactNativeMacOSDependencyConsistency(ctx);
enforceReactNativeMacosPrivatePackageVersion(ctx);
enforceReactNativeMacOSDependencyConsistency(ctx);
},
});
Loading