Skip to content

Commit 6f800a5

Browse files
authored
fix(constraints): enforcePrivateReactNativeScopedPackages checks workspaces instead of dependencies (#2652)
1 parent 797ca8c commit 6f800a5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/react-native-compatibility-check/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@react-native/compatibility-check",
33
"version": "0.79.0-main",
4+
"private": true,
45
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
56
"license": "MIT",
67
"repository": {

yarn.config.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ const isMainBranch = ({Yarn}) => {
6060
* @param {Context} context
6161
*/
6262
function enforcePrivateReactNativeScopedPackages({Yarn}) {
63-
for (const dependency of Yarn.dependencies()) {
64-
if (dependency.ident.startsWith('@react-native/')) {
65-
Yarn.workspace({ident: dependency.ident})?.set('private', true);
63+
for (const workspace of Yarn.workspaces()) {
64+
if (workspace.ident?.startsWith('@react-native/') && !PACKAGES_TO_IGNORE.includes(workspace.ident)) {
65+
workspace.set('private', true);
6666
}
67-
}
67+
}
6868
}
6969

7070
/**

0 commit comments

Comments
 (0)