Skip to content

Commit 47532de

Browse files
authored
Switch from yarn classic to pnpm (#5184)
1 parent 87e1049 commit 47532de

File tree

15 files changed

+8042
-6022
lines changed

15 files changed

+8042
-6022
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* @matrix-org/element-web-reviewers
22
/.github/workflows/** @matrix-org/element-web-team
33
/package.json @matrix-org/element-web-team
4-
/yarn.lock @matrix-org/element-web-team
4+
/pnpm-lock.yaml @matrix-org/element-web-team
55
/scripts/** @matrix-org/element-web-team
66
/src/webrtc @matrix-org/element-call-reviewers
77
/src/matrixrtc @matrix-org/element-call-reviewers

.github/workflows/release-drafter-workflow.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ jobs:
2121
ref: staging
2222
fetch-depth: 0
2323

24+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
2425
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
2526
with:
2627
node-version-file: package.json
27-
cache: "yarn"
28+
cache: "pnpm"
2829

2930
- name: Install Deps
30-
run: "yarn install --frozen-lockfile"
31+
run: "pnpm install --frozen-lockfile"
3132

3233
- uses: t3chguy/release-drafter@105e541c2c3d857f032bd522c0764694758fabad
3334
id: draft-release

.github/workflows/release-gitflow.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ jobs:
3333
sparse-checkout: |
3434
scripts/release
3535
36+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
3637
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
3738
with:
38-
cache: "yarn"
39+
cache: "pnpm"
3940
node-version-file: package.json
4041

4142
- name: Install Deps
42-
run: "yarn install --frozen-lockfile"
43+
run: "pnpm install --frozen-lockfile"
4344

4445
- name: Set up git
4546
run: |
@@ -73,7 +74,7 @@ jobs:
7374
fi
7475
7576
echo "Resetting $PACKAGE to develop branch..."
76-
yarn add "github:matrix-org/$PACKAGE#develop"
77+
pnpm add "github:matrix-org/$PACKAGE#develop"
7778
git add -u
7879
git commit -m "Reset $PACKAGE back to develop branch"
7980
done <<< "$DEPENDENCIES"

.github/workflows/release-make.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,14 @@ jobs:
123123
git config --global user.email "releases@riot.im"
124124
git config --global user.name "RiotRobot"
125125
126+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
126127
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
127128
with:
128-
cache: "yarn"
129+
cache: "pnpm"
129130
node-version-file: package.json
130131

131132
- name: Install dependencies
132-
run: "yarn install --frozen-lockfile"
133+
run: "pnpm install --frozen-lockfile"
133134

134135
- name: Handle develop dependencies
135136
run: |
@@ -140,14 +141,14 @@ jobs:
140141
VERSION=${dep[1]}
141142
142143
echo "::warning title=Develop dependency found::$DEPENDENCY will be kept at $VERSION"
143-
yarn upgrade "$PACKAGE@$VERSION" --exact
144+
pnpm add "$PACKAGE@$VERSION" --save-exact
144145
git add -u
145146
git commit -m "Keep $PACKAGE at $VERSION"
146147
done
147148
148149
- name: Bump package.json version
149150
run: |
150-
yarn version --no-git-tag-version --new-version "${VERSION#v}"
151+
pnpm version --no-git-tag-version "${VERSION#v}"
151152
git add package.json
152153
153154
- name: Add to CHANGELOG.md
@@ -175,7 +176,7 @@ jobs:
175176

176177
- name: Build assets
177178
if: steps.prepare.outputs.has-dist-script == '1'
178-
run: DIST_VERSION="$VERSION" yarn dist
179+
run: DIST_VERSION="$VERSION" pnpm dist
179180

180181
- name: Upload release assets & signatures
181182
if: inputs.asset-path

.github/workflows/release-npm.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ jobs:
2121
with:
2222
ref: staging
2323

24-
- name: 🔧 Yarn cache
24+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
25+
- name: 🔧 pnpm cache
2526
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
2627
with:
27-
cache: "yarn"
28+
cache: "pnpm"
2829
registry-url: "https://registry.npmjs.org"
2930
node-version-file: package.json
3031

@@ -33,7 +34,7 @@ jobs:
3334
run: npm install -g npm@latest
3435

3536
- name: 🔨 Install dependencies
36-
run: "yarn install --frozen-lockfile"
37+
run: "pnpm install --frozen-lockfile"
3738

3839
- name: 🚀 Publish to npm
3940
id: npm-publish

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ jobs:
5050
ref: staging
5151
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
5252

53+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
5354
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
5455
with:
55-
cache: "yarn"
56+
cache: "pnpm"
5657
node-version: "lts/*"
5758

5859
- name: Bump dependency
@@ -61,8 +62,8 @@ jobs:
6162
run: |
6263
git config --global user.email "releases@riot.im"
6364
git config --global user.name "RiotRobot"
64-
yarn upgrade "$DEPENDENCY" --exact
65-
git add package.json yarn.lock
65+
pnpm add "$DEPENDENCY" --save-exact
66+
git add package.json pnpm-lock.yaml
6667
git commit -am"Upgrade dependency to $DEPENDENCY"
6768
git push origin staging
6869
@@ -75,17 +76,18 @@ jobs:
7576
- name: 🧮 Checkout code
7677
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
7778

78-
- name: 🔧 Yarn cache
79+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
80+
- name: 🔧 pnpm cache
7981
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
8082
with:
81-
cache: "yarn"
83+
cache: "pnpm"
8284
node-version-file: package.json
8385

8486
- name: 🔨 Install dependencies
85-
run: "yarn install --frozen-lockfile"
87+
run: "pnpm install --frozen-lockfile"
8688

8789
- name: 📖 Generate docs
88-
run: yarn gendoc
90+
run: pnpm gendoc
8991

9092
- name: Upload artifact
9193
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4

.github/workflows/static_analysis.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,56 +16,53 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1818

19+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
1920
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
2021
with:
21-
cache: "yarn"
22+
cache: "pnpm"
2223
node-version-file: package.json
2324

2425
- name: Install Deps
25-
run: "yarn install"
26+
run: "pnpm install"
2627

2728
- name: Typecheck
28-
run: "yarn run lint:types"
29+
run: "pnpm run lint:types"
2930

3031
js_lint:
3132
name: "ESLint"
3233
runs-on: ubuntu-24.04
3334
steps:
3435
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
3536

37+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
3638
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
3739
with:
38-
cache: "yarn"
40+
cache: "pnpm"
3941
node-version-file: package.json
4042

4143
- name: Install Deps
42-
run: "yarn install"
44+
run: "pnpm install"
4345

4446
- name: Run Linter
45-
run: "yarn run lint:js"
47+
run: "pnpm run lint:js"
4648

4749
node_example_lint:
4850
name: "Node.js example"
4951
runs-on: ubuntu-latest
5052
steps:
5153
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
5254

55+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
5356
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
5457
with:
55-
cache: "yarn"
58+
cache: "pnpm"
5659
node-version-file: package.json
5760

5861
- name: Install Deps
59-
run: "yarn install"
62+
run: "pnpm install"
6063

6164
- name: Build Types
62-
run: "yarn build:types"
63-
64-
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
65-
with:
66-
cache: "npm"
67-
node-version-file: "examples/node/package.json"
68-
# cache-dependency-path: '**/package-lock.json'
65+
run: "pnpm build:types"
6966

7067
- name: Install Example Deps
7168
run: "npm install"
@@ -85,33 +82,35 @@ jobs:
8582
steps:
8683
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
8784

85+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
8886
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
8987
with:
90-
cache: "yarn"
88+
cache: "pnpm"
9189
node-version-file: package.json
9290

9391
- name: Install Deps
94-
run: "yarn install --frozen-lockfile"
92+
run: "pnpm install --frozen-lockfile"
9593

9694
- name: Run Linter
97-
run: "yarn lint:workflows"
95+
run: "pnpm lint:workflows"
9896

9997
docs:
10098
name: "JSDoc Checker"
10199
runs-on: ubuntu-24.04
102100
steps:
103101
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
104102

103+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
105104
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
106105
with:
107-
cache: "yarn"
106+
cache: "pnpm"
108107
node-version-file: package.json
109108

110109
- name: Install Deps
111-
run: "yarn install"
110+
run: "pnpm install"
112111

113112
- name: Generate Docs
114-
run: "yarn run gendoc --treatWarningsAsErrors --suppressCommentWarningsInDeclarationFiles"
113+
run: "pnpm run gendoc --treatWarningsAsErrors --suppressCommentWarningsInDeclarationFiles"
115114

116115
- name: Upload Artifact
117116
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
@@ -127,16 +126,17 @@ jobs:
127126
steps:
128127
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
129128

129+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
130130
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
131131
with:
132-
cache: "yarn"
132+
cache: "pnpm"
133133
node-version-file: package.json
134134

135135
- name: Install Deps
136-
run: "yarn install --frozen-lockfile"
136+
run: "pnpm install --frozen-lockfile"
137137

138138
- name: Run linter
139-
run: "yarn run lint:knip"
139+
run: "pnpm run lint:knip"
140140

141141
element-web:
142142
name: Downstream tsc element-web
@@ -147,9 +147,10 @@ jobs:
147147
with:
148148
repository: element-hq/element-web
149149

150+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
150151
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
151152
with:
152-
cache: "yarn"
153+
cache: "pnpm"
153154
node-version: "lts/*"
154155

155156
- name: Install Dependencies
@@ -159,7 +160,7 @@ jobs:
159160
JS_SDK_GITHUB_BASE_REF: ${{ github.sha }}
160161

161162
- name: Typecheck
162-
run: "yarn run lint:types"
163+
run: "pnpm run lint:types"
163164

164165
# Hook for branch protection to skip downstream typechecking outside of merge queues
165166
downstream:

.github/workflows/tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,24 @@ jobs:
2424
- name: Checkout code
2525
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
2626

27+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
2728
- name: Setup Node
2829
id: setupNode
2930
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
3031
with:
31-
cache: "yarn"
32+
cache: "pnpm"
3233
node-version: ${{ matrix.node }}
3334

3435
- name: Install dependencies
35-
run: "yarn install"
36+
run: "pnpm install"
3637

3738
- name: Get number of CPU cores
3839
id: cpu-cores
3940
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2
4041

4142
- name: Run tests
4243
run: |
43-
yarn test \
44+
pnpm test \
4445
--coverage=${{ env.ENABLE_COVERAGE }} \
4546
--maxWorkers ${{ steps.cpu-cores.outputs.count }} \
4647
./spec/${{ matrix.specs }}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
/.npmrc
55
/*.log
6+
pnpm-lock.yaml
67
package-lock.json
78
.lock-wscript
89
build/Release

0 commit comments

Comments
 (0)