Production readiness
brandapp-ui는 copy-paste source라서 코드 테스트뿐 아니라 registry, consumer app contract, 문서 route까지 같이 닫아야 합니다.
reopt design업데이트
1. 릴리즈 게이트
| Gate | 필수 증거 | 잡는 리스크 |
|---|---|---|
| Registry | surface file, _meta.ts, registry.json, tests가 같은 변경에 포함됩니다. | opt surface add에서 누락되거나 오래된 dependency/props 설명이 배포됩니다. |
| Auth states | pending, signed-out, signed-in, sign-out failure, OAuth failure가 테스트됩니다. | 헤더가 비어 보이거나 OAuth 실패가 조용히 삼켜집니다. |
| Secret boundary | client bundle에 clientSecret, createReoptSDK, server-only SDK가 들어가지 않습니다. | BrandApp client secret 노출, 브라우저에서 SDK 호출 실패 |
| Build-safe server clients | createReoptSDK/createBrandappProvider는 route module scope가 아니라 lazy getter 안에서 초기화됩니다. | next build/static evaluation에서 env 누락 crash 또는 secret boundary 혼선 |
| Surface ownership | 복사 후 consumer app에서 copy, fallback, loading, endpoint를 수정할 지점이 명확합니다. | runtime package처럼 착각해 제품별 정책을 반영하지 못합니다. |
| Browser docs | docs와 explore route가 desktop/mobile에서 200, no console warning/error로 열립니다. | 문서 nav, pager, sitemap, quick link가 깨집니다. |
2. Auth state matrix
인증 Surface는 happy path만 보면 부족합니다. copy-paste 후 소비자 앱의 API helper와 auth-client 구현이 다를 수 있으므로 상태 전이를 명시해서 테스트합니다.
SignInWithReoptButton
idle, pending, classified error, retry/help action
ReoptUserMenu
session pending, signed-out, signed-in, sign-out pending/error
SignInGate
pending, loud signed-out, quiet signed-out, signed-in
SessionExpiredDialog
truthy to falsy session transition, 401 event, forceReauth true/false
3. Package와 registry
Surface를 수정했다면 brandapp-ui 테스트만으로 끝내지 않습니다. opt-cli registry를 재생성하고 registry 테스트까지 함께 돌립니다.
bun run --filter @reopt-ai/brandapp-ui typecheck
bun run --filter @reopt-ai/brandapp-ui test
bun run --filter @reopt-ai/brandapp-ui lint
bun run --filter @reopt-ai/opt-cli build:registry
bun run --filter @reopt-ai/opt-cli test4. 문서와 SEO
새 문서 route는 staticDocPages, 사이드바, pager, sitemap 검증에 걸려야 합니다. 문서 보강 PR에서는 아래 테스트를 기본으로 둡니다.
bun run --filter @reopt/web typecheck
bun run --filter @reopt/web test -- 'app/[locale]/docs/__tests__' lib/seo.test.ts5. 브라우저 smoke
docs route와 explore hub를 함께 확인합니다. explore route는 실제 Surface preview와 source snippets를 노출하므로, 문서 링크가 맞는지 확인하는 smoke target입니다.
bun run --filter @reopt/web dev
http://localhost:5001/docs/brandapp-ui
http://localhost:5001/docs/brandapp-ui/start
http://localhost:5001/docs/brandapp-ui/surfaces
http://localhost:5001/docs/brandapp-ui/server-contracts
http://localhost:5001/explore/brandapp-ui