Skip to content

Commit 7e0dfa8

Browse files
authored
Update monorepo to Yarn Berry (#4489)
1 parent 181cd6b commit 7e0dfa8

File tree

8 files changed

+22361
-15641
lines changed

8 files changed

+22361
-15641
lines changed

.github/workflows/pre-merge.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ jobs:
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: "20"
19-
cache: "yarn"
2019

21-
- name: Install dependencies
22-
run: yarn install --frozen-lockfile --no-progress --non-interactive
20+
- name: Enable Corepack
21+
run: corepack enable
22+
23+
- name: Check dependencies
24+
run: yarn dedupe --check
2325

26+
- name: Install dependencies
27+
run: yarn install --immutable
28+
2429
- name: Run Lint
2530
run: yarn ci:lint
2631
working-directory: website
@@ -35,10 +40,12 @@ jobs:
3540
uses: actions/setup-node@v4
3641
with:
3742
node-version: "20"
38-
cache: "yarn"
43+
44+
- name: Enable Corepack
45+
run: corepack enable
3946

4047
- name: Install dependencies
41-
run: yarn install --frozen-lockfile --no-progress --non-interactive
48+
run: yarn install --immutable
4249

4350
- name: Build
4451
run: yarn build

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ sync-api-docs/extracted.json
2727
website/.docusaurus
2828
website/.cache-loader
2929
website/build/
30+
31+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
32+
.pnp.*
33+
.yarn/*
34+
!.yarn/patches
35+
!.yarn/plugins
36+
!.yarn/releases
37+
!.yarn/sdks
38+
!.yarn/versions

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ If you are looking for the source code of the [React Native Archive website](htt
1717
### Prerequisites
1818

1919
1. [Git](https://git-scm.com/downloads).
20-
1. [Node](https://nodejs.org/en/download/) _(version 12 or greater)_.
21-
1. [Yarn](https://yarnpkg.com/lang/en/docs/install/) _(version 1.5 or greater)_.
20+
1. [Node](https://nodejs.org/en/download/) _(version 20 or greater)_.
21+
1. [Yarn](https://yarnpkg.com/getting-started/install) _(version 4)_.
2222
1. A fork of the repo _(for any contributions)_.
2323
1. A clone of the `react-native-website` repo.
2424

2525
### Installation
2626

2727
1. `cd react-native-website` to go into the project root.
28+
1. Run `corepack enable` to enable Corepack.
29+
30+
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
31+
2832
1. Run `yarn` to install the website's workspace dependencies.
2933

3034
### Running locally
@@ -166,6 +170,7 @@ If possible, test any visual changes in all latest versions of the following bro
166170
### Push it
167171

168172
1. Run `yarn prettier` and `yarn language:lint` in `./website` directory to ensure your changes are consistent with other files in the repo.
173+
1. Run `yarn update-lock` to [deduplicate dependencies](https://yarnpkg.com/cli/dedupe).
169174
1. `git add -A && git commit -m "My message"` to stage and commit your changes.
170175
> replace `My message` with a commit message, such as `Fixed header logo on Android`
171176
1. `git push my-fork-name the-name-of-my-branch`

package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"name": "react-native-website-monorepo",
33
"private": true,
4+
"engines": {
5+
"node": ">=20"
6+
},
47
"workspaces": [
58
"website",
69
"plugins/*",
710
"scripts/*",
811
"sync-api-docs"
912
],
1013
"scripts": {
11-
"postinstall": "yarn update-lock",
12-
"update-lock": "yarn-deduplicate",
14+
"update-lock": "yarn dedupe",
1315
"docusaurus": "yarn --cwd website docusaurus",
1416
"start": "yarn --cwd website start",
1517
"build": "yarn --cwd website build",
@@ -22,22 +24,15 @@
2224
}
2325
},
2426
"dependencies": {
25-
"case-police": "^0.5.14",
26-
"eslint": "^8.20.0",
27+
"eslint": "^8.57.1",
2728
"eslint-config-prettier": "^9.1.0",
2829
"eslint-plugin-mdx": "^3.1.5",
2930
"eslint-plugin-prettier": "^5.2.1",
3031
"eslint-plugin-yml": "^1.2.0",
3132
"husky": "^4.3.8",
3233
"netlify-plugin-cache": "^1.0.3",
3334
"prettier": "^3.4.2",
34-
"pretty-quick": "^4.0.0",
35-
"yarn-deduplicate": "^6.0.2"
36-
},
37-
"resolutions": {
38-
"trim": "^1.0.1",
39-
"update-notifier": "^6.0.2",
40-
"@sideway/formula": ">=3.0.1"
35+
"pretty-quick": "^4.0.0"
4136
},
42-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
37+
"packageManager": "yarn@4.6.0"
4338
}

scripts/lint-examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"@babel/core": "^7.25.2",
1212
"@babel/preset-env": "^7.25.4",
1313
"@babel/runtime": "^7.25.6",
14-
"@react-native/babel-preset": "^0.76.0-rc.2",
1514
"@react-native-community/slider": "^4.5.3",
15+
"@react-native/babel-preset": "^0.76.0-rc.2",
1616
"@react-native/eslint-config": "^0.76.0-rc.2",
1717
"@react-native/typescript-config": "^0.76.0-rc.2",
1818
"@types/react": "^18.2.79",

website/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@
6969
"@react-native-website/update-redirects": "0.0.0",
7070
"@types/google.analytics": "^0.0.46",
7171
"alex": "^10.0.0",
72+
"case-police": "^0.5.14",
73+
"eslint": "^8.57.1",
7274
"fs-extra": "^11.2.0",
7375
"glob": "^11.0.0",
76+
"prettier": "^3.4.2",
7477
"remark-cli": "^12.0.1",
7578
"typescript": "^5.7.2"
7679
}

0 commit comments

Comments
 (0)