mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-20 20:07:34 +00:00
The package was never published under EITHER name — `npm view @hanzo/gitops` and `@hanzo/cd` both returned E404 — so `pkg/ui/src/gitops.ts` (`export * from '@hanzo/gitops'`) and the `>=0.1.0` peer dep pointed at nothing and broke every clean install of @hanzo/ui. Publishing exposed a second break one level down: @hanzo/gitops peers on @hanzo/canvas >=0.2.0, and the registry still had canvas at 0.1.0 while the monorepo was on 0.2.1. Publishing the first package alone only moved the ETARGET deeper. Both are now on the registry, and a clean `npm install @hanzo/[email protected]` resolves — 673 packages, no errors. pkgs/gitops -> pkgs/cd and @hanzo/gitops -> @hanzo/cd: the surface is the CD surface (cd.hanzo.ai, apps/cd), and the old name only ever described the mechanism. Every reference in the monorepo moved with it; the old name is deprecated on npm pointing here rather than left as a second way to install the same code. Co-authored-by: Hanzo Dev <[email protected]>
4.4 KiB
4.4 KiB
Hanzo CD — the dedicated deploy dashboard (cd.hanzo.ai)
A focused, mobile-first CD dashboard served at cd.hanzo.ai. It replaces the
ArgoCD React fork (~/work/hanzo/deploy/ui, webpack/argo-cd-ui) with the shared
Hanzo component packages over the native cloud CD plane. Its whole job: see every
service deployed as an operator App CR — stats · sync · health · resource tree ·
logs · sync/rollback.
Stack + why
- Vite + React 19 static SPA →
dist/(a static bundle, no runtime server). @hanzo/cd(workspace) is the ArgoCD-replacement UI — a clean-room, framework-free port (plain React + scoped CSS, no Tamagui/Tailwind). We mountGitopsAppList(the fleet), and composeGitopsSyncPanel+GitopsAppTree+GitopsNodeInfo+GitopsRollbackDialogfor the app detail (lazy per-node/resource+/logsfetch).@hanzo/canvas/pure(workspace) for the pure helpers.- The workspace packages are resolved by Vite path alias (
vite.config.ts), so the app builds off@hanzo/cd/dist+@hanzo/canvas/srcwithout a full monorepo install (the shared pnpm store lacks the registry deps of the heavier packages). Runpnpm --filter @hanzo/cd buildonce if itsdistis stale.
Backend + auth (the contract this preserves)
- API = the cloud binary at
/v1/deploy(SuperAdmin-gated, clean paths —applications,:name/tree,:name/resource/:ref,:name/logs,sync,rollback). The cd.hanzo.ai ingress peels/v1/deploy/*off tocloud:8000; the SPA calls it same-origin withcredentials: 'include'. - Auth = the
admin-consolePKCE gate (public/login.html, ported verbatim from the ArgoCD fork — self-contained, proven):hanzo.id→ sets the non-httpOnlyhanzo_iam_tokencookie the cloud binary validates (SanitizeIdentity→c.IsAdmin()). The SPA reads that cookie for its gate; a missing/expired session (or an API 401/403) lands on the sign-in screen — never a fabricated row. src/lib/adapt.tsmaps the/v1/deployDTOs INTO the shared@hanzo/cdview-models (reusing the package's ownfoldHealth/foldSync). Note: the cloud wire uses the hyphenatedout-of-sync, whichfoldSync(whitespace-only strip) reads as Unknown — the adapter strips[-_]before folding.
Build + serve
pnpm --filter cd build # tsc -b && vite build → dist/ (index.html + login.html + CNAME + assets)
pnpm --filter cd preview # serve dist locally
pnpm --filter cd dev # vite dev (proxies /v1 → CD_API, default https://cd.hanzo.ai)
Serving: the built dist/ is a static bundle published to s3://cdn/cd — the
existing static plane cd.hanzo.ai already serves (ingress staticFiles +
spaMode, zero pods; see universe/infra/k8s/operator/crs/static-sites.yaml). No
ingress or backend change: publish the bundle, retire the old ArgoCD ui/ + the
deploy/dashboard.go embed.
Verify
tsc --noEmit -p tsconfig.app.json— clean.npx vitest run src/lib/adapt.test.ts— the/v1/deploy→@hanzo/cdmapping (incl. theout-of-syncfold fix,parentRefstree linking, clean-semver rollback).npx playwright test— builds + serves + proves the fleet renders, a row opens the ArgoCD-grade detail (sync panel + resource topology), and no horizontal body scroll at 390px. Screenshots ine2e-shots/.
Follow-ons (registry-install / routing gated — flagged, not fabricated)
@hanzo/canvasfleet MAP (the Railway board) needs@hanzo/gui(Tamagui), which is an external npm dep not in the offline store here — so the map is a registry-install follow-on. It already ships green in the console (hanzoai/consolefeat/cd-canvas-map); lifting it in is an import once@hanzo/guiinstalls.@hanzo/ui-shadcnshared shell (HanzoHeader+ org/project switcher + ⌘K) needs a full monorepo install (its Tailwind deps aren't in the offline store). This app ships a lean self-contained topbar (Geist, small mark, env scope) in the interim; swap to the shared shell once installed. The org/project↔IAM switcher additionally needs/v1/iamrouted on cd.hanzo.ai (today the SuperAdmin cookie sees the whole fleet; env is the scope control).- Rollback targets come from the app's
revisions(forward-compat — the plane doesn't expose prior tags yet; empty → the dialog's honest "no history"). Cloud re-validates the clean semver.