Skip to content

Commit f3e8098

Browse files
authored
feat: bun (#55)
1 parent a184297 commit f3e8098

File tree

20 files changed

+5352
-9452
lines changed

20 files changed

+5352
-9452
lines changed

.github/CONTRIBUTING.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ messenger.reply('ping', (args) => {
9696
This guide is intended to help you get started with contributing. By following these steps, you will understand the development process and workflow.
9797

9898
1. [Cloning the repository](#cloning-the-repository)
99-
2. [Installing Node.js and pnpm](#installing-nodejs-and-pnpm)
99+
2. [Installing Bun](#installing-bun)
100100
3. [Installing Anvil](#installing-anvil)
101101
4. [Installing dependencies](#installing-dependencies)
102102
5. [Running the Web Extension](#running-the-web-extension)
@@ -123,21 +123,19 @@ gh repo clone paradigmxyz/rivet
123123
<a href="#getting-started">&uarr; back to top</a></b>
124124
</div>
125125

126-
### Installing Node.js and pnpm
126+
### Installing Bun
127127

128-
Rivet uses [pnpm](https://pnpm.io/workspaces). You need to install **Node.js v18 or higher** and **pnpm v8 or higher**.
128+
wagmi uses [Bun](https://bun.sh). You need to install **Bun v1 or higher**.
129129

130-
You can run the following commands in your terminal to check your local Node.js and pnpm versions:
130+
You can run the following commands in your terminal to check your local Bun version:
131131

132132
```bash
133-
node -v
134-
pnpm -v
133+
bun -v
135134
```
136135

137-
If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:
136+
If the versions are not correct or you don't have Bun installed, download and follow their setup instructions:
138137

139-
- Install Node.js using [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org)
140-
- Install [pnpm](https://pnpm.io/installation)
138+
- Install [Bun](https://bun.sh/docs/install)
141139

142140
<div align="right">
143141
<a href="#getting-started">&uarr; back to top</a></b>
@@ -162,7 +160,7 @@ curl -L https://foundry.paradigm.xyz | bash
162160
Once in the project's root directory, run the following command to install the project's dependencies:
163161

164162
```bash
165-
pnpm install
163+
bun i
166164
```
167165

168166
<div align="right">
@@ -174,7 +172,7 @@ pnpm install
174172
After you have installed dependencies, you are ready to run the Web Extension. To do so, run the following:
175173

176174
```bash
177-
pnpm dev # start dev server
175+
bun run dev # start dev server
178176
```
179177

180178
This will run a script that will build the Web Extension and start a dev server for the Test Dapp, it will also open the Test Dapp in a new browser tab. The Web Extension also utilizes Hot Module Replacement (HMR), so you can make changes to the code and see them reflected in the extension without having to reload the extension itself.

.github/actions/install-dependencies/action.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@ description: "Prepare repository and all dependencies"
44
runs:
55
using: "composite"
66
steps:
7-
- name: Set up pnpm
8-
uses: pnpm/action-setup@v2
9-
10-
- name: Set up node
11-
uses: actions/setup-node@v3
12-
with:
13-
cache: pnpm
14-
node-version: 18
7+
- name: Set up Bun
8+
uses: oven-sh/setup-bun@v1
159

1610
- name: Set up foundry
1711
uses: foundry-rs/foundry-toolchain@v1
1812

1913
- name: Install dependencies
2014
shell: bash
21-
run: pnpm install --ignore-scripts
15+
run: bun install --yarn --ignore-scripts

.github/workflows/artifacts.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: ./.github/actions/install-dependencies
1717

1818
- name: Build
19-
run: pnpm build
19+
run: bun run build
2020

2121
- name: Upload Artifact
2222
uses: actions/upload-artifact@v3

.github/workflows/verify.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: ./.github/actions/install-dependencies
1818

1919
- name: Lint code
20-
run: pnpm format && pnpm lint:fix
20+
run: bun run format && bun run lint:fix
2121

2222
- uses: stefanzweifel/git-auto-commit-action@v4
2323
env:
@@ -41,7 +41,7 @@ jobs:
4141
uses: ./.github/actions/install-dependencies
4242

4343
- name: Build
44-
run: pnpm build
44+
run: bun run build
4545

4646
types:
4747
name: Types
@@ -57,4 +57,4 @@ jobs:
5757
uses: ./.github/actions/install-dependencies
5858

5959
- name: Check types
60-
run: pnpm typecheck
60+
run: bun run typecheck

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -79,36 +79,34 @@ Clone the repo to your local machine using git:
7979
git clone https://github.com/paradigmxyz/rivet.git
8080
```
8181

82-
### 2. Install Node.js and pnpm
82+
### 2. Install Bun
8383

84-
You need to install **Node.js v18 or higher** and **pnpm v8 or higher**.
84+
wagmi uses [Bun](https://bun.sh). You need to install **Bun v1 or higher**.
8585

86-
You can run the following commands in your terminal to check your local Node.js and pnpm versions:
86+
You can run the following commands in your terminal to check your local Bun version:
8787

8888
```bash
89-
node -v
90-
pnpm -v
89+
bun -v
9190
```
9291

93-
If the versions are not correct or you don't have Node.js or pnpm installed, download and follow their setup instructions:
92+
If the versions are not correct or you don't have Bun installed, download and follow their setup instructions:
9493

95-
- Install Node.js using [fnm](https://github.com/Schniz/fnm) or from the [official website](https://nodejs.org)
96-
- Install [pnpm](https://pnpm.io/installation)
94+
- Install [Bun](https://bun.sh/docs/install)
9795

9896
### 3. Install dependencies
9997

10098
Once in the project's root directory, run the following command to install the project's dependencies:
10199

102100
```bash
103-
pnpm install
101+
bun i
104102
```
105103

106104
### 4. Run the dev server
107105

108106
After you have installed dependencies, you are ready to run the dev server for the Extension. To do so, run the following:
109107

110108
```bash
111-
pnpm dev
109+
bun run dev
112110
```
113111

114112
This will run a script that will build the Web Extension and start a dev server for the Test Dapp, it will also open the Test Dapp in a new browser tab.

biome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/1.0.0/schema.json",
33
"files": {
4-
"ignore": ["node_modules", "public", "dist"]
4+
"ignore": ["node_modules", "public", "dist", "symbols/generated"]
55
},
66
"formatter": {
77
"enabled": true,

bun.lockb

290 KB
Binary file not shown.

dom.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference lib="dom" />
2+
/// <reference lib="dom.iterable" />

package.json

+32-39
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
},
88
"scripts": {
99
"anvil": "anvil --fork-url https://cloudflare-eth.com",
10-
"build": "tsc && vite build && pnpm build:inpage",
10+
"build": "tsc && vite build && bun run build:inpage",
1111
"build:ds": "vite build -c src/design-system/vite.config.ts",
1212
"build:inpage": "vite build -c vite.config.inpage.ts",
1313
"clean": "rimraf dist",
14-
"dev": "cross-env NODE_ENV=development pnpm build:inpage && vite --open",
14+
"dev": "cross-env NODE_ENV=development bun run build:inpage && vite --open",
1515
"format": "biome format . --write",
1616
"lint": "biome check .",
17-
"lint:fix": "pnpm lint --apply",
18-
"prepare": "pnpm build:ds",
19-
"symbols": "node -r esbuild-register scripts/generate-symbols.ts",
17+
"lint:fix": "bun run lint --apply",
18+
"preinstall": "bun scripts/preinstall.ts",
19+
"postinstall": "patch-package",
20+
"prepare": "bun run build:ds",
21+
"symbols": "bun scripts/symbols.ts",
2022
"typecheck": "tsc --noEmit"
2123
},
22-
"devDependencies": {
23-
"@biomejs/biome": "1.0.0",
24+
"dependencies": {
2425
"@capsizecss/core": "^3.1.0",
2526
"@capsizecss/vanilla-extract": "^1.0.0",
2627
"@fastify/deepmerge": "^1.3.0",
@@ -32,41 +33,19 @@
3233
"@radix-ui/react-progress": "^1.0.3",
3334
"@radix-ui/react-tabs": "^1.0.4",
3435
"@radix-ui/react-tooltip": "^1.0.6",
35-
"@samrum/vite-plugin-web-extension": "^4.1.0",
3636
"@tanstack/query-async-storage-persister": "5.0.0-alpha.42",
3737
"@tanstack/react-query": "5.0.0-alpha.42",
3838
"@tanstack/react-query-persist-client": "5.0.0-alpha.42",
3939
"@tanstack/react-virtual": "3.0.0-beta.54",
40-
"@types/chroma-js": "^2.4.0",
41-
"@types/chrome": "^0.0.244",
42-
"@types/d3-format": "^3.0.1",
43-
"@types/fs-extra": "^11.0.1",
44-
"@types/node": "^18.15.11",
45-
"@types/opentype.js": "^1.3.4",
46-
"@types/prettier": "^2.7.2",
47-
"@types/qs": "^6.9.7",
48-
"@types/react": "^18.0.32",
49-
"@types/react-dom": "^18.0.11",
50-
"@types/use-sync-external-store": "^0.0.3",
51-
"@types/webextension-polyfill": "^0.10.0",
5240
"@vanilla-extract/css": "^1.11.0",
5341
"@vanilla-extract/css-utils": "^0.1.3",
5442
"@vanilla-extract/dynamic": "^2.0.3",
5543
"@vanilla-extract/sprinkles": "^1.6.0",
56-
"@vanilla-extract/vite-plugin": "^3.8.0",
57-
"@vitejs/plugin-react": "^4.0.0-beta.0",
5844
"chroma-js": "^2.4.2",
5945
"clsx": "^1.2.1",
60-
"cross-env": "^7.0.3",
61-
"d3-format": "^3.1.0",
62-
"esbuild": "^0.17.17",
63-
"esbuild-register": "^3.4.2",
6446
"eventemitter3": "^5.0.1",
65-
"fs-extra": "^11.1.1",
6647
"human-id": "^4.0.0",
6748
"mipd": "^0.0.5",
68-
"opentype.js": "^1.3.4",
69-
"prettier": "^2.8.7",
7049
"react": "^18.2.0",
7150
"react-dom": "^18.2.0",
7251
"react-flatten-children": "^1.1.2",
@@ -75,26 +54,40 @@
7554
"react-router": "^6.10.0",
7655
"react-router-dom": "^6.10.0",
7756
"remeda": "^1.14.0",
57+
"use-sync-external-store": "^1.2.0",
58+
"viem": "^1.10.12",
59+
"zustand": "^4.3.8"
60+
},
61+
"devDependencies": {
62+
"@biomejs/biome": "1.0.0",
63+
"@samrum/vite-plugin-web-extension": "^4.1.0",
64+
"@types/chroma-js": "^2.4.0",
65+
"@types/chrome": "^0.0.244",
66+
"@types/opentype.js": "^1.3.4",
67+
"@types/qs": "^6.9.7",
68+
"@types/react": "^18.0.32",
69+
"@types/react-dom": "^18.0.11",
70+
"@types/use-sync-external-store": "^0.0.3",
71+
"@types/webextension-polyfill": "^0.10.0",
72+
"@types/which-pm-runs": "^1.0.0",
73+
"@vanilla-extract/vite-plugin": "^3.8.0",
74+
"@vitejs/plugin-react": "^4.0.0-beta.0",
75+
"bun-types": "^1.0.1",
76+
"cross-env": "^7.0.3",
77+
"opentype.js": "^1.3.4",
78+
"patch-package": "^8.0.0",
7879
"rimraf": "^5.0.1",
7980
"simple-git-hooks": "^2.8.1",
8081
"svg-path-commander": "^2.0.5",
8182
"typescript": "^5.0.4",
82-
"use-sync-external-store": "^1.2.0",
83-
"viem": "^1.9.2",
8483
"vite": "^4.3.0",
8584
"vite-plugin-crx-hot-reload": "^1.0.4",
8685
"vite-tsconfig-paths": "^4.2.0",
8786
"web-ext": "^7.6.1",
8887
"webextension-polyfill": "^0.10.0",
89-
"zustand": "^4.3.8"
88+
"which-pm-runs": "^1.1.0"
9089
},
9190
"simple-git-hooks": {
92-
"pre-commit": "pnpm format && pnpm lint:fix"
93-
},
94-
"packageManager": "[email protected]",
95-
"pnpm": {
96-
"patchedDependencies": {
97-
"@samrum/[email protected]": "patches/@[email protected]"
98-
}
91+
"pre-commit": "bun run format && bun run lint:fix"
9992
}
10093
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/node_modules/@samrum/vite-plugin-web-extension/dist/index.es.js b/node_modules/@samrum/vite-plugin-web-extension/dist/index.es.js
2+
index f2d642d..56beb35 100644
3+
--- a/node_modules/@samrum/vite-plugin-web-extension/dist/index.es.js
4+
+++ b/node_modules/@samrum/vite-plugin-web-extension/dist/index.es.js
5+
@@ -186,7 +186,7 @@ class DevBuilder {
6+
}
7+
async writeBuild({ devServerPort, manifestHtmlFiles, }) {
8+
this.hmrServerOrigin = this.getHmrServerOrigin(devServerPort);
9+
- await emptyDir(this.outDir);
10+
+ // await emptyDir(this.outDir);
11+
const publicDir = path.resolve(process.cwd(), this.viteConfig.root, this.viteConfig.publicDir);
12+
copy(publicDir, this.outDir);
13+
await this.writeManifestHtmlFiles(manifestHtmlFiles);
14+
diff --git a/node_modules/@samrum/vite-plugin-web-extension/dist/index.js b/node_modules/@samrum/vite-plugin-web-extension/dist/index.js
15+
index a16b52f..65627cb 100644
16+
--- a/node_modules/@samrum/vite-plugin-web-extension/dist/index.js
17+
+++ b/node_modules/@samrum/vite-plugin-web-extension/dist/index.js
18+
@@ -188,7 +188,7 @@ class DevBuilder {
19+
}
20+
async writeBuild({ devServerPort, manifestHtmlFiles, }) {
21+
this.hmrServerOrigin = this.getHmrServerOrigin(devServerPort);
22+
- await fsExtra.emptyDir(this.outDir);
23+
+ // await fsExtra.emptyDir(this.outDir);
24+
const publicDir = path.resolve(process.cwd(), this.viteConfig.root, this.viteConfig.publicDir);
25+
fsExtra.copy(publicDir, this.outDir);
26+
await this.writeManifestHtmlFiles(manifestHtmlFiles);

patches/@[email protected]

-13
This file was deleted.

0 commit comments

Comments
 (0)