Skip to content

Commit 18c8169

Browse files
committed
chore: merge main into Next.js 16 upgrade branch
Resolves conflicts between this branch and main's parallel work: - #67 (chore: remove lootbox feature) - #69 (test: add Vitest + unit tests for proposal encoding, funding totals, middleware) plus the CI workflow that runs `pnpm lint` + `pnpm test` Key merge decisions: - Rename `src/middleware.test.ts` → `src/proxy.test.ts` and update its `import` / symbols / describe label to `proxy`, matching this branch's `middleware.ts` → `proxy.ts` rename for the Next.js 16 file convention. - Regenerated `pnpm-lock.yaml` from the merged `package.json` so both Next.js 16 / React 19.2.5 and the new `vitest` + `@vitest/coverage-v8` devDeps resolve. - Accept Next.js 16's tsconfig auto-update: add `.next/dev/types/**/*.ts` to include, switch `jsx` to `react-jsx`. `pnpm exec tsc --noEmit` passes; `tsc` doesn't emit so the jsx change is non-functional here. - CLAUDE.md: refresh the `md/` comment to reference `proxy.ts` instead of middleware. Validation: - `pnpm lint` → 0 errors, 137 warnings (pre-existing react-compiler warnings) - `pnpm exec tsc --noEmit` → clean - `pnpm test` → 37 pass, 1 todo (includes the renamed proxy tests) - `pnpm dev` → Ready in 903ms; `curl -H "Accept: text/markdown" /` → 200 https://claude.ai/code/session_01QVjceB1PFubwe6TCpRq3xx
2 parents a1294a8 + c31a18d commit 18c8169

28 files changed

Lines changed: 1532 additions & 5591 deletions

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
lint-format-test:
11+
name: Lint, format, unit tests
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: pnpm/action-setup@v4
17+
with:
18+
version: 10
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: pnpm
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Lint
29+
run: pnpm lint
30+
31+
- name: Unit tests
32+
run: pnpm test

CLAUDE.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ No unit test runner; Playwright e2e only. `tests/e2e/propdates.spec.ts`, `tests/
3434

3535
```
3636
src/
37-
├── app/ # App Router — 25+ routes incl. /auctions /proposals /propose /tv /members /treasury /lootbox /feed /propdates /droposals /installations /blogs /coin-proposal /community/bounties /map /mural
37+
├── app/ # App Router — 25+ routes incl. /auctions /proposals /propose /tv /members /treasury /feed /propdates /droposals /installations /blogs /coin-proposal /community/bounties /map /mural
3838
│ ├── api/ # 18 route groups (alchemy, coins, ens, og, pinata, propdates, proposals, treasury, tv, …)
39-
│ └── md/ # markdown content-negotiation target (see middleware)
39+
│ └── md/ # markdown content-negotiation target (see proxy.ts)
4040
├── components/ # 24 feature dirs + ui/ (shadcn)
4141
├── hooks/ # 40 hooks — see naming note below
4242
├── services/ # 16 data-layer modules (auctions, proposals, treasury, feed, members, farcaster, poidh, snapshot, …)
4343
├── lib/ # config.ts, thirdweb.ts, wagmi.ts, subgraph.ts, ipfs.ts, zora-*, proposal-*, og-*, schemas/, types/
4444
├── data/ # static JSON (installations.json)
4545
├── types/ # shared TS interfaces
46-
├── utils/abis/ # contract ABIs (gnarsLootboxV4Abi, erc20, …)
46+
├── utils/abis/ # contract ABIs (erc20, …)
4747
├── workers/ # client-side search workers (blog, proposal)
4848
└── proxy.ts # Accept: text/markdown → rewrite to /md/* (Next.js 16 proxy convention, formerly middleware.ts)
4949
```
@@ -70,13 +70,6 @@ src/
7070
- **Governance pre-checks** — write hooks that gate on voting power must pre-read `getPastVotes` / `getVotes` and bail with a toast before prompting signatures.
7171
- Full provider tree + decision matrix: `docs/architecture/thirdweb-wallet-layer.md`.
7272

73-
### Lootbox (V4 only)
74-
75-
- UI at `src/app/lootbox/page.tsx`, ABI `src/utils/abis/gnarsLootboxV4Abi.ts`, hooks `use-lootbox-contract.ts` + `use-lootbox-actions.ts`.
76-
- Admin controls for VRF config, allowlist, deposits, withdrawals, recovery.
77-
- Listens for `FlexOpened` event (in `use-lootbox-contract.ts`) to surface NFT win toasts.
78-
- Address from `DAO_ADDRESSES.lootbox` in `config.ts` — update after each deploy.
79-
8073
## Data Fetching
8174

8275
- Server Components for initial load (SEO, perf).

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"lint": "eslint",
1010
"format": "prettier --write .",
1111
"format:check": "prettier --check .",
12+
"test": "vitest run",
13+
"test:watch": "vitest",
14+
"test:coverage": "vitest run --coverage",
1215
"proposal:funding:poc": "tsx scripts/proposal-funding-poc.ts"
1316
},
1417
"dependencies": {
@@ -100,6 +103,7 @@
100103
"@types/react": "^19.2.14",
101104
"@types/react-dom": "^19.2.3",
102105
"@types/three": "^0.182.0",
106+
"@vitest/coverage-v8": "^4.1.5",
103107
"eslint": "^9",
104108
"eslint-config-next": "16.2.4",
105109
"eslint-config-prettier": "^10.1.8",
@@ -108,6 +112,7 @@
108112
"tailwindcss": "^4",
109113
"tsx": "^4.21.0",
110114
"tw-animate-css": "^1.3.7",
111-
"typescript": "^5"
115+
"typescript": "^5",
116+
"vitest": "^4.1.5"
112117
}
113118
}

pnpm-lock.yaml

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

public/gnars-lootbox.mp4

-599 KB
Binary file not shown.

src/app/lootbox/page.tsx

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

src/app/sitemap.xml/route.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@ export async function GET(): Promise<Response> {
235235
changeFrequency: "daily",
236236
priority: 0.7,
237237
},
238-
{
239-
url: toUrl("/lootbox"),
240-
lastModified: now,
241-
changeFrequency: "weekly",
242-
priority: 0.6,
243-
},
244238
{
245239
url: toUrl("/map"),
246240
lastModified: now,

src/components/layout/DaoHeader.tsx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,6 @@ const navigationItems = [
164164
description: "Gnarly challenges from the action sports community",
165165
badge: "NEW!",
166166
},
167-
{
168-
title: "divider",
169-
label: "Beta",
170-
},
171-
{
172-
title: "Lootbox",
173-
href: "/lootbox",
174-
icon: Gift,
175-
description: "Join Gnars DAO onboarding",
176-
badge: "BETA",
177-
},
178167
],
179168
},
180169
];
@@ -250,21 +239,6 @@ function DesktopNav() {
250239
<NavigationMenuContent>
251240
<ul className="grid w-[400px] gap-2 p-2">
252241
{item.items?.map((subItem) => {
253-
// Divider item
254-
if (subItem.title === "divider") {
255-
return (
256-
<li key={`divider-${subItem.label}`} className="px-3 py-2">
257-
<div className="flex items-center gap-2">
258-
<div className="h-px flex-1 bg-border" />
259-
<span className="text-xs font-medium text-muted-foreground uppercase tracking-wider">
260-
{subItem.label}
261-
</span>
262-
<div className="h-px flex-1 bg-border" />
263-
</div>
264-
</li>
265-
);
266-
}
267-
268242
if (!subItem.icon) return null;
269243

270244
const SubIcon = subItem.icon;
@@ -419,21 +393,6 @@ function MobileNav() {
419393
{item.title}
420394
</div>
421395
{item.items?.map((subItem) => {
422-
if (subItem.title === "divider") {
423-
return (
424-
<div key={subItem.title} className="relative my-2 mx-3">
425-
<div className="absolute inset-0 flex items-center">
426-
<div className="w-full border-t" />
427-
</div>
428-
<div className="relative flex justify-center text-xs uppercase">
429-
<span className="bg-background px-2 text-muted-foreground">
430-
{subItem.label}
431-
</span>
432-
</div>
433-
</div>
434-
);
435-
}
436-
437396
if (!subItem.icon) return null;
438397

439398
const SubIcon = subItem.icon;

0 commit comments

Comments
 (0)