fix(showcase): align fixtures with tightened spec schemas#1897
Merged
Conversation
The showcase typecheck drifted out of sync with spec schema tightenings (field-liveness audit + page/report required props): - invoice.object.ts: author conditional-rule predicates and the amount formula with the `P`/`cel` tagged-template helpers (the convention already used in project.object.ts) instead of bare strings, which now type as the post-transform Expression object. - project-detail.page.ts: add required `template`. - project-workspace.page.ts: add required `isDefault`. - reports/index.ts: add required `drilldown` on the three reports. `pnpm verify` (typecheck + 20 tests) green. CI does not typecheck examples, so this drift was silent on main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
The
app-showcaseexample'spnpm typecheckhad silently drifted out of sync with several spec schema tightenings. CI does not typecheckexamples/**, so this went unnoticed onmain. Fixes 14 type errors across 4 files;pnpm verify(typecheck + 20 tests) is now green.Why each change
invoice.object.ts— conditional-rule fields (requiredWhen/readonlyWhen/visibleWhen) and theamountformula are now backed byExpressionInputSchema, whose authored type is the post-transformExpressionobject. Bare strings no longer typecheck. Switched to theP(predicate) andceltagged-template helpers — the same convention already used inproject.object.ts.project-detail.page.ts—record-type pages now requiretemplate; addedtemplate: 'default'.project-workspace.page.ts— pages now requireisDefault; addedisDefault: false.reports/index.ts—Report.drilldownisz.boolean().default(true), so the inferred (output) type makes it required at author time; addeddrilldown: trueto the three top-level reports.Note
The underlying friction is that several
Field.*()/Reportauthor-time types are derived fromz.infer(output) rather thanz.input, so.default()/transform fields read as required even though the runtime accepts the looser input. This PR matches the existing in-repo convention rather than changing those shared spec types; a follow-up could widen the author types toz.inputfor nicer DX.🤖 Generated with Claude Code