Skip to content
Merged
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
11 changes: 1 addition & 10 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6

- name: Enable Corepack
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
cache: yarn

- name: Check lock for duplications
run: yarn dedupe --check
run: yarn update-lock --fail

- name: Install dependencies
run: yarn install --immutable
Expand All @@ -42,9 +39,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6

- name: Enable Corepack
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v6
with:
Expand All @@ -64,9 +58,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6

- name: Enable Corepack
run: corepack enable

- name: Set up Node.js
uses: actions/setup-node@v6
with:
Expand Down
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@ This repo contains the website configuration and documentation powering the [Rea

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

### Installation

1. `cd react-native-website` to go into the project root.
1. Run `corepack enable` to enable Corepack.

> If the command above fails, run `npm install -g corepack@latest` to install the latest version of [Corepack](https://yarnpkg.com/corepack#installation).

1. Run `yarn` to install the website's workspace dependencies.
> If you want to retain the globally installed `yarn` classic, you can use `corepack yarn` instead.

### Running locally

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"serve": "yarn --cwd website serve",
"prepare": "husky",
"lint": "eslint .",
"lint:packages": "yarn workspaces foreach --from \"packages/*\" -p -R run lint",
"lint:plugins": "yarn workspaces foreach --from \"plugins/*\" -p -R run lint && yarn workspaces foreach --from \"plugins/*\" -p -R run test",
"lint:packages": "yarn workspace @react-native-website/lint-examples lint",
"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",
"lint:website": "eslint ./website ./docs",
"update-lock": "yarn dedupe",
"update-lock": "npx yarn-deduplicate",
"check-dependencies": "manypkg check"
},
"devDependencies": {
Expand All @@ -45,7 +45,6 @@
"typescript": "^5.9.3",
"typescript-eslint": "^8.57.1"
},
"packageManager": "yarn@4.13.0",
"resolutions": {
"serialize-javascript": "^7.0.5",
"serve-handler/minimatch": "3.1.4"
Expand Down
17 changes: 11 additions & 6 deletions scripts/src/image-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
* LICENSE file in the root directory of this source tree.
*/

import {glob} from 'glob';
import fs from 'node:fs/promises';
import path from 'node:path';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';

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

async function main() {
const assets: {imagePath: string; markdownPath: string}[] = [];
const missingAssets = [];
const queue = [];

const files = await glob('../docs/**/*.md', {});
const files = (await fs.readdir(docsRoot, {recursive: true}))
.filter(
file =>
(file.endsWith('.md') || file.endsWith('.mdx')) && path.isAbsolute(file)
)
.map(file => path.join(docsRoot, file));

for (const file of files) {
const entry = (async () => {
Expand All @@ -37,7 +42,7 @@ async function main() {
for (const {imagePath, markdownPath} of assets) {
try {
await fs.stat(
path.join(import.meta.dirname, '../website/static', imagePath)
path.join(import.meta.dirname, '../../website/static', imagePath)
);
} catch {
missingAssets.push({imagePath, markdownPath});
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"format:style": "prettier --write src/**/*.scss",
"format:examples": "eslint-examples-jsx --fix && eslint-examples-tsx --fix",
"prettier": "yarn format:style",
"lint": "yarn lint:website",
"lint": "yarn --cwd ../ lint:website",
"lint:examples": "eslint-examples-jsx && eslint-examples-tsx && tsc-examples",
"lint:markdown:images": "node ../scripts/src/image-check.ts",
"lint:markdown:links": "remark ../docs --quiet -r .remarkrc.withBrokenLinks.mjs",
Expand Down
Loading
Loading