From 3e2d8b9a06ec76873c1f163e8cb5ad3f7ce4cd9b Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:06:57 +0200 Subject: [PATCH 01/54] [code-infra] Update and fix bundling fixtures --- test/bundling/README.md | 12 +++++------- .../fixtures/create-react-app/package.json | 15 ++++++++------- test/bundling/fixtures/esbuild/package.json | 15 ++++++++------- test/bundling/fixtures/gatsby/package.json | 15 ++++++++------- test/bundling/fixtures/next-webpack4/package.json | 15 ++++++++------- test/bundling/fixtures/next-webpack5/package.json | 15 ++++++++------- test/bundling/fixtures/node-esm/package.json | 15 ++++++++------- test/bundling/fixtures/snowpack/package.json | 15 ++++++++------- test/bundling/fixtures/vite/package.json | 15 ++++++++------- 9 files changed, 69 insertions(+), 63 deletions(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index 497cbb60db0f57..36a77439965f41 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -12,16 +12,14 @@ The created file might need some manual adjustment since not every edge case is 1. Prepare the package.json - to test a Pull Request 1. checkout branch - 1. `pnpm` - 1. `pnpm lerna run build --scope "@mui/*"` - 1. `cd` to fixture + 1. add fixture path to workspaces in `pnpm-workspace.yaml` 1. `pnpm install` - 1. `node ../../scripts/useBuildFromSource.js .` + 1. `pnpm lerna run build --scope "@mui/*"` - to test a published npm dist tag (for example `latest` or `next`) on npm - 1. `cd` to fixture - 1. adjust the dependencies in the package.json accordingly + 1. adjust the dependencies in the package.json accordingly (replace the `workspace:*` specifiers) 1. `pnpm install` -1. `pnpm start` should exit with 0 + 1. `pnpm lerna run build --scope "@mui/*"` +1. `pnpm --filter start` should exit with 0 ### In CI diff --git a/test/bundling/fixtures/create-react-app/package.json b/test/bundling/fixtures/create-react-app/package.json index 70bb49fdc67c2d..76a0cf6c99653b 100644 --- a/test/bundling/fixtures/create-react-app/package.json +++ b/test/bundling/fixtures/create-react-app/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js create-react-app", "start": "pnpm cross-env DISABLE_ESLINT_PLUGIN=true SKIP_PREFLIGHT_CHECK=true react-scripts build && concurrently --success first --kill-others \"pnpm server\" \"node testCreateReactAppIntegration\"", "server": "serve -p 5001 -s build" }, @@ -10,13 +11,13 @@ "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "react": "18.2.0", "react-dom": "18.2.0", "react-scripts": "5.0.1", diff --git a/test/bundling/fixtures/esbuild/package.json b/test/bundling/fixtures/esbuild/package.json index 56ad9bcccb0722..450921dfa5b802 100644 --- a/test/bundling/fixtures/esbuild/package.json +++ b/test/bundling/fixtures/esbuild/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js esbuild", "start": "pnpm build && concurrently --success first --kill-others \"pnpm server\" \"node testEsbuildIntegration\"", "build": "esbuild esbuild.fixture.js --bundle --outfile=build/esbuild.fixture.js", "server": "serve -p 5001 -s build" @@ -11,13 +12,13 @@ "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "esbuild": "0.15.7", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/test/bundling/fixtures/gatsby/package.json b/test/bundling/fixtures/gatsby/package.json index 9797a8561e737b..acfbec6f38beab 100644 --- a/test/bundling/fixtures/gatsby/package.json +++ b/test/bundling/fixtures/gatsby/package.json @@ -3,19 +3,20 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js gatsby", "start": "pnpm gatsby build && concurrently --success first --kill-others \"pnpm gatsby serve\" \"node testGatsbyIntegration\"" }, "dependencies": { "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "gatsby": "4.25.7", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/test/bundling/fixtures/next-webpack4/package.json b/test/bundling/fixtures/next-webpack4/package.json index 8bd8aa61d00744..c40916e58ffb06 100644 --- a/test/bundling/fixtures/next-webpack4/package.json +++ b/test/bundling/fixtures/next-webpack4/package.json @@ -3,19 +3,20 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js next-webpack4", "start": "pnpm next build && concurrently --success first --kill-others \"pnpm next start\" \"node testNextWebpack4Integration\"" }, "dependencies": { "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "next": "11.1.4", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/test/bundling/fixtures/next-webpack5/package.json b/test/bundling/fixtures/next-webpack5/package.json index e5a132011a73ce..e2592a23af9b2c 100644 --- a/test/bundling/fixtures/next-webpack5/package.json +++ b/test/bundling/fixtures/next-webpack5/package.json @@ -3,19 +3,20 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js next-webpack5", "start": "pnpm next build && concurrently --success first --kill-others \"pnpm next start\" \"node testNextWebpack5Integration\"" }, "dependencies": { "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "next": "12.3.0", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/test/bundling/fixtures/node-esm/package.json b/test/bundling/fixtures/node-esm/package.json index 2cc5d58eaeded5..81687365e352be 100644 --- a/test/bundling/fixtures/node-esm/package.json +++ b/test/bundling/fixtures/node-esm/package.json @@ -5,18 +5,19 @@ "type": "module", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js node-esm", "start": "node node-esm.fixture.js" }, "dependencies": { "@emotion/core": "11.0.0", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "5workspace:*", + "@mui/icons-material": "5workspace:*", + "@mui/lab": "5workspace:*", + "@mui/styled-engine": "5workspace:*", + "@mui/styles": "5workspace:*", + "@mui/system": "5workspace:*", + "@mui/utils": "5workspace:*", "react-is": "18.2.0" } } diff --git a/test/bundling/fixtures/snowpack/package.json b/test/bundling/fixtures/snowpack/package.json index d3208e9c774228..71c6f6f39763ab 100644 --- a/test/bundling/fixtures/snowpack/package.json +++ b/test/bundling/fixtures/snowpack/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js snowpack", "start": "pnpm snowpack build && concurrently --success first --kill-others \"pnpm server\" \"node testSnowpackIntegration\"", "server": "serve -p 5001 -s build" }, @@ -10,13 +11,13 @@ "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "snowpack": "3.8.8", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/test/bundling/fixtures/vite/package.json b/test/bundling/fixtures/vite/package.json index 668385231bfa96..2fe116a5ad152c 100644 --- a/test/bundling/fixtures/vite/package.json +++ b/test/bundling/fixtures/vite/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "license": "MIT", "scripts": { + "prestart": "node ../../scripts/createFixture.js vite", "start": "pnpm vite build && concurrently --success first --kill-others \"pnpm server\" \"node testViteIntegration\"", "server": "serve -p 5001 -s build" }, @@ -10,13 +11,13 @@ "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "react": "18.2.0", "react-dom": "18.2.0", "react-is": "18.2.0", From dc53655080110dacb4f978942d6f7ef212302327 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:23:47 +0200 Subject: [PATCH 02/54] Update CI --- .circleci/config.yml | 248 +++---------------------------------------- 1 file changed, 16 insertions(+), 232 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 36c364d56b1c62..7c32b2ee8c8692 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -498,214 +498,29 @@ jobs: - run: name: Upload screenshots to Argos CI command: pnpm test:argos - test_bundling_prepare: + test_bundling: <<: *default-job steps: - checkout + - run: + name: Enable bundling workspaces + command: sed -i "" 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml - install_js - run: name: Build packages for fixtures command: pnpm lerna run --scope "@mui/*" build - - persist_to_workspace: - root: packages - paths: - - '*/build' - - test_bundling_node-esm: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/node-esm/ - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture node-esm - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: | - # TODO: Known failure - set +e - pnpm start - exit 0 - test_bundling_next-webpack4: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture next-webpack4 - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: pnpm start - test_bundling_next-webpack5: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture next-webpack5 - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: pnpm start - test_bundling_create-react-app: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture create-react-app - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: pnpm start - test_bundling_snowpack: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture snowpack - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: pnpm start - test_bundling_vite: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/vite/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture vite - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: pnpm start - test_bundling_esbuild: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - - run: - name: Prepare fixture - command: | - node ../../scripts/createFixture esbuild - - run: - name: Install dependencies - command: | - pnpm - node ../../scripts/useBuildFromSource.js . - - run: - name: Test fixture - command: | - # TODO: Known failure - set +e - pnpm start - exit 0 - test_bundling_gatsby: - <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout: - path: /tmp/material-ui - - attach_workspace: - at: /tmp/material-ui/packages - run: - name: Prepare fixture + name: Run tests command: | - node ../../scripts/useBuildFromSource.js . - node ../../scripts/createFixture gatsby - - run: - name: Install dependencies - command: pnpm - - run: - name: Test fixture - command: pnpm start + pnpm --filter create-react-app start + pnpm --filter esbuild start + pnpm --filter gatsby start + pnpm --filter next-webpack4 start + pnpm --filter next-webpack5 start + pnpm --filter node-esm start + pnpm --filter snowpack start + pnpm --filter vite start + test_bundle_size_monitor: <<: *default-job steps: @@ -855,40 +670,9 @@ workflows: when: equal: [bundling, << pipeline.parameters.workflow >>] jobs: - - test_bundling_prepare: - <<: *default-context - - test_bundling_node-esm: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_next-webpack4: + - test_bundling: <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_next-webpack5: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_create-react-app: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_snowpack: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_vite: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_esbuild: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_gatsby: - <<: *default-context - requires: - - test_bundling_prepare + profile: when: equal: [profile, << pipeline.parameters.workflow >>] From fa66f05f224117a9d8193c5a15840d5a9dfeda97 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:27:46 +0200 Subject: [PATCH 03/54] Delete useBuildFromSource.js --- test/bundling/scripts/useBuildFromSource.js | 96 --------------------- 1 file changed, 96 deletions(-) delete mode 100644 test/bundling/scripts/useBuildFromSource.js diff --git a/test/bundling/scripts/useBuildFromSource.js b/test/bundling/scripts/useBuildFromSource.js deleted file mode 100644 index 20d5b8f4358306..00000000000000 --- a/test/bundling/scripts/useBuildFromSource.js +++ /dev/null @@ -1,96 +0,0 @@ -// Only use built-in modules because this script runs pre-install. -import { promises as fs } from 'fs'; -import { URL } from 'url'; - -/** - * node 12 compatible implementation of cp -r - * @param {URL} sourceDirectory - * @param {URL} targetDirectory - */ -async function copyDirectory(sourceDirectory, targetDirectory) { - await fs.mkdir(targetDirectory, { recursive: true }); - - const sourceFiles = await fs.readdir(sourceDirectory, { withFileTypes: true }); - await Promise.all( - sourceFiles.map(async (sourceFileEntry) => { - let copyMethod; - let sourceFileUrlInput; - if (sourceFileEntry.isDirectory()) { - sourceFileUrlInput = `./${sourceFileEntry.name}/`; - copyMethod = copyDirectory; - } else { - sourceFileUrlInput = `./${sourceFileEntry.name}`; - copyMethod = fs.copyFile; - } - await copyMethod( - new URL(sourceFileUrlInput, sourceDirectory), - new URL(sourceFileUrlInput, targetDirectory), - ); - }), - ); -} - -/** - * node 12 compatible implementation of rm -rf - * @param {string} directory - */ -async function rmRecursiveForce(directory) { - const files = await fs.readdir(directory); - await Promise.all( - files.map(async (fileBasename) => { - const fileName = new URL(fileBasename, directory); - - const fileStats = await fs.stat(fileName); - if (fileStats.isDirectory()) { - await rmRecursiveForce(fileName); - } else { - await fs.unlink(fileName, { force: true }); - } - }), - ); - - await fs.rmdir(directory); -} - -async function run(context) { - const { fixturePath } = context; - if (fixturePath === undefined) { - throw new Error( - `Usage: ${process.argv[1]} [distTag]\n distTag: An npm tag e.g. 'npm:next' or 'npm:latest'. Omit the use the built packages from source.`, - ); - } - const cwdUrl = new URL(`${process.cwd()}/`, 'file://'); - const fixtureUrl = new URL(`./${fixturePath}/`, cwdUrl); - - const workspaceRoot = new URL('../../../', import.meta.url); - await Promise.all( - [ - 'material', - 'icons-material', - 'lab', - 'private-theming', - 'styled-engine', - 'styles', - 'system', - 'types', - 'base', - 'utils', - ].map(async (muiPackageName) => { - // clean copy - try { - await rmRecursiveForce(new URL(`./node_modules/@mui/${muiPackageName}/`, fixtureUrl)); - } catch (error) { - // already exists - } - await copyDirectory( - new URL(`./packages/mui${`-${muiPackageName}`}/build/`, workspaceRoot), - new URL(`./node_modules/@mui/${muiPackageName}/`, fixtureUrl), - ); - }), - ); -} - -run({ fixturePath: process.argv[2] }).catch((error) => { - console.error(error); - process.exit(1); -}); From 7a40193a31480ee43f4d5e258485d7b8d79a5552 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:32:22 +0200 Subject: [PATCH 04/54] Update pnpm-workspace.yaml --- pnpm-workspace.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 31fe8d0485f8a6..8ee2e65d99ea4c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,3 +7,4 @@ packages: - 'test' - 'apps/*' - 'scripts/sizeSnapshot' + # CI:BUNDLING - 'test/bundling/fixtures/*' From cce46faf935df1b913f6dfdd96d7d1b7543b1ffb Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:17:03 +0200 Subject: [PATCH 05/54] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c32b2ee8c8692..215458759c52c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -504,7 +504,7 @@ jobs: - checkout - run: name: Enable bundling workspaces - command: sed -i "" 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml + command: sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml - install_js - run: name: Build packages for fixtures From 34388e0fa3a9181cb36f924687547809d9a6ce34 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:17:31 +0200 Subject: [PATCH 06/54] Update config.yml --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 215458759c52c4..9f8c802ebe89d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -504,7 +504,9 @@ jobs: - checkout - run: name: Enable bundling workspaces - command: sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml + command: | + sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml + cat ./pnpm-workspace.yaml - install_js - run: name: Build packages for fixtures From c2012097341372eeffbbbc6988d1986d4a6a2042 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:23:28 +0200 Subject: [PATCH 07/54] Update config.yml --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f8c802ebe89d8..7860bb51556ab9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -133,7 +133,9 @@ jobs: - when: # Install can be "dirty" when running with non-default versions of React condition: - equal: [<< parameters.react-version >>, stable] + or: + - equal: [<< parameters.react-version >>, stable] + - equal: [<< pipeline.parameters.workflow >>, bundling] steps: - run: name: Should not have any git not staged @@ -507,6 +509,7 @@ jobs: command: | sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml cat ./pnpm-workspace.yaml + pnpm install - install_js - run: name: Build packages for fixtures From 8bcaa79405b1df221d3b83842e7802b5f102df00 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:23:58 +0200 Subject: [PATCH 08/54] Update config.yml --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7860bb51556ab9..ccfa1ead0bdd60 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -509,7 +509,6 @@ jobs: command: | sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml cat ./pnpm-workspace.yaml - pnpm install - install_js - run: name: Build packages for fixtures From e91a35e18f32a03dacc9141f37923acc1fde5e87 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:26:59 +0200 Subject: [PATCH 09/54] Update config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccfa1ead0bdd60..80c4d763a05294 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -509,6 +509,7 @@ jobs: command: | sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml cat ./pnpm-workspace.yaml + pnpm install --no-frozen-lockfile - install_js - run: name: Build packages for fixtures From 0dc49436f7b3e7fa27af64e9cf70018fc2fdb2e1 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:31:00 +0200 Subject: [PATCH 10/54] Update config.yml --- .circleci/config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 80c4d763a05294..9e11533eab7263 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,6 +100,15 @@ commands: node --version pnpm --version + - when: + condition: + equal: [<< pipeline.parameters.workflow >>, bundling] + steps: + - run: | + sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml + cat ./pnpm-workspace.yaml + pnpm install --no-frozen-lockfile + - run: name: Resolve React version command: | @@ -504,12 +513,6 @@ jobs: <<: *default-job steps: - checkout - - run: - name: Enable bundling workspaces - command: | - sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml - cat ./pnpm-workspace.yaml - pnpm install --no-frozen-lockfile - install_js - run: name: Build packages for fixtures From 508f07aeef3504785c6cf1d973a5444323ebee18 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:31:49 +0200 Subject: [PATCH 11/54] Update config.yml --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e11533eab7263..cc9bdc3046296e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -142,9 +142,7 @@ jobs: - when: # Install can be "dirty" when running with non-default versions of React condition: - or: - - equal: [<< parameters.react-version >>, stable] - - equal: [<< pipeline.parameters.workflow >>, bundling] + equal: [<< parameters.react-version >>, stable] steps: - run: name: Should not have any git not staged From 22e7851fcc8a9216ff4a2915da2839306aa4c5c1 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:53:27 +0200 Subject: [PATCH 12/54] Update package.json --- test/bundling/fixtures/node-esm/package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/bundling/fixtures/node-esm/package.json b/test/bundling/fixtures/node-esm/package.json index 81687365e352be..8180ed8930aa38 100644 --- a/test/bundling/fixtures/node-esm/package.json +++ b/test/bundling/fixtures/node-esm/package.json @@ -11,13 +11,13 @@ "dependencies": { "@emotion/core": "11.0.0", "@emotion/styled": "11.10.4", - "@mui/material": "5workspace:*", - "@mui/icons-material": "5workspace:*", - "@mui/lab": "5workspace:*", - "@mui/styled-engine": "5workspace:*", - "@mui/styles": "5workspace:*", - "@mui/system": "5workspace:*", - "@mui/utils": "5workspace:*", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "react-is": "18.2.0" } } From 330c1074f9a311cb7dc7bd6fd8c9f257e72bbdf9 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:06:04 +0200 Subject: [PATCH 13/54] Update config.yml --- .circleci/config.yml | 130 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 120 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cc9bdc3046296e..d97322d5e91e35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -507,7 +507,7 @@ jobs: - run: name: Upload screenshots to Argos CI command: pnpm test:argos - test_bundling: + test_bundling_prepare: <<: *default-job steps: - checkout @@ -515,17 +515,95 @@ jobs: - run: name: Build packages for fixtures command: pnpm lerna run --scope "@mui/*" build + - persist_to_workspace: + root: packages + paths: + - '*/build' + + test_bundling_node-esm: + <<: *default-job + steps: - run: - name: Run tests + name: Test fixture command: | - pnpm --filter create-react-app start - pnpm --filter esbuild start - pnpm --filter gatsby start - pnpm --filter next-webpack4 start - pnpm --filter next-webpack5 start + # TODO: Known failure + set +e pnpm --filter node-esm start - pnpm --filter snowpack start - pnpm --filter vite start + exit 0 + test_bundling_next-webpack4: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test fixture + command: pnpm --filter next-webpack4 start + test_bundling_next-webpack5: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test fixture + command: pnpm --filter next-webpack4 start + test_bundling_create-react-app: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test fixture + command: pnpm --filter create-react-app start + test_bundling_snowpack: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test fixture + command: pnpm --filter snowpack start + test_bundling_vite: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test fixture + command: pnpm --filter vite start + test_bundling_esbuild: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test fixture + command: | + # TODO: Known failure + set +e + pnpm --filter esbuild start + exit 0 + test_bundling_gatsby: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.46.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + steps: + - run: + name: Test --filter gatsby fixture + command: pnpm start test_bundle_size_monitor: <<: *default-job @@ -676,8 +754,40 @@ workflows: when: equal: [bundling, << pipeline.parameters.workflow >>] jobs: - - test_bundling: + - test_bundling_prepare: + <<: *default-context + - test_bundling_node-esm: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_next-webpack4: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_next-webpack5: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_create-react-app: <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_snowpack: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_vite: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_esbuild: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_gatsby: + <<: *default-context + requires: + - test_bundling_prepare profile: when: From e15cf5839e84ffa8fe0bb6afe7fd82d99d61e095 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:20:30 +0200 Subject: [PATCH 14/54] Update config.yml --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d97322d5e91e35..0aabb110bea6a7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,10 +104,12 @@ commands: condition: equal: [<< pipeline.parameters.workflow >>, bundling] steps: - - run: | - sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml - cat ./pnpm-workspace.yaml - pnpm install --no-frozen-lockfile + - run: + name: Enable bundling fixtures workspaces + command: | + sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml + cat ./pnpm-workspace.yaml + pnpm install --no-frozen-lockfile - run: name: Resolve React version From f68a3d29193b70a59992e15c795364d26413712d Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:38:17 +0200 Subject: [PATCH 15/54] Update config.yml --- .circleci/config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0aabb110bea6a7..852cb9b950bb41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -525,6 +525,8 @@ jobs: test_bundling_node-esm: <<: *default-job steps: + - checkout + - install_js - run: name: Test fixture command: | @@ -539,6 +541,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test fixture command: pnpm --filter next-webpack4 start @@ -549,6 +553,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test fixture command: pnpm --filter next-webpack4 start @@ -559,6 +565,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test fixture command: pnpm --filter create-react-app start @@ -569,6 +577,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test fixture command: pnpm --filter snowpack start @@ -579,6 +589,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test fixture command: pnpm --filter vite start @@ -589,6 +601,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test fixture command: | @@ -603,6 +617,8 @@ jobs: environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: + - checkout + - install_js - run: name: Test --filter gatsby fixture command: pnpm start From e9308eda7889d9468feea5f88004cc36576371bd Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:37:01 +0200 Subject: [PATCH 16/54] Update config.yml --- .circleci/config.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 852cb9b950bb41..5879d3e2065176 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -542,7 +542,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test fixture command: pnpm --filter next-webpack4 start @@ -554,7 +555,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test fixture command: pnpm --filter next-webpack4 start @@ -566,7 +568,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test fixture command: pnpm --filter create-react-app start @@ -578,7 +581,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test fixture command: pnpm --filter snowpack start @@ -590,7 +594,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test fixture command: pnpm --filter vite start @@ -602,7 +607,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test fixture command: | @@ -618,7 +624,8 @@ jobs: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - - install_js + - install_js: + browsers: true - run: name: Test --filter gatsby fixture command: pnpm start From e7720cc03a39e0573fd49d1cb68fb49534c65717 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:32:03 +0200 Subject: [PATCH 17/54] Update config.yml --- .circleci/config.yml | 93 +++++++++----------------------------------- 1 file changed, 19 insertions(+), 74 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5879d3e2065176..defaed74fca10f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,6 +67,10 @@ commands: type: boolean default: false description: 'Set to true if you intend to any browser (for example with playwright).' + bundling: + type: boolean + default: false + description: 'Set to true if you intend to run bundling tests.' steps: - when: @@ -101,8 +105,7 @@ commands: pnpm --version - when: - condition: - equal: [<< pipeline.parameters.workflow >>, bundling] + condition: << parameters.bundling >> steps: - run: name: Enable bundling fixtures workspaces @@ -522,11 +525,12 @@ jobs: paths: - '*/build' - test_bundling_node-esm: + test_bundling_node: <<: *default-job steps: - checkout - - install_js + - install_js: + bundling: true - run: name: Test fixture command: | @@ -534,7 +538,7 @@ jobs: set +e pnpm --filter node-esm start exit 0 - test_bundling_next-webpack4: + test_bundling_browsers: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.46.1-focal @@ -544,91 +548,32 @@ jobs: - checkout - install_js: browsers: true + bundling: true - run: - name: Test fixture + name: Test fixture next-webpack4 command: pnpm --filter next-webpack4 start - test_bundling_next-webpack5: - <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout - - install_js: - browsers: true - run: - name: Test fixture - command: pnpm --filter next-webpack4 start - test_bundling_create-react-app: - <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout - - install_js: - browsers: true + name: Test fixture next-webpack5 + command: pnpm --filter next-webpack5 start - run: - name: Test fixture + name: Test fixture create-react-app command: pnpm --filter create-react-app start - test_bundling_snowpack: - <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout - - install_js: - browsers: true - run: - name: Test fixture + name: Test fixture snowpack command: pnpm --filter snowpack start - test_bundling_vite: - <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout - - install_js: - browsers: true - run: - name: Test fixture + name: Test fixture vite command: pnpm --filter vite start - test_bundling_esbuild: - <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout - - install_js: - browsers: true - run: - name: Test fixture + name: Test fixture esbuild command: | # TODO: Known failure set +e pnpm --filter esbuild start exit 0 - test_bundling_gatsby: - <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` - steps: - - checkout - - install_js: - browsers: true - run: - name: Test --filter gatsby fixture - command: pnpm start + name: Test fixture gatsby + command: Test --filter gatsby fixture test_bundle_size_monitor: <<: *default-job From 6a428c9baa25e3ed524c1e74a979b329c1754013 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:35:18 +0200 Subject: [PATCH 18/54] Update config.yml --- .circleci/config.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index defaed74fca10f..14e67eb7d5d6c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -407,7 +407,7 @@ jobs: <<: *default-job resource_class: 'medium+' docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: @@ -437,7 +437,7 @@ jobs: test_e2e: <<: *default-job docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: @@ -451,7 +451,7 @@ jobs: # NOTE: This workflow runs after successful docs deploy. See /test/e2e-website/README.md#ci <<: *default-job docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: @@ -466,7 +466,7 @@ jobs: test_profile: <<: *default-job docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: @@ -493,7 +493,7 @@ jobs: test_regressions: <<: *default-job docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: @@ -541,7 +541,7 @@ jobs: test_bundling_browsers: <<: *default-job docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: @@ -657,7 +657,7 @@ jobs: test_benchmark: <<: *default-job docker: - - image: mcr.microsoft.com/playwright:v1.46.1-focal + - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` steps: From 5998d853496c028219feb3cf5631b8744a22dac8 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:42:24 +0200 Subject: [PATCH 19/54] Update config.yml --- .circleci/config.yml | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 14e67eb7d5d6c4..01f68f591cc320 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -726,35 +726,11 @@ workflows: jobs: - test_bundling_prepare: <<: *default-context - - test_bundling_node-esm: + - test_bundling_node: <<: *default-context requires: - test_bundling_prepare - - test_bundling_next-webpack4: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_next-webpack5: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_create-react-app: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_snowpack: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_vite: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_esbuild: - <<: *default-context - requires: - - test_bundling_prepare - - test_bundling_gatsby: + - test_bundling_browsers: <<: *default-context requires: - test_bundling_prepare From 3cd7ce734302fd6af8a8c9cf9fd97c36b9e6a4f0 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:59:03 +0200 Subject: [PATCH 20/54] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01f68f591cc320..07244e2fdb7b66 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -112,7 +112,7 @@ commands: command: | sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml cat ./pnpm-workspace.yaml - pnpm install --no-frozen-lockfile + pnpm install --no-frozen-lockfile --child-concurrency 1 - run: name: Resolve React version From 9d58936ae0b3905a79c80dddd217aaf0aadb21bc Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:11:25 +0200 Subject: [PATCH 21/54] fwrf --- .circleci/config.yml | 12 ++++++------ test/bundling/fixtures/next-webpack4/next.config.js | 3 +++ test/bundling/fixtures/next-webpack5/next.config.js | 5 +++++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 test/bundling/fixtures/next-webpack5/next.config.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 07244e2fdb7b66..6a26fffff4f125 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -549,12 +549,6 @@ jobs: - install_js: browsers: true bundling: true - - run: - name: Test fixture next-webpack4 - command: pnpm --filter next-webpack4 start - - run: - name: Test fixture next-webpack5 - command: pnpm --filter next-webpack5 start - run: name: Test fixture create-react-app command: pnpm --filter create-react-app start @@ -574,6 +568,12 @@ jobs: - run: name: Test fixture gatsby command: Test --filter gatsby fixture + # - run: + # name: Test fixture next-webpack4 + # command: NODE_OPTIONS=--openssl-legacy-provider pnpm --filter next-webpack4 start + - run: + name: Test fixture next-webpack5 + command: pnpm --filter next-webpack5 start test_bundle_size_monitor: <<: *default-job diff --git a/test/bundling/fixtures/next-webpack4/next.config.js b/test/bundling/fixtures/next-webpack4/next.config.js index af6c7df4649094..4fe8097623c74a 100644 --- a/test/bundling/fixtures/next-webpack4/next.config.js +++ b/test/bundling/fixtures/next-webpack4/next.config.js @@ -1,3 +1,6 @@ module.exports = { webpack5: false, + eslint: { + ignoreDuringBuilds: true, + }, }; diff --git a/test/bundling/fixtures/next-webpack5/next.config.js b/test/bundling/fixtures/next-webpack5/next.config.js new file mode 100644 index 00000000000000..7d17dcfcfb4d45 --- /dev/null +++ b/test/bundling/fixtures/next-webpack5/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + eslint: { + ignoreDuringBuilds: true, + }, +}; From 6fc81664bece08072f9871272849186ab17788fa Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 23 Sep 2024 17:03:22 +0200 Subject: [PATCH 22/54] Update package.json --- test/bundling/fixtures/esbuild/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bundling/fixtures/esbuild/package.json b/test/bundling/fixtures/esbuild/package.json index 0fd8d49a057bda..1337db5936700e 100644 --- a/test/bundling/fixtures/esbuild/package.json +++ b/test/bundling/fixtures/esbuild/package.json @@ -5,7 +5,7 @@ "scripts": { "prestart": "node ../../scripts/createFixture.js esbuild", "start": "pnpm build && concurrently --success first --kill-others \"pnpm server\" \"node testEsbuildIntegration\"", - "build": "esbuild esbuild.fixture.js --bundle --outfile=build/esbuild.fixture.js", + "build": "esbuild esbuild.fixture.js --bundle --outfile=build/esbuild.fixture.js --tsconfig=tsconfig.json", "server": "serve -p 5001 -s build" }, "dependencies": { From 47d4c0df9d827e16eb9a1ac92099d706391bd329 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:22:19 +0200 Subject: [PATCH 23/54] dwefw --- .circleci/config.yml | 40 +++++-- .gitignore | 1 + package.json | 1 + scripts/releasePack.mts | 107 ++++++++++++++++++ scripts/sizeSnapshot/package.json | 1 + .../fixtures/next-webpack4/next.config.js | 7 ++ .../fixtures/next-webpack4/package.json | 14 ++- .../fixtures/next-webpack5/package.json | 27 +++-- .../bundling/fixtures/node-cjs/development.js | 5 + .../fixtures/node-cjs/node-cjs.template | 3 + test/bundling/fixtures/node-cjs/package.json | 35 ++++++ test/bundling/scripts/createFixture.js | 40 ++++++- 12 files changed, 262 insertions(+), 19 deletions(-) create mode 100644 scripts/releasePack.mts create mode 100644 test/bundling/fixtures/node-cjs/development.js create mode 100644 test/bundling/fixtures/node-cjs/node-cjs.template create mode 100644 test/bundling/fixtures/node-cjs/package.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a26fffff4f125..dfa6f150f1ad68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -520,19 +520,41 @@ jobs: - run: name: Build packages for fixtures command: pnpm lerna run --scope "@mui/*" build + - run: + name: Pack packages + command: pnpm release:pack - persist_to_workspace: - root: packages + root: packed paths: - - '*/build' + - './packed' - test_bundling_node: + test_bundling_node_cjs: <<: *default-job + working_directory: /tmp/material-ui/test/bundling/fixtures/node-cjs/ steps: - - checkout - - install_js: - bundling: true + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - run: + name: Install dependencies + command: pnpm install --ignore-workspace + - run: + name: Test fixture node-cjs + command: pnpm start + test_bundling_node_esm: + <<: *default-job + working_directory: /tmp/material-ui/test/bundling/fixtures/node-cjs/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - run: + name: Install dependencies + command: pnpm install --ignore-workspace - run: - name: Test fixture + name: Test fixture node-esm command: | # TODO: Known failure set +e @@ -726,11 +748,11 @@ workflows: jobs: - test_bundling_prepare: <<: *default-context - - test_bundling_node: + - test_bundling_node_cjs: <<: *default-context requires: - test_bundling_prepare - - test_bundling_browsers: + - test_bundling_node_esm: <<: *default-context requires: - test_bundling_prepare diff --git a/.gitignore b/.gitignore index 605f9c60ddddcc..e0af26ad0d2a0b 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ docs/public/static/blog/feed/* .nx/cache .nx/workspace-data screenshots +packed diff --git a/package.json b/package.json index bd575bcc6e742e..79cdaac3632a2c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "release:publish": "pnpm publish --recursive --tag latest", "release:publish:dry-run": "pnpm publish --recursive --tag latest --registry=\"http://localhost:4873/\"", "release:tag": "node scripts/releaseTag.mjs", + "release:pack": "tsx scripts/releasePack.mts", "docs:api": "rimraf --glob ./docs/pages/**/api-docs ./docs/pages/**/api && pnpm docs:api:build", "docs:api:build": "tsx ./scripts/buidApiDocs/index.ts", "docs:build": "pnpm --filter docs build", diff --git a/scripts/releasePack.mts b/scripts/releasePack.mts new file mode 100644 index 00000000000000..c955da16eca1b5 --- /dev/null +++ b/scripts/releasePack.mts @@ -0,0 +1,107 @@ +/* eslint-disable no-console */ +import yargs from 'yargs'; +import { hideBin } from 'yargs/helpers'; +import { $ } from 'execa'; +import * as path from 'path'; +import * as fs from 'fs/promises'; + +interface WorkspaceDefinition { + name: string; + version: string; + path: string; + private: boolean; +} + +interface Manifest { + packages: Record; +} + +interface RunOptions { + packages?: string[]; + outDir: string; + concurrency: number; +} + +async function packWorkspace(workspace: WorkspaceDefinition, outDir: string): Promise { + const packages: Record = {}; + const { stdout: zipFilePath } = await $({ + cwd: workspace.path, + })`pnpm pack --pack-destination ${outDir}`; + packages[workspace.name] = zipFilePath; + return zipFilePath; +} + +async function run({ packages, outDir, concurrency }: RunOptions) { + const allWorkspaces: WorkspaceDefinition[] = await $`pnpm m ls --depth -1 --json`.then((result) => + JSON.parse(result.stdout), + ); + const workspacesMap = new Map(allWorkspaces.map((workspace) => [workspace.name, workspace])); + + const publicPackages = allWorkspaces + .filter((workspace) => !workspace.private) + .map((workspace) => workspace.name); + const packagesToPack = packages || publicPackages; + + const workspacesToPack = packagesToPack.map((name) => { + const workspace = workspacesMap.get(name); + if (!workspace) { + throw new Error(`Workspace ${name} not found`); + } + return workspace; + }); + + const absoluteDestination = path.resolve(outDir); + + const workspacesIterator = workspacesToPack.values(); + const manifest: Manifest = { packages: {} }; + const workers = Array.from({ length: concurrency }).map(async () => { + for (const workspace of workspacesIterator) { + /* eslint-disable no-await-in-loop */ + console.log(`packing "${workspace.name}"`); + const zipFilePath = await packWorkspace(workspace, absoluteDestination); + const newName = path.join(absoluteDestination, `${workspace.name}.tgz`); + await fs.mkdir(path.dirname(newName), { recursive: true }); + await fs.rename(zipFilePath, newName); + const relativeZipFilePath = path.relative(absoluteDestination, newName); + manifest.packages[workspace.name] = relativeZipFilePath; + console.log(`packed "${zipFilePath}"`); + /* eslint-enable no-await-in-loop */ + } + }); + + await Promise.all(workers); + + await fs.writeFile( + path.join(absoluteDestination, 'manifest.json'), + JSON.stringify(manifest, null, 2), + ); +} + +yargs(hideBin(process.argv)) + .command( + '$0', + 'Pack workspaces.', + (command) => { + return command + .option('packages', { + describe: 'Workspace Packages to pack, defaults to public packages', + type: 'array', + alias: 'p', + }) + .option('outDir', { + default: './packed', + describe: 'Destination folder', + type: 'string', + }) + .option('concurrency', { + default: 5, + describe: 'Number of concurrent packing processes', + type: 'number', + }); + }, + run, + ) + .help() + .strict(true) + .version(false) + .parse(); diff --git a/scripts/sizeSnapshot/package.json b/scripts/sizeSnapshot/package.json index cdf10486a4b819..5a71c6f3278715 100644 --- a/scripts/sizeSnapshot/package.json +++ b/scripts/sizeSnapshot/package.json @@ -1,6 +1,7 @@ { "name": "size-snapshot", "version": "1.0.0", + "private": true, "description": "Size snapshot of MUI packages", "dependencies": { "@mui/base": "workspace:^", diff --git a/test/bundling/fixtures/next-webpack4/next.config.js b/test/bundling/fixtures/next-webpack4/next.config.js index 4fe8097623c74a..2e0d198c8f3565 100644 --- a/test/bundling/fixtures/next-webpack4/next.config.js +++ b/test/bundling/fixtures/next-webpack4/next.config.js @@ -3,4 +3,11 @@ module.exports = { eslint: { ignoreDuringBuilds: true, }, + webpack(config, { defaultLoaders }) { + config.module.rules.push({ + test: /\/node_modules\/@mui\//, + use: [defaultLoaders.babel], + }); + return config; + }, }; diff --git a/test/bundling/fixtures/next-webpack4/package.json b/test/bundling/fixtures/next-webpack4/package.json index 9b6f2e5deef9fb..b459358be51a48 100644 --- a/test/bundling/fixtures/next-webpack4/package.json +++ b/test/bundling/fixtures/next-webpack4/package.json @@ -4,7 +4,7 @@ "license": "MIT", "scripts": { "prestart": "node ../../scripts/createFixture.js next-webpack4", - "start": "pnpm next build && concurrently --success first --kill-others \"pnpm next start\" \"node testNextWebpack4Integration\"" + "start": "NODE_OPTIONS=--openssl-legacy-provider pnpm next build && concurrently --success first --kill-others \"pnpm next start\" \"node testNextWebpack4Integration\"" }, "dependencies": { "@emotion/core": "11.0.0", @@ -25,5 +25,17 @@ "devDependencies": { "concurrently": "7.4.0", "playwright": "1.47.1" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } diff --git a/test/bundling/fixtures/next-webpack5/package.json b/test/bundling/fixtures/next-webpack5/package.json index 140641fe65d9d5..269031e0705c79 100644 --- a/test/bundling/fixtures/next-webpack5/package.json +++ b/test/bundling/fixtures/next-webpack5/package.json @@ -3,20 +3,19 @@ "version": "1.0.0", "license": "MIT", "scripts": { - "prestart": "node ../../scripts/createFixture.js next-webpack5", "start": "pnpm next build && concurrently --success first --kill-others \"pnpm next start\" \"node testNextWebpack5Integration\"" }, "dependencies": { "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "workspace:*", - "@mui/icons-material": "workspace:*", - "@mui/lab": "workspace:*", - "@mui/styled-engine": "workspace:*", - "@mui/styles": "workspace:*", - "@mui/system": "workspace:*", - "@mui/utils": "workspace:*", + "@mui/material": "5.10.5", + "@mui/icons-material": "5.10.3", + "@mui/lab": "5.0.0-alpha.99", + "@mui/styled-engine": "5.10.5", + "@mui/styles": "5.10.3", + "@mui/system": "5.10.5", + "@mui/utils": "5.10.3", "next": "12.3.0", "react": "18.2.0", "react-dom": "18.2.0", @@ -25,5 +24,17 @@ "devDependencies": { "concurrently": "7.4.0", "playwright": "1.47.1" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } diff --git a/test/bundling/fixtures/node-cjs/development.js b/test/bundling/fixtures/node-cjs/development.js new file mode 100644 index 00000000000000..3c51c76266bab2 --- /dev/null +++ b/test/bundling/fixtures/node-cjs/development.js @@ -0,0 +1,5 @@ +import * as ReactIs from 'react-is'; +import Accordion2 from '@mui/material/Accordion'; + +// eslint-disable-next-line no-console +console.assert(ReactIs.isValidElementType(Accordion2)); diff --git a/test/bundling/fixtures/node-cjs/node-cjs.template b/test/bundling/fixtures/node-cjs/node-cjs.template new file mode 100644 index 00000000000000..3444091e6caa5d --- /dev/null +++ b/test/bundling/fixtures/node-cjs/node-cjs.template @@ -0,0 +1,3 @@ +{{{requires}}} + +{{{usage}}} diff --git a/test/bundling/fixtures/node-cjs/package.json b/test/bundling/fixtures/node-cjs/package.json new file mode 100644 index 00000000000000..ed913aababbd3f --- /dev/null +++ b/test/bundling/fixtures/node-cjs/package.json @@ -0,0 +1,35 @@ +{ + "name": "node-esm", + "version": "1.0.0", + "main": "index.js", + "type": "commonjs", + "license": "MIT", + "scripts": { + "prestart": "node ../../scripts/createFixture.js node-cjs", + "start": "node node-cjs.fixture.js" + }, + "dependencies": { + "@emotion/core": "11.0.0", + "@emotion/styled": "11.10.4", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", + "react-is": "18.2.0" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } + } +} diff --git a/test/bundling/scripts/createFixture.js b/test/bundling/scripts/createFixture.js index 3a5b98ba908f72..2d2b99d891ea2a 100644 --- a/test/bundling/scripts/createFixture.js +++ b/test/bundling/scripts/createFixture.js @@ -33,6 +33,19 @@ async function writeNodeESMFixture(context) { await writeFromTemplate(destinationPath, templateSource, fixtureTemplateValues); } +/** + * @param {FixtureContext} context + */ +async function writeNodeCJSFixture(context) { + const { fixtureUrl, fixtureTemplateValues } = context; + const destinationPath = new URL('./node-cjs.fixture.js', fixtureUrl); + const templateSource = await fs.readFile(new URL('node-cjs.template', fixtureUrl), { + encoding: 'utf8', + }); + + await writeFromTemplate(destinationPath, templateSource, fixtureTemplateValues); +} + /** * @param {FixtureContext} context */ @@ -118,10 +131,29 @@ async function readFixtureTemplateValues(fileUrl) { const importsMatch = code.match(/\/\/ #region imports(.+?)\/\/ #endregion/s); const [imports] = importsMatch; + const lines = imports.split(/\n+/).filter((line) => { + const trimmed = line.trim(); + return trimmed && !trimmed.startsWith('//') && !trimmed.startsWith('/*'); + }); + const requires = lines + .map((line) => { + const [, specifier, module] = /import (.*) from ['"](.*)['"]/.exec(line); + if (specifier.startsWith('*')) { + return `const ${specifier.replace('* as ', '')} = require('${module}')`; + } + if (specifier.startsWith('{')) { + return `const ${specifier.replace(' as ', ': ')} = require('${module}')`; + } + return `const { default: ${specifier} } = require('${module}')`; + }) + .join('\n'); + + console.log(requires); + const usageMatch = code.match(/\/\/ #region usage(.+?)\/\/ #endregion/s); const [usage] = usageMatch; - return { imports, usage }; + return { imports, usage, requires }; } function resolveFixtureUrl(fixtureName) { @@ -144,6 +176,12 @@ async function run(context) { ); switch (fixture) { + case 'node-cjs': + await writeNodeCJSFixture({ + fixtureUrl: resolveFixtureUrl('node-cjs'), + fixtureTemplateValues, + }); + break; case 'node-esm': await writeNodeESMFixture({ fixtureUrl: resolveFixtureUrl('node-esm'), From e122cb756eba91c5d54c59c0d5122aa684a956c6 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:36:15 +0200 Subject: [PATCH 24/54] Update createFixture.js --- test/bundling/scripts/createFixture.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/bundling/scripts/createFixture.js b/test/bundling/scripts/createFixture.js index 2d2b99d891ea2a..7ceeaf15966f3c 100644 --- a/test/bundling/scripts/createFixture.js +++ b/test/bundling/scripts/createFixture.js @@ -148,8 +148,6 @@ async function readFixtureTemplateValues(fileUrl) { }) .join('\n'); - console.log(requires); - const usageMatch = code.match(/\/\/ #region usage(.+?)\/\/ #endregion/s); const [usage] = usageMatch; From cc7a540036e9cb8edcf6e6bd97a7a7890203135f Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:44:50 +0200 Subject: [PATCH 25/54] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dfa6f150f1ad68..44d78a7218bda9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -526,7 +526,7 @@ jobs: - persist_to_workspace: root: packed paths: - - './packed' + - '*' test_bundling_node_cjs: <<: *default-job From 3535aa16839cee403100c0c4f6c23e1489bf74c8 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:56:19 +0200 Subject: [PATCH 26/54] Update config.yml --- .circleci/config.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44d78a7218bda9..e39660814f7f44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,6 +61,22 @@ default-context: &default-context # key: v1-repo-{{ .Branch }}-{{ .Revision }} commands: + setup_corepack: + 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 install_js: parameters: browsers: @@ -73,14 +89,10 @@ commands: description: 'Set to true if you intend to run bundling tests.' steps: + - setup_corepack - when: condition: << parameters.browsers >> steps: - - run: - name: Install pnpm package manager - command: | - corepack enable - corepack prepare pnpm@latest-8 --activate - run: name: Prepare playwright hash command: pnpm list --json --filter playwright > /tmp/playwright_info.json @@ -91,12 +103,6 @@ commands: name: Restore playwright cache keys: - v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }} - - when: - condition: - not: << parameters.browsers >> - steps: - # See https://stackoverflow.com/a/73411601 - - run: corepack enable --install-directory ~/bin - run: name: View install environment @@ -536,6 +542,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed + - setup_corepack - run: name: Install dependencies command: pnpm install --ignore-workspace @@ -550,6 +557,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed + - setup_corepack - run: name: Install dependencies command: pnpm install --ignore-workspace @@ -607,6 +615,7 @@ jobs: command: pnpm danger ci environment: DANGER_COMMAND: prepareBundleSizeReport + - setup_corepack - run: name: build @mui packages command: pnpm lerna run --ignore @mui/icons-material --concurrency 6 --scope "@mui/*" build From 9ca5745f91479e63bccccb3dbe3d908ac8fc8108 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:00:31 +0200 Subject: [PATCH 27/54] Update config.yml --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e39660814f7f44..e06e2cb8c9579b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,6 +62,11 @@ default-context: &default-context commands: setup_corepack: + parameters: + browsers: + type: boolean + default: false + description: 'Set to true if you intend to any browser (for example with playwright).' steps: - when: condition: << parameters.browsers >> @@ -89,7 +94,8 @@ commands: description: 'Set to true if you intend to run bundling tests.' steps: - - setup_corepack + - setup_corepack: + browsers: << parameters.browsers >> - when: condition: << parameters.browsers >> steps: From 3565100586350dd4b1db902b7d880f232de0a5e0 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:12:25 +0200 Subject: [PATCH 28/54] Update config.yml --- .circleci/config.yml | 184 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 158 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e06e2cb8c9579b..aa430c1b634091 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -553,7 +553,7 @@ jobs: name: Install dependencies command: pnpm install --ignore-workspace - run: - name: Test fixture node-cjs + name: Test fixture command: pnpm start test_bundling_node_esm: <<: *default-job @@ -568,48 +568,152 @@ jobs: name: Install dependencies command: pnpm install --ignore-workspace - run: - name: Test fixture node-esm + name: Test fixture command: | # TODO: Known failure set +e - pnpm --filter node-esm start + pnpm start exit 0 - test_bundling_browsers: + test_bundling_create_react_app: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ steps: - - checkout - - install_js: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: browsers: true - bundling: true - run: - name: Test fixture create-react-app - command: pnpm --filter create-react-app start + name: Install dependencies + command: pnpm install --ignore-workspace - run: - name: Test fixture snowpack - command: pnpm --filter snowpack start + name: Test fixture + command: pnpm start + test_bundling_snowpack: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: + browsers: true - run: - name: Test fixture vite - command: pnpm --filter vite start + name: Install dependencies + command: pnpm install --ignore-workspace - run: - name: Test fixture esbuild - command: | - # TODO: Known failure - set +e - pnpm --filter esbuild start - exit 0 + name: Test fixture + command: pnpm start + test_bundling_vite: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/vite/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: + browsers: true - run: - name: Test fixture gatsby - command: Test --filter gatsby fixture - # - run: - # name: Test fixture next-webpack4 - # command: NODE_OPTIONS=--openssl-legacy-provider pnpm --filter next-webpack4 start + name: Install dependencies + command: pnpm install --ignore-workspace - run: - name: Test fixture next-webpack5 - command: pnpm --filter next-webpack5 start + name: Test fixture + command: pnpm start + test_bundling_esbuild: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: + browsers: true + - run: + name: Install dependencies + command: pnpm install --ignore-workspace + - run: + name: Test fixture + command: pnpm start + test_bundling_gatsby: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: + browsers: true + - run: + name: Install dependencies + command: pnpm install --ignore-workspace + - run: + name: Test fixture + command: pnpm start + test_bundling_next_webpack4: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: + browsers: true + - run: + name: Install dependencies + command: pnpm install --ignore-workspace + - run: + name: Test fixture + command: pnpm start + test_bundling_next_webpack5: + <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` + working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/ + steps: + - checkout: + path: /tmp/material-ui + - attach_workspace: + at: /tmp/material-ui/packed + - setup_corepack: + browsers: true + - run: + name: Install dependencies + command: pnpm install --ignore-workspace + - run: + name: Test fixture + command: pnpm start test_bundle_size_monitor: <<: *default-job @@ -771,6 +875,34 @@ workflows: <<: *default-context requires: - test_bundling_prepare + - test_bundling_create_react_app: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_snowpack: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_vite: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_esbuild: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_gatsby: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_next_webpack4: + <<: *default-context + requires: + - test_bundling_prepare + - test_bundling_next_webpack5: + <<: *default-context + requires: + - test_bundling_prepare profile: when: From e9e69cade63f792f711f5d7ab66f49e78b2afdca Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:22:31 +0200 Subject: [PATCH 29/54] Update config.yml --- .circleci/config.yml | 51 ++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa430c1b634091..031cd7c30864b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,12 +61,17 @@ default-context: &default-context # key: v1-repo-{{ .Branch }}-{{ .Revision }} commands: - setup_corepack: + install_js: parameters: browsers: type: boolean default: false description: 'Set to true if you intend to any browser (for example with playwright).' + bundling: + type: boolean + default: false + description: 'Set to true if you intend to run bundling tests.' + steps: - when: condition: << parameters.browsers >> @@ -82,20 +87,6 @@ commands: name: Install pnpm package manager # See https://stackoverflow.com/a/73411601 command: corepack enable --install-directory ~/bin - install_js: - parameters: - browsers: - type: boolean - default: false - description: 'Set to true if you intend to any browser (for example with playwright).' - bundling: - type: boolean - default: false - description: 'Set to true if you intend to run bundling tests.' - - steps: - - setup_corepack: - browsers: << parameters.browsers >> - when: condition: << parameters.browsers >> steps: @@ -116,16 +107,6 @@ commands: node --version pnpm --version - - when: - condition: << parameters.bundling >> - steps: - - run: - name: Enable bundling fixtures workspaces - command: | - sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml - cat ./pnpm-workspace.yaml - pnpm install --no-frozen-lockfile --child-concurrency 1 - - run: name: Resolve React version command: | @@ -548,7 +529,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack + - install_js - run: name: Install dependencies command: pnpm install --ignore-workspace @@ -563,7 +544,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack + - install_js - run: name: Install dependencies command: pnpm install --ignore-workspace @@ -586,7 +567,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -606,7 +587,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -626,7 +607,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -646,7 +627,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -666,7 +647,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -686,7 +667,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -706,7 +687,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - setup_corepack: + - install_js: browsers: true - run: name: Install dependencies @@ -725,7 +706,7 @@ jobs: command: pnpm danger ci environment: DANGER_COMMAND: prepareBundleSizeReport - - setup_corepack + - install_js - run: name: build @mui packages command: pnpm lerna run --ignore @mui/icons-material --concurrency 6 --scope "@mui/*" build From 8ec0b55345e43106f72e9e30b6921ec011c474a9 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:27:18 +0200 Subject: [PATCH 30/54] Update config.yml --- .circleci/config.yml | 58 ++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 031cd7c30864b7..ce81a3f071b3cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,17 +61,12 @@ default-context: &default-context # key: v1-repo-{{ .Branch }}-{{ .Revision }} commands: - install_js: + setup_corepack: parameters: browsers: type: boolean default: false description: 'Set to true if you intend to any browser (for example with playwright).' - bundling: - type: boolean - default: false - description: 'Set to true if you intend to run bundling tests.' - steps: - when: condition: << parameters.browsers >> @@ -87,6 +82,20 @@ commands: name: Install pnpm package manager # See https://stackoverflow.com/a/73411601 command: corepack enable --install-directory ~/bin + install_js: + parameters: + browsers: + type: boolean + default: false + description: 'Set to true if you intend to any browser (for example with playwright).' + bundling: + type: boolean + default: false + description: 'Set to true if you intend to run bundling tests.' + + steps: + - setup_corepack: + browsers: << parameters.browsers >> - when: condition: << parameters.browsers >> steps: @@ -107,6 +116,16 @@ commands: node --version pnpm --version + - when: + condition: << parameters.bundling >> + steps: + - run: + name: Enable bundling fixtures workspaces + command: | + sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml + cat ./pnpm-workspace.yaml + pnpm install --no-frozen-lockfile --child-concurrency 1 + - run: name: Resolve React version command: | @@ -529,7 +548,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js + - setup_corepack - run: name: Install dependencies command: pnpm install --ignore-workspace @@ -544,7 +563,7 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js + - setup_corepack - run: name: Install dependencies command: pnpm install --ignore-workspace @@ -567,11 +586,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -587,11 +607,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -607,11 +628,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -627,11 +649,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -647,11 +670,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -667,11 +691,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -687,11 +712,12 @@ jobs: path: /tmp/material-ui - attach_workspace: at: /tmp/material-ui/packed - - install_js: + - setup_corepack: browsers: true - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -706,7 +732,7 @@ jobs: command: pnpm danger ci environment: DANGER_COMMAND: prepareBundleSizeReport - - install_js + - setup_corepack - run: name: build @mui packages command: pnpm lerna run --ignore @mui/icons-material --concurrency 6 --scope "@mui/*" build From c3e0aaf80049adcf3d70e345d5a6ad6dc9599da1 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:40:04 +0200 Subject: [PATCH 31/54] edwf --- .../fixtures/create-react-app/package.json | 12 ++++++++++++ test/bundling/fixtures/esbuild/package.json | 12 ++++++++++++ test/bundling/fixtures/gatsby/package.json | 12 ++++++++++++ test/bundling/fixtures/next-webpack5/package.json | 14 +++++++------- test/bundling/fixtures/snowpack/package.json | 12 ++++++++++++ test/bundling/fixtures/vite/package.json | 12 ++++++++++++ 6 files changed, 67 insertions(+), 7 deletions(-) diff --git a/test/bundling/fixtures/create-react-app/package.json b/test/bundling/fixtures/create-react-app/package.json index 4ad19506dd53e2..626e51baabd652 100644 --- a/test/bundling/fixtures/create-react-app/package.json +++ b/test/bundling/fixtures/create-react-app/package.json @@ -40,5 +40,17 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } diff --git a/test/bundling/fixtures/esbuild/package.json b/test/bundling/fixtures/esbuild/package.json index 1337db5936700e..25e6637dfde962 100644 --- a/test/bundling/fixtures/esbuild/package.json +++ b/test/bundling/fixtures/esbuild/package.json @@ -28,5 +28,17 @@ "concurrently": "7.4.0", "playwright": "1.47.1", "serve": "14.0.1" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } diff --git a/test/bundling/fixtures/gatsby/package.json b/test/bundling/fixtures/gatsby/package.json index 2e2422f4428d40..ac4842b0ad25e2 100644 --- a/test/bundling/fixtures/gatsby/package.json +++ b/test/bundling/fixtures/gatsby/package.json @@ -25,5 +25,17 @@ "devDependencies": { "concurrently": "7.4.0", "playwright": "1.47.1" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } diff --git a/test/bundling/fixtures/next-webpack5/package.json b/test/bundling/fixtures/next-webpack5/package.json index 269031e0705c79..9cd3b06e740848 100644 --- a/test/bundling/fixtures/next-webpack5/package.json +++ b/test/bundling/fixtures/next-webpack5/package.json @@ -9,13 +9,13 @@ "@emotion/core": "11.0.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", - "@mui/material": "5.10.5", - "@mui/icons-material": "5.10.3", - "@mui/lab": "5.0.0-alpha.99", - "@mui/styled-engine": "5.10.5", - "@mui/styles": "5.10.3", - "@mui/system": "5.10.5", - "@mui/utils": "5.10.3", + "@mui/material": "workspace:*", + "@mui/icons-material": "workspace:*", + "@mui/lab": "workspace:*", + "@mui/styled-engine": "workspace:*", + "@mui/styles": "workspace:*", + "@mui/system": "workspace:*", + "@mui/utils": "workspace:*", "next": "12.3.0", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/test/bundling/fixtures/snowpack/package.json b/test/bundling/fixtures/snowpack/package.json index bd7f430b6419c1..017fb74b366f07 100644 --- a/test/bundling/fixtures/snowpack/package.json +++ b/test/bundling/fixtures/snowpack/package.json @@ -27,5 +27,17 @@ "concurrently": "7.4.0", "playwright": "1.47.1", "serve": "14.0.1" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } diff --git a/test/bundling/fixtures/vite/package.json b/test/bundling/fixtures/vite/package.json index ae36e8ae1a891c..6b715b1869d405 100644 --- a/test/bundling/fixtures/vite/package.json +++ b/test/bundling/fixtures/vite/package.json @@ -27,5 +27,17 @@ "concurrently": "7.4.0", "playwright": "1.47.1", "serve": "14.0.1" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } From 362faa52327412b0a1aac9bb6a00c4a5c1d5722a Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:47:32 +0200 Subject: [PATCH 32/54] Create tsconfig.json --- test/bundling/fixtures/esbuild/tsconfig.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/bundling/fixtures/esbuild/tsconfig.json diff --git a/test/bundling/fixtures/esbuild/tsconfig.json b/test/bundling/fixtures/esbuild/tsconfig.json new file mode 100644 index 00000000000000..3b7182f4eaf85f --- /dev/null +++ b/test/bundling/fixtures/esbuild/tsconfig.json @@ -0,0 +1,4 @@ +{ + "compilerOptions": {}, + "exclude": ["node_modules", "build"] +} From a18c15b96f2f4830e262b89823838c6d704a0953 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:55:03 +0200 Subject: [PATCH 33/54] geg --- test/bundling/fixtures/gatsby/.browserslistrc | 2 ++ test/bundling/fixtures/gatsby/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 test/bundling/fixtures/gatsby/.browserslistrc diff --git a/test/bundling/fixtures/gatsby/.browserslistrc b/test/bundling/fixtures/gatsby/.browserslistrc new file mode 100644 index 00000000000000..cef7bb62dac7f6 --- /dev/null +++ b/test/bundling/fixtures/gatsby/.browserslistrc @@ -0,0 +1,2 @@ +defaults and fully supports es6-module +maintained node versions diff --git a/test/bundling/fixtures/gatsby/package.json b/test/bundling/fixtures/gatsby/package.json index ac4842b0ad25e2..59a4ee97b5917c 100644 --- a/test/bundling/fixtures/gatsby/package.json +++ b/test/bundling/fixtures/gatsby/package.json @@ -17,7 +17,7 @@ "@mui/styles": "workspace:*", "@mui/system": "workspace:*", "@mui/utils": "workspace:*", - "gatsby": "4.25.7", + "gatsby": "5.13.7", "react": "18.2.0", "react-dom": "18.2.0", "react-is": "18.2.0" From 308fcb10289e448306447917db9a45f72bd579b2 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:20:28 +0200 Subject: [PATCH 34/54] order --- .circleci/config.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce81a3f071b3cc..3c0cf7b9a965f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -574,13 +574,13 @@ jobs: set +e pnpm start exit 0 - test_bundling_create_react_app: + test_bundling_next_webpack4: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ + working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/ steps: - checkout: path: /tmp/material-ui @@ -595,13 +595,13 @@ jobs: - run: name: Test fixture command: pnpm start - test_bundling_snowpack: + test_bundling_next_webpack5: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/ + working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/ steps: - checkout: path: /tmp/material-ui @@ -616,13 +616,13 @@ jobs: - run: name: Test fixture command: pnpm start - test_bundling_vite: + test_bundling_create_react_app: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/vite/ + working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ steps: - checkout: path: /tmp/material-ui @@ -637,13 +637,13 @@ jobs: - run: name: Test fixture command: pnpm start - test_bundling_esbuild: + test_bundling_snowpack: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/ + working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/ steps: - checkout: path: /tmp/material-ui @@ -658,13 +658,13 @@ jobs: - run: name: Test fixture command: pnpm start - test_bundling_gatsby: + test_bundling_vite: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ + working_directory: /tmp/material-ui/test/bundling/fixtures/vite/ steps: - checkout: path: /tmp/material-ui @@ -679,13 +679,13 @@ jobs: - run: name: Test fixture command: pnpm start - test_bundling_next_webpack4: + test_bundling_esbuild: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/ + working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/ steps: - checkout: path: /tmp/material-ui @@ -700,13 +700,13 @@ jobs: - run: name: Test fixture command: pnpm start - test_bundling_next_webpack5: + test_bundling_gatsby: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: NODE_ENV: development # Needed if playwright is in `devDependencies` - working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/ + working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ steps: - checkout: path: /tmp/material-ui From 4aeedc2a3062e823fcb46b5a88b536df6deda37e Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:34:38 +0200 Subject: [PATCH 35/54] Update config.yml --- .circleci/config.yml | 59 ++++++-------------------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c0cf7b9a965f9..dd0280b11cb9f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,13 +36,12 @@ default-job: &default-job type: string default: << pipeline.parameters.e2e-base-url >> environment: - # Keep in sync with "Save playwright cache" - PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers # expose it globally otherwise we have to thread it from each job to the install command BROWSERSTACK_FORCE: << pipeline.parameters.browserstack-force >> REACT_VERSION: << parameters.react-version >> TEST_GATE: << parameters.test-gate >> AWS_REGION_ARTIFACTS: eu-central-1 + COREPACK_ENABLE_DOWNLOAD_PROMPT: '0' working_directory: /tmp/material-ui docker: - image: cimg/node:20.17 @@ -82,6 +81,13 @@ commands: 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 + install_js: parameters: browsers: @@ -96,35 +102,6 @@ commands: steps: - setup_corepack: browsers: << parameters.browsers >> - - when: - condition: << parameters.browsers >> - steps: - - run: - name: Prepare playwright hash - command: pnpm list --json --filter playwright > /tmp/playwright_info.json - - store_artifacts: - name: Debug playwright hash - path: /tmp/playwright_info.json - - restore_cache: - name: Restore playwright cache - keys: - - v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }} - - - run: - name: View install environment - command: | - node --version - pnpm --version - - - when: - condition: << parameters.bundling >> - steps: - - run: - name: Enable bundling fixtures workspaces - command: | - sed -i 's/# CI:BUNDLING //g' ./pnpm-workspace.yaml - cat ./pnpm-workspace.yaml - pnpm install --no-frozen-lockfile --child-concurrency 1 - run: name: Resolve React version @@ -136,19 +113,6 @@ commands: - run: name: Install js dependencies command: pnpm install - - when: - condition: << parameters.browsers >> - steps: - - run: - name: Install playwright browsers - command: pnpm playwright install --with-deps - - save_cache: - name: Save playwright cache - key: v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }} - paths: - # Keep path in sync with "PLAYWRIGHT_BROWSERS_PATH" - # Can't use environment variables for `save_cache` paths (tested in https://app.circleci.com/pipelines/github/mui/material-ui/37813/workflows/5b1e207f-ac8b-44e7-9ba4-d0f9a01f5c55/jobs/223370) - - /tmp/pw-browsers jobs: checkout: @@ -591,7 +555,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -612,7 +575,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -633,7 +595,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -654,7 +615,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -675,7 +635,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -696,7 +655,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start @@ -717,7 +675,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: pnpm exec playwright install - run: name: Test fixture command: pnpm start From 8a20ed11ea81ac2111206ed0ca89fac64c465c95 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:35:40 +0200 Subject: [PATCH 36/54] Update config.yml --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd0280b11cb9f0..c997b336da9b1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,10 +94,6 @@ commands: type: boolean default: false description: 'Set to true if you intend to any browser (for example with playwright).' - bundling: - type: boolean - default: false - description: 'Set to true if you intend to run bundling tests.' steps: - setup_corepack: From abdd54e8539f538d18f88ce9c6ef933e466d3be7 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:39:29 +0200 Subject: [PATCH 37/54] Update config.yml --- .circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c997b336da9b1b..1dd866553a6cce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -576,10 +576,6 @@ jobs: command: pnpm start test_bundling_create_react_app: <<: *default-job - docker: - - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ steps: - checkout: @@ -591,6 +587,9 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace + - run: + name: Install playwright + command: pnpm exec playwright install --with-deps - run: name: Test fixture command: pnpm start From 68776885447b05aa5ec515eb4f8ce2576cad10fa Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:35:05 +0200 Subject: [PATCH 38/54] Revert "Update config.yml" This reverts commit abdd54e8539f538d18f88ce9c6ef933e466d3be7. --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dd866553a6cce..c997b336da9b1b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -576,6 +576,10 @@ jobs: command: pnpm start test_bundling_create_react_app: <<: *default-job + docker: + - image: mcr.microsoft.com/playwright:v1.47.1-focal + environment: + NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ steps: - checkout: @@ -587,9 +591,6 @@ jobs: - run: name: Install dependencies command: pnpm install --ignore-workspace - - run: - name: Install playwright - command: pnpm exec playwright install --with-deps - run: name: Test fixture command: pnpm start From 349dee27143d8a0a8a6df704f6236bd962c1796b Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:29:18 +0200 Subject: [PATCH 39/54] Update config.yml --- .circleci/config.yml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c997b336da9b1b..9f4a402d3aee4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -380,8 +380,6 @@ jobs: resource_class: 'medium+' docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - install_js: @@ -410,8 +408,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - install_js: @@ -424,8 +420,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - install_js: @@ -439,8 +433,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - install_js: @@ -466,8 +458,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - install_js: @@ -538,8 +528,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/ steps: - checkout: @@ -558,8 +546,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/ steps: - checkout: @@ -578,8 +564,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/ steps: - checkout: @@ -598,8 +582,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/ steps: - checkout: @@ -618,8 +600,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/vite/ steps: - checkout: @@ -638,8 +618,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/ steps: - checkout: @@ -659,7 +637,7 @@ jobs: docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` + GATSBY_CPU_COUNT: '1' working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ steps: - checkout: @@ -759,8 +737,6 @@ jobs: <<: *default-job docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal - environment: - NODE_ENV: development # Needed if playwright is in `devDependencies` steps: - checkout - install_js: From c8551e8f65cb8bcd7339a7b9d6c83816013f8143 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:38:57 +0200 Subject: [PATCH 40/54] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f4a402d3aee4b..2988f8cf7d6a90 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -637,7 +637,7 @@ jobs: docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: - GATSBY_CPU_COUNT: '1' + GATSBY_CPU_COUNT: '2' working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ steps: - checkout: From 55883d36bd21f19a66801948f26c203ece6a27c3 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:55:01 +0200 Subject: [PATCH 41/54] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2988f8cf7d6a90..489acb59be3708 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -637,7 +637,7 @@ jobs: docker: - image: mcr.microsoft.com/playwright:v1.47.1-focal environment: - GATSBY_CPU_COUNT: '2' + GATSBY_CPU_COUNT: '3' working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/ steps: - checkout: From c6aacc6dcfcf9e1a10fdb21813bb710ed30db08e Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:17:08 +0200 Subject: [PATCH 42/54] Update README.md --- test/bundling/README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index 36a77439965f41..3dd5a1a1e63925 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -7,19 +7,19 @@ The created file might need some manual adjustment since not every edge case is ## Run a fixture -1. Navigate into the fixture you want to test (where the `package.json` is located) -1. Use the node version you want to use (for example `nvm use 14.0.0`) -1. Prepare the package.json - - to test a Pull Request - 1. checkout branch - 1. add fixture path to workspaces in `pnpm-workspace.yaml` - 1. `pnpm install` - 1. `pnpm lerna run build --scope "@mui/*"` - - to test a published npm dist tag (for example `latest` or `next`) on npm - 1. adjust the dependencies in the package.json accordingly (replace the `workspace:*` specifiers) - 1. `pnpm install` - 1. `pnpm lerna run build --scope "@mui/*"` -1. `pnpm --filter start` should exit with 0 +- to test a Pull Request + 1. checkout branch + 1. `pnpm install` + 1. `pnpm lerna run build --scope "@mui/*"` + 1. `pnpm release:pack` + 1. Navigate into the fixture you want to test (where the `package.json` is located) + 1. `pnpm install --ignore-workspace` + 1. `pnpm start` +- to test a published npm dist tag (for example `latest` or `next`) on npm or a codesandboxci published version + 1. Navigate into the fixture you want to test (where the `package.json` is located) + 1. adjust `pnpm.overrides` of the `package.json` file to point to the desired version + 1. `pnpm install --ignore-workspace` + 1. `pnpm start` ### In CI @@ -42,7 +42,7 @@ curl --request POST \ 1. Create a folder in `test/fixtures/bundling` 1. Add the necessary dependencies -1. Re-use the entries for `dependencies` and `resolutions` for `@mui/*` packages from the other fixtures +1. Re-use the entries for `dependencies` and `pnpm.overrides` for `@mui/*` packages from the other fixtures 1. Create a template 1. Write a factory that fills the template in `test/bundling/scripts/createFixture` 1. Add an entry into the `bundling` CircleCI pipeline (`.circleci/config.yml`) From b16bed65f8d8ab8331d57897691e9d346bfd7e72 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:17:36 +0200 Subject: [PATCH 43/54] Update README.md --- test/bundling/README.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index 3dd5a1a1e63925..66d461e56c3d6f 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -7,19 +7,22 @@ The created file might need some manual adjustment since not every edge case is ## Run a fixture -- to test a Pull Request - 1. checkout branch - 1. `pnpm install` - 1. `pnpm lerna run build --scope "@mui/*"` - 1. `pnpm release:pack` - 1. Navigate into the fixture you want to test (where the `package.json` is located) - 1. `pnpm install --ignore-workspace` - 1. `pnpm start` -- to test a published npm dist tag (for example `latest` or `next`) on npm or a codesandboxci published version - 1. Navigate into the fixture you want to test (where the `package.json` is located) - 1. adjust `pnpm.overrides` of the `package.json` file to point to the desired version - 1. `pnpm install --ignore-workspace` - 1. `pnpm start` +### to test a Pull Request + +1. checkout branch +1. `pnpm install` +1. `pnpm lerna run build --scope "@mui/*"` +1. `pnpm release:pack` +1. Navigate into the fixture you want to test (where the `package.json` is located) +1. `pnpm install --ignore-workspace` +1. `pnpm start` + +### to test a published npm dist tag (for example `latest` or `next`) on npm or a codesandboxci published version + +1. Navigate into the fixture you want to test (where the `package.json` is located) +1. adjust `pnpm.overrides` of the `package.json` file to point to the desired version +1. `pnpm install --ignore-workspace` +1. `pnpm start` ### In CI From 8cccefdafb3ca079568b99a692caa21230624c42 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:18:14 +0200 Subject: [PATCH 44/54] Update README.md --- test/bundling/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index 66d461e56c3d6f..e4dc2cead03634 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -17,7 +17,9 @@ The created file might need some manual adjustment since not every edge case is 1. `pnpm install --ignore-workspace` 1. `pnpm start` -### to test a published npm dist tag (for example `latest` or `next`) on npm or a codesandboxci published version +### to test a published npm dist tag + +_for example `latest` or `next` on npm or a codesandboxci published version_ 1. Navigate into the fixture you want to test (where the `package.json` is located) 1. adjust `pnpm.overrides` of the `package.json` file to point to the desired version From 536a29b8a482cb6fbd724052baeb1ba1862fc909 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:20:29 +0200 Subject: [PATCH 45/54] Update README.md --- test/bundling/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index e4dc2cead03634..f995abd5e4d780 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -7,7 +7,7 @@ The created file might need some manual adjustment since not every edge case is ## Run a fixture -### to test a Pull Request +### To test a Pull Request 1. checkout branch 1. `pnpm install` @@ -17,7 +17,7 @@ The created file might need some manual adjustment since not every edge case is 1. `pnpm install --ignore-workspace` 1. `pnpm start` -### to test a published npm dist tag +### To test a published npm dist tag _for example `latest` or `next` on npm or a codesandboxci published version_ From 91e5a08a36610d20aadc4108c2ca81db8dfdc6e4 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:20:47 +0200 Subject: [PATCH 46/54] Update README.md --- test/bundling/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index f995abd5e4d780..b2b55c2c54423a 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -19,7 +19,7 @@ The created file might need some manual adjustment since not every edge case is ### To test a published npm dist tag -_for example `latest` or `next` on npm or a codesandboxci published version_ +_For example: `latest` or `next` on npm or a codesandboxci published version_ 1. Navigate into the fixture you want to test (where the `package.json` is located) 1. adjust `pnpm.overrides` of the `package.json` file to point to the desired version From 6cbc0a0115697ee20b0188515a64b83be97fcd72 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:20:59 +0200 Subject: [PATCH 47/54] Update README.md --- test/bundling/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bundling/README.md b/test/bundling/README.md index b2b55c2c54423a..4fdd303c23c34d 100644 --- a/test/bundling/README.md +++ b/test/bundling/README.md @@ -9,7 +9,7 @@ The created file might need some manual adjustment since not every edge case is ### To test a Pull Request -1. checkout branch +1. Checkout branch 1. `pnpm install` 1. `pnpm lerna run build --scope "@mui/*"` 1. `pnpm release:pack` @@ -22,7 +22,7 @@ The created file might need some manual adjustment since not every edge case is _For example: `latest` or `next` on npm or a codesandboxci published version_ 1. Navigate into the fixture you want to test (where the `package.json` is located) -1. adjust `pnpm.overrides` of the `package.json` file to point to the desired version +1. Adjust `pnpm.overrides` of the `package.json` file to point to the desired version 1. `pnpm install --ignore-workspace` 1. `pnpm start` From d3fb2b168669fdc37a4c2b177b0fe277b6ebbfac Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:23:27 +0200 Subject: [PATCH 48/54] Update config.yml --- .circleci/config.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 489acb59be3708..2c1b6f4e4581b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -519,11 +519,8 @@ jobs: command: pnpm install --ignore-workspace - run: name: Test fixture - command: | - # TODO: Known failure - set +e - pnpm start - exit 0 + # TODO: Known failure + command: pnpm start test_bundling_next_webpack4: <<: *default-job docker: From 81c3c8ccd107ad7116c75f27fbc32d44b9be86a7 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:46:29 +0200 Subject: [PATCH 49/54] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c1b6f4e4581b1..248752bd5da203 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -507,7 +507,7 @@ jobs: command: pnpm start test_bundling_node_esm: <<: *default-job - working_directory: /tmp/material-ui/test/bundling/fixtures/node-cjs/ + working_directory: /tmp/material-ui/test/bundling/fixtures/node-esm/ steps: - checkout: path: /tmp/material-ui From c6bb141e4a0cff7fc0ee5944e4b0c336a6b5061c Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:02:47 +0200 Subject: [PATCH 50/54] Update package.json --- test/bundling/fixtures/node-esm/package.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/bundling/fixtures/node-esm/package.json b/test/bundling/fixtures/node-esm/package.json index 8180ed8930aa38..8056aa2e7e4d5a 100644 --- a/test/bundling/fixtures/node-esm/package.json +++ b/test/bundling/fixtures/node-esm/package.json @@ -19,5 +19,17 @@ "@mui/system": "workspace:*", "@mui/utils": "workspace:*", "react-is": "18.2.0" + }, + "pnpm": { + "overrides": { + "@mui/base": "file:../../../../packed/@mui/base.tgz", + "@mui/material": "file:../../../../packed/@mui/material.tgz", + "@mui/icons-material": "file:../../../../packed/@mui/icons-material.tgz", + "@mui/lab": "file:../../../../packed/@mui/lab.tgz", + "@mui/styled-engine": "file:../../../../packed/@mui/styled-engine.tgz", + "@mui/styles": "file:../../../../packed/@mui/styles.tgz", + "@mui/system": "file:../../../../packed/@mui/system.tgz", + "@mui/utils": "file:../../../../packed/@mui/utils.tgz" + } } } From 93758906d370218a3470af019d582117cae9f0c6 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:13:59 +0200 Subject: [PATCH 51/54] Update pnpm-workspace.yaml --- pnpm-workspace.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8ee2e65d99ea4c..31fe8d0485f8a6 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,4 +7,3 @@ packages: - 'test' - 'apps/*' - 'scripts/sizeSnapshot' - # CI:BUNDLING - 'test/bundling/fixtures/*' From 16827788488ce9fb3c58ecb257e02e45f2211a6d Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:18:09 +0200 Subject: [PATCH 52/54] Update releasePack.mts --- scripts/releasePack.mts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/releasePack.mts b/scripts/releasePack.mts index c955da16eca1b5..7766eb1efc5944 100644 --- a/scripts/releasePack.mts +++ b/scripts/releasePack.mts @@ -32,8 +32,8 @@ async function packWorkspace(workspace: WorkspaceDefinition, outDir: string): Pr } async function run({ packages, outDir, concurrency }: RunOptions) { - const allWorkspaces: WorkspaceDefinition[] = await $`pnpm m ls --depth -1 --json`.then((result) => - JSON.parse(result.stdout), + const allWorkspaces: WorkspaceDefinition[] = await $`pnpm -r ls --depth -1 --json`.then( + (result) => JSON.parse(result.stdout), ); const workspacesMap = new Map(allWorkspaces.map((workspace) => [workspace.name, workspace])); From 1a8ccd77347aa940b028eec7657ef48d2823c188 Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:18:59 +0200 Subject: [PATCH 53/54] Update config.yml --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1492ae5a28b65f..5eda3afeb7a589 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -628,11 +628,7 @@ jobs: command: pnpm install --ignore-workspace - run: name: Test fixture - command: | - # TODO: Known failure - set +e - pnpm start - exit 0 + command: pnpm start test_bundling_gatsby: <<: *default-job docker: From 5c11a76833c1a8a75d7bb8c5987de23fca78b7ca Mon Sep 17 00:00:00 2001 From: MUI bot <2109932+Janpot@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:54:13 +0200 Subject: [PATCH 54/54] ignore test file as a page --- apps/pigment-css-vite-app/src/pages/fixtures/index.tsx | 4 +--- apps/pigment-css-vite-app/vite.config.ts | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/pigment-css-vite-app/src/pages/fixtures/index.tsx b/apps/pigment-css-vite-app/src/pages/fixtures/index.tsx index b646a41333c1ea..4967f9144b2bfe 100644 --- a/apps/pigment-css-vite-app/src/pages/fixtures/index.tsx +++ b/apps/pigment-css-vite-app/src/pages/fixtures/index.tsx @@ -17,9 +17,7 @@ export default function Layout() { ); const demo = new URLSearchParams(location.search).get('demo'); - const fixturesRoutes = (matchedRoute?.route.children ?? []).filter( - (item) => !!item.path && item.path !== 'index.test', - ); + const fixturesRoutes = (matchedRoute?.route.children ?? []).filter((item) => !!item.path); const demosRoutes = (materialUIRoute?.route.children ?? []).filter( (item) => !!item.path && !item.path.includes('react-pagination'), diff --git a/apps/pigment-css-vite-app/vite.config.ts b/apps/pigment-css-vite-app/vite.config.ts index 1aeffb286e54bb..88f1fb06db2f1f 100644 --- a/apps/pigment-css-vite-app/vite.config.ts +++ b/apps/pigment-css-vite-app/vite.config.ts @@ -43,8 +43,10 @@ export default defineConfig({ sourceMap: true, displayName: true, }), - Pages(), splitVendorChunkPlugin(), + Pages({ + exclude: ['**/*.test.*'], + }), nodePolyfills(), ], });