Skip to content

Commit 4a5373d

Browse files
committed
build: switch to bun for dep management
1 parent 3d47773 commit 4a5373d

File tree

7 files changed

+25
-522
lines changed

7 files changed

+25
-522
lines changed

.github/workflows/ci.yml

+14-23
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,19 @@ jobs:
2121
- name: "Install Foundry"
2222
uses: "foundry-rs/foundry-toolchain@v1"
2323

24-
- name: "Install Pnpm"
25-
uses: "pnpm/action-setup@v2"
26-
with:
27-
version: "8"
28-
2924
- name: "Install Node.js"
3025
uses: "actions/setup-node@v3"
3126
with:
32-
cache: "pnpm"
3327
node-version: "lts/*"
3428

29+
- name: "Install Bun"
30+
uses: "oven-sh/setup-bun@v1"
31+
3532
- name: "Install the Node.js dependencies"
36-
run: "pnpm install"
33+
run: "bun install"
3734

38-
- name: "Lint the contracts"
39-
run: "pnpm lint"
35+
- name: "Lint the code"
36+
run: "bun run lint"
4037

4138
- name: "Add lint summary"
4239
run: |
@@ -52,19 +49,16 @@ jobs:
5249
- name: "Install Foundry"
5350
uses: "foundry-rs/foundry-toolchain@v1"
5451

55-
- name: "Install Pnpm"
56-
uses: "pnpm/action-setup@v2"
57-
with:
58-
version: "8"
59-
6052
- name: "Install Node.js"
6153
uses: "actions/setup-node@v3"
6254
with:
63-
cache: "pnpm"
6455
node-version: "lts/*"
6556

57+
- name: "Install Bun"
58+
uses: "oven-sh/setup-bun@v1"
59+
6660
- name: "Install the Node.js dependencies"
67-
run: "pnpm install"
61+
run: "bun install"
6862

6963
- name: "Build the contracts and print their size"
7064
run: "forge build --sizes"
@@ -84,19 +78,16 @@ jobs:
8478
- name: "Install Foundry"
8579
uses: "foundry-rs/foundry-toolchain@v1"
8680

87-
- name: "Install Pnpm"
88-
uses: "pnpm/action-setup@v2"
89-
with:
90-
version: "8"
91-
9281
- name: "Install Node.js"
9382
uses: "actions/setup-node@v3"
9483
with:
95-
cache: "pnpm"
9684
node-version: "lts/*"
9785

86+
- name: "Install Bun"
87+
uses: "oven-sh/setup-bun@v1"
88+
9889
- name: "Install the Node.js dependencies"
99-
run: "pnpm install"
90+
run: "bun install"
10091

10192
- name: "Show the Foundry config"
10293
run: "forge config"

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ out
1010
.DS_Store
1111
.pnp.*
1212
lcov.info
13+
package-lock.json
14+
pnpm-lock.yaml
1315
yarn.lock
1416

1517
# broadcasts

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ out
1010
*.log
1111
.DS_Store
1212
.pnp.*
13+
bun.lockb
1314
lcov.info
1415
package-lock.json
1516
pnpm-lock.yaml

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Or, if you prefer to install the template manually:
3131
$ mkdir my-project
3232
$ cd my-project
3333
$ forge init --template PaulRBerg/foundry-template
34-
$ pnpm install # install Solhint, Prettier, and other Node.js deps
34+
$ bun install # install Solhint, Prettier, and other Node.js deps
3535
```
3636

3737
If this is your first time with Foundry, check out the
@@ -83,8 +83,8 @@ Foundry typically uses git submodules to manage dependencies, but this template
8383

8484
This is how to install dependencies:
8585

86-
1. Install the dependency using your preferred package manager, e.g. `pnpm add dependency-name`
87-
- Use this syntax to install from GitHub: `pnpm add github:username/repo-name`
86+
1. Install the dependency using your preferred package manager, e.g. `bun install dependency-name`
87+
- Use this syntax to install from GitHub: `bun install github:username/repo-name`
8888
2. Add a remapping for the dependency in [remappings.txt](./remappings.txt), e.g.
8989
`dependency-name=node_modules/dependency-name`
9090

@@ -170,7 +170,7 @@ $ forge test --gas-report
170170
Lint the contracts:
171171

172172
```sh
173-
$ pnpm lint
173+
$ bun run lint
174174
```
175175

176176
### Test
@@ -184,14 +184,14 @@ $ forge test
184184
Generate test coverage and output result to the terminal:
185185

186186
```sh
187-
$ pnpm test:coverage
187+
$ bun run test:coverage
188188
```
189189

190190
Generate test coverage with lcov report (you'll have to open the `./coverage/index.html` file in your browser, to do so
191191
simply copy paste the path):
192192

193193
```sh
194-
$ pnpm test:coverage:report
194+
$ bun run test:coverage:report
195195
```
196196

197197
## Related Efforts

bun.lockb

28.1 KB
Binary file not shown.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"scripts": {
2929
"clean": "rm -rf cache out",
3030
"build": "forge build",
31-
"lint": "pnpm lint:sol && pnpm prettier:check",
32-
"lint:sol": "forge fmt --check && pnpm solhint {script,src,test}/**/*.sol",
31+
"lint": "bun run lint:sol && bun run prettier:check",
32+
"lint:sol": "forge fmt --check && bun run solhint {script,src,test}/**/*.sol",
3333
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
3434
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
3535
"test": "forge test",

0 commit comments

Comments
 (0)