Skip to content

Commit 931fd6e

Browse files
LukasTyJCQuintas
andauthored
[code-infra] Change package manager to pnpm (#11875)
Signed-off-by: Lukas <[email protected]> Co-authored-by: Jose Quintas <[email protected]>
1 parent 5a39f7f commit 931fd6e

File tree

97 files changed

+18531
-15907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+18531
-15907
lines changed

.circleci/config.yml

Lines changed: 49 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -59,55 +59,38 @@ commands:
5959
description: 'Set to true if you intend to any browser (for example with playwright).'
6060

6161
steps:
62-
- run:
63-
name: View install environment
64-
command: |
65-
node --version
66-
yarn --version
67-
- restore_cache:
68-
name: Restore yarn cache
69-
keys:
70-
- v8-yarn-{{ checksum "yarn.lock" }}
71-
- run:
72-
name: Set yarn cache folder
73-
command: |
74-
# Keep path in sync with `save_cache` for key "v8-yarn-"
75-
yarn config set cache-folder /tmp/yarn-cache
76-
# Debug information
77-
yarn cache dir
78-
yarn cache list
7962
- when:
8063
condition: << parameters.browsers >>
8164
steps:
65+
- run:
66+
name: Install pnpm package manager
67+
command: |
68+
corepack enable
69+
corepack prepare pnpm@latest-8 --activate
8270
- run:
8371
name: Prepare playwright hash
84-
command: yarn --json list --pattern playwright > /tmp/playwright_info.json
72+
command: pnpm list --json --filter playwright > /tmp/playwright_info.json
8573
- store_artifacts:
8674
name: Debug playwright hash
8775
path: /tmp/playwright_info.json
8876
- restore_cache:
8977
name: Restore playwright cache
9078
keys:
9179
- v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
80+
- run:
81+
name: View install environment
82+
command: |
83+
node --version
84+
pnpm --version
9285
- run:
9386
name: Install js dependencies
94-
command: yarn install
87+
command: pnpm install
9588
- when:
9689
condition: << parameters.browsers >>
9790
steps:
9891
- run:
9992
name: Install playwright browsers
10093
command: npx playwright install --with-deps
101-
- save_cache:
102-
name: Save yarn cache
103-
key: v8-yarn-{{ checksum "yarn.lock" }}
104-
paths:
105-
# Keep path in sync with "Set yarn cache folder"
106-
# 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)
107-
- /tmp/yarn-cache
108-
- when:
109-
condition: << parameters.browsers >>
110-
steps:
11194
- save_cache:
11295
name: Save playwright cache
11396
key: v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
@@ -127,18 +110,24 @@ jobs:
127110
command: git add -A && git diff --exit-code --staged
128111
- run:
129112
name: Check for duplicated packages
130-
command: yarn deduplicate
113+
command: |
114+
if [[ $(git diff --name-status next | grep pnpm-lock) == "" ]];
115+
then
116+
echo "No changes to dependencies detected. Skipping..."
117+
else
118+
pnpm dedupe --check
119+
fi
131120
test_unit:
132121
<<: *default-job
133122
steps:
134123
- checkout
135124
- install_js
136125
- run:
137126
name: Tests charts
138-
command: yarn test:charts:unit # Run special test for charts due to ESM compatibility issue
127+
command: pnpm test:charts:unit # Run special test for charts due to ESM compatibility issue
139128
- run:
140129
name: Tests fake browser
141-
command: yarn test:coverage
130+
command: pnpm test:coverage
142131
- run:
143132
name: Check coverage generated
144133
command: |
@@ -159,43 +148,47 @@ jobs:
159148
- install_js
160149
- run:
161150
name: Eslint
162-
command: yarn eslint:ci
151+
command: pnpm eslint:ci
163152
- run:
164153
name: Lint JSON
165-
command: yarn jsonlint
154+
command: pnpm jsonlint
166155
- run:
167156
name: Lint Markdown
168-
command: yarn markdownlint
157+
command: pnpm markdownlint
169158
test_static:
170159
<<: *default-job
171160
steps:
172161
- checkout
173162
- install_js
174163
- run:
175-
name: '`yarn prettier` changes committed?'
176-
command: yarn prettier --check
164+
name: '`pnpm prettier` changes committed?'
165+
command: pnpm prettier --check
177166
- run:
178167
name: Generate PropTypes
179-
command: yarn proptypes
168+
command: pnpm proptypes
169+
environment:
170+
NODE_OPTIONS: --max-old-space-size=3584
180171
- run:
181-
name: '`yarn proptypes` changes committed?'
172+
name: '`pnpm proptypes` changes committed?'
182173
command: git add -A && git diff --exit-code --staged
183174
- run:
184175
name: Generate the documentation
185-
command: yarn docs:api
176+
command: pnpm docs:api
177+
environment:
178+
NODE_OPTIONS: --max-old-space-size=3584
186179
- run:
187-
name: '`yarn docs:api` changes committed?'
180+
name: '`pnpm docs:api` changes committed?'
188181
command: git add -A && git diff --exit-code --staged
189182
- run:
190183
name: Sync locale files
191-
command: yarn l10n
184+
command: pnpm l10n
192185
- run:
193-
name: '`yarn l10n` changes committed?'
186+
name: '`pnpm l10n` changes committed?'
194187
command: git add -A && git diff --exit-code --staged
195188
- run:
196-
name: '`yarn docs:link-check` changes committed?'
189+
name: '`pnpm docs:link-check` changes committed?'
197190
command: |
198-
yarn docs:link-check
191+
pnpm docs:link-check
199192
git add -A && git diff --exit-code --staged
200193
test_browser:
201194
<<: *default-job
@@ -209,7 +202,7 @@ jobs:
209202
browsers: true
210203
- run:
211204
name: Tests real browsers
212-
command: yarn test:karma
205+
command: pnpm test:karma
213206
- store_artifacts:
214207
# hardcoded in karma-webpack
215208
path: /tmp/_karma_webpack_
@@ -221,15 +214,15 @@ jobs:
221214
- install_js
222215
- run:
223216
name: Transpile TypeScript demos
224-
command: yarn docs:typescript:formatted --disable-cache
217+
command: pnpm docs:typescript:formatted --disable-cache
225218
- run:
226-
name: '`yarn docs:typescript:formatted` changes committed?'
219+
name: '`pnpm docs:typescript:formatted` changes committed?'
227220
command: git add -A && git diff --exit-code --staged
228221
- run:
229222
name: Tests TypeScript definitions
230-
command: yarn typescript:ci
223+
command: pnpm typescript:ci
231224
environment:
232-
NODE_OPTIONS: --max-old-space-size=2048
225+
NODE_OPTIONS: --max-old-space-size=1536
233226
test_e2e:
234227
<<: *default-job
235228
docker:
@@ -242,7 +235,7 @@ jobs:
242235
browsers: true
243236
- run:
244237
name: Run e2e tests
245-
command: yarn test:e2e
238+
command: pnpm test:e2e
246239
test_e2e_website:
247240
<<: *default-job
248241
docker:
@@ -254,8 +247,8 @@ jobs:
254247
- install_js:
255248
browsers: true
256249
- run:
257-
name: yarn test:e2e-website
258-
command: yarn test:e2e-website
250+
name: pnpm test:e2e-website
251+
command: pnpm test:e2e-website
259252
environment:
260253
PLAYWRIGHT_TEST_BASE_URL: << parameters.e2e-base-url >>
261254
test_regressions:
@@ -270,10 +263,10 @@ jobs:
270263
browsers: true
271264
- run:
272265
name: Run visual regression tests
273-
command: xvfb-run yarn test:regressions
266+
command: xvfb-run pnpm test:regressions
274267
- run:
275268
name: Upload screenshots to Argos CI
276-
command: yarn test:argos
269+
command: pnpm test:argos
277270
run_danger:
278271
<<: *default-job
279272
docker:
@@ -286,7 +279,7 @@ jobs:
286279
browsers: true
287280
- run:
288281
name: Run danger on PRs
289-
command: yarn danger ci --fail-on-errors
282+
command: pnpm danger ci --fail-on-errors
290283
environment:
291284
DANGER_DISABLE_TRANSPILATION: 'true'
292285
workflows:

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/.git
2+
pnpm-lock.yaml
3+
netlify/functions
24
/docs/.next
35
/docs/export
46
/docs/pages/playground/

.github/workflows/l10n.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2323
with:
2424
node-version: 20
25-
cache: 'yarn' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
26-
- run: yarn install
27-
- name: yarn l10n --report
25+
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
26+
- run: pnpm install
27+
- name: pnpm l10n --report
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
run: |
3131
git remote -v
32-
yarn l10n --report
32+
pnpm l10n --report

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
engine-strict = true
2+
auto-install-peers = true
3+
enable-pre-post-scripts = true

.yarnrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

babel.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ module.exports = function getBabelConfig(api) {
5858

5959
const plugins = [
6060
'babel-plugin-optimize-clsx',
61-
// Need the following 3 proposals for all targets in .browserslistrc.
61+
// Need the following 3 transforms for all targets in .browserslistrc.
6262
// With our usage the transpiled loose mode is equivalent to spec mode.
63-
['@babel/plugin-proposal-class-properties', { loose: true }],
64-
['@babel/plugin-proposal-private-methods', { loose: true }],
65-
['@babel/plugin-proposal-private-property-in-object', { loose: true }],
66-
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
63+
['@babel/plugin-transform-class-properties', { loose: true }],
64+
['@babel/plugin-transform-private-methods', { loose: true }],
65+
['@babel/plugin-transform-private-property-in-object', { loose: true }],
66+
['@babel/plugin-transform-object-rest-spread', { loose: true }],
6767
[
6868
'@babel/plugin-transform-runtime',
6969
{

dangerfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ function addL10nHelpMessage() {
5959
'- [ ] Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)',
6060
' > [l10n] Improve Swedish (sv-SE) locale',
6161
' > [l10n] Add Danish (da-DK) locale',
62-
'- [ ] Update the documentation of supported locales by running `yarn l10n`',
62+
'- [ ] Update the documentation of supported locales by running `pnpm l10n`',
6363
...(isAddingLocale
6464
? [
6565
'- [ ] Verify that you have added an export line in `src/locales/index.ts` for the new locale.',
66-
'- [ ] Run `yarn docs:api` which should add your new translation to the list of exported interfaces.',
66+
'- [ ] Run `pnpm docs:api` which should add your new translation to the list of exported interfaces.',
6767
]
6868
: []),
69-
'- [ ] Clean files with `yarn prettier`.',
69+
'- [ ] Clean files with `pnpm prettier`.',
7070
'',
7171
].join('\n'),
7272
);

docs/.link-check-errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Broken links found by `yarn docs:link-check` that exist:
1+
Broken links found by `docs:link-check` that exist:
22

docs/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ This is the documentation website of MUI X.
55
To start the docs site in development mode, from the project root, run:
66

77
```bash
8-
yarn && yarn docs:dev
8+
pnpm i && pnpm docs:dev
99
```
1010

11-
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).
12-
DO NOT USE npm, use Yarn to install the dependencies.
11+
If you do not have pnpm installed, follow the instructions on the [pnpm website](https://pnpm.io/installation).
12+
13+
_DO NOT USE NPM, use pnpm to install the dependencies._
1314

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

docs/data/data-grid/row-pinning/RowPinningWithPagination.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { DataGridPro } from '@mui/x-data-grid-pro';
3-
import { useDemoData } from '@mui/x-data-grid-generator/';
3+
import { useDemoData } from '@mui/x-data-grid-generator';
44

55
export default function RowPinningWithPagination() {
66
const { data } = useDemoData({

0 commit comments

Comments
 (0)