ui

package
v1.49.54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 2 Imported by: 0

README

commerce/ui

dist/ is the embedded Commerce admin — build output, not tracked content. Only .gitkeep is committed, so //go:embed all:dist resolves on a fresh clone.

The one way to produce it

cd app && pnpm turbo run typecheck build --filter=@hanzo/commerce-dashboard
scripts/sync-admin-ui.sh          # app/admin/out -> ui/dist
go build ./cmd/commerced

Dockerfile runs exactly those three steps (admin-build stage → sync → go build), so the shipped binary's admin is always this commit's admin.

Served at /admin/*, and built for it: app/admin/next.config.ts sets basePath: '/admin'. Move the mount and you must move BASE_PATH (app/admin/src/lib/basepath.ts) — the export and the mount are one contract.

Documentation

Overview

Package ui exposes THE Commerce admin export as an embedded filesystem.

There is one Commerce admin: app/admin (@hanzo/commerce-dashboard, Next.js `output: export`, built on @hanzo/ui + @hanzo/gui — the same component set the cloud console renders). scripts/sync-admin-ui.sh copies app/admin/out into ui/dist, which is baked into the commerced binary at compile time — no external static-assets directory, no sidecar, no separate deploy.

dist/ is BUILD OUTPUT, not tracked content: gitignored but for .gitkeep, and produced by Dockerfile's admin-build stage before `go build`. It was committed until now, and a committed bundle is a bundle nobody rebuilds — the binary shipped a retired Vite SPA for as long as that was true.

Mounted at /admin/* (commerce.go), and the export is BUILT for that path: next.config.ts sets `basePath: '/admin'`, so chunk URLs are /admin/_next/* and the client router resolves routes under the same prefix. An export built for "/" cannot be served from a sub-path at all — its root-absolute /_next/* escapes the mount and its router 404s on its own pathname.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the embedded built-UI filesystem rooted at dist/. Empty when scripts/sync-admin-ui.sh has not been run.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL