Skip to content

Commit

Permalink
Replace remaining yarn usages
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Jan 31, 2024
1 parent 2482ab5 commit 0591518
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 74 deletions.
95 changes: 48 additions & 47 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,52 +55,47 @@ commands:
description: 'Set to true if you intend to any browser (e.g. with playwright).'

steps:
- run:
name: View install environment
command: |
node --version
yarn --version
- restore_cache:
name: Restore yarn cache
name: Restore pnpm cache
keys:
- v8-yarn-{{ checksum "yarn.lock" }}
- run:
name: Set yarn cache folder
command: |
# Keep path in sync with `save_cache` for key "v8-yarn-"
yarn config set cache-folder /tmp/yarn-cache
# Debug information
yarn cache dir
yarn cache list
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
- when:
condition: << parameters.browsers >>
steps:
- run:
name: Install pnpm package manager
command: |
corepack enable
corepack prepare pnpm@latest-8 --activate
- run:
name: Prepare playwright hash
command: yarn --json list --pattern playwright > /tmp/playwright_info.json
command: pnpm list --json --filter playwright > /tmp/playwright_info.json
- store_artifacts:
name: Debug playwright hash
path: /tmp/playwright_info.json
- restore_cache:
name: Restore playwright cache
keys:
- v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
- run:
name: View install environment
command: |
node --version
pnpm --version
- run:
name: Install js dependencies
command: yarn install
command: pnpm install
- when:
condition: << parameters.browsers >>
steps:
- run:
name: Install playwright browsers
command: npx playwright install --with-deps
- save_cache:
name: Save yarn cache
key: v8-yarn-{{ checksum "yarn.lock" }}
name: Save pnpm package cache
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
paths:
# Keep path in sync with "Set yarn cache folder"
# Can't use environment variables for `save_cache` paths (tested in https://app.circleci.com/pipelines/github/mui/material-ui/37813/workflows/5b1e207f-ac8b-44e7-9ba4-d0f9a01f5c55/jobs/223370)
- /tmp/yarn-cache
- node_modules
- when:
condition: << parameters.browsers >>
steps:
Expand All @@ -123,15 +118,21 @@ jobs:
command: git add -A && git diff --exit-code --staged
- run:
name: Check for duplicated packages
command: yarn deduplicate
command: |
if [[ $(git diff --name-status next | grep pnpm-lock) == "" ]];
then
echo "No changes to dependencies detected. Skipping..."
else
pnpm dedupe --check
fi
test_unit:
<<: *defaults
steps:
- checkout
- install_js
- run:
name: Tests fake browser
command: yarn test:coverage
command: pnpm test:coverage
- run:
name: Check coverage generated
command: |
Expand All @@ -152,43 +153,43 @@ jobs:
- install_js
- run:
name: Eslint
command: yarn eslint:ci
command: pnpm eslint:ci
- run:
name: Lint JSON
command: yarn jsonlint
command: pnpm jsonlint
- run:
name: Lint Markdown
command: yarn markdownlint
command: pnpm markdownlint
test_static:
<<: *defaults
steps:
- checkout
- install_js
- run:
name: '`yarn prettier` changes committed?'
command: yarn prettier --check
name: '`pnpm prettier` changes committed?'
command: pnpm prettier --check
- run:
name: Generate PropTypes
command: yarn proptypes
command: pnpm proptypes
- run:
name: '`yarn proptypes` changes committed?'
name: '`pnpm proptypes` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Generate the documentation
command: yarn docs:api
command: pnpm docs:api
- run:
name: '`yarn docs:api` changes committed?'
name: '`pnpm docs:api` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Sync locale files
command: yarn l10n
command: pnpm l10n
- run:
name: '`yarn l10n` changes committed?'
name: '`pnpm l10n` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: '`yarn docs:link-check` changes committed?'
name: '`pnpm docs:link-check` changes committed?'
command: |
yarn docs:link-check
pnpm docs:link-check
git add -A && git diff --exit-code --staged
test_browser:
<<: *defaults
Expand All @@ -202,7 +203,7 @@ jobs:
browsers: true
- run:
name: Tests real browsers
command: yarn test:karma
command: pnpm test:karma
- store_artifacts:
# hardcoded in karma-webpack
path: /tmp/_karma_webpack_
Expand All @@ -214,13 +215,13 @@ jobs:
- install_js
- run:
name: Transpile TypeScript demos
command: yarn docs:typescript:formatted --disable-cache
command: pnpm docs:typescript:formatted --disable-cache
- run:
name: '`yarn docs:typescript:formatted` changes committed?'
name: '`pnpm docs:typescript:formatted` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Tests TypeScript definitions
command: yarn typescript:ci
command: pnpm typescript:ci
environment:
NODE_OPTIONS: --max-old-space-size=3072
test_e2e:
Expand All @@ -235,7 +236,7 @@ jobs:
browsers: true
- run:
name: Run e2e tests
command: yarn test:e2e
command: pnpm test:e2e
test_e2e_website:
<<: *defaults
docker:
Expand All @@ -247,8 +248,8 @@ jobs:
- install_js:
browsers: true
- run:
name: yarn test:e2e-website
command: yarn test:e2e-website
name: pnpm test:e2e-website
command: pnpm test:e2e-website
environment:
PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >>
test_regressions:
Expand All @@ -263,10 +264,10 @@ jobs:
browsers: true
- run:
name: Run visual regression tests
command: xvfb-run yarn test:regressions
command: xvfb-run pnpm test:regressions
- run:
name: Upload screenshots to Argos CI
command: yarn test:argos
command: pnpm test:argos
run_danger:
<<: *defaults
docker:
Expand All @@ -279,7 +280,7 @@ jobs:
browsers: true
- run:
name: Run danger on PRs
command: yarn danger ci --fail-on-errors
command: pnpm danger ci --fail-on-errors
environment:
DANGER_DISABLE_TRANSPILATION: 'true'
workflows:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/l10n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: 20
cache: 'yarn' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
- run: yarn install
- name: yarn l10n --report
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
- run: pnpm install
- name: pnpm l10n --report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote -v
yarn l10n --report
pnpm l10n --report
6 changes: 3 additions & 3 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ function addL10nHelpMessage() {
'- [ ] Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)',
' > [l10n] Improve Swedish (sv-SE) locale',
' > [l10n] Add Danish (da-DK) locale',
'- [ ] Update the documentation of supported locales by running `yarn l10n`',
'- [ ] Update the documentation of supported locales by running `pnpm l10n`',
...(isAddingLocale
? [
'- [ ] Verify that you have added an export line in `src/locales/index.ts` for the new locale.',
'- [ ] Run `yarn docs:api` which should add your new translation to the list of exported interfaces.',
'- [ ] Run `pnpm docs:api` which should add your new translation to the list of exported interfaces.',
]
: []),
'- [ ] Clean files with `yarn prettier`.',
'- [ ] Clean files with `pnpm prettier`.',
'',
].join('\n'),
);
Expand Down
2 changes: 1 addition & 1 deletion docs/.link-check-errors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Broken links found by `yarn docs:link-check` that exist:
Broken links found by `docs:link-check` that exist:

- https://mui.com/base-ui/react-autocomplete/hooks-api/#use-autocomplete
- https://mui.com/base-ui/react-portal/components-api/
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ This is the documentation website of MUI X.
To start the docs site in development mode, from the project root, run:

```bash
yarn && yarn docs:dev
pnpm i && pnpm docs:dev
```

If you do not have yarn installed, select your OS and follow the instructions on the [Yarn website](https://yarnpkg.com/lang/en/docs/install/#mac-stable).
If you do not have pnpm installed, follow the instructions on the [pnpm website](https://pnpm.io/installation).

_DO NOT USE NPM, use Yarn to install the dependencies._
_DO NOT USE NPM, use pnpm to install the dependencies._

## How can I add a new demo to the documentation?

Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module.exports = withDocsInfra({

return map;
},
// Used to signal we run yarn build
// Used to signal we run build
...(process.env.NODE_ENV === 'production'
? {
output: 'export',
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/reportBrokenLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const removeUnsupportedHash = (link) => {
const rep = doNotSupportAnchors ? getPageUrlFromLink(link) : link;
return rep;
};
write('Broken links found by `yarn docs:link-check` that exist:\n');
write('Broken links found by `docs:link-check` that exist:\n');
Object.keys(usedLinks)
.filter((link) => link.startsWith('/'))
.filter((link) => !availableLinks[removeUnsupportedHash(link)])
Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"matchManagers": ["github-actions"]
}
],
"postUpdateOptions": ["yarnDedupeHighest"],
"postUpdateOptions": ["pnpmDedupe"],
"prConcurrentLimit": 30,
"prHourlyLimit": 0,
"rangeStrategy": "bump",
Expand Down
14 changes: 7 additions & 7 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ A typical release goes like this:
The following steps must be proposed as a pull request.

1. Compare the last tag with the branch upon which you want to release (`next` for the alpha / beta releases and `master` for the current stable version).
To do so, use `yarn release:changelog` The options are the following:
To do so, use `pnpm release:changelog` The options are the following:

```bash
yarn release:changelog
pnpm release:changelog
--githubToken YOUR_GITHUB_TOKEN (needs "public_repo" permission)
--lastRelease The release to compare against (default: the last one)
--release The branch to release (default: master)
Expand All @@ -29,16 +29,16 @@ In case of a problem, another method to generate the changelog is available at t

2. Clean the generated changelog, to match the format of [https://github.com/mui/mui-x/releases](https://github.com/mui/mui-x/releases).
3. Update the root `package.json`'s version
4. Update the versions of the other `package.json` files and of the dependencies with `yarn release:version` (`yarn release:version prerelease` for alpha / beta releases).
4. Update the versions of the other `package.json` files and of the dependencies with `pnpm release:version` (`pnpm release:version prerelease` for alpha / beta releases).
5. Open PR with changes and wait for review and green CI.
6. Merge PR once CI is green, and it has been approved.

### Release the packages

1. Checkout the last version of the working branch
2. `yarn && yarn release:build` (make sure you have the latest dependencies installed, and build the packages)
3. `yarn release:publish` (release the versions on npm, you need your 2FA device)
4. `yarn release:tag` (push the newly created tag)
2. `pnpm i && pnpm release:build` (make sure you have the latest dependencies installed, and build the packages)
3. `pnpm release:publish` (release the versions on npm, you need your 2FA device)
4. `pnpm release:tag` (push the newly created tag)

### Publish the documentation

Expand Down Expand Up @@ -85,4 +85,4 @@ You can use the following script in your browser console on any GitHub page to a

### Manually create the release tag

If the `yarn release:tag` fails you can create and push the tag using the following command: `git tag -a v4.0.0-alpha.30 -m "Version 4.0.0-alpha.30" && git push upstream --tag`.
If the `pnpm release:tag` fails you can create and push the tag using the following command: `git tag -a v4.0.0-alpha.30 -m "Version 4.0.0-alpha.30" && git push upstream --tag`.
2 changes: 1 addition & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async function run(argv) {
babelArgs.push('--compact false');
}

const command = ['yarn babel', ...babelArgs].join(' ');
const command = ['pnpm babel', ...babelArgs].join(' ');

if (verbose) {
// eslint-disable-next-line no-console
Expand Down
2 changes: 1 addition & 1 deletion scripts/l10n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ async function updateIssue(githubToken, newMessage) {

const requestBody = `You can check below all of the localization files that contain at least one missing translation. If you are a fluent speaker of any of these languages, feel free to submit a pull request. Any help is welcome to make the X components to reach new cultures.
Run \`yarn l10n --report\` to update the list below ⬇️
Run \`pnpm l10n --report\` to update the list below ⬇️
${newMessage}
`;
Expand Down
3 changes: 2 additions & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function run(argv) {
.sync(globPattern, {
cwd: workspaceRoot,
ignore,
followSymbolicLinks: false,
})
.filter((relativeFile) => {
return /\.test\.(js|ts|tsx)$/.test(relativeFile);
Expand All @@ -52,7 +53,7 @@ async function run(argv) {
args.push(`--grep '${argv.testNamePattern}'`);
}

const mochaProcess = childProcess.spawn('yarn', args, {
const mochaProcess = childProcess.spawn('pnpm', args, {
env: {
...process.env,
BABEL_ENV: 'test',
Expand Down
4 changes: 2 additions & 2 deletions test/e2e-website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Running locally

1. Run `yarn docs:dev` to start docs in development server.
2. Run `yarn test:e2e-website` in a separate terminal to run the test suites (`*.spec.ts`) inside `test/e2e-website` folder.
1. Run `pnpm docs:dev` to start docs in development server.
2. Run `pnpm test:e2e-website` in a separate terminal to run the test suites (`*.spec.ts`) inside `test/e2e-website` folder.

> use --headed to run tests in headed browsers, check out [Playwright CLI](https://playwright.dev/docs/intro#command-line) for more options
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function initializeEnvironment(
const isServerRunning = await attemptGoto(page, `${baseUrl}#no-dev`);
if (!isServerRunning) {
throw new Error(
`Unable to navigate to ${baseUrl} after multiple attempts. Did you forget to run \`yarn test:e2e:server\` and \`yarn test:e2e:build\`?`,
`Unable to navigate to ${baseUrl} after multiple attempts. Did you forget to run \`pnpm test:e2e:server\` and \`pnpm test:e2e:build\`?`,
);
}
return { browser, context, page };
Expand Down

0 comments on commit 0591518

Please sign in to comment.