docs(showcase): demonstrate format named-format + conditional otherwise#1496
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #1485 — enriches the
app-showcaseAccount validation examples so each enforced rule type shows more than one shape (nice-to-have, example-only).format— named format: adds abilling_emailfield (plainField.text, notField.email) with aformat: 'email'rule, so the rule itself enforces validity. Complements the existing regex (tax_id) example and exercises theemail/url/phone/jsonnamed-format branch.conditional—otherwise: the churn rule (churn_reason_consistency) gains anotherwisebranch: a churned account needs a reason; a non-churned account must not carry a stale one. Theotherwiseconditionhas()-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 && test→ 20 tests pass (the two new behaviors are checked against the realevaluateValidationRules).Touches only the private
@objectstack/example-showcasepackage (empty changeset; no release).🤖 Generated with Claude Code