Repository navigation
feat(form): compose schemas and vocabulary across chained extensions - #31
Open
abhinavkdeval08-design wants to merge 1 commit into
Conversation
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.
Part 2 of #16, follows #29. This is the PR that actually calls
resolveExtensionChain.What changed
extractConditionFormsnow takes one extension or an array, plus an optionalregistry. It resolvesspec.dependenciesbase-first and mergeskinds,interfaceTypes,interfaceFields,conditionFieldsandfieldValuesacross the chain.ExtensionSchemaItemcan omitappliesToKind/appliesToInterfaceTypefor a shared schema (e.g.configuration-shapeinenv-configuration). If the owning extension hasconditionFieldsentries for a property, it is only added to the scopes they apply to, soapi/webhookdoesn't getconfiguration. If there are no entries for it, it goes everywhere.(kind, interfaceType)are merged into one form. Scoped refinements (like narrowingpropertyto an enum) are pushed intooneOfvariants, and patterns,requiredflags and basevalueDescriptionsare kept.ExtractedConditionFormgetsappliedExtensionIdsandschemaIds.schemaIdstays.Things to know
(kind, interfaceType)instead of one per schema item.extensionIdon a form is the extension that first introduced that target (the base), not the additive one.appliedExtensionIdslists everything that contributed.oneOf, variants are paired by index, so they need the same order. Extra incoming variants are kept. An incoming child that matches no variant is dropped. Fine for the current catalog, but worth revisiting.ExtensionDependency.versionis still not checked. Catalog IDs already contain the version, so matching byidpins it for now. Range handling should come with the catalog loader.extractConditionFormsorspec.dependencies.Testing
5 new tests in
src/form/form.test.ts: env-configuration on common-integrations (array and registry, scope isolation, enum refinement, fieldValues), additive docs precedence, extraoneOfvariants,schemaIdfallback for a form with no fields, and a missing dependency error. CI passes for root andbackend/.npm cihung on my Windows machine, so I relied on CI for the full run.Drafted with AI assistance. I reviewed the changes, and CI passes...