diff --git a/.circleci/config.yml b/.circleci/config.yml index c1f0cb97c95c3..7a8c252845dae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ default-job: &default-job COREPACK_ENABLE_DOWNLOAD_PROMPT: '0' working_directory: /tmp/mui docker: - - image: cimg/node:20.19 + - image: cimg/node:23.11 # CircleCI has disabled the cache across forks for security reasons. # Following their official statement, it was a quick solution, they # are working on providing this feature back with appropriate security measures. @@ -60,36 +60,27 @@ default-context: &default-context commands: install_js: parameters: - browsers: + playwright: + description: If playwright should be installed. type: boolean default: false - description: 'Set to true if you intend to any browser (for example with playwright).' react-version: + description: The version of React to use. type: string default: << pipeline.parameters.react-version >> - description: The version of React to use. steps: - - when: - condition: << parameters.browsers >> - steps: - - run: - name: Install pnpm package manager - command: corepack enable - - when: - condition: - not: << parameters.browsers >> - steps: - - run: - name: Install pnpm package manager - # See https://stackoverflow.com/a/73411601 - command: corepack enable --install-directory ~/bin + - run: + name: Install pnpm package manager + # See https://stackoverflow.com/a/73411601 + command: corepack enable --install-directory ~/bin - run: name: View install environment command: | node --version pnpm --version + - when: condition: equal: [stable, << parameters.react-version >>] @@ -118,6 +109,12 @@ commands: - run: name: Install @mui/material v6 command: pnpm use-material-ui-v6 + - when: + condition: << parameters.playwright >> + steps: + - run: + name: Install playwright + command: pnpx playwright@1.51.1 install --with-deps jobs: checkout: @@ -240,12 +237,10 @@ jobs: test_browser: <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.51.1-noble steps: - checkout - install_js: - browsers: true + playwright: true react-version: << parameters.react-version >> - run: name: Tests real browsers @@ -272,24 +267,20 @@ jobs: NODE_OPTIONS: --max-old-space-size=3584 test_e2e: <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.51.1-noble steps: - checkout - install_js: - browsers: true + playwright: true react-version: << parameters.react-version >> - run: name: Run e2e tests command: pnpm test:e2e test_e2e_website: <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.51.1-noble steps: - checkout - install_js: - browsers: true + playwright: true - run: name: pnpm test:e2e-website command: pnpm test:e2e-website @@ -297,16 +288,14 @@ jobs: PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >> test_regressions: <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.51.1-noble steps: - checkout - install_js: - browsers: true + playwright: true react-version: << parameters.react-version >> - run: name: Install ffmpeg - command: apt update && apt upgrade -y && apt install ffmpeg -y + command: sudo apt update && sudo apt upgrade -y && sudo apt install ffmpeg -y - run: name: Run visual regression tests command: xvfb-run pnpm test:regressions diff --git a/.mocharc.js b/.mocharc.js index db51ee6949f29..71e67948d2a1f 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -8,11 +8,14 @@ module.exports = { // We're leaving this to make sure. 'docs/.next/**', ], - 'node-option': ['no-experimental-detect-module'], recursive: true, timeout: (process.env.CIRCLECI === 'true' ? 5 : 2) * 1000, // Circle CI has low-performance CPUs. reporter: 'dot', - require: [require.resolve('./test/utils/setupBabel'), require.resolve('./test/utils/setupJSDOM')], + require: [ + require.resolve('./test/utils/ignoreCSS'), + require.resolve('./test/utils/setupBabel'), + require.resolve('./test/utils/setupJSDOM'), + ], 'watch-ignore': [ // default '.git', diff --git a/babel.config.js b/babel.config.js index f435c2cfc93e9..072df75dfa233 100644 --- a/babel.config.js +++ b/babel.config.js @@ -131,7 +131,7 @@ module.exports = function getBabelConfig(api) { } if (process.env.NODE_ENV === 'production') { - if (!process.env.E2E_BUILD) { + if (!process.env.TEST_BUILD) { plugins.push(['babel-plugin-react-remove-properties', { properties: ['data-testid'] }]); } diff --git a/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.js b/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.js index 21edd6b04eac4..e462fb6a565cc 100644 --- a/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.js +++ b/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS = [ { diff --git a/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.tsx b/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.tsx index 22732137d9ff1..2e95d0930817e 100644 --- a/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.tsx +++ b/docs/data/tree-view/rich-tree-view/focus/ApiMethodFocusItem.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; import { TreeViewBaseItem } from '@mui/x-tree-view/models'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS: TreeViewBaseItem[] = [ { diff --git a/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.js b/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.js index 95427da9ddcbf..43534ca2d6080 100644 --- a/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.js +++ b/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS = [ { diff --git a/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.tsx b/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.tsx index 2f2e6e1e69fc1..be0df0843498c 100644 --- a/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.tsx +++ b/docs/data/tree-view/rich-tree-view/items/ApiMethodGetItemDOMElement.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; import { TreeViewBaseItem } from '@mui/x-tree-view/models'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS: TreeViewBaseItem[] = [ { diff --git a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.js b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.js index 8a5bdf79527b3..01ce56e559330 100644 --- a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.js +++ b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS = [ { diff --git a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.tsx b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.tsx index c49dfa4b78494..3314e62cbecb3 100644 --- a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.tsx +++ b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelection.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { TreeViewBaseItem } from '@mui/x-tree-view/models'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS: TreeViewBaseItem[] = [ { diff --git a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js index d1fe22bc6f260..dac04e3a3fe8f 100644 --- a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js +++ b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS = [ { diff --git a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx index 8815b3aea4540..a57bf72dfc798 100644 --- a/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx +++ b/docs/data/tree-view/rich-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { TreeViewBaseItem } from '@mui/x-tree-view/models'; import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; const MUI_X_PRODUCTS: TreeViewBaseItem[] = [ { diff --git a/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.js b/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.js index 52053493b5ae1..20017c9b2cd0f 100644 --- a/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.js +++ b/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodFocusItem() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.tsx b/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.tsx index 1f881952954a1..0fdad00933ed1 100644 --- a/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.tsx +++ b/docs/data/tree-view/simple-tree-view/focus/ApiMethodFocusItem.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodFocusItem() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.js b/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.js index ba8ad12bd5f6b..e39e0ea5a549a 100644 --- a/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.js +++ b/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodGetItemDOMElement() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.tsx b/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.tsx index 678a7093fa743..926f0dba4ac4a 100644 --- a/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.tsx +++ b/docs/data/tree-view/simple-tree-view/items/ApiMethodGetItemDOMElement.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodGetItemDOMElement() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.js b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.js index 7acbdcf92055a..94b016b0c5c3c 100644 --- a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.js +++ b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodSetItemSelection() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.tsx b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.tsx index 56c6f7b3ad490..ddd1886dab32c 100644 --- a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.tsx +++ b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelection.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodSetItemSelection() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js index 0abb34ef5c909..0fcc269b156a8 100644 --- a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js +++ b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.js @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodSetItemSelectionKeepExistingSelection() { const apiRef = useTreeViewApiRef(); diff --git a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx index 3c5f164de1473..c71716bb94ff9 100644 --- a/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx +++ b/docs/data/tree-view/simple-tree-view/selection/ApiMethodSetItemSelectionKeepExistingSelection.tsx @@ -4,7 +4,7 @@ import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; import { SimpleTreeView } from '@mui/x-tree-view/SimpleTreeView'; import { TreeItem } from '@mui/x-tree-view/TreeItem'; -import { useTreeViewApiRef } from '@mui/x-tree-view/hooks/useTreeViewApiRef'; +import { useTreeViewApiRef } from '@mui/x-tree-view/hooks'; export default function ApiMethodSetItemSelectionKeepExistingSelection() { const apiRef = useTreeViewApiRef(); diff --git a/docs/next.config.ts b/docs/next.config.ts index 6d93974caf0ce..37b49a2d5759b 100644 --- a/docs/next.config.ts +++ b/docs/next.config.ts @@ -1,6 +1,6 @@ import * as path from 'path'; -import * as url from 'url'; import * as fs from 'fs'; +import * as url from 'url'; import { createRequire } from 'module'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; // @ts-expect-error This expected error should be gone once we update the monorepo @@ -10,7 +10,10 @@ import { findPages } from './src/modules/utils/find'; import { LANGUAGES, LANGUAGES_SSR, LANGUAGES_IGNORE_PAGES, LANGUAGES_IN_PROGRESS } from './config'; import { SOURCE_CODE_REPO, SOURCE_GITHUB_BRANCH } from './constants'; +const IS_PRODUCTION = process.env.NODE_ENV === 'production'; + const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); + const require = createRequire(import.meta.url); const WORKSPACE_ROOT = path.resolve(currentDirectory, '../'); @@ -20,24 +23,6 @@ const MONOREPO_ALIASES = { '@mui/internal-markdown': path.resolve(MONOREPO_PATH, './packages/markdown'), }; -const WORKSPACE_ALIASES = { - '@mui/x-data-grid': path.resolve(WORKSPACE_ROOT, './packages/x-data-grid/src'), - '@mui/x-data-grid-generator': path.resolve( - WORKSPACE_ROOT, - './packages/x-data-grid-generator/src', - ), - '@mui/x-data-grid-pro': path.resolve(WORKSPACE_ROOT, './packages/x-data-grid-pro/src'), - '@mui/x-data-grid-premium': path.resolve(WORKSPACE_ROOT, './packages/x-data-grid-premium/src'), - '@mui/x-date-pickers': path.resolve(WORKSPACE_ROOT, './packages/x-date-pickers/src'), - '@mui/x-date-pickers-pro': path.resolve(WORKSPACE_ROOT, './packages/x-date-pickers-pro/src'), - '@mui/x-charts': path.resolve(WORKSPACE_ROOT, './packages/x-charts/src'), - '@mui/x-charts-pro': path.resolve(WORKSPACE_ROOT, './packages/x-charts-pro/src'), - '@mui/x-charts-vendor': path.resolve(WORKSPACE_ROOT, './packages/x-charts-vendor'), - '@mui/x-tree-view': path.resolve(WORKSPACE_ROOT, './packages/x-tree-view/src'), - '@mui/x-tree-view-pro': path.resolve(WORKSPACE_ROOT, './packages/x-tree-view-pro/src'), - '@mui/x-license': path.resolve(WORKSPACE_ROOT, './packages/x-license/src'), -}; - function loadPkg(pkgPath: string): { version: string } { const pkgContent = fs.readFileSync(path.resolve(WORKSPACE_ROOT, pkgPath, 'package.json'), 'utf8'); return JSON.parse(pkgContent); @@ -58,6 +43,10 @@ try { } export default withDocsInfra({ + typescript: { + // The tsconfig also contains path aliases that are used by next.js. + tsconfigPath: IS_PRODUCTION ? '../tsconfig.prod.json' : '../tsconfig.dev.json', + }, experimental: { esmExternals: undefined, }, @@ -105,7 +94,6 @@ export default withDocsInfra({ alias: { ...config.resolve.alias, ...MONOREPO_ALIASES, - ...WORKSPACE_ALIASES, // TODO: get rid of this, replace with @mui/docs docs: path.resolve(MONOREPO_PATH, './docs'), docsx: path.resolve(currentDirectory, '../docs'), @@ -204,7 +192,7 @@ export default withDocsInfra({ return map; }, // Used to signal we run build - ...(process.env.NODE_ENV === 'production' + ...(IS_PRODUCTION ? { output: 'export', } diff --git a/docs/package.json b/docs/package.json index 901c7fa6e30bd..a4536a1b684a8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -36,6 +36,7 @@ "@mui/system": "^7.0.1", "@mui/utils": "^7.0.1", "@mui/x-charts": "workspace:*", + "@mui/x-charts-pro": "workspace:*", "@mui/x-charts-vendor": "workspace:*", "@mui/x-data-grid": "workspace:*", "@mui/x-data-grid-generator": "workspace:*", @@ -44,6 +45,7 @@ "@mui/x-date-pickers": "workspace:*", "@mui/x-date-pickers-pro": "workspace:*", "@mui/x-tree-view": "workspace:*", + "@mui/x-tree-view-pro": "workspace:*", "@react-spring/web": "^9.7.5", "@tanstack/query-core": "^5.71.10", "@tanstack/react-query": "^5.71.10", diff --git a/netlify.toml b/netlify.toml index 7fbe2e7babad3..512d0e9dfa5a4 100644 --- a/netlify.toml +++ b/netlify.toml @@ -8,7 +8,7 @@ command = "pnpm docs:build" [build.environment] - NODE_VERSION = "20" + NODE_VERSION = "23" NODE_OPTIONS = "--max_old_space_size=4096" [[plugins]] diff --git a/package.json b/package.json index 552400c14a42c..86afa8756b521 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "docs:api:build": "tsx ./scripts/buildApiDocs/index.ts", "docs:api:buildX": "tsx ./docs/scripts/api/buildApi.ts", "docs:link-check": "tsx ./docs/scripts/reportBrokenLinks.js", - "docs:build": "pnpm --filter docs build", + "docs:build": "pnpm run release:build && pnpm --filter docs build", "docs:typescript:formatted": "pnpm --filter docs typescript:transpile", "docs:populate:demos": "pnpm --filter docs populate:demos", "docs:importDocsStatic": "node scripts/importDocsStatic.mjs", @@ -40,29 +40,21 @@ "test:karma": "cross-env NODE_ENV=test TZ=UTC karma start test/karma.conf.js", "test:karma:parallel": "cross-env NODE_ENV=test TZ=UTC PARALLEL=true karma start test/karma.conf.js", "test:unit": "cross-env NODE_ENV=test TZ=UTC mocha -n expose_gc 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}'", - "test:e2e": "cross-env NODE_ENV=production pnpm test:e2e:build && concurrently --success first --kill-others \"pnpm test:e2e:run\" \"pnpm test:e2e:server\"", - "test:e2e:build": "cross-env E2E_BUILD=true webpack --config test/e2e/webpack.config.js", - "test:e2e:dev": "concurrently \"pnpm test:e2e:build --watch\" \"pnpm test:e2e:server\"", - "test:e2e:run": "mocha --config test/e2e/.mocharc.js 'test/e2e/**/*.test.{js,ts,tsx}'", - "test:e2e:server": "serve test/e2e -p 5001", + "test:e2e": "pnpm run release:build && cd test/e2e && pnpm run start", "test:e2e-website": "npx playwright test test/e2e-website --config test/e2e-website/playwright.config.ts", "test:e2e-website:dev": "PLAYWRIGHT_TEST_BASE_URL=http://localhost:3001 npx playwright test test/e2e-website --config test/e2e-website/playwright.config.ts", - "test:regressions": "cross-env NODE_ENV=production pnpm test:regressions:build && concurrently --success first --kill-others \"pnpm test:regressions:run\" \"pnpm test:regressions:server\"", - "test:regressions:build": "cross-env E2E_BUILD=true webpack --config test/regressions/webpack.config.js", - "test:regressions:dev": "concurrently \"pnpm test:regressions:build --watch\" \"pnpm test:regressions:server\"", - "test:regressions:run": "mocha --config test/regressions/.mocharc.js --delay 'test/regressions/**/*.test.ts'", - "test:regressions:server": "serve test/regressions -p 5001", + "test:regressions": "pnpm run release:build && cd test/regressions && pnpm run start", "test:argos": "node ./scripts/pushArgos.mjs", "typescript": "lerna run --no-bail --parallel typescript", "typescript:ci": "lerna run --concurrency 1 --no-bail --no-sort typescript", "use-react-version": "node scripts/useReactVersion.mjs", "use-material-ui-v6": "node scripts/useMaterialUIv6.mjs", "use-material-ui-next": "node scripts/useMaterialUINext.mjs", - "build:codesandbox": "lerna run --concurrency 3 --no-private --scope \"@mui/*\" build", + "build:codesandbox": "pnpm run release:build --concurrency 3", "install:codesandbox": "pnpm install --no-frozen-lockfile", "release:changelog": "node scripts/releaseChangelog.mjs", "release:version": "lerna version --exact --no-changelog --no-push --no-git-tag-version --no-private", - "release:build": "lerna run --no-private --scope \"@mui/*\" build", + "release:build": "lerna run --scope '@mui/*' build", "release:publish": "pnpm publish --recursive --tag next", "release:publish:dry-run": "pnpm publish --recursive --tag next --registry=\"http://localhost:4873/\"", "release:tag": "node scripts/releaseTag.mjs", @@ -111,7 +103,7 @@ "@types/karma": "^6.3.9", "@types/lodash": "^4.17.16", "@types/mocha": "^10.0.10", - "@types/node": "^20.17.30", + "@types/node": "^23.11.0", "@types/react": "^19.0.12", "@types/react-dom": "^19.0.4", "@types/requestidlecallback": "^0.3.7", @@ -177,6 +169,7 @@ "mocha": "^11.1.0", "moment": "^2.30.1", "moment-timezone": "^0.5.48", + "null-loader": "^4.0.1", "nyc": "^17.1.0", "prettier": "^3.5.3", "pretty-quick": "^4.1.1", diff --git a/packages/x-charts-vendor/src/tests/d3-interpolate.test.ts b/packages/x-charts-vendor/src/tests/d3-interpolate.test.ts index ca28b08af8d7c..4c201621f3f66 100644 --- a/packages/x-charts-vendor/src/tests/d3-interpolate.test.ts +++ b/packages/x-charts-vendor/src/tests/d3-interpolate.test.ts @@ -6,10 +6,7 @@ import { expect } from 'chai'; /* eslint-disable @typescript-eslint/no-unused-vars */ import { - // @ts-expect-error Make sure invalid imports fail: - INVALID_TYPE, interpolate, - NumberArray, } from '@mui/x-charts-vendor/d3-interpolate'; describe('d3-interpolate', () => { diff --git a/packages/x-charts-vendor/src/tests/d3-scale.test.ts b/packages/x-charts-vendor/src/tests/d3-scale.test.ts index d27f29054c4eb..2f9419cbb3309 100644 --- a/packages/x-charts-vendor/src/tests/d3-scale.test.ts +++ b/packages/x-charts-vendor/src/tests/d3-scale.test.ts @@ -1,58 +1,10 @@ import { expect } from 'chai'; -/* eslint-disable @typescript-eslint/no-unused-vars */ import { - // @ts-expect-error Make sure invalid imports fail: - INVALID_TYPE, - InterpolatorFactory, - NumberValue, - ScaleBand, - ScaleContinuousNumeric, - ScaleDiverging, - ScaleIdentity, - ScaleLinear, - ScaleLogarithmic, - ScaleOrdinal, - ScalePoint, - ScalePower, - ScaleQuantile, - ScaleQuantize, - ScaleRadial, - ScaleSequential, - ScaleSequentialBase, - ScaleSequentialQuantile, - ScaleSymLog, - ScaleThreshold, - ScaleTime, - UnknownReturnType, - scaleBand, - scaleDiverging, - scaleDivergingLog, - scaleDivergingPow, - scaleDivergingSqrt, - scaleDivergingSymlog, - scaleIdentity, - scaleImplicit, scaleLinear, scaleLog, - scaleOrdinal, - scalePoint, scalePow, - scaleQuantile, - scaleQuantize, - scaleRadial, - scaleSequential, - scaleSequentialLog, - scaleSequentialPow, - scaleSequentialQuantile, - scaleSequentialSqrt, - scaleSequentialSymlog, scaleSqrt, - scaleSymlog, - scaleThreshold, - scaleTime, - scaleUtc, - tickFormat, } from '@mui/x-charts-vendor/d3-scale'; describe('d3-scale', () => { diff --git a/packages/x-data-grid-generator/package.json b/packages/x-data-grid-generator/package.json index d0ed3543f9ac5..5f3103a70fe34 100644 --- a/packages/x-data-grid-generator/package.json +++ b/packages/x-data-grid-generator/package.json @@ -35,6 +35,9 @@ "dependencies": { "@babel/runtime": "^7.27.0", "@mui/x-data-grid-premium": "workspace:*", + "@mui/x-data-grid-pro": "workspace:*", + "@mui/x-data-grid": "workspace:*", + "@mui/x-internals": "workspace:*", "chance": "^1.1.12", "clsx": "^2.1.1", "lru-cache": "^11.1.0" diff --git a/packages/x-data-grid-premium/package.json b/packages/x-data-grid-premium/package.json index abdcabbe0eeb3..7382bbd0712c5 100644 --- a/packages/x-data-grid-premium/package.json +++ b/packages/x-data-grid-premium/package.json @@ -9,7 +9,9 @@ "url": "https://github.com/mui/mui-x/issues" }, "homepage": "https://mui.com/x/react-data-grid/", - "sideEffects": false, + "sideEffects": [ + "**/*.css" + ], "publishConfig": { "access": "public", "directory": "build" diff --git a/packages/x-data-grid-premium/src/setupExcelExportWebWorker.ts b/packages/x-data-grid-premium/src/setupExcelExportWebWorker.ts deleted file mode 100644 index c0d3d9c12bfdd..0000000000000 --- a/packages/x-data-grid-premium/src/setupExcelExportWebWorker.ts +++ /dev/null @@ -1 +0,0 @@ -export { setupExcelExportWebWorker } from './hooks/features/export/serializer/setupExcelExportWebWorker'; diff --git a/packages/x-data-grid-premium/src/setupExcelExportWebWorker/index.ts b/packages/x-data-grid-premium/src/setupExcelExportWebWorker/index.ts new file mode 100644 index 0000000000000..5d835d9dcf0d5 --- /dev/null +++ b/packages/x-data-grid-premium/src/setupExcelExportWebWorker/index.ts @@ -0,0 +1 @@ +export { setupExcelExportWebWorker } from '../hooks/features/export/serializer/setupExcelExportWebWorker'; diff --git a/packages/x-data-grid-pro/package.json b/packages/x-data-grid-pro/package.json index 9705258fddabc..1053ef86bb7d6 100644 --- a/packages/x-data-grid-pro/package.json +++ b/packages/x-data-grid-pro/package.json @@ -9,7 +9,9 @@ "url": "https://github.com/mui/mui-x/issues" }, "homepage": "https://mui.com/x/react-data-grid/", - "sideEffects": false, + "sideEffects": [ + "**/*.css" + ], "publishConfig": { "access": "public", "directory": "build" diff --git a/packages/x-data-grid/package.json b/packages/x-data-grid/package.json index 614dc16f90f32..970696ae7c2b1 100644 --- a/packages/x-data-grid/package.json +++ b/packages/x-data-grid/package.json @@ -9,7 +9,9 @@ "url": "https://github.com/mui/mui-x/issues" }, "homepage": "https://mui.com/x/react-data-grid/", - "sideEffects": false, + "sideEffects": [ + "**/*.css" + ], "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" diff --git a/packages/x-data-grid/src/DataGrid/index.ts b/packages/x-data-grid/src/DataGrid/index.ts index 8bbb546cef5ec..9b5f999af00af 100644 --- a/packages/x-data-grid/src/DataGrid/index.ts +++ b/packages/x-data-grid/src/DataGrid/index.ts @@ -1 +1,3 @@ +import '../index.css'; + export * from './DataGrid'; diff --git a/packages/x-data-grid/src/index.css b/packages/x-data-grid/src/index.css new file mode 100644 index 0000000000000..5b18d73f182f7 --- /dev/null +++ b/packages/x-data-grid/src/index.css @@ -0,0 +1,5 @@ +/* Placeholder file to ensure CSS imports are working */ + +.MuiDataGrid { + display: block; +} diff --git a/packages/x-internals/package.json b/packages/x-internals/package.json index ee3f042ba549d..0e0bb28ab460c 100644 --- a/packages/x-internals/package.json +++ b/packages/x-internals/package.json @@ -45,10 +45,12 @@ "@mui/utils": "^7.0.1" }, "peerDependencies": { + "@mui/system": "^5.15.14 || ^6.0.0 || ^7.0.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "devDependencies": { "@mui/internal-test-utils": "^2.0.4", + "@mui/system": "^7.0.1", "react": "^19.0.0", "react-dom": "^19.0.0", "rimraf": "^6.0.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4212f03cc3179..b16fcffbcaacf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -160,10 +160,10 @@ importers: version: 17.0.33 '@typescript-eslint/eslint-plugin': specifier: ^8.29.0 - version: 8.29.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3) + version: 8.29.1(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3) '@typescript-eslint/parser': specifier: ^8.29.0 - version: 8.29.0(eslint@8.57.1)(typescript@5.8.3) + version: 8.29.1(eslint@8.57.1)(typescript@5.8.3) autoprefixer: specifier: ^10.4.21 version: 10.4.21(postcss@8.5.3) @@ -244,7 +244,7 @@ importers: version: 1.3.2(eslint@8.57.1) eslint-plugin-import: specifier: ^2.31.0 - version: 2.31.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) + version: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) eslint-plugin-jsdoc: specifier: ^50.6.9 version: 50.6.9(eslint@8.57.1) @@ -338,6 +338,9 @@ importers: moment-timezone: specifier: ^0.5.48 version: 0.5.48 + null-loader: + specifier: ^4.0.1 + version: 4.0.1(webpack@5.98.0) nyc: specifier: ^17.1.0 version: 17.1.0 @@ -455,6 +458,9 @@ importers: '@mui/x-charts': specifier: workspace:* version: link:../packages/x-charts/build + '@mui/x-charts-pro': + specifier: workspace:* + version: link:../packages/x-charts-pro/build '@mui/x-charts-vendor': specifier: workspace:* version: link:../packages/x-charts-vendor @@ -479,15 +485,18 @@ importers: '@mui/x-tree-view': specifier: workspace:* version: link:../packages/x-tree-view/build + '@mui/x-tree-view-pro': + specifier: workspace:* + version: link:../packages/x-tree-view-pro/build '@react-spring/web': specifier: ^9.7.5 version: 9.7.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@tanstack/query-core': specifier: ^5.71.10 - version: 5.71.10 + version: 5.72.0 '@tanstack/react-query': specifier: ^5.71.10 - version: 5.71.10(react@19.0.0) + version: 5.72.0(react@19.0.0) ast-types: specifier: ^0.14.2 version: 0.14.2 @@ -710,13 +719,13 @@ importers: version: 8.56.12 '@typescript-eslint/parser': specifier: ^8.29.0 - version: 8.29.0(eslint@8.57.1)(typescript@5.8.3) + version: 8.29.1(eslint@8.57.1)(typescript@5.8.3) '@typescript-eslint/rule-tester': specifier: ^8.29.0 - version: 8.29.0(eslint@8.57.1)(typescript@5.8.3) + version: 8.29.1(eslint@8.57.1)(typescript@5.8.3) '@typescript-eslint/utils': specifier: ^8.29.0 - version: 8.29.0(eslint@8.57.1)(typescript@5.8.3) + version: 8.29.1(eslint@8.57.1)(typescript@5.8.3) packages/x-charts: dependencies: @@ -1041,9 +1050,18 @@ importers: '@emotion/styled': specifier: ^11.8.1 version: 11.14.0(@emotion/react@11.14.0(@types/react@19.0.12)(react@19.0.0))(@types/react@19.0.12)(react@19.0.0) + '@mui/x-data-grid': + specifier: workspace:* + version: link:../x-data-grid/build '@mui/x-data-grid-premium': specifier: workspace:* version: link:../x-data-grid-premium/build + '@mui/x-data-grid-pro': + specifier: workspace:* + version: link:../x-data-grid-pro/build + '@mui/x-internals': + specifier: workspace:* + version: link:../x-internals/build chance: specifier: ^1.1.12 version: 1.1.12 @@ -1391,6 +1409,9 @@ importers: '@mui/internal-test-utils': specifier: ^2.0.4 version: 2.0.4(@babel/core@7.26.10)(@types/react-dom@19.0.4(@types/react@19.0.12))(@types/react@19.0.12)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + '@mui/system': + specifier: ^7.0.1 + version: 7.0.1(@emotion/react@11.14.0(@types/react@19.0.12)(react@19.0.0))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@19.0.12)(react@19.0.0))(@types/react@19.0.12)(react@19.0.0))(@types/react@19.0.12)(react@19.0.0) react: specifier: ^19.0.0 version: 19.0.0 @@ -1698,11 +1719,95 @@ importers: specifier: ^2.1.1 version: 2.1.1(stylis@4.3.6) + test/e2e: + devDependencies: + '@babel/runtime': + specifier: ^7.27.0 + version: 7.27.0 + '@mui/x-charts': + specifier: workspace:* + version: link:../../packages/x-charts/build + '@mui/x-charts-pro': + specifier: workspace:* + version: link:../../packages/x-charts-pro/build + '@mui/x-charts-vendor': + specifier: workspace:* + version: link:../../packages/x-charts-vendor + '@mui/x-data-grid': + specifier: workspace:* + version: link:../../packages/x-data-grid/build + '@mui/x-data-grid-generator': + specifier: workspace:^ + version: link:../../packages/x-data-grid-generator/build + '@mui/x-data-grid-premium': + specifier: workspace:^ + version: link:../../packages/x-data-grid-premium/build + '@mui/x-data-grid-pro': + specifier: workspace:* + version: link:../../packages/x-data-grid-pro/build + '@mui/x-date-pickers': + specifier: workspace:* + version: link:../../packages/x-date-pickers/build + '@mui/x-date-pickers-pro': + specifier: workspace:* + version: link:../../packages/x-date-pickers-pro/build + '@mui/x-internals': + specifier: workspace:^ + version: link:../../packages/x-internals/build + '@mui/x-license': + specifier: workspace:* + version: link:../../packages/x-license/build + '@playwright/test': + specifier: ^1.51.0 + version: 1.51.1 + '@types/chai': + specifier: ^4.3.20 + version: 4.3.20 + '@types/karma': + specifier: ^6.3.9 + version: 6.3.9 + '@types/moment-jalaali': + specifier: ^0.7.9 + version: 0.7.9 + '@types/react': + specifier: ^19.0.10 + version: 19.0.12 + '@types/react-router': + specifier: ^5.1.20 + version: 5.1.20 + '@types/semver': + specifier: ^7.5.8 + version: 7.7.0 + '@vitejs/plugin-react': + specifier: ^4.3.4 + version: 4.3.4(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) + chai: + specifier: ^4.5.0 + version: 4.5.0 + react: + specifier: ^19.0.0 + version: 19.0.0 + react-dom: + specifier: ^19.0.0 + version: 19.0.0(react@19.0.0) + react-router: + specifier: ^7.3.0 + version: 7.5.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + react-transition-group: + specifier: ^4.4.5 + version: 4.4.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + tsx: + specifier: ^4.19.3 + version: 4.19.3 + vite: + specifier: ^6.2.2 + version: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + test/performance-charts: devDependencies: '@codspeed/vitest-plugin': specifier: ^4.0.1 - version: 4.0.1(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1) + version: 4.0.1(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1) '@emotion/react': specifier: ^11.14.0 version: 11.14.0(@types/react@19.0.12)(react@19.0.0) @@ -1723,13 +1828,13 @@ importers: version: 14.6.1(@testing-library/dom@10.4.0) '@vitejs/plugin-react': specifier: ^4.3.4 - version: 4.3.4(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) + version: 4.3.4(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) '@vitejs/plugin-react-swc': specifier: ^3.8.1 - version: 3.8.1(@swc/helpers@0.5.15)(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) + version: 3.8.1(@swc/helpers@0.5.15)(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) '@vitest/browser': specifier: 3.1.1 - version: 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(playwright@1.51.1)(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1) + version: 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(playwright@1.51.1)(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1) '@vitest/ui': specifier: 3.1.1 version: 3.1.1(vitest@3.1.1) @@ -1744,7 +1849,97 @@ importers: version: 19.0.0(react@19.0.0) vitest: specifier: 3.1.1 - version: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + version: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(lightningcss@1.29.3)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + + test/regressions: + devDependencies: + '@babel/runtime': + specifier: ^7.27.0 + version: 7.27.0 + '@mui/x-charts': + specifier: workspace:* + version: link:../../packages/x-charts/build + '@mui/x-charts-pro': + specifier: workspace:* + version: link:../../packages/x-charts-pro/build + '@mui/x-charts-vendor': + specifier: workspace:* + version: link:../../packages/x-charts-vendor + '@mui/x-data-grid': + specifier: workspace:* + version: link:../../packages/x-data-grid/build + '@mui/x-data-grid-generator': + specifier: workspace:^ + version: link:../../packages/x-data-grid-generator/build + '@mui/x-data-grid-premium': + specifier: workspace:^ + version: link:../../packages/x-data-grid-premium/build + '@mui/x-data-grid-pro': + specifier: workspace:* + version: link:../../packages/x-data-grid-pro/build + '@mui/x-date-pickers': + specifier: workspace:* + version: link:../../packages/x-date-pickers/build + '@mui/x-date-pickers-pro': + specifier: workspace:* + version: link:../../packages/x-date-pickers-pro/build + '@mui/x-internals': + specifier: workspace:^ + version: link:../../packages/x-internals/build + '@mui/x-license': + specifier: workspace:* + version: link:../../packages/x-license/build + '@mui/x-tree-view': + specifier: workspace:* + version: link:../../packages/x-tree-view/build + '@mui/x-tree-view-pro': + specifier: workspace:* + version: link:../../packages/x-tree-view-pro/build + '@playwright/test': + specifier: ^1.51.0 + version: 1.51.1 + '@types/chai': + specifier: ^4.3.20 + version: 4.3.20 + '@types/karma': + specifier: ^6.3.9 + version: 6.3.9 + '@types/moment-jalaali': + specifier: ^0.7.9 + version: 0.7.9 + '@types/react': + specifier: ^19.0.10 + version: 19.0.12 + '@types/react-router': + specifier: ^5.1.20 + version: 5.1.20 + '@types/semver': + specifier: ^7.5.8 + version: 7.7.0 + '@vitejs/plugin-react': + specifier: ^4.3.4 + version: 4.3.4(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) + chai: + specifier: ^4.5.0 + version: 4.5.0 + react: + specifier: ^19.0.0 + version: 19.0.0 + react-dom: + specifier: ^19.0.0 + version: 19.0.0(react@19.0.0) + react-router: + specifier: ^7.3.0 + version: 7.5.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + react-transition-group: + specifier: ^4.4.5 + version: 4.4.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + tsx: + specifier: ^4.19.3 + version: 4.19.3 + vite: + specifier: ^6.2.2 + version: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) packages: @@ -3712,8 +3907,8 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@pkgr/core@0.2.0': - resolution: {integrity: sha512-vsJDAkYR6qCPu+ioGScGiMYR7LvZYIXh/dlQeviqoTWNCVfKTLYD/LkNWH4Mxsv2a5vpIRc77FN5DnmK1eBggQ==} + '@pkgr/core@0.2.1': + resolution: {integrity: sha512-VzgHzGblFmUeBmmrk55zPyrQIArQN4vujc9shWytaPdB3P7qhi0cpaiKIr7tlCmFv2lYUwnLospIqjL9ZSAhhg==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} '@playwright/test@1.51.1': @@ -4009,11 +4204,11 @@ packages: '@swc/types@0.1.19': resolution: {integrity: sha512-WkAZaAfj44kh/UFdAQcrMP1I0nwRqpt27u+08LMBYMqmQfwwMofYoMh/48NGkMMRfC4ynpfwRbJuu8ErfNloeA==} - '@tanstack/query-core@5.71.10': - resolution: {integrity: sha512-/fKEY8fO1nbszfrBatzmhJa1nEwIKn0c6Tv2A1ocSA5OiD2GukOIV8nnBbvJRgZb/VIoBy9/N4PVbABI8YQLow==} + '@tanstack/query-core@5.72.0': + resolution: {integrity: sha512-aa3p6Mou++JLLxxxVX9AB9uGeRIGc0JWkw96GASXuMG8K3D+JpYbSFcqXbkGFJ1eX2jKHPurmCBoO43RjjXJCA==} - '@tanstack/react-query@5.71.10': - resolution: {integrity: sha512-mQYM/ObpL8YMDz8vCoUuHkbe8Yu7NnVRH8aBaBa/3zlufjp1f1VuWjeO3TcumNHfuVMDwEAGinsgwrB7OKADiQ==} + '@tanstack/react-query@5.72.0': + resolution: {integrity: sha512-4Dejq/IiXrPlr/0xxj4H2GbC6KckwfTCoHWbd02+UoIV0laC9yke0d0KegmFdXJA712I6UCuy8WpPM76uuPJ+w==} peerDependencies: react: ^18 || ^19 @@ -4326,57 +4521,57 @@ packages: '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - '@typescript-eslint/eslint-plugin@8.29.0': - resolution: {integrity: sha512-PAIpk/U7NIS6H7TEtN45SPGLQaHNgB7wSjsQV/8+KYokAb2T/gloOA/Bee2yd4/yKVhPKe5LlaUGhAZk5zmSaQ==} + '@typescript-eslint/eslint-plugin@8.29.1': + resolution: {integrity: sha512-ba0rr4Wfvg23vERs3eB+P3lfj2E+2g3lhWcCVukUuhtcdUx5lSIFZlGFEBHKr+3zizDa/TvZTptdNHVZWAkSBg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/parser@8.29.0': - resolution: {integrity: sha512-8C0+jlNJOwQso2GapCVWWfW/rzaq7Lbme+vGUFKE31djwNncIpgXD7Cd4weEsDdkoZDjH0lwwr3QDQFuyrMg9g==} + '@typescript-eslint/parser@8.29.1': + resolution: {integrity: sha512-zczrHVEqEaTwh12gWBIJWj8nx+ayDcCJs06yoNMY0kwjMWDM6+kppljY+BxWI06d2Ja+h4+WdufDcwMnnMEWmg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/rule-tester@8.29.0': - resolution: {integrity: sha512-7F9qOiwW5PJaryNj7cuvdjnCXzY9qbfTii3VYSDPNaZtgJvQwAYZxJA8RUQ0I7G2bvlUONCzL0VEerwNYEIDKQ==} + '@typescript-eslint/rule-tester@8.29.1': + resolution: {integrity: sha512-Kge0+/xU4So5mnZqCTj07wBtJBBGf0EEDLXhOmEbrfDXiPpc6FHaqOmc4y16eGrs2sTrgAXYyc2MOkdsoWgK2w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/scope-manager@8.29.0': - resolution: {integrity: sha512-aO1PVsq7Gm+tcghabUpzEnVSFMCU4/nYIgC2GOatJcllvWfnhrgW0ZEbnTxm36QsikmCN1K/6ZgM7fok2I7xNw==} + '@typescript-eslint/scope-manager@8.29.1': + resolution: {integrity: sha512-2nggXGX5F3YrsGN08pw4XpMLO1Rgtnn4AzTegC2MDesv6q3QaTU5yU7IbS1tf1IwCR0Hv/1EFygLn9ms6LIpDA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.29.0': - resolution: {integrity: sha512-ahaWQ42JAOx+NKEf5++WC/ua17q5l+j1GFrbbpVKzFL/tKVc0aYY8rVSYUpUvt2hUP1YBr7mwXzx+E/DfUWI9Q==} + '@typescript-eslint/type-utils@8.29.1': + resolution: {integrity: sha512-DkDUSDwZVCYN71xA4wzySqqcZsHKic53A4BLqmrWFFpOpNSoxX233lwGu/2135ymTCR04PoKiEEEvN1gFYg4Tw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/types@8.29.0': - resolution: {integrity: sha512-wcJL/+cOXV+RE3gjCyl/V2G877+2faqvlgtso/ZRbTCnZazh0gXhe+7gbAnfubzN2bNsBtZjDvlh7ero8uIbzg==} + '@typescript-eslint/types@8.29.1': + resolution: {integrity: sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.29.0': - resolution: {integrity: sha512-yOfen3jE9ISZR/hHpU/bmNvTtBW1NjRbkSFdZOksL1N+ybPEE7UVGMwqvS6CP022Rp00Sb0tdiIkhSCe6NI8ow==} + '@typescript-eslint/typescript-estree@8.29.1': + resolution: {integrity: sha512-l1enRoSaUkQxOQnbi0KPUtqeZkSiFlqrx9/3ns2rEDhGKfTa+88RmXqedC1zmVTOWrLc2e6DEJrTA51C9iLH5g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/utils@8.29.0': - resolution: {integrity: sha512-gX/A0Mz9Bskm8avSWFcK0gP7cZpbY4AIo6B0hWYFCaIsz750oaiWR4Jr2CI+PQhfW1CpcQr9OlfPS+kMFegjXA==} + '@typescript-eslint/utils@8.29.1': + resolution: {integrity: sha512-QAkFEbytSaB8wnmB+DflhUPz6CLbFWE2SnSCrRMEa+KnXIzDYbpsn++1HGvnfAsUY44doDXmvRkO5shlM/3UfA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/visitor-keys@8.29.0': - resolution: {integrity: sha512-Sne/pVz8ryR03NFK21VpN88dZ2FdQXOlq3VIklbrTYEt8yXtRFr9tvUhqvCeKjqYk5FSim37sHbooT6vzBTZcg==} + '@typescript-eslint/visitor-keys@8.29.1': + resolution: {integrity: sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.3.0': @@ -7511,6 +7706,70 @@ packages: lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} + lightningcss-darwin-arm64@1.29.3: + resolution: {integrity: sha512-fb7raKO3pXtlNbQbiMeEu8RbBVHnpyqAoxTyTRMEWFQWmscGC2wZxoHzZ+YKAepUuKT9uIW5vL2QbFivTgprZg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.29.3: + resolution: {integrity: sha512-KF2XZ4ZdmDGGtEYmx5wpzn6u8vg7AdBHaEOvDKu8GOs7xDL/vcU2vMKtTeNe1d4dogkDdi3B9zC77jkatWBwEQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.29.3: + resolution: {integrity: sha512-VUWeVf+V1UM54jv9M4wen9vMlIAyT69Krl9XjI8SsRxz4tdNV/7QEPlW6JASev/pYdiynUCW0pwaFquDRYdxMw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.29.3: + resolution: {integrity: sha512-UhgZ/XVNfXQVEJrMIWeK1Laj8KbhjbIz7F4znUk7G4zeGw7TRoJxhb66uWrEsonn1+O45w//0i0Fu0wIovYdYg==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.29.3: + resolution: {integrity: sha512-Pqau7jtgJNmQ/esugfmAT1aCFy/Gxc92FOxI+3n+LbMHBheBnk41xHDhc0HeYlx9G0xP5tK4t0Koy3QGGNqypw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.29.3: + resolution: {integrity: sha512-dxakOk66pf7KLS7VRYFO7B8WOJLecE5OPL2YOk52eriFd/yeyxt2Km5H0BjLfElokIaR+qWi33gB8MQLrdAY3A==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.29.3: + resolution: {integrity: sha512-ySZTNCpbfbK8rqpKJeJR2S0g/8UqqV3QnzcuWvpI60LWxnFN91nxpSSwCbzfOXkzKfar9j5eOuOplf+klKtINg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.29.3: + resolution: {integrity: sha512-3pVZhIzW09nzi10usAXfIGTTSTYQ141dk88vGFNCgawIzayiIzZQxEcxVtIkdvlEq2YuFsL9Wcj/h61JHHzuFQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.29.3: + resolution: {integrity: sha512-VRnkAvtIkeWuoBJeGOTrZxsNp4HogXtcaaLm8agmbYtLDOhQdpgxW6NjZZjDXbvGF+eOehGulXZ3C1TiwHY4QQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.29.3: + resolution: {integrity: sha512-IszwRPu2cPnDQsZpd7/EAr0x2W7jkaWqQ1SwCVIZ/tSbZVXPLt6k8s6FkcyBjViCzvB5CW0We0QbbP7zp2aBjQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.29.3: + resolution: {integrity: sha512-GlOJwTIP6TMIlrTFsxTerwC0W6OpQpCGuX1ECRLBUVRh6fpJH3xTqjCjRgQHTb4ZXexH9rtHou1Lf03GKzmhhQ==} + engines: {node: '>= 12.0.0'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -8285,6 +8544,12 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + null-loader@4.0.1: + resolution: {integrity: sha512-pxqVbi4U6N26lq+LmgIbB5XATP0VdZKOG25DhHi8btMmJJefGArFyDg1yc4U3hWCJbMqSrw0qyrz1UQX+qYXqg==} + engines: {node: '>= 10.13.0'} + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + nwsapi@2.2.18: resolution: {integrity: sha512-p1TRH/edngVEHVbwqWnxUViEmq5znDvyB+Sik5cmuLpGOIfDf/39zLiq3swPF8Vakqn+gvNiOQAZu8djYlQILA==} @@ -8699,8 +8964,8 @@ packages: pinpoint@1.1.0: resolution: {integrity: sha512-+04FTD9x7Cls2rihLlo57QDCcHoLBGn5Dk51SwtFBWkUWLxZaBXyNVpCw1S+atvE7GmnFjeaRZ0WLq3UYuqAdg==} - pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} pkg-dir@3.0.0: @@ -9668,8 +9933,8 @@ packages: symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} - synckit@0.11.2: - resolution: {integrity: sha512-1IUffI8zZ8qUMB3NUJIjk0RpLroG/8NkQDAWH1NbB2iJ0/5pn3M8rxfNzMz4GH9OnYaGYn31LEDSXJp/qIlxgA==} + synckit@0.11.3: + resolution: {integrity: sha512-szhWDqNNI9etJUvbZ1/cx1StnZx8yMmFxme48SwR4dty4ioSY50KEZlpv0qAfgc1fpRzuh9hBXEzoCpJ779dLg==} engines: {node: ^14.18.0 || >=16.0.0} synckit@0.9.2: @@ -10142,8 +10407,8 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@6.2.1: - resolution: {integrity: sha512-n2GnqDb6XPhlt9B8olZPrgMD/es/Nd1RdChF6CBD/fHW6pUyUTt2sQW2fPRX5GiD9XEa6+8A6A4f2vT6pSsE7Q==} + vite@6.2.4: + resolution: {integrity: sha512-veHMSew8CcRzhL5o8ONjy8gkfmFJAd5Ac16oxBUjlwgX3Gq2Wqr+qNC3TjPIpy7TPV/KporLga5GT9HqdrCizw==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: @@ -11460,7 +11725,7 @@ snapshots: clone-deep: 4.0.1 find-cache-dir: 2.1.0 make-dir: 2.1.0 - pirates: 4.0.6 + pirates: 4.0.7 source-map-support: 0.5.21 '@babel/runtime-corejs2@7.27.0': @@ -11522,11 +11787,11 @@ snapshots: transitivePeerDependencies: - debug - '@codspeed/vitest-plugin@4.0.1(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1)': + '@codspeed/vitest-plugin@4.0.1(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1)': dependencies: '@codspeed/core': 4.0.1 - vite: 6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) - vitest: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vitest: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(lightningcss@1.29.3)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - debug @@ -12891,7 +13156,7 @@ snapshots: '@pkgr/core@0.1.1': {} - '@pkgr/core@0.2.0': {} + '@pkgr/core@0.2.1': {} '@playwright/test@1.51.1': dependencies: @@ -13173,11 +13438,11 @@ snapshots: dependencies: '@swc/counter': 0.1.3 - '@tanstack/query-core@5.71.10': {} + '@tanstack/query-core@5.72.0': {} - '@tanstack/react-query@5.71.10(react@19.0.0)': + '@tanstack/react-query@5.72.0(react@19.0.0)': dependencies: - '@tanstack/query-core': 5.71.10 + '@tanstack/query-core': 5.72.0 react: 19.0.0 '@testing-library/dom@10.4.0': @@ -13507,14 +13772,14 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.29.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.29.1(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.29.0(eslint@8.57.1)(typescript@5.8.3) - '@typescript-eslint/scope-manager': 8.29.0 - '@typescript-eslint/type-utils': 8.29.0(eslint@8.57.1)(typescript@5.8.3) - '@typescript-eslint/utils': 8.29.0(eslint@8.57.1)(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.29.0 + '@typescript-eslint/parser': 8.29.1(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.29.1 + '@typescript-eslint/type-utils': 8.29.1(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/utils': 8.29.1(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.29.1 eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 @@ -13524,23 +13789,23 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3)': + '@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3)': dependencies: - '@typescript-eslint/scope-manager': 8.29.0 - '@typescript-eslint/types': 8.29.0 - '@typescript-eslint/typescript-estree': 8.29.0(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.29.0 + '@typescript-eslint/scope-manager': 8.29.1 + '@typescript-eslint/types': 8.29.1 + '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.29.1 debug: 4.4.0(supports-color@8.1.1) eslint: 8.57.1 typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/rule-tester@8.29.0(eslint@8.57.1)(typescript@5.8.3)': + '@typescript-eslint/rule-tester@8.29.1(eslint@8.57.1)(typescript@5.8.3)': dependencies: - '@typescript-eslint/parser': 8.29.0(eslint@8.57.1)(typescript@5.8.3) - '@typescript-eslint/typescript-estree': 8.29.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.29.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/parser': 8.29.1(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) + '@typescript-eslint/utils': 8.29.1(eslint@8.57.1)(typescript@5.8.3) ajv: 6.12.6 eslint: 8.57.1 json-stable-stringify-without-jsonify: 1.0.1 @@ -13550,15 +13815,15 @@ snapshots: - supports-color - typescript - '@typescript-eslint/scope-manager@8.29.0': + '@typescript-eslint/scope-manager@8.29.1': dependencies: - '@typescript-eslint/types': 8.29.0 - '@typescript-eslint/visitor-keys': 8.29.0 + '@typescript-eslint/types': 8.29.1 + '@typescript-eslint/visitor-keys': 8.29.1 - '@typescript-eslint/type-utils@8.29.0(eslint@8.57.1)(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.29.1(eslint@8.57.1)(typescript@5.8.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.29.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.29.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) + '@typescript-eslint/utils': 8.29.1(eslint@8.57.1)(typescript@5.8.3) debug: 4.4.0(supports-color@8.1.1) eslint: 8.57.1 ts-api-utils: 2.0.1(typescript@5.8.3) @@ -13566,12 +13831,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.29.0': {} + '@typescript-eslint/types@8.29.1': {} - '@typescript-eslint/typescript-estree@8.29.0(typescript@5.8.3)': + '@typescript-eslint/typescript-estree@8.29.1(typescript@5.8.3)': dependencies: - '@typescript-eslint/types': 8.29.0 - '@typescript-eslint/visitor-keys': 8.29.0 + '@typescript-eslint/types': 8.29.1 + '@typescript-eslint/visitor-keys': 8.29.1 debug: 4.4.0(supports-color@8.1.1) fast-glob: 3.3.3 is-glob: 4.0.3 @@ -13582,52 +13847,52 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.29.0(eslint@8.57.1)(typescript@5.8.3)': + '@typescript-eslint/utils@8.29.1(eslint@8.57.1)(typescript@5.8.3)': dependencies: '@eslint-community/eslint-utils': 4.5.0(eslint@8.57.1) - '@typescript-eslint/scope-manager': 8.29.0 - '@typescript-eslint/types': 8.29.0 - '@typescript-eslint/typescript-estree': 8.29.0(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.29.1 + '@typescript-eslint/types': 8.29.1 + '@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3) eslint: 8.57.1 typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.29.0': + '@typescript-eslint/visitor-keys@8.29.1': dependencies: - '@typescript-eslint/types': 8.29.0 + '@typescript-eslint/types': 8.29.1 eslint-visitor-keys: 4.2.0 '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react-swc@3.8.1(@swc/helpers@0.5.15)(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))': + '@vitejs/plugin-react-swc@3.8.1(@swc/helpers@0.5.15)(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))': dependencies: '@swc/core': 1.11.11(@swc/helpers@0.5.15) - vite: 6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@swc/helpers' - '@vitejs/plugin-react@4.3.4(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))': + '@vitejs/plugin-react@4.3.4(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))': dependencies: '@babel/core': 7.26.10 '@babel/plugin-transform-react-jsx-self': 7.25.9(@babel/core@7.26.10) '@babel/plugin-transform-react-jsx-source': 7.25.9(@babel/core@7.26.10) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - supports-color - '@vitest/browser@3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(playwright@1.51.1)(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1)': + '@vitest/browser@3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(playwright@1.51.1)(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.6.1(@testing-library/dom@10.4.0) - '@vitest/mocker': 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) + '@vitest/mocker': 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) '@vitest/utils': 3.1.1 magic-string: 0.30.17 sirv: 3.0.1 tinyrainbow: 2.0.0 - vitest: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vitest: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(lightningcss@1.29.3)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) ws: 8.18.1 optionalDependencies: playwright: 1.51.1 @@ -13644,14 +13909,14 @@ snapshots: chai: 5.2.0 tinyrainbow: 2.0.0 - '@vitest/mocker@3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))': + '@vitest/mocker@3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))': dependencies: '@vitest/spy': 3.1.1 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: msw: 2.7.3(@types/node@20.17.30)(typescript@5.8.3) - vite: 6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) '@vitest/pretty-format@3.1.1': dependencies: @@ -13681,7 +13946,7 @@ snapshots: sirv: 3.0.1 tinyglobby: 0.2.12 tinyrainbow: 2.0.0 - vitest: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vitest: 3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(lightningcss@1.29.3)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) '@vitest/utils@3.1.1': dependencies: @@ -15487,7 +15752,7 @@ snapshots: dependencies: confusing-browser-globals: 1.0.11 eslint: 8.57.1 - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) object.assign: 4.1.7 object.entries: 1.1.9 semver: 6.3.1 @@ -15496,7 +15761,7 @@ snapshots: dependencies: eslint: 8.57.1 eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.31.0)(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.2(eslint@8.57.1) eslint-plugin-react: 7.37.5(eslint@8.57.1) eslint-plugin-react-hooks: 5.2.0(eslint@8.57.1) @@ -15519,7 +15784,7 @@ snapshots: dependencies: debug: 3.2.7 enhanced-resolve: 0.9.1 - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) find-root: 1.1.0 hasown: 2.0.2 interpret: 1.4.0 @@ -15532,11 +15797,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.29.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/parser': 8.29.1(eslint@8.57.1)(typescript@5.8.3) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-webpack: 0.13.10(eslint-plugin-import@2.31.0)(webpack@5.98.0) @@ -15551,7 +15816,7 @@ snapshots: lodash.snakecase: 4.1.1 lodash.upperfirst: 4.3.1 - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -15562,7 +15827,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.29.0(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.29.1(eslint@8.57.1)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.10)(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -15574,7 +15839,7 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.29.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/parser': 8.29.1(eslint@8.57.1)(typescript@5.8.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -15628,7 +15893,7 @@ snapshots: eslint: 8.57.1 prettier: 3.5.3 prettier-linter-helpers: 1.0.0 - synckit: 0.11.2 + synckit: 0.11.3 optionalDependencies: '@types/eslint': 8.56.12 eslint-config-prettier: 10.1.1(eslint@8.57.1) @@ -15673,8 +15938,8 @@ snapshots: eslint-plugin-testing-library@7.1.1(eslint@8.57.1)(typescript@5.8.3): dependencies: - '@typescript-eslint/scope-manager': 8.29.0 - '@typescript-eslint/utils': 8.29.0(eslint@8.57.1)(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.29.1 + '@typescript-eslint/utils': 8.29.1(eslint@8.57.1)(typescript@5.8.3) eslint: 8.57.1 transitivePeerDependencies: - supports-color @@ -17406,6 +17671,52 @@ snapshots: dependencies: immediate: 3.0.6 + lightningcss-darwin-arm64@1.29.3: + optional: true + + lightningcss-darwin-x64@1.29.3: + optional: true + + lightningcss-freebsd-x64@1.29.3: + optional: true + + lightningcss-linux-arm-gnueabihf@1.29.3: + optional: true + + lightningcss-linux-arm64-gnu@1.29.3: + optional: true + + lightningcss-linux-arm64-musl@1.29.3: + optional: true + + lightningcss-linux-x64-gnu@1.29.3: + optional: true + + lightningcss-linux-x64-musl@1.29.3: + optional: true + + lightningcss-win32-arm64-msvc@1.29.3: + optional: true + + lightningcss-win32-x64-msvc@1.29.3: + optional: true + + lightningcss@1.29.3: + dependencies: + detect-libc: 2.0.3 + optionalDependencies: + lightningcss-darwin-arm64: 1.29.3 + lightningcss-darwin-x64: 1.29.3 + lightningcss-freebsd-x64: 1.29.3 + lightningcss-linux-arm-gnueabihf: 1.29.3 + lightningcss-linux-arm64-gnu: 1.29.3 + lightningcss-linux-arm64-musl: 1.29.3 + lightningcss-linux-x64-gnu: 1.29.3 + lightningcss-linux-x64-musl: 1.29.3 + lightningcss-win32-arm64-msvc: 1.29.3 + lightningcss-win32-x64-msvc: 1.29.3 + optional: true + lines-and-columns@1.2.4: {} lines-and-columns@2.0.3: {} @@ -18365,6 +18676,12 @@ snapshots: dependencies: boolbase: 1.0.0 + null-loader@4.0.1(webpack@5.98.0): + dependencies: + loader-utils: 2.0.4 + schema-utils: 3.3.0 + webpack: 5.98.0(@swc/core@1.11.11(@swc/helpers@0.5.15))(webpack-cli@6.0.1(webpack-bundle-analyzer@4.10.2)(webpack@5.98.0)) + nwsapi@2.2.18: {} nx@20.5.0(@swc/core@1.11.11(@swc/helpers@0.5.15)): @@ -18860,7 +19177,7 @@ snapshots: pinpoint@1.1.0: {} - pirates@4.0.6: {} + pirates@4.0.7: {} pkg-dir@3.0.0: dependencies: @@ -19983,7 +20300,7 @@ snapshots: glob: 10.4.5 lines-and-columns: 1.2.4 mz: 2.7.0 - pirates: 4.0.6 + pirates: 4.0.7 ts-interface-checker: 0.1.13 supports-color@3.2.3: @@ -20011,9 +20328,9 @@ snapshots: symbol-tree@3.2.4: {} - synckit@0.11.2: + synckit@0.11.3: dependencies: - '@pkgr/core': 0.2.0 + '@pkgr/core': 0.2.1 tslib: 2.8.1 synckit@0.9.2: @@ -20464,13 +20781,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@3.1.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): + vite-node@3.1.1(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): dependencies: cac: 6.7.14 debug: 4.4.0(supports-color@8.1.1) es-module-lexer: 1.6.0 pathe: 2.0.3 - vite: 6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@types/node' - jiti @@ -20485,7 +20802,7 @@ snapshots: - tsx - yaml - vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): + vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): dependencies: esbuild: 0.25.1 postcss: 8.5.3 @@ -20493,14 +20810,15 @@ snapshots: optionalDependencies: '@types/node': 20.17.30 fsevents: 2.3.3 + lightningcss: 1.29.3 terser: 5.39.0 tsx: 4.19.3 yaml: 2.7.0 - vitest@3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): + vitest@3.1.1(@types/debug@4.1.12)(@types/node@20.17.30)(@vitest/browser@3.1.1)(@vitest/ui@3.1.1)(jsdom@26.0.0)(lightningcss@1.29.3)(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0): dependencies: '@vitest/expect': 3.1.1 - '@vitest/mocker': 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) + '@vitest/mocker': 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0)) '@vitest/pretty-format': 3.1.1 '@vitest/runner': 3.1.1 '@vitest/snapshot': 3.1.1 @@ -20516,13 +20834,13 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) - vite-node: 3.1.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite: 6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) + vite-node: 3.1.1(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 '@types/node': 20.17.30 - '@vitest/browser': 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(playwright@1.51.1)(vite@6.2.1(@types/node@20.17.30)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1) + '@vitest/browser': 3.1.1(msw@2.7.3(@types/node@20.17.30)(typescript@5.8.3))(playwright@1.51.1)(vite@6.2.4(@types/node@20.17.30)(lightningcss@1.29.3)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.1.1) '@vitest/ui': 3.1.1(vitest@3.1.1) jsdom: 26.0.0 transitivePeerDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7329626c6a3cf..3c78dd2b9e428 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,6 +2,8 @@ packages: - packages/* - docs - test + - test/e2e + - test/regressions - test/performance-charts ignoredBuiltDependencies: - '@mui/monorepo' diff --git a/scripts/build.mjs b/scripts/build.mjs index 7d88074132c52..4bc1d477b3a44 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -95,17 +95,16 @@ async function run(argv) { ...getVersionEnvVariables(packageJson), }; + // prettier-ignore const babelArgs = [ - '--config-file', - babelConfigPath, - '--extensions', - `"${extensions.join(',')}"`, + '--config-file', babelConfigPath, + '--extensions', `"${extensions.join(',')}"`, srcDir, - '--out-dir', - outDir, - '--ignore', + '--out-dir', outDir, // Need to put these patterns in quotes otherwise they might be evaluated by the used terminal. - `"${ignore.join('","')}"`, + '--ignore', `"${ignore.join('","')}"`, + '--copy-files', + '--no-copy-ignored', ]; if (outFileExtension !== '.js') { diff --git a/scripts/utils.mjs b/scripts/utils.mjs index 7a62fe6c4ad05..414a9e889748f 100644 --- a/scripts/utils.mjs +++ b/scripts/utils.mjs @@ -1,12 +1,10 @@ import path from 'path'; -import url from 'url'; /** * Returns the full path of the root directory of this repository. */ // eslint-disable-next-line import/prefer-default-export export function getWorkspaceRoot() { - const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); - const workspaceRoot = path.resolve(currentDirectory, '..'); + const workspaceRoot = path.resolve(import.meta.dirname, '..'); return workspaceRoot; } diff --git a/test/e2e/.mocharc.js b/test/e2e/.mocharc.js index 5f5eed680baeb..14094e0ba9981 100644 --- a/test/e2e/.mocharc.js +++ b/test/e2e/.mocharc.js @@ -1,8 +1,8 @@ -module.exports = { +export default { extension: ['js', 'ts', 'tsx'], recursive: true, slow: 500, - timeout: (process.env.CIRCLECI === 'true' ? 5 : 2) * 1000, // Circle CI has low-performance CPUs. + timeout: (process.env.CIRCLECI === 'true' ? 8 : 4) * 1000, // Circle CI has low-performance CPUs. + require: 'tsx', reporter: 'dot', - require: [require.resolve('../utils/setupBabel')], }; diff --git a/test/e2e/TestViewer.js b/test/e2e/TestViewer.jsx similarity index 83% rename from test/e2e/TestViewer.js rename to test/e2e/TestViewer.jsx index 785f62db79be7..2de6bb7f62e41 100644 --- a/test/e2e/TestViewer.js +++ b/test/e2e/TestViewer.jsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; function TestViewer(props) { const { children } = props; @@ -18,8 +17,4 @@ function TestViewer(props) { ); } -TestViewer.propTypes = { - children: PropTypes.node.isRequired, -}; - export default TestViewer; diff --git a/test/e2e/template.html b/test/e2e/index.html similarity index 85% rename from test/e2e/template.html rename to test/e2e/index.html index fe0f2392e57c0..94160939498ce 100644 --- a/test/e2e/template.html +++ b/test/e2e/index.html @@ -12,5 +12,6 @@
+ diff --git a/test/e2e/index.test.ts b/test/e2e/index.test.ts index 8141c2611f047..f7c965da92426 100644 --- a/test/e2e/index.test.ts +++ b/test/e2e/index.test.ts @@ -4,14 +4,14 @@ import { chromium, webkit, firefox, - Page, - Browser, - BrowserContext, devices, - BrowserContextOptions, - BrowserType, - WebError, - Locator, + type Page, + type Browser, + type BrowserContext, + type BrowserContextOptions, + type BrowserType, + type WebError, + type Locator, } from '@playwright/test'; import { pickersSectionListClasses } from '@mui/x-date-pickers/PickersSectionList'; @@ -109,7 +109,7 @@ async function initializeEnvironment( ...contextOptions, }); // Circle CI has low-performance CPUs. - context.setDefaultTimeout((process.env.CIRCLECI === 'true' ? 4 : 2) * 1000); + context.setDefaultTimeout((process.env.CIRCLECI === 'true' ? 8 : 4) * 1000); page = await context.newPage(); // taken from: https://github.com/microsoft/playwright/issues/6347#issuecomment-1085850728 // Update the Date accordingly in your test pages diff --git a/test/e2e/index.tsx b/test/e2e/index.tsx index 960e48b0e407d..b0b8f00497c4b 100644 --- a/test/e2e/index.tsx +++ b/test/e2e/index.tsx @@ -13,24 +13,23 @@ interface Fixture { const fixtures: Fixture[] = []; // @ts-ignore -const requireFixtures = require.context('./fixtures', true, /\.(js|ts|tsx)$/); -requireFixtures.keys().forEach((path: string) => { - // require.context contains paths for module alias imports and relative imports - if (!path.startsWith('.')) { - return; - } +const fixturesImports = import.meta.glob('./fixtures/**/*', { eager: true }); +Object.keys(fixturesImports).forEach((path: string) => { const [suite, name] = path - .replace('./', '') + .replace('./fixtures/', '') .replace(/\.\w+$/, '') .split('/'); + fixtures.push({ path, suite: `e2e/${suite}`, name, - Component: requireFixtures(path).default, + Component: fixturesImports[path].default, }); }); +ReactDOM.createRoot(document.getElementById('react-root')!).render(); + function App() { function computeIsDev() { if (window.location.hash === '#dev') { @@ -126,5 +125,3 @@ function App() { ); } - -ReactDOM.createRoot(document.getElementById('react-root')!).render(); diff --git a/test/e2e/package.json b/test/e2e/package.json new file mode 100644 index 0000000000000..e3e9dc56fc731 --- /dev/null +++ b/test/e2e/package.json @@ -0,0 +1,42 @@ +{ + "name": "@mui-x-internal/test-e2e", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "start": "cross-env NODE_ENV=production pnpm build && concurrently --success first --kill-others \"pnpm run mocha\" \"pnpm run server\"", + "build": "cross-env TEST_BUILD=true vite build", + "dev": "concurrently \"pnpm run build --watch\" \"pnpm run server\"", + "mocha": "mocha --config .mocharc.js --timeout 8000 '**/*.test.{js,ts,tsx}'", + "server": "serve . -p 5001" + }, + "devDependencies": { + "@babel/runtime": "^7.27.0", + "@mui/x-charts": "workspace:*", + "@mui/x-charts-pro": "workspace:*", + "@mui/x-charts-vendor": "workspace:*", + "@mui/x-data-grid": "workspace:*", + "@mui/x-data-grid-generator": "workspace:^", + "@mui/x-data-grid-premium": "workspace:^", + "@mui/x-data-grid-pro": "workspace:*", + "@mui/x-date-pickers": "workspace:*", + "@mui/x-date-pickers-pro": "workspace:*", + "@mui/x-internals": "workspace:^", + "@mui/x-license": "workspace:*", + "@playwright/test": "^1.51.0", + "@types/chai": "^4.3.20", + "@types/karma": "^6.3.9", + "@types/moment-jalaali": "^0.7.9", + "@types/react": "^19.0.10", + "@types/react-router": "^5.1.20", + "@types/semver": "^7.5.8", + "@vitejs/plugin-react": "^4.3.4", + "chai": "^4.5.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router": "^7.3.0", + "react-transition-group": "^4.4.5", + "tsx": "^4.19.3", + "vite": "^6.2.2" + } +} diff --git a/test/e2e/vite.config.js b/test/e2e/vite.config.js new file mode 100644 index 0000000000000..53832c993ab5f --- /dev/null +++ b/test/e2e/vite.config.js @@ -0,0 +1,20 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + build: { + outDir: 'build', + }, + plugins: [ + react(), + { + name: 'replace-code', + enforce: 'post', + async transform(code) { + return code + .replaceAll('__RELEASE_INFO__', 'MTU5NjMxOTIwMDAwMA==') // 2020-08-02 + .replaceAll('DISABLE_CHANCE_RANDOM', 'true'); + }, + }, + ], +}); diff --git a/test/e2e/webpack.config.js b/test/e2e/webpack.config.js deleted file mode 100644 index bd784da19e5c0..0000000000000 --- a/test/e2e/webpack.config.js +++ /dev/null @@ -1,35 +0,0 @@ -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const path = require('path'); -const webpackBaseConfig = require('../../webpackBaseConfig'); - -module.exports = { - ...webpackBaseConfig, - entry: path.resolve(__dirname, 'index.tsx'), - mode: process.env.NODE_ENV || 'development', - optimization: { - // Helps debugging and build perf. - // Bundle size is irrelevant for local serving - minimize: false, - }, - output: { - path: path.resolve(__dirname, './build'), - publicPath: '/', - filename: 'tests.js', - }, - plugins: [ - new HtmlWebpackPlugin({ - template: path.resolve(__dirname, './template.html'), - }), - ], - module: { - ...webpackBaseConfig.module, - rules: webpackBaseConfig.module.rules.concat([ - { - test: /\.(jpg|gif|png)$/, - loader: 'url-loader', - }, - ]), - }, - // TODO: 'browserslist:modern' - target: 'web', -}; diff --git a/test/karma.conf.js b/test/karma.conf.js index 7b4516a71b7e6..ab77c1c7492f3 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -79,6 +79,10 @@ module.exports = function setKarmaConfig(config) { loader: 'babel-loader', exclude: /node_modules\/.*\/node_modules\/(?!@mui\/monorepo)/, }, + { + test: /\.css$/, + loader: 'null-loader', + }, ], }, resolve: { diff --git a/test/regressions/.mocharc.js b/test/regressions/.mocharc.js index d58ff938cb98f..eb94534547252 100644 --- a/test/regressions/.mocharc.js +++ b/test/regressions/.mocharc.js @@ -1,7 +1,7 @@ -module.exports = { +export default { extension: ['js', 'ts', 'tsx'], recursive: true, slow: 500, timeout: (process.env.CIRCLECI === 'true' ? 5 : 2) * 1000, // Circle CI has low-performance CPUs. - require: [require.resolve('../utils/setupBabel')], + require: 'tsx', }; diff --git a/test/regressions/TestViewer.js b/test/regressions/TestViewer.tsx similarity index 67% rename from test/regressions/TestViewer.js rename to test/regressions/TestViewer.tsx index 8c8da8e05d4d5..e22b445427a41 100644 --- a/test/regressions/TestViewer.js +++ b/test/regressions/TestViewer.tsx @@ -1,66 +1,95 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; +import { useLocation } from 'react-router'; import { styled } from '@mui/material/styles'; import GlobalStyles from '@mui/material/GlobalStyles'; -import { useLocation } from 'react-router'; -import { useFakeTimers } from 'sinon'; +import { fakeClock, setupFakeClock } from '../utils/setupFakeClock'; // eslint-disable-line const StyledBox = styled('div', { shouldForwardProp: (prop) => prop !== 'isDataGridTest' && prop !== 'isDataGridPivotTest', -})(({ theme, isDataGridTest, isDataGridPivotTest }) => ({ - backgroundColor: theme.palette.background.default, - display: 'flex', - padding: theme.spacing(1), - justifyContent: 'center', - ...(isDataGridTest && { - width: isDataGridPivotTest ? 800 : 500, - minHeight: 400, - // Workaround the min-height limitation - '& .grid-container': { - position: 'relative', - '& > .MuiDataGrid-root': { - position: 'absolute', - top: 0, - right: 0, - left: 0, - bottom: 0, +})<{ isDataGridTest?: boolean; isDataGridPivotTest?: boolean }>( + ({ theme, isDataGridTest, isDataGridPivotTest }) => ({ + backgroundColor: theme.palette.background.default, + display: 'flex', + padding: theme.spacing(1), + justifyContent: 'center', + ...(isDataGridTest && { + width: isDataGridPivotTest ? 800 : 500, + minHeight: 400, + // Workaround the min-height limitation + '& .grid-container': { + position: 'relative', + '& > .MuiDataGrid-root': { + position: 'absolute', + top: 0, + right: 0, + left: 0, + bottom: 0, + }, }, - }, + }), }), -})); +); -let clock; +function TestViewer(props: any) { + const { children, isDataGridTest, isDataGridPivotTest, path } = props; -function MockTime(props) { + return ( + + + + + {children} + + + + ); +} + +function MockTime(props: any) { const [ready, setReady] = React.useState(false); React.useEffect(() => { - // Use a "real timestamp" so that we see a useful date instead of "00:00" - // eslint-disable-next-line react-hooks/rules-of-hooks -- not a React hook - clock = useFakeTimers({ - now: new Date('Mon Aug 18 14:11:54 2014 -0500').getTime(), - // We need to let time advance to use `useDemoData`, but on the pickers test it makes the tests flaky - shouldAdvanceTime: props.isDataGridTest, - shouldClearNativeTimers: true, - }); + const dispose = setupFakeClock(props.isDataGridTest); setReady(true); - - return () => { - clock.restore(); - }; + return dispose; }, [props.isDataGridTest]); return ready ? props.children : null; } -MockTime.propTypes = { - children: PropTypes.node.isRequired, - isDataGridTest: PropTypes.bool, -}; - -function LoadFont(props) { +function LoadFont(props: any) { const { children, ...other } = props; const location = useLocation(); + // We're simulating `act(() => ReactDOM.render(children))` // In the end children passive effects should've been flushed. // React doesn't have any such guarantee outside of `act()` so we're approximating it. @@ -69,7 +98,7 @@ function LoadFont(props) { // In react-router v6, with multiple routes sharing the same element, // this effect will only run once if no dependency is passed. React.useEffect(() => { - function handleFontsEvent(event) { + function handleFontsEvent(event: any) { if (event.type === 'loading') { setReady(false); } else if (event.type === 'loadingdone') { @@ -85,7 +114,7 @@ function LoadFont(props) { document.fonts.addEventListener('loadingdone', handleFontsEvent); // and wait `load-css` timeouts to be flushed - clock.runToLast(); + fakeClock?.runToLast(); // In case the child triggered font fetching we're not ready yet. // The fonts event handler will mark the test as ready on `loadingdone` @@ -106,59 +135,4 @@ function LoadFont(props) { ); } -LoadFont.propTypes = { - children: PropTypes.node.isRequired, -}; - -function TestViewer(props) { - const { children, isDataGridTest, isDataGridPivotTest, path } = props; - - return ( - - - - - {children} - - - - ); -} - -TestViewer.propTypes = { - children: PropTypes.node.isRequired, - isDataGridPivotTest: PropTypes.bool.isRequired, - isDataGridTest: PropTypes.bool.isRequired, - path: PropTypes.string.isRequired, -}; - export default TestViewer; diff --git a/test/regressions/template.html b/test/regressions/index.html similarity index 89% rename from test/regressions/template.html rename to test/regressions/index.html index 758782822fd2c..b3e9fea3db04f 100644 --- a/test/regressions/template.html +++ b/test/regressions/index.html @@ -16,5 +16,6 @@
+ diff --git a/test/regressions/index.test.ts b/test/regressions/index.test.ts index 6f2ba1eb3ca96..ee33d0cab7349 100644 --- a/test/regressions/index.test.ts +++ b/test/regressions/index.test.ts @@ -3,16 +3,10 @@ import { expect } from 'chai'; import * as path from 'path'; import * as childProcess from 'child_process'; import { chromium } from '@playwright/test'; -import materialPackageJson from '@mui/material/package.json'; +import { major } from '@mui/material/version'; -function sleep(timeoutMS: number | undefined) { - return new Promise((resolve) => { - setTimeout(resolve, timeoutMS); - }); -} - -const isMaterialUIv6 = materialPackageJson.version.startsWith('6.'); -const isMaterialUIv7 = materialPackageJson.version.startsWith('7.'); +const isMaterialUIv6 = major === 6; +const isMaterialUIv7 = major === 7; // Tests that need a longer timeout. const timeSensitiveSuites = [ @@ -28,43 +22,11 @@ const timeSensitiveSuites = [ 'RowSpanningCalendar', ]; -const isConsoleWarningIgnored = (msg?: string) => { - const isMuiV6Error = - isMaterialUIv6 && - msg?.startsWith( - 'MUI: The Experimental_CssVarsProvider component has been ported into ThemeProvider.', - ); - - const isMuiLoadingButtonWarning = - (isMaterialUIv6 || isMaterialUIv7) && - msg?.includes( - 'MUI: The LoadingButton component functionality is now part of the Button component from Material UI.', - ); - - const isReactRouterFlagsError = msg?.includes('React Router Future Flag Warning'); - - const isNoDevRoute = msg?.includes('No routes matched location "/#no-dev"'); - - // We use the Tailwind CDN in iframed docs demos to isolate the library and avoid having to bundle it. - const isTailwindCdnWarning = msg?.includes( - 'The browser build of Tailwind CSS should not be used in production.', - ); - - if ( - isMuiV6Error || - isReactRouterFlagsError || - isNoDevRoute || - isTailwindCdnWarning || - isMuiLoadingButtonWarning - ) { - return true; - } - return false; -}; +await main(); async function main() { const baseUrl = 'http://localhost:5001'; - const screenshotDir = path.resolve(__dirname, './screenshots/chrome'); + const screenshotDir = path.resolve(import.meta.dirname, './screenshots/chrome'); const browser = await chromium.launch({ args: [ @@ -125,6 +87,7 @@ async function main() { async function navigateToTest(route: string) { // Use client-side routing which is much faster than full page navigation via page.goto(). + await page.waitForFunction(() => window.muiFixture.isReady()); return page.evaluate((_route) => { window.muiFixture.navigate(`${_route}#no-dev`); }, route); @@ -158,7 +121,7 @@ async function main() { this.timeout(0); } - if (route === '/docs-components-data-grid-overview/DataGridProDemo') { + if (route.includes('DataGridProDemo')) { this.timeout(6000); } @@ -305,13 +268,44 @@ async function main() { // }); // }); }); +} + +function isConsoleWarningIgnored(msg?: string) { + const isMuiV6Error = + isMaterialUIv6 && + msg?.startsWith( + 'MUI: The Experimental_CssVarsProvider component has been ported into ThemeProvider.', + ); - run(); + const isMuiLoadingButtonWarning = + (isMaterialUIv6 || isMaterialUIv7) && + msg?.includes( + 'MUI: The LoadingButton component functionality is now part of the Button component from Material UI.', + ); + + const isReactRouterFlagsError = msg?.includes('React Router Future Flag Warning'); + + const isNoDevRoute = msg?.includes('No routes matched location "/#no-dev"'); + + // We use the Tailwind CDN in iframed docs demos to isolate the library and avoid having to bundle it. + const isTailwindCdnWarning = msg?.includes( + 'The browser build of Tailwind CSS should not be used in production.', + ); + + if ( + isMuiV6Error || + isReactRouterFlagsError || + isNoDevRoute || + isTailwindCdnWarning || + isMuiLoadingButtonWarning + ) { + return true; + } + return false; } -main().catch((error) => { - // error during setup. - // Throwing lets mocha hang. - console.error(error); - process.exitCode = 1; -}); +function sleep(timeoutMS: number | undefined) { + return new Promise((resolve) => { + setTimeout(resolve, timeoutMS); + }); +} diff --git a/test/regressions/index.tsx b/test/regressions/index.tsx index 2442ecff82ba1..c224ce9c2f0da 100644 --- a/test/regressions/index.tsx +++ b/test/regressions/index.tsx @@ -1,12 +1,13 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom/client'; import { createBrowserRouter, RouterProvider, Outlet, NavLink, useNavigate } from 'react-router'; -import TestViewer from 'test/regressions/TestViewer'; -import { useFakeTimers } from 'sinon'; import { Globals } from '@react-spring/web'; -import { setupTestLicenseKey } from '../utils/testLicense'; +import { setupFakeClock, restoreFakeClock } from '../utils/setupFakeClock'; // eslint-disable-line +import { generateTestLicenseKey, setupTestLicenseKey } from '../utils/testLicense'; // eslint-disable-line +import TestViewer from './TestViewer'; +import type { Test } from './testsBySuite'; -setupTestLicenseKey(); +setupTestLicenseKey(generateTestLicenseKey(new Date('2099-01-01'))); Globals.assign({ skipAnimation: true, @@ -15,164 +16,31 @@ Globals.assign({ declare global { interface Window { muiFixture: { - navigate: ReturnType; + isReady: () => boolean; + navigate: (test: string) => void; }; } } window.muiFixture = { + isReady: () => false, navigate: () => { throw new Error(`muiFixture.navigate is not ready`); }, }; -const blacklist = [ - /^docs-(.*)(?<=NoSnap)\.png$/, // Excludes demos that we don't want - /^docs-data-grid-custom-columns-cell-renderers\/(.*)\.png$/, // Custom components used to build docs pages - 'docs-data-grid-filtering/RemoveBuiltInOperators.png', // Needs interaction - 'docs-data-grid-filtering/CustomRatingOperator.png', // Needs interaction - 'docs-data-grid-filtering/CustomInputComponent.png', // Needs interaction - /^docs-charts-tooltip\/(.*).png/, // Needs interaction - 'docs-date-pickers-date-calendar/DateCalendarServerRequest.png', // Has random behavior (TODO: Use seeded random) - // 'docs-system-typography', -]; - -const unusedBlacklistPatterns = new Set(blacklist); - -// Use a "real timestamp" so that we see a useful date instead of "00:00" -// eslint-disable-next-line react-hooks/rules-of-hooks -- not a React hook -const clock = useFakeTimers(new Date('Mon Aug 18 14:11:54 2014 -0500')); - -function excludeTest(suite: string, name: string) { - return blacklist.some((pattern) => { - if (typeof pattern === 'string') { - if (pattern === suite) { - unusedBlacklistPatterns.delete(pattern); - - return true; - } - if (pattern === `${suite}/${name}.png`) { - unusedBlacklistPatterns.delete(pattern); - - return true; - } - - return false; - } - - // assume regex - if (pattern.test(`${suite}/${name}.png`)) { - unusedBlacklistPatterns.delete(pattern); - return true; - } - return false; - }); -} - -interface Test { - path: string; - suite: string; - name: string; - case: React.ComponentType; -} - -const tests: Test[] = []; - -// Also use some of the demos to avoid code duplication. -// @ts-ignore -const requireDocs = require.context('docsx/data', true, /\.js$/); -requireDocs.keys().forEach((path: string) => { - const [name, ...suiteArray] = path.replace('./', '').replace('.js', '').split('/').reverse(); - const suite = `docs-${suiteArray.reverse().join('-')}`; - - if (excludeTest(suite, name)) { - return; - } - - // TODO: Why does webpack include a key for the absolute and relative path? - // We just want the relative path - if (!path.startsWith('./')) { - return; - } +let testsBySuite: typeof import('./testsBySuite').testsBySuite; - if (requireDocs(path).default === undefined) { - return; - } +main(); - tests.push({ - path, - suite, - name, - case: requireDocs(path).default, - }); -}); - -// @ts-ignore -const requireRegressions = require.context('./data-grid', true, /\.js$/); -requireRegressions.keys().forEach((path: string) => { - // "./DataGridRTLVirtualization.js" - // "test/regressions/data-grid/DataGridRTLVirtualization.js" - if (!path.startsWith('./')) { - return; - } +async function main() { + setupFakeClock(); - const name = path.replace('./', '').replace('.js', ''); - const suite = `test-regressions-data-grid`; + testsBySuite = (await import('./testsBySuite')).testsBySuite; - tests.push({ - path, - suite, - name, - case: requireRegressions(path).default, - }); -}); - -clock.restore(); - -if (unusedBlacklistPatterns.size > 0) { - console.warn( - [ - 'The following patterns are unused:', - ...Array.from(unusedBlacklistPatterns).map((pattern) => `- ${pattern}`), - ].join('\n'), - ); -} - -const suiteTestsMap = tests.reduce( - (acc, test) => { - if (!acc[test.suite]) { - acc[test.suite] = []; - } - acc[test.suite].push(test); - return acc; - }, - {} as Record, -); - -function useHash() { - const subscribe = React.useCallback((callback: any) => { - window.addEventListener('hashchange', callback); - return () => { - window.removeEventListener('hashchange', callback); - }; - }, []); - const getSnapshot = React.useCallback(() => window.location.hash, []); - const getServerSnapshot = React.useCallback(() => '', []); - return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); -} - -function computeIsDev(hash: string) { - if (hash === '#dev') { - return true; - } - if (hash === '#no-dev') { - return false; - } - return process.env.NODE_ENV === 'development'; -} + restoreFakeClock(); -function computePath(test: Test) { - return `/${test.suite}/${test.name}`; + ReactDOM.createRoot(document.getElementById('react-root')!).render(); } function Root() { @@ -182,6 +50,7 @@ function Root() { const navigate = useNavigate(); React.useEffect(() => { window.muiFixture.navigate = navigate; + window.muiFixture.isReady = () => true; }, [navigate]); return ( @@ -198,14 +67,18 @@ function Root() { nav for all tests @@ -220,13 +93,13 @@ function App() { { path: '/', element: , - children: Object.keys(suiteTestsMap).map((suite) => { + children: Object.keys(testsBySuite).map((suite) => { const isDataGridTest = suite.indexOf('docs-data-grid') === 0 || suite === 'test-regressions-data-grid'; const isDataGridPivotTest = isDataGridTest && suite.startsWith('docs-data-grid-pivoting'); return { path: suite, - children: suiteTestsMap[suite].map((test) => ({ + children: testsBySuite[suite].map((test) => ({ path: test.name, element: ( ; } -ReactDOM.createRoot(document.getElementById('react-root')!).render(); +function useHash() { + const subscribe = React.useCallback((callback: any) => { + window.addEventListener('hashchange', callback); + return () => { + window.removeEventListener('hashchange', callback); + }; + }, []); + const getSnapshot = React.useCallback(() => window.location.hash, []); + const getServerSnapshot = React.useCallback(() => '', []); + return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); +} + +function computeIsDev(hash: string) { + if (hash === '#dev') { + return true; + } + if (hash === '#no-dev') { + return false; + } + return process.env.NODE_ENV === 'development'; +} + +function computePath(test: Test) { + return `/${test.suite}/${test.name}`; +} diff --git a/test/regressions/package.json b/test/regressions/package.json new file mode 100644 index 0000000000000..763118fa4e244 --- /dev/null +++ b/test/regressions/package.json @@ -0,0 +1,44 @@ +{ + "name": "@mui-x-internal/test-regressions", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "start": "cross-env NODE_ENV=production pnpm build && concurrently --success first --kill-others \"pnpm run mocha\" \"pnpm run server\"", + "build": "cross-env TEST_BUILD=true vite build", + "dev": "concurrently \"pnpm run build --watch\" \"pnpm run server\"", + "mocha": "mocha --config .mocharc.js '**/*.test.{js,ts,tsx}'", + "server": "serve . -p 5001" + }, + "devDependencies": { + "@babel/runtime": "^7.27.0", + "@mui/x-charts": "workspace:*", + "@mui/x-charts-pro": "workspace:*", + "@mui/x-charts-vendor": "workspace:*", + "@mui/x-data-grid": "workspace:*", + "@mui/x-data-grid-generator": "workspace:^", + "@mui/x-data-grid-premium": "workspace:^", + "@mui/x-data-grid-pro": "workspace:*", + "@mui/x-date-pickers": "workspace:*", + "@mui/x-date-pickers-pro": "workspace:*", + "@mui/x-internals": "workspace:^", + "@mui/x-license": "workspace:*", + "@mui/x-tree-view": "workspace:*", + "@mui/x-tree-view-pro": "workspace:*", + "@playwright/test": "^1.51.0", + "@types/chai": "^4.3.20", + "@types/karma": "^6.3.9", + "@types/moment-jalaali": "^0.7.9", + "@types/react": "^19.0.10", + "@types/react-router": "^5.1.20", + "@types/semver": "^7.5.8", + "@vitejs/plugin-react": "^4.3.4", + "chai": "^4.5.0", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router": "^7.3.0", + "react-transition-group": "^4.4.5", + "tsx": "^4.19.3", + "vite": "^6.2.2" + } +} diff --git a/test/regressions/testsBySuite.ts b/test/regressions/testsBySuite.ts new file mode 100644 index 0000000000000..98c90f7af72ba --- /dev/null +++ b/test/regressions/testsBySuite.ts @@ -0,0 +1,73 @@ +export interface Test { + path: string; + suite: string; + name: string; + case: React.ComponentType; +} + +const tests: Test[] = []; + +// Also use some of the demos to avoid code duplication. +// @ts-ignore +const docsImports = import.meta.glob( + [ + 'docsx/data/**/[A-Z]*.js', + // Hooks examples + 'docsx/data/**/use[A-Z]*.js', + // ================== Exclusions ================== + '!docsx/data/charts/lines/GDPperCapita.js', + '!docsx/data/data-grid/list-view/components/*.js', + // Excludes demos that we don't want + '!docsx/data/**/*NoSnap.*', + '!docsx/data/data-grid/filtering/RemoveBuiltInOperators', // Needs interaction + '!docsx/data/data-grid/filtering/CustomRatingOperator', // Needs interaction + '!docsx/data/data-grid/filtering/CustomInputComponent', // Needs interaction + '!docsx/data/date-pickers/date-calendar/DateCalendarServerRequest', // Has random behavior (TODO: Use seeded random) + '!docsx/data/charts/tooltip/*', // Needs interaction + ], + { eager: true }, +); +Object.keys(docsImports).forEach((path: string) => { + const [name, ...suiteArray] = path + .replace('../../docs/data/', '') + .replace('.js', '') + .split('/') + .reverse(); + const suite = `docs-${suiteArray.reverse().join('-')}`; + + if (docsImports[path].default === undefined) { + return; + } + + tests.push({ + path, + suite, + name, + case: docsImports[path].default, + }); +}); + +// @ts-ignore +const regressionsImports = import.meta.glob('./data-grid/**/*.js', { eager: true }); +Object.keys(regressionsImports).forEach((path: string) => { + const name = path.replace('./data-grid/', '').replace('.js', ''); + const suite = `test-regressions-data-grid`; + + tests.push({ + path, + suite, + name, + case: regressionsImports[path].default, + }); +}); + +export const testsBySuite = tests.reduce( + (acc, test) => { + if (!acc[test.suite]) { + acc[test.suite] = []; + } + acc[test.suite].push(test); + return acc; + }, + {} as Record, +); diff --git a/test/regressions/vite.config.js b/test/regressions/vite.config.js new file mode 100644 index 0000000000000..4891bbc61f858 --- /dev/null +++ b/test/regressions/vite.config.js @@ -0,0 +1,49 @@ +import path from 'path'; +import { defineConfig, transformWithEsbuild } from 'vite'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + build: { + outDir: 'build', + }, + loader: { + '.js': 'jsx', + }, + resolve: { + alias: { + '@mui/docs': path.resolve( + import.meta.dirname, + '../../node_modules/@mui/monorepo/packages/mui-docs/src', + ), + docsx: path.resolve(import.meta.dirname, '../../docs'), + }, + }, + worker: { + format: 'es', + }, + plugins: [ + react(), + { + name: 'replace-code', + enforce: 'post', + async transform(code) { + return code + .replaceAll('__RELEASE_INFO__', 'MTU5NjMxOTIwMDAwMA==') // 2020-08-02 + .replaceAll('DISABLE_CHANCE_RANDOM', 'true'); + }, + }, + { + name: 'js-files-as-jsx', + enforce: 'pre', + async transform(code, id) { + if (!id.match(/.*\.js$/)) { + return null; + } + return transformWithEsbuild(code, id, { + loader: 'jsx', + jsx: 'automatic', + }); + }, + }, + ], +}); diff --git a/test/regressions/webpack.config.js b/test/regressions/webpack.config.js deleted file mode 100644 index e9a4eade765c2..0000000000000 --- a/test/regressions/webpack.config.js +++ /dev/null @@ -1,63 +0,0 @@ -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const path = require('path'); -const webpack = require('webpack'); -const webpackBaseConfig = require('../../webpackBaseConfig'); - -module.exports = { - ...webpackBaseConfig, - entry: path.resolve(__dirname, 'index.tsx'), - mode: process.env.NODE_ENV || 'development', - optimization: { - // Helps debugging and build perf. - // Bundle size is irrelevant for local serving - minimize: false, - }, - output: { - path: path.resolve(__dirname, './build'), - publicPath: '/', - filename: 'tests.js', - }, - plugins: [ - new HtmlWebpackPlugin({ - template: path.resolve(__dirname, './template.html'), - }), - new webpack.DefinePlugin({ - DISABLE_CHANCE_RANDOM: JSON.stringify(true), - }), - new webpack.ProvidePlugin({ - // required by code accessing `process.env` in the browser - process: 'process/browser.js', - }), - ], - module: { - ...webpackBaseConfig.module, - rules: webpackBaseConfig.module.rules.concat([ - { - test: /\.(jpg|gif|png)$/, - loader: 'url-loader', - }, - { - test: /\.css$/i, - use: ['style-loader', 'css-loader'], - }, - ]), - }, - resolve: { - ...webpackBaseConfig.resolve, - fallback: { - // Exclude polyfill and treat 'fs' as an empty module since it is not required. next -> gzip-size relies on it. - fs: false, - // Exclude polyfill and treat 'stream' as an empty module since it is not required. next -> gzip-size relies on it. - stream: false, - // Exclude polyfill and treat 'zlib' as an empty module since it is not required. next -> gzip-size relies on it. - zlib: false, - }, - alias: { - ...webpackBaseConfig.resolve.alias, - docs: false, // Disable this alias as it creates a circular resolution loop with the docsx alias - }, - }, - // TODO: 'browserslist:modern' - // See https://github.com/webpack/webpack/issues/14203 - target: 'web', -}; diff --git a/test/utils/ignoreCSS.js b/test/utils/ignoreCSS.js new file mode 100644 index 0000000000000..02119b01f0859 --- /dev/null +++ b/test/utils/ignoreCSS.js @@ -0,0 +1,6 @@ +function ignore() { + return null; +} + +require.extensions['.css'] = ignore; +require.extensions['.scss'] = ignore; diff --git a/test/utils/mochaHooks.js b/test/utils/mochaHooks.js index 5c37886ca4e36..f174088d7bc22 100644 --- a/test/utils/mochaHooks.js +++ b/test/utils/mochaHooks.js @@ -21,6 +21,14 @@ export function createXMochaHooks(coreMochaHooks = {}) { licenseKey = generateTestLicenseKey(); }); + // In Node.js>20: window.navigator !== navigator + mochaHooks.beforeAll.push(function func() { + Object.defineProperty(globalThis, 'navigator', { + value: globalThis.window.navigator, + configurable: false, + }); + }); + mochaHooks.beforeEach.push(function setupCommon() { setupTestLicenseKey(licenseKey); // disable "react-transition-group" transitions diff --git a/test/utils/setupFakeClock.ts b/test/utils/setupFakeClock.ts new file mode 100644 index 0000000000000..a59a6c85f26fb --- /dev/null +++ b/test/utils/setupFakeClock.ts @@ -0,0 +1,37 @@ +import { useFakeTimers } from 'sinon'; + +declare global { + interface Window { + fakeClock: any; + } +} + +// Use a "real timestamp" so that we see a useful date instead of "00:00" +const DEFAULT_TIMESTAMP = 'Mon Aug 18 14:11:54 2014 -0500'; + +// eslint-disable-next-line import/no-mutable-exports +export let fakeClock: ReturnType | undefined; + +setupFakeClock(); + +export function setupFakeClock(shouldAdvanceTime = true) { + restoreFakeClock(); + + // eslint-disable-next-line react-hooks/rules-of-hooks + fakeClock = useFakeTimers({ + now: new Date(DEFAULT_TIMESTAMP).getTime(), + // We need to let time advance to use `useDemoData`, but on the pickers + // test it makes the tests flaky + shouldAdvanceTime, + }); + + return restoreFakeClock; +} + +export function restoreFakeClock() { + if (fakeClock) { + fakeClock.runToLast(); + fakeClock.restore(); + fakeClock = undefined; + } +} diff --git a/test/utils/testLicense.js b/test/utils/testLicense.js index 15e9e679f3111..603ad3201bf6b 100644 --- a/test/utils/testLicense.js +++ b/test/utils/testLicense.js @@ -1,7 +1,6 @@ import { LicenseInfo, generateLicense } from '@mui/x-license'; -export function generateTestLicenseKey() { - const expiryDate = new Date(); +export function generateTestLicenseKey(expiryDate = new Date()) { // Set the expiry date to 1 hour from now just to be on the safe side. // Tests usually take up to 15 minutes to run on CI. expiryDate.setHours(expiryDate.getHours() + 1); diff --git a/tsconfig.dev.json b/tsconfig.dev.json new file mode 100644 index 0000000000000..6929621c9bb3a --- /dev/null +++ b/tsconfig.dev.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "skipLibCheck": true, + "incremental": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] +} diff --git a/tsconfig.prod.json b/tsconfig.prod.json new file mode 100644 index 0000000000000..3af9370874b8f --- /dev/null +++ b/tsconfig.prod.json @@ -0,0 +1,45 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": { + "@mui/x-date-pickers": ["./packages/x-date-pickers/src"], + "@mui/x-date-pickers/*": ["./packages/x-date-pickers/src/*"], + "@mui/x-date-pickers-pro": ["./packages/x-date-pickers-pro/src"], + "@mui/x-date-pickers-pro/*": ["./packages/x-date-pickers-pro/src/*"], + "@mui/x-charts": ["./packages/x-charts/src"], + "@mui/x-charts/*": ["./packages/x-charts/src/*"], + "@mui/x-charts-pro": ["./packages/x-charts-pro/src"], + "@mui/x-charts-pro/*": ["./packages/x-charts-pro/src/*"], + "@mui/x-charts-vendor": ["./packages/x-charts-vendor"], + "@mui/x-charts-vendor/*": ["./packages/x-charts-vendor/*"], + "@mui/x-tree-view": ["./packages/x-tree-view/src"], + "@mui/x-tree-view/*": ["./packages/x-tree-view/src/*"], + "@mui/x-tree-view-pro": ["./packages/x-tree-view-pro/src"], + "@mui/x-tree-view-pro/*": ["./packages/x-tree-view-pro/src/*"], + "@mui/x-license": ["./packages/x-license/src"], + "@mui/x-license/*": ["./packages/x-license/src/*"], + "@mui/x-internals": ["./packages/x-internals/src"], + "@mui/x-internals/*": ["./packages/x-internals/src/*"], + "@mui/x-telemetry": ["./packages/x-telemetry/src"], + "@mui/x-telemetry/*": ["./packages/x-telemetry/src/*"], + "@mui/docs": ["./node_modules/@mui/monorepo/packages/mui-docs/src"], + "@mui/docs/*": ["./node_modules/@mui/monorepo/packages/mui-docs/src/*"], + "@mui-internal/api-docs-builder": ["./node_modules/@mui/monorepo/packages/api-docs-builder"], + "@types/react-docgen": [ + "./node_modules/@mui/monorepo/packages/react-docgen-types/index.d.ts" + ], + "@mui-internal/api-docs-builder/*": [ + "./node_modules/@mui/monorepo/packages/api-docs-builder/*" + ], + "test/*": ["./test/*"], + "docs/*": ["./node_modules/@mui/monorepo/docs/*"], + "docsx/*": ["./docs/*"] + }, + "skipLibCheck": true, + "incremental": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] +}