Skip to content

Upgrade to Svelte 5 / SvelteKit 3 and fix broken features - #175

Merged
zaibon merged 2 commits into
mainfrom
svelte5-upgrade
Oct 4, 2026
Merged

zaibon merged 2 commits into
mainfrom
svelte5-upgrade

Conversation

@zaibon

@zaibon zaibon commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

The project no longer built on current Node, and several features were broken. This PR upgrades the stack to Svelte 5 and fixes the broken features. The feature set stays the same.

Stack changes

Before After
Framework Svelte 4, SvelteKit 2.5, Vite 5 Svelte 5 (runes), SvelteKit 3, Vite 8, TS 6
UI Skeleton v2, Tailwind 3 Skeleton v5, Tailwind 4 (legacy theme)
Wallet Web3Modal (deprecated) Reown AppKit, ethers5 adapter
Balances Ankr API (key revoked) On-chain: Peanut token list + Multicall3, no API key
Other Peanut 0.4, Sentry 8, ESLint 8, npm + pnpm lockfiles Peanut 0.6.2, Sentry 11, ESLint 9, pnpm only

SvelteKit 3 migration

  • svelte.config.js → options passed to sveltekit() in vite.config.ts
  • $lib → #lib subpath imports (explicit extensions)
  • Env vars declared in src/env.ts ($app/env/private)
  • Sentry server init moved to instrumentation.server.ts
  • @vercel/analytics/sveltekit still imports $app/stores, so it's replaced by the generic inject()

Bug fixes

  • Simple mode: links were never stored after creation, so "Send emails" never appeared. Emails were also hardcoded to the maintainer's address; they now go to the contributors. Generated links are listed in the UI.
  • ERC20 rewards: the deposit was sent before the approval was mined; each tx is now awaited
  • Expert mode: multi-reward checked the wrong contributor list; commits without a linked GitHub account crashed aggregation
  • /api/mail validates input (valid email, repo name, peanut.to link only)
  • Badge generator: shields.io path escaping, malformed HTML snippet
  • Light/dark mode persisted without flash
  • Dead networks removed (goerli, mumbai, zkEVM without Peanut contracts), sepolia added
  • Commits per page raised from 30 to 100

Tooling

  • CI on Node 22 + pnpm 11 (packageManager), with a build step added
  • .env.example added

Test plan

  • pnpm run check → 0 errors
  • pnpm run lint
  • pnpm run build (adapter-vercel)
  • API: /api/github happy path + 400/404; /api/mail validation rejects bad input
  • Headless Chrome e2e (15 checks): simple mode with URL params, contributor list, wallet modal opens; expert mode cards, select all, multi rewards; badges + snippets; light switch persistence
  • Live chains (read-only): balance multicall on Base/Optimism/Gnosis; Peanut prepareDepositTxs for native (1 tx) and USDC (approve + deposit)
  • Real reward on Sepolia with a wallet (needs signature)
  • Real email delivery through SMTP

Deploy notes

  • Remove the unused ANKR_PROVIDER / COVALENT_API_KEY vars on Vercel
  • Required runtime vars: GITHUB_TOKEN (optional), SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD

🤖 Generated with Claude Code

- Svelte 5 runes, SvelteKit 3, Vite 8, TypeScript 6, adapter-vercel 7
- Skeleton v5 + Tailwind 4 (legacy theme), custom light switch
- Replace deprecated Web3Modal with Reown AppKit (ethers5 adapter)
- Fetch token balances on-chain (Peanut token list + Multicall3) instead of Ankr
- Peanut SDK 0.6.2, wait for each tx so ERC20 approvals land before deposits
- Sentry 11 (server init in instrumentation.server.ts), ESLint 9 flat config
- Declare env vars in src/env.ts, use #lib subpath imports
- Fix simple mode "Send emails" never showing and hardcoded recipient
- Fix multi-reward selection, null commit authors, badge URL escaping
- Validate /api/mail input, improve email subject/body
- Drop dead networks (goerli, mumbai, zkEVM), add sepolia
- pnpm only, CI on Node 22 with build step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
commitkudos Ready Ready Preview Oct 4, 2026 2:45pm UTC

Keep the branch's package.json and pnpm-lock.yaml: the dependabot bumps on main
are superseded (packages upgraded further or removed). package-lock.json stays deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zaibon
zaibon marked this pull request as ready for review October 4, 2026 14:46
@zaibon
zaibon merged commit 3395257 into main Oct 4, 2026
5 checks passed
@zaibon
zaibon deleted the svelte5-upgrade branch October 4, 2026 14:51

This branch was successfully deployed

1 active deployment
Preview — 829dfd5d Deployed Oct 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant