mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
Match the layout convention used elsewhere in the Hanzo / Liquidity stack
(pkgs/* for libraries, apps/* for consumer apps, templates/* for starters).
Layout changes:
pkgs/ ← code/{compiler,core,packages,ui,ui-admin}/
apps/ ← code/{admin-base,admin-tasks,demos,gui.hanzo.ai,
kitchen-sink*,sandbox,tests}/
templates/ ← code/starters/* (flattened — no more starters/ subdir)
Updated:
- package.json workspaces glob.
- All scripts/* path references (postinstall, format, repair, release,
sync-gui-versions, ci-serve, check-references, etc).
- ../../tasks/scripts/sync-admin-ui.sh — DEFAULT_SRC now points at
../gui/apps/admin-tasks (and scrubbed Tamagui mentions in comments).
- ~/work/hanzo/HANZO_BINARY.md doctrine doc.
- ~/work/hanzo/ui/pkg/ui/BASES.md framework-bases doc.
- gui CLAUDE.md, CONTRIBUTING.md.
- Memory entries.
Side-effect fix: ui-admin/src/primitives/index.ts now re-exports
PageShell from ../shell/PageShell. Several IAM identity pages
(GroupEdit, OrgEdit, GroupTree, UserEdit, RoleEdit) imported PageShell
from ./primitives — pre-existing barrel mismatch the test suite missed
because the smoke tests don't full-render. The rename surfaced it via
production build; back-compat re-export keeps both barrels working.
Verification:
- bun install: clean.
- ui-admin tests: 127/127 green.
- admin-tasks vite build: 721 KB JS / 213 KB gzip + 10 KB CSS, clean.
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
const mode = process.env.TEST_MODE || 'dev' // 'dev' | 'prod' | 'both'
|
|
|
|
// use fixed ports to avoid race conditions with playwright workers
|
|
const devPort = process.env.DEV_PORT || '8085'
|
|
const prodPort = process.env.PROD_PORT || '8086'
|
|
|
|
const devProject = {
|
|
name: 'dev',
|
|
use: { ...devices['Desktop Chrome'], baseURL: `http://localhost:${devPort}` },
|
|
}
|
|
|
|
const prodProject = {
|
|
name: 'prod',
|
|
use: { ...devices['Desktop Chrome'], baseURL: `http://localhost:${prodPort}` },
|
|
}
|
|
|
|
const projects =
|
|
mode === 'both'
|
|
? [devProject, prodProject]
|
|
: mode === 'prod'
|
|
? [prodProject]
|
|
: [devProject]
|
|
|
|
const webServers: any[] = []
|
|
|
|
if (mode === 'dev' || mode === 'both') {
|
|
webServers.push({
|
|
command: `bun run dev --port ${devPort} --clean`,
|
|
url: `http://localhost:${devPort}`,
|
|
reuseExistingServer: true,
|
|
timeout: 120000,
|
|
})
|
|
}
|
|
|
|
if (mode === 'prod' || mode === 'both') {
|
|
webServers.push({
|
|
command: `bun run build:web && bun run serve --port ${prodPort} --clean`,
|
|
url: `http://localhost:${prodPort}`,
|
|
reuseExistingServer: true,
|
|
timeout: 180000,
|
|
})
|
|
}
|
|
|
|
export default defineConfig({
|
|
testDir: './tests',
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
// One's dev SSR server can leak route state across concurrent requests in this app.
|
|
// Keep sandbox browser tests single-worker so hydration assertions stay deterministic.
|
|
workers: 1,
|
|
reporter: [['html', { outputFolder: '.playwright-report' }]],
|
|
outputDir: '.playwright-results',
|
|
timeout: 30000, // 30s per test for debugging
|
|
use: {
|
|
trace: 'on-first-retry',
|
|
},
|
|
projects,
|
|
webServer: webServers.length === 1 ? webServers[0] : webServers,
|
|
})
|