pkg/utila has a rollup config issue + isn't in app/bridge's dep graph.
pkg/bridge ships from src/ (no dist), Vite reads its TS directly.
Drop both from the pre-build chain — threshold + core are the only
workspace deps that need to be compiled for Vite to resolve exports.
@luxfi/threshold (and likely @luxfi/{core,utila,bridge}) declare exports
pointing to dist/ which is produced by tsc — pnpm install doesn't run
the build automatically. Build the workspace deps before running the
Vite-driven app/bridge build so its module resolver finds the dist.
- Convert app/bridge/ from Next.js 14 app-router to Vite 8 SPA.
- New entry: index.html → src/main.tsx → src/App.tsx (wouter router).
- src/pages/{HomePage,AuthPage,CampaignsPage,CampaignDetailPage,SalonPage,
SwapPage,TeleporterSwapPage,UtilaSwapPage,TransactionsPage,NotFoundPage}.tsx.
- src/shims/next-{link,image,navigation,dynamic,headers,server,font/google,mdx}
+ sentry-nextjs map Next.js APIs onto wouter + plain DOM so existing
components compile unchanged. Aliased in vite.config.ts.
- Dockerfile (root + app/bridge): FROM node:22-alpine AS build → vite build →
FROM ghcr.io/hanzoai/spa COPY dist /public.
- Delete app-router dir, next.config.js, next-env.d.ts, middleware.ts,
sentry.*.ts. Keep app/explorer/ and docs/ untouched (still Next.js).
Tenant route resolution:
src/app/api/tenant/route.ts was a 17-line edge handler that called
lib/tenant.fetchTenant(). fetchTenant() only reads env vars and fetches a
public IAM /api/get-organization endpoint. No secrets. Moved to client:
lib/tenant.ts now reads import.meta.env.VITE_* and is called directly from
main.tsx + TenantProvider. No sidecar needed.
TODO:
- `pnpm install` in CI to pick up wouter, vite, @vitejs/plugin-react,
@sentry/browser (added to package.json).
- Pre-existing viem/teleport tsc errors remain (ignored as before via esbuild).
- Storybook config still references @storybook/nextjs — rewire to
@storybook/react-vite separately.
Next.js requires NEXT_PUBLIC_* env vars at build time for SSR pages.
These defaults match the production API endpoints and can be overridden
via --build-arg.
pnpm workspace creates linked node_modules for each package.
Copying only root node_modules loses the workspace package links,
causing 'next: not found' during build. Copy entire /app from deps
to preserve the full pnpm link structure.
pnpm needs git to resolve ethereumjs-abi which is referenced as a
git URL dependency. Without git installed, pnpm install fails with
ENOENT: spawn git.