Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code-infra] Fix and update bundling fixtures #43709

Merged
merged 56 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3e2d8b9
[code-infra] Update and fix bundling fixtures
Janpot Sep 11, 2024
dc53655
Update CI
Janpot Sep 11, 2024
fa66f05
Delete useBuildFromSource.js
Janpot Sep 11, 2024
7a40193
Update pnpm-workspace.yaml
Janpot Sep 11, 2024
cce46fa
Update config.yml
Janpot Sep 11, 2024
34388e0
Update config.yml
Janpot Sep 11, 2024
c201209
Update config.yml
Janpot Sep 11, 2024
8bcaa79
Update config.yml
Janpot Sep 11, 2024
e91a35e
Update config.yml
Janpot Sep 11, 2024
0dc4943
Update config.yml
Janpot Sep 11, 2024
508f07a
Update config.yml
Janpot Sep 11, 2024
22e7851
Update package.json
Janpot Sep 11, 2024
330c107
Update config.yml
Janpot Sep 11, 2024
e15cf58
Update config.yml
Janpot Sep 11, 2024
f68a3d2
Update config.yml
Janpot Sep 11, 2024
e9308ed
Update config.yml
Janpot Sep 23, 2024
e7720cc
Update config.yml
Janpot Sep 23, 2024
c885d61
Merge remote-tracking branch 'upstream/master' into bundling-fixtures
Janpot Sep 23, 2024
6a428c9
Update config.yml
Janpot Sep 23, 2024
5998d85
Update config.yml
Janpot Sep 23, 2024
3cd7ce7
Update config.yml
Janpot Sep 23, 2024
9d58936
fwrf
Janpot Sep 23, 2024
6fc8166
Update package.json
Janpot Sep 23, 2024
47d4c0d
dwefw
Janpot Sep 24, 2024
e122cb7
Update createFixture.js
Janpot Sep 24, 2024
cc7a540
Update config.yml
Janpot Sep 24, 2024
3535aa1
Update config.yml
Janpot Sep 24, 2024
9ca5745
Update config.yml
Janpot Sep 24, 2024
3565100
Update config.yml
Janpot Sep 24, 2024
e9e69ca
Update config.yml
Janpot Sep 24, 2024
8ec0b55
Update config.yml
Janpot Sep 24, 2024
c3e0aaf
edwf
Janpot Sep 24, 2024
362faa5
Create tsconfig.json
Janpot Sep 24, 2024
a18c15b
geg
Janpot Sep 25, 2024
308fcb1
order
Janpot Sep 25, 2024
4aeedc2
Update config.yml
Janpot Sep 25, 2024
8a20ed1
Update config.yml
Janpot Sep 25, 2024
abdd54e
Update config.yml
Janpot Sep 25, 2024
6877688
Revert "Update config.yml"
Janpot Sep 25, 2024
349dee2
Update config.yml
Janpot Sep 25, 2024
c8551e8
Update config.yml
Janpot Sep 25, 2024
55883d3
Update config.yml
Janpot Sep 25, 2024
c6aacc6
Update README.md
Janpot Sep 25, 2024
b16bed6
Update README.md
Janpot Sep 25, 2024
8cccefd
Update README.md
Janpot Sep 25, 2024
536a29b
Update README.md
Janpot Sep 25, 2024
91e5a08
Update README.md
Janpot Sep 25, 2024
6cbc0a0
Update README.md
Janpot Sep 25, 2024
d3fb2b1
Update config.yml
Janpot Sep 25, 2024
81c3c8c
Update config.yml
Janpot Sep 25, 2024
c6bb141
Update package.json
Janpot Sep 25, 2024
9375890
Update pnpm-workspace.yaml
Janpot Sep 25, 2024
34c6f53
Merge remote-tracking branch 'upstream/master' into bundling-fixtures
Janpot Sep 30, 2024
1682778
Update releasePack.mts
Janpot Sep 30, 2024
1a8ccd7
Update config.yml
Janpot Sep 30, 2024
5c11a76
ignore test file as a page
Janpot Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 93 additions & 95 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,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).'

steps:
- when:
condition: << parameters.browsers >>
Expand All @@ -89,6 +88,17 @@ commands:
node --version
pnpm --version

install_js:
parameters:
browsers:
type: boolean
default: false
description: 'Set to true if you intend to any browser (for example with playwright).'

steps:
- setup_corepack:
browsers: << parameters.browsers >>

- run:
name: Resolve React version
command: |
Expand Down Expand Up @@ -472,192 +482,174 @@ 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'
- '*'

test_bundling_node-esm:
test_bundling_node_cjs:
<<: *default-job
working_directory: /tmp/material-ui/test/bundling/fixtures/node-esm/
working_directory: /tmp/material-ui/test/bundling/fixtures/node-cjs/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
at: /tmp/material-ui/packed
- setup_corepack
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture node-esm
name: Install dependencies
command: pnpm install --ignore-workspace
- run:
name: Test fixture
command: pnpm start
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/packed
- setup_corepack
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
command: pnpm install --ignore-workspace
- run:
name: Test fixture
command: |
# TODO: Known failure
set +e
pnpm start
exit 0
test_bundling_next-webpack4:
# TODO: Known failure
command: pnpm start
test_bundling_next_webpack4:
<<: *default-job
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack4/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture next-webpack4
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
command: pnpm install --ignore-workspace
- run:
name: Test fixture
command: pnpm start
test_bundling_next-webpack5:
test_bundling_next_webpack5:
<<: *default-job
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
working_directory: /tmp/material-ui/test/bundling/fixtures/next-webpack5/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture next-webpack5
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
command: pnpm install --ignore-workspace
- run:
name: Test fixture
command: pnpm start
test_bundling_create-react-app:
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.47.2-focal
working_directory: /tmp/material-ui/test/bundling/fixtures/create-react-app/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture create-react-app
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
command: pnpm install --ignore-workspace
- 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.47.2-focal
working_directory: /tmp/material-ui/test/bundling/fixtures/snowpack/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture snowpack
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
command: pnpm install --ignore-workspace
- 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.47.2-focal
working_directory: /tmp/material-ui/test/bundling/fixtures/vite/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture vite
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
command: pnpm install --ignore-workspace
- 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.47.2-focal
working_directory: /tmp/material-ui/test/bundling/fixtures/esbuild/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/createFixture esbuild
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: |
pnpm
node ../../scripts/useBuildFromSource.js .
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
working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/
docker:
- image: mcr.microsoft.com/playwright:v1.47.2-focal
environment:
GATSBY_CPU_COUNT: '3'
working_directory: /tmp/material-ui/test/bundling/fixtures/gatsby/
steps:
- checkout:
path: /tmp/material-ui
- attach_workspace:
at: /tmp/material-ui/packages
- run:
name: Prepare fixture
command: |
node ../../scripts/useBuildFromSource.js .
node ../../scripts/createFixture gatsby
at: /tmp/material-ui/packed
- setup_corepack:
browsers: true
- run:
name: Install dependencies
command: pnpm
command: pnpm install --ignore-workspace
- run:
name: Test fixture
command: pnpm start

test_bundle_size_monitor:
<<: *default-job
steps:
Expand All @@ -668,6 +660,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
Expand Down Expand Up @@ -807,19 +800,15 @@ workflows:
jobs:
- test_bundling_prepare:
<<: *default-context
- test_bundling_node-esm:
- test_bundling_node_cjs:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_next-webpack4:
- test_bundling_node_esm:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_next-webpack5:
<<: *default-context
requires:
- test_bundling_prepare
- test_bundling_create-react-app:
- test_bundling_create_react_app:
<<: *default-context
requires:
- test_bundling_prepare
Expand All @@ -839,6 +828,15 @@ workflows:
<<: *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:
equal: [profile, << pipeline.parameters.workflow >>]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ docs/public/static/blog/feed/*
.nx/cache
.nx/workspace-data
screenshots
packed
4 changes: 1 addition & 3 deletions apps/pigment-css-vite-app/src/pages/fixtures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 3 additions & 1 deletion apps/pigment-css-vite-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ export default defineConfig({
sourceMap: true,
displayName: true,
}),
Pages(),
splitVendorChunkPlugin(),
Pages({
exclude: ['**/*.test.*'],
}),
nodePolyfills(),
],
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading