Skip to content

Commit

Permalink
add use-react-version script
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Jul 17, 2024
1 parent 611a2ca commit 6f5f6db
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ commands:
- run:
name: Resolve React version
command: |
node scripts/useReactVersion.mjs
pnpm use-react-version
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"test:argos": "node ./scripts/pushArgos.mjs",
"typescript": "lerna run --no-bail --parallel typescript",
"typescript:ci": "lerna run --concurrency 3 --no-bail --no-sort typescript",
"use-react-version": "node ./scripts/useReactVersion.mjs",
"validate-declarations": "tsx scripts/validateTypescriptDeclarations.mts",
"generate-codeowners": "node scripts/generateCodeowners.mjs",
"canary:release": "tsx ./scripts/canaryRelease.mts",
Expand Down
3 changes: 1 addition & 2 deletions scripts/useReactVersion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import fs from 'fs';
import os from 'os';
import path from 'path';
import { promisify } from 'util';
import { getWorkspaceRoot } from './utils.mjs';

const exec = promisify(childProcess.exec);

Expand All @@ -37,7 +36,7 @@ async function main(version) {
return;
}

const packageJsonPath = path.resolve(getWorkspaceRoot(), 'package.json');
const packageJsonPath = path.resolve(process.cwd(), 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));

// the version is something in format: "17.0.0"
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ For example, in https://app.circleci.com/pipelines/github/mui/material-ui/32796/

### Testing multiple versions of React

You can check integration of different versions of React (for example different [release channels](https://react.dev/community/versioning-policy) or PRs to React) by running `node scripts/useReactVersion.mjs <version>`.
You can check integration of different versions of React (for example different [release channels](https://react.dev/community/versioning-policy) or PRs to React) by running `pnpm use-react-version <version>`.

Possible values for `version`:

Expand Down

0 comments on commit 6f5f6db

Please sign in to comment.