Skip to content

Commit bc6ca26

Browse files
authored
Merge pull request #986 from rust-lang/pnpm
2 parents de38725 + 78ea3e9 commit bc6ca26

File tree

9 files changed

+7599
-6784
lines changed

9 files changed

+7599
-6784
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,40 @@ jobs:
154154
uses: actions/checkout@v3
155155
with:
156156
ref: "${{ github.event.pull_request.head.sha }}"
157-
- name: Get yarn cache directory path
158-
id: yarn-cache-dir-path
159-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
160-
- name: Cache yarn intermediate products
161-
uses: actions/cache@v3
162-
with:
163-
path: "${{ steps.yarn-cache-dir-path.outputs.dir }}"
164-
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
165-
restore-keys: "${{ runner.os }}-yarn-"
166157
- name: Configure node
167158
uses: actions/setup-node@v3
168159
with:
169160
node-version: 18.14
161+
- name: Get pnpm version from package.json
162+
id: pnpm-version
163+
run: 'echo "pnpm_version=$(node -p ''require(`./ui/frontend/package.json`).engines.pnpm'')" >> $GITHUB_OUTPUT
164+
165+
'
166+
- name: Install pnpm
167+
uses: pnpm/action-setup@v2.4.0
168+
with:
169+
version: "${{ steps.pnpm-version.outputs.pnpm_version }}"
170+
- name: Get pnpm store directory
171+
id: pnpm-cache-dir-path
172+
run: 'echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
173+
174+
'
175+
- name: Cache pnpm intermediate products
176+
uses: actions/cache@v3
177+
with:
178+
path: "${{ steps.pnpm-cache-dir-path.outputs.dir }}"
179+
key: "${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}"
180+
restore-keys: "${{ runner.os }}-pnpm-\n"
170181
- name: Install dependencies
171-
run: yarn --cwd ui/frontend/
182+
run: pnpm --dir ui/frontend/ install
172183
- name: Run tests
173-
run: yarn --cwd ui/frontend/ test
184+
run: pnpm --dir ui/frontend/ run test
174185
- name: Lint
175-
run: yarn --cwd ui/frontend/ test:lint
186+
run: pnpm --dir ui/frontend/ run test:lint
176187
- name: Style
177-
run: yarn --cwd ui/frontend/ test:style
188+
run: pnpm --dir ui/frontend/ run test:style
178189
- name: Build frontend
179-
run: yarn --cwd ui/frontend/ run build:production
190+
run: pnpm --dir ui/frontend/ run build:production
180191
- name: Save frontend artifact
181192
uses: actions/upload-artifact@v3
182193
with:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ perform tests on! Once fixed, you can choose to be credited here.
8686
### Build the UI
8787
```
8888
cd ui/frontend
89-
yarn
90-
yarn run watch # Will rebuild and watch for changes
89+
pnpm install
90+
pnpm watch # Will rebuild and watch for changes
9191
```
9292

9393
If you don't need the backend running because you are only making

ci/workflows.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -249,42 +249,53 @@ workflows:
249249
steps:
250250
- *checkout_pr
251251

252-
- name: "Get yarn cache directory path"
253-
id: yarn-cache-dir-path
254-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
255-
256-
- name: "Cache yarn intermediate products"
257-
uses: actions/cache@v3
258-
with:
259-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
260-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
261-
restore-keys: |-
262-
${{ runner.os }}-yarn-
263-
264252
- name: "Configure node"
265253
uses: actions/setup-node@v3
266254
with:
267255
node-version: 18.14
268256

257+
- name: "Get pnpm version from package.json"
258+
id: pnpm-version
259+
run: |
260+
echo "pnpm_version=$(node -p 'require(`./ui/frontend/package.json`).engines.pnpm')" >> $GITHUB_OUTPUT
261+
262+
- name: "Install pnpm"
263+
uses: pnpm/action-setup@v2.4.0
264+
with:
265+
version: ${{ steps.pnpm-version.outputs.pnpm_version }}
266+
267+
- name: "Get pnpm store directory"
268+
id: pnpm-cache-dir-path
269+
run: |
270+
echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
271+
272+
- name: "Cache pnpm intermediate products"
273+
uses: actions/cache@v3
274+
with:
275+
path: ${{ steps.pnpm-cache-dir-path.outputs.dir }}
276+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
277+
restore-keys: |
278+
${{ runner.os }}-pnpm-
279+
269280
- name: "Install dependencies"
270281
run: >-
271-
yarn --cwd ui/frontend/
282+
pnpm --dir ui/frontend/ install
272283
273284
- name: "Run tests"
274285
run: >-
275-
yarn --cwd ui/frontend/ test
286+
pnpm --dir ui/frontend/ run test
276287
277288
- name: "Lint"
278289
run: >-
279-
yarn --cwd ui/frontend/ test:lint
290+
pnpm --dir ui/frontend/ run test:lint
280291
281292
- name: "Style"
282293
run: >-
283-
yarn --cwd ui/frontend/ test:style
294+
pnpm --dir ui/frontend/ run test:style
284295
285296
- name: "Build frontend"
286297
run: >-
287-
yarn --cwd ui/frontend/ run build:production
298+
pnpm --dir ui/frontend/ run build:production
288299
289300
- name: "Save frontend artifact"
290301
uses: actions/upload-artifact@v3

ui/frontend/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.eslintcache
22
build
33
node_modules
4-
yarn-error.log

ui/frontend/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pnpm-lock.yaml
2+
13
build
24
node_modules
35

ui/frontend/package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"common-tags": "^1.8.0",
1111
"core-js": "^3.1.3",
1212
"history": "^5.3.0",
13+
"immer": "^9.0.0",
1314
"isomorphic-fetch": "^3.0.0",
1415
"lodash-es": "^4.17.21",
1516
"monaco-editor": "^0.36.1",
@@ -23,6 +24,7 @@
2324
"react-prism": "^4.0.0",
2425
"react-redux": "^8.0.2",
2526
"react-shadow": "^20.0.0",
27+
"redux-thunk": "^2.4.2",
2628
"route-parser": "^0.0.5",
2729
"split-grid": "^1.0.9",
2830
"suspend-react": "^0.1.3",
@@ -82,26 +84,23 @@
8284
"webpack": "^5.24.3",
8385
"webpack-cli": "^5.0.1"
8486
},
85-
"resolutions": {
86-
"//": "https://github.com/isaacs/jackspeak/issues/5",
87-
"jackspeak": "2.0.3"
88-
},
8987
"engines": {
90-
"node": "^18.14"
88+
"node": "^18.14",
89+
"pnpm": "^8.9"
9190
},
9291
"scripts": {
9392
"test": "jest",
9493
"test:lint": "eslint '**/*.tsx' '**/*.ts'",
9594
"test:lint:fix": "eslint --fix '**/*.tsx' '**/*.ts'",
96-
"test:style": "yarn run test:style:prettier && yarn run test:style:stylelint",
97-
"test:style:fix": "yarn run test:style:prettier:fix && yarn run test:style:stylelint:fix",
95+
"test:style": "pnpm run test:style:prettier && pnpm run test:style:stylelint",
96+
"test:style:fix": "pnpm run test:style:prettier:fix && pnpm run test:style:stylelint:fix",
9897
"test:style:prettier": "prettier --check .",
9998
"test:style:prettier:fix": "prettier --write .",
10099
"test:style:stylelint": "stylelint '**/*.css'",
101100
"test:style:stylelint:fix": "stylelint --fix '**/*.css'",
102101
"build": "webpack --progress --color --mode development",
103102
"build:production": "webpack --progress --color --mode production",
104-
"watch": "yarn run build --watch"
103+
"watch": "pnpm run build --watch"
105104
},
106105
"jest": {
107106
"transform": {

0 commit comments

Comments
 (0)