Skip to content

[Draft] feat: use yarn 4 in monorepo #50808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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: 3 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
runs:
using: "composite"
steps:
- name: corepack enable
run: corepack enable
shell: bash
- name: Setup node.js
uses: actions/setup-node@v4
with:
Expand Down
29 changes: 13 additions & 16 deletions .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: yarn-install
name: Yarn
description: Runs `yarn install`
inputs:
immutable:
description: Abort with an error exit code if the lockfile was to be modified
default: true
runs:
using: composite
steps:
- name: Install dependencies
- name: Install npm dependencies
if: ${{ inputs.immutable == 'true' }}
run: yarn
shell: bash
- name: Install npm dependencies (ignore lockfile changes)
if: ${{ inputs.immutable != 'true' }}
run: yarn --no-immutable
shell: bash
run: |
MAX_ATTEMPTS=2
ATTEMPT=0
WAIT_TIME=20
while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
yarn install --non-interactive --frozen-lockfile && break
echo "yarn install failed. Retrying in $WAIT_TIME seconds..."
sleep $WAIT_TIME
ATTEMPT=$((ATTEMPT + 1))
done
if [ $ATTEMPT -eq $MAX_ATTEMPTS ]; then
echo "All attempts to invoke yarn install failed - Aborting the workflow"
exit 1
fi
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,7 @@ fix_*.patch

# [Experimental] Generated TS type definitions
/packages/**/types_generated/

# Yarn
.yarn/cache
.yarn/install-state.gz
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "1000.0.0",
"license": "MIT",
"packageManager": "yarn@1.22.22",
"packageManager": "yarn@4.9.1",
"scripts": {
"android": "yarn --cwd packages/rn-tester android",
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
Expand Down Expand Up @@ -52,8 +52,8 @@
"@babel/preset-flow": "^7.24.7",
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.7.0",
"@react-native/metro-babel-transformer": "0.80.0-main",
"@react-native/metro-config": "0.80.0-main",
"@react-native/metro-babel-transformer": "workspace:*",
"@react-native/metro-config": "workspace:*",
"@tsconfig/node18": "1.0.1",
"@types/react": "^19.0.0",
"@typescript-eslint/parser": "^7.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dist"
],
"dependencies": {
"@react-native/dev-middleware": "0.80.0-main",
"@react-native/dev-middleware": "workspace:*",
"chalk": "^4.0.0",
"debug": "^4.4.0",
"invariant": "^2.2.4",
Expand Down
4 changes: 1 addition & 3 deletions packages/core-cli-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@
},
"files": [
"dist"
],
"dependencies": {},
"devDependencies": {}
]
}
2 changes: 1 addition & 1 deletion packages/dev-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"dependencies": {
"@isaacs/ttlcache": "^1.4.1",
"@react-native/debugger-frontend": "0.80.0-main",
"@react-native/debugger-frontend": "workspace:*",
"chrome-launcher": "^0.15.2",
"chromium-edge-launcher": "^0.2.0",
"connect": "^3.6.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.80.0-main",
"@react-native/eslint-plugin": "workspace:*",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"eslint-config-prettier": "^8.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@react-native/codegen": "0.80.0-main",
"@react-native/codegen": "workspace:*",
"make-dir": "^2.1.0",
"pirates": "^4.0.1",
"source-map-support": "0.5.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/helloworld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native/babel-preset": "0.80.0-main",
"@react-native/core-cli-utils": "0.80.0-main",
"@react-native/eslint-config": "0.80.0-main",
"@react-native/metro-config": "0.80.0-main",
"@react-native/babel-preset": "workspace:*",
"@react-native/core-cli-utils": "workspace:*",
"@react-native/eslint-config": "workspace:*",
"@react-native/metro-config": "workspace:*",
"chalk": "^4.1.2",
"commander": "^12.0.0",
"eslint": "^8.19.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"dist"
],
"dependencies": {
"@react-native/js-polyfills": "0.80.0-main",
"@react-native/metro-babel-transformer": "0.80.0-main",
"@react-native/js-polyfills": "workspace:*",
"@react-native/metro-babel-transformer": "workspace:*",
"metro-config": "^0.82.0",
"metro-runtime": "^0.82.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@babel/plugin-transform-typescript": "^7.25.2",
"@babel/plugin-transform-unicode-regex": "^7.24.7",
"@babel/template": "^7.25.0",
"@react-native/babel-plugin-codegen": "0.80.0-main",
"@react-native/babel-plugin-codegen": "workspace:*",
"babel-plugin-syntax-hermes-parser": "0.28.0",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.14.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-babel-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
"dependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.80.0-main",
"@react-native/babel-preset": "workspace:*",
"hermes-parser": "0.28.0",
"nullthrows": "^1.1.1"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/react-native-codegen-typescript-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
"prepare": "yarn run build"
},
"dependencies": {
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "workspace:*"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-class-properties": "^7.25.4",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7",
"@babel/plugin-transform-object-rest-spread": "^7.24.7",
"@babel/plugin-transform-optional-chaining": "^7.24.8",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-async-to-generator": "^7.24.7",
"@babel/plugin-transform-class-properties": "^7.25.4",
"@babel/plugin-transform-destructuring": "^7.24.8",
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7",
"@babel/plugin-transform-object-rest-spread": "^7.24.7",
"@babel/plugin-transform-optional-chaining": "^7.24.8",
"@babel/preset-env": "^7.25.3",
"@types/jest": "^29.5.3",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-compatibility-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dist"
],
"dependencies": {
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "workspace:*"
},
"devDependencies": {
"flow-remove-types": "^2.237.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-popup-menu-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"license": "MIT",
"devDependencies": {
"@react-native/codegen": "0.80.0-main"
"@react-native/codegen": "workspace:*"
},
"peerDependencies": {
"@types/react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-test-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"devDependencies": {
"@babel/core": "^7.25.2",
"@react-native/babel-preset": "0.80.0-main",
"@react-native/babel-preset": "workspace:*",
"react-native": "1000.0.0"
},
"peerDependencies": {
Expand Down
18 changes: 8 additions & 10 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"engines": {
"node": ">=18"
},
"bin": {
"react-native": "cli.js"
},
"bin": "cli.js",
"types": "types",
"jest-junit": {
"outputDirectory": "reports/junit",
Expand Down Expand Up @@ -119,13 +117,13 @@
},
"dependencies": {
"@jest/create-cache-key-function": "^29.7.0",
"@react-native/assets-registry": "0.80.0-main",
"@react-native/codegen": "0.80.0-main",
"@react-native/community-cli-plugin": "0.80.0-main",
"@react-native/gradle-plugin": "0.80.0-main",
"@react-native/js-polyfills": "0.80.0-main",
"@react-native/normalize-colors": "0.80.0-main",
"@react-native/virtualized-lists": "0.80.0-main",
"@react-native/assets-registry": "workspace:*",
"@react-native/codegen": "workspace:*",
"@react-native/community-cli-plugin": "workspace:*",
"@react-native/gradle-plugin": "workspace:*",
"@react-native/js-polyfills": "workspace:*",
"@react-native/normalize-colors": "workspace:*",
"@react-native/virtualized-lists": "workspace:*",
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"ansi-regex": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"e2e-test-ios": "./scripts/maestro-test-ios.sh"
},
"dependencies": {
"@react-native/oss-library-example": "0.80.0-main",
"@react-native/popup-menu-android": "0.80.0-main",
"@react-native/oss-library-example": "workspace:*",
"@react-native/popup-menu-android": "workspace:*",
"flow-enums-runtime": "^0.0.6",
"invariant": "^2.2.4",
"nullthrows": "^1.1.1"
Expand Down
Loading
Loading