Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upgrade-monorepo-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Apr 30, 2024
2 parents 88503e5 + ad0c9bf commit 6f8dbea
Show file tree
Hide file tree
Showing 305 changed files with 20,487 additions and 16,744 deletions.
115 changes: 54 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,55 +59,38 @@ commands:
description: 'Set to true if you intend to any browser (for example with playwright).'

steps:
- run:
name: View install environment
command: |
node --version
yarn --version
- restore_cache:
name: Restore yarn 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
- 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" }}
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
- when:
condition: << parameters.browsers >>
steps:
- save_cache:
name: Save playwright cache
key: v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
Expand All @@ -127,18 +110,24 @@ 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:
<<: *default-job
steps:
- checkout
- install_js
- run:
name: Tests charts
command: yarn test:charts:unit # Run special test for charts due to ESM compatibility issue
command: pnpm test:charts:unit # Run special test for charts due to ESM compatibility issue
- run:
name: Tests fake browser
command: yarn test:coverage
command: pnpm test:coverage
- run:
name: Check coverage generated
command: |
Expand All @@ -159,48 +148,52 @@ 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:
<<: *default-job
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
environment:
NODE_OPTIONS: --max-old-space-size=3584
- 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
environment:
NODE_OPTIONS: --max-old-space-size=3584
- 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:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.41.2-focal
- image: mcr.microsoft.com/playwright:v1.43.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand All @@ -209,7 +202,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 @@ -221,19 +214,19 @@ 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=2048
NODE_OPTIONS: --max-old-space-size=1536
test_e2e:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.41.2-focal
- image: mcr.microsoft.com/playwright:v1.43.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand All @@ -242,26 +235,26 @@ jobs:
browsers: true
- run:
name: Run e2e tests
command: yarn test:e2e
command: pnpm test:e2e
test_e2e_website:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.41.2-focal
- image: mcr.microsoft.com/playwright:v1.43.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
- checkout
- 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:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.41.2-focal
- image: mcr.microsoft.com/playwright:v1.43.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand All @@ -270,14 +263,14 @@ 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:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.41.2-focal
- image: mcr.microsoft.com/playwright:v1.43.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand All @@ -286,7 +279,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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.git
pnpm-lock.yaml
netlify/functions
/docs/.next
/docs/export
/docs/pages/playground/
Expand Down
15 changes: 9 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const baseline = require('@mui/monorepo/.eslintrc');
const path = require('path');

// TODO move this helper to @mui/monorepo/.eslintrc
// It needs to know about the parent "no-restricted-imports" to not override them.
const buildPackageRestrictedImports = (packageName, root) => ({
files: [`packages/${root}/src/**/*{.ts,.tsx,.js}`],
excludedFiles: ['*.d.ts', '*.spec.ts', '*.spec.tsx', '**.test.tx', '**.test.tsx'],
Expand Down Expand Up @@ -50,10 +52,12 @@ module.exports = {
*/
rules: {
...baseline.rules,
// TODO move to @mui/monorepo/.eslintrc, codebase is moving away from default exports
'import/prefer-default-export': 'off',
// TODO move rule into the main repo once it has upgraded
'@typescript-eslint/return-await': 'off',
'no-restricted-imports': 'off',
// TODO move to @mui/monorepo/.eslintrc
'jsdoc/require-param': ['error', { contexts: ['TSFunctionType'] }],
'jsdoc/require-param-type': ['error', { contexts: ['TSFunctionType'] }],
'jsdoc/require-param-name': ['error', { contexts: ['TSFunctionType'] }],
Expand All @@ -75,7 +79,10 @@ module.exports = {
],
// Fixes false positive when using both `inputProps` and `InputProps` on the same example
// See https://stackoverflow.com/questions/42367236/why-am-i-getting-this-warning-no-duplicate-props-allowed-react-jsx-no-duplicate
// TODO move to @mui/monorepo/.eslintrc
// TODO Fix <Input> props names to not conflict
'react/jsx-no-duplicate-props': [1, { ignoreCase: false }],
// TOOD move to @mui/monorepo/.eslintrc, these are false positive
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
},
overrides: [
Expand Down Expand Up @@ -114,19 +121,15 @@ module.exports = {
},
parserOptions: { tsconfigRootDir: __dirname, project: ['./tsconfig.json'] },
},
// TODO remove, shouldn't disable prop-type generation rule.
// lot of public components are missing it.
{
files: ['*.tsx'],
excludedFiles: '*.spec.tsx',
rules: {
'react/prop-types': 'off',
},
},
{
files: ['docs/data/**/*.js', 'docs/data/**/*.tsx'],
rules: {
'filenames/match-exported': ['error'],
},
},
{
files: ['**/*.mjs'],
rules: {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cherry-pick-master-to-v6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && github.event.pull_request.merged == true }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Cherry pick and create the new PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: carloscastrojumo/github-cherry-pick-action@a145da1b8142e752d3cbc11aaaa46a535690f0c5 # v1.0.9
uses: carloscastrojumo/github-cherry-pick-action@503773289f4a459069c832dc628826685b75b4b3 # v1.0.10
with:
branch: v6.x
body: 'Cherry-pick of #{old_pull_request_id}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cherry-pick-next-to-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && github.event.pull_request.merged == true }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Cherry pick and create the new PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: carloscastrojumo/github-cherry-pick-action@a145da1b8142e752d3cbc11aaaa46a535690f0c5 # v1.0.9
uses: carloscastrojumo/github-cherry-pick-action@503773289f4a459069c832dc628826685b75b4b3 # v1.0.10
with:
branch: master
body: 'Cherry-pick of #{old_pull_request_id}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/closed-issue-message.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
permissions:
issues: write
steps:
- uses: actions-cool/check-user-permission@a0668c9aec87f3875fc56170b6452a453e9dd819
- uses: actions-cool/check-user-permission@956b2e73cdfe3bcb819bb7225e490cb3b18fd76e
id: checkUser
with:
require: 'write'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
languages: typescript
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -29,4 +29,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
Loading

0 comments on commit 6f8dbea

Please sign in to comment.