Skip to content

Commit 53c67fb

Browse files
LG-4650: migrate from yarn to pnpm (#2612)
* WIP * Oops * ts-ignore * Test * Fix resolutions * Comment out file size job * Revert restore-key additions * Remove ts-nocheck comments * Add @types/react-dom to pnpm overrides * Run fresh install after adding r17 dev dependencies and comment out unresolvable ts error * Add r17 overrides to r17-packages.json * Try this * Rebase * Add @types/react back to pnpm.overrides * r17 dependencies * Fix dependencies * Remove testing library hoist * Try pnpm.overrides * pnpm React 17 (#2629) * update r17 packages & script * Update turbo.json * fix r17 build issues * add logging to build script * add type overrides * Lint install-react17 script * Fix date-picker spec * Fix lint * Fix chat stories * Changeset * Remove @ts-ignore comments * Update node and pnpm versions in github actions * Add comment to re-add sizeDiff job after PNPM migration * Feedback * Feedback pt2 * Update publish script in release flow * Update README * enable placeholder sizeDiff * add build timeout * temp disable build cache * restore cache * fix restore cache * update cache path * update cache path * build all * update save cache key * temp: only build cli * Revert "temp: only build cli" This reverts commit 367232d. * ensure same cache key across jobs * simplify cache path * actually fix cache path * revert complex glob * Fix/Ignore lint errors on pnpm (#2640) --------- Co-authored-by: Adam Thompson <[email protected]> Co-authored-by: Adam Thompson <[email protected]>
1 parent 7958d40 commit 53c67fb

File tree

268 files changed

+22805
-18806
lines changed

Some content is hidden

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

268 files changed

+22805
-18806
lines changed

.changeset/warm-waves-clap.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
'@leafygreen-ui/leafygreen-provider': patch
3+
'@leafygreen-ui/confirmation-modal': patch
4+
'@leafygreen-ui/inline-definition': patch
5+
'@leafygreen-ui/loading-indicator': patch
6+
'@leafygreen-ui/segmented-control': patch
7+
'@lg-tools/storybook-decorators': patch
8+
'@leafygreen-ui/expandable-card': patch
9+
'@leafygreen-ui/marketing-modal': patch
10+
'@leafygreen-ui/radio-box-group': patch
11+
'@leafygreen-ui/skeleton-loader': patch
12+
'@leafygreen-ui/password-input': patch
13+
'@lg-chat/fixed-chat-window': patch
14+
'@leafygreen-ui/info-sprinkle': patch
15+
'@lg-chat/message-feedback': patch
16+
'@leafygreen-ui/input-option': patch
17+
'@leafygreen-ui/number-input': patch
18+
'@leafygreen-ui/ordered-list': patch
19+
'@leafygreen-ui/search-input': patch
20+
'@leafygreen-ui/split-button': patch
21+
'@lg-tools/storybook-addon': patch
22+
'@lg-tools/storybook-utils': patch
23+
'@lg-chat/chat-disclaimer': patch
24+
'@lg-chat/message-prompts': patch
25+
'@leafygreen-ui/date-picker': patch
26+
'@leafygreen-ui/descendants': patch
27+
'@leafygreen-ui/empty-state': patch
28+
'@leafygreen-ui/form-footer': patch
29+
'@leafygreen-ui/icon-button': patch
30+
'@leafygreen-ui/polymorphic': patch
31+
'@leafygreen-ui/radio-group': patch
32+
'@leafygreen-ui/testing-lib': patch
33+
'@lg-tools/test-harnesses': patch
34+
'@lg-chat/message-rating': patch
35+
'@leafygreen-ui/date-utils': patch
36+
'@leafygreen-ui/form-field': patch
37+
'@leafygreen-ui/pagination': patch
38+
'@leafygreen-ui/text-input': patch
39+
'@leafygreen-ui/typography': patch
40+
'@leafygreen-ui/guide-cue': patch
41+
'@leafygreen-ui/text-area': patch
42+
'@lg-chat/message-feed': patch
43+
'@leafygreen-ui/checkbox': patch
44+
'@leafygreen-ui/combobox': patch
45+
'@leafygreen-ui/copyable': patch
46+
'@leafygreen-ui/pipeline': patch
47+
'@leafygreen-ui/side-nav': patch
48+
'@lg-chat/chat-window': patch
49+
'@lg-chat/lg-markdown': patch
50+
'@leafygreen-ui/callout': patch
51+
'@leafygreen-ui/palette': patch
52+
'@leafygreen-ui/popover': patch
53+
'@leafygreen-ui/stepper': patch
54+
'@leafygreen-ui/tooltip': patch
55+
'@lg-chat/rich-links': patch
56+
'@leafygreen-ui/avatar': patch
57+
'@leafygreen-ui/banner': patch
58+
'@leafygreen-ui/button': patch
59+
'@leafygreen-ui/portal': patch
60+
'@leafygreen-ui/ripple': patch
61+
'@leafygreen-ui/select': patch
62+
'@leafygreen-ui/toggle': patch
63+
'@leafygreen-ui/tokens': patch
64+
'@lg-chat/input-bar': patch
65+
'@lg-chat/title-bar': patch
66+
'@leafygreen-ui/badge': patch
67+
'@leafygreen-ui/hooks': patch
68+
'@leafygreen-ui/modal': patch
69+
'@leafygreen-ui/table': patch
70+
'@leafygreen-ui/toast': patch
71+
'@lg-tools/codemods': patch
72+
'@lg-tools/slackbot': patch
73+
'@lg-tools/validate': patch
74+
'@leafygreen-ui/a11y': patch
75+
'@leafygreen-ui/card': patch
76+
'@leafygreen-ui/chip': patch
77+
'@leafygreen-ui/code': patch
78+
'@leafygreen-ui/icon': patch
79+
'@leafygreen-ui/logo': patch
80+
'@leafygreen-ui/menu': patch
81+
'@leafygreen-ui/tabs': patch
82+
'@lg-tools/install': patch
83+
'@lg-chat/message': patch
84+
'@leafygreen-ui/box': patch
85+
'@leafygreen-ui/lib': patch
86+
'@lg-tools/create': patch
87+
'@lg-tools/update': patch
88+
'@lg-charts/core': patch
89+
'@lg-chat/avatar': patch
90+
'@lg-tools/build': patch
91+
'@lg-tools/link': patch
92+
'@lg-tools/lint': patch
93+
'@lg-tools/meta': patch
94+
'@lg-tools/test': patch
95+
'@lg-tools/cli': patch
96+
---
97+
98+
[LG-4650](https://jira.mongodb.org/browse/LG-4650): migrates from `yarn` to `pnpm`

.eslintrc.js

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

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
- [ ] I have added tests that prove my fix is effective or that my feature works
1212
- [ ] I have added necessary documentation (if appropriate)
13-
- [ ] I have run `yarn changeset` and documented my changes
13+
- [ ] I have run `pnpm changeset` and documented my changes
1414

1515
### For new components
1616

.github/workflows/clean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
- name: Cleanup
1717
run: |

.github/workflows/pr.yml

Lines changed: 106 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,92 +13,128 @@ jobs:
1313
build:
1414
name: Build packages
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 20 # Should not take more than 20 minutes to build
17+
outputs:
18+
cache-primary-key: ${{ steps.build-cache.outputs.cache-primary-key }}
1619
steps:
17-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1821

19-
- uses: actions/cache@v3
22+
- name: pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 9.15.0
26+
27+
- uses: actions/cache/restore@v4
2028
name: Check for build cache
2129
id: build-cache
2230
with:
31+
# Note: `path` doesn't like complex glob patterns (i.e. `+(charts|chat|packages|tools)`)
2332
path: |
24-
**/dist
25-
!**/node_modules
26-
key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }}
33+
charts/*/dist/*
34+
chat/*/dist/*
35+
packages/*/dist/*
36+
tools/*/dist/*
37+
key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/') }}
2738

2839
# Only setup & build if there was no build cache hit
2940
- name: Use Node 18
30-
uses: actions/setup-node@v3
41+
uses: actions/setup-node@v4
3142
if: ${{ steps.build-cache.outputs.cache-hit != 'true' }}
3243
with:
33-
node-version: '18'
34-
cache: yarn
35-
cache-dependency-path: 'yarn.lock'
44+
node-version: 18
45+
cache: 'pnpm'
46+
cache-dependency-path: 'pnpm-lock.yaml'
3647

3748
- name: Install
3849
if: ${{ steps.build-cache.outputs.cache-hit != 'true' }}
39-
run: yarn install --frozen-lockfile --prefer-offline
50+
run: pnpm install --frozen-lockfile --prefer-offline
4051

4152
- name: Build
4253
if: ${{ steps.build-cache.outputs.cache-hit != 'true' }}
43-
run: yarn build
54+
run: pnpm build
55+
56+
- uses: actions/cache/save@v4
57+
name: Save build cache
58+
if: ${{ steps.build-cache.outputs.cache-hit != 'true' }}
59+
with:
60+
path: |
61+
charts/*/dist/*
62+
chat/*/dist/*
63+
packages/*/dist/*
64+
tools/*/dist/*
65+
key: ${{ steps.build-cache.outputs.cache-primary-key }}
4466

4567
lint:
4668
name: Check lints
4769
runs-on: ubuntu-latest
4870
needs: [build]
4971
steps:
50-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
73+
74+
- name: pnpm
75+
uses: pnpm/action-setup@v4
76+
with:
77+
version: 9.15.0
5178

5279
- name: Use Node 18
53-
uses: actions/setup-node@v3
80+
uses: actions/setup-node@v4
5481
with:
55-
node-version: '18'
56-
cache: yarn
57-
cache-dependency-path: 'yarn.lock'
82+
node-version: 18
83+
cache: 'pnpm'
84+
cache-dependency-path: 'pnpm-lock.yaml'
5885

59-
- uses: actions/cache/restore@v3
86+
- uses: actions/cache/restore@v4
6087
name: Restore build cache
6188
id: build-cache
6289
with:
6390
path: |
64-
**/dist
65-
!**/node_modules
66-
key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }}
91+
charts/*/dist/*
92+
chat/*/dist/*
93+
packages/*/dist/*
94+
tools/*/dist/*
95+
key: ${{needs.build.outputs.cache-primary-key}}
6796

6897
- name: Install Dependencies
69-
run: yarn install --frozen-lockfile --prefer-offline
98+
run: pnpm install --frozen-lockfile --prefer-offline
7099

71100
- name: lint
72-
run: yarn lint
101+
run: pnpm lint
73102

74103
chromatic:
75104
name: Chromatic
76105
runs-on: ubuntu-latest
77106
needs: [build]
78107
steps:
79108
- name: Checkout
80-
uses: actions/checkout@v3
109+
uses: actions/checkout@v4
81110
with:
82111
fetch-depth: 0
83112

84-
- name: Use Node 18
85-
uses: actions/setup-node@v3
113+
- name: pnpm
114+
uses: pnpm/action-setup@v4
86115
with:
87-
node-version: '18'
88-
cache: yarn
89-
cache-dependency-path: 'yarn.lock'
116+
version: 9.15.0
90117

91-
- name: Install Dependencies
92-
run: yarn install --frozen-lockfile --prefer-offline
118+
- name: Use Node 18
119+
uses: actions/setup-node@v4
120+
with:
121+
node-version: 18
122+
cache: 'pnpm'
123+
cache-dependency-path: 'pnpm-lock.yaml'
93124

94-
- uses: actions/cache/restore@v3
125+
- uses: actions/cache/restore@v4
95126
name: Restore build cache
96127
id: build-cache
97128
with:
98129
path: |
99-
**/dist
100-
!**/node_modules
101-
key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }}
130+
charts/*/dist/*
131+
chat/*/dist/*
132+
packages/*/dist/*
133+
tools/*/dist/*
134+
key: ${{needs.build.outputs.cache-primary-key}}
135+
136+
- name: Install Dependencies
137+
run: pnpm install --frozen-lockfile --prefer-offline
102138

103139
- name: Publish to Chromatic
104140
env:
@@ -116,29 +152,36 @@ jobs:
116152
runs-on: ubuntu-latest
117153
needs: [build]
118154
steps:
119-
- uses: actions/checkout@v3
155+
- uses: actions/checkout@v4
156+
157+
- name: pnpm
158+
uses: pnpm/action-setup@v4
159+
with:
160+
version: 9.15.0
120161

121162
- name: Use Node 18
122-
uses: actions/setup-node@v3
163+
uses: actions/setup-node@v4
123164
with:
124-
node-version: '18'
125-
cache: yarn
126-
cache-dependency-path: 'yarn.lock'
165+
node-version: 18
166+
cache: 'pnpm'
167+
cache-dependency-path: 'pnpm-lock.yaml'
127168

128169
- name: Install Dependencies
129-
run: yarn install --frozen-lockfile --prefer-offline
170+
run: pnpm install --frozen-lockfile --prefer-offline
130171

131-
- uses: actions/cache/restore@v3
172+
- uses: actions/cache/restore@v4
132173
name: Restore build cache
133174
id: build-cache
134175
with:
135176
path: |
136-
**/dist
137-
!**/node_modules
138-
key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }}
177+
charts/*/dist/*
178+
chat/*/dist/*
179+
packages/*/dist/*
180+
tools/*/dist/*
181+
key: ${{needs.build.outputs.cache-primary-key}}
139182

140183
- name: tests
141-
run: yarn test --ci
184+
run: pnpm run test --ci
142185
env:
143186
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
144187

@@ -147,26 +190,33 @@ jobs:
147190
runs-on: ubuntu-latest
148191
needs: [build]
149192
steps:
150-
- uses: actions/checkout@v3
193+
- uses: actions/checkout@v4
194+
195+
- name: pnpm
196+
uses: pnpm/action-setup@v4
197+
with:
198+
version: 9.15.0
151199

152200
- name: Use Node 18
153-
uses: actions/setup-node@v3
201+
uses: actions/setup-node@v4
154202
with:
155-
node-version: '18'
156-
cache: yarn
157-
cache-dependency-path: 'yarn.lock'
203+
node-version: 18
204+
cache: 'pnpm'
205+
cache-dependency-path: 'pnpm-lock.yaml'
158206

159207
- name: Install Dependencies
160-
run: yarn install --frozen-lockfile --prefer-offline
208+
run: pnpm install --frozen-lockfile --prefer-offline
161209

162-
- uses: actions/cache/restore@v3
210+
- uses: actions/cache/restore@v4
163211
name: Restore build cache
164212
id: build-cache
165213
with:
166214
path: |
167-
**/dist
168-
!**/node_modules
169-
key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }}
215+
charts/*/dist/*
216+
chat/*/dist/*
217+
packages/*/dist/*
218+
tools/*/dist/*
219+
key: ${{needs.build.outputs.cache-primary-key}}
170220

171221
- name: validate
172-
run: yarn validate
222+
run: pnpm validate

0 commit comments

Comments
 (0)