Skip to content

Conversation

@kiwicopple
Copy link
Member

This PR upgrades the website to the latest Next.js and modernizes the testing infrastructure.

Framework Upgrades

Next.js: 15.4.10 → 16.1.1 (with Turbopack as default bundler)
React: 18.x → 19.x
React Query: v4 → v5
react-final-form: 6.5.9 → 7.0.0 (React 19 support)

React Query v5 Migration

Replaced Hydrate with HydrationBoundary
Updated all queries/mutations to object syntax ({ queryKey, queryFn })
Replaced isLoading with isPending for mutations
Replaced keepPreviousData with placeholderData: keepPreviousData
Updated invalidateQueries to object syntax

Testing Infrastructure (New)

Added Vitest with jsdom environment
Created 7 integration tests covering:
    Form validation and submission
    Theme switching (light/dark mode)
    UI components (Button, Card, Badge, etc.)
    Layout components (Header, Footer, Sidebar)
    Access tokens management
    Search functionality
    Authentication flows
Added v8 coverage provider
Integrated Coveralls for coverage reporting

CI/CD

Added GitHub Actions workflow for running tests on PR/push
Configured coverage uploads to Coveralls

claude and others added 17 commits January 6, 2026 19:45
Document the strategy to upgrade from Next.js 15.4.10 to 16.x
and update shadcn/ui components to latest patterns.
- Install vitest, @testing-library/react, jsdom, and related deps
- Create vitest.config.ts with React plugin and path aliases
- Add test and test:run scripts to package.json
- Add basic Button component tests to verify setup works
- Remove fine-grained Button component tests
- Add integration test for Form, FormInput, and FormButton
- Test form submission with valid data
- Test validation errors with invalid input
- Add @testing-library/user-event for realistic interactions
- Install @vitest/coverage-v8
- Configure coverage in vitest.config.ts
- Add test:coverage script
- Generate text, html, and lcov reports
- Run tests with coverage on push/PR to main
- Only triggers on website/** changes
- Upload coverage to Codecov (optional)
- Test ThemeContextProvider and ThemeSwitcher working together
- Test light/dark toggle functionality
- Test localStorage persistence
- Add matchMedia mock to vitest setup
- Test Card, Avatar, Badge, Button components together
- Test profile card scenario with user interactions
- Test badge variant styling
- Test Footer with navigation links
- Test full Layout with Navbar, content, and Footer
- Test container width variants (md/full)
- Mock Next.js router, auth, and data hooks
- Test AccessTokenCard renders token info and masked value
- Test revoke button triggers mutation and toast
- Test rendering multiple tokens in a list
- Test SearchInput accepts user input
- Test SearchPackageRow displays package info with link
- Test Search shows results, empty state, and error state
- Test AuthProvider loading and resolved states
- Test useAuth, useSession, useUser, useIsLoggedIn hooks
- Test withAuth HOC redirects when unauthenticated
- Test auth state change handling
- Remove 'main' from branches, only 'master' exists
- Update Node.js version from 20 to 24 (latest LTS)
- Upgrade Next.js from 15.4.10 to 16.1.1
- Upgrade React to 19.x
- Upgrade @tanstack/react-query to v5
- Migrate all mutations and queries to v5 API:
  - Replace isLoading with isPending for mutations
  - Replace keepPreviousData option with placeholderData
  - Update query/mutation format to object syntax
  - Update invalidateQueries to object syntax
  - Replace Hydrate with HydrationBoundary
  - Fix ReactQueryDevtools position prop
- Update tsconfig.json to exclude test files from Next.js build
- Format all files with Prettier
- Upgrade react-final-form from 6.5.9 to 7.0.0 (React 19 support)
- Use --legacy-peer-deps in CI for npm install
@vercel
Copy link

vercel bot commented Jan 11, 2026

@kiwicopple is attempting to deploy a commit to the Supabase Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jan 11, 2026

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

Project Deployment Review Updated (UTC)
dbdev Error Error Jan 11, 2026 1:02am

@alaister
Copy link
Member

Moving to #340

@alaister alaister closed this Jan 13, 2026
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.

3 participants