Skip to content

fix(showcase): align fixtures with tightened spec schemas#1897

Merged
os-zhuang merged 1 commit into
mainfrom
fix/showcase-spec-typecheck-drift
Jun 15, 2026
Merged

fix(showcase): align fixtures with tightened spec schemas#1897
os-zhuang merged 1 commit into
mainfrom
fix/showcase-spec-typecheck-drift

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

The app-showcase example's pnpm typecheck had silently drifted out of sync with several spec schema tightenings. CI does not typecheck examples/**, so this went unnoticed on main. 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 the amount formula are now backed by ExpressionInputSchema, whose authored type is the post-transform Expression object. Bare strings no longer typecheck. Switched to the P (predicate) and cel tagged-template helpers — the same convention already used in project.object.ts.
  • project-detail.page.tsrecord-type pages now require template; added template: 'default'.
  • project-workspace.page.ts — pages now require isDefault; added isDefault: false.
  • reports/index.tsReport.drilldown is z.boolean().default(true), so the inferred (output) type makes it required at author time; added drilldown: true to the three top-level reports.

Note

The underlying friction is that several Field.*()/Report author-time types are derived from z.infer (output) rather than z.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 to z.input for nicer DX.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 15, 2026 7:32am

Request Review

@os-zhuang
os-zhuang merged commit eaeb290 into main Jun 15, 2026
13 checks passed
@os-zhuang
os-zhuang deleted the fix/showcase-spec-typecheck-drift branch June 15, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant