mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
The existing Next.js app (99 pages, 427 next/* imports, 177 files using
next/router, 154 using nextjs-routes types, 105 using getServerSideProps) is
far too coupled to rewrite in one pass. A full migration is ~2–4 weeks of
mechanical work.
This commit adds the scaffold only:
vite/package.json — Vite 8 + React 19.2 + wouter, no Next deps
vite/vite.config.ts — aliases at ../lib, ../ui, ../configs, … so source
migrates file-by-file instead of moving
vite/tsconfig.json — mirrors the aliases for TypeScript
vite/index.html — security headers as <meta> (was nextjs/headers.js)
vite/src/main.tsx — React 19 root bootstrap
vite/src/env.ts — runtime envs: window.__envs first, import.meta.env
fallback, maps NEXT_PUBLIC_API_HOST → VITE_API_BASE_URL
vite/src/redirects.ts — full port of nextjs/redirects.js (69 client rules)
vite/src/App.tsx — wouter router with CatchAll redirect resolver
vite/Dockerfile — 2-stage → ghcr.io/hanzoai/spa
vite/LLM.md — what's done, what's left, how to finish
The production Dockerfile at ../Dockerfile still builds the Next.js app. This
scaffold is independent; nothing in the existing tree is deleted or moved.
See vite/LLM.md for the full migration plan and 9 critical TODOs before this
can replace the Next.js build.
20 lines
643 B
Docker
20 lines
643 B
Docker
# WIP Vite 8 SPA build — see vite/LLM.md for migration plan.
|
|
# The production image (../Dockerfile) still builds the Next.js app; this
|
|
# Dockerfile will replace it once the SPA rewrite is complete.
|
|
|
|
FROM node:22-alpine AS build
|
|
RUN corepack enable
|
|
WORKDIR /app
|
|
|
|
# Copy the whole repo because the vite/ project aliases resolve into
|
|
# ../configs, ../lib, ../ui, etc. (see vite.config.ts). Once migration
|
|
# finalizes these paths will live inside vite/src and the context can shrink.
|
|
COPY . .
|
|
|
|
WORKDIR /app/vite
|
|
RUN pnpm install --frozen-lockfile || pnpm install
|
|
RUN pnpm build
|
|
|
|
FROM ghcr.io/hanzoai/spa
|
|
COPY --from=build /app/vite/dist /public
|