Skip to content

Commit 43fcd7d

Browse files
chore: update wagmi code (#137)
Bumps deps for the wagmi tutorial and switches to vite
1 parent 93a8727 commit 43fcd7d

32 files changed

Lines changed: 1592 additions & 206 deletions

code/test-contracts/test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Greeter', function () {
2828
expect(await contract.greet()).to.match(/^Hello/);
2929
});
3030
it('setGreeting should throw when passed an invalid argument', async function () {
31-
await expect(contract.setGreeting('')).to.be.revertedWith('Greeting must not be empty');
31+
await expect(contract.setGreeting('')).to.be.reverted;
3232
});
3333
it('isGreetingChanged should return true after setting greeting', async function () {
3434
expect(await contract.isGreetingChanged()).to.be.false;

code/wagmi/.gitignore

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,24 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.*
7-
.yarn/*
8-
!.yarn/patches
9-
!.yarn/plugins
10-
!.yarn/releases
11-
!.yarn/versions
12-
13-
# testing
14-
/coverage
15-
16-
# next.js
17-
/.next/
18-
/out/
19-
20-
# production
21-
/build
22-
23-
# misc
24-
.DS_Store
25-
*.pem
26-
27-
# debug
1+
# Logs
2+
logs
3+
*.log
284
npm-debug.log*
295
yarn-debug.log*
306
yarn-error.log*
31-
32-
# env files (can opt-in for committing if needed)
33-
.env*
34-
35-
# vercel
36-
.vercel
37-
38-
# typescript
39-
*.tsbuildinfo
40-
next-env.d.ts
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

code/wagmi/bun.lock

Lines changed: 1223 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/wagmi/bun.lockb

-342 KB
Binary file not shown.

code/wagmi/eslint.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactRefresh from 'eslint-plugin-react-refresh';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
23+
},
24+
}
25+
);

code/wagmi/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link
6+
rel="icon"
7+
type="image/svg+xml"
8+
href="/vite.svg"
9+
/>
10+
<meta
11+
name="viewport"
12+
content="width=device-width, initial-scale=1.0"
13+
/>
14+
<title>Vite + React + TS</title>
15+
</head>
16+
<body>
17+
<div id="root"></div>
18+
<script
19+
type="module"
20+
src="/src/main.tsx"
21+
></script>
22+
</body>
23+
</html>

code/wagmi/next.config.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

code/wagmi/package.json

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
{
22
"name": "wagmi",
3-
"version": "0.1.0",
43
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
56
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "next lint"
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
1011
},
1112
"dependencies": {
12-
"@tanstack/react-query": "^5.60.4",
13-
"@wagmi/connectors": "^5.3.10",
14-
"@wagmi/core": "^2.14.6",
15-
"next": "15.2.3",
16-
"react": "19.0.0-rc-66855b96-20241106",
17-
"react-dom": "19.0.0-rc-66855b96-20241106",
18-
"viem": "^2.21.45",
19-
"wagmi": "^2.12.32"
13+
"@tanstack/react-query": "^5.80.7",
14+
"@wagmi/connectors": "^5.8.5",
15+
"@wagmi/core": "^2.17.3",
16+
"react": "^19.1.0",
17+
"react-dom": "^19.1.0",
18+
"viem": "^2.31.0",
19+
"wagmi": "^2.15.6"
2020
},
2121
"devDependencies": {
22-
"@types/node": "^20",
23-
"@types/react": "^18",
24-
"@types/react-dom": "^18",
25-
"typescript": "^5"
22+
"@eslint/js": "^9.25.0",
23+
"@types/react": "^19.1.2",
24+
"@types/react-dom": "^19.1.2",
25+
"@vitejs/plugin-react": "^4.4.1",
26+
"eslint": "^9.25.0",
27+
"eslint-plugin-react-hooks": "^5.2.0",
28+
"eslint-plugin-react-refresh": "^0.4.19",
29+
"globals": "^16.0.0",
30+
"typescript": "~5.8.3",
31+
"typescript-eslint": "^8.30.1",
32+
"vite": "^6.3.5"
2633
}
2734
}

code/wagmi/public/favicon.ico

-25.3 KB
Binary file not shown.

code/wagmi/src/App.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#root {
2+
max-width: 1280px;
3+
margin: 0 auto;
4+
padding: 2rem;
5+
text-align: center;
6+
}
7+
8+
.logo {
9+
height: 6em;
10+
padding: 1.5em;
11+
will-change: filter;
12+
transition: filter 300ms;
13+
}
14+
.logo:hover {
15+
filter: drop-shadow(0 0 2em #646cffaa);
16+
}
17+
.logo.react:hover {
18+
filter: drop-shadow(0 0 2em #61dafbaa);
19+
}
20+
21+
@keyframes logo-spin {
22+
from {
23+
transform: rotate(0deg);
24+
}
25+
to {
26+
transform: rotate(360deg);
27+
}
28+
}
29+
30+
@media (prefers-reduced-motion: no-preference) {
31+
a:nth-of-type(2) .logo {
32+
animation: logo-spin infinite 20s linear;
33+
}
34+
}
35+
36+
.card {
37+
padding: 2em;
38+
}
39+
40+
.read-the-docs {
41+
color: #888;
42+
}

0 commit comments

Comments
 (0)