Skip to content

docs(showcase): demonstrate format named-format + conditional otherwise#1496

Merged
xuyushun441-sys merged 2 commits into
mainfrom
feat/showcase-validation-examples
Jun 1, 2026
Merged

docs(showcase): demonstrate format named-format + conditional otherwise#1496
xuyushun441-sys merged 2 commits into
mainfrom
feat/showcase-validation-examples

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1485 — enriches the app-showcase Account validation examples so each enforced rule type shows more than one shape (nice-to-have, example-only).

  • format — named format: adds a billing_email field (plain Field.text, not Field.email) with a format: 'email' rule, so the rule itself enforces validity. Complements the existing regex (tax_id) example and exercises the email/url/phone/json named-format branch.
  • conditionalotherwise: the churn rule (churn_reason_consistency) gains an otherwise branch: a churned account needs a reason; a non-churned account must not carry a stale one. The otherwise condition has()-guards the absent case, so ordinary non-churned writes are untouched (no interference with the other focused examples/tests).

Verification

pnpm --filter @objectstack/example-showcase typecheck && test20 tests pass (the two new behaviors are checked against the real evaluateValidationRules).

Touches only the private @objectstack/example-showcase package (empty changeset; no release).

🤖 Generated with Claude Code

Enriches the app-showcase Account validation examples so each enforced rule
type shows more than one shape:

- `format`: adds a *named* `email` format on a new plain-text `billing_email`
  field (deliberately not Field.email, so the rule itself enforces validity) —
  complements the existing regex example.
- `conditional`: the churn rule gains an `otherwise` branch — a churned account
  needs a reason; a non-churned one must not carry a stale one. The otherwise
  `has()`-guards the absent case so ordinary writes are untouched.

Both verified in test/validation.test.ts against the real evaluator (20 pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Error Error Jun 1, 2026 9:19pm

Request Review

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: spec.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@xuyushun441-sys xuyushun441-sys merged commit 3321b0a into main Jun 1, 2026
10 of 11 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/showcase-validation-examples branch June 2, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants