Skip to content

Commit b9bec38

Browse files
authored
migrate monorepo back to Yarn Classic (#5047)
1 parent 54e783d commit b9bec38

File tree

7 files changed

+16801
-22378
lines changed

7 files changed

+16801
-22378
lines changed

.github/workflows/pre-merge.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ jobs:
1212
- name: Checkout repository
1313
uses: actions/checkout@v6
1414

15-
- name: Enable Corepack
16-
run: corepack enable
17-
1815
- name: Set up Node.js
1916
uses: actions/setup-node@v6
2017
with:
2118
node-version: "22"
2219
cache: yarn
2320

2421
- name: Check lock for duplications
25-
run: yarn dedupe --check
22+
run: yarn update-lock --fail
2623

2724
- name: Install dependencies
2825
run: yarn install --immutable
@@ -42,9 +39,6 @@ jobs:
4239
- name: Checkout repository
4340
uses: actions/checkout@v6
4441

45-
- name: Enable Corepack
46-
run: corepack enable
47-
4842
- name: Set up Node.js
4943
uses: actions/setup-node@v6
5044
with:
@@ -64,9 +58,6 @@ jobs:
6458
- name: Checkout repository
6559
uses: actions/checkout@v6
6660

67-
- name: Enable Corepack
68-
run: corepack enable
69-
7061
- name: Set up Node.js
7162
uses: actions/setup-node@v6
7263
with:

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ This repo contains the website configuration and documentation powering the [Rea
1818

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

2424
### Installation
2525

2626
1. `cd react-native-website` to go into the project root.
27-
1. Run `corepack enable` to enable Corepack.
28-
29-
> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).
30-
3127
1. Run `yarn` to install the website's workspace dependencies.
32-
> If you want to retain the globally installed `yarn` classic, you can use `corepack yarn` instead.
3328

3429
### Running locally
3530

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"serve": "yarn --cwd website serve",
1919
"prepare": "husky",
2020
"lint": "eslint .",
21-
"lint:packages": "yarn workspaces foreach --from \"packages/*\" -p -R run lint",
22-
"lint:plugins": "yarn workspaces foreach --from \"plugins/*\" -p -R run lint && yarn workspaces foreach --from \"plugins/*\" -p -R run test",
21+
"lint:packages": "yarn workspace @react-native-website/lint-examples lint",
22+
"lint:plugins": "yarn workspace @react-native-website/remark-codeblock-language-as-title lint && yarn workspace @react-native-website/remark-lint-no-broken-external-links lint && yarn workspace @react-native-website/remark-snackplayer lint && yarn workspace @react-native-website/remark-lint-no-broken-external-links test && yarn workspace @react-native-website/remark-snackplayer test",
2323
"lint:website": "eslint ./website ./docs",
24-
"update-lock": "yarn dedupe",
24+
"update-lock": "npx yarn-deduplicate",
2525
"check-dependencies": "manypkg check"
2626
},
2727
"devDependencies": {
@@ -45,7 +45,6 @@
4545
"typescript": "^5.9.3",
4646
"typescript-eslint": "^8.57.1"
4747
},
48-
"packageManager": "yarn@4.13.0",
4948
"resolutions": {
5049
"serialize-javascript": "^7.0.5",
5150
"serve-handler/minimatch": "3.1.4"

scripts/src/image-check.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import {glob} from 'glob';
9-
import fs from 'node:fs/promises';
10-
import path from 'node:path';
8+
import * as fs from 'node:fs/promises';
9+
import * as path from 'node:path';
1110

12-
const imageReferenceRegExp = new RegExp(/!\[.*?\]\((.*)\)/g);
11+
const imageReferenceRegExp = /!\[.*?]\((.*)\)/g;
12+
const docsRoot = path.join(import.meta.dirname, '../../docs');
1313

1414
async function main() {
1515
const assets: {imagePath: string; markdownPath: string}[] = [];
1616
const missingAssets = [];
1717
const queue = [];
1818

19-
const files = await glob('../docs/**/*.md', {});
19+
const files = (await fs.readdir(docsRoot, {recursive: true}))
20+
.filter(
21+
file =>
22+
(file.endsWith('.md') || file.endsWith('.mdx')) && path.isAbsolute(file)
23+
)
24+
.map(file => path.join(docsRoot, file));
2025

2126
for (const file of files) {
2227
const entry = (async () => {
@@ -37,7 +42,7 @@ async function main() {
3742
for (const {imagePath, markdownPath} of assets) {
3843
try {
3944
await fs.stat(
40-
path.join(import.meta.dirname, '../website/static', imagePath)
45+
path.join(import.meta.dirname, '../../website/static', imagePath)
4146
);
4247
} catch {
4348
missingAssets.push({imagePath, markdownPath});

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"format:style": "prettier --write src/**/*.scss",
2525
"format:examples": "eslint-examples-jsx --fix && eslint-examples-tsx --fix",
2626
"prettier": "yarn format:style",
27-
"lint": "yarn lint:website",
27+
"lint": "yarn --cwd ../ lint:website",
2828
"lint:examples": "eslint-examples-jsx && eslint-examples-tsx && tsc-examples",
2929
"lint:markdown:images": "node ../scripts/src/image-check.ts",
3030
"lint:markdown:links": "remark ../docs --quiet -r .remarkrc.withBrokenLinks.mjs",

0 commit comments

Comments
 (0)