Migrate to Vite/TanStack stack and add tests - #14
Conversation
Add AGENTS.md (developer/agent guide) and a test scaffold (tools/tests/test_main.py). Rename tools/.gitconfig to top-level .gitconfig (keep "theirs" merge driver) and consolidate the courses.json merge rule into .gitattributes. Update .gitignore to target TanStack Start/Vite build outputs and remove Next.js-specific ignores. Remove obsolete/large tooling files from tools/ (courses.json, LICENSE, .actrc, .gitattributes) and delete improve.md as part of repository cleanup.
There was a problem hiding this comment.
Pull request overview
Migrates the app from a legacy Next.js scaffold to a TanStack Start + Vite stack, updates GitHub Pages deployment assumptions (base path/assets), and introduces unit + e2e testing infrastructure.
Changes:
- Replaces Next.js routing/layout with TanStack Router/Start + React Query data fetching.
- Adds/updates test tooling (Vitest + Testing Library setup, Playwright smoke test) and CI workflows for app/tools.
- Updates static assets, base path configuration, and repo docs to reflect GitHub Pages deployment.
Reviewed changes
Copilot reviewed 54 out of 63 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Switches Vitest to jsdom, expands test globs to TSX, adds setup file. |
| vite.config.ts | Adds Vite/TanStack Start config, sets GitHub Pages base path and prerender options. |
| tsconfig.json | Removes Next.js-specific config; updates JSX mode and Vite types. |
| tools/tests/test_main.py | Adds Python unit tests for the tools HTML parsing/merge helpers. |
| tools/LICENSE | Removes tools-specific license file (root LICENSE remains). |
| tools/.gitignore | Removes tools-only gitignore (replaced by root ignores for tools). |
| tools/.gitattributes | Removes tools-only gitattributes (moved to root). |
| tools/.actrc | Removes act config line; leaves container architecture entry. |
| src/utils/parse-times.ts | Minor logic/style tweak in period token parsing loop. |
| src/test/setup.ts | Adds Testing Library jest-dom Vitest setup import. |
| src/styles/app.css | Adds font CSS variables; removes duplicate radius variable. |
| src/routes/index.tsx | Adds TanStack file route; normalizes/serializes selected courses in URL search params. |
| src/routes/__root.tsx | Adds app shell/document + head metadata + React Query provider wiring. |
| src/router.tsx | Adds TanStack Router instance with basepath from import.meta.env.BASE_URL. |
| src/routeTree.gen.ts | Adds TanStack Router auto-generated route tree/types. |
| src/lib/utils.ts | Import ordering tweak for clsx type/value imports. |
| src/lib/query-client.ts | Adds React Query QueryClient factory with default query options. |
| src/env.d.ts | Adds Vite env typings for courses URL variables. |
| src/components/ui/tooltip.tsx | Converts React import to type-only import. |
| src/components/ui/table.tsx | Converts React import to type-only import. |
| src/components/ui/sidebar.tsx | Reorders imports; adds Biome override support for cookie usage/exhaustive deps. |
| src/components/ui/sheet.tsx | Converts React import to type-only import. |
| src/components/ui/separator.tsx | Converts React import to type-only import. |
| src/components/ui/select.tsx | Converts React import to type-only import. |
| src/components/ui/scroll-area.tsx | Converts React import to type-only import. |
| src/components/ui/popover.tsx | Converts React import to type-only import. |
| src/components/ui/input.tsx | Converts React import to type-only import. |
| src/components/ui/drawer.tsx | Converts React import to type-only import. |
| src/components/ui/dialog.tsx | Converts React import to type-only import. |
| src/components/ui/command.tsx | Converts React import to type-only import; adjusts import ordering. |
| src/components/ui/card.tsx | Converts React import to type-only import. |
| src/components/ui/button.tsx | Converts React import to type-only import; keeps value imports. |
| src/components/course-scheduler-content.tsx | Migrates data fetching to React Query; makes selected course state external (router-driven). |
| src/components/course-list.tsx | Adds TanStack Virtual for list virtualization and scroll container ref. |
| src/components/course-info-table.tsx | Migrates filters to RHF + Zod; refactors table rendering to TanStack Table column defs. |
| src/components/app-sidebar.tsx | Replaces Next.js Link with TanStack Router Link. |
| src/components/tests/course-info-table.test.tsx | Adds unit test covering search-term filtering behavior. |
| src/app/robots.txt | Removes Next.js app-scoped robots.txt. |
| src/app/page.tsx | Removes Next.js app page entry point. |
| src/app/manifest.ts | Removes Next.js manifest route implementation (replaced by static manifest). |
| src/app/layout.tsx | Removes Next.js root layout, analytics, and font loader usage. |
| src/app/api/og/route.tsx | Removes Next.js OG image route implementation. |
| public/robots.txt | Adds static robots.txt for the Vite/TanStack app. |
| public/og.png | Adds OpenGraph image asset (PNG). |
| public/manifest.webmanifest | Adds static PWA manifest file. |
| public/favicon.ico | Adds static favicon asset. |
| playwright.config.ts | Adds Playwright config with preview server and baseURL including GitHub Pages base path. |
| package.json | Switches scripts to Vite; adds TanStack + testing deps; sets ESM module type. |
| next.config.ts | Removes Next.js config file. |
| improve.md | Removes legacy improvement checklist tied to Next.js scaffold. |
| e2e/smoke.spec.ts | Adds Playwright smoke test for initial page load and key UI elements. |
| components.json | Updates shadcn/ui config to non-RSC and new CSS entry path. |
| biome.json | Updates ignored paths (TanStack output/gen, large assets, test artifacts) and adds file override. |
| README.md | Updates project docs for new stack, scripts, and GitHub Pages deployment. |
| AGENTS.md | Adds repo contribution guide for tooling, conventions, and commands. |
| .gitignore | Updates ignores for TanStack/Vite outputs and Playwright artifacts; folds tools Python ignores into root. |
| .github/workflows/test.yml | Adds path-filtered CI jobs for app (lint/test/build) and tools (uv + unittest). |
| .github/workflows/deploy.yml | Adds GitHub Pages deployment workflow driven by successful test workflow runs. |
| .gitconfig | Trims/adjusts whitespace in merge driver config entry. |
| .gitattributes | Adds merge driver rule for tools/courses.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { property: "og:title", content: "AZQUERYSUCKS" }, | ||
| { property: "og:description", content: "so I made one" }, | ||
| { property: "og:site_name", content: "AZQUERYSUCKS" }, | ||
| { property: "og:image", content: `${BASE_URL}og.svg` }, | ||
| ], |
There was a problem hiding this comment.
og:image points to ${BASE_URL}og.svg, but there is no public/og.svg in the repo (only public/og.png). Update the reference (or add the missing asset) so OpenGraph previews don’t break.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| - uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: "pnpm" | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm build |
There was a problem hiding this comment.
Deploy workflow pins pnpm v9 while the test/build workflow uses pnpm v10. Align the pnpm version across workflows to avoid subtle install/lockfile behavior differences between CI and deploy.
| queryFn: async () => { | ||
| const res = await fetch(COURSES_URL); |
There was a problem hiding this comment.
React Query can pass an AbortSignal to the queryFn so in-flight fetches are cancelled on unmount/refetch. Consider accepting the query function context and forwarding signal to fetch to avoid unnecessary network work.
| queryFn: async () => { | |
| const res = await fetch(COURSES_URL); | |
| queryFn: async ({ signal }) => { | |
| const res = await fetch(COURSES_URL, { signal }); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@cantpr09ram I've opened a new pull request, #15, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Testing