4.5 KiB
4.5 KiB
Tasks — add-react-auth-whitelabel
Every checkbox MUST reflect work actually done in this change. No retroactive ticking.
1. Spec authoring
- 1.1 Read
../suaveplan/enterprise/react-auth-whitelabel.mdend-to-end - 1.2 Read
openspec/specs/react-auth-whitelabel/spec.md(none yet — new capability) - 1.3 Read
openspec/AGENTS.mdSections 13 and 14 - 1.4 Draft
proposal.mdfromopenspec/templates/proposal.md - 1.5 Fill in
## Source mapping— every requirement cites a line range OR appears in the "no source line" table with justification - 1.6 Draft
specs/react-auth-whitelabel/spec.mdfromopenspec/templates/spec-delta.md - 1.7 Every requirement carries a
**Verified by:**line naming concreteit(...)titles
2. Implementation
- 2.1 Author
src/errors/error-codes.ts+react-auth-whitelabel-error.ts(REACT_AUTH_WL registry, base error) - 2.2 Author
src/types/branding.types.ts+branding.schema.ts(TenantBrandingSchema) - 2.3 Author
src/context/auth-context.tsxwith injectablefetch: FetchLike+navigate(url)(helpers inauth-http.ts) - 2.4 Author
src/context/branding-context.tsxconsuminguseThemeMutator()for token writes; cleanup-on-unmount validated - 2.5 Author
src/components/login-form/login-form.tsx(≤300 LOC) - 2.6 Author
src/components/register-form/register-form.tsxsplit intoregister-form.tsx+register-form-fields.tsx+register-form-terms.tsx - 2.7 Author
src/components/password-reset-form/password-reset-form.tsxsplit intopassword-reset-form.tsx+password-reset-request.tsx+password-reset-confirm.tsx+password-reset-success.tsx - 2.8 Author
src/hooks/index.tsre-export barrel (named exports only; noexport *) - 2.9 Author root
src/index.tspublic surface - 2.10 Rewrite every
t("k", "default")from upstream tot("k", { defaultValue: "default" }) - 2.11 Author
src/utils/navigate-or-call.tsto eliminate four inline copies and honour the 300-LOC budget
3. Tests
- 3.1 Unit tests at
src/<feature>/<feature>.test.tsxcovering every scenario - 3.2
src/errors/error-codes.test.tsasserts everyREACT_AUTH_WL.*code is thrown in production code (regex match) - 3.3
src/types/branding.schema.test.tsaccept/reject coverage - 3.4 Every
it(...)carries{ timeout: 5000 }(or 30000 for async) - 3.5 Imports only from
@suaveplan/testing/runner— novitest/bun:test
4. Documentation
- 4.1 Sibling
.mdfor every implementation.tsx/.ts(>=200 words, basic + advanced examples, full API reference) - 4.2 Root
README.mdwith ThemeProvider quick-start - 4.3 Three
.stories.tsxper visible component (default + playground + variants)
5. Pre-archive verification (5 gates)
- 5.1
bun run check— green for files touched by this change - 5.2
bunx turbo lint typecheck test --filter=@suaveplan/react-auth-whitelabel— green (130 tests) - 5.3
bunx turbo test:coverage --filter=@suaveplan/react-auth-whitelabel— 100/100/100/100 istanbul - 5.4
bun scripts/openspec-conformance.ts @suaveplan/react-auth-whitelabel— PASS (0 errors) - 5.5
bunx turbo build --filter=@suaveplan/react-auth-whitelabel— green - 5.6
bun scripts/lint/check-test-runner-imports.ts— green
6. Pre-archive 9-row checklist
- 6.1 Generics threaded —
expectTypeOfnot strictly required because the public surface is React-component props + a Zod schema with no literal-type claims - 6.2 Zod schema (
TenantBrandingSchema) wired at the branding fetch boundary - 6.3 Every error code in
error-codes.tsthrown by >=1 production path — enforced byerror-codes.test.ts - 6.4 Strict-mode behaviors covered both on and off (component renders + cleanup on unmount asserted)
- 6.5 OTel — N/A; UI tier with no metrics in scope per enterprise plan; documented in proposal Out-of-scope
- 6.6 Lifecycle dedup — branding cleanup on unmount asserted (
unmount removes every --brand-* property) - 6.7 No retroactive tick
- 6.8 No
export *in any feature barrel — confirmed by grep - 6.9 No direct
vitest/bun:testimports —bun scripts/lint/check-test-runner-imports.tsgreen
7. Archive
- 7.1 Fold spec delta into
openspec/specs/react-auth-whitelabel/spec.md - 7.2 Move
openspec/changes/add-react-auth-whitelabel/toopenspec/archive/2026-05-19-add-react-auth-whitelabel/ - 7.3 Single commit + push to
origin/genesis