Repository navigation
refactor(web_core): resolve catalog definitions before building Zod - #50
Draft
louis-bompart wants to merge 1 commit into
Draft
louis-bompart wants to merge 1 commit into
louis-bompart wants to merge 1 commit into
Conversation
Moves catalog reference resolution out of the schema loader into catalog_references.ts, and resolves each entry's definition (its references, mixins, allOf members and closure rules) in catalog_definitions.ts before the loader builds a Zod schema from it. A catalog's references resolve against its own document and common_types.json only, as upstream reverted cross-catalog peers. Regroups #27 and #28. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
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.
Description
The catalog loader resolved references while it built Zod schemas, so the two concerns were mixed in one file. This PR resolves an entry's definition first, without Zod, and builds the Zod schema from the result. It changes no public API.
catalog_references.ts: JSON Pointer traversal andresolveDefinition(), which resolves the references an entry reaches and bundles every local definition it reaches underdefs, keeping its references named. A reference resolves against the catalog's own document andcommon_types.jsononly.catalog_definitions.ts:resolveComponentDefinition,resolveFunctionArgumentsDefinitionandresolveThemeDefinitionreturn an object definition as ordered pieces (common types or own properties), with its required names, omitted envelope fields and closure.schema_loader.tsconverts those definitions to Zod 3 and keeps upstream's v1.0 reference checks (assertSupportedV10Refs).Validation
yarn buildintypescript/core/web_core, thennode --test "dist/**/*.test.js": 1367 tests, 0 failing.node tests/conformance/conformance_test.mjs: every vector passes.yarn lintintypescript/core/web_core: 0 errors.yarn buildandyarn testintypescript/catalogs/mcp,typescript/catalogs/vegachart,typescript/renderers/markdown-it,typescript/renderers/lit,typescript/renderers/reactandtypescript/agents/a2ui_agent: all pass.yarn buildintypescript/renderers/angular,tools/composer,tools/editorandtools/inspector. The Angular tests were not run: the local Java is too old for the Closure Compiler step.Regroups #27 and #28.
Part of a2ui-project#2160.
🤖 Generated with Claude Code