Skip to content

Commit 0fab3e3

Browse files
Add AGW Next.js example workspace
- Scaffold a new Next.js app for Abstract Global Wallet - Wire up wallet sign-in, connected state, and sponsored tx demo - Enable Tailwind CSS parsing in Biome
1 parent d1db9be commit 0fab3e3

29 files changed

Lines changed: 926 additions & 64 deletions

‎biome.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"quoteStyle": "double"
2828
}
2929
},
30+
"css": {
31+
"parser": {
32+
"tailwindDirectives": true
33+
}
34+
},
3035
"assist": {
3136
"enabled": true,
3237
"actions": {

‎examples/agw-nextjs/next-env.d.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
3+
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
5+
const appNodeModules = path.join(__dirname, "node_modules");
6+
7+
/** @type {import('next').NextConfig} */
8+
const nextConfig = {
9+
webpack: (config) => {
10+
config.resolve.alias = {
11+
...config.resolve.alias,
12+
wagmi: path.join(appNodeModules, "wagmi"),
13+
viem: path.join(appNodeModules, "viem"),
14+
"@tanstack/react-query": path.join(
15+
appNodeModules,
16+
"@tanstack/react-query",
17+
),
18+
};
19+
config.resolve.extensionAlias = {
20+
".js": [".ts", ".tsx", ".js", ".jsx"],
21+
};
22+
return config;
23+
},
24+
};
25+
26+
export default nextConfig;

‎examples/agw-nextjs/package.json‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "agw-nextjs",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"typecheck": "tsc --noEmit"
10+
},
11+
"dependencies": {
12+
"@abstract-foundation/agw-client": "workspace:*",
13+
"@abstract-foundation/agw-react": "workspace:*",
14+
"@tanstack/react-query": "^5.71.5",
15+
"next": "15.5.12",
16+
"react": "catalog:",
17+
"react-dom": "catalog:",
18+
"viem": "catalog:",
19+
"wagmi": "catalog:"
20+
},
21+
"devDependencies": {
22+
"@tailwindcss/postcss": "^4",
23+
"@types/node": "catalog:",
24+
"@types/react": "catalog:",
25+
"@types/react-dom": "catalog:",
26+
"tailwindcss": "^4",
27+
"typescript": "catalog:"
28+
}
29+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = {
2+
plugins: ["@tailwindcss/postcss"],
3+
};
4+
5+
export default config;
Lines changed: 5 additions & 0 deletions
Loading

‎examples/agw-nextjs/public/abs.svg‎

Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading
15 KB
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@import "tailwindcss";
2+
3+
:root {
4+
--background: #ffffff;
5+
--foreground: #171717;
6+
}
7+
8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
15+
@media (prefers-color-scheme: dark) {
16+
:root {
17+
--background: #0a0a0a;
18+
--foreground: #ededed;
19+
}
20+
}
21+
22+
body {
23+
background: var(--background);
24+
color: var(--foreground);
25+
font-family: Arial, Helvetica, sans-serif;
26+
}

0 commit comments

Comments
 (0)