Skip to content

Commit

Permalink
Merge branch 'master' into add-missing-default
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi committed Jul 9, 2024
2 parents 7733550 + ba6c7a1 commit 23b34b6
Show file tree
Hide file tree
Showing 524 changed files with 13,154 additions and 6,027 deletions.
63 changes: 54 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ parameters:
description: Whether to force browserstack usage. We have limited resources on browserstack so the pipeline might decide to skip browserstack if this parameter isn't set to true.
type: boolean
default: false
react-dist-tag:
description: The dist-tag of react to be used
react-version:
description: The version of react to be used
type: string
default: stable
workflow:
Expand All @@ -20,10 +20,10 @@ parameters:

default-job: &default-job
parameters:
react-dist-tag:
description: The dist-tag of react to be used
react-version:
description: The version of react to be used
type: string
default: << pipeline.parameters.react-dist-tag >>
default: << pipeline.parameters.react-version >>
e2e-base-url:
description: The base url for running end-to-end test
type: string
Expand All @@ -33,7 +33,7 @@ default-job: &default-job
PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers
# expose it globally otherwise we have to thread it from each job to the install command
BROWSERSTACK_FORCE: << pipeline.parameters.browserstack-force >>
REACT_DIST_TAG: << parameters.react-dist-tag >>
REACT_VERSION: << parameters.react-version >>
working_directory: /tmp/mui
docker:
- image: cimg/node:18.20
Expand All @@ -59,6 +59,13 @@ commands:
description: 'Set to true if you intend to any browser (for example with playwright).'

steps:
- run:
name: Resolve React version
command: |
node scripts/useReactVersion.mjs
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD
- when:
condition: << parameters.browsers >>
steps:
Expand Down Expand Up @@ -90,7 +97,17 @@ commands:
pnpm --version
- run:
name: Install js dependencies
command: pnpm install
command: |
echo "React version $REACT_VERSION"
if [ $REACT_VERSION == "stable" ];
then
echo "pnpm install"
pnpm install
else
echo "pnpm install --no-frozen-lockfile"
pnpm install --no-frozen-lockfile
fi
- when:
condition: << parameters.browsers >>
steps:
Expand All @@ -115,7 +132,7 @@ jobs:
name: Should not have any git not staged
command: git add -A && git diff --exit-code --staged
- run:
name: Check for duplicated packages
name: '`pnpm dedupe` was run?'
command: |
if [[ $(git diff --name-status next | grep pnpm-lock) == "" ]];
then
Expand Down Expand Up @@ -146,7 +163,7 @@ jobs:
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_DIST_TAG-jsdom"
./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_VERSION-jsdom"
test_lint:
<<: *default-job
steps:
Expand Down Expand Up @@ -330,3 +347,31 @@ workflows:
- test_e2e_website:
requires:
- checkout

react-next:
when:
equal: [react-next, << pipeline.parameters.workflow >>]
# triggers:
# - schedule:
# cron: '0 0 * * *'
# filters:
# branches:
# only:
# - master
jobs:
- test_unit:
<<: *default-context
react-version: next
name: test_unit-react@next
- test_browser:
<<: *default-context
react-version: next
name: test_browser-react@next
- test_regressions:
<<: *default-context
react-version: next
name: test_regressions-react@next
- test_e2e:
<<: *default-context
react-version: next
name: test_e2e-react@next
6 changes: 4 additions & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"packages/x-date-pickers",
"packages/x-date-pickers-pro",
"packages/x-charts",
"packages/x-tree-view"
"packages/x-tree-view",
"packages/x-internals"
],
"publishDirectory": {
"@mui/x-license": "packages/x-license/build",
Expand All @@ -24,7 +25,8 @@
"@mui/x-charts": "packages/x-charts/build",
"@mui/x-charts-pro": "packages/x-charts-pro/build",
"@mui/x-tree-view": "packages/x-tree-view/build",
"@mui/x-tree-view-pro": "packages/x-tree-view-pro/build"
"@mui/x-tree-view-pro": "packages/x-tree-view-pro/build",
"@mui/x-internals": "packages/x-internals/build"
},
"sandboxes": ["/bug-reproductions/x-data-grid"],
"silent": true
Expand Down
44 changes: 30 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
const baseline = require('@mui/monorepo/.eslintrc');
const path = require('path');

const chartsPackages = ['x-charts', 'x-charts-pro'];

const dataGridPackages = [
'x-data-grid',
'x-data-grid-pro',
'x-data-grid-premium',
'x-data-grid-generator',
];

const datePickersPackages = ['x-date-pickers', 'x-date-pickers-pro'];

const treeViewPackages = ['x-tree-view', 'x-tree-view-pro'];

// Enable React Compiler Plugin rules globally
const ENABLE_REACT_COMPILER_PLUGIN = process.env.ENABLE_REACT_COMPILER_PLUGIN ?? false;

Expand Down Expand Up @@ -139,6 +152,18 @@ module.exports = {
...(ENABLE_REACT_COMPILER_PLUGIN ? { 'react-compiler/react-compiler': 'error' } : {}),
// TODO move to @mui/monorepo/.eslintrc, codebase is moving away from default exports
'import/prefer-default-export': 'off',
'import/no-restricted-paths': [
'error',
{
zones: [...chartsPackages, ...datePickersPackages, ...treeViewPackages].map(
(packageName) => ({
target: `./packages/${packageName}/src/**/!(*.test.*|*.spec.*)`,
from: `./packages/${packageName}/src/internals/index.ts`,
message: `Use a more specific import instead. E.g. import { MyInternal } from '../internals/MyInternal';`,
}),
),
},
],
// TODO move rule into the main repo once it has upgraded
'@typescript-eslint/return-await': 'off',
'no-restricted-imports': 'off',
Expand Down Expand Up @@ -167,7 +192,7 @@ module.exports = {
// 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
// TODO move to @mui/monorepo/.eslintrc, these are false positive
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
},
overrides: [
Expand Down Expand Up @@ -257,18 +282,9 @@ module.exports = {
...buildPackageRestrictedImports('@mui/x-tree-view-pro', 'x-tree-view-pro', false),
...buildPackageRestrictedImports('@mui/x-license', 'x-license'),

...addReactCompilerRule(['x-charts', 'x-charts-pro'], ENABLE_REACT_COMPILER_PLUGIN_CHARTS),
...addReactCompilerRule(
['x-data-grid', 'x-data-grid-pro', 'x-data-grid-premium', 'x-data-grid-generator'],
ENABLE_REACT_COMPILER_PLUGIN_DATA_GRID,
),
...addReactCompilerRule(
['x-date-pickers', 'x-date-pickers-pro'],
ENABLE_REACT_COMPILER_PLUGIN_DATE_PICKERS,
),
...addReactCompilerRule(
['x-tree-view', 'x-tree-view-pro'],
ENABLE_REACT_COMPILER_PLUGIN_TREE_VIEW,
),
...addReactCompilerRule(chartsPackages, ENABLE_REACT_COMPILER_PLUGIN_CHARTS),
...addReactCompilerRule(dataGridPackages, ENABLE_REACT_COMPILER_PLUGIN_DATA_GRID),
...addReactCompilerRule(datePickersPackages, ENABLE_REACT_COMPILER_PLUGIN_DATE_PICKERS),
...addReactCompilerRule(treeViewPackages, ENABLE_REACT_COMPILER_PLUGIN_TREE_VIEW),
],
};
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
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@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
sarif_file: results.sarif
Loading

0 comments on commit 23b34b6

Please sign in to comment.