mirror of
https://github.com/hanzoai/sites.git
synced 2026-10-30 18:22:43 +00:00
This repo was a stale consumer: `@hanzo/ui` was already on 8.x while `@hanzo/gui` and every `@hanzogui/*` were still 7.3.0 — a combination `@hanzo/ui@8` does not support (it peers `>=8.0.0` on all three). Onto the real latest, checked against the registry rather than assumed: @hanzo/gui 7.3.0 → 8.0.1 (the package formerly `hanzogui`) @hanzogui/config 7.3.0 → 8.0.1 @hanzogui/lucide-icons-2 7.3.0 → 8.0.1 @hanzogui/next-theme 7.3.0 → 8.0.0 @hanzo/ui 8.0.26 → 8.0.39 @hanzo/data 1.2.1 → 1.2.2 @hanzo/iam 0.13.8 → 0.21.6 Two things the upgrade exposed, both real: `react-native-svg` becomes a DIRECT dependency. Every lucide glyph imports it and `@hanzo/ui/product` draws with it, but `@hanzogui/lucide-icons-2@8` declares it neither as a dependency nor as a peer — it arrived transitively under 7.3.0 and vanished with it, taking the build down. The webpack rule that puts `.web.*` first was already written for exactly this package, so the dependency is now stated where it is actually used. `@hanzo/ui/theme.css` was never imported. Its components name `--border` and `--radius`, and nothing else in the app defines them — gui's runtime injection supplies the colour SCALE (`--color12`, `--background`), the token sheet supplies the semantic tokens. Missing, they resolved to nothing and those surfaces painted transparent while every request still returned 200. It now leads `app/layout.tsx`, and `globals.css` drops the font-family rules it was duplicating: the token sheet owns families and colour, this app only fetches the face and resets the document. `<html>` gains `dark` beside `t_dark` — two vocabularies for one state, and only `t_dark` was set. NextThemeProvider adds `dark` after hydration, so the first frame resolved the light token set. Verified in a browser, not by status code: `e2e/tokens.spec.ts` asserts the tokens actually resolve, the shell paints dark, four brand marks render, nothing throws, and neither viewport scrolls sideways at 390px. It needs no backend, which is the point — it catches the failure `shots.spec.ts` cannot see. No Tailwind, no shadcn, no Radix: none were present, and none are now — confirmed absent from the installed tree, not just from package.json. Also: `typecheck` moves to `tsgo` (TypeScript 7 native) — 2.0s against tsc's 14.2s on this tree. `next build` keeps its own tsc pass; that step is Next's and is the only one that sees the route types it generates mid-build, so forcing tsgo there would have traded real coverage for a few seconds. Dead code out: `dev:cloud` invoked `dev/stack.mjs`, which does not exist; `e2e` and `audit` replace it with scripts for the two suites that do. `page.tsx` imported from 'react' twice. `@hanzo/logo` was a direct dependency nothing imported. Co-authored-by: Hanzo Dev <[email protected]>
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
'use client'
|
|
|
|
/**
|
|
* The ONE route. Four hosts, three depths, one file:
|
|
*
|
|
* / the module's collections
|
|
* /:doctype that collection's records
|
|
* /:doctype/:name one record (`new` opens the create form)
|
|
*
|
|
* The site comes from the hostname, so it is resolved in the browser — which is
|
|
* also why the server render is identical for all four hosts and one build ships
|
|
* everywhere.
|
|
*/
|
|
import { use, useEffect, useState } from 'react'
|
|
|
|
import { currentConfig } from '../../src/config'
|
|
import { Site, SiteChooser } from '../../src/Site'
|
|
|
|
export default function Page({ params }: { params: Promise<{ path?: string[] }> }) {
|
|
const { path } = use(params)
|
|
// The host is a browser fact. Render nothing on the server rather than a
|
|
// guessed site that would flash the wrong product.
|
|
const [host, setHost] = useState<string | null>(null)
|
|
useEffect(() => setHost(window.location.host), [])
|
|
if (!host) return null
|
|
|
|
const cfg = currentConfig()
|
|
if (!cfg.site) return <SiteChooser brand={cfg.brand} brandName={cfg.brandName} />
|
|
return <Site site={cfg.site} brand={cfg.brand} brandName={cfg.brandName} path={path} />
|
|
}
|