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] Change package manager to pnpm #11875

Merged
merged 104 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
26636c1
specify package manager
LukasTy Jan 30, 2024
dba95e9
Generate pnpm-lock
LukasTy Jan 30, 2024
e8e915a
define pnpm workspace
LukasTy Jan 30, 2024
78b2c2f
Remove `yarn.lock`
LukasTy Jan 30, 2024
1920b08
Replace deprecated proposals with transform packages
LukasTy Jan 30, 2024
a72fd80
sync transform versions
LukasTy Jan 30, 2024
55719c9
run install
LukasTy Jan 30, 2024
7f9a5c6
npmrc
LukasTy Jan 30, 2024
d72dd0c
Downgrade monorepo to current version
LukasTy Jan 30, 2024
8d02d44
Replace `yarn` calls with `pnpm`
LukasTy Jan 31, 2024
d66ccfd
Use `workspace:*` for direct monorepo deps
LukasTy Jan 31, 2024
2ad73e3
Remove `yarn-deduplicate`
LukasTy Jan 31, 2024
1c03ce9
Update remaining scripts
LukasTy Jan 31, 2024
a3122b8
Specify publish directory
LukasTy Jan 31, 2024
2482ab5
Remove not used `@trendmicro/react-interpolate` package
LukasTy Jan 31, 2024
0591518
Replace remaining `yarn` usages
LukasTy Jan 31, 2024
edc8b44
Refactor patches into `pnpm` solution
LukasTy Jan 31, 2024
0f48bed
fix eslint
LukasTy Jan 31, 2024
0b830ab
Add `@types/prop-types` where necessary
LukasTy Jan 31, 2024
6a5c146
Fix `moment-hijri` missing types
LukasTy Jan 31, 2024
87d93fb
Fix data-grid typing issues
LukasTy Jan 31, 2024
a085a5a
Fix missing import in docs
LukasTy Jan 31, 2024
eecb512
Fix docs packages
LukasTy Jan 31, 2024
597745f
Fix remaining `docs` package TS issues
LukasTy Jan 31, 2024
9a52d23
Add missing dev packages
LukasTy Feb 1, 2024
d1420dc
Make `typescript` happy
LukasTy Feb 1, 2024
06a3927
Fix build
LukasTy Feb 1, 2024
3adcd19
Fix missing `fs-extra` types warning
LukasTy Feb 1, 2024
37b89a9
Lock to a commit to avoid `dedupe` updating it
LukasTy Feb 1, 2024
679241c
Merge branch 'master' into yarn-to-pnpm
LukasTy Apr 5, 2024
516a7be
Fix new `yarn` instances
LukasTy Apr 5, 2024
174d7cb
Run install
LukasTy Apr 5, 2024
64e72b8
Sync monorepo version with `master` branch
LukasTy Apr 5, 2024
5b0471a
Sync and lock (for now) `@types/react-dom`
LukasTy Apr 5, 2024
6d2a386
docs:typescript:formatted
LukasTy Apr 5, 2024
77cf266
Try raising node heap memory to avoid OOM error
LukasTy Apr 5, 2024
f07661a
Add `chance` package to docs for charts demos
LukasTy Apr 5, 2024
4133d07
Add `stylis` package as its used in `DataGridRTL` demo
LukasTy Apr 5, 2024
686b441
Add `jscodeshift` to docs package as its used in `populatePickersDemos`
LukasTy Apr 5, 2024
0a68b4a
Eslint ignore `netlify/functions`
LukasTy Apr 5, 2024
423cdf1
Add `lodash` to root package as it's used in `sizeSnapshot/create`
LukasTy Apr 5, 2024
902fe88
Add packages to make `scripts/sizeSnapshot/webpack.config` happy
LukasTy Apr 5, 2024
4df06af
Add missing `@types/d3-shape` package
LukasTy Apr 5, 2024
649e822
Add `test` "package"
LukasTy Apr 8, 2024
04d76c4
Fix test package TS issues
LukasTy Apr 8, 2024
724ee70
Lock React types to the versions installed with yarn to avoid errors
LukasTy Apr 8, 2024
f0f4202
Remove duplicate `@mui/base` resolution
LukasTy Apr 8, 2024
8026b61
Fix links to `themeCssVarsAugmentation`
LukasTy Apr 8, 2024
a6959d6
Run `pnpm:dedupe`
LukasTy Apr 8, 2024
c8a8b72
Fix `tsconfig`
LukasTy Apr 8, 2024
7e66313
Remove redundant script
LukasTy Apr 8, 2024
a6ab14b
prettier
LukasTy Apr 8, 2024
b175565
Fix `build:types` on `x-tree-view`
LukasTy Apr 8, 2024
eb8c85d
Bump TS to avoid data grid type compilation issues
LukasTy Apr 9, 2024
ac22b7b
Remove no longer used component
LukasTy Apr 9, 2024
a971535
Fix to successfully build `x-charts` dynamically imported types
LukasTy Apr 9, 2024
95656db
Increase heap size for `docs:api`
LukasTy Apr 9, 2024
5581622
Reduce `typescript` heap size even further to avoid OOM
LukasTy Apr 9, 2024
0870afb
Run `pnpm dedupe`
LukasTy Apr 9, 2024
30da4b2
Rename charts `tsx` files to `ts`
LukasTy Apr 9, 2024
cbd8073
Fix `x-data-grid` and `x-date-pickers` type building
LukasTy Apr 9, 2024
d331834
Enable the `pre/post` scripts
LukasTy Apr 9, 2024
58a4bc0
Add `preinstall` script
LukasTy Apr 9, 2024
3f2039d
Add `rimraf` to dev deps to fix `prebuild` script
LukasTy Apr 9, 2024
a149241
Merge commit '8efee23e8ba67ea1e3c31ab54ac71561b3cd9223' into yarn-to-…
JCQuintas Apr 15, 2024
2e5abd0
Revert typescript to 5.3.3.
LukasTy Apr 15, 2024
b3bcc60
dedupe
LukasTy Apr 15, 2024
a840b29
Change specifier
LukasTy Apr 15, 2024
8680628
Fix `@mui/x-data-grid-premium` types build
LukasTy Apr 16, 2024
28ad040
Fix `@mui/x-charts` types build
LukasTy Apr 16, 2024
f50ccd2
prettier
LukasTy Apr 16, 2024
32c243f
Fix to let babel transpile `@mui/monorepo`
LukasTy Apr 17, 2024
6287b78
prettier
LukasTy Apr 17, 2024
04f88ed
Add missing `@babel/runtime` package
LukasTy Apr 17, 2024
587d91a
Fix `test:karma` and `test:regressions` by adjusting the `webpack.exc…
LukasTy Apr 18, 2024
515ce69
Patch problematic babel.config.js resolution `parseTest`
LukasTy Apr 18, 2024
1be7c1d
Move `@mui/internal-markdown` to root folder to avoid not being detec…
LukasTy Apr 18, 2024
8fcb660
Merge remote-tracking branch 'upstream/master' into yarn-to-pnpm
LukasTy Apr 18, 2024
5338a06
Cleanup
LukasTy Apr 18, 2024
6a14142
Update package.json
LukasTy Apr 19, 2024
ec30c92
Clean-up `date-fns-v3` dep declaration
LukasTy Apr 19, 2024
d2e83f7
Merge remote-tracking branch 'upstream/master' into yarn-to-pnpm
LukasTy Apr 19, 2024
43abdec
Use regex instead of an exclude function
LukasTy Apr 19, 2024
ccf6005
Fix `importDocsStatic` script
LukasTy Apr 19, 2024
e935f3c
Grid packages have already been flattened
LukasTy Apr 19, 2024
f84086d
Simplify Pickers tsconfig
LukasTy Apr 19, 2024
dcdd4e3
Simplify Charts tsconfig
LukasTy Apr 19, 2024
ccae289
Simplify codemod tsconfig
LukasTy Apr 19, 2024
2ea33ef
Simplify Data Grid tsconfig
LukasTy Apr 19, 2024
911f5ca
Bump typescript to fix `x-data-grid-premium` `buildTypes`
LukasTy Apr 22, 2024
9f4fec3
Further Data Grid package tsconfig simplifications
LukasTy Apr 22, 2024
fe04389
Remove unused entry
LukasTy Apr 22, 2024
23355c7
Simplify Tree View tsconfig
LukasTy Apr 22, 2024
34cfe46
prettier
LukasTy Apr 22, 2024
ee4c36d
Merge remote-tracking branch 'upstream/master' into yarn-to-pnpm
LukasTy Apr 22, 2024
98807b0
Add `engine-strict`
LukasTy Apr 22, 2024
ef331f7
Simplify license tsconfig
LukasTy Apr 23, 2024
14701d9
Omit pnpm cache
LukasTy Apr 24, 2024
dd410a7
Merge remote-tracking branch 'upstream/master' into yarn-to-pnpm
LukasTy Apr 24, 2024
77d3ddf
Fix release scripts
LukasTy Apr 24, 2024
0f60f5f
Revert to original `dry-run` script solution
LukasTy Apr 24, 2024
3fc38db
Add note about `release:publish:dry-run` usage
LukasTy Apr 24, 2024
e620216
Simplify `docs` and `test` package `tsconfig`
LukasTy Apr 24, 2024
0bc1da9
prettier
LukasTy Apr 24, 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
105 changes: 49 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,55 +59,38 @@ commands:
description: 'Set to true if you intend to any browser (for example with playwright).'

steps:
- run:
name: View install environment
command: |
node --version
yarn --version
- restore_cache:
name: Restore yarn cache
keys:
- v8-yarn-{{ checksum "yarn.lock" }}
- run:
name: Set yarn cache folder
command: |
# Keep path in sync with `save_cache` for key "v8-yarn-"
yarn config set cache-folder /tmp/yarn-cache
# Debug information
yarn cache dir
yarn cache list
- 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: yarn --json list --pattern playwright > /tmp/playwright_info.json
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
- run:
name: Install js dependencies
command: yarn install
command: pnpm install
- when:
condition: << parameters.browsers >>
steps:
- run:
name: Install playwright browsers
command: npx playwright install --with-deps
- save_cache:
name: Save yarn cache
key: v8-yarn-{{ checksum "yarn.lock" }}
paths:
# Keep path in sync with "Set yarn cache folder"
# 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/yarn-cache
- when:
condition: << parameters.browsers >>
steps:
- save_cache:
name: Save playwright cache
key: v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
Expand All @@ -127,18 +110,24 @@ jobs:
command: git add -A && git diff --exit-code --staged
- run:
name: Check for duplicated packages
command: yarn deduplicate
command: |
if [[ $(git diff --name-status next | grep pnpm-lock) == "" ]];
then
echo "No changes to dependencies detected. Skipping..."
else
pnpm dedupe --check
fi
test_unit:
<<: *default-job
steps:
- checkout
- install_js
- run:
name: Tests charts
command: yarn test:charts:unit # Run special test for charts due to ESM compatibility issue
command: pnpm test:charts:unit # Run special test for charts due to ESM compatibility issue
- run:
name: Tests fake browser
command: yarn test:coverage
command: pnpm test:coverage
- run:
name: Check coverage generated
command: |
Expand All @@ -159,43 +148,47 @@ jobs:
- install_js
- run:
name: Eslint
command: yarn eslint:ci
command: pnpm eslint:ci
- run:
name: Lint JSON
command: yarn jsonlint
command: pnpm jsonlint
- run:
name: Lint Markdown
command: yarn markdownlint
command: pnpm markdownlint
test_static:
<<: *default-job
steps:
- checkout
- install_js
- run:
name: '`yarn prettier` changes committed?'
command: yarn prettier --check
name: '`pnpm prettier` changes committed?'
command: pnpm prettier --check
- run:
name: Generate PropTypes
command: yarn proptypes
command: pnpm proptypes
environment:
NODE_OPTIONS: --max-old-space-size=3584
- run:
name: '`yarn proptypes` changes committed?'
name: '`pnpm proptypes` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Generate the documentation
command: yarn docs:api
command: pnpm docs:api
environment:
NODE_OPTIONS: --max-old-space-size=3584
- run:
name: '`yarn docs:api` changes committed?'
name: '`pnpm docs:api` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Sync locale files
command: yarn l10n
command: pnpm l10n
- run:
name: '`yarn l10n` changes committed?'
name: '`pnpm l10n` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: '`yarn docs:link-check` changes committed?'
name: '`pnpm docs:link-check` changes committed?'
command: |
yarn docs:link-check
pnpm docs:link-check
git add -A && git diff --exit-code --staged
test_browser:
<<: *default-job
Expand All @@ -209,7 +202,7 @@ jobs:
browsers: true
- run:
name: Tests real browsers
command: yarn test:karma
command: pnpm test:karma
- store_artifacts:
# hardcoded in karma-webpack
path: /tmp/_karma_webpack_
Expand All @@ -221,15 +214,15 @@ jobs:
- install_js
- run:
name: Transpile TypeScript demos
command: yarn docs:typescript:formatted --disable-cache
command: pnpm docs:typescript:formatted --disable-cache
- run:
name: '`yarn docs:typescript:formatted` changes committed?'
name: '`pnpm docs:typescript:formatted` changes committed?'
command: git add -A && git diff --exit-code --staged
- run:
name: Tests TypeScript definitions
command: yarn typescript:ci
command: pnpm typescript:ci
environment:
NODE_OPTIONS: --max-old-space-size=2048
NODE_OPTIONS: --max-old-space-size=1536
test_e2e:
<<: *default-job
docker:
Expand All @@ -242,7 +235,7 @@ jobs:
browsers: true
- run:
name: Run e2e tests
command: yarn test:e2e
command: pnpm test:e2e
test_e2e_website:
<<: *default-job
docker:
Expand All @@ -254,8 +247,8 @@ jobs:
- install_js:
browsers: true
- run:
name: yarn test:e2e-website
command: yarn test:e2e-website
name: pnpm test:e2e-website
command: pnpm test:e2e-website
environment:
PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >>
test_regressions:
Expand All @@ -270,10 +263,10 @@ jobs:
browsers: true
- run:
name: Run visual regression tests
command: xvfb-run yarn test:regressions
command: xvfb-run pnpm test:regressions
- run:
name: Upload screenshots to Argos CI
command: yarn test:argos
command: pnpm test:argos
run_danger:
<<: *default-job
docker:
Expand All @@ -286,7 +279,7 @@ jobs:
browsers: true
- run:
name: Run danger on PRs
command: yarn danger ci --fail-on-errors
command: pnpm danger ci --fail-on-errors
environment:
DANGER_DISABLE_TRANSPILATION: 'true'
workflows:
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.git
pnpm-lock.yaml
netlify/functions
/docs/.next
/docs/export
/docs/pages/playground/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/l10n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'yarn' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
- run: yarn install
- name: yarn l10n --report
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
- run: pnpm install
- name: pnpm l10n --report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote -v
yarn l10n --report
pnpm l10n --report
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
engine-strict = true
auto-install-peers = true
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
enable-pre-post-scripts = true
5 changes: 0 additions & 5 deletions .yarnrc

This file was deleted.

10 changes: 5 additions & 5 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ module.exports = function getBabelConfig(api) {

const plugins = [
'babel-plugin-optimize-clsx',
// Need the following 3 proposals for all targets in .browserslistrc.
// Need the following 3 transforms for all targets in .browserslistrc.
// With our usage the transpiled loose mode is equivalent to spec mode.
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-private-methods', { loose: true }],
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
['@babel/plugin-transform-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
['@babel/plugin-transform-object-rest-spread', { loose: true }],
[
'@babel/plugin-transform-runtime',
{
Expand Down
6 changes: 3 additions & 3 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ function addL10nHelpMessage() {
'- [ ] Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)',
' > [l10n] Improve Swedish (sv-SE) locale',
' > [l10n] Add Danish (da-DK) locale',
'- [ ] Update the documentation of supported locales by running `yarn l10n`',
'- [ ] Update the documentation of supported locales by running `pnpm l10n`',
...(isAddingLocale
? [
'- [ ] Verify that you have added an export line in `src/locales/index.ts` for the new locale.',
'- [ ] Run `yarn docs:api` which should add your new translation to the list of exported interfaces.',
'- [ ] Run `pnpm docs:api` which should add your new translation to the list of exported interfaces.',
]
: []),
'- [ ] Clean files with `yarn prettier`.',
'- [ ] Clean files with `pnpm prettier`.',
'',
].join('\n'),
);
Expand Down
2 changes: 1 addition & 1 deletion docs/.link-check-errors.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Broken links found by `yarn docs:link-check` that exist:
Broken links found by `docs:link-check` that exist:

7 changes: 4 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ This is the documentation website of MUI X.
To start the docs site in development mode, from the project root, run:

```bash
yarn && yarn docs:dev
pnpm i && pnpm docs:dev
```

If you do not have yarn installed, select your OS and follow the instructions on the [Yarn website](https://yarnpkg.com/lang/en/docs/install/#mac-stable).
DO NOT USE npm, use Yarn to install the dependencies.
If you do not have pnpm installed, follow the instructions on the [pnpm website](https://pnpm.io/installation).

_DO NOT USE NPM, use pnpm to install the dependencies._

## How can I add a new demo to the documentation?

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator/';
import { useDemoData } from '@mui/x-data-grid-generator';

export default function RowPinningWithPagination() {
const { data } = useDemoData({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator/';
import { useDemoData } from '@mui/x-data-grid-generator';

export default function RowPinningWithPagination() {
const { data } = useDemoData({
Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default withDocsInfra({

return map;
},
// Used to signal we run yarn build
// Used to signal we run build
...(process.env.NODE_ENV === 'production'
? {
output: 'export',
Expand Down
Loading
Loading