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, notField.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

vercelBot commented Jun 1, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specErrorErrorJun 1, 2026 9:19pm

Request Review

@vercel

vercelBot commented Jun 1, 2026

Copy link
Copy Markdown

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 mainJun 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/steststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang