Skip to content

Migrate to Vite+ toolchain and upgrade shadcn/ui to Base UI - #5

Merged
mythz merged 4 commits into
mainfrom
voidzero
Oct 31, 2026
Merged

mythz merged 4 commits into
mainfrom
voidzero

Conversation

@mythz

@mythz mythz commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Moves the MyApp.Client tooling to Vite+ and upgrades shadcn/ui from Radix UI to Base UI. Both follow the react-spa and next-static templates.

Vite+ toolchain

Next.js still runs the dev server and production build (next dev / next build). Vite+ (vp) replaces the rest of the tooling:

  • Lint and type check: Oxlint, configured to match the old ESLint rules, with type-aware checks that replace tsc
  • Format: Oxfmt
  • Test: Vitest 5

All of it is configured in vite.config.ts, which replaces vitest.config.ts.

  • vite-plus is a pinned devDependency, so users don't need the global vp CLI. npm scripts stay the entry points: check, lint, typecheck, fmt, test, test:run, test:ui, outdated, upgrade
  • Updated to TypeScript 7 and @vitejs/plugin-react 6
  • package-lock.json replaces npm-shrinkwrap.json
  • Removed postinstall.mjs: the .NET app now creates empty databases at startup
  • Fixed or suppressed new lint findings (rules-of-hooks naming in lib/auth.tsx and lib/gateway.ts). Added starter tests for HelloApi and intro.tsx
  • The Oxfmt reformat is its own commit (f031f77), listed in .git-blame-ignore-revs
  • CI: build.yml adds a client job (check, test, build). build-container.yml uses voidzero-dev/setup-vp
  • Added MyApp.code-workspace so the Oxc extension's linting and format-on-save work in VS Code
  • Docs: AGENTS.md / README.md updated, including that dtos.ts is regenerated when the .NET app starts

shadcn/ui on Base UI (base-vega)

  • Regenerated all components with shadcn 4.23 (base-vega style, rsc: true) and removed every @radix-ui/* package. Added dialog, dropdown-menu, empty, field, input, label, separator, sheet, skeleton, spinner, table and tooltip
  • cn package replaces clsx + tailwind-merge. tw-animate-css and shadcn/tailwind.css provide the animations and Base UI's data-* variants
  • Theme uses the current shadcn format (oklch tokens in :root / .dark, with @theme inline). The old @theme dark { } block wasn't valid Tailwind v4, so dark-mode shadcn colors never applied
  • Added TooltipProvider in app/providers.tsx and components/data-table.tsx (TanStack Table)
  • The /shadcn-ui page is react-spa's showcase, ported to Next.js. It uses the live Hello API, shows CreateTodo validation errors in Field/FieldError, and renders GetWeatherForecast in a DataTable with a row menu that opens a Sheet. A server component lists the installed components at build time

Visible changes: the shadcn primary color in dark mode is now slate instead of blue, and every element now defaults to the border-border color.

Verification

  • npm ci, npm run check (0 errors), npm run test:run (9/9), npm run build, dotnet build
  • With dotnet watch running, /shadcn-ui and its APIs respond. I haven't reviewed the page in a browser.

🤖 Generated with Claude Code

mythz and others added 4 commits November 1, 2026 01:35
Next.js keeps building the app (next dev/build/start unchanged). Vite+
(vite-plus 1.4.0) takes over the rest of the tooling: Vitest 5, Oxlint
(type-aware, via tsgolint) and Oxfmt, configured in one vite.config.ts.
npm scripts stay the entry points, so no global `vp` install is required.

- vite-plus pinned with npm overrides for vite -> @voidzero-dev/vite-plus-core
- vitest.config.ts merged into vite.config.ts; tests import from vite-plus/test
- new check/lint/fmt/outdated/upgrade scripts; typecheck runs `vp check --no-fmt --no-lint`
- lint: eslint:recommended + typescript-eslint recommended equivalents, plus
  react hooks and nextjs rules (the template had no ESLint before)
- fix lint findings: unused imports/vars, `extends {}`, ValidateAuth hook
  naming/order in lib/auth.tsx; suppress useMetadata, swrClient.get() and
  appAuth() false positives without changing the shared APIs
- remove postinstall.mjs (empty DBs are migrated on app startup), autoprefixer
- replace npm-shrinkwrap.json with package-lock.json
- drop tsconfig baseUrl (removed in TypeScript Go)
- add seed tests (gateway, HelloApi component)
- upgrade deps, incl. TypeScript 7, @vitejs/plugin-react 6, Next.js 16.4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- build.yml: new client job (vp check, vp test run, npm run build)
- build-container.yml: voidzero-dev/setup-vp replaces setup-node + npm install
- AGENTS.md / README.md: Vite+ commands; dtos.ts is regenerated on .NET
  startup, so `npm run dtos` is typically never needed
- MyApp.code-workspace: adds MyApp.Client as its own root so the Oxc
  extension resolves the local vite-plus; TypeScript 7 language server
- .git-blame-ignore-revs: ignore the Oxfmt formatting commit

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

Ports react-spa's shadcn/ui upgrade to the Next.js template.

Components
- Regenerate all components with shadcn 4.23 in the base-vega style on
  Base UI (@base-ui/react). Radix UI is removed entirely.
- Add dialog, dropdown-menu, empty, field, input, label, separator,
  sheet, skeleton, spinner, table and tooltip
- Generated with rsc: true, so client components keep 'use client'.
  They are otherwise identical to react-spa's
- Use shadcn's `cn` package (replaces clsx + tailwind-merge);
  lib/utils re-exports it
- Add components.json: base-vega style, slate base color, Tailwind v4
  (no JS config)

Theme
- Use the current shadcn theme format: oklch tokens in :root/.dark,
  mapped with @theme inline. The old `@theme dark { }` block isn't valid
  Tailwind v4, so dark mode shadcn colors never applied
- tw-animate-css and shadcn/tailwind.css add animations and Base UI's
  data-* variants. Remove the unused Radix accordion keyframes
- @variant dark -> @custom-variant dark

Integration
- TooltipProvider in app/providers.tsx
- Add components/data-table.tsx (TanStack Table + shadcn Table)

/shadcn-ui page
- Port react-spa's showcase: live Hello API, CreateTodo validation
  errors in Field/FieldError, and GetWeatherForecast in DataTable with a
  row DropdownMenu that opens a Sheet, plus overlays, theming swatches,
  tabs and accordion
- page.tsx is a server component that lists components/ui at build time
  (no import.meta.glob in Next.js) and renders the client shadcn-ui.tsx
@mythz
mythz merged commit ea829a5 into main Oct 31, 2026
4 checks passed
@mythz
mythz deleted the voidzero branch October 31, 2026 17:56
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