diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c86ac5d08a22..d93f233ad3a5d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -55,29 +55,21 @@ 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 @@ -85,9 +77,14 @@ commands: 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: @@ -95,12 +92,10 @@ commands: 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: @@ -123,7 +118,13 @@ 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: @@ -131,7 +132,7 @@ jobs: - install_js - run: name: Tests fake browser - command: yarn test:coverage + command: pnpm test:coverage - run: name: Check coverage generated command: | @@ -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 @@ -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_ @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml index 64adb63bc4dee..2a2da15c5ca43 100644 --- a/.github/workflows/l10n.yml +++ b/.github/workflows/l10n.yml @@ -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 diff --git a/dangerfile.js b/dangerfile.js index a3726af581bf7..25eb355c443a1 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -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'), ); diff --git a/docs/.link-check-errors.txt b/docs/.link-check-errors.txt index b753b2a7b7041..0c023d70276e7 100644 --- a/docs/.link-check-errors.txt +++ b/docs/.link-check-errors.txt @@ -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/ diff --git a/docs/README.md b/docs/README.md index de28cd79766fe..ff8a508a012f4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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? diff --git a/docs/next.config.js b/docs/next.config.js index a8b59b0b4f737..8a1cc29c7eb02 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -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', diff --git a/docs/scripts/reportBrokenLinks.js b/docs/scripts/reportBrokenLinks.js index b63814708e958..a0c67247cdb8e 100644 --- a/docs/scripts/reportBrokenLinks.js +++ b/docs/scripts/reportBrokenLinks.js @@ -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)]) diff --git a/renovate.json b/renovate.json index ef8e4c9dd8822..821bce5854225 100644 --- a/renovate.json +++ b/renovate.json @@ -110,7 +110,7 @@ "matchManagers": ["github-actions"] } ], - "postUpdateOptions": ["yarnDedupeHighest"], + "postUpdateOptions": ["pnpmDedupe"], "prConcurrentLimit": 30, "prHourlyLimit": 0, "rangeStrategy": "bump", diff --git a/scripts/README.md b/scripts/README.md index 3c48aee3391fe..58f89421bf167 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -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) @@ -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 @@ -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`. diff --git a/scripts/build.mjs b/scripts/build.mjs index 98098d8f3827e..2876dae2c390d 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -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 diff --git a/scripts/l10n.ts b/scripts/l10n.ts index 6bb5e90d0bcac..1305514269560 100644 --- a/scripts/l10n.ts +++ b/scripts/l10n.ts @@ -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} `; diff --git a/test/cli.js b/test/cli.js index a30f0853e89f3..20e8527904ef0 100644 --- a/test/cli.js +++ b/test/cli.js @@ -26,6 +26,7 @@ async function run(argv) { .sync(globPattern, { cwd: workspaceRoot, ignore, + followSymbolicLinks: false, }) .filter((relativeFile) => { return /\.test\.(js|ts|tsx)$/.test(relativeFile); @@ -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', diff --git a/test/e2e-website/README.md b/test/e2e-website/README.md index 951cccebdb14b..0ea3f4cc773bb 100644 --- a/test/e2e-website/README.md +++ b/test/e2e-website/README.md @@ -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 diff --git a/test/e2e/index.test.ts b/test/e2e/index.test.ts index 01bc01a24ec84..e9a6d2d5cd35b 100644 --- a/test/e2e/index.test.ts +++ b/test/e2e/index.test.ts @@ -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 };