Skip to content

feat(web_core): write the v0.8 basic catalog in Zod 4 - #38

Closed
louis-bompart wants to merge 1 commit into
claude/zod-scope/basic-v09-zod4from
claude/zod-scope/basic-v08-zod4
Closed

louis-bompart wants to merge 1 commit into
claude/zod-scope/basic-v09-zod4from
claude/zod-scope/basic-v08-zod4

Conversation

@louis-bompart

Copy link
Copy Markdown
Collaborator

Description

This PR moves the v0.8 basic catalog to Zod 4, stacked on #37. Its document, validationSchema and accepted payloads are unchanged.

src/v0_8/scripts/generate-catalog.mjs now generates:

  • each component as a z.strictObject annotated with .meta(specMeta(...)), instead of a Zod 3 .strict() object wrapped in spec();
  • the styles theme (ThemeSchema) the same way.

v0.8 has no common types and no catalog mixins, so nothing else needed to change.

Breaking, per the changelog: the v0.8 basic catalog's schemas are Zod 4.

Next: the exported common types and authoring helpers, spec(), exclusiveUnion and fromZod3, and then removing Zod 3.

Validation

  • yarn build from clean, with the generator rerun (stable output)
  • node --test "dist/**/*.test.js": 1453 passing, 0 failing, 42 todo (the known cases)
  • node tests/conformance/conformance_test.mjs: all vectors passing
  • yarn lint: 0 errors, same warning count
  • yarn format:check
  • yarn test in typescript/catalogs/{mcp,vegachart}, typescript/renderers/{lit,react,markdown-it} and typescript/agents/a2ui_agent. Angular builds and passes test:unit (328) and test:integration (222); test:closure-compiler needs Java 21.
  • Compared before and after:
    • the toJson() and validationSchema of every code catalog: byte for byte identical;
    • the binding views of every loaded catalog document (5,625 results): identical;
    • validation of 10,695 payloads against every catalog document and the code basic catalogs, now including v0.8: no outcome, message or parsed value changed.

Part of a2ui-project#2160

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file.
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

🤖 Generated with Claude Code

The v0.8 catalog generator writes strict Zod 4 objects annotated with
specMeta() instead of Zod 3 objects annotated with spec(). The catalog's
document, validation schema and accepted payloads are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@louis-bompart

Copy link
Copy Markdown
Collaborator Author

Superseded by the regrouped stack on upstream main: this change is now part of #53 (series #45 to #54). The branch is kept for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant