Files
ui/pkg/vite/vitest.config.ts
zeekayandGitHub daf0c30ae6 vite: render a static site from app/; og: draw without next (#303)
@hanzo/vite 0.1.5 adds site(): the App Router's file conventions
(layouts, groups, dynamic and rest segments, generateStaticParams,
metadata, not-found, route.ts GET, opengraph-image, robots, sitemap)
rendered as React Server Components through @vitejs/plugin-rsc and
written as HTML to out/.  Pages import @hanzo/vite/link, /navigation,
/dynamic and /metadata in place of next/*.  mdx() reads posts with front
matter, gfm, [#id] heading ids and a toc export.

The head is resolved by the App Router's rules and written in its order;
a key it does not render throws.  Measured on hanzo.blog: 712 pages with
identical text, head tags and <html lang dir> against its Next export.

@hanzo/og 1.0.1 draws with satori 0.12.2, the layout its images were
drawn against, and loads resvg from its own install at run time, since a
bundler cannot carry a native addon.  It no longer peers on next.

The lockfile is regenerated over the whole workspace: main's predated
@hanzo/commerce 7.9.1.

Claude-Session: https://claude.ai/code/session_015XYKLnoSseGhXKoeBiFtQF
2026-11-08 23:45:03 -08:00

11 lines
553 B
TypeScript

import { defineConfig } from "vitest/config"
// A package whose `test` script is `vitest run` needs its OWN config. Without
// one vitest walks up to the root workspace file and resolves its relative
// entries against THIS directory, so it looks for a config here, does not find
// it, and fails at startup before a single test runs — which reads as a broken
// suite rather than a missing file. Pure config folding: node, no DOM.
export default defineConfig({
test: { environment: "node", include: ["src/**/*.test.ts", "src/**/*.test.tsx"] },
})