Skip to content

Commit 4eefedf

Browse files
authored
chore: migrate workspace from yarn to pnpm (#648)
1 parent 31f38df commit 4eefedf

File tree

12 files changed

+4948
-4025
lines changed

12 files changed

+4948
-4025
lines changed

.github/workflows/build-test.yml

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,25 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v4
1919

20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 10.30.3
24+
run_install: false
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version-file: .nvmrc
30+
2031
- name: Install node_modules
2132
uses: OffchainLabs/actions/node-modules/install@main
33+
with:
34+
install-command: pnpm install --frozen-lockfile
35+
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
2236

2337
- name: Run audit
24-
run: yarn audit:ci
38+
run: pnpm audit:ci
2539

2640
check-formatting:
2741
name: 'Check Formatting'
@@ -30,11 +44,25 @@ jobs:
3044
- name: Checkout
3145
uses: actions/checkout@v4
3246

47+
- name: Setup pnpm
48+
uses: pnpm/action-setup@v4
49+
with:
50+
version: 10.30.3
51+
run_install: false
52+
53+
- name: Setup Node.js
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version-file: .nvmrc
57+
3358
- name: Install node_modules
3459
uses: OffchainLabs/actions/node-modules/install@main
60+
with:
61+
install-command: pnpm install --frozen-lockfile
62+
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
3563

3664
- name: Check formatting with Prettier
37-
run: yarn prettier:check
65+
run: pnpm prettier:check
3866

3967
test-type:
4068
name: Test (Type)
@@ -43,17 +71,31 @@ jobs:
4371
- name: Checkout
4472
uses: actions/checkout@v4
4573

74+
- name: Setup pnpm
75+
uses: pnpm/action-setup@v4
76+
with:
77+
version: 10.30.3
78+
run_install: false
79+
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v4
82+
with:
83+
node-version-file: .nvmrc
84+
4685
- name: Install node_modules
4786
uses: OffchainLabs/actions/node-modules/install@main
87+
with:
88+
install-command: pnpm install --frozen-lockfile
89+
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
4890

4991
- name: Copy .env
5092
run: cp ./.env.example ./.env
5193

5294
- name: Build
53-
run: yarn build
95+
run: pnpm build
5496

5597
- name: Test
56-
run: yarn test:type
98+
run: pnpm test:type
5799

58100
test-unit:
59101
name: Test (Unit)
@@ -62,17 +104,31 @@ jobs:
62104
- name: Checkout
63105
uses: actions/checkout@v4
64106

107+
- name: Setup pnpm
108+
uses: pnpm/action-setup@v4
109+
with:
110+
version: 10.30.3
111+
run_install: false
112+
113+
- name: Setup Node.js
114+
uses: actions/setup-node@v4
115+
with:
116+
node-version-file: .nvmrc
117+
65118
- name: Install node_modules
66119
uses: OffchainLabs/actions/node-modules/install@main
120+
with:
121+
install-command: pnpm install --frozen-lockfile
122+
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
67123

68124
- name: Copy .env
69125
run: cp ./.env.example ./.env
70126

71127
- name: Build
72-
run: yarn build
128+
run: pnpm build
73129

74130
- name: Test
75-
run: yarn test:unit
131+
run: pnpm test:unit
76132

77133
test-integration:
78134
name: Test (Integration) - ${{ matrix.config.name }}
@@ -104,8 +160,22 @@ jobs:
104160
- name: Checkout
105161
uses: actions/checkout@v4
106162

163+
- name: Setup pnpm
164+
uses: pnpm/action-setup@v4
165+
with:
166+
version: 10.30.3
167+
run_install: false
168+
169+
- name: Setup Node.js
170+
uses: actions/setup-node@v4
171+
with:
172+
node-version-file: .nvmrc
173+
107174
- name: Install node_modules
108175
uses: OffchainLabs/actions/node-modules/install@main
176+
with:
177+
install-command: pnpm install --frozen-lockfile
178+
cache-key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
109179

110180
- name: Set up the local node
111181
uses: OffchainLabs/actions/run-nitro-test-node@feat-simplify
@@ -118,10 +188,10 @@ jobs:
118188
run: cp ./.env.example ./.env
119189

120190
- name: Build
121-
run: yarn build
191+
run: pnpm build
122192

123193
- name: Test
124194
run: |
125195
INTEGRATION_TEST_DECIMALS=${{matrix.config.decimals}} \
126196
INTEGRATION_TEST_NITRO_CONTRACTS_BRANCH=${{matrix.config.nitro-contracts-branch}} \
127-
yarn test:integration
197+
pnpm test:integration

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TypeScript SDK for [building Arbitrum chains](https://docs.arbitrum.io/launch-ar
77
Make sure you are using Node.js v18 or greater.
88

99
```bash
10-
yarn add @arbitrum/chain-sdk viem@^1.20.0
10+
pnpm add @arbitrum/chain-sdk viem@^1.20.0
1111
```
1212

1313
## Run integration tests
@@ -21,7 +21,7 @@ Clone the branch `release` of [nitro-testnode](https://github.com/OffchainLabs/n
2121
Then, run the integration tests:
2222

2323
```bash
24-
yarn test:integration
24+
pnpm test:integration
2525
```
2626

2727
## Examples

examples/create-rollup-custom-fee-token/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ await createRollup({
3737
1. Install dependencies
3838

3939
```bash
40-
yarn install
40+
pnpm install
4141
```
4242

4343
2. Create .env file and add the env vars
@@ -48,9 +48,9 @@ await createRollup({
4848

4949
3. Run the example
5050
```bash
51-
yarn dev
51+
pnpm dev
5252
```
5353

54-
There is an option to deploy the rollup contracts using more low-level methods as demonstrated in `low_level.ts` or `yarn dev:low-level`.
54+
There is an option to deploy the rollup contracts using more low-level methods as demonstrated in `low_level.ts` or `pnpm dev:low-level`.
5555

5656
[Read full documentation](https://docs.arbitrum.io/launch-orbit-chain/how-tos/orbit-sdk-deploying-custom-gas-token-chain)

examples/create-rollup-eth/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ await createRollup({
3333
1. Install dependencies
3434

3535
```bash
36-
yarn install
36+
pnpm install
3737
```
3838

3939
2. Create .env file and add the env vars
@@ -44,9 +44,9 @@ await createRollup({
4444

4545
3. Run the example
4646
```bash
47-
yarn dev
47+
pnpm dev
4848
```
4949

50-
There is an option to deploy the rollup contracts using more low-level methods as demonstrated in `low_level.ts` or `yarn dev:low-level`.
50+
There is an option to deploy the rollup contracts using more low-level methods as demonstrated in `low_level.ts` or `pnpm dev:low-level`.
5151

5252
[Read full documentation](https://docs.arbitrum.io/launch-orbit-chain/how-tos/orbit-sdk-deploying-rollup-chain)

examples/setup-aep-fee-router/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Routing contracts owned by the Arbitrum Foundation can be seen in the [AEP docum
3939
1. Install dependencies
4040

4141
```bash
42-
yarn install
42+
pnpm install
4343
```
4444

4545
2. Create .env file and add the env vars
@@ -50,7 +50,7 @@ Routing contracts owned by the Arbitrum Foundation can be seen in the [AEP docum
5050

5151
3. Run the example
5252
```bash
53-
yarn dev
53+
pnpm dev
5454
```
5555

5656
## References

examples/setup-fast-withdrawal/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You need to set the following environment variables in an .env file:
3939
1. Install dependencies
4040

4141
```bash
42-
yarn install
42+
pnpm install
4343
```
4444

4545
2. Create .env file and add the env vars
@@ -50,5 +50,5 @@ You need to set the following environment variables in an .env file:
5050

5151
3. Run the example
5252
```bash
53-
yarn dev
53+
pnpm dev
5454
```

examples/setup-fee-distributor-contract/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You can configure as many recipients as you wish.
3131
1. Install dependencies
3232

3333
```bash
34-
yarn install
34+
pnpm install
3535
```
3636

3737
2. Create .env file and add the env vars
@@ -42,7 +42,7 @@ You can configure as many recipients as you wish.
4242

4343
3. Run the example
4444
```bash
45-
yarn dev
45+
pnpm dev
4646
```
4747

4848
## References

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{
2-
"workspaces": [
3-
"src",
4-
"examples/*"
5-
],
62
"private": true,
73
"type": "module",
4+
"packageManager": "pnpm@10.30.3",
85
"scripts": {
96
"prebuild": "rm -rf ./src/dist",
107
"build": "tsc --project ./tsconfig.json --module commonjs --outDir ./src/dist --declaration",
11-
"dev": "yarn build --watch",
8+
"dev": "pnpm build --watch",
129
"generate": "wagmi generate",
13-
"generate:node-config-type": "yarn build && node ./src/dist/scripts/generateNodeConfigType.js",
10+
"generate:node-config-type": "pnpm build && node ./src/dist/scripts/generateNodeConfigType.js",
1411
"postgenerate:node-config-type": "prettier --write ./src/types/NodeConfig.generated.ts",
1512
"test:type": "vitest --config vitest.type.config.ts",
1613
"test:unit": "vitest --config vitest.unit.config.ts",
@@ -32,16 +29,19 @@
3229
"typescript": "^5.2.2",
3330
"vitest": "^3.2.4"
3431
},
35-
"resolutions": {
36-
"**/@wagmi/cli/viem/ws": "8.17.1",
37-
"**/@wagmi/cli/esbuild": "0.25.1",
38-
"**/@ethersproject/providers/ws": "7.5.10",
39-
"**/elliptic": "6.6.1",
40-
"**/nanoid": "3.3.8",
41-
"**/base-x": "3.0.11",
42-
"**/pbkdf2": "3.1.3",
43-
"**/sha.js": "2.4.12",
44-
"**/cipher-base": "1.0.5",
45-
"**/tmp": "0.2.5"
32+
"pnpm": {
33+
"overrides": {
34+
"viem": "1.20.0",
35+
"viem>ws": "8.17.1",
36+
"@wagmi/cli>esbuild": "0.25.1",
37+
"@ethersproject/providers>ws": "7.5.10",
38+
"elliptic": "6.6.1",
39+
"nanoid": "3.3.8",
40+
"base-x": "3.0.11",
41+
"pbkdf2": "3.1.3",
42+
"sha.js": "2.4.12",
43+
"cipher-base": "1.0.5",
44+
"tmp": "0.2.5"
45+
}
4646
}
4747
}

0 commit comments

Comments
 (0)