Skip to content

Commit

Permalink
Merge branch 'master' into codemod/typescript-support-for-removeObjec…
Browse files Browse the repository at this point in the history
…tProperty
  • Loading branch information
MBilalShafi committed Sep 3, 2024
2 parents 3a95fa0 + 315ffa1 commit 7eaa7ea
Show file tree
Hide file tree
Showing 732 changed files with 25,793 additions and 8,671 deletions.
30 changes: 29 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ commands:
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD
- when:
condition:
equal: [material-ui-v6, << pipeline.parameters.workflow >>]
steps:
- run:
name: Install @mui/material@next
command: pnpm use-material-ui-v6

- when:
condition: << parameters.browsers >>
steps:
Expand Down Expand Up @@ -248,7 +256,7 @@ jobs:
command: pnpm docs:typescript:formatted --disable-cache
- run:
name: '`pnpm docs:typescript:formatted` changes committed?'
command: git add -A && git diff --exit-code --staged
command: git add -A && git diff --exit-code --staged docs/src docs/data
- run:
name: Tests TypeScript definitions
command: pnpm typescript:ci
Expand Down Expand Up @@ -383,3 +391,23 @@ workflows:
<<: *default-context
react-version: next
name: test_e2e-react@next

material-ui-v6:
when:
equal: [material-ui-v6, << pipeline.parameters.workflow >>]
jobs:
- test_unit:
<<: *default-context
name: test_unit-material@next
- test_browser:
<<: *default-context
name: test_browser-material@next
- test_regressions:
<<: *default-context
name: test_regressions-material@next
- test_e2e:
<<: *default-context
name: test_e2e-material@next
- test_types:
<<: *default-context
name: test_types-material@next
2 changes: 2 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"packages/x-date-pickers",
"packages/x-date-pickers-pro",
"packages/x-charts",
"packages/x-charts-pro",
"packages/x-charts-vendor",
"packages/x-tree-view",
"packages/x-tree-view-pro",
"packages/x-internals"
],
"publishDirectory": {
Expand Down
90 changes: 59 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ const addReactCompilerRule = (packagesNames, isEnabled) =>
},
}));

const RESTRICTED_TOP_LEVEL_IMPORTS = [
'@mui/material',
'@mui/x-charts',
'@mui/x-charts-pro',
'@mui/x-codemod',
'@mui/x-date-pickers',
'@mui/x-date-pickers-pro',
'@mui/x-tree-view',
'@mui/x-tree-view-pro',
];

// 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, allowRootImports = true) => [
Expand Down Expand Up @@ -85,43 +96,16 @@ const buildPackageRestrictedImports = (packageName, root, allowRootImports = tru
files: [
`packages/${root}/src/**/*.test{.ts,.tsx,.js}`,
`packages/${root}/src/**/*.spec{.ts,.tsx,.js}`,
'docs/data/**/*{.ts,.tsx,.js}',
],
excludedFiles: ['*.d.ts'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@mui/x-charts',
message: 'Use deeper import instead',
},
{
name: '@mui/x-charts-pro',
message: 'Use deeper import instead',
},
{
name: '@mui/x-codemod',
message: 'Use deeper import instead',
},
{
name: '@mui/x-date-pickers',
message: 'Use deeper import instead',
},
{
name: '@mui/x-date-pickers-pro',
message: 'Use deeper import instead',
},
{
name: '@mui/x-tree-view',
message: 'Use deeper import instead',
},
{
name: '@mui/x-tree-view-pro',
message: 'Use deeper import instead',
},
],
paths: RESTRICTED_TOP_LEVEL_IMPORTS.map((name) => ({
name,
message: 'Use deeper import instead',
})),
},
],
},
Expand Down Expand Up @@ -197,6 +181,19 @@ module.exports = {
},
overrides: [
...baseline.overrides,
{
files: [
// matching the pattern of the test runner
'*.test.js',
'*.test.ts',
'*.test.tsx',
],
excludedFiles: ['test/e2e/**/*', 'test/regressions/**/*'],
extends: ['plugin:testing-library/react'],
rules: {
'testing-library/no-container': 'off',
},
},
{
files: [
// matching the pattern of the test runner
Expand Down Expand Up @@ -269,6 +266,37 @@ module.exports = {
],
},
},
{
files: ['docs/**/*{.ts,.tsx,.js}'],
excludedFiles: ['*.d.ts'],
rules: {
'no-restricted-imports': [
'error',
{
paths: RESTRICTED_TOP_LEVEL_IMPORTS.map((name) => ({
name,
message: 'Use deeper import instead',
})),
patterns: [
{
group: [
'@mui/*/*/*',
// Allow any import depth with any internal packages
'!@mui/internal-*/**',

// Exceptions (QUESTION: Keep or remove?)
'!@mui/x-date-pickers/internals/demo',
'!@mui/x-tree-view/hooks/useTreeViewApiRef',
// TODO: export this from /ButtonBase in core. This will break after we move to package exports
'!@mui/material/ButtonBase/TouchRipple',
],
message: 'Use less deep import instead',
},
],
},
],
},
},
...buildPackageRestrictedImports('@mui/x-charts', 'x-charts', false),
...buildPackageRestrictedImports('@mui/x-charts-pro', 'x-charts-pro', false),
...buildPackageRestrictedImports('@mui/x-codemod', 'x-codemod', false),
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3.pro-support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
id: contact
attributes:
label: Order ID or Support key 💳
description: The order ID of the purchased Pro plan. Community users can [learn more about support](https://mui.com/getting-started/support/) in the documentation.
description: The order ID of the purchased Pro plan. Community users can [learn more about support](https://mui.com/x/introduction/support/) in the documentation.
placeholder: 'e.g. 11111'
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/4.premium-support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
id: contact
attributes:
label: Order ID or Support key 💳
description: The order ID of the purchased Premium plan. Community users can [learn more about support](https://mui.com/getting-started/support/) in the documentation.
description: The order ID of the purchased Premium plan. Community users can [learn more about support](https://mui.com/x/introduction/support/) in the documentation.
placeholder: 'e.g. 11111'
validations:
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: Support ❔
url: https://mui.com/getting-started/support/
about: I need support with MUI X.
url: https://mui.com/x/introduction/support/
about: I need support with MUI X.
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@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
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@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
10 changes: 6 additions & 4 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
- 'master'
- 'next'

permissions: {}

jobs:
benchmarks:
name: Benchmarks Charts
Expand All @@ -26,10 +28,10 @@ jobs:
# L3: Run the benchmarks for pull requests with the label 'component: charts'
# Yaml syntax looks a little weird, but it is correct.
if: >-
${{
(github.event_name == 'push') ||
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'component: charts') ||
(github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'component: charts'))
${{
(github.event_name == 'push') ||
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'component: charts') ||
(github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'component: charts'))
}}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/issue-cleanup.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/new-issue-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: New issue triage
on:
issues:
types:
- opened

permissions: {}

jobs:
issue_cleanup:
name: Clean issue body
uses: mui/mui-public/.github/workflows/issues_body-cleanup.yml@master
permissions:
contents: read
issues: write
order_id_validation:
name: Validate order ID
needs: issue_cleanup
if: needs.issue_cleanup.outputs.orderId != ''
uses: mui/mui-public/.github/workflows/issues_order-id-validation.yml@master
secrets: inherit
with:
orderId: ${{ needs.issue_cleanup.outputs.orderId }}
permissions:
contents: read
issues: write
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@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions .github/workflows/support-stackoverflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
# Comment to post on issues marked as support requests. Add a link
# to a support page, or set to `false` to disable
issue-comment: |
👋 Thanks for using MUI X!
👋 Thanks for using this project!
We use GitHub issues as a bug and feature requests tracker, however,
this issue appears to be a support request.
For support, please check out https://mui.com/x/introduction/support/. Thanks!
For support with MUI X please check out https://mui.com/x/introduction/support/. Thanks!
If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.
Expand Down
Loading

0 comments on commit 7eaa7ea

Please sign in to comment.