diff --git a/packages/react-native-compatibility-check/package.json b/packages/react-native-compatibility-check/package.json index 6c25ca3431d3..69ccc77b6e42 100644 --- a/packages/react-native-compatibility-check/package.json +++ b/packages/react-native-compatibility-check/package.json @@ -1,6 +1,7 @@ { "name": "@react-native/compatibility-check", "version": "0.79.0-main", + "private": true, "description": "Check a React Native app's boundary between JS and Native for incompatibilities", "license": "MIT", "repository": { diff --git a/yarn.config.cjs b/yarn.config.cjs index 567c97a3ecd4..bffe9b7c2759 100644 --- a/yarn.config.cjs +++ b/yarn.config.cjs @@ -60,11 +60,11 @@ const isMainBranch = ({Yarn}) => { * @param {Context} context */ function enforcePrivateReactNativeScopedPackages({Yarn}) { - for (const dependency of Yarn.dependencies()) { - if (dependency.ident.startsWith('@react-native/')) { - Yarn.workspace({ident: dependency.ident})?.set('private', true); + for (const workspace of Yarn.workspaces()) { + if (workspace.ident?.startsWith('@react-native/') && !PACKAGES_TO_IGNORE.includes(workspace.ident)) { + workspace.set('private', true); } - } + } } /**